@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.
@@ -0,0 +1,1868 @@
1
+ import { NgTemplateOutlet } from '@angular/common';
2
+ import * as i0 from '@angular/core';
3
+ import { InjectionToken, makeEnvironmentProviders, SkipSelf, Optional, inject, computed, linkedSignal, TemplateRef, Directive, input, booleanAttribute, output, DestroyRef, contentChild, effect, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
4
+ import { CngxLiveRegion, CngxRovingTabindex, CngxRovingItem } from '@cngx/common/a11y';
5
+ import * as i1 from '@cngx/common/data';
6
+ import { CngxPaginate, connectPaginateResetOn, CNGX_BUCKET_PAGINATE_HOST } from '@cngx/common/data';
7
+ import { CngxProgress } from '@cngx/ui/feedback';
8
+ import { CngxIcon } from '@cngx/common/display';
9
+ import { CngxRipple, CngxListbox, CngxListboxTrigger, CngxOption } from '@cngx/common/interactive';
10
+ import { CngxPopover, CngxPopoverTrigger } from '@cngx/common/popover';
11
+ import { CngxInfiniteScroll } from '@cngx/common/layout';
12
+
13
+ /** Library defaults - English. Override via {@link provideCngxPaginatorConfig}. */
14
+ const CNGX_PAGINATOR_DEFAULTS = {
15
+ ariaLabels: {
16
+ label: 'Pagination',
17
+ first: 'First page',
18
+ previous: 'Previous page',
19
+ next: 'Next page',
20
+ last: 'Last page',
21
+ page: (page) => `Page ${page}`,
22
+ morePages: 'More pages',
23
+ itemsPerPage: 'Items per page',
24
+ goToPage: 'Go to page',
25
+ pageOfPages: 'Select page',
26
+ loadMore: 'Load more',
27
+ allLoaded: (total) => `All ${total} loaded`,
28
+ bucket: (label) => label,
29
+ emptyBucket: (label) => `${label}, no items`,
30
+ bucketGroup: 'Categories',
31
+ railPosition: 'Page position',
32
+ },
33
+ announcements: {
34
+ pageChange: (page, totalPages) => `Page ${page} of ${totalPages}`,
35
+ loading: 'Loading',
36
+ updated: 'Updated',
37
+ },
38
+ formats: {
39
+ // The readout segments render the formatter output as sanitised HTML, so the
40
+ // current value (the page, or the item range) is emphasised with `<b>`;
41
+ // Angular's sanitiser keeps `<b>` and strips anything dangerous.
42
+ range: (start, end, total) => `<b>${start}-${end}</b> of ${total}`,
43
+ pageStatus: (page, totalPages) => `Page <b>${page}</b> of ${totalPages}`,
44
+ },
45
+ };
46
+ /**
47
+ * Configuration cascade token. Resolution priority (high to low):
48
+ * per-instance Input, then `provideCngxPaginatorConfig(...)` at the
49
+ * application root, then the library defaults.
50
+ *
51
+ * @category ui/paginator
52
+ */
53
+ const CNGX_PAGINATOR_CONFIG = new InjectionToken('CngxPaginatorConfig', {
54
+ providedIn: 'root',
55
+ factory: () => CNGX_PAGINATOR_DEFAULTS,
56
+ });
57
+ /** Reduce a feature list onto a base config, merging each sub-tree in isolation. */
58
+ function applyFeatures(base, features) {
59
+ let ariaLabels = base.ariaLabels;
60
+ let announcements = base.announcements;
61
+ let formats = base.formats;
62
+ let templates = base.templates;
63
+ for (const feature of features) {
64
+ if (feature.kind === 'ariaLabels') {
65
+ ariaLabels = { ...ariaLabels, ...feature.payload };
66
+ }
67
+ else if (feature.kind === 'announcements') {
68
+ announcements = { ...announcements, ...feature.payload };
69
+ }
70
+ else if (feature.kind === 'formats') {
71
+ formats = { ...formats, ...feature.payload };
72
+ }
73
+ else {
74
+ templates = { ...templates, ...feature.payload };
75
+ }
76
+ }
77
+ return { ariaLabels, announcements, formats, templates };
78
+ }
79
+ /**
80
+ * Override any subset of the paginator accessible-name strings. Per-instance
81
+ * `aria-label` bindings still win over the cascade for the landmark name.
82
+ *
83
+ * ```ts
84
+ * provideCngxPaginatorConfig(
85
+ * withPaginatorAriaLabels({ next: 'Nächste Seite', previous: 'Vorige Seite' }),
86
+ * );
87
+ * ```
88
+ *
89
+ * @category ui/paginator
90
+ */
91
+ function withPaginatorAriaLabels(payload) {
92
+ return { kind: 'ariaLabels', payload };
93
+ }
94
+ /**
95
+ * Override any subset of the paginator live-region announcement phrasing.
96
+ *
97
+ * ```ts
98
+ * provideCngxPaginatorConfig(
99
+ * withPaginatorAnnouncements({
100
+ * pageChange: (page, total) => `Seite ${page} von ${total}`,
101
+ * loading: 'Wird geladen',
102
+ * updated: 'Aktualisiert',
103
+ * }),
104
+ * );
105
+ * ```
106
+ *
107
+ * @category ui/paginator
108
+ */
109
+ function withPaginatorAnnouncements(payload) {
110
+ return { kind: 'announcements', payload };
111
+ }
112
+ /**
113
+ * Override the range-readout format. The `cngx-pgn-range` segment renders the
114
+ * returned string verbatim, so this also localises the `of` connector.
115
+ *
116
+ * ```ts
117
+ * provideCngxPaginatorConfig(
118
+ * withPaginatorRangeFormat((start, end, total) => `${start}-${end} von ${total}`),
119
+ * );
120
+ * ```
121
+ *
122
+ * @category ui/paginator
123
+ */
124
+ function withPaginatorRangeFormat(range) {
125
+ return { kind: 'formats', payload: { range } };
126
+ }
127
+ /**
128
+ * Override the page-status format. The `cngx-pgn-status` segment renders the
129
+ * returned string verbatim, so this localises the "Page n of m" readout that
130
+ * the responsive collapse reveals.
131
+ *
132
+ * ```ts
133
+ * provideCngxPaginatorConfig(
134
+ * withPaginatorPageStatusFormat((page, totalPages) => `Seite ${page} von ${totalPages}`),
135
+ * );
136
+ * ```
137
+ *
138
+ * @category ui/paginator
139
+ */
140
+ function withPaginatorPageStatusFormat(pageStatus) {
141
+ return { kind: 'formats', payload: { pageStatus } };
142
+ }
143
+ /**
144
+ * Supply application-wide template-slot defaults for the paginator. The
145
+ * per-instance `*cngxPaginatorLoading` slot still wins over this tier; it only
146
+ * applies where no instance slot is projected.
147
+ *
148
+ * ```ts
149
+ * provideCngxPaginatorConfig(
150
+ * withPaginatorTemplates({ loading: myBrandedSpinnerTemplate }),
151
+ * );
152
+ * ```
153
+ *
154
+ * @category ui/paginator
155
+ */
156
+ function withPaginatorTemplates(payload) {
157
+ return { kind: 'templates', payload };
158
+ }
159
+ /**
160
+ * Application-root configuration cascade for the paginator. Pass any
161
+ * combination of `with*` features in `bootstrapApplication`'s providers.
162
+ * Supplied features deep-merge with the library defaults, so consumers only
163
+ * declare the keys they want to override.
164
+ *
165
+ * @category ui/paginator
166
+ */
167
+ function provideCngxPaginatorConfig(...features) {
168
+ // Empty-features: leave the root default reference untouched so downstream
169
+ // identity comparisons stay stable.
170
+ if (features.length === 0) {
171
+ return makeEnvironmentProviders([]);
172
+ }
173
+ return makeEnvironmentProviders([
174
+ { provide: CNGX_PAGINATOR_CONFIG, useValue: applyFeatures(CNGX_PAGINATOR_DEFAULTS, features) },
175
+ ]);
176
+ }
177
+ /**
178
+ * Component-scoped paginator configuration override. Pass into a component's
179
+ * or directive's `viewProviders`; features merge on top of the parent config
180
+ * (an enclosing scope or the application root), so a region can re-phrase its
181
+ * announcements or labels without disturbing the rest of the app.
182
+ *
183
+ * @category ui/paginator
184
+ */
185
+ function provideCngxPaginatorConfigAt(...features) {
186
+ return [
187
+ {
188
+ provide: CNGX_PAGINATOR_CONFIG,
189
+ useFactory: (parent) => applyFeatures(parent ?? CNGX_PAGINATOR_DEFAULTS, features),
190
+ deps: [[new SkipSelf(), new Optional(), CNGX_PAGINATOR_CONFIG]],
191
+ },
192
+ ];
193
+ }
194
+ /**
195
+ * Convenience accessor for the paginator configuration. Runs in injection
196
+ * context; resolves through the cascade. Equivalent to
197
+ * `inject(CNGX_PAGINATOR_CONFIG)`.
198
+ *
199
+ * @category ui/paginator
200
+ */
201
+ function injectPaginatorConfig() {
202
+ return inject(CNGX_PAGINATOR_CONFIG);
203
+ }
204
+
205
+ /**
206
+ * DI token the `CngxPaginator` shell provides via `useExisting`. Segment
207
+ * parts (`cngx-pgn-prev`, `cngx-pgn-pages`, ...) inject this rather than the
208
+ * concrete component class, keeping the organism decompose-ready.
209
+ *
210
+ * @category ui/paginator
211
+ * @wcag AA
212
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/paginator/paginator-host.token.ts
213
+ * @since 0.1.0
214
+ */
215
+ const CNGX_PAGINATOR_HOST = new InjectionToken('CngxPaginatorHost');
216
+
217
+ /**
218
+ * Builds the paginator live-region message as a single derived signal - no
219
+ * class logic baked into the shell, so the skin still ejects cleanly. The
220
+ * message is a `linkedSignal` over `[pageIndex, totalPages, isBusy]` from
221
+ * {@link CNGX_PAGINATOR_HOST}: it speaks "Page N of M" on every effective-page
222
+ * change (navigation OR a `total`-shrink clamp, so the clamp is never silent),
223
+ * "Loading" while busy, and "Updated" on the first settle after busy. Phrasing
224
+ * comes from {@link injectPaginatorConfig}.
225
+ *
226
+ * The previous source value (held by `linkedSignal`) is what distinguishes a
227
+ * settle from a steady state, so there is no signal write in an `effect` and no
228
+ * imperative `previous` tracking. Identical consecutive messages dedupe through
229
+ * the signal's value equality, so the live region never re-announces a no-op.
230
+ *
231
+ * Must run in an injection context (call as a field initialiser on the shell).
232
+ *
233
+ * @category ui/paginator
234
+ */
235
+ function createPaginatorAnnouncer() {
236
+ const host = inject(CNGX_PAGINATOR_HOST);
237
+ const config = injectPaginatorConfig();
238
+ // Sample the three drivers together so a transition is atomic. The field-wise
239
+ // `equal` keeps the source reference stable across a recompute that yields an
240
+ // identical tuple, so the linkedSignal computation never re-runs on a no-op
241
+ // (equality rule: an object-returning computed carries an explicit equal).
242
+ const source = computed(() => ({
243
+ page: host.pageIndex(),
244
+ totalPages: host.totalPages(),
245
+ busy: host.isBusy(),
246
+ }), { ...(ngDevMode ? { debugName: "source" } : /* istanbul ignore next */ {}), equal: (a, b) => a.page === b.page && a.totalPages === b.totalPages && a.busy === b.busy });
247
+ const message = linkedSignal({ ...(ngDevMode ? { debugName: "message" } : /* istanbul ignore next */ {}), source,
248
+ computation: (current, previous) => {
249
+ const { announcements } = config;
250
+ if (current.busy) {
251
+ return announcements.loading;
252
+ }
253
+ // Just left a busy state: announce the settle once, before page phrasing.
254
+ if (previous?.source.busy) {
255
+ return announcements.updated;
256
+ }
257
+ return announcements.pageChange(current.page + 1, current.totalPages);
258
+ } });
259
+ return { message };
260
+ }
261
+ /**
262
+ * Swap token for the live-region announcer derivation. The default resolves to
263
+ * {@link createPaginatorAnnouncer}; the shell builds its announcer via
264
+ * `inject(CNGX_PAGINATOR_ANNOUNCER_FACTORY)()` rather than calling the factory
265
+ * directly. Override it to wrap the busy / settle / page-change derivation - a
266
+ * telemetry tap, politeness escalation, or custom phrasing branch - without
267
+ * forking the shell (mirrors `CNGX_COMMIT_ERROR_ANNOUNCER_FACTORY` in the
268
+ * select family). The override runs in the shell's injection context, so it can
269
+ * still `inject(CNGX_PAGINATOR_HOST)` / {@link injectPaginatorConfig}.
270
+ *
271
+ * @category ui/paginator
272
+ */
273
+ const CNGX_PAGINATOR_ANNOUNCER_FACTORY = new InjectionToken('CngxPaginatorAnnouncerFactory', {
274
+ providedIn: 'root',
275
+ factory: () => createPaginatorAnnouncer,
276
+ });
277
+
278
+ /**
279
+ * Overrides the paginator's built-in busy indicator. Project a structural
280
+ * `*cngxPaginatorLoading` template inside `<cngx-paginator>` and the shell
281
+ * renders it - instead of the default `<cngx-progress>` bar - while the bound
282
+ * async state is busy. Resolution cascades instance slot ->
283
+ * `CngxPaginatorConfig.templates.loading` -> built-in `CngxProgress`.
284
+ *
285
+ * ```html
286
+ * <cngx-paginator [state]="state">
287
+ * <ng-template cngxPaginatorLoading>
288
+ * <my-branded-spinner />
289
+ * </ng-template>
290
+ * <cngx-pgn-pages />
291
+ * </cngx-paginator>
292
+ * ```
293
+ *
294
+ * @category ui/paginator
295
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/paginator/paginator-loading.directive.ts
296
+ * @since 0.1.0
297
+ * @relatedTo CngxPaginator, CngxProgress
298
+ */
299
+ class CngxPaginatorLoading {
300
+ templateRef = inject(TemplateRef);
301
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorLoading, deps: [], target: i0.ɵɵFactoryTarget.Directive });
302
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorLoading, isStandalone: true, selector: "[cngxPaginatorLoading]", exportAs: ["cngxPaginatorLoading"], ngImport: i0 });
303
+ }
304
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorLoading, decorators: [{
305
+ type: Directive,
306
+ args: [{ selector: '[cngxPaginatorLoading]', standalone: true, exportAs: 'cngxPaginatorLoading' }]
307
+ }] });
308
+
309
+ /**
310
+ * Declarative, skinnable pagination organism. A thin shell over the
311
+ * `CngxPaginate` brain (applied as a `hostDirective`), assembled by the
312
+ * consumer from projected segment parts in DOM order - no `show*` config
313
+ * inputs. `skin` / `density` are single paint attributes reflected onto
314
+ * `[data-skin]` / `[data-density]`.
315
+ *
316
+ * Two-way `[(pageIndex)]` / `[(pageSize)]`: the brain's controlled inputs are
317
+ * aliased through `hostDirectives` (`cngxPageIndex` -> `pageIndex`,
318
+ * `cngxPageSize` -> `pageSize`); the shell owns the matching
319
+ * `pageIndexChange` / `pageSizeChange` outputs and is their single emitter,
320
+ * guarded by the shared `lastEmitted*` fields. Two paths feed each output once:
321
+ * (1) a subscription forwards the brain's nav-only `pageChange` /
322
+ * `pageSizeChange` - the only signal that captures a controlled-mode `setPage`,
323
+ * because the brain's `pageIndex()` stays pinned to the input until the
324
+ * consumer feeds it back; (2) an `effect()` reads the effective
325
+ * `pageIndex()` / `pageSize()` and covers a `total`-shrink clamp the nav-only
326
+ * output misses. The brain output is forwarded, NOT aliased through
327
+ * `hostDirectives`: a raw alias would bypass the shared guard and double-emit
328
+ * on uncontrolled navigation. The guard makes every distinct value emit exactly
329
+ * once across both paths and both modes, so the clamp echoes back to controlled
330
+ * consumers (and, from Phase E, is announced) without a double-fire.
331
+ *
332
+ * All ARIA attributes are signal-driven. `aria-busy` has a single owner here.
333
+ *
334
+ * @category ui/paginator
335
+ * @docsKind primary
336
+ * @wcag AA
337
+ * @github https://github.com/cngxjs/cngx/blob/main/projects/ui/paginator/paginator.component.ts
338
+ * @since 0.1.0
339
+ * @relatedTo CngxPaginate, CngxMatPaginator
340
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
341
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
342
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
343
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
344
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
345
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/infinite</example-url>
346
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/load-more</example-url>
347
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
348
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
349
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
350
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
351
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
352
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
353
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/dots</example-url>
354
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
355
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
356
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
357
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
358
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
359
+ */
360
+ class CngxPaginator {
361
+ /** Accessible name for the navigation landmark. Overrides the config default. */
362
+ ariaLabel = input(undefined, { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
363
+ /** Visual skin; reflected onto `[data-skin]`. */
364
+ skin = input('numbered', ...(ngDevMode ? [{ debugName: "skin" }] : /* istanbul ignore next */ []));
365
+ /** Density preset; reflected onto `[data-density]`. */
366
+ density = input('default', ...(ngDevMode ? [{ debugName: "density" }] : /* istanbul ignore next */ []));
367
+ /**
368
+ * Opt into the responsive collapse; reflected onto `[data-responsive]`. When
369
+ * set, a `@container` rule swaps the projected `cngx-pgn-pages` number row for
370
+ * a `cngx-pgn-status` "Page n of m" readout once the paginator's own container
371
+ * narrows past the collapse breakpoint. Compose both segments for it to apply.
372
+ */
373
+ responsive = input(false, { ...(ngDevMode ? { debugName: "responsive" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
374
+ /**
375
+ * Reset key. When its value changes (after the initial render) the paginator
376
+ * jumps to the first page - bind the sort / filter / search value a result set
377
+ * depends on so a narrowed result never strands the user on a now-empty page.
378
+ * Bind a primitive or a `computed`; an inline array / object literal
379
+ * recomputes every change-detection pass and would reset on each. Shares the
380
+ * `connectPaginateResetOn` implementation with `[cngxPaginateResetOn]`.
381
+ */
382
+ resetOn = input(undefined, ...(ngDevMode ? [{ debugName: "resetOn" }] : /* istanbul ignore next */ []));
383
+ /** Emits the effective page index on every change - navigation or `total`-shrink clamp. */
384
+ pageIndexChange = output();
385
+ /** Emits the effective page size on every change. */
386
+ pageSizeChange = output();
387
+ paginate = inject(CngxPaginate);
388
+ config = injectPaginatorConfig();
389
+ destroyRef = inject(DestroyRef);
390
+ /**
391
+ * Live-region message source - mounted onto the `cngxLiveRegion` span in the
392
+ * template. Built through the swap token so a consumer can wrap the
393
+ * busy / settle / page-change derivation without forking the shell.
394
+ */
395
+ announcer = inject(CNGX_PAGINATOR_ANNOUNCER_FACTORY)();
396
+ resolvedAriaLabel = computed(() => this.ariaLabel() ?? this.config.ariaLabels.label, ...(ngDevMode ? [{ debugName: "resolvedAriaLabel" }] : /* istanbul ignore next */ []));
397
+ // Loading-slot cascade: instance *cngxPaginatorLoading -> config default ->
398
+ // built-in <cngx-progress>. Direct contentChild field initialiser (AOT
399
+ // NG8110 rejects it from a helper). Returns existing TemplateRef references
400
+ // or null - reference-stable, so no explicit equal fn is needed.
401
+ loadingSlot = contentChild(CngxPaginatorLoading, { ...(ngDevMode ? { debugName: "loadingSlot" } : /* istanbul ignore next */ {}), read: TemplateRef });
402
+ loadingTemplate = computed(() => this.loadingSlot() ?? this.config.templates?.loading ?? null, ...(ngDevMode ? [{ debugName: "loadingTemplate" }] : /* istanbul ignore next */ []));
403
+ // Shared last-emitted guards across the nav (subscription) and clamp (effect)
404
+ // paths. Plain non-signal fields, so the effects carry no signal write.
405
+ // Seeded with the current effective values so mounting emits no initial change.
406
+ lastEmittedIndex = this.paginate.pageIndex();
407
+ lastEmittedSize = this.paginate.pageSize();
408
+ constructor() {
409
+ // Reset-on-change, shared verbatim with the bridge input and the generic
410
+ // [cngxPaginateResetOn] directive.
411
+ connectPaginateResetOn(this.paginate, this.resetOn);
412
+ // Nav path. Forward the brain's nav-only outputs: in controlled mode a
413
+ // setPage leaves the effective pageIndex() pinned to the input, so this
414
+ // event is the only thing that reports the navigation. Forwarded (not
415
+ // aliased) so the guard is shared with the clamp effect below.
416
+ const indexSub = this.paginate.pageChange.subscribe((index) => {
417
+ if (index !== this.lastEmittedIndex) {
418
+ this.lastEmittedIndex = index;
419
+ this.pageIndexChange.emit(index);
420
+ }
421
+ });
422
+ const sizeSub = this.paginate.pageSizeChange.subscribe((size) => {
423
+ if (size !== this.lastEmittedSize) {
424
+ this.lastEmittedSize = size;
425
+ this.pageSizeChange.emit(size);
426
+ }
427
+ });
428
+ this.destroyRef.onDestroy(() => {
429
+ indexSub.unsubscribe();
430
+ sizeSub.unsubscribe();
431
+ });
432
+ // Clamp path. The effective pageIndex moved without a nav (a total-shrink
433
+ // clamp the nav-only pageChange misses). The shared guard means a value the
434
+ // nav path already emitted is a no-op here, so each change emits once.
435
+ effect(() => {
436
+ const index = this.paginate.pageIndex();
437
+ if (index !== this.lastEmittedIndex) {
438
+ this.lastEmittedIndex = index;
439
+ this.pageIndexChange.emit(index);
440
+ }
441
+ });
442
+ effect(() => {
443
+ const size = this.paginate.pageSize();
444
+ if (size !== this.lastEmittedSize) {
445
+ this.lastEmittedSize = size;
446
+ this.pageSizeChange.emit(size);
447
+ }
448
+ });
449
+ }
450
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginator, deps: [], target: i0.ɵɵFactoryTarget.Component });
451
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginator, isStandalone: true, selector: "cngx-paginator", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, skin: { classPropertyName: "skin", publicName: "skin", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, responsive: { classPropertyName: "responsive", publicName: "responsive", isSignal: true, isRequired: false, transformFunction: null }, resetOn: { classPropertyName: "resetOn", publicName: "resetOn", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndexChange: "pageIndexChange", pageSizeChange: "pageSizeChange" }, host: { attributes: { "role": "navigation" }, properties: { "attr.aria-label": "resolvedAriaLabel()", "attr.aria-busy": "paginate.isBusy()", "attr.data-skin": "skin()", "attr.data-density": "density()", "attr.data-responsive": "responsive() ? '' : null" }, classAttribute: "cngx-paginator" }, providers: [{ provide: CNGX_PAGINATOR_HOST, useExisting: CngxPaginate }], queries: [{ propertyName: "loadingSlot", first: true, predicate: CngxPaginatorLoading, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxPaginator"], hostDirectives: [{ directive: i1.CngxPaginate, inputs: ["cngxPageIndex", "pageIndex", "cngxPageSize", "pageSize", "total", "total", "state", "state"] }], ngImport: i0, template: "@if (paginate.isBusy()) {\n @if (loadingTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-progress\n class=\"cngx-paginator__progress\"\n variant=\"linear\"\n [state]=\"paginate.state()\"\n [label]=\"config.announcements.loading\"\n />\n }\n}\n\n<ng-content />\n\n<span cngxLiveRegion class=\"cngx-paginator__sr\">{{ announcer.message() }}</span>\n", styles: ["@layer cngx.components{.cngx-paginator{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:var(--cngx-paginator-row-gap, .75rem);font-family:var( --cngx-paginator-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif );font-size:var(--cngx-paginator-font-size, .875rem)}.cngx-paginator__progress{position:absolute;inset-inline:0;inset-block-start:0;block-size:var(--cngx-paginator-progress-thickness, 2px)}.cngx-paginator__segment{display:inline-flex;align-items:center}.cngx-paginator__nav-label,.cngx-paginator__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}.cngx-paginator__pages{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-gap, .25rem)}.cngx-paginator__button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:var(--cngx-paginator-button-size, 2.25rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-button-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-button-border-color, transparent);border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__button:hover{background:var( --cngx-paginator-button-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__button:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__button[aria-disabled=true],.cngx-paginator__button:disabled{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__page[aria-current=page]{background:var( --cngx-paginator-current-bg, color-mix(in oklch, currentColor 12%, transparent) );color:var(--cngx-paginator-current-color, currentColor);border-color:var(--cngx-paginator-current-border-color, transparent);font-weight:600}.cngx-paginator__range,.cngx-paginator__status{font-variant-numeric:tabular-nums;color:var(--cngx-paginator-range-color, currentColor);white-space:nowrap}.cngx-paginator__load-more{gap:var(--cngx-paginator-load-more-gap, .5rem);white-space:nowrap}.cngx-paginator__load-more-count{font-variant-numeric:tabular-nums;color:var( --cngx-paginator-load-more-count-color, color-mix(in oklch, currentColor 60%, transparent) )}.cngx-paginator__goto-input{box-sizing:border-box;width:var(--cngx-paginator-goto-width, 3.5rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-goto-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-goto-border-color, color-mix(in oklch, currentColor 25%, transparent));border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;font-variant-numeric:tabular-nums}.cngx-paginator__goto-input:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__select{gap:var(--cngx-paginator-select-gap, .25rem);font-variant-numeric:tabular-nums}.cngx-paginator__select-caret{display:inline-flex;font-size:var(--cngx-paginator-caret-size, 1em);line-height:1;opacity:var(--cngx-paginator-caret-opacity, .55)}.cngx-paginator__select-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__option{display:flex;align-items:center;min-height:var(--cngx-paginator-option-size, 2rem);padding:var(--cngx-paginator-option-padding, 0 .75rem);border-radius:var(--cngx-paginator-option-radius, .25rem);cursor:pointer;font-variant-numeric:tabular-nums}.cngx-paginator__overflow-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;display:grid;grid-template-columns:repeat(var(--cngx-paginator-overflow-columns, 5),var(--cngx-paginator-overflow-cell-size, 2rem));gap:var(--cngx-paginator-overflow-gap, .15rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__overflow-panel .cngx-paginator__option{justify-content:center;min-block-size:var(--cngx-paginator-overflow-cell-size, 2rem);padding:var(--cngx-paginator-overflow-cell-padding, 0)}.cngx-paginator__overflow-panel:focus,.cngx-paginator__overflow-panel:focus-visible{outline:none}[popover]:has(>.cngx-paginator__select-panel),[popover]:has(>.cngx-paginator__overflow-panel){margin:0;padding:0;border:0;background:none}.cngx-paginator__option.cngx-option--highlighted,.cngx-paginator__option.cngx-menu-item--highlighted{background:var( --cngx-paginator-option-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__option.cngx-option--selected{background:var( --cngx-paginator-option-selected-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 14%, transparent) );color:var(--cngx-paginator-option-selected-color, var(--cngx-color-primary, oklch(.66 .19 50)));font-weight:600}.cngx-paginator[data-density=compact]{--cngx-paginator-button-size: 1.75rem;--cngx-paginator-gap: .125rem;font-size:var(--cngx-paginator-font-size-compact, .8125rem)}.cngx-paginator[data-density=comfortable]{--cngx-paginator-button-size: 2.75rem;--cngx-paginator-gap: .5rem;font-size:var(--cngx-paginator-font-size-comfortable, .95rem)}.cngx-paginator__dots{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-dot-gap, .5rem)}.cngx-paginator__dot{box-sizing:border-box;width:var(--cngx-paginator-dot-size, .5rem);height:var(--cngx-paginator-dot-size, .5rem);padding:0;border:0;border-radius:50%;background:var(--cngx-paginator-dot-color, color-mix(in oklch, currentColor 35%, transparent));cursor:pointer;transition:transform var(--cngx-paginator-transition, .15s ease),background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__dot[data-size=medium]{transform:scale(var(--cngx-paginator-dot-medium-scale, .7))}.cngx-paginator__dot[data-size=small]{transform:scale(var(--cngx-paginator-dot-small-scale, .45))}.cngx-paginator__dot--current{background:var( --cngx-paginator-dot-current-color, var(--cngx-color-primary, oklch(.66 .19 50)) );transform:scale(var(--cngx-paginator-dot-current-scale, 1.15))}.cngx-paginator__dot:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__dot[aria-disabled=true]{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__rail{position:relative;display:flex;align-items:center;flex:1 1 auto;min-inline-size:var(--cngx-paginator-rail-min-size, 6rem)}.cngx-paginator__rail cngx-progress{flex:1 1 auto;--cngx-progress-height: var(--cngx-paginator-rail-height, .375rem);--cngx-progress-color: var( --cngx-paginator-rail-fill, var(--cngx-color-primary, oklch(.66 .19 50)) );--cngx-progress-track-color: var( --cngx-paginator-rail-track, var(--cngx-color-border, oklch(.9 .005 250)) )}.cngx-paginator__rail-knob{position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:var(--cngx-paginator-rail-knob-size, .875rem);block-size:var(--cngx-paginator-rail-knob-size, .875rem);border-radius:50%;background:var(--cngx-paginator-rail-knob-bg, oklch(1 0 0));border:var(--cngx-paginator-rail-knob-border-width, 2px) solid var(--cngx-paginator-rail-knob-border-color, oklch(.66 .19 50));transform:translate(-50%,-50%);transition:inset-inline-start var(--cngx-paginator-motion-duration, .2s) cubic-bezier(.3,.7,0,1)}.cngx-paginator__infinite{display:flex;align-items:center;justify-content:center;gap:var(--cngx-paginator-infinite-gap, .5rem);padding:var(--cngx-paginator-infinite-padding, .9rem);color:var(--cngx-paginator-infinite-color, color-mix(in oklch, currentColor 60%, transparent))}.cngx-paginator__infinite-status,.cngx-paginator__infinite-end{font-size:var(--cngx-paginator-infinite-font-size, .8125rem)}.cngx-paginator__infinite-spinner{inline-size:var(--cngx-paginator-infinite-spinner-size, 1rem);block-size:var(--cngx-paginator-infinite-spinner-size, 1rem);border-radius:50%;border:var(--cngx-paginator-infinite-spinner-width, 2px) solid color-mix(in oklch,var(--cngx-color-primary, oklch(.66 .19 50)) 30%,transparent);border-block-start-color:var(--cngx-color-primary, oklch(.66 .19 50));animation:cngx-paginator-spin var(--cngx-paginator-infinite-spinner-duration, .7s) linear infinite}@keyframes cngx-paginator-spin{to{transform:rotate(360deg)}}.cngx-paginator__alpha{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cngx-paginator-alpha-gap, .4rem)}.cngx-paginator__alpha-chip{border-color:var( --cngx-paginator-alpha-chip-border-color, var(--cngx-color-border, oklch(.88 .005 250)) );background:var(--cngx-paginator-alpha-chip-bg, var(--cngx-color-surface, oklch(1 0 0)));font-weight:500}.cngx-paginator__alpha-chip:hover:not([aria-pressed=true]):not(:disabled){border-color:var(--cngx-color-primary, oklch(.66 .19 50));color:var(--cngx-color-primary, oklch(.66 .19 50))}.cngx-paginator__alpha-chip[aria-pressed=true]{background:var(--cngx-paginator-current-bg, var(--cngx-color-primary, oklch(.66 .19 50)));color:var(--cngx-paginator-current-color, var(--cngx-color-on-primary, oklch(1 0 0)));border-color:var( --cngx-paginator-current-border-color, var(--cngx-color-primary, oklch(.66 .19 50)) );font-weight:600}@media(prefers-reduced-motion:reduce){.cngx-paginator__button,.cngx-paginator__dot{transition:none}.cngx-paginator__infinite-spinner{animation:none}}}\n", "@layer cngx.tokens{@property --cngx-paginator-gap{syntax: \"*\"; inherits: true; initial-value: .25rem;}@property --cngx-paginator-row-gap{syntax: \"<length>\"; inherits: true; initial-value: .75rem;}@property --cngx-paginator-font-size{syntax: \"<length>\"; inherits: true; initial-value: .875rem;}@property --cngx-paginator-button-size{syntax: \"<length>\"; inherits: true; initial-value: 2.25rem;}@property --cngx-paginator-button-radius{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-button-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-paginator-button-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-paginator-button-hover-bg{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,currentColor 10%,transparent);}@property --cngx-paginator-button-border-color{syntax: \"<color>\"; inherits: true; initial-value: transparent;}@property --cngx-paginator-current-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-paginator-current-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-paginator-current-border-color{syntax: \"<color>\"; inherits: true; initial-value: transparent;}@property --cngx-paginator-focus-ring{syntax: \"*\"; inherits: true; initial-value: 2px solid currentColor;}@property --cngx-paginator-disabled-opacity{syntax: \"<number>\"; inherits: true; initial-value: .45;}@property --cngx-paginator-track-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 0 0);}@property --cngx-paginator-active-shadow{syntax: \"*\"; inherits: true; initial-value: 0 1px 2px oklch(0 0 0 / .06);}@property --cngx-paginator-indicator-thickness{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-paginator-rail-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-paginator-rail-thickness{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-paginator-rail-knob-size{syntax: \"<length>\"; inherits: true; initial-value: .875rem;}@property --cngx-paginator-rail-knob-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-paginator-rail-knob-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-paginator-bar-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-paginator-bar-radius{syntax: \"<length>\"; inherits: true; initial-value: .375rem;}@property --cngx-paginator-hover-scale{syntax: \"<number>\"; inherits: true; initial-value: 1;}@property --cngx-paginator-press-scale{syntax: \"<number>\"; inherits: true; initial-value: 1;}@property --cngx-paginator-motion-duration{syntax: \"<time>\"; inherits: true; initial-value: .2s;}@property --cngx-paginator-fade-duration{syntax: \"<time>\"; inherits: true; initial-value: .25s;}@property --cngx-paginator-busy-opacity{syntax: \"<number>\"; inherits: true; initial-value: .6;}@property --cngx-paginator-focus-halo{syntax: \"*\"; inherits: true; initial-value: 0 0 0 4px color-mix(in oklch,currentColor 18%,transparent);}@property --cngx-paginator-dot-size{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-dot-gap{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-dot-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.7 0 0 / .35);}@property --cngx-paginator-dot-current-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-paginator-panel-bg{syntax: \"*\"; inherits: true; initial-value: Canvas;}@property --cngx-paginator-panel-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-paginator-panel-border-color{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,currentColor 20%,transparent);}@property --cngx-paginator-panel-radius{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-panel-padding{syntax: \"*\"; inherits: true; initial-value: .25rem;}@property --cngx-paginator-panel-shadow{syntax: \"*\"; inherits: true; initial-value: 0 4px 12px rgb(0 0 0 / .15);}@property --cngx-paginator-option-size{syntax: \"<length>\"; inherits: true; initial-value: 2rem;}@property --cngx-paginator-option-padding{syntax: \"*\"; inherits: true; initial-value: 0 .75rem;}@property --cngx-paginator-option-radius{syntax: \"<length>\"; inherits: true; initial-value: .25rem;}@property --cngx-paginator-option-hover-bg{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,currentColor 10%,transparent);}@property --cngx-paginator-option-selected-bg{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,var(--cngx-color-primary, oklch(.66 .19 50)) 14%,transparent);}@property --cngx-paginator-option-selected-color{syntax: \"*\"; inherits: true; initial-value: var(--cngx-color-primary, oklch(.66 .19 50));}@property --cngx-paginator-overflow-columns{syntax: \"<integer>\"; inherits: true; initial-value: 5;}@property --cngx-paginator-overflow-cell-size{syntax: \"<length>\"; inherits: true; initial-value: 2rem;}:root{--cngx-paginator-current-bg: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-border-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-focus-ring: 2px solid var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-focus-halo: 0 0 0 4px color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 18%, transparent);--cngx-paginator-dot-current-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{@scope(.cngx-paginator[data-skin=numbered]){:scope{--cngx-paginator-current-bg: transparent;--cngx-paginator-current-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent )}.cngx-paginator__page{position:relative}.cngx-paginator__page:after{content:\"\";position:absolute;inset-inline:var(--cngx-paginator-indicator-inset, 18%);inset-block-end:var(--cngx-paginator-indicator-offset, 4px);block-size:var(--cngx-paginator-indicator-thickness, 2px);border-radius:var(--cngx-paginator-indicator-thickness, 2px) var(--cngx-paginator-indicator-thickness, 2px) 0 0;background:var(--cngx-color-primary, oklch(.66 .19 50));transform:scaleX(0);transition:transform var(--cngx-paginator-motion-duration, .2s) ease}.cngx-paginator__page:hover:not([aria-current=page]):after{transform:scaleX(var(--cngx-paginator-indicator-hover-scale, .5))}.cngx-paginator__page[aria-current=page]:after{transform:scaleX(1)}}@scope(.cngx-paginator[data-skin=pill]){:scope{--cngx-paginator-gap: .375rem;--cngx-paginator-button-radius: 100px;--cngx-paginator-current-bg: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-color: var(--cngx-color-on-primary, oklch(1 0 0));--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 8%, transparent )}}@scope(.cngx-paginator[data-skin=segmented]){:scope{--cngx-paginator-button-radius: .375rem;--cngx-paginator-track-bg: color-mix( in oklch, var(--cngx-color-surface, oklch(1 0 0)), var(--cngx-color-border, oklch(.88 .005 250)) 25% );--cngx-paginator-current-bg: var(--cngx-color-surface, oklch(1 0 0));--cngx-paginator-current-color: currentColor;--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-surface, oklch(1 0 0)), var(--cngx-color-border, oklch(.88 .005 250)) 45% )}.cngx-paginator__pages{background:var(--cngx-paginator-track-bg, oklch(.96 0 0));border-radius:var(--cngx-paginator-button-radius, .375rem);padding:var(--cngx-paginator-segmented-track-padding, .25rem)}.cngx-paginator__page[aria-current=page]{box-shadow:var(--cngx-paginator-active-shadow, 0 1px 2px oklch(0 0 0 / .06))}}@scope(.cngx-paginator[data-skin=minimal]){:scope{--cngx-paginator-row-gap: .5rem;--cngx-paginator-gap: .125rem;--cngx-paginator-button-bg: transparent;--cngx-paginator-button-hover-bg: transparent;--cngx-paginator-button-border-color: transparent;--cngx-paginator-current-bg: transparent;--cngx-paginator-current-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-border-color: transparent}.cngx-paginator__page:hover:not([aria-disabled=true]),.cngx-paginator__page[aria-current=page]{text-decoration:underline;text-underline-offset:.25em}.cngx-paginator__status{min-inline-size:var(--cngx-paginator-status-min-size, 5.5rem);text-align:center}:scope[data-nav-labels] .cngx-paginator__nav{gap:var(--cngx-paginator-minimal-nav-gap, .4rem);padding-inline:var(--cngx-paginator-minimal-nav-padding, .85rem);border-color:var(--cngx-color-border, oklch(.88 .005 250))}:scope[data-nav-labels] cngx-pgn-next .cngx-paginator__nav,:scope[data-nav-labels] cngx-pgn-last .cngx-paginator__nav{flex-direction:row-reverse}:scope[data-nav-labels] .cngx-paginator__nav .cngx-paginator__nav-label{position:static;width:auto;height:auto;margin:0;clip:auto;clip-path:none;overflow:visible;white-space:nowrap;font-weight:500}:scope[data-nav-labels] .cngx-paginator__nav:hover:not([aria-disabled=true]){border-color:var(--cngx-color-primary, oklch(.66 .19 50));color:var(--cngx-color-primary, oklch(.66 .19 50))}}@scope(.cngx-paginator[data-skin=rail]){:scope{--cngx-paginator-row-gap: .9rem}}@scope(.cngx-paginator[data-skin=bar]){:scope{--cngx-paginator-row-gap: 0;--cngx-paginator-gap: 0;--cngx-paginator-button-radius: 0;--cngx-paginator-current-bg: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-color: var(--cngx-color-on-primary, oklch(1 0 0));--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 10%, transparent );width:max-content;max-width:100%;min-block-size:var(--cngx-paginator-button-size, 2.25rem);border:1px solid var(--cngx-paginator-bar-border-color, oklch(.88 .005 250));border-radius:var(--cngx-paginator-bar-radius, .375rem);overflow:clip;overflow-clip-margin:var(--cngx-paginator-bar-clip-margin, .5rem)}:scope>.cngx-paginator__segment{align-self:stretch;align-items:stretch;border-inline-start:1px solid var(--cngx-paginator-bar-border-color, oklch(.88 .005 250))}:scope>.cngx-paginator__segment:first-child{border-inline-start:0}.cngx-paginator__segment>.cngx-paginator__button{align-self:stretch;block-size:auto;border-radius:0;padding-inline:var(--cngx-paginator-bar-cell-padding, .85rem)}.cngx-paginator__segment:is(cngx-pgn-first,cngx-pgn-prev,cngx-pgn-next,cngx-pgn-last)>.cngx-paginator__button{padding-inline:0}.cngx-paginator__range,.cngx-paginator__status{align-self:center;padding-inline:var(--cngx-paginator-bar-cell-padding, .85rem)}:scope>span.cngx-paginator__segment{align-items:center;padding-inline:var(--cngx-paginator-bar-cell-padding, .85rem)}.cngx-paginator__pages{gap:0;align-self:stretch}.cngx-paginator__pages .cngx-paginator__button{align-self:stretch;block-size:auto;border-radius:0;border-inline-start:1px solid var(--cngx-paginator-bar-border-color, oklch(.88 .005 250));padding-inline:var(--cngx-paginator-bar-page-padding, .5rem)}.cngx-paginator__pages .cngx-paginator__button:first-child{border-inline-start:0}}@scope(.cngx-paginator[data-skin=dots]){:scope{--cngx-paginator-row-gap: .9rem;--cngx-paginator-gap: .5rem;--cngx-paginator-dot-gap: .625rem;--cngx-paginator-dot-size: .5625rem;--cngx-paginator-dot-color: color-mix(in oklch, currentColor 30%, transparent);--cngx-paginator-dot-current-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@scope(.cngx-paginator){.cngx-paginator__button{transition:background var(--cngx-paginator-motion-duration, .2s) ease,transform var(--cngx-paginator-motion-duration, .2s) ease,box-shadow var(--cngx-paginator-motion-duration, .2s) ease}.cngx-paginator__button:hover:not([aria-disabled=true]){transform:scale(var(--cngx-paginator-hover-scale, 1))}.cngx-paginator__button:active:not([aria-disabled=true]){transform:scale(var(--cngx-paginator-press-scale, 1))}.cngx-paginator__button:focus-visible{box-shadow:var( --cngx-paginator-focus-halo, 0 0 0 4px color-mix(in oklch, currentColor 18%, transparent) )}.cngx-paginator__pages{transition:opacity var(--cngx-paginator-fade-duration, .25s) ease}:scope[aria-busy=true] .cngx-paginator__pages{opacity:var(--cngx-paginator-busy-opacity, .6)}@media(prefers-reduced-motion:reduce){:scope{--cngx-paginator-hover-scale: 1;--cngx-paginator-press-scale: 1}.cngx-paginator__button,.cngx-paginator__pages,.cngx-paginator__page:after,.cngx-paginator__rail-knob{transition:none}}}.cngx-paginator:not([data-skin=bar]){container-type:inline-size;container-name:cngx-paginator}@container cngx-paginator (max-width: 30rem){cngx-pgn-goto{display:none}}@container cngx-paginator (max-width: 24rem){cngx-pgn-first,cngx-pgn-last{display:none}}.cngx-paginator[data-responsive] cngx-pgn-status{display:none}@container cngx-paginator (max-width: 24rem){.cngx-paginator[data-responsive] cngx-pgn-pages{display:none}.cngx-paginator[data-responsive] cngx-pgn-status{display:inline-flex}}@media(pointer:coarse){.cngx-paginator{--cngx-paginator-button-size: 2.75rem}}[dir=rtl] .cngx-paginator__nav .cngx-icon{transform:scaleX(-1)}}@media(prefers-color-scheme:dark){.cngx-paginator[data-skin=numbered]{--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.72 .18 50)) 24%, transparent )}.cngx-paginator[data-skin=segmented]{--cngx-paginator-active-shadow: 0 1px 3px oklch(0 0 0 / .3)}}\n"], dependencies: [{ kind: "component", type: CngxProgress, selector: "cngx-progress", inputs: ["state", "progress", "variant", "showLabel", "label"] }, { kind: "directive", type: CngxLiveRegion, selector: "[cngxLiveRegion]", inputs: ["politeness", "atomic", "relevant"], exportAs: ["cngxLiveRegion"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
452
+ }
453
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginator, decorators: [{
454
+ type: Component,
455
+ args: [{ selector: 'cngx-paginator', exportAs: 'cngxPaginator', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CngxProgress, CngxLiveRegion, NgTemplateOutlet], hostDirectives: [
456
+ {
457
+ directive: CngxPaginate,
458
+ inputs: ['cngxPageIndex: pageIndex', 'cngxPageSize: pageSize', 'total', 'state'],
459
+ },
460
+ ], providers: [{ provide: CNGX_PAGINATOR_HOST, useExisting: CngxPaginate }], host: {
461
+ class: 'cngx-paginator',
462
+ role: 'navigation',
463
+ '[attr.aria-label]': 'resolvedAriaLabel()',
464
+ '[attr.aria-busy]': 'paginate.isBusy()',
465
+ '[attr.data-skin]': 'skin()',
466
+ '[attr.data-density]': 'density()',
467
+ '[attr.data-responsive]': "responsive() ? '' : null",
468
+ }, template: "@if (paginate.isBusy()) {\n @if (loadingTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-progress\n class=\"cngx-paginator__progress\"\n variant=\"linear\"\n [state]=\"paginate.state()\"\n [label]=\"config.announcements.loading\"\n />\n }\n}\n\n<ng-content />\n\n<span cngxLiveRegion class=\"cngx-paginator__sr\">{{ announcer.message() }}</span>\n", styles: ["@layer cngx.components{.cngx-paginator{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:var(--cngx-paginator-row-gap, .75rem);font-family:var( --cngx-paginator-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif );font-size:var(--cngx-paginator-font-size, .875rem)}.cngx-paginator__progress{position:absolute;inset-inline:0;inset-block-start:0;block-size:var(--cngx-paginator-progress-thickness, 2px)}.cngx-paginator__segment{display:inline-flex;align-items:center}.cngx-paginator__nav-label,.cngx-paginator__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}.cngx-paginator__pages{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-gap, .25rem)}.cngx-paginator__button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:var(--cngx-paginator-button-size, 2.25rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-button-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-button-border-color, transparent);border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__button:hover{background:var( --cngx-paginator-button-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__button:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__button[aria-disabled=true],.cngx-paginator__button:disabled{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__page[aria-current=page]{background:var( --cngx-paginator-current-bg, color-mix(in oklch, currentColor 12%, transparent) );color:var(--cngx-paginator-current-color, currentColor);border-color:var(--cngx-paginator-current-border-color, transparent);font-weight:600}.cngx-paginator__range,.cngx-paginator__status{font-variant-numeric:tabular-nums;color:var(--cngx-paginator-range-color, currentColor);white-space:nowrap}.cngx-paginator__load-more{gap:var(--cngx-paginator-load-more-gap, .5rem);white-space:nowrap}.cngx-paginator__load-more-count{font-variant-numeric:tabular-nums;color:var( --cngx-paginator-load-more-count-color, color-mix(in oklch, currentColor 60%, transparent) )}.cngx-paginator__goto-input{box-sizing:border-box;width:var(--cngx-paginator-goto-width, 3.5rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-goto-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-goto-border-color, color-mix(in oklch, currentColor 25%, transparent));border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;font-variant-numeric:tabular-nums}.cngx-paginator__goto-input:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__select{gap:var(--cngx-paginator-select-gap, .25rem);font-variant-numeric:tabular-nums}.cngx-paginator__select-caret{display:inline-flex;font-size:var(--cngx-paginator-caret-size, 1em);line-height:1;opacity:var(--cngx-paginator-caret-opacity, .55)}.cngx-paginator__select-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__option{display:flex;align-items:center;min-height:var(--cngx-paginator-option-size, 2rem);padding:var(--cngx-paginator-option-padding, 0 .75rem);border-radius:var(--cngx-paginator-option-radius, .25rem);cursor:pointer;font-variant-numeric:tabular-nums}.cngx-paginator__overflow-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;display:grid;grid-template-columns:repeat(var(--cngx-paginator-overflow-columns, 5),var(--cngx-paginator-overflow-cell-size, 2rem));gap:var(--cngx-paginator-overflow-gap, .15rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__overflow-panel .cngx-paginator__option{justify-content:center;min-block-size:var(--cngx-paginator-overflow-cell-size, 2rem);padding:var(--cngx-paginator-overflow-cell-padding, 0)}.cngx-paginator__overflow-panel:focus,.cngx-paginator__overflow-panel:focus-visible{outline:none}[popover]:has(>.cngx-paginator__select-panel),[popover]:has(>.cngx-paginator__overflow-panel){margin:0;padding:0;border:0;background:none}.cngx-paginator__option.cngx-option--highlighted,.cngx-paginator__option.cngx-menu-item--highlighted{background:var( --cngx-paginator-option-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__option.cngx-option--selected{background:var( --cngx-paginator-option-selected-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 14%, transparent) );color:var(--cngx-paginator-option-selected-color, var(--cngx-color-primary, oklch(.66 .19 50)));font-weight:600}.cngx-paginator[data-density=compact]{--cngx-paginator-button-size: 1.75rem;--cngx-paginator-gap: .125rem;font-size:var(--cngx-paginator-font-size-compact, .8125rem)}.cngx-paginator[data-density=comfortable]{--cngx-paginator-button-size: 2.75rem;--cngx-paginator-gap: .5rem;font-size:var(--cngx-paginator-font-size-comfortable, .95rem)}.cngx-paginator__dots{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-dot-gap, .5rem)}.cngx-paginator__dot{box-sizing:border-box;width:var(--cngx-paginator-dot-size, .5rem);height:var(--cngx-paginator-dot-size, .5rem);padding:0;border:0;border-radius:50%;background:var(--cngx-paginator-dot-color, color-mix(in oklch, currentColor 35%, transparent));cursor:pointer;transition:transform var(--cngx-paginator-transition, .15s ease),background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__dot[data-size=medium]{transform:scale(var(--cngx-paginator-dot-medium-scale, .7))}.cngx-paginator__dot[data-size=small]{transform:scale(var(--cngx-paginator-dot-small-scale, .45))}.cngx-paginator__dot--current{background:var( --cngx-paginator-dot-current-color, var(--cngx-color-primary, oklch(.66 .19 50)) );transform:scale(var(--cngx-paginator-dot-current-scale, 1.15))}.cngx-paginator__dot:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__dot[aria-disabled=true]{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__rail{position:relative;display:flex;align-items:center;flex:1 1 auto;min-inline-size:var(--cngx-paginator-rail-min-size, 6rem)}.cngx-paginator__rail cngx-progress{flex:1 1 auto;--cngx-progress-height: var(--cngx-paginator-rail-height, .375rem);--cngx-progress-color: var( --cngx-paginator-rail-fill, var(--cngx-color-primary, oklch(.66 .19 50)) );--cngx-progress-track-color: var( --cngx-paginator-rail-track, var(--cngx-color-border, oklch(.9 .005 250)) )}.cngx-paginator__rail-knob{position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:var(--cngx-paginator-rail-knob-size, .875rem);block-size:var(--cngx-paginator-rail-knob-size, .875rem);border-radius:50%;background:var(--cngx-paginator-rail-knob-bg, oklch(1 0 0));border:var(--cngx-paginator-rail-knob-border-width, 2px) solid var(--cngx-paginator-rail-knob-border-color, oklch(.66 .19 50));transform:translate(-50%,-50%);transition:inset-inline-start var(--cngx-paginator-motion-duration, .2s) cubic-bezier(.3,.7,0,1)}.cngx-paginator__infinite{display:flex;align-items:center;justify-content:center;gap:var(--cngx-paginator-infinite-gap, .5rem);padding:var(--cngx-paginator-infinite-padding, .9rem);color:var(--cngx-paginator-infinite-color, color-mix(in oklch, currentColor 60%, transparent))}.cngx-paginator__infinite-status,.cngx-paginator__infinite-end{font-size:var(--cngx-paginator-infinite-font-size, .8125rem)}.cngx-paginator__infinite-spinner{inline-size:var(--cngx-paginator-infinite-spinner-size, 1rem);block-size:var(--cngx-paginator-infinite-spinner-size, 1rem);border-radius:50%;border:var(--cngx-paginator-infinite-spinner-width, 2px) solid color-mix(in oklch,var(--cngx-color-primary, oklch(.66 .19 50)) 30%,transparent);border-block-start-color:var(--cngx-color-primary, oklch(.66 .19 50));animation:cngx-paginator-spin var(--cngx-paginator-infinite-spinner-duration, .7s) linear infinite}@keyframes cngx-paginator-spin{to{transform:rotate(360deg)}}.cngx-paginator__alpha{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cngx-paginator-alpha-gap, .4rem)}.cngx-paginator__alpha-chip{border-color:var( --cngx-paginator-alpha-chip-border-color, var(--cngx-color-border, oklch(.88 .005 250)) );background:var(--cngx-paginator-alpha-chip-bg, var(--cngx-color-surface, oklch(1 0 0)));font-weight:500}.cngx-paginator__alpha-chip:hover:not([aria-pressed=true]):not(:disabled){border-color:var(--cngx-color-primary, oklch(.66 .19 50));color:var(--cngx-color-primary, oklch(.66 .19 50))}.cngx-paginator__alpha-chip[aria-pressed=true]{background:var(--cngx-paginator-current-bg, var(--cngx-color-primary, oklch(.66 .19 50)));color:var(--cngx-paginator-current-color, var(--cngx-color-on-primary, oklch(1 0 0)));border-color:var( --cngx-paginator-current-border-color, var(--cngx-color-primary, oklch(.66 .19 50)) );font-weight:600}@media(prefers-reduced-motion:reduce){.cngx-paginator__button,.cngx-paginator__dot{transition:none}.cngx-paginator__infinite-spinner{animation:none}}}\n", "@layer cngx.tokens{@property --cngx-paginator-gap{syntax: \"*\"; inherits: true; initial-value: .25rem;}@property --cngx-paginator-row-gap{syntax: \"<length>\"; inherits: true; initial-value: .75rem;}@property --cngx-paginator-font-size{syntax: \"<length>\"; inherits: true; initial-value: .875rem;}@property --cngx-paginator-button-size{syntax: \"<length>\"; inherits: true; initial-value: 2.25rem;}@property --cngx-paginator-button-radius{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-button-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-paginator-button-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-paginator-button-hover-bg{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,currentColor 10%,transparent);}@property --cngx-paginator-button-border-color{syntax: \"<color>\"; inherits: true; initial-value: transparent;}@property --cngx-paginator-current-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-paginator-current-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-paginator-current-border-color{syntax: \"<color>\"; inherits: true; initial-value: transparent;}@property --cngx-paginator-focus-ring{syntax: \"*\"; inherits: true; initial-value: 2px solid currentColor;}@property --cngx-paginator-disabled-opacity{syntax: \"<number>\"; inherits: true; initial-value: .45;}@property --cngx-paginator-track-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 0 0);}@property --cngx-paginator-active-shadow{syntax: \"*\"; inherits: true; initial-value: 0 1px 2px oklch(0 0 0 / .06);}@property --cngx-paginator-indicator-thickness{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-paginator-rail-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-paginator-rail-thickness{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-paginator-rail-knob-size{syntax: \"<length>\"; inherits: true; initial-value: .875rem;}@property --cngx-paginator-rail-knob-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-paginator-rail-knob-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-paginator-bar-border-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.88 .005 250);}@property --cngx-paginator-bar-radius{syntax: \"<length>\"; inherits: true; initial-value: .375rem;}@property --cngx-paginator-hover-scale{syntax: \"<number>\"; inherits: true; initial-value: 1;}@property --cngx-paginator-press-scale{syntax: \"<number>\"; inherits: true; initial-value: 1;}@property --cngx-paginator-motion-duration{syntax: \"<time>\"; inherits: true; initial-value: .2s;}@property --cngx-paginator-fade-duration{syntax: \"<time>\"; inherits: true; initial-value: .25s;}@property --cngx-paginator-busy-opacity{syntax: \"<number>\"; inherits: true; initial-value: .6;}@property --cngx-paginator-focus-halo{syntax: \"*\"; inherits: true; initial-value: 0 0 0 4px color-mix(in oklch,currentColor 18%,transparent);}@property --cngx-paginator-dot-size{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-dot-gap{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-dot-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.7 0 0 / .35);}@property --cngx-paginator-dot-current-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-paginator-panel-bg{syntax: \"*\"; inherits: true; initial-value: Canvas;}@property --cngx-paginator-panel-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-paginator-panel-border-color{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,currentColor 20%,transparent);}@property --cngx-paginator-panel-radius{syntax: \"<length>\"; inherits: true; initial-value: .5rem;}@property --cngx-paginator-panel-padding{syntax: \"*\"; inherits: true; initial-value: .25rem;}@property --cngx-paginator-panel-shadow{syntax: \"*\"; inherits: true; initial-value: 0 4px 12px rgb(0 0 0 / .15);}@property --cngx-paginator-option-size{syntax: \"<length>\"; inherits: true; initial-value: 2rem;}@property --cngx-paginator-option-padding{syntax: \"*\"; inherits: true; initial-value: 0 .75rem;}@property --cngx-paginator-option-radius{syntax: \"<length>\"; inherits: true; initial-value: .25rem;}@property --cngx-paginator-option-hover-bg{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,currentColor 10%,transparent);}@property --cngx-paginator-option-selected-bg{syntax: \"*\"; inherits: true; initial-value: color-mix(in oklch,var(--cngx-color-primary, oklch(.66 .19 50)) 14%,transparent);}@property --cngx-paginator-option-selected-color{syntax: \"*\"; inherits: true; initial-value: var(--cngx-color-primary, oklch(.66 .19 50));}@property --cngx-paginator-overflow-columns{syntax: \"<integer>\"; inherits: true; initial-value: 5;}@property --cngx-paginator-overflow-cell-size{syntax: \"<length>\"; inherits: true; initial-value: 2rem;}:root{--cngx-paginator-current-bg: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-border-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-focus-ring: 2px solid var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-focus-halo: 0 0 0 4px color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 18%, transparent);--cngx-paginator-dot-current-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@layer cngx.components{@scope(.cngx-paginator[data-skin=numbered]){:scope{--cngx-paginator-current-bg: transparent;--cngx-paginator-current-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 12%, transparent )}.cngx-paginator__page{position:relative}.cngx-paginator__page:after{content:\"\";position:absolute;inset-inline:var(--cngx-paginator-indicator-inset, 18%);inset-block-end:var(--cngx-paginator-indicator-offset, 4px);block-size:var(--cngx-paginator-indicator-thickness, 2px);border-radius:var(--cngx-paginator-indicator-thickness, 2px) var(--cngx-paginator-indicator-thickness, 2px) 0 0;background:var(--cngx-color-primary, oklch(.66 .19 50));transform:scaleX(0);transition:transform var(--cngx-paginator-motion-duration, .2s) ease}.cngx-paginator__page:hover:not([aria-current=page]):after{transform:scaleX(var(--cngx-paginator-indicator-hover-scale, .5))}.cngx-paginator__page[aria-current=page]:after{transform:scaleX(1)}}@scope(.cngx-paginator[data-skin=pill]){:scope{--cngx-paginator-gap: .375rem;--cngx-paginator-button-radius: 100px;--cngx-paginator-current-bg: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-color: var(--cngx-color-on-primary, oklch(1 0 0));--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 8%, transparent )}}@scope(.cngx-paginator[data-skin=segmented]){:scope{--cngx-paginator-button-radius: .375rem;--cngx-paginator-track-bg: color-mix( in oklch, var(--cngx-color-surface, oklch(1 0 0)), var(--cngx-color-border, oklch(.88 .005 250)) 25% );--cngx-paginator-current-bg: var(--cngx-color-surface, oklch(1 0 0));--cngx-paginator-current-color: currentColor;--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-surface, oklch(1 0 0)), var(--cngx-color-border, oklch(.88 .005 250)) 45% )}.cngx-paginator__pages{background:var(--cngx-paginator-track-bg, oklch(.96 0 0));border-radius:var(--cngx-paginator-button-radius, .375rem);padding:var(--cngx-paginator-segmented-track-padding, .25rem)}.cngx-paginator__page[aria-current=page]{box-shadow:var(--cngx-paginator-active-shadow, 0 1px 2px oklch(0 0 0 / .06))}}@scope(.cngx-paginator[data-skin=minimal]){:scope{--cngx-paginator-row-gap: .5rem;--cngx-paginator-gap: .125rem;--cngx-paginator-button-bg: transparent;--cngx-paginator-button-hover-bg: transparent;--cngx-paginator-button-border-color: transparent;--cngx-paginator-current-bg: transparent;--cngx-paginator-current-color: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-border-color: transparent}.cngx-paginator__page:hover:not([aria-disabled=true]),.cngx-paginator__page[aria-current=page]{text-decoration:underline;text-underline-offset:.25em}.cngx-paginator__status{min-inline-size:var(--cngx-paginator-status-min-size, 5.5rem);text-align:center}:scope[data-nav-labels] .cngx-paginator__nav{gap:var(--cngx-paginator-minimal-nav-gap, .4rem);padding-inline:var(--cngx-paginator-minimal-nav-padding, .85rem);border-color:var(--cngx-color-border, oklch(.88 .005 250))}:scope[data-nav-labels] cngx-pgn-next .cngx-paginator__nav,:scope[data-nav-labels] cngx-pgn-last .cngx-paginator__nav{flex-direction:row-reverse}:scope[data-nav-labels] .cngx-paginator__nav .cngx-paginator__nav-label{position:static;width:auto;height:auto;margin:0;clip:auto;clip-path:none;overflow:visible;white-space:nowrap;font-weight:500}:scope[data-nav-labels] .cngx-paginator__nav:hover:not([aria-disabled=true]){border-color:var(--cngx-color-primary, oklch(.66 .19 50));color:var(--cngx-color-primary, oklch(.66 .19 50))}}@scope(.cngx-paginator[data-skin=rail]){:scope{--cngx-paginator-row-gap: .9rem}}@scope(.cngx-paginator[data-skin=bar]){:scope{--cngx-paginator-row-gap: 0;--cngx-paginator-gap: 0;--cngx-paginator-button-radius: 0;--cngx-paginator-current-bg: var(--cngx-color-primary, oklch(.66 .19 50));--cngx-paginator-current-color: var(--cngx-color-on-primary, oklch(1 0 0));--cngx-paginator-current-border-color: transparent;--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 10%, transparent );width:max-content;max-width:100%;min-block-size:var(--cngx-paginator-button-size, 2.25rem);border:1px solid var(--cngx-paginator-bar-border-color, oklch(.88 .005 250));border-radius:var(--cngx-paginator-bar-radius, .375rem);overflow:clip;overflow-clip-margin:var(--cngx-paginator-bar-clip-margin, .5rem)}:scope>.cngx-paginator__segment{align-self:stretch;align-items:stretch;border-inline-start:1px solid var(--cngx-paginator-bar-border-color, oklch(.88 .005 250))}:scope>.cngx-paginator__segment:first-child{border-inline-start:0}.cngx-paginator__segment>.cngx-paginator__button{align-self:stretch;block-size:auto;border-radius:0;padding-inline:var(--cngx-paginator-bar-cell-padding, .85rem)}.cngx-paginator__segment:is(cngx-pgn-first,cngx-pgn-prev,cngx-pgn-next,cngx-pgn-last)>.cngx-paginator__button{padding-inline:0}.cngx-paginator__range,.cngx-paginator__status{align-self:center;padding-inline:var(--cngx-paginator-bar-cell-padding, .85rem)}:scope>span.cngx-paginator__segment{align-items:center;padding-inline:var(--cngx-paginator-bar-cell-padding, .85rem)}.cngx-paginator__pages{gap:0;align-self:stretch}.cngx-paginator__pages .cngx-paginator__button{align-self:stretch;block-size:auto;border-radius:0;border-inline-start:1px solid var(--cngx-paginator-bar-border-color, oklch(.88 .005 250));padding-inline:var(--cngx-paginator-bar-page-padding, .5rem)}.cngx-paginator__pages .cngx-paginator__button:first-child{border-inline-start:0}}@scope(.cngx-paginator[data-skin=dots]){:scope{--cngx-paginator-row-gap: .9rem;--cngx-paginator-gap: .5rem;--cngx-paginator-dot-gap: .625rem;--cngx-paginator-dot-size: .5625rem;--cngx-paginator-dot-color: color-mix(in oklch, currentColor 30%, transparent);--cngx-paginator-dot-current-color: var(--cngx-color-primary, oklch(.66 .19 50))}}@scope(.cngx-paginator){.cngx-paginator__button{transition:background var(--cngx-paginator-motion-duration, .2s) ease,transform var(--cngx-paginator-motion-duration, .2s) ease,box-shadow var(--cngx-paginator-motion-duration, .2s) ease}.cngx-paginator__button:hover:not([aria-disabled=true]){transform:scale(var(--cngx-paginator-hover-scale, 1))}.cngx-paginator__button:active:not([aria-disabled=true]){transform:scale(var(--cngx-paginator-press-scale, 1))}.cngx-paginator__button:focus-visible{box-shadow:var( --cngx-paginator-focus-halo, 0 0 0 4px color-mix(in oklch, currentColor 18%, transparent) )}.cngx-paginator__pages{transition:opacity var(--cngx-paginator-fade-duration, .25s) ease}:scope[aria-busy=true] .cngx-paginator__pages{opacity:var(--cngx-paginator-busy-opacity, .6)}@media(prefers-reduced-motion:reduce){:scope{--cngx-paginator-hover-scale: 1;--cngx-paginator-press-scale: 1}.cngx-paginator__button,.cngx-paginator__pages,.cngx-paginator__page:after,.cngx-paginator__rail-knob{transition:none}}}.cngx-paginator:not([data-skin=bar]){container-type:inline-size;container-name:cngx-paginator}@container cngx-paginator (max-width: 30rem){cngx-pgn-goto{display:none}}@container cngx-paginator (max-width: 24rem){cngx-pgn-first,cngx-pgn-last{display:none}}.cngx-paginator[data-responsive] cngx-pgn-status{display:none}@container cngx-paginator (max-width: 24rem){.cngx-paginator[data-responsive] cngx-pgn-pages{display:none}.cngx-paginator[data-responsive] cngx-pgn-status{display:inline-flex}}@media(pointer:coarse){.cngx-paginator{--cngx-paginator-button-size: 2.75rem}}[dir=rtl] .cngx-paginator__nav .cngx-icon{transform:scaleX(-1)}}@media(prefers-color-scheme:dark){.cngx-paginator[data-skin=numbered]{--cngx-paginator-button-hover-bg: color-mix( in oklch, var(--cngx-color-primary, oklch(.72 .18 50)) 24%, transparent )}.cngx-paginator[data-skin=segmented]{--cngx-paginator-active-shadow: 0 1px 3px oklch(0 0 0 / .3)}}\n"] }]
469
+ }], ctorParameters: () => [], propDecorators: { ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], skin: [{ type: i0.Input, args: [{ isSignal: true, alias: "skin", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], responsive: [{ type: i0.Input, args: [{ isSignal: true, alias: "responsive", required: false }] }], resetOn: [{ type: i0.Input, args: [{ isSignal: true, alias: "resetOn", required: false }] }], pageIndexChange: [{ type: i0.Output, args: ["pageIndexChange"] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }], loadingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxPaginatorLoading), { ...{ read: TemplateRef }, isSignal: true }] }] } });
470
+
471
+ /**
472
+ * Default text glyphs for the paginator segments. Internal and non-exported -
473
+ * mirrors `CNGX_SELECT_GLYPHS`. The library ships no icon font; these unicode
474
+ * marks are the out-of-the-box chevrons and the overflow ellipsis. Consumers
475
+ * restyle visually via CSS rather than by swapping these characters.
476
+ *
477
+ * Centralised so the chevron / ellipsis literals live in one place instead of
478
+ * being duplicated across the segment classes.
479
+ */
480
+ const CNGX_PAGINATOR_GLYPHS = {
481
+ /** First-page nav (double left-pointing angle quotation mark). */
482
+ first: '«',
483
+ /** Previous-page nav (single left-pointing angle quotation mark). */
484
+ previous: '‹',
485
+ /** Next-page nav (single right-pointing angle quotation mark). */
486
+ next: '›',
487
+ /** Last-page nav (double right-pointing angle quotation mark). */
488
+ last: '»',
489
+ /** Ellipsis trigger that opens the hidden-pages overflow menu. */
490
+ more: '…',
491
+ /** Dropdown caret on the page-size / page-of-pages select triggers. */
492
+ caret: '▾',
493
+ };
494
+
495
+ /**
496
+ * Shared nav-button glue. Composition, not an abstract base class: each of the
497
+ * four segments calls this factory as a field initialiser and binds the same
498
+ * template, differing only in selector, glyph, and the three options here.
499
+ */
500
+ function createPaginatorNavCore(options) {
501
+ const host = inject(CNGX_PAGINATOR_HOST);
502
+ const config = injectPaginatorConfig();
503
+ const disabled = computed(() => host.isBusy() || options.atBound(host), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
504
+ const ariaLabel = computed(() => config.ariaLabels[options.ariaKey], ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
505
+ return {
506
+ disabled,
507
+ ariaLabel,
508
+ activate: () => {
509
+ if (disabled()) {
510
+ return;
511
+ }
512
+ options.action(host);
513
+ },
514
+ };
515
+ }
516
+ // Shared template - identical across the four segments; only the glyph differs.
517
+ // `aria-disabled` (not native `disabled`) keeps the button focusable so AT users
518
+ // hear the bound state; `activate()` guards the click.
519
+ const NAV_TEMPLATE = `
520
+ <button
521
+ type="button"
522
+ class="cngx-paginator__button cngx-paginator__nav"
523
+ cngxRipple
524
+ [attr.aria-disabled]="core.disabled()"
525
+ (click)="core.activate()"
526
+ >
527
+ <cngx-icon aria-hidden="true">{{ glyph }}</cngx-icon>
528
+ <span class="cngx-paginator__nav-label">{{ core.ariaLabel() }}</span>
529
+ </button>
530
+ `;
531
+ // Angular's compiler needs literal decorator metadata per component (no
532
+ // spreads), so the shared parts are duplicated inline; the behavioural glue
533
+ // stays factored in createPaginatorNavCore and the markup in NAV_TEMPLATE.
534
+ /** First-page segment. Disabled on the first page; calls `host.first()`.
535
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
536
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
537
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
538
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
539
+ */
540
+ class CngxPaginatorFirst {
541
+ glyph = CNGX_PAGINATOR_GLYPHS.first;
542
+ core = createPaginatorNavCore({
543
+ atBound: (host) => host.isFirst(),
544
+ action: (host) => host.first(),
545
+ ariaKey: 'first',
546
+ });
547
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorFirst, deps: [], target: i0.ɵɵFactoryTarget.Component });
548
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorFirst, isStandalone: true, selector: "cngx-pgn-first", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnFirst"], ngImport: i0, template: "\n <button\n type=\"button\"\n class=\"cngx-paginator__button cngx-paginator__nav\"\n cngxRipple\n [attr.aria-disabled]=\"core.disabled()\"\n (click)=\"core.activate()\"\n >\n <cngx-icon aria-hidden=\"true\">{{ glyph }}</cngx-icon>\n <span class=\"cngx-paginator__nav-label\">{{ core.ariaLabel() }}</span>\n </button>\n", isInline: true, dependencies: [{ kind: "component", type: CngxIcon, selector: "cngx-icon, [cngxIcon]", inputs: ["label", "size"], exportAs: ["cngxIcon"] }, { kind: "directive", type: CngxRipple, selector: "[cngxRipple]", inputs: ["rippleColor", "rippleCentered", "rippleDisabled"], exportAs: ["cngxRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
549
+ }
550
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorFirst, decorators: [{
551
+ type: Component,
552
+ args: [{
553
+ selector: 'cngx-pgn-first',
554
+ exportAs: 'cngxPgnFirst',
555
+ standalone: true,
556
+ changeDetection: ChangeDetectionStrategy.OnPush,
557
+ encapsulation: ViewEncapsulation.None,
558
+ imports: [CngxIcon, CngxRipple],
559
+ template: NAV_TEMPLATE,
560
+ host: { class: 'cngx-paginator__segment' },
561
+ }]
562
+ }] });
563
+ /** Previous-page segment. Disabled on the first page; calls `host.previous()`.
564
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
565
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
566
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
567
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
568
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
569
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
570
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
571
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
572
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
573
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
574
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
575
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
576
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
577
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
578
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
579
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
580
+ */
581
+ class CngxPaginatorPrev {
582
+ glyph = CNGX_PAGINATOR_GLYPHS.previous;
583
+ core = createPaginatorNavCore({
584
+ atBound: (host) => host.isFirst(),
585
+ action: (host) => host.previous(),
586
+ ariaKey: 'previous',
587
+ });
588
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPrev, deps: [], target: i0.ɵɵFactoryTarget.Component });
589
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorPrev, isStandalone: true, selector: "cngx-pgn-prev", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnPrev"], ngImport: i0, template: "\n <button\n type=\"button\"\n class=\"cngx-paginator__button cngx-paginator__nav\"\n cngxRipple\n [attr.aria-disabled]=\"core.disabled()\"\n (click)=\"core.activate()\"\n >\n <cngx-icon aria-hidden=\"true\">{{ glyph }}</cngx-icon>\n <span class=\"cngx-paginator__nav-label\">{{ core.ariaLabel() }}</span>\n </button>\n", isInline: true, dependencies: [{ kind: "component", type: CngxIcon, selector: "cngx-icon, [cngxIcon]", inputs: ["label", "size"], exportAs: ["cngxIcon"] }, { kind: "directive", type: CngxRipple, selector: "[cngxRipple]", inputs: ["rippleColor", "rippleCentered", "rippleDisabled"], exportAs: ["cngxRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
590
+ }
591
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPrev, decorators: [{
592
+ type: Component,
593
+ args: [{
594
+ selector: 'cngx-pgn-prev',
595
+ exportAs: 'cngxPgnPrev',
596
+ standalone: true,
597
+ changeDetection: ChangeDetectionStrategy.OnPush,
598
+ encapsulation: ViewEncapsulation.None,
599
+ imports: [CngxIcon, CngxRipple],
600
+ template: NAV_TEMPLATE,
601
+ host: { class: 'cngx-paginator__segment' },
602
+ }]
603
+ }] });
604
+ /** Next-page segment. Disabled on the last page; calls `host.next()`.
605
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
606
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
607
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
608
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
609
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
610
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
611
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
612
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
613
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
614
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
615
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
616
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
617
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
618
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
619
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
620
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
621
+ */
622
+ class CngxPaginatorNext {
623
+ glyph = CNGX_PAGINATOR_GLYPHS.next;
624
+ core = createPaginatorNavCore({
625
+ atBound: (host) => host.isLast(),
626
+ action: (host) => host.next(),
627
+ ariaKey: 'next',
628
+ });
629
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorNext, deps: [], target: i0.ɵɵFactoryTarget.Component });
630
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorNext, isStandalone: true, selector: "cngx-pgn-next", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnNext"], ngImport: i0, template: "\n <button\n type=\"button\"\n class=\"cngx-paginator__button cngx-paginator__nav\"\n cngxRipple\n [attr.aria-disabled]=\"core.disabled()\"\n (click)=\"core.activate()\"\n >\n <cngx-icon aria-hidden=\"true\">{{ glyph }}</cngx-icon>\n <span class=\"cngx-paginator__nav-label\">{{ core.ariaLabel() }}</span>\n </button>\n", isInline: true, dependencies: [{ kind: "component", type: CngxIcon, selector: "cngx-icon, [cngxIcon]", inputs: ["label", "size"], exportAs: ["cngxIcon"] }, { kind: "directive", type: CngxRipple, selector: "[cngxRipple]", inputs: ["rippleColor", "rippleCentered", "rippleDisabled"], exportAs: ["cngxRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
631
+ }
632
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorNext, decorators: [{
633
+ type: Component,
634
+ args: [{
635
+ selector: 'cngx-pgn-next',
636
+ exportAs: 'cngxPgnNext',
637
+ standalone: true,
638
+ changeDetection: ChangeDetectionStrategy.OnPush,
639
+ encapsulation: ViewEncapsulation.None,
640
+ imports: [CngxIcon, CngxRipple],
641
+ template: NAV_TEMPLATE,
642
+ host: { class: 'cngx-paginator__segment' },
643
+ }]
644
+ }] });
645
+ /** Last-page segment. Disabled on the last page; calls `host.last()`.
646
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
647
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
648
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
649
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
650
+ */
651
+ class CngxPaginatorLast {
652
+ glyph = CNGX_PAGINATOR_GLYPHS.last;
653
+ core = createPaginatorNavCore({
654
+ atBound: (host) => host.isLast(),
655
+ action: (host) => host.last(),
656
+ ariaKey: 'last',
657
+ });
658
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorLast, deps: [], target: i0.ɵɵFactoryTarget.Component });
659
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorLast, isStandalone: true, selector: "cngx-pgn-last", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnLast"], ngImport: i0, template: "\n <button\n type=\"button\"\n class=\"cngx-paginator__button cngx-paginator__nav\"\n cngxRipple\n [attr.aria-disabled]=\"core.disabled()\"\n (click)=\"core.activate()\"\n >\n <cngx-icon aria-hidden=\"true\">{{ glyph }}</cngx-icon>\n <span class=\"cngx-paginator__nav-label\">{{ core.ariaLabel() }}</span>\n </button>\n", isInline: true, dependencies: [{ kind: "component", type: CngxIcon, selector: "cngx-icon, [cngxIcon]", inputs: ["label", "size"], exportAs: ["cngxIcon"] }, { kind: "directive", type: CngxRipple, selector: "[cngxRipple]", inputs: ["rippleColor", "rippleCentered", "rippleDisabled"], exportAs: ["cngxRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
660
+ }
661
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorLast, decorators: [{
662
+ type: Component,
663
+ args: [{
664
+ selector: 'cngx-pgn-last',
665
+ exportAs: 'cngxPgnLast',
666
+ standalone: true,
667
+ changeDetection: ChangeDetectionStrategy.OnPush,
668
+ encapsulation: ViewEncapsulation.None,
669
+ imports: [CngxIcon, CngxRipple],
670
+ template: NAV_TEMPLATE,
671
+ host: { class: 'cngx-paginator__segment' },
672
+ }]
673
+ }] });
674
+
675
+ // Internal pure page-window math for `cngx-pgn-pages`. Not part of the public
676
+ // API - the segment is the only consumer. 0-based throughout (matching the
677
+ // brain's `pageIndex`); the rendered display number is `index + 1`.
678
+ function range(start, end) {
679
+ const length = end - start + 1;
680
+ return length > 0 ? Array.from({ length }, (_, i) => start + i) : [];
681
+ }
682
+ /**
683
+ * Compute the windowed page sequence around `current` for `total` pages.
684
+ * A run of more than one hidden page collapses into a `gap` carrying the hidden
685
+ * 0-based indices (the ellipsis menu's options); a single hidden page renders
686
+ * as a plain page button instead of a gap. Derived from the MUI `usePagination`
687
+ * range algorithm, 0-based. `siblingCount` is how many pages flank `current` on
688
+ * each side; `boundaryCount` is how many pages are pinned at each end. Both
689
+ * default to `1`, reproducing the v1 window byte-for-byte; the `cngx-pgn-pages`
690
+ * inputs and {@link CNGX_PAGINATOR_PAGE_WINDOW_FACTORY} feed non-default values.
691
+ */
692
+ function pageWindow(current, total, siblingCount = 1, boundaryCount = 1) {
693
+ const count = Math.max(1, total);
694
+ const page = Math.min(Math.max(current, 0), count - 1) + 1; // 1-based, clamped
695
+ const startPages = range(1, Math.min(boundaryCount, count));
696
+ const endPages = range(Math.max(count - boundaryCount + 1, boundaryCount + 1), count);
697
+ const siblingsStart = Math.max(Math.min(page - siblingCount, count - boundaryCount - siblingCount * 2 - 1), boundaryCount + 2);
698
+ const siblingsEnd = Math.min(Math.max(page + siblingCount, boundaryCount + siblingCount * 2 + 2), endPages.length > 0 ? endPages[0] - 2 : count - 1);
699
+ const startHidden = range(boundaryCount + 1, siblingsStart - 1);
700
+ const endHidden = range(siblingsEnd + 1, count - boundaryCount);
701
+ const itemList = [
702
+ ...startPages,
703
+ ...(siblingsStart > boundaryCount + 2
704
+ ? ['start-gap']
705
+ : boundaryCount + 1 < count - boundaryCount
706
+ ? [boundaryCount + 1]
707
+ : []),
708
+ ...range(siblingsStart, siblingsEnd),
709
+ ...(siblingsEnd < count - boundaryCount - 1
710
+ ? ['end-gap']
711
+ : count - boundaryCount > boundaryCount
712
+ ? [count - boundaryCount]
713
+ : []),
714
+ ...endPages,
715
+ ];
716
+ let gaps = 0;
717
+ const pages = itemList.map((entry) => {
718
+ if (entry === 'start-gap') {
719
+ gaps++;
720
+ return { kind: 'gap', hidden: startHidden.map((n) => n - 1) };
721
+ }
722
+ if (entry === 'end-gap') {
723
+ gaps++;
724
+ return { kind: 'gap', hidden: endHidden.map((n) => n - 1) };
725
+ }
726
+ return { kind: 'page', index: entry - 1 };
727
+ });
728
+ return { pages, gaps };
729
+ }
730
+ /**
731
+ * Structural equality for two page windows. The `equal` fn for the segment's
732
+ * `computed()` - keeps the reference stable across recomputes that yield an
733
+ * identical window, so downstream `@for` does not churn.
734
+ */
735
+ function pageWindowEqual(a, b) {
736
+ if (a === b) {
737
+ return true;
738
+ }
739
+ if (a.gaps !== b.gaps || a.pages.length !== b.pages.length) {
740
+ return false;
741
+ }
742
+ for (let i = 0; i < a.pages.length; i++) {
743
+ const pa = a.pages[i];
744
+ const pb = b.pages[i];
745
+ if (pa.kind !== pb.kind) {
746
+ return false;
747
+ }
748
+ if (pa.kind === 'page' && pb.kind === 'page') {
749
+ if (pa.index !== pb.index) {
750
+ return false;
751
+ }
752
+ }
753
+ else if (pa.kind === 'gap' && pb.kind === 'gap') {
754
+ if (pa.hidden.length !== pb.hidden.length || pa.hidden.some((h, j) => h !== pb.hidden[j])) {
755
+ return false;
756
+ }
757
+ }
758
+ }
759
+ return true;
760
+ }
761
+
762
+ /**
763
+ * Default page-window factory. Resolves to the built-in {@link pageWindow} math
764
+ * (one sibling each side, one pinned boundary at each end at the `1 / 1`
765
+ * defaults). The segment builds its window via
766
+ * `inject(CNGX_PAGINATOR_PAGE_WINDOW_FACTORY)()` rather than calling this
767
+ * directly, mirroring {@link createPaginatorAnnouncer}.
768
+ *
769
+ * @category ui/paginator
770
+ */
771
+ const createPaginatorPageWindow = () => pageWindow;
772
+ /**
773
+ * Swap token for the page-row truncation algorithm. The default resolves to
774
+ * {@link createPaginatorPageWindow}; override it to replace the whole windowing
775
+ * computation enterprise-wide (via `providers`) or per-component (via
776
+ * `viewProviders`) without forking the segment. Per-instance tweaks to the
777
+ * sibling / boundary counts use the `[siblingCount]` / `[boundaryCount]` inputs
778
+ * on `cngx-pgn-pages` instead. Mirrors {@link CNGX_PAGINATOR_ANNOUNCER_FACTORY}.
779
+ *
780
+ * @category ui/paginator
781
+ */
782
+ const CNGX_PAGINATOR_PAGE_WINDOW_FACTORY = new InjectionToken('CngxPaginatorPageWindowFactory', {
783
+ providedIn: 'root',
784
+ factory: () => createPaginatorPageWindow,
785
+ });
786
+
787
+ /**
788
+ * The numbered page row. One tab stop via `CngxRovingTabindex` (arrows / Home /
789
+ * End move the active page button); the current page carries `aria-current`.
790
+ * A truncation run collapses into an ellipsis button that opens a `CngxListbox`
791
+ * grid of the hidden pages (same select-and-jump model as `cngx-pgn-page-of-pages`,
792
+ * so focus moves into the panel on open).
793
+ *
794
+ * @category ui/paginator
795
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
796
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/card-grid</example-url>
797
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
798
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/async-loading</example-url>
799
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/ellipsis-overflow</example-url>
800
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/first-and-last</example-url>
801
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
802
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
803
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/pill</example-url>
804
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
805
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/segmented</example-url>
806
+ */
807
+ class CngxPaginatorPages {
808
+ host = inject(CNGX_PAGINATOR_HOST);
809
+ config = injectPaginatorConfig();
810
+ glyphs = CNGX_PAGINATOR_GLYPHS;
811
+ /** Pages flanking the current page on each side. Defaults to the v1 window. */
812
+ siblingCount = input(1, ...(ngDevMode ? [{ debugName: "siblingCount" }] : /* istanbul ignore next */ []));
813
+ /** Pages pinned at each end. Defaults to the v1 window. */
814
+ boundaryCount = input(1, ...(ngDevMode ? [{ debugName: "boundaryCount" }] : /* istanbul ignore next */ []));
815
+ /** The page-window computation, swappable enterprise-wide via the DI token. */
816
+ pageWindowFn = inject(CNGX_PAGINATOR_PAGE_WINDOW_FACTORY)();
817
+ /**
818
+ * The rendered page window. Structural `equal` keeps the reference stable
819
+ * across recomputes that yield an identical window, so the `@for` does not
820
+ * churn (signal-equality rule).
821
+ */
822
+ model = computed(() => this.pageWindowFn(this.host.pageIndex(), this.host.totalPages(), this.siblingCount(), this.boundaryCount()), { ...(ngDevMode ? { debugName: "model" } : /* istanbul ignore next */ {}), equal: pageWindowEqual });
823
+ /** Position of the active page within the rendered window (gaps counted). */
824
+ activeWindowIndex = computed(() => {
825
+ const current = this.host.pageIndex();
826
+ const idx = this.model().pages.findIndex((item) => item.kind === 'page' && item.index === current);
827
+ return idx === -1 ? 0 : idx;
828
+ }, ...(ngDevMode ? [{ debugName: "activeWindowIndex" }] : /* istanbul ignore next */ []));
829
+ /**
830
+ * Roving focus cursor for the page row. A `linkedSignal` so the row's single
831
+ * tab stop tracks the active page (Tab lands on `aria-current`) yet still
832
+ * moves freely under the arrow keys between selections: arrow navigation
833
+ * writes the cursor locally, and it re-syncs to the active page whenever the
834
+ * page changes by any path (click / prev / next / Enter). Focus is not
835
+ * selection - the user arrows to a page and Enter commits it.
836
+ */
837
+ rovingIndex = linkedSignal(() => this.activeWindowIndex(), ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
838
+ isCurrent(index) {
839
+ return index === this.host.pageIndex();
840
+ }
841
+ goto(index) {
842
+ this.host.setPage(index);
843
+ }
844
+ /**
845
+ * Open the overflow popover and move focus into the listbox panel, so a
846
+ * keyboard user lands in the grid (the trigger is a roving page-row item, so
847
+ * the listbox trigger's own focus-move does not fire). `Enter`/`Space` on the
848
+ * button dispatch a native click, so this covers mouse and keyboard alike.
849
+ */
850
+ openOverflow(popover, panel) {
851
+ popover.toggle();
852
+ if (popover.isVisible()) {
853
+ queueMicrotask(() => panel.focus());
854
+ }
855
+ }
856
+ /**
857
+ * Restore focus to the ellipsis trigger when the panel closes (Escape /
858
+ * outside click), so a keyboard user is not dropped to the page body. If a
859
+ * selection re-rendered the window away, the trigger is gone and the guard
860
+ * skips it.
861
+ */
862
+ onOverflowToggle(event, trigger) {
863
+ if (event.newState === 'closed' && trigger.isConnected) {
864
+ trigger.focus();
865
+ }
866
+ }
867
+ onSelectOverflow(value) {
868
+ if (typeof value === 'number') {
869
+ this.host.setPage(value);
870
+ }
871
+ }
872
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPages, deps: [], target: i0.ɵɵFactoryTarget.Component });
873
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorPages, isStandalone: true, selector: "cngx-pgn-pages", inputs: { siblingCount: { classPropertyName: "siblingCount", publicName: "siblingCount", isSignal: true, isRequired: false, transformFunction: null }, boundaryCount: { classPropertyName: "boundaryCount", publicName: "boundaryCount", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnPages"], ngImport: i0, template: `
874
+ <div class="cngx-paginator__pages" cngxRovingTabindex [(activeIndex)]="rovingIndex">
875
+ @for (item of model().pages; track $index) {
876
+ @if (item.kind === 'page') {
877
+ <button
878
+ type="button"
879
+ cngxRovingItem
880
+ class="cngx-paginator__button cngx-paginator__page"
881
+ [class.cngx-paginator__page--current]="isCurrent(item.index)"
882
+ [attr.aria-current]="isCurrent(item.index) ? 'page' : null"
883
+ [attr.aria-label]="config.ariaLabels.page(item.index + 1)"
884
+ [attr.aria-disabled]="host.isBusy() ? 'true' : null"
885
+ (click)="goto(item.index)"
886
+ >
887
+ {{ item.index + 1 }}
888
+ </button>
889
+ } @else {
890
+ <button
891
+ type="button"
892
+ cngxRovingItem
893
+ #moreBtn
894
+ class="cngx-paginator__button cngx-paginator__more"
895
+ [cngxListboxTrigger]="moreList"
896
+ [cngxPopoverTrigger]="morePopover"
897
+ [haspopup]="'listbox'"
898
+ [popover]="morePopover"
899
+ [attr.aria-label]="config.ariaLabels.morePages"
900
+ (click)="openOverflow(morePopover, moreUl)"
901
+ >
902
+ {{ glyphs.more }}
903
+ </button>
904
+ <div cngxPopover #morePopover="cngxPopover" (toggle)="onOverflowToggle($event, moreBtn)">
905
+ <ul
906
+ cngxListbox
907
+ #moreList="cngxListbox"
908
+ #moreUl
909
+ tabindex="0"
910
+ class="cngx-paginator__overflow-panel"
911
+ [label]="config.ariaLabels.morePages"
912
+ [value]="null"
913
+ (valueChange)="onSelectOverflow($event)"
914
+ >
915
+ @for (hidden of item.hidden; track hidden) {
916
+ <li cngxOption class="cngx-paginator__option" [value]="hidden">{{ hidden + 1 }}</li>
917
+ }
918
+ </ul>
919
+ </div>
920
+ }
921
+ }
922
+ </div>
923
+ `, isInline: true, dependencies: [{ kind: "directive", type: CngxRovingTabindex, selector: "[cngxRovingTabindex]", inputs: ["orientation", "loop", "activeIndex", "virtualCount"], outputs: ["orientationChange", "activeIndexChange"], exportAs: ["cngxRovingTabindex"] }, { kind: "directive", type: CngxRovingItem, selector: "[cngxRovingItem]", inputs: ["cngxRovingItemDisabled"], exportAs: ["cngxRovingItem"] }, { kind: "directive", type: CngxListbox, selector: "[cngxListbox]", inputs: ["label", "value", "selectedValues", "multiple", "compareWith", "cngxSearchRef", "externalActivation", "explicitOptions"], outputs: ["valueChange", "selectedValuesChange"], exportAs: ["cngxListbox"] }, { kind: "directive", type: CngxListboxTrigger, selector: "[cngxListboxTrigger]", inputs: ["cngxListboxTrigger", "popover", "closeOnSelect"], outputs: ["backspaceOnEmpty"], exportAs: ["cngxListboxTrigger"] }, { kind: "directive", type: CngxOption, selector: "[cngxOption]", inputs: ["value", "disabled", "label"], exportAs: ["cngxOption"] }, { kind: "directive", type: CngxPopover, selector: "[cngxPopover]", inputs: ["placement", "positionTryFallbacks", "offset", "closeOnEscape", "mode", "cngxPopoverOpen", "exclusive"], exportAs: ["cngxPopover"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
924
+ }
925
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPages, decorators: [{
926
+ type: Component,
927
+ args: [{
928
+ selector: 'cngx-pgn-pages',
929
+ exportAs: 'cngxPgnPages',
930
+ standalone: true,
931
+ changeDetection: ChangeDetectionStrategy.OnPush,
932
+ encapsulation: ViewEncapsulation.None,
933
+ imports: [
934
+ CngxRovingTabindex,
935
+ CngxRovingItem,
936
+ CngxListbox,
937
+ CngxListboxTrigger,
938
+ CngxOption,
939
+ CngxPopover,
940
+ CngxPopoverTrigger,
941
+ ],
942
+ template: `
943
+ <div class="cngx-paginator__pages" cngxRovingTabindex [(activeIndex)]="rovingIndex">
944
+ @for (item of model().pages; track $index) {
945
+ @if (item.kind === 'page') {
946
+ <button
947
+ type="button"
948
+ cngxRovingItem
949
+ class="cngx-paginator__button cngx-paginator__page"
950
+ [class.cngx-paginator__page--current]="isCurrent(item.index)"
951
+ [attr.aria-current]="isCurrent(item.index) ? 'page' : null"
952
+ [attr.aria-label]="config.ariaLabels.page(item.index + 1)"
953
+ [attr.aria-disabled]="host.isBusy() ? 'true' : null"
954
+ (click)="goto(item.index)"
955
+ >
956
+ {{ item.index + 1 }}
957
+ </button>
958
+ } @else {
959
+ <button
960
+ type="button"
961
+ cngxRovingItem
962
+ #moreBtn
963
+ class="cngx-paginator__button cngx-paginator__more"
964
+ [cngxListboxTrigger]="moreList"
965
+ [cngxPopoverTrigger]="morePopover"
966
+ [haspopup]="'listbox'"
967
+ [popover]="morePopover"
968
+ [attr.aria-label]="config.ariaLabels.morePages"
969
+ (click)="openOverflow(morePopover, moreUl)"
970
+ >
971
+ {{ glyphs.more }}
972
+ </button>
973
+ <div cngxPopover #morePopover="cngxPopover" (toggle)="onOverflowToggle($event, moreBtn)">
974
+ <ul
975
+ cngxListbox
976
+ #moreList="cngxListbox"
977
+ #moreUl
978
+ tabindex="0"
979
+ class="cngx-paginator__overflow-panel"
980
+ [label]="config.ariaLabels.morePages"
981
+ [value]="null"
982
+ (valueChange)="onSelectOverflow($event)"
983
+ >
984
+ @for (hidden of item.hidden; track hidden) {
985
+ <li cngxOption class="cngx-paginator__option" [value]="hidden">{{ hidden + 1 }}</li>
986
+ }
987
+ </ul>
988
+ </div>
989
+ }
990
+ }
991
+ </div>
992
+ `,
993
+ host: { class: 'cngx-paginator__segment' },
994
+ }]
995
+ }], propDecorators: { siblingCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "siblingCount", required: false }] }], boundaryCount: [{ type: i0.Input, args: [{ isSignal: true, alias: "boundaryCount", required: false }] }] } });
996
+
997
+ /**
998
+ * Range-readout segment: renders `start-end of total` for the current page.
999
+ * Pure derivation from the host `range()`/`total()` signals - no local state,
1000
+ * no writes. The text (including the `of` connector) comes from the
1001
+ * config range formatter, so it localises with the rest of the cascade. Tabular
1002
+ * figures keep the numerals from reflowing as the page changes.
1003
+ *
1004
+ * @category ui/paginator
1005
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/reset-on-filter</example-url>
1006
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
1007
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/paginated-list</example-url>
1008
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-contexts/select-panel-footer</example-url>
1009
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
1010
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
1011
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/minimal</example-url>
1012
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/numbered</example-url>
1013
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
1014
+ */
1015
+ class CngxPaginatorRange {
1016
+ host = inject(CNGX_PAGINATOR_HOST);
1017
+ config = injectPaginatorConfig();
1018
+ /** 1-based index of the first item on the current page (0 when empty). */
1019
+ start = computed(() => this.host.total() === 0 ? 0 : this.host.range()[0] + 1, ...(ngDevMode ? [{ debugName: "start" }] : /* istanbul ignore next */ []));
1020
+ /**
1021
+ * 1-based index of the last item on the current page. The brain's `range()`
1022
+ * upper bound is uncapped (`start + pageSize`), so a partial final page is
1023
+ * clamped to `total` here for an honest readout.
1024
+ */
1025
+ end = computed(() => Math.min(this.host.range()[1], this.host.total()), ...(ngDevMode ? [{ debugName: "end" }] : /* istanbul ignore next */ []));
1026
+ /** Formatted readout from the config range formatter (EN default `start-end of total`). */
1027
+ text = computed(() => this.config.formats.range(this.start(), this.end(), this.host.total()), ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
1028
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorRange, deps: [], target: i0.ɵɵFactoryTarget.Component });
1029
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorRange, isStandalone: true, selector: "cngx-pgn-range", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnRange"], ngImport: i0, template: `<span class="cngx-paginator__range" [innerHTML]="text()"></span>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1030
+ }
1031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorRange, decorators: [{
1032
+ type: Component,
1033
+ args: [{
1034
+ selector: 'cngx-pgn-range',
1035
+ exportAs: 'cngxPgnRange',
1036
+ standalone: true,
1037
+ changeDetection: ChangeDetectionStrategy.OnPush,
1038
+ encapsulation: ViewEncapsulation.None,
1039
+ template: `<span class="cngx-paginator__range" [innerHTML]="text()"></span>`,
1040
+ host: { class: 'cngx-paginator__segment' },
1041
+ }]
1042
+ }] });
1043
+
1044
+ /**
1045
+ * Go-to-page segment: a native `<input type="number">`. Typing (or the spinner)
1046
+ * navigates live via `input`; Enter / blur additionally clamp and re-sync the
1047
+ * field. The brain clamps out-of-range values, so the field reflects the clamped
1048
+ * page back. Accessible name from config (EN default, Pillar 2).
1049
+ *
1050
+ * @category ui/paginator
1051
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
1052
+ */
1053
+ class CngxPaginatorGoto {
1054
+ host = inject(CNGX_PAGINATOR_HOST);
1055
+ config = injectPaginatorConfig();
1056
+ /** Live navigation on every keystroke / spinner step - no field re-sync, so
1057
+ * typing is never interrupted; the clamp re-sync happens on commit. */
1058
+ navigate(event) {
1059
+ const value = Number(event.target.value);
1060
+ if (Number.isFinite(value) && value >= 1) {
1061
+ this.host.setPage(value - 1);
1062
+ }
1063
+ }
1064
+ commit(event) {
1065
+ const input = event.target;
1066
+ const value = Number(input.value);
1067
+ if (Number.isFinite(value) && value >= 1) {
1068
+ this.host.setPage(value - 1);
1069
+ }
1070
+ // Re-sync the field to the effective page: the brain may have clamped to a
1071
+ // bound (no signal change, so the [value] binding would not refresh), or
1072
+ // rejected an empty / sub-1 entry. Either way the field shows the truth.
1073
+ input.value = String(this.host.pageIndex() + 1);
1074
+ }
1075
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorGoto, deps: [], target: i0.ɵɵFactoryTarget.Component });
1076
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorGoto, isStandalone: true, selector: "cngx-pgn-goto", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnGoto"], ngImport: i0, template: `
1077
+ <input
1078
+ type="number"
1079
+ class="cngx-paginator__goto-input"
1080
+ min="1"
1081
+ [max]="host.totalPages()"
1082
+ [value]="host.pageIndex() + 1"
1083
+ [attr.aria-label]="config.ariaLabels.goToPage"
1084
+ [attr.aria-disabled]="host.isBusy() ? 'true' : null"
1085
+ (input)="navigate($event)"
1086
+ (keydown.enter)="commit($event)"
1087
+ (blur)="commit($event)"
1088
+ />
1089
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1090
+ }
1091
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorGoto, decorators: [{
1092
+ type: Component,
1093
+ args: [{
1094
+ selector: 'cngx-pgn-goto',
1095
+ exportAs: 'cngxPgnGoto',
1096
+ standalone: true,
1097
+ changeDetection: ChangeDetectionStrategy.OnPush,
1098
+ encapsulation: ViewEncapsulation.None,
1099
+ template: `
1100
+ <input
1101
+ type="number"
1102
+ class="cngx-paginator__goto-input"
1103
+ min="1"
1104
+ [max]="host.totalPages()"
1105
+ [value]="host.pageIndex() + 1"
1106
+ [attr.aria-label]="config.ariaLabels.goToPage"
1107
+ [attr.aria-disabled]="host.isBusy() ? 'true' : null"
1108
+ (input)="navigate($event)"
1109
+ (keydown.enter)="commit($event)"
1110
+ (blur)="commit($event)"
1111
+ />
1112
+ `,
1113
+ host: { class: 'cngx-paginator__segment' },
1114
+ }]
1115
+ }] });
1116
+
1117
+ /**
1118
+ * Items-per-page segment. A `CngxListbox` dropdown (never a native `<select>`,
1119
+ * never the forms select family - keeps `@cngx/ui/paginator` free of a
1120
+ * `@cngx/forms` dependency). `[options]` is data, not a feature toggle.
1121
+ * Picking a size routes through `host.setPageSize`, which resets to
1122
+ * page 0 (brain semantics). The selected size is derived from `host.pageSize()`,
1123
+ * so the panel selection and the trigger label never drift (Pillar 1).
1124
+ *
1125
+ * @category ui/paginator
1126
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/url-synced-paging</example-url>
1127
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/page-size-and-range</example-url>
1128
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/bar</example-url>
1129
+ */
1130
+ class CngxPaginatorPageSize {
1131
+ host = inject(CNGX_PAGINATOR_HOST);
1132
+ config = injectPaginatorConfig();
1133
+ glyphs = CNGX_PAGINATOR_GLYPHS;
1134
+ /** Selectable page sizes. Pure data - the segment is content-agnostic. */
1135
+ options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
1136
+ onSelect(value) {
1137
+ if (typeof value === 'number') {
1138
+ this.host.setPageSize(value);
1139
+ }
1140
+ }
1141
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPageSize, deps: [], target: i0.ɵɵFactoryTarget.Component });
1142
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorPageSize, isStandalone: true, selector: "cngx-pgn-page-size", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnPageSize"], ngImport: i0, template: `
1143
+ <button
1144
+ type="button"
1145
+ class="cngx-paginator__button cngx-paginator__select"
1146
+ [cngxListboxTrigger]="lb"
1147
+ [cngxPopoverTrigger]="pop"
1148
+ [haspopup]="'listbox'"
1149
+ [popover]="pop"
1150
+ [attr.aria-label]="config.ariaLabels.itemsPerPage"
1151
+ [disabled]="host.isBusy()"
1152
+ (click)="pop.toggle()"
1153
+ >
1154
+ <span class="cngx-paginator__select-label">{{ host.pageSize() }}</span>
1155
+ <span class="cngx-paginator__select-caret" aria-hidden="true">{{ glyphs.caret }}</span>
1156
+ </button>
1157
+ <div cngxPopover #pop="cngxPopover">
1158
+ <ul
1159
+ cngxListbox
1160
+ class="cngx-paginator__select-panel"
1161
+ tabindex="0"
1162
+ [label]="config.ariaLabels.itemsPerPage"
1163
+ [value]="host.pageSize()"
1164
+ (valueChange)="onSelect($event)"
1165
+ #lb="cngxListbox"
1166
+ >
1167
+ @for (option of options(); track option) {
1168
+ <li cngxOption class="cngx-paginator__option" [value]="option">{{ option }}</li>
1169
+ }
1170
+ </ul>
1171
+ </div>
1172
+ `, isInline: true, dependencies: [{ kind: "directive", type: CngxListbox, selector: "[cngxListbox]", inputs: ["label", "value", "selectedValues", "multiple", "compareWith", "cngxSearchRef", "externalActivation", "explicitOptions"], outputs: ["valueChange", "selectedValuesChange"], exportAs: ["cngxListbox"] }, { kind: "directive", type: CngxListboxTrigger, selector: "[cngxListboxTrigger]", inputs: ["cngxListboxTrigger", "popover", "closeOnSelect"], outputs: ["backspaceOnEmpty"], exportAs: ["cngxListboxTrigger"] }, { kind: "directive", type: CngxOption, selector: "[cngxOption]", inputs: ["value", "disabled", "label"], exportAs: ["cngxOption"] }, { kind: "directive", type: CngxPopover, selector: "[cngxPopover]", inputs: ["placement", "positionTryFallbacks", "offset", "closeOnEscape", "mode", "cngxPopoverOpen", "exclusive"], exportAs: ["cngxPopover"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1173
+ }
1174
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPageSize, decorators: [{
1175
+ type: Component,
1176
+ args: [{
1177
+ selector: 'cngx-pgn-page-size',
1178
+ exportAs: 'cngxPgnPageSize',
1179
+ standalone: true,
1180
+ changeDetection: ChangeDetectionStrategy.OnPush,
1181
+ encapsulation: ViewEncapsulation.None,
1182
+ imports: [CngxListbox, CngxListboxTrigger, CngxOption, CngxPopover, CngxPopoverTrigger],
1183
+ template: `
1184
+ <button
1185
+ type="button"
1186
+ class="cngx-paginator__button cngx-paginator__select"
1187
+ [cngxListboxTrigger]="lb"
1188
+ [cngxPopoverTrigger]="pop"
1189
+ [haspopup]="'listbox'"
1190
+ [popover]="pop"
1191
+ [attr.aria-label]="config.ariaLabels.itemsPerPage"
1192
+ [disabled]="host.isBusy()"
1193
+ (click)="pop.toggle()"
1194
+ >
1195
+ <span class="cngx-paginator__select-label">{{ host.pageSize() }}</span>
1196
+ <span class="cngx-paginator__select-caret" aria-hidden="true">{{ glyphs.caret }}</span>
1197
+ </button>
1198
+ <div cngxPopover #pop="cngxPopover">
1199
+ <ul
1200
+ cngxListbox
1201
+ class="cngx-paginator__select-panel"
1202
+ tabindex="0"
1203
+ [label]="config.ariaLabels.itemsPerPage"
1204
+ [value]="host.pageSize()"
1205
+ (valueChange)="onSelect($event)"
1206
+ #lb="cngxListbox"
1207
+ >
1208
+ @for (option of options(); track option) {
1209
+ <li cngxOption class="cngx-paginator__option" [value]="option">{{ option }}</li>
1210
+ }
1211
+ </ul>
1212
+ </div>
1213
+ `,
1214
+ host: { class: 'cngx-paginator__segment' },
1215
+ }]
1216
+ }], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
1217
+
1218
+ /**
1219
+ * Page-of-pages segment. A `CngxListbox` dropdown of `1..totalPages`; picking
1220
+ * page `n` routes through `host.setPage(n - 1)`. The option list is derived
1221
+ * from `host.totalPages()` and the selected entry from `host.pageIndex()`, so
1222
+ * both track the brain with zero local state (Pillar 1). Like the page-size
1223
+ * segment it avoids native `<select>` and the forms family, keeping the entry
1224
+ * `@cngx/forms`-free.
1225
+ *
1226
+ * @category ui/paginator
1227
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-segments/go-to-page</example-url>
1228
+ */
1229
+ class CngxPaginatorPageOfPages {
1230
+ host = inject(CNGX_PAGINATOR_HOST);
1231
+ config = injectPaginatorConfig();
1232
+ glyphs = CNGX_PAGINATOR_GLYPHS;
1233
+ /**
1234
+ * The 1-based page numbers `1..totalPages`. Length-keyed `equal` keeps the
1235
+ * reference stable while the count is unchanged - the contents are fully
1236
+ * determined by the length, so the `@for` never churns (signal-equality rule).
1237
+ */
1238
+ pages = computed(() => Array.from({ length: this.host.totalPages() }, (_, i) => i + 1), { ...(ngDevMode ? { debugName: "pages" } : /* istanbul ignore next */ {}), equal: (a, b) => a.length === b.length });
1239
+ onSelect(value) {
1240
+ if (typeof value === 'number') {
1241
+ this.host.setPage(value - 1);
1242
+ }
1243
+ }
1244
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPageOfPages, deps: [], target: i0.ɵɵFactoryTarget.Component });
1245
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorPageOfPages, isStandalone: true, selector: "cngx-pgn-page-of-pages", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnPageOfPages"], ngImport: i0, template: `
1246
+ <button
1247
+ type="button"
1248
+ class="cngx-paginator__button cngx-paginator__select"
1249
+ [cngxListboxTrigger]="lb"
1250
+ [cngxPopoverTrigger]="pop"
1251
+ [haspopup]="'listbox'"
1252
+ [popover]="pop"
1253
+ [attr.aria-label]="config.ariaLabels.pageOfPages"
1254
+ [disabled]="host.isBusy()"
1255
+ (click)="pop.toggle()"
1256
+ >
1257
+ <span class="cngx-paginator__select-label"
1258
+ ><b>{{ host.pageIndex() + 1 }}</b> / {{ host.totalPages() }}</span
1259
+ >
1260
+ <span class="cngx-paginator__select-caret" aria-hidden="true">{{ glyphs.caret }}</span>
1261
+ </button>
1262
+ <div cngxPopover #pop="cngxPopover">
1263
+ <ul
1264
+ cngxListbox
1265
+ class="cngx-paginator__overflow-panel"
1266
+ tabindex="0"
1267
+ [label]="config.ariaLabels.pageOfPages"
1268
+ [value]="host.pageIndex() + 1"
1269
+ (valueChange)="onSelect($event)"
1270
+ #lb="cngxListbox"
1271
+ >
1272
+ @for (page of pages(); track page) {
1273
+ <li cngxOption class="cngx-paginator__option" [value]="page">{{ page }}</li>
1274
+ }
1275
+ </ul>
1276
+ </div>
1277
+ `, isInline: true, dependencies: [{ kind: "directive", type: CngxListbox, selector: "[cngxListbox]", inputs: ["label", "value", "selectedValues", "multiple", "compareWith", "cngxSearchRef", "externalActivation", "explicitOptions"], outputs: ["valueChange", "selectedValuesChange"], exportAs: ["cngxListbox"] }, { kind: "directive", type: CngxListboxTrigger, selector: "[cngxListboxTrigger]", inputs: ["cngxListboxTrigger", "popover", "closeOnSelect"], outputs: ["backspaceOnEmpty"], exportAs: ["cngxListboxTrigger"] }, { kind: "directive", type: CngxOption, selector: "[cngxOption]", inputs: ["value", "disabled", "label"], exportAs: ["cngxOption"] }, { kind: "directive", type: CngxPopover, selector: "[cngxPopover]", inputs: ["placement", "positionTryFallbacks", "offset", "closeOnEscape", "mode", "cngxPopoverOpen", "exclusive"], exportAs: ["cngxPopover"] }, { kind: "directive", type: CngxPopoverTrigger, selector: "[cngxPopoverTrigger]", inputs: ["cngxPopoverTrigger", "haspopup", "restoreFocus"], exportAs: ["cngxPopoverTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1278
+ }
1279
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorPageOfPages, decorators: [{
1280
+ type: Component,
1281
+ args: [{
1282
+ selector: 'cngx-pgn-page-of-pages',
1283
+ exportAs: 'cngxPgnPageOfPages',
1284
+ standalone: true,
1285
+ changeDetection: ChangeDetectionStrategy.OnPush,
1286
+ encapsulation: ViewEncapsulation.None,
1287
+ imports: [CngxListbox, CngxListboxTrigger, CngxOption, CngxPopover, CngxPopoverTrigger],
1288
+ template: `
1289
+ <button
1290
+ type="button"
1291
+ class="cngx-paginator__button cngx-paginator__select"
1292
+ [cngxListboxTrigger]="lb"
1293
+ [cngxPopoverTrigger]="pop"
1294
+ [haspopup]="'listbox'"
1295
+ [popover]="pop"
1296
+ [attr.aria-label]="config.ariaLabels.pageOfPages"
1297
+ [disabled]="host.isBusy()"
1298
+ (click)="pop.toggle()"
1299
+ >
1300
+ <span class="cngx-paginator__select-label"
1301
+ ><b>{{ host.pageIndex() + 1 }}</b> / {{ host.totalPages() }}</span
1302
+ >
1303
+ <span class="cngx-paginator__select-caret" aria-hidden="true">{{ glyphs.caret }}</span>
1304
+ </button>
1305
+ <div cngxPopover #pop="cngxPopover">
1306
+ <ul
1307
+ cngxListbox
1308
+ class="cngx-paginator__overflow-panel"
1309
+ tabindex="0"
1310
+ [label]="config.ariaLabels.pageOfPages"
1311
+ [value]="host.pageIndex() + 1"
1312
+ (valueChange)="onSelect($event)"
1313
+ #lb="cngxListbox"
1314
+ >
1315
+ @for (page of pages(); track page) {
1316
+ <li cngxOption class="cngx-paginator__option" [value]="page">{{ page }}</li>
1317
+ }
1318
+ </ul>
1319
+ </div>
1320
+ `,
1321
+ host: { class: 'cngx-paginator__segment' },
1322
+ }]
1323
+ }] });
1324
+
1325
+ /** Visible dot count cap before the edge-shrink window kicks in. */
1326
+ const MAX_DOTS = 7;
1327
+ /**
1328
+ * Compute the windowed dot sequence around `current` for `total` pages. Small
1329
+ * counts render every dot full-size; large counts render a `MAX_DOTS` window
1330
+ * that slides to keep `current` centred, with the two dots nearest a truncated
1331
+ * edge rendered medium then small (iOS page-control edge-shrink). Pure, internal
1332
+ * to this segment - dots stay organism-internal, no shared atom.
1333
+ */
1334
+ function dotWindow(current, total) {
1335
+ const count = Math.max(0, total);
1336
+ if (count === 0) {
1337
+ return [];
1338
+ }
1339
+ const visible = Math.min(count, MAX_DOTS);
1340
+ const half = Math.floor(visible / 2);
1341
+ const clamped = Math.min(Math.max(current, 0), count - 1);
1342
+ const start = Math.max(0, Math.min(clamped - half, count - visible));
1343
+ const end = start + visible - 1;
1344
+ const moreBefore = start > 0;
1345
+ const moreAfter = end < count - 1;
1346
+ const dots = [];
1347
+ for (let i = start; i <= end; i++) {
1348
+ let size = 'full';
1349
+ if (moreBefore && i === start) {
1350
+ size = 'small';
1351
+ }
1352
+ else if (moreBefore && i === start + 1) {
1353
+ size = 'medium';
1354
+ }
1355
+ else if (moreAfter && i === end) {
1356
+ size = 'small';
1357
+ }
1358
+ else if (moreAfter && i === end - 1) {
1359
+ size = 'medium';
1360
+ }
1361
+ dots.push({ index: i, size });
1362
+ }
1363
+ return dots;
1364
+ }
1365
+ function dotsEqual(a, b) {
1366
+ if (a === b) {
1367
+ return true;
1368
+ }
1369
+ if (a.length !== b.length) {
1370
+ return false;
1371
+ }
1372
+ return a.every((d, i) => d.index === b[i].index && d.size === b[i].size);
1373
+ }
1374
+ /**
1375
+ * The dots indicator: one circular `<button>` per page, windowed with an
1376
+ * iOS-style edge-shrink for large counts. The active dot carries
1377
+ * `aria-current="page"`; every dot exposes its page name via `aria-label`
1378
+ * (the circle itself is decorative). Click navigates through the brain, gated
1379
+ * while busy. Dot DOM + windowing live here, not in a shared atom (over-
1380
+ * abstraction avoided - extract only when a second consumer appears).
1381
+ *
1382
+ * @category ui/paginator
1383
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/dots</example-url>
1384
+ */
1385
+ class CngxPaginatorDots {
1386
+ host = inject(CNGX_PAGINATOR_HOST);
1387
+ config = injectPaginatorConfig();
1388
+ /**
1389
+ * The rendered dot window. Structural `equal` keeps the reference stable
1390
+ * across recomputes that yield an identical window, so the `@for` does not
1391
+ * churn (signal-equality rule).
1392
+ */
1393
+ model = computed(() => dotWindow(this.host.pageIndex(), this.host.totalPages()), { ...(ngDevMode ? { debugName: "model" } : /* istanbul ignore next */ {}), equal: dotsEqual });
1394
+ isCurrent(index) {
1395
+ return index === this.host.pageIndex();
1396
+ }
1397
+ goto(index) {
1398
+ this.host.setPage(index);
1399
+ }
1400
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorDots, deps: [], target: i0.ɵɵFactoryTarget.Component });
1401
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorDots, isStandalone: true, selector: "cngx-pgn-dots", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnDots"], ngImport: i0, template: `
1402
+ <div class="cngx-paginator__dots">
1403
+ @for (dot of model(); track dot.index) {
1404
+ <button
1405
+ type="button"
1406
+ class="cngx-paginator__dot"
1407
+ [class.cngx-paginator__dot--current]="isCurrent(dot.index)"
1408
+ [attr.data-size]="dot.size"
1409
+ [attr.aria-current]="isCurrent(dot.index) ? 'page' : null"
1410
+ [attr.aria-label]="config.ariaLabels.page(dot.index + 1)"
1411
+ [attr.aria-disabled]="host.isBusy() ? 'true' : null"
1412
+ (click)="goto(dot.index)"
1413
+ ></button>
1414
+ }
1415
+ </div>
1416
+ `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1417
+ }
1418
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorDots, decorators: [{
1419
+ type: Component,
1420
+ args: [{
1421
+ selector: 'cngx-pgn-dots',
1422
+ exportAs: 'cngxPgnDots',
1423
+ standalone: true,
1424
+ changeDetection: ChangeDetectionStrategy.OnPush,
1425
+ encapsulation: ViewEncapsulation.None,
1426
+ template: `
1427
+ <div class="cngx-paginator__dots">
1428
+ @for (dot of model(); track dot.index) {
1429
+ <button
1430
+ type="button"
1431
+ class="cngx-paginator__dot"
1432
+ [class.cngx-paginator__dot--current]="isCurrent(dot.index)"
1433
+ [attr.data-size]="dot.size"
1434
+ [attr.aria-current]="isCurrent(dot.index) ? 'page' : null"
1435
+ [attr.aria-label]="config.ariaLabels.page(dot.index + 1)"
1436
+ [attr.aria-disabled]="host.isBusy() ? 'true' : null"
1437
+ (click)="goto(dot.index)"
1438
+ ></button>
1439
+ }
1440
+ </div>
1441
+ `,
1442
+ host: { class: 'cngx-paginator__segment' },
1443
+ }]
1444
+ }] });
1445
+
1446
+ /**
1447
+ * Page-status readout: renders "Page n of m" for the current page. Pure
1448
+ * derivation from the host `pageIndex()`/`totalPages()` signals - no local
1449
+ * state, no writes. It is the visible counterpart of the
1450
+ * `announcements.pageChange` live-region phrasing, and the collapse target the
1451
+ * responsive number row swaps to once the paginator's container narrows. Text
1452
+ * comes from the config `pageStatus` formatter, so it localises with the rest of
1453
+ * the cascade; tabular figures keep the numerals from reflowing as the page
1454
+ * changes.
1455
+ *
1456
+ * @category ui/paginator
1457
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-behaviors/responsive-collapse</example-url>
1458
+ */
1459
+ class CngxPaginatorStatus {
1460
+ host = inject(CNGX_PAGINATOR_HOST);
1461
+ config = injectPaginatorConfig();
1462
+ /** Formatted "Page n of m" readout from the config formatter (1-based page). */
1463
+ text = computed(() => this.config.formats.pageStatus(this.host.pageIndex() + 1, this.host.totalPages()), ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
1464
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorStatus, deps: [], target: i0.ɵɵFactoryTarget.Component });
1465
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorStatus, isStandalone: true, selector: "cngx-pgn-status", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnStatus"], ngImport: i0, template: `<span class="cngx-paginator__status" [innerHTML]="text()"></span>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1466
+ }
1467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorStatus, decorators: [{
1468
+ type: Component,
1469
+ args: [{
1470
+ selector: 'cngx-pgn-status',
1471
+ exportAs: 'cngxPgnStatus',
1472
+ standalone: true,
1473
+ changeDetection: ChangeDetectionStrategy.OnPush,
1474
+ encapsulation: ViewEncapsulation.None,
1475
+ template: `<span class="cngx-paginator__status" [innerHTML]="text()"></span>`,
1476
+ host: { class: 'cngx-paginator__segment' },
1477
+ }]
1478
+ }] });
1479
+
1480
+ /**
1481
+ * Progress-rail segment: a horizontal rail whose fill tracks the current page
1482
+ * position, with an overlaid knob riding the fill edge. The track, fill, and
1483
+ * `role="progressbar"` a11y are composed from the `CngxProgress` atom - not
1484
+ * reinvented here (same precedent as the progress-bar stepper). The only new
1485
+ * part is the position knob, a decorative (`aria-hidden`) dot positioned by an
1486
+ * inline `inset-inline-start.%`, which `CngxProgress` cannot express. The fill
1487
+ * percentage derives purely from the host `pageIndex()`/`totalPages()` signals -
1488
+ * no local state, no writes.
1489
+ *
1490
+ * @category ui/paginator
1491
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-skins/rail</example-url>
1492
+ */
1493
+ class CngxPaginatorRail {
1494
+ host = inject(CNGX_PAGINATOR_HOST);
1495
+ config = injectPaginatorConfig();
1496
+ /**
1497
+ * Fill percentage (0-100) of the current page across the page span. A single
1498
+ * page (or none) reads 0; the last page reads 100. Drives both the composed
1499
+ * `cngx-progress` `[progress]` and the knob's inline position.
1500
+ */
1501
+ fillPercent = computed(() => {
1502
+ const total = this.host.totalPages();
1503
+ return total <= 1 ? 0 : (this.host.pageIndex() / (total - 1)) * 100;
1504
+ }, ...(ngDevMode ? [{ debugName: "fillPercent" }] : /* istanbul ignore next */ []));
1505
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorRail, deps: [], target: i0.ɵɵFactoryTarget.Component });
1506
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.4", type: CngxPaginatorRail, isStandalone: true, selector: "cngx-pgn-rail", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnRail"], ngImport: i0, template: `
1507
+ <div class="cngx-paginator__rail">
1508
+ <cngx-progress
1509
+ variant="linear"
1510
+ [progress]="fillPercent()"
1511
+ [label]="config.ariaLabels.railPosition"
1512
+ />
1513
+ <span
1514
+ class="cngx-paginator__rail-knob"
1515
+ aria-hidden="true"
1516
+ [style.inset-inline-start.%]="fillPercent()"
1517
+ ></span>
1518
+ </div>
1519
+ `, isInline: true, dependencies: [{ kind: "component", type: CngxProgress, selector: "cngx-progress", inputs: ["state", "progress", "variant", "showLabel", "label"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1520
+ }
1521
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorRail, decorators: [{
1522
+ type: Component,
1523
+ args: [{
1524
+ selector: 'cngx-pgn-rail',
1525
+ exportAs: 'cngxPgnRail',
1526
+ standalone: true,
1527
+ changeDetection: ChangeDetectionStrategy.OnPush,
1528
+ encapsulation: ViewEncapsulation.None,
1529
+ imports: [CngxProgress],
1530
+ template: `
1531
+ <div class="cngx-paginator__rail">
1532
+ <cngx-progress
1533
+ variant="linear"
1534
+ [progress]="fillPercent()"
1535
+ [label]="config.ariaLabels.railPosition"
1536
+ />
1537
+ <span
1538
+ class="cngx-paginator__rail-knob"
1539
+ aria-hidden="true"
1540
+ [style.inset-inline-start.%]="fillPercent()"
1541
+ ></span>
1542
+ </div>
1543
+ `,
1544
+ host: { class: 'cngx-paginator__segment' },
1545
+ }]
1546
+ }] });
1547
+
1548
+ /**
1549
+ * Load-more segment: an append-don't-replace trigger over the same brain. One
1550
+ * `host.next()` button plus a `shown / total` count readout. The cumulative
1551
+ * slice is derived by the brain (`host.cumulativeRange()`); this segment holds
1552
+ * no accumulation state - the consumer slices its own array from
1553
+ * `cumulativeRange()`.
1554
+ *
1555
+ * Disabled (and so a no-op) on the last page or while busy. `aria-disabled`
1556
+ * (not native `disabled`) keeps the button focusable so AT hears the bound
1557
+ * state, matching the nav segments; the busy/position reason is already spoken
1558
+ * by the shell live region.
1559
+ *
1560
+ * @category ui/paginator
1561
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/load-more</example-url>
1562
+ */
1563
+ class CngxPaginatorLoadMore {
1564
+ host = inject(CNGX_PAGINATOR_HOST);
1565
+ config = injectPaginatorConfig();
1566
+ /**
1567
+ * Accessible name from the config cascade. On the last page the actionable
1568
+ * `Load more` name is replaced with the exhausted-state `allLoaded` label so
1569
+ * AT does not announce an action on the disabled button.
1570
+ */
1571
+ ariaLabel = computed(() => this.host.isLast()
1572
+ ? this.config.ariaLabels.allLoaded(this.host.total())
1573
+ : this.config.ariaLabels.loadMore, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
1574
+ /** Disabled on the last page or while busy - the trigger becomes a no-op. */
1575
+ disabled = computed(() => this.host.isLast() || this.host.isBusy(), ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
1576
+ /**
1577
+ * Items revealed so far. The brain's `cumulativeRange()` upper bound is
1578
+ * uncapped (`(pageIndex + 1) * pageSize`), so a partial final page is clamped
1579
+ * to `total` here for an honest readout.
1580
+ */
1581
+ shown = computed(() => Math.min(this.host.cumulativeRange()[1], this.host.total()), ...(ngDevMode ? [{ debugName: "shown" }] : /* istanbul ignore next */ []));
1582
+ /** Reveal the next page. Guarded so a disabled click is a no-op. */
1583
+ handleClick() {
1584
+ if (this.disabled()) {
1585
+ return;
1586
+ }
1587
+ this.host.next();
1588
+ }
1589
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorLoadMore, deps: [], target: i0.ɵɵFactoryTarget.Component });
1590
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorLoadMore, isStandalone: true, selector: "cngx-pgn-load-more", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnLoadMore"], ngImport: i0, template: `
1591
+ <button
1592
+ type="button"
1593
+ class="cngx-paginator__button cngx-paginator__load-more"
1594
+ cngxRipple
1595
+ [attr.aria-label]="ariaLabel()"
1596
+ [attr.aria-disabled]="disabled()"
1597
+ (click)="handleClick()"
1598
+ >
1599
+ <span class="cngx-paginator__load-more-label">{{ ariaLabel() }}</span>
1600
+ @if (!host.isLast()) {
1601
+ <span class="cngx-paginator__load-more-count" aria-hidden="true">
1602
+ {{ shown() }} / {{ host.total() }}
1603
+ </span>
1604
+ }
1605
+ </button>
1606
+ `, isInline: true, dependencies: [{ kind: "directive", type: CngxRipple, selector: "[cngxRipple]", inputs: ["rippleColor", "rippleCentered", "rippleDisabled"], exportAs: ["cngxRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1607
+ }
1608
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorLoadMore, decorators: [{
1609
+ type: Component,
1610
+ args: [{
1611
+ selector: 'cngx-pgn-load-more',
1612
+ exportAs: 'cngxPgnLoadMore',
1613
+ standalone: true,
1614
+ changeDetection: ChangeDetectionStrategy.OnPush,
1615
+ encapsulation: ViewEncapsulation.None,
1616
+ imports: [CngxRipple],
1617
+ template: `
1618
+ <button
1619
+ type="button"
1620
+ class="cngx-paginator__button cngx-paginator__load-more"
1621
+ cngxRipple
1622
+ [attr.aria-label]="ariaLabel()"
1623
+ [attr.aria-disabled]="disabled()"
1624
+ (click)="handleClick()"
1625
+ >
1626
+ <span class="cngx-paginator__load-more-label">{{ ariaLabel() }}</span>
1627
+ @if (!host.isLast()) {
1628
+ <span class="cngx-paginator__load-more-count" aria-hidden="true">
1629
+ {{ shown() }} / {{ host.total() }}
1630
+ </span>
1631
+ }
1632
+ </button>
1633
+ `,
1634
+ host: { class: 'cngx-paginator__segment' },
1635
+ }]
1636
+ }] });
1637
+
1638
+ /**
1639
+ * Infinite-scroll segment: a bottom-of-list sentinel that auto-advances the
1640
+ * page as it scrolls into view, composing `CngxInfiniteScroll`. The in-template
1641
+ * sentinel binds the directive's `[enabled]` / `[loading]` inputs and its
1642
+ * `(loadMore)` output directly to the `CNGX_PAGINATOR_HOST` signals, so the
1643
+ * directive's built-in debounce, busy-gate, enabled-disable, and auto-disconnect
1644
+ * own the auto-advance double-fire guard - this segment adds no
1645
+ * `IntersectionObserver` code of its own. The directive sits on the sentinel
1646
+ * element (not as a `hostDirective`) precisely so its `[enabled]` / `[loading]`
1647
+ * inputs can bind to the host-token signals; a static `hostDirectives`
1648
+ * declaration could not express that wiring.
1649
+ *
1650
+ * Like `cngx-pgn-load-more`, this stays a thin trigger atom: it injects
1651
+ * `CNGX_PAGINATOR_HOST`, holds no accumulation state, and renders no async view
1652
+ * of its own. The consumer slices its own array from the brain's
1653
+ * `cumulativeRange()`; the busy / error / end experience belongs to the consumer
1654
+ * or to a composing container, keeping the segment reusable unchanged.
1655
+ *
1656
+ * Exhausted state: once `host.isLast()` the sentinel disables (`enabled` is
1657
+ * `false`, so the observer disconnects). It swaps its busy affordance for the
1658
+ * `allLoaded` end label only after the final load settles (`!host.isBusy()`),
1659
+ * so it never claims "all loaded" while the last batch is still arriving, and
1660
+ * the tail is never a silent or stale spinner.
1661
+ *
1662
+ * `[root]` / `[rootMargin]` forward straight to the composed directive so a
1663
+ * consumer can point the sentinel at a bounded scroll container (a feed box)
1664
+ * rather than the viewport, and tune the pre-fetch distance. They are plain
1665
+ * passthrough config - the segment still owns no observer code and no state.
1666
+ *
1667
+ * @category ui/paginator
1668
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/infinite</example-url>
1669
+ */
1670
+ class CngxPaginatorInfinite {
1671
+ host = inject(CNGX_PAGINATOR_HOST);
1672
+ config = injectPaginatorConfig();
1673
+ /**
1674
+ * CSS selector for the scroll container the sentinel is watched within.
1675
+ * `null` (default) observes the viewport. Forwarded to `CngxInfiniteScroll`.
1676
+ */
1677
+ root = input(null, ...(ngDevMode ? [{ debugName: "root" }] : /* istanbul ignore next */ []));
1678
+ /**
1679
+ * Pre-fetch margin around the scroll container, forwarded to
1680
+ * `CngxInfiniteScroll`. The directive default loads ~200px before the
1681
+ * sentinel is visible.
1682
+ */
1683
+ rootMargin = input('0px 0px 200px 0px', ...(ngDevMode ? [{ debugName: "rootMargin" }] : /* istanbul ignore next */ []));
1684
+ /**
1685
+ * Exhausted: the last page is reached AND its load has settled. Gating on
1686
+ * `!isBusy()` keeps the spinner up while the final batch is still loading, so
1687
+ * the segment never claims "all loaded" before the last rows arrive.
1688
+ */
1689
+ isExhausted = computed(() => this.host.isLast() && !this.host.isBusy(), ...(ngDevMode ? [{ debugName: "isExhausted" }] : /* istanbul ignore next */ []));
1690
+ /**
1691
+ * Exhausted-state label from the config cascade, reused from the load-more
1692
+ * segment so both append modes speak the same "all N loaded" end state rather
1693
+ * than leaving the tail implicit.
1694
+ */
1695
+ endLabel = computed(() => this.config.ariaLabels.allLoaded(this.host.total()), ...(ngDevMode ? [{ debugName: "endLabel" }] : /* istanbul ignore next */ []));
1696
+ /** Status text shown beside the spinner while more pages remain. */
1697
+ busyLabel = computed(() => this.config.announcements.loading, ...(ngDevMode ? [{ debugName: "busyLabel" }] : /* istanbul ignore next */ []));
1698
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorInfinite, deps: [], target: i0.ɵɵFactoryTarget.Component });
1699
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorInfinite, isStandalone: true, selector: "cngx-pgn-infinite", inputs: { root: { classPropertyName: "root", publicName: "root", isSignal: true, isRequired: false, transformFunction: null }, rootMargin: { classPropertyName: "rootMargin", publicName: "rootMargin", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnInfinite"], ngImport: i0, template: `
1700
+ <div
1701
+ class="cngx-paginator__infinite"
1702
+ cngxInfiniteScroll
1703
+ [enabled]="!host.isLast()"
1704
+ [loading]="host.isBusy()"
1705
+ [root]="root()"
1706
+ [rootMargin]="rootMargin()"
1707
+ (loadMore)="host.next()"
1708
+ >
1709
+ @if (isExhausted()) {
1710
+ <span class="cngx-paginator__infinite-end">{{ endLabel() }}</span>
1711
+ } @else {
1712
+ <span class="cngx-paginator__infinite-spinner" aria-hidden="true"></span>
1713
+ <span class="cngx-paginator__infinite-status">{{ busyLabel() }}</span>
1714
+ }
1715
+ </div>
1716
+ `, isInline: true, dependencies: [{ kind: "directive", type: CngxInfiniteScroll, selector: "[cngxInfiniteScroll]", inputs: ["threshold", "rootMargin", "root", "enabled", "loading", "debounceMs"], outputs: ["loadMore"], exportAs: ["cngxInfiniteScroll"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1717
+ }
1718
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorInfinite, decorators: [{
1719
+ type: Component,
1720
+ args: [{
1721
+ selector: 'cngx-pgn-infinite',
1722
+ exportAs: 'cngxPgnInfinite',
1723
+ standalone: true,
1724
+ changeDetection: ChangeDetectionStrategy.OnPush,
1725
+ encapsulation: ViewEncapsulation.None,
1726
+ imports: [CngxInfiniteScroll],
1727
+ template: `
1728
+ <div
1729
+ class="cngx-paginator__infinite"
1730
+ cngxInfiniteScroll
1731
+ [enabled]="!host.isLast()"
1732
+ [loading]="host.isBusy()"
1733
+ [root]="root()"
1734
+ [rootMargin]="rootMargin()"
1735
+ (loadMore)="host.next()"
1736
+ >
1737
+ @if (isExhausted()) {
1738
+ <span class="cngx-paginator__infinite-end">{{ endLabel() }}</span>
1739
+ } @else {
1740
+ <span class="cngx-paginator__infinite-spinner" aria-hidden="true"></span>
1741
+ <span class="cngx-paginator__infinite-status">{{ busyLabel() }}</span>
1742
+ }
1743
+ </div>
1744
+ `,
1745
+ host: { class: 'cngx-paginator__segment' },
1746
+ }]
1747
+ }], propDecorators: { root: [{ type: i0.Input, args: [{ isSignal: true, alias: "root", required: false }] }], rootMargin: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootMargin", required: false }] }] } });
1748
+
1749
+ /**
1750
+ * Alphabetical / category chips: a `role="group"` toggle strip over the
1751
+ * {@link CngxBucketPaginate} range model. One `<button>` per bucket; the active
1752
+ * bucket carries `aria-pressed`, an empty bucket is `disabled`. The model is
1753
+ * injected through `CNGX_BUCKET_PAGINATE_HOST`, never the concrete directive
1754
+ * class, so the strip stays decompose-ready.
1755
+ *
1756
+ * Every chip's pressed / disabled / name state is a `computed()` read of the
1757
+ * host signals - nothing is synced. An empty chip is not a silent dead control:
1758
+ * its accessible name comes from `ariaLabels.emptyBucket(label)`, which states
1759
+ * the bucket has no items, so AT hears the reason the chip is disabled.
1760
+ *
1761
+ * Keyboard navigation reuses `CngxRovingTabindex` / `CngxRovingItem` (no new
1762
+ * keyboard code, matching `cngx-pgn-pages`): arrows move the focus cursor and
1763
+ * skip disabled chips, the single tab stop tracks the active bucket, and
1764
+ * activation commits via `select()`.
1765
+ *
1766
+ * @category ui/paginator
1767
+ * <example-url>http://localhost:4200/#/ui/paginator/paginator-modes/alphabetical</example-url>
1768
+ */
1769
+ class CngxPaginatorAlpha {
1770
+ host = inject(CNGX_BUCKET_PAGINATE_HOST);
1771
+ config = injectPaginatorConfig();
1772
+ /**
1773
+ * Roving focus cursor. A `linkedSignal` so the strip's single tab stop tracks
1774
+ * the active bucket (Tab lands on the pressed chip) yet still moves freely
1775
+ * under the arrow keys; when nothing is selected it falls back to the first
1776
+ * non-empty chip so Tab never lands on a disabled control.
1777
+ */
1778
+ rovingIndex = linkedSignal(() => {
1779
+ const buckets = this.host.buckets();
1780
+ const active = this.host.active();
1781
+ if (active !== null) {
1782
+ const index = buckets.findIndex((bucket) => bucket.label === active);
1783
+ if (index !== -1) {
1784
+ return index;
1785
+ }
1786
+ }
1787
+ const firstEnabled = buckets.findIndex((bucket) => !this.host.isEmpty(bucket.label));
1788
+ return firstEnabled === -1 ? 0 : firstEnabled;
1789
+ }, ...(ngDevMode ? [{ debugName: "rovingIndex" }] : /* istanbul ignore next */ []));
1790
+ isActive(label) {
1791
+ return this.host.active() === label;
1792
+ }
1793
+ /**
1794
+ * Accessible name: the available chip uses `ariaLabels.bucket`; an empty chip
1795
+ * swaps to `ariaLabels.emptyBucket` so the disabled control states its reason.
1796
+ */
1797
+ chipLabel(label) {
1798
+ return this.host.isEmpty(label)
1799
+ ? this.config.ariaLabels.emptyBucket(label)
1800
+ : this.config.ariaLabels.bucket(label);
1801
+ }
1802
+ select(label) {
1803
+ this.host.select(label);
1804
+ }
1805
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorAlpha, deps: [], target: i0.ɵɵFactoryTarget.Component });
1806
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxPaginatorAlpha, isStandalone: true, selector: "cngx-pgn-alpha", host: { classAttribute: "cngx-paginator__segment" }, exportAs: ["cngxPgnAlpha"], ngImport: i0, template: `
1807
+ <div
1808
+ class="cngx-paginator__alpha"
1809
+ role="group"
1810
+ [attr.aria-label]="config.ariaLabels.bucketGroup"
1811
+ cngxRovingTabindex
1812
+ [(activeIndex)]="rovingIndex"
1813
+ >
1814
+ @for (bucket of host.buckets(); track bucket.label) {
1815
+ @let isEmpty = host.isEmpty(bucket.label);
1816
+ <button
1817
+ type="button"
1818
+ cngxRovingItem
1819
+ [cngxRovingItemDisabled]="isEmpty"
1820
+ class="cngx-paginator__button cngx-paginator__alpha-chip"
1821
+ [class.cngx-paginator__alpha-chip--active]="isActive(bucket.label)"
1822
+ [attr.aria-pressed]="isActive(bucket.label) ? 'true' : 'false'"
1823
+ [attr.aria-label]="chipLabel(bucket.label)"
1824
+ [disabled]="isEmpty"
1825
+ (click)="select(bucket.label)"
1826
+ >
1827
+ {{ bucket.label }}
1828
+ </button>
1829
+ }
1830
+ </div>
1831
+ `, isInline: true, styles: ["@layer cngx.components{.cngx-paginator{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:var(--cngx-paginator-row-gap, .75rem);font-family:var( --cngx-paginator-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif );font-size:var(--cngx-paginator-font-size, .875rem)}.cngx-paginator__progress{position:absolute;inset-inline:0;inset-block-start:0;block-size:var(--cngx-paginator-progress-thickness, 2px)}.cngx-paginator__segment{display:inline-flex;align-items:center}.cngx-paginator__nav-label,.cngx-paginator__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}.cngx-paginator__pages{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-gap, .25rem)}.cngx-paginator__button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:var(--cngx-paginator-button-size, 2.25rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-button-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-button-border-color, transparent);border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__button:hover{background:var( --cngx-paginator-button-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__button:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__button[aria-disabled=true],.cngx-paginator__button:disabled{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__page[aria-current=page]{background:var( --cngx-paginator-current-bg, color-mix(in oklch, currentColor 12%, transparent) );color:var(--cngx-paginator-current-color, currentColor);border-color:var(--cngx-paginator-current-border-color, transparent);font-weight:600}.cngx-paginator__range,.cngx-paginator__status{font-variant-numeric:tabular-nums;color:var(--cngx-paginator-range-color, currentColor);white-space:nowrap}.cngx-paginator__load-more{gap:var(--cngx-paginator-load-more-gap, .5rem);white-space:nowrap}.cngx-paginator__load-more-count{font-variant-numeric:tabular-nums;color:var( --cngx-paginator-load-more-count-color, color-mix(in oklch, currentColor 60%, transparent) )}.cngx-paginator__goto-input{box-sizing:border-box;width:var(--cngx-paginator-goto-width, 3.5rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-goto-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-goto-border-color, color-mix(in oklch, currentColor 25%, transparent));border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;font-variant-numeric:tabular-nums}.cngx-paginator__goto-input:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__select{gap:var(--cngx-paginator-select-gap, .25rem);font-variant-numeric:tabular-nums}.cngx-paginator__select-caret{display:inline-flex;font-size:var(--cngx-paginator-caret-size, 1em);line-height:1;opacity:var(--cngx-paginator-caret-opacity, .55)}.cngx-paginator__select-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__option{display:flex;align-items:center;min-height:var(--cngx-paginator-option-size, 2rem);padding:var(--cngx-paginator-option-padding, 0 .75rem);border-radius:var(--cngx-paginator-option-radius, .25rem);cursor:pointer;font-variant-numeric:tabular-nums}.cngx-paginator__overflow-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;display:grid;grid-template-columns:repeat(var(--cngx-paginator-overflow-columns, 5),var(--cngx-paginator-overflow-cell-size, 2rem));gap:var(--cngx-paginator-overflow-gap, .15rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__overflow-panel .cngx-paginator__option{justify-content:center;min-block-size:var(--cngx-paginator-overflow-cell-size, 2rem);padding:var(--cngx-paginator-overflow-cell-padding, 0)}.cngx-paginator__overflow-panel:focus,.cngx-paginator__overflow-panel:focus-visible{outline:none}[popover]:has(>.cngx-paginator__select-panel),[popover]:has(>.cngx-paginator__overflow-panel){margin:0;padding:0;border:0;background:none}.cngx-paginator__option.cngx-option--highlighted,.cngx-paginator__option.cngx-menu-item--highlighted{background:var( --cngx-paginator-option-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__option.cngx-option--selected{background:var( --cngx-paginator-option-selected-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 14%, transparent) );color:var(--cngx-paginator-option-selected-color, var(--cngx-color-primary, oklch(.66 .19 50)));font-weight:600}.cngx-paginator[data-density=compact]{--cngx-paginator-button-size: 1.75rem;--cngx-paginator-gap: .125rem;font-size:var(--cngx-paginator-font-size-compact, .8125rem)}.cngx-paginator[data-density=comfortable]{--cngx-paginator-button-size: 2.75rem;--cngx-paginator-gap: .5rem;font-size:var(--cngx-paginator-font-size-comfortable, .95rem)}.cngx-paginator__dots{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-dot-gap, .5rem)}.cngx-paginator__dot{box-sizing:border-box;width:var(--cngx-paginator-dot-size, .5rem);height:var(--cngx-paginator-dot-size, .5rem);padding:0;border:0;border-radius:50%;background:var(--cngx-paginator-dot-color, color-mix(in oklch, currentColor 35%, transparent));cursor:pointer;transition:transform var(--cngx-paginator-transition, .15s ease),background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__dot[data-size=medium]{transform:scale(var(--cngx-paginator-dot-medium-scale, .7))}.cngx-paginator__dot[data-size=small]{transform:scale(var(--cngx-paginator-dot-small-scale, .45))}.cngx-paginator__dot--current{background:var( --cngx-paginator-dot-current-color, var(--cngx-color-primary, oklch(.66 .19 50)) );transform:scale(var(--cngx-paginator-dot-current-scale, 1.15))}.cngx-paginator__dot:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__dot[aria-disabled=true]{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__rail{position:relative;display:flex;align-items:center;flex:1 1 auto;min-inline-size:var(--cngx-paginator-rail-min-size, 6rem)}.cngx-paginator__rail cngx-progress{flex:1 1 auto;--cngx-progress-height: var(--cngx-paginator-rail-height, .375rem);--cngx-progress-color: var( --cngx-paginator-rail-fill, var(--cngx-color-primary, oklch(.66 .19 50)) );--cngx-progress-track-color: var( --cngx-paginator-rail-track, var(--cngx-color-border, oklch(.9 .005 250)) )}.cngx-paginator__rail-knob{position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:var(--cngx-paginator-rail-knob-size, .875rem);block-size:var(--cngx-paginator-rail-knob-size, .875rem);border-radius:50%;background:var(--cngx-paginator-rail-knob-bg, oklch(1 0 0));border:var(--cngx-paginator-rail-knob-border-width, 2px) solid var(--cngx-paginator-rail-knob-border-color, oklch(.66 .19 50));transform:translate(-50%,-50%);transition:inset-inline-start var(--cngx-paginator-motion-duration, .2s) cubic-bezier(.3,.7,0,1)}.cngx-paginator__infinite{display:flex;align-items:center;justify-content:center;gap:var(--cngx-paginator-infinite-gap, .5rem);padding:var(--cngx-paginator-infinite-padding, .9rem);color:var(--cngx-paginator-infinite-color, color-mix(in oklch, currentColor 60%, transparent))}.cngx-paginator__infinite-status,.cngx-paginator__infinite-end{font-size:var(--cngx-paginator-infinite-font-size, .8125rem)}.cngx-paginator__infinite-spinner{inline-size:var(--cngx-paginator-infinite-spinner-size, 1rem);block-size:var(--cngx-paginator-infinite-spinner-size, 1rem);border-radius:50%;border:var(--cngx-paginator-infinite-spinner-width, 2px) solid color-mix(in oklch,var(--cngx-color-primary, oklch(.66 .19 50)) 30%,transparent);border-block-start-color:var(--cngx-color-primary, oklch(.66 .19 50));animation:cngx-paginator-spin var(--cngx-paginator-infinite-spinner-duration, .7s) linear infinite}@keyframes cngx-paginator-spin{to{transform:rotate(360deg)}}.cngx-paginator__alpha{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cngx-paginator-alpha-gap, .4rem)}.cngx-paginator__alpha-chip{border-color:var( --cngx-paginator-alpha-chip-border-color, var(--cngx-color-border, oklch(.88 .005 250)) );background:var(--cngx-paginator-alpha-chip-bg, var(--cngx-color-surface, oklch(1 0 0)));font-weight:500}.cngx-paginator__alpha-chip:hover:not([aria-pressed=true]):not(:disabled){border-color:var(--cngx-color-primary, oklch(.66 .19 50));color:var(--cngx-color-primary, oklch(.66 .19 50))}.cngx-paginator__alpha-chip[aria-pressed=true]{background:var(--cngx-paginator-current-bg, var(--cngx-color-primary, oklch(.66 .19 50)));color:var(--cngx-paginator-current-color, var(--cngx-color-on-primary, oklch(1 0 0)));border-color:var( --cngx-paginator-current-border-color, var(--cngx-color-primary, oklch(.66 .19 50)) );font-weight:600}@media(prefers-reduced-motion:reduce){.cngx-paginator__button,.cngx-paginator__dot{transition:none}.cngx-paginator__infinite-spinner{animation:none}}}\n"], dependencies: [{ kind: "directive", type: CngxRovingTabindex, selector: "[cngxRovingTabindex]", inputs: ["orientation", "loop", "activeIndex", "virtualCount"], outputs: ["orientationChange", "activeIndexChange"], exportAs: ["cngxRovingTabindex"] }, { kind: "directive", type: CngxRovingItem, selector: "[cngxRovingItem]", inputs: ["cngxRovingItemDisabled"], exportAs: ["cngxRovingItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1832
+ }
1833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPaginatorAlpha, decorators: [{
1834
+ type: Component,
1835
+ args: [{ selector: 'cngx-pgn-alpha', exportAs: 'cngxPgnAlpha', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [CngxRovingTabindex, CngxRovingItem], template: `
1836
+ <div
1837
+ class="cngx-paginator__alpha"
1838
+ role="group"
1839
+ [attr.aria-label]="config.ariaLabels.bucketGroup"
1840
+ cngxRovingTabindex
1841
+ [(activeIndex)]="rovingIndex"
1842
+ >
1843
+ @for (bucket of host.buckets(); track bucket.label) {
1844
+ @let isEmpty = host.isEmpty(bucket.label);
1845
+ <button
1846
+ type="button"
1847
+ cngxRovingItem
1848
+ [cngxRovingItemDisabled]="isEmpty"
1849
+ class="cngx-paginator__button cngx-paginator__alpha-chip"
1850
+ [class.cngx-paginator__alpha-chip--active]="isActive(bucket.label)"
1851
+ [attr.aria-pressed]="isActive(bucket.label) ? 'true' : 'false'"
1852
+ [attr.aria-label]="chipLabel(bucket.label)"
1853
+ [disabled]="isEmpty"
1854
+ (click)="select(bucket.label)"
1855
+ >
1856
+ {{ bucket.label }}
1857
+ </button>
1858
+ }
1859
+ </div>
1860
+ `, host: { class: 'cngx-paginator__segment' }, styles: ["@layer cngx.components{.cngx-paginator{position:relative;display:flex;flex-direction:row;align-items:center;flex-wrap:wrap;gap:var(--cngx-paginator-row-gap, .75rem);font-family:var( --cngx-paginator-font-family, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif );font-size:var(--cngx-paginator-font-size, .875rem)}.cngx-paginator__progress{position:absolute;inset-inline:0;inset-block-start:0;block-size:var(--cngx-paginator-progress-thickness, 2px)}.cngx-paginator__segment{display:inline-flex;align-items:center}.cngx-paginator__nav-label,.cngx-paginator__sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}.cngx-paginator__pages{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-gap, .25rem)}.cngx-paginator__button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-width:var(--cngx-paginator-button-size, 2.25rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-button-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-button-border-color, transparent);border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;line-height:1;cursor:pointer;-webkit-user-select:none;user-select:none;transition:background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__button:hover{background:var( --cngx-paginator-button-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__button:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__button[aria-disabled=true],.cngx-paginator__button:disabled{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__page[aria-current=page]{background:var( --cngx-paginator-current-bg, color-mix(in oklch, currentColor 12%, transparent) );color:var(--cngx-paginator-current-color, currentColor);border-color:var(--cngx-paginator-current-border-color, transparent);font-weight:600}.cngx-paginator__range,.cngx-paginator__status{font-variant-numeric:tabular-nums;color:var(--cngx-paginator-range-color, currentColor);white-space:nowrap}.cngx-paginator__load-more{gap:var(--cngx-paginator-load-more-gap, .5rem);white-space:nowrap}.cngx-paginator__load-more-count{font-variant-numeric:tabular-nums;color:var( --cngx-paginator-load-more-count-color, color-mix(in oklch, currentColor 60%, transparent) )}.cngx-paginator__goto-input{box-sizing:border-box;width:var(--cngx-paginator-goto-width, 3.5rem);height:var(--cngx-paginator-button-size, 2.25rem);padding:var(--cngx-paginator-goto-padding, 0 .5rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-goto-border-color, color-mix(in oklch, currentColor 25%, transparent));border-radius:var(--cngx-paginator-button-radius, .375rem);background:var(--cngx-paginator-button-bg, transparent);color:var(--cngx-paginator-button-color, currentColor);font:inherit;font-variant-numeric:tabular-nums}.cngx-paginator__goto-input:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__select{gap:var(--cngx-paginator-select-gap, .25rem);font-variant-numeric:tabular-nums}.cngx-paginator__select-caret{display:inline-flex;font-size:var(--cngx-paginator-caret-size, 1em);line-height:1;opacity:var(--cngx-paginator-caret-opacity, .55)}.cngx-paginator__select-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__option{display:flex;align-items:center;min-height:var(--cngx-paginator-option-size, 2rem);padding:var(--cngx-paginator-option-padding, 0 .75rem);border-radius:var(--cngx-paginator-option-radius, .25rem);cursor:pointer;font-variant-numeric:tabular-nums}.cngx-paginator__overflow-panel{margin:0;padding:var(--cngx-paginator-panel-padding, .25rem);list-style:none;display:grid;grid-template-columns:repeat(var(--cngx-paginator-overflow-columns, 5),var(--cngx-paginator-overflow-cell-size, 2rem));gap:var(--cngx-paginator-overflow-gap, .15rem);border:var(--cngx-paginator-button-border-width, 1px) solid var(--cngx-paginator-panel-border-color, color-mix(in oklch, currentColor 20%, transparent));border-radius:var(--cngx-paginator-panel-radius, .5rem);background:var(--cngx-paginator-panel-bg, Canvas);color:var(--cngx-paginator-panel-color, currentColor);box-shadow:var(--cngx-paginator-panel-shadow, 0 4px 12px rgb(0 0 0 / .15))}.cngx-paginator__overflow-panel .cngx-paginator__option{justify-content:center;min-block-size:var(--cngx-paginator-overflow-cell-size, 2rem);padding:var(--cngx-paginator-overflow-cell-padding, 0)}.cngx-paginator__overflow-panel:focus,.cngx-paginator__overflow-panel:focus-visible{outline:none}[popover]:has(>.cngx-paginator__select-panel),[popover]:has(>.cngx-paginator__overflow-panel){margin:0;padding:0;border:0;background:none}.cngx-paginator__option.cngx-option--highlighted,.cngx-paginator__option.cngx-menu-item--highlighted{background:var( --cngx-paginator-option-hover-bg, color-mix(in oklch, currentColor 10%, transparent) )}.cngx-paginator__option.cngx-option--selected{background:var( --cngx-paginator-option-selected-bg, color-mix(in oklch, var(--cngx-color-primary, oklch(.66 .19 50)) 14%, transparent) );color:var(--cngx-paginator-option-selected-color, var(--cngx-color-primary, oklch(.66 .19 50)));font-weight:600}.cngx-paginator[data-density=compact]{--cngx-paginator-button-size: 1.75rem;--cngx-paginator-gap: .125rem;font-size:var(--cngx-paginator-font-size-compact, .8125rem)}.cngx-paginator[data-density=comfortable]{--cngx-paginator-button-size: 2.75rem;--cngx-paginator-gap: .5rem;font-size:var(--cngx-paginator-font-size-comfortable, .95rem)}.cngx-paginator__dots{display:inline-flex;flex-direction:row;align-items:center;gap:var(--cngx-paginator-dot-gap, .5rem)}.cngx-paginator__dot{box-sizing:border-box;width:var(--cngx-paginator-dot-size, .5rem);height:var(--cngx-paginator-dot-size, .5rem);padding:0;border:0;border-radius:50%;background:var(--cngx-paginator-dot-color, color-mix(in oklch, currentColor 35%, transparent));cursor:pointer;transition:transform var(--cngx-paginator-transition, .15s ease),background var(--cngx-paginator-transition, .15s ease)}.cngx-paginator__dot[data-size=medium]{transform:scale(var(--cngx-paginator-dot-medium-scale, .7))}.cngx-paginator__dot[data-size=small]{transform:scale(var(--cngx-paginator-dot-small-scale, .45))}.cngx-paginator__dot--current{background:var( --cngx-paginator-dot-current-color, var(--cngx-color-primary, oklch(.66 .19 50)) );transform:scale(var(--cngx-paginator-dot-current-scale, 1.15))}.cngx-paginator__dot:focus-visible{outline:var(--cngx-paginator-focus-ring, 2px solid currentColor);outline-offset:var(--cngx-paginator-focus-offset, 2px)}.cngx-paginator__dot[aria-disabled=true]{cursor:not-allowed;opacity:var(--cngx-paginator-disabled-opacity, .45)}.cngx-paginator__rail{position:relative;display:flex;align-items:center;flex:1 1 auto;min-inline-size:var(--cngx-paginator-rail-min-size, 6rem)}.cngx-paginator__rail cngx-progress{flex:1 1 auto;--cngx-progress-height: var(--cngx-paginator-rail-height, .375rem);--cngx-progress-color: var( --cngx-paginator-rail-fill, var(--cngx-color-primary, oklch(.66 .19 50)) );--cngx-progress-track-color: var( --cngx-paginator-rail-track, var(--cngx-color-border, oklch(.9 .005 250)) )}.cngx-paginator__rail-knob{position:absolute;inset-block-start:50%;inset-inline-start:0;inline-size:var(--cngx-paginator-rail-knob-size, .875rem);block-size:var(--cngx-paginator-rail-knob-size, .875rem);border-radius:50%;background:var(--cngx-paginator-rail-knob-bg, oklch(1 0 0));border:var(--cngx-paginator-rail-knob-border-width, 2px) solid var(--cngx-paginator-rail-knob-border-color, oklch(.66 .19 50));transform:translate(-50%,-50%);transition:inset-inline-start var(--cngx-paginator-motion-duration, .2s) cubic-bezier(.3,.7,0,1)}.cngx-paginator__infinite{display:flex;align-items:center;justify-content:center;gap:var(--cngx-paginator-infinite-gap, .5rem);padding:var(--cngx-paginator-infinite-padding, .9rem);color:var(--cngx-paginator-infinite-color, color-mix(in oklch, currentColor 60%, transparent))}.cngx-paginator__infinite-status,.cngx-paginator__infinite-end{font-size:var(--cngx-paginator-infinite-font-size, .8125rem)}.cngx-paginator__infinite-spinner{inline-size:var(--cngx-paginator-infinite-spinner-size, 1rem);block-size:var(--cngx-paginator-infinite-spinner-size, 1rem);border-radius:50%;border:var(--cngx-paginator-infinite-spinner-width, 2px) solid color-mix(in oklch,var(--cngx-color-primary, oklch(.66 .19 50)) 30%,transparent);border-block-start-color:var(--cngx-color-primary, oklch(.66 .19 50));animation:cngx-paginator-spin var(--cngx-paginator-infinite-spinner-duration, .7s) linear infinite}@keyframes cngx-paginator-spin{to{transform:rotate(360deg)}}.cngx-paginator__alpha{display:flex;flex-wrap:wrap;align-items:center;gap:var(--cngx-paginator-alpha-gap, .4rem)}.cngx-paginator__alpha-chip{border-color:var( --cngx-paginator-alpha-chip-border-color, var(--cngx-color-border, oklch(.88 .005 250)) );background:var(--cngx-paginator-alpha-chip-bg, var(--cngx-color-surface, oklch(1 0 0)));font-weight:500}.cngx-paginator__alpha-chip:hover:not([aria-pressed=true]):not(:disabled){border-color:var(--cngx-color-primary, oklch(.66 .19 50));color:var(--cngx-color-primary, oklch(.66 .19 50))}.cngx-paginator__alpha-chip[aria-pressed=true]{background:var(--cngx-paginator-current-bg, var(--cngx-color-primary, oklch(.66 .19 50)));color:var(--cngx-paginator-current-color, var(--cngx-color-on-primary, oklch(1 0 0)));border-color:var( --cngx-paginator-current-border-color, var(--cngx-color-primary, oklch(.66 .19 50)) );font-weight:600}@media(prefers-reduced-motion:reduce){.cngx-paginator__button,.cngx-paginator__dot{transition:none}.cngx-paginator__infinite-spinner{animation:none}}}\n"] }]
1861
+ }] });
1862
+
1863
+ /**
1864
+ * Generated bundle index. Do not edit.
1865
+ */
1866
+
1867
+ 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 };
1868
+ //# sourceMappingURL=cngx-ui-paginator.mjs.map