@cngx/ui 0.1.0-rc.7 → 0.1.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/a11y/README.md +11 -5
- package/accordion/README.md +4 -2
- package/breadcrumb/README.md +262 -0
- package/collection/README.md +6 -0
- package/command-palette/README.md +227 -0
- package/data-grid-accordion/README.md +76 -2
- package/feedback/README.md +40 -0
- package/fesm2022/cngx-ui-a11y.mjs +189 -57
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +120 -36
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +121 -56
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +228 -108
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +180 -23
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +204 -62
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +395 -119
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +209 -40
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +498 -101
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +16 -6
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +1074 -460
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +76 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +67 -24
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +72 -47
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +555 -204
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-overlay.mjs +69 -13
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +553 -198
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +344 -109
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +4 -16
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +107 -8
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +146 -46
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +234 -99
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +88 -25
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +98 -23
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +101 -33
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +15 -20
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-paginator/README.md +9 -2
- package/mat-tabs/README.md +30 -6
- package/mat-tabs/styles/mat-tabs.css +188 -42
- package/overlay/README.md +9 -4
- package/package.json +31 -7
- package/paginator/README.md +8 -4
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +33 -11
- package/speak/README.md +3 -2
- package/stepper/README.md +14 -2
- package/timeline/README.md +1 -1
- package/toc/README.md +4 -1
- package/types/cngx-ui-a11y.d.ts +121 -30
- package/types/cngx-ui-accordion.d.ts +100 -28
- package/types/cngx-ui-action-button.d.ts +44 -3
- package/types/cngx-ui-breadcrumb.d.ts +167 -60
- package/types/cngx-ui-chart-panel.d.ts +122 -18
- package/types/cngx-ui-collection.d.ts +157 -55
- package/types/cngx-ui-command-palette.d.ts +297 -183
- package/types/cngx-ui-context-menu.d.ts +140 -10
- package/types/cngx-ui-data-grid-accordion.d.ts +278 -39
- package/types/cngx-ui-empty-state.d.ts +9 -2
- package/types/cngx-ui-feedback.d.ts +605 -59
- package/types/cngx-ui-mat-accordion.d.ts +30 -1
- package/types/cngx-ui-mat-paginator.d.ts +37 -8
- package/types/cngx-ui-mat-stepper.d.ts +23 -11
- package/types/cngx-ui-mat-tabs.d.ts +250 -34
- package/types/cngx-ui-overlay.d.ts +56 -10
- package/types/cngx-ui-paginator.d.ts +425 -136
- package/types/cngx-ui-sidenav.d.ts +248 -74
- package/types/cngx-ui-skeleton.d.ts +6 -7
- package/types/cngx-ui-speak.d.ts +118 -5
- package/types/cngx-ui-stat-card.d.ts +117 -33
- package/types/cngx-ui-stepper.d.ts +88 -49
- package/types/cngx-ui-tabs.d.ts +6 -4
- package/types/cngx-ui-timeline.d.ts +35 -11
- package/types/cngx-ui-toc.d.ts +93 -16
- package/types/cngx-ui.d.ts +7 -4
|
@@ -1,26 +1,75 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { InjectionToken, makeEnvironmentProviders, SkipSelf, Optional,
|
|
3
|
+
import { InjectionToken, inject, makeEnvironmentProviders, SkipSelf, Optional, input, output, ElementRef, computed, afterRenderEffect, ViewEncapsulation, ChangeDetectionStrategy, Component, TemplateRef, Directive, booleanAttribute, contentChild, untracked } from '@angular/core';
|
|
4
4
|
import { CngxLiveRegion } from '@cngx/common/a11y';
|
|
5
5
|
import * as i1 from '@cngx/common/data';
|
|
6
|
-
import { injectRecycler, CngxVirtualItem, CngxMeasure, CngxRecyclerAnnouncer, CngxPaginate, resolveAsyncView, connectPaginateEmit, CNGX_RECYCLER_I18N } from '@cngx/common/data';
|
|
6
|
+
import { injectRecycler, CngxVirtualItem, CngxMeasure, CngxRecyclerPlaceholder, CngxRecyclerAnnouncer, CngxPaginate, resolveAsyncView, connectPaginateEmit, CNGX_RECYCLER_I18N } from '@cngx/common/data';
|
|
7
|
+
import { createOverrideMerge, createFilledOverrideMerge, injectLocale, displayFormattersFor, formatDisplayValue } from '@cngx/core/utils';
|
|
8
|
+
import { recordEqual } from '@cngx/utils';
|
|
7
9
|
import { CngxEmptyState } from '@cngx/ui/empty-state';
|
|
8
10
|
import { CngxProgress } from '@cngx/ui/feedback';
|
|
11
|
+
import { formatMessage, createLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
9
12
|
import { CNGX_PAGINATOR_HOST } from '@cngx/ui/paginator';
|
|
10
13
|
export { CNGX_PAGINATOR_HOST, CngxPaginatorInfinite, CngxPaginatorLoadMore } from '@cngx/ui/paginator';
|
|
11
14
|
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
/**
|
|
16
|
+
* The English collection section: the single source of the incremental
|
|
17
|
+
* list's English copy. The `CNGX_INCREMENTAL_LIST_CONFIG` labels default to it.
|
|
18
|
+
*
|
|
19
|
+
* @category ui/collection/i18n
|
|
20
|
+
* @since 0.1.0
|
|
21
|
+
* @relatedTo CNGX_INCREMENTAL_LIST_CONFIG
|
|
22
|
+
*/
|
|
23
|
+
const CNGX_COLLECTION_LANGUAGE_EN = {
|
|
24
|
+
loading: 'Loading',
|
|
25
|
+
empty: 'Nothing here yet',
|
|
26
|
+
error: 'Could not load',
|
|
27
|
+
pageError: 'Could not load more',
|
|
28
|
+
retry: 'Retry',
|
|
29
|
+
endReached: 'All {count} loaded',
|
|
30
|
+
loadedMore: '{count} more loaded. {total} total.',
|
|
23
31
|
};
|
|
32
|
+
|
|
33
|
+
/** @internal Turns a collection section into the incremental-list labels for a locale. Pure. */
|
|
34
|
+
function collectionLabelsFrom(section, locale) {
|
|
35
|
+
return {
|
|
36
|
+
loading: section.loading,
|
|
37
|
+
empty: section.empty,
|
|
38
|
+
error: section.error,
|
|
39
|
+
pageError: section.pageError,
|
|
40
|
+
retry: section.retry,
|
|
41
|
+
endReached: (total) => formatMessage(section.endReached, { count: total }, locale),
|
|
42
|
+
loadedMore: (count, total) => formatMessage(section.loadedMore, { count, total }, locale),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** @internal The collection section of the active pack over the English section. */
|
|
46
|
+
const injectCollectionLanguage = createLanguageSection('collection', CNGX_COLLECTION_LANGUAGE_EN);
|
|
47
|
+
/** @internal Builds and reads the section labels, formatted for the reading locale. */
|
|
48
|
+
const collectionBundle = createSectionBundle({
|
|
49
|
+
section: injectCollectionLanguage,
|
|
50
|
+
toBundle: collectionLabelsFrom,
|
|
51
|
+
});
|
|
52
|
+
/**
|
|
53
|
+
* @internal The collection labels of the active pack, formatted for the app
|
|
54
|
+
* locale. Private: consumers override copy through `withIncrementalListAriaLabels`.
|
|
55
|
+
*/
|
|
56
|
+
const COLLECTION_SECTION_LABELS = new InjectionToken('CngxCollectionSectionLabels', { providedIn: 'root', factory: () => collectionBundle.build() });
|
|
57
|
+
/**
|
|
58
|
+
* @internal The collection labels at the reading site: the active pack's
|
|
59
|
+
* section formatted for the locale of the injector that reads it. Injection
|
|
60
|
+
* context required.
|
|
61
|
+
*/
|
|
62
|
+
function injectCollectionSiteLabels() {
|
|
63
|
+
return collectionBundle.resolve(inject(COLLECTION_SECTION_LABELS));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Library defaults. Empty: the label defaults are the `collection` section of
|
|
68
|
+
* the language pack and the template slots are unset, so a config only ever
|
|
69
|
+
* holds overrides.
|
|
70
|
+
*/
|
|
71
|
+
const INCREMENTAL_LIST_DEFAULTS = {};
|
|
72
|
+
const NO_ARIA_LABELS = {};
|
|
24
73
|
/**
|
|
25
74
|
* Configuration cascade token. Resolution priority (high to low):
|
|
26
75
|
* per-instance projected slot, then `provideIncrementalListConfigAt(...)` at
|
|
@@ -33,7 +82,7 @@ const CNGX_INCREMENTAL_LIST_DEFAULTS = {
|
|
|
33
82
|
*/
|
|
34
83
|
const CNGX_INCREMENTAL_LIST_CONFIG = new InjectionToken('CngxIncrementalListConfig', {
|
|
35
84
|
providedIn: 'root',
|
|
36
|
-
factory: () =>
|
|
85
|
+
factory: () => INCREMENTAL_LIST_DEFAULTS,
|
|
37
86
|
});
|
|
38
87
|
/** Reduce a feature list onto a base config, merging each sub-tree in isolation. */
|
|
39
88
|
function applyFeatures(base, features) {
|
|
@@ -41,7 +90,7 @@ function applyFeatures(base, features) {
|
|
|
41
90
|
let templates = base.templates;
|
|
42
91
|
for (const feature of features) {
|
|
43
92
|
if (feature.kind === 'ariaLabels') {
|
|
44
|
-
ariaLabels =
|
|
93
|
+
ariaLabels = createOverrideMerge(ariaLabels ?? NO_ARIA_LABELS, feature.payload);
|
|
45
94
|
}
|
|
46
95
|
else {
|
|
47
96
|
templates = { ...templates, ...feature.payload };
|
|
@@ -51,7 +100,9 @@ function applyFeatures(base, features) {
|
|
|
51
100
|
}
|
|
52
101
|
/**
|
|
53
102
|
* Override any subset of the incremental-list labels. The override applies to
|
|
54
|
-
* both the visible built-in views and the live-region announcements.
|
|
103
|
+
* both the visible built-in views and the live-region announcements. Pass a
|
|
104
|
+
* `Signal` to switch the language at runtime; the live region speaks the new
|
|
105
|
+
* phrasing with its next change.
|
|
55
106
|
*
|
|
56
107
|
* ```ts
|
|
57
108
|
* provideIncrementalListConfig(
|
|
@@ -105,7 +156,7 @@ function provideIncrementalListConfig(...features) {
|
|
|
105
156
|
return makeEnvironmentProviders([
|
|
106
157
|
{
|
|
107
158
|
provide: CNGX_INCREMENTAL_LIST_CONFIG,
|
|
108
|
-
useValue: applyFeatures(
|
|
159
|
+
useValue: applyFeatures(INCREMENTAL_LIST_DEFAULTS, features),
|
|
109
160
|
},
|
|
110
161
|
]);
|
|
111
162
|
}
|
|
@@ -123,7 +174,7 @@ function provideIncrementalListConfigAt(...features) {
|
|
|
123
174
|
return [
|
|
124
175
|
{
|
|
125
176
|
provide: CNGX_INCREMENTAL_LIST_CONFIG,
|
|
126
|
-
useFactory: (parent) => applyFeatures(parent ??
|
|
177
|
+
useFactory: (parent) => applyFeatures(parent ?? INCREMENTAL_LIST_DEFAULTS, features),
|
|
127
178
|
deps: [[new SkipSelf(), new Optional(), CNGX_INCREMENTAL_LIST_CONFIG]],
|
|
128
179
|
},
|
|
129
180
|
];
|
|
@@ -140,6 +191,22 @@ function provideIncrementalListConfigAt(...features) {
|
|
|
140
191
|
function injectIncrementalListConfig() {
|
|
141
192
|
return inject(CNGX_INCREMENTAL_LIST_CONFIG);
|
|
142
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* The resolved labels of the incremental-list config in scope, as a Signal that
|
|
196
|
+
* follows a runtime language switch: the config overrides over the
|
|
197
|
+
* `collection` section of the active pack, formatted for the reading site's
|
|
198
|
+
* locale. A key the config leaves unset, `null` or `undefined` reads the
|
|
199
|
+
* section. Read it untracked where it builds
|
|
200
|
+
* live-region text, so a language switch does not re-speak the current
|
|
201
|
+
* message. Runs in injection context.
|
|
202
|
+
*
|
|
203
|
+
* @category ui/collection
|
|
204
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/collection/incremental-list-config.ts
|
|
205
|
+
* @since 0.1.0
|
|
206
|
+
*/
|
|
207
|
+
function injectIncrementalListAriaLabels() {
|
|
208
|
+
return createFilledOverrideMerge(injectCollectionSiteLabels(), injectIncrementalListConfig().ariaLabels);
|
|
209
|
+
}
|
|
143
210
|
|
|
144
211
|
/**
|
|
145
212
|
* The collection organism reuses the paginator's read-mostly host contract
|
|
@@ -197,6 +264,8 @@ class CngxIncrementalVirtualizedBody {
|
|
|
197
264
|
*/
|
|
198
265
|
focusEscaped = output();
|
|
199
266
|
host = inject((ElementRef));
|
|
267
|
+
locale = injectLocale();
|
|
268
|
+
formatters = computed(() => displayFormattersFor(this.locale()), ...(ngDevMode ? [{ debugName: "formatters" }] : /* istanbul ignore next */ []));
|
|
200
269
|
/**
|
|
201
270
|
* The recycler. Constructed here, never in the organism, so its scroll
|
|
202
271
|
* observer + effects install only when virtualized. `estimateSize` is passed
|
|
@@ -241,6 +310,10 @@ class CngxIncrementalVirtualizedBody {
|
|
|
241
310
|
}
|
|
242
311
|
return true;
|
|
243
312
|
} });
|
|
313
|
+
/** Built-in row text without an item slot: numbers and dates in the locale. */
|
|
314
|
+
itemText(item) {
|
|
315
|
+
return formatDisplayValue(item, this.formatters());
|
|
316
|
+
}
|
|
244
317
|
constructor() {
|
|
245
318
|
// Focus continuity under recycling: when the row that held focus scrolls out
|
|
246
319
|
// of the window, move focus to the nearest still-rendered row so keyboard
|
|
@@ -279,11 +352,17 @@ class CngxIncrementalVirtualizedBody {
|
|
|
279
352
|
target.focus({ preventScroll: true });
|
|
280
353
|
}
|
|
281
354
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIncrementalVirtualizedBody, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
282
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxIncrementalVirtualizedBody, isStandalone: true, selector: "cngx-incremental-virtualized-body", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, estimateSize: { classPropertyName: "estimateSize", publicName: "estimateSize", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, trackItem: { classPropertyName: "trackItem", publicName: "trackItem", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { focusEscaped: "focusEscaped" }, host: { classAttribute: "cngx-incremental-list__viewport" }, ngImport: i0, template: "<ul\n class=\"cngx-incremental-
|
|
355
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxIncrementalVirtualizedBody, isStandalone: true, selector: "cngx-incremental-virtualized-body", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, estimateSize: { classPropertyName: "estimateSize", publicName: "estimateSize", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null }, trackItem: { classPropertyName: "trackItem", publicName: "trackItem", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { focusEscaped: "focusEscaped" }, host: { classAttribute: "cngx-incremental-list__viewport" }, ngImport: i0, template: "<ul class=\"cngx-incremental-list__items\" role=\"list\">\n @if (recycler.offsetBefore(); as before) {\n <li\n class=\"cngx-incremental-list__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [cngxRecyclerPlaceholder]=\"recycler\"\n [style.height.px]=\"before\"\n ></li>\n }\n @for (item of windowItems(); track trackItem()(recycler.start() + $index, item)) {\n <li\n class=\"cngx-incremental-list__item\"\n [cngxVirtualItem]=\"recycler\"\n [cngxVirtualItemIndex]=\"recycler.start() + $index\"\n [cngxMeasure]=\"recycler\"\n [cngxMeasureIndex]=\"recycler.start() + $index\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: recycler.start() + $index }\"\n />\n } @else {\n {{ itemText(item) }}\n }\n </li>\n }\n @if (recycler.offsetAfter(); as after) {\n <li\n class=\"cngx-incremental-list__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [cngxRecyclerPlaceholder]=\"recycler\"\n [style.height.px]=\"after\"\n ></li>\n }\n</ul>\n\n<cngx-recycler-announcer [cngxRecyclerAnnouncer]=\"recycler\" />\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: CngxVirtualItem, selector: "[cngxVirtualItem]", inputs: ["cngxVirtualItem", "cngxVirtualItemIndex"] }, { kind: "directive", type: CngxMeasure, selector: "[cngxMeasure]", inputs: ["cngxMeasure", "cngxMeasureIndex"] }, { kind: "directive", type: CngxRecyclerPlaceholder, selector: "[cngxRecyclerPlaceholder]", inputs: ["cngxRecyclerPlaceholder", "rowHeight"] }, { kind: "component", type: CngxRecyclerAnnouncer, selector: "cngx-recycler-announcer", inputs: ["cngxRecyclerAnnouncer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
283
356
|
}
|
|
284
357
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIncrementalVirtualizedBody, decorators: [{
|
|
285
358
|
type: Component,
|
|
286
|
-
args: [{ selector: 'cngx-incremental-virtualized-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
359
|
+
args: [{ selector: 'cngx-incremental-virtualized-body', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [
|
|
360
|
+
NgTemplateOutlet,
|
|
361
|
+
CngxVirtualItem,
|
|
362
|
+
CngxMeasure,
|
|
363
|
+
CngxRecyclerPlaceholder,
|
|
364
|
+
CngxRecyclerAnnouncer,
|
|
365
|
+
], host: { class: 'cngx-incremental-list__viewport' }, template: "<ul class=\"cngx-incremental-list__items\" role=\"list\">\n @if (recycler.offsetBefore(); as before) {\n <li\n class=\"cngx-incremental-list__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [cngxRecyclerPlaceholder]=\"recycler\"\n [style.height.px]=\"before\"\n ></li>\n }\n @for (item of windowItems(); track trackItem()(recycler.start() + $index, item)) {\n <li\n class=\"cngx-incremental-list__item\"\n [cngxVirtualItem]=\"recycler\"\n [cngxVirtualItemIndex]=\"recycler.start() + $index\"\n [cngxMeasure]=\"recycler\"\n [cngxMeasureIndex]=\"recycler.start() + $index\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: recycler.start() + $index }\"\n />\n } @else {\n {{ itemText(item) }}\n }\n </li>\n }\n @if (recycler.offsetAfter(); as after) {\n <li\n class=\"cngx-incremental-list__spacer\"\n role=\"presentation\"\n aria-hidden=\"true\"\n [cngxRecyclerPlaceholder]=\"recycler\"\n [style.height.px]=\"after\"\n ></li>\n }\n</ul>\n\n<cngx-recycler-announcer [cngxRecyclerAnnouncer]=\"recycler\" />\n" }]
|
|
287
366
|
}], ctorParameters: () => [], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], estimateSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "estimateSize", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], trackItem: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackItem", required: true }] }], focusEscaped: [{ type: i0.Output, args: ["focusEscaped"] }] } });
|
|
288
367
|
|
|
289
368
|
/**
|
|
@@ -397,6 +476,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
397
476
|
}]
|
|
398
477
|
}] });
|
|
399
478
|
|
|
479
|
+
/**
|
|
480
|
+
* The recycler's view-state phrases stay silent inside the organism: its own
|
|
481
|
+
* `statusMessage` live region owns those, so only `loaded` carries text.
|
|
482
|
+
*/
|
|
483
|
+
const SILENT_RECYCLER_I18N = {
|
|
484
|
+
filtered: () => '',
|
|
485
|
+
empty: () => '',
|
|
486
|
+
error: () => '',
|
|
487
|
+
};
|
|
488
|
+
const RECYCLER_I18N = new WeakMap();
|
|
489
|
+
/**
|
|
490
|
+
* The recycler's i18n over the list labels, memoized per labels Signal so every
|
|
491
|
+
* list under one cascade shares one `computed()`.
|
|
492
|
+
*/
|
|
493
|
+
function recyclerI18nFor(ariaLabels) {
|
|
494
|
+
const cached = RECYCLER_I18N.get(ariaLabels);
|
|
495
|
+
if (cached) {
|
|
496
|
+
return cached;
|
|
497
|
+
}
|
|
498
|
+
const i18n = computed(() => ({ ...SILENT_RECYCLER_I18N, loaded: ariaLabels().loadedMore }), { ...(ngDevMode ? { debugName: "i18n" } : /* istanbul ignore next */ {}), equal: recordEqual });
|
|
499
|
+
RECYCLER_I18N.set(ariaLabels, i18n);
|
|
500
|
+
return i18n;
|
|
501
|
+
}
|
|
400
502
|
/**
|
|
401
503
|
* Append-style collection organism. \
|
|
402
504
|
* Accumulates rows across pages (append, don't replace) and switches its view
|
|
@@ -420,8 +522,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
420
522
|
* the two halves resolve to different directive instances - same limitation,
|
|
421
523
|
* same reason, as `CngxPaginator`.
|
|
422
524
|
*
|
|
423
|
-
* All ARIA is signal-driven: `aria-busy` reflects the brain busy signal
|
|
424
|
-
*
|
|
525
|
+
* All ARIA is signal-driven: `aria-busy` reflects the brain busy signal on the
|
|
526
|
+
* items container (scoped there so the polite live region never sits inside a
|
|
527
|
+
* busy container) and the live region communicates every settle
|
|
528
|
+
* (empty / error / end-reached).
|
|
425
529
|
*
|
|
426
530
|
* @category ui/collection
|
|
427
531
|
* @docsKind primary
|
|
@@ -434,6 +538,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
434
538
|
* @slot cngxIncrementalEmpty Rendered when the list resolves to nothing.
|
|
435
539
|
* @slot cngxIncrementalError Rendered when a page fetch fails; gets the error and a retry callback.
|
|
436
540
|
* @slot cngxIncrementalEnd Rendered once after the last page, e.g. an end-of-results marker.
|
|
541
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/load-more-trigger</example-url>
|
|
542
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/infinite-trigger</example-url>
|
|
543
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/virtualized</example-url>
|
|
544
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/custom-loading-slot</example-url>
|
|
545
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/empty</example-url>
|
|
546
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/end-reached</example-url>
|
|
547
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/error-retry</example-url>
|
|
548
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/skins/plain</example-url>
|
|
549
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/skins/divided</example-url>
|
|
550
|
+
* <example-url>http://localhost:4200/#/ui/collection/incremental-list/skins/card</example-url>
|
|
437
551
|
*/
|
|
438
552
|
class CngxIncrementalList {
|
|
439
553
|
/** Visual skin; reflected onto `[data-skin]`. Paint-only. */
|
|
@@ -451,7 +565,12 @@ class CngxIncrementalList {
|
|
|
451
565
|
* guess before a row is measured. Ignored unless `[virtualize]` is set.
|
|
452
566
|
*/
|
|
453
567
|
estimateSize = input(48, ...(ngDevMode ? [{ debugName: "estimateSize" }] : /* istanbul ignore next */ []));
|
|
454
|
-
/**
|
|
568
|
+
/**
|
|
569
|
+
* Emits the effective page index on every change - navigation or
|
|
570
|
+
* `total`-shrink clamp. Clamp emits are held back while the brain is busy or
|
|
571
|
+
* `total` is 0, so a transient total drop during a refetch never writes a
|
|
572
|
+
* page-0 clamp into the consumer's two-way state.
|
|
573
|
+
*/
|
|
455
574
|
pageIndexChange = output();
|
|
456
575
|
/** Emits the effective page size on every change. */
|
|
457
576
|
pageSizeChange = output();
|
|
@@ -471,6 +590,9 @@ class CngxIncrementalList {
|
|
|
471
590
|
paginate = inject(CngxPaginate);
|
|
472
591
|
host = inject((ElementRef));
|
|
473
592
|
config = injectIncrementalListConfig();
|
|
593
|
+
ariaLabels = injectIncrementalListAriaLabels();
|
|
594
|
+
locale = injectLocale();
|
|
595
|
+
formatters = computed(() => displayFormattersFor(this.locale()), ...(ngDevMode ? [{ debugName: "formatters" }] : /* istanbul ignore next */ []));
|
|
474
596
|
// View slot resolvers. Direct contentChild field initialisers (AOT NG8110
|
|
475
597
|
// rejects them from a helper); read as TemplateRef so the cascade computeds
|
|
476
598
|
// return a renderable reference or null.
|
|
@@ -499,8 +621,13 @@ class CngxIncrementalList {
|
|
|
499
621
|
}
|
|
500
622
|
return resolveAsyncView(state.status(), state.isFirstLoad(), state.isEmpty());
|
|
501
623
|
}, ...(ngDevMode ? [{ debugName: "view" }] : /* istanbul ignore next */ []));
|
|
502
|
-
/**
|
|
503
|
-
|
|
624
|
+
/**
|
|
625
|
+
* `true` on the last page of a KNOWN total - every accumulated item has been
|
|
626
|
+
* revealed. With `total` unset or not yet arrived (0), the end state never
|
|
627
|
+
* renders ("All 0 loaded" would be a lie); the load-more trigger stays until
|
|
628
|
+
* the consumer supplies the count.
|
|
629
|
+
*/
|
|
630
|
+
exhausted = computed(() => this.paginate.total() > 0 && this.paginate.isLast(), ...(ngDevMode ? [{ debugName: "exhausted" }] : /* istanbul ignore next */ []));
|
|
504
631
|
/**
|
|
505
632
|
* The accumulated slice: every page revealed so far, sliced from the top of
|
|
506
633
|
* the bound data. Pure derivation of the brain `cumulativeRange()` and the
|
|
@@ -515,14 +642,24 @@ class CngxIncrementalList {
|
|
|
515
642
|
const [start, end] = this.paginate.cumulativeRange();
|
|
516
643
|
return data.slice(start, end);
|
|
517
644
|
}, { ...(ngDevMode ? { debugName: "items" } : /* istanbul ignore next */ {}), equal: (a, b) => a.length === b.length && a.every((item, i) => Object.is(item, b[i])) });
|
|
518
|
-
// Built-in view labels
|
|
519
|
-
//
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
645
|
+
// Built-in view labels: config overrides over the `collection` language
|
|
646
|
+
// section. Consumers re-phrase single keys via provideIncrementalListConfig.
|
|
647
|
+
// They follow a language switch at once; the live region below reads them
|
|
648
|
+
// untracked.
|
|
649
|
+
loadingLabel = computed(() => this.ariaLabels().loading, ...(ngDevMode ? [{ debugName: "loadingLabel" }] : /* istanbul ignore next */ []));
|
|
650
|
+
/**
|
|
651
|
+
* The empty view renders `cngx-empty-state`, itself a polite status region, so
|
|
652
|
+
* its title is read untracked and keyed on the view: a language switch does
|
|
653
|
+
* not re-announce it, the next settle speaks the new language.
|
|
654
|
+
*/
|
|
655
|
+
emptyLabel = computed(() => {
|
|
656
|
+
this.view();
|
|
657
|
+
return untracked(() => this.ariaLabels().empty);
|
|
658
|
+
}, ...(ngDevMode ? [{ debugName: "emptyLabel" }] : /* istanbul ignore next */ []));
|
|
659
|
+
errorLabel = computed(() => this.ariaLabels().error, ...(ngDevMode ? [{ debugName: "errorLabel" }] : /* istanbul ignore next */ []));
|
|
660
|
+
pageErrorLabel = computed(() => this.ariaLabels().pageError, ...(ngDevMode ? [{ debugName: "pageErrorLabel" }] : /* istanbul ignore next */ []));
|
|
661
|
+
retryLabel = computed(() => this.ariaLabels().retry, ...(ngDevMode ? [{ debugName: "retryLabel" }] : /* istanbul ignore next */ []));
|
|
662
|
+
endLabel = computed(() => this.ariaLabels().endReached(this.paginate.total()), ...(ngDevMode ? [{ debugName: "endLabel" }] : /* istanbul ignore next */ []));
|
|
526
663
|
/**
|
|
527
664
|
* Error text for the active error view - the distinct `pageError` phrasing
|
|
528
665
|
* when a subsequent page failed with the list still visible (`content+error`),
|
|
@@ -533,20 +670,38 @@ class CngxIncrementalList {
|
|
|
533
670
|
/**
|
|
534
671
|
* Polite live-region message - communicated on every settle through the same
|
|
535
672
|
* labels the visible views use, so a config or slot override stays in sync.
|
|
673
|
+
* The view state is tracked, the labels are read untracked: a language switch
|
|
674
|
+
* does not re-speak the current message, the next settle speaks the new
|
|
675
|
+
* language.
|
|
536
676
|
*/
|
|
537
677
|
statusMessage = computed(() => {
|
|
678
|
+
const status = this.statusKey();
|
|
679
|
+
if (status === null) {
|
|
680
|
+
return '';
|
|
681
|
+
}
|
|
682
|
+
const total = this.paginate.total();
|
|
683
|
+
return untracked(() => {
|
|
684
|
+
const labels = this.ariaLabels();
|
|
685
|
+
return status === 'end' ? labels.endReached(total) : labels[status];
|
|
686
|
+
});
|
|
687
|
+
}, ...(ngDevMode ? [{ debugName: "statusMessage" }] : /* istanbul ignore next */ []));
|
|
688
|
+
/** Which message the live region speaks for the current view, if any. */
|
|
689
|
+
statusKey = computed(() => {
|
|
538
690
|
if (this.paginate.isBusy()) {
|
|
539
|
-
return
|
|
691
|
+
return 'loading';
|
|
540
692
|
}
|
|
541
693
|
const view = this.view();
|
|
542
694
|
if (view === 'empty') {
|
|
543
|
-
return
|
|
695
|
+
return 'empty';
|
|
544
696
|
}
|
|
545
|
-
if (view === 'error'
|
|
546
|
-
return
|
|
697
|
+
if (view === 'error') {
|
|
698
|
+
return 'error';
|
|
547
699
|
}
|
|
548
|
-
|
|
549
|
-
|
|
700
|
+
if (view === 'content+error') {
|
|
701
|
+
return 'pageError';
|
|
702
|
+
}
|
|
703
|
+
return this.exhausted() ? 'end' : null;
|
|
704
|
+
}, ...(ngDevMode ? [{ debugName: "statusKey" }] : /* istanbul ignore next */ []));
|
|
550
705
|
/** Stable retry callback - emits the `retry` output; shared by the built-in button and the error slot context. */
|
|
551
706
|
retryFn = () => this.retry.emit();
|
|
552
707
|
/**
|
|
@@ -568,6 +723,10 @@ class CngxIncrementalList {
|
|
|
568
723
|
errorContext = computed(() => ({ retry: this.retryFn, error: this.paginate.state()?.error() }), { ...(ngDevMode ? { debugName: "errorContext" } : /* istanbul ignore next */ {}), equal: (a, b) => a.retry === b.retry && a.error === b.error });
|
|
569
724
|
/** `@for` track expression - delegates to the `trackBy` input (index by default). */
|
|
570
725
|
trackItem = (index, item) => this.trackBy()(index, item);
|
|
726
|
+
/** Built-in row text without an item slot: numbers and dates in the locale. */
|
|
727
|
+
itemText(item) {
|
|
728
|
+
return formatDisplayValue(item, this.formatters());
|
|
729
|
+
}
|
|
571
730
|
constructor() {
|
|
572
731
|
// pageIndexChange / pageSizeChange emit, shared verbatim with
|
|
573
732
|
// CngxPaginator through the connectPaginateEmit bridge.
|
|
@@ -577,7 +736,7 @@ class CngxIncrementalList {
|
|
|
577
736
|
});
|
|
578
737
|
}
|
|
579
738
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIncrementalList, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
580
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxIncrementalList, isStandalone: true, selector: "cngx-incremental-list", inputs: { skin: { classPropertyName: "skin", publicName: "skin", isSignal: true, isRequired: false, transformFunction: null }, virtualize: { classPropertyName: "virtualize", publicName: "virtualize", isSignal: true, isRequired: false, transformFunction: null }, estimateSize: { classPropertyName: "estimateSize", publicName: "estimateSize", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndexChange: "pageIndexChange", pageSizeChange: "pageSizeChange", retry: "retry" }, host: { properties: { "attr.
|
|
739
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxIncrementalList, isStandalone: true, selector: "cngx-incremental-list", inputs: { skin: { classPropertyName: "skin", publicName: "skin", isSignal: true, isRequired: false, transformFunction: null }, virtualize: { classPropertyName: "virtualize", publicName: "virtualize", isSignal: true, isRequired: false, transformFunction: null }, estimateSize: { classPropertyName: "estimateSize", publicName: "estimateSize", isSignal: true, isRequired: false, transformFunction: null }, trackBy: { classPropertyName: "trackBy", publicName: "trackBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pageIndexChange: "pageIndexChange", pageSizeChange: "pageSizeChange", retry: "retry" }, host: { properties: { "attr.data-skin": "skin()", "attr.data-virtualize": "virtualize() ? '' : null" }, classAttribute: "cngx-incremental-list" }, providers: [
|
|
581
740
|
{ provide: CNGX_PAGINATOR_HOST, useExisting: CngxPaginate },
|
|
582
741
|
{
|
|
583
742
|
// Route the recycler's SR i18n through the same config cascade the
|
|
@@ -588,17 +747,9 @@ class CngxIncrementalList {
|
|
|
588
747
|
// owner of view-state (no double-announce). The no-state recycler branch
|
|
589
748
|
// never calls filtered()/error() anyway.
|
|
590
749
|
provide: CNGX_RECYCLER_I18N,
|
|
591
|
-
useFactory: () =>
|
|
592
|
-
const config = injectIncrementalListConfig();
|
|
593
|
-
return {
|
|
594
|
-
loaded: (count, total) => config.ariaLabels.loadedMore(count, total),
|
|
595
|
-
filtered: () => '',
|
|
596
|
-
empty: () => '',
|
|
597
|
-
error: () => '',
|
|
598
|
-
};
|
|
599
|
-
},
|
|
750
|
+
useFactory: () => recyclerI18nFor(injectIncrementalListAriaLabels()),
|
|
600
751
|
},
|
|
601
|
-
], queries: [{ propertyName: "itemSlot", first: true, predicate: CngxIncrementalItem, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptySlot", first: true, predicate: CngxIncrementalEmpty, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "errorSlot", first: true, predicate: CngxIncrementalError, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "endSlot", first: true, predicate: CngxIncrementalEnd, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "loadingSlot", first: true, predicate: CngxIncrementalLoading, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxIncrementalList"], hostDirectives: [{ directive: i1.CngxPaginate, inputs: ["cngxPageIndex", "pageIndex", "cngxPageSize", "pageSize", "total", "total", "state", "state"] }], ngImport: i0, template: "@switch (view()) {\n @case ('skeleton') {\n @if (loadingTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-progress\n class=\"cngx-incremental-list__progress\"\n variant=\"linear\"\n [state]=\"paginate.state()\"\n [label]=\"loadingLabel()\"\n />\n }\n }\n @case ('empty') {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-empty-state class=\"cngx-incremental-list__empty\" [title]=\"emptyLabel()\" />\n }\n }\n @case ('error') {\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n }\n @default {\n @if (virtualize()) {\n <cngx-incremental-virtualized-body\n [items]=\"items()\"\n [estimateSize]=\"estimateSize()\"\n [itemTemplate]=\"itemTemplate()\"\n [trackItem]=\"trackItem\"\n (focusEscaped)=\"handleFocusEscaped()\"\n />\n } @else {\n <ul class=\"cngx-incremental-list__items\" role=\"list\">\n @for (item of items(); track trackItem($index, item)) {\n <li class=\"cngx-incremental-list__item\">\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: $index }\"\n />\n } @else {\n {{ item }}\n }\n </li>\n }\n </ul>\n }\n @if (view() === 'content+error') {\n <!-- Subsequent-page failure: keep the accumulated list above visible and\n render a reachable retry, rather than silently swallowing the error. -->\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__inline-error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n } @else if (exhausted()) {\n @if (endTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <p class=\"cngx-incremental-list__message cngx-incremental-list__end\">{{ endLabel() }}</p>\n }\n } @else {\n <ng-content select=\"[cngxIncrementalTrigger]\" />\n }\n }\n}\n\n<ng-template #builtinError>\n <p class=\"cngx-incremental-list__error-text\">{{ errorViewLabel() }}</p>\n <button type=\"button\" class=\"cngx-incremental-list__retry\" (click)=\"retryFn()\">\n {{ retryLabel() }}\n </button>\n</ng-template>\n\n<span cngxLiveRegion class=\"cngx-incremental-list__sr\">{{ statusMessage() }}</span>\n", styles: ["@layer cngx.tokens{.cngx-incremental-list{display:block;--cngx-incremental-list-item-padding: var(--cngx-space-sm, .5rem);--cngx-incremental-list-message-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-error-gap: var(--cngx-space-sm, .5rem);--cngx-incremental-list-card-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-button-padding: var(--cngx-space-xs, .25rem) var(--cngx-space-md, 1rem);color:var(--cngx-incremental-list-text, var(--cngx-color-text, oklch(.2 .01 250)))}}@layer cngx.components{@scope(.cngx-incremental-list){.cngx-incremental-list__viewport{overflow-y:auto;max-block-size:var(--cngx-incremental-list-viewport-height, 60vh)}.cngx-incremental-list__items{margin:0;padding:0;list-style:none}.cngx-incremental-list__item{padding-block:var(--cngx-incremental-list-item-padding)}.cngx-incremental-list__message{margin:0;padding:var(--cngx-incremental-list-message-padding);text-align:center;color:var( --cngx-incremental-list-message-color, var(--cngx-color-text-muted, oklch(.5 .01 250)) )}.cngx-incremental-list__error,.cngx-incremental-list__inline-error{display:flex;flex-direction:column;align-items:center;gap:var(--cngx-incremental-list-error-gap);padding:var(--cngx-incremental-list-message-padding)}.cngx-incremental-list__inline-error{border-top:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}.cngx-incremental-list__error-text{margin:0;text-align:center;color:var(--cngx-incremental-list-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-incremental-list__retry{font:inherit;color:var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));background:transparent;padding:var(--cngx-incremental-list-button-padding);border:1px solid var(--cngx-incremental-list-button-border, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-button-radius, var(--cngx-radius-sm, 6px));min-block-size:var(--cngx-target-min, 0px);cursor:pointer}.cngx-incremental-list__retry:hover{background:color-mix(in oklch,var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50))) 8%,transparent)}.cngx-incremental-list__retry:focus-visible{outline:2px solid var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:2px}.cngx-incremental-list__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}}@scope(.cngx-incremental-list[data-skin=divided]){.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card]){:scope{background:var(--cngx-incremental-list-surface, var(--cngx-color-surface, oklch(1 0 0)));border:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-radius, var(--cngx-radius-md, 8px));padding-inline:var(--cngx-incremental-list-card-padding);overflow:hidden}.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=divided][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}}\n"], dependencies: [{ kind: "component", type: CngxProgress, selector: "cngx-progress", inputs: ["state", "progress", "variant", "showLabel", "label"] }, { kind: "component", type: CngxEmptyState, selector: "cngx-empty-state", inputs: ["title", "description", "state"] }, { kind: "directive", type: CngxLiveRegion, selector: "[cngxLiveRegion]", inputs: ["politeness", "atomic", "relevant"], exportAs: ["cngxLiveRegion"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CngxIncrementalVirtualizedBody, selector: "cngx-incremental-virtualized-body", inputs: ["items", "estimateSize", "itemTemplate", "trackItem"], outputs: ["focusEscaped"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
752
|
+
], queries: [{ propertyName: "itemSlot", first: true, predicate: CngxIncrementalItem, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "emptySlot", first: true, predicate: CngxIncrementalEmpty, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "errorSlot", first: true, predicate: CngxIncrementalError, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "endSlot", first: true, predicate: CngxIncrementalEnd, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "loadingSlot", first: true, predicate: CngxIncrementalLoading, descendants: true, read: TemplateRef, isSignal: true }], exportAs: ["cngxIncrementalList"], hostDirectives: [{ directive: i1.CngxPaginate, inputs: ["cngxPageIndex", "pageIndex", "cngxPageSize", "pageSize", "total", "total", "state", "state"] }], ngImport: i0, template: "@switch (view()) {\n @case ('skeleton') {\n @if (loadingTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-progress\n class=\"cngx-incremental-list__progress\"\n variant=\"linear\"\n [state]=\"paginate.state()\"\n [label]=\"loadingLabel()\"\n />\n }\n }\n @case ('empty') {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-empty-state class=\"cngx-incremental-list__empty\" [title]=\"emptyLabel()\" />\n }\n }\n @case ('error') {\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n }\n @default {\n <!-- aria-busy scoped to the items container, not the host: the polite\n live region below must never sit inside a busy container, or every\n settle announcement is suppressed. -->\n @if (virtualize()) {\n <cngx-incremental-virtualized-body\n [attr.aria-busy]=\"paginate.isBusy() ? 'true' : null\"\n [items]=\"items()\"\n [estimateSize]=\"estimateSize()\"\n [itemTemplate]=\"itemTemplate()\"\n [trackItem]=\"trackItem\"\n (focusEscaped)=\"handleFocusEscaped()\"\n />\n } @else {\n <ul class=\"cngx-incremental-list__items\" role=\"list\" [attr.aria-busy]=\"paginate.isBusy() ? 'true' : null\">\n @for (item of items(); track trackItem($index, item)) {\n <li class=\"cngx-incremental-list__item\">\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: $index }\"\n />\n } @else {\n {{ itemText(item) }}\n }\n </li>\n }\n </ul>\n }\n @if (view() === 'content+error') {\n <!-- Subsequent-page failure: keep the accumulated list above visible and\n render a reachable retry, rather than silently swallowing the error. -->\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__inline-error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n } @else if (exhausted()) {\n @if (endTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <p class=\"cngx-incremental-list__message cngx-incremental-list__end\">{{ endLabel() }}</p>\n }\n } @else {\n <ng-content select=\"[cngxIncrementalTrigger]\" />\n }\n }\n}\n\n<ng-template #builtinError>\n <p class=\"cngx-incremental-list__error-text\">{{ errorViewLabel() }}</p>\n <button type=\"button\" class=\"cngx-incremental-list__retry\" (click)=\"retryFn()\">\n {{ retryLabel() }}\n </button>\n</ng-template>\n\n<span cngxLiveRegion class=\"cngx-incremental-list__sr\">{{ statusMessage() }}</span>\n", styles: ["@layer cngx.tokens{.cngx-incremental-list{display:block;--cngx-incremental-list-item-padding: var(--cngx-space-sm, .5rem);--cngx-incremental-list-message-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-error-gap: var(--cngx-space-sm, .5rem);--cngx-incremental-list-card-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-button-padding: var(--cngx-space-xs, .25rem) var(--cngx-space-md, 1rem);color:var(--cngx-incremental-list-text, var(--cngx-color-text, oklch(.2 .01 250)))}}@layer cngx.components{@scope(.cngx-incremental-list){.cngx-incremental-list__viewport{display:block;overflow-y:auto;max-block-size:var(--cngx-incremental-list-viewport-height, 60vh);overflow-anchor:none;position:relative}.cngx-incremental-list__items{margin:0;padding:0;list-style:none}.cngx-incremental-list__item{padding-block:var(--cngx-incremental-list-item-padding)}.cngx-incremental-list__message{margin:0;padding:var(--cngx-incremental-list-message-padding);text-align:center;color:var( --cngx-incremental-list-message-color, var(--cngx-color-text-muted, oklch(.5 .01 250)) )}.cngx-incremental-list__error,.cngx-incremental-list__inline-error{display:flex;flex-direction:column;align-items:center;gap:var(--cngx-incremental-list-error-gap);padding:var(--cngx-incremental-list-message-padding)}.cngx-incremental-list__inline-error{border-top:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}.cngx-incremental-list__error-text{margin:0;text-align:center;color:var(--cngx-incremental-list-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-incremental-list__retry{font:inherit;color:var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));background:transparent;padding:var(--cngx-incremental-list-button-padding);border:1px solid var(--cngx-incremental-list-button-border, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-button-radius, var(--cngx-radius-sm, 6px));min-block-size:var(--cngx-target-min, 0px);cursor:pointer}.cngx-incremental-list__retry:hover{background:color-mix(in oklch,var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50))) 8%,transparent)}.cngx-incremental-list__retry:focus-visible{outline:2px solid var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:2px}.cngx-incremental-list__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}}@scope(.cngx-incremental-list[data-skin=divided]){.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card]){:scope{background:var(--cngx-incremental-list-surface, var(--cngx-color-surface, oklch(1 0 0)));border:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-radius, var(--cngx-radius-md, 8px));padding-inline:var(--cngx-incremental-list-card-padding);overflow:hidden}.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=divided][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}}\n"], dependencies: [{ kind: "component", type: CngxProgress, selector: "cngx-progress", inputs: ["state", "progress", "variant", "showLabel", "label"] }, { kind: "component", type: CngxEmptyState, selector: "cngx-empty-state", inputs: ["title", "description", "state"] }, { kind: "directive", type: CngxLiveRegion, selector: "[cngxLiveRegion]", inputs: ["politeness", "atomic", "relevant"], exportAs: ["cngxLiveRegion"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: CngxIncrementalVirtualizedBody, selector: "cngx-incremental-virtualized-body", inputs: ["items", "estimateSize", "itemTemplate", "trackItem"], outputs: ["focusEscaped"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
602
753
|
}
|
|
603
754
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxIncrementalList, decorators: [{
|
|
604
755
|
type: Component,
|
|
@@ -624,22 +775,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
624
775
|
// owner of view-state (no double-announce). The no-state recycler branch
|
|
625
776
|
// never calls filtered()/error() anyway.
|
|
626
777
|
provide: CNGX_RECYCLER_I18N,
|
|
627
|
-
useFactory: () =>
|
|
628
|
-
const config = injectIncrementalListConfig();
|
|
629
|
-
return {
|
|
630
|
-
loaded: (count, total) => config.ariaLabels.loadedMore(count, total),
|
|
631
|
-
filtered: () => '',
|
|
632
|
-
empty: () => '',
|
|
633
|
-
error: () => '',
|
|
634
|
-
};
|
|
635
|
-
},
|
|
778
|
+
useFactory: () => recyclerI18nFor(injectIncrementalListAriaLabels()),
|
|
636
779
|
},
|
|
637
780
|
], host: {
|
|
638
781
|
class: 'cngx-incremental-list',
|
|
639
|
-
'[attr.aria-busy]': 'paginate.isBusy()',
|
|
640
782
|
'[attr.data-skin]': 'skin()',
|
|
641
783
|
'[attr.data-virtualize]': "virtualize() ? '' : null",
|
|
642
|
-
}, template: "@switch (view()) {\n @case ('skeleton') {\n @if (loadingTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-progress\n class=\"cngx-incremental-list__progress\"\n variant=\"linear\"\n [state]=\"paginate.state()\"\n [label]=\"loadingLabel()\"\n />\n }\n }\n @case ('empty') {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-empty-state class=\"cngx-incremental-list__empty\" [title]=\"emptyLabel()\" />\n }\n }\n @case ('error') {\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n }\n @default {\n @if (virtualize()) {\n <cngx-incremental-virtualized-body\n [items]=\"items()\"\n [estimateSize]=\"estimateSize()\"\n [itemTemplate]=\"itemTemplate()\"\n [trackItem]=\"trackItem\"\n (focusEscaped)=\"handleFocusEscaped()\"\n />\n } @else {\n <ul class=\"cngx-incremental-list__items\" role=\"list\">\n @for (item of items(); track trackItem($index, item)) {\n <li class=\"cngx-incremental-list__item\">\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: $index }\"\n />\n } @else {\n {{ item }}\n }\n </li>\n }\n </ul>\n }\n @if (view() === 'content+error') {\n <!-- Subsequent-page failure: keep the accumulated list above visible and\n render a reachable retry, rather than silently swallowing the error. -->\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__inline-error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n } @else if (exhausted()) {\n @if (endTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <p class=\"cngx-incremental-list__message cngx-incremental-list__end\">{{ endLabel() }}</p>\n }\n } @else {\n <ng-content select=\"[cngxIncrementalTrigger]\" />\n }\n }\n}\n\n<ng-template #builtinError>\n <p class=\"cngx-incremental-list__error-text\">{{ errorViewLabel() }}</p>\n <button type=\"button\" class=\"cngx-incremental-list__retry\" (click)=\"retryFn()\">\n {{ retryLabel() }}\n </button>\n</ng-template>\n\n<span cngxLiveRegion class=\"cngx-incremental-list__sr\">{{ statusMessage() }}</span>\n", styles: ["@layer cngx.tokens{.cngx-incremental-list{display:block;--cngx-incremental-list-item-padding: var(--cngx-space-sm, .5rem);--cngx-incremental-list-message-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-error-gap: var(--cngx-space-sm, .5rem);--cngx-incremental-list-card-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-button-padding: var(--cngx-space-xs, .25rem) var(--cngx-space-md, 1rem);color:var(--cngx-incremental-list-text, var(--cngx-color-text, oklch(.2 .01 250)))}}@layer cngx.components{@scope(.cngx-incremental-list){.cngx-incremental-list__viewport{overflow-y:auto;max-block-size:var(--cngx-incremental-list-viewport-height, 60vh)}.cngx-incremental-list__items{margin:0;padding:0;list-style:none}.cngx-incremental-list__item{padding-block:var(--cngx-incremental-list-item-padding)}.cngx-incremental-list__message{margin:0;padding:var(--cngx-incremental-list-message-padding);text-align:center;color:var( --cngx-incremental-list-message-color, var(--cngx-color-text-muted, oklch(.5 .01 250)) )}.cngx-incremental-list__error,.cngx-incremental-list__inline-error{display:flex;flex-direction:column;align-items:center;gap:var(--cngx-incremental-list-error-gap);padding:var(--cngx-incremental-list-message-padding)}.cngx-incremental-list__inline-error{border-top:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}.cngx-incremental-list__error-text{margin:0;text-align:center;color:var(--cngx-incremental-list-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-incremental-list__retry{font:inherit;color:var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));background:transparent;padding:var(--cngx-incremental-list-button-padding);border:1px solid var(--cngx-incremental-list-button-border, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-button-radius, var(--cngx-radius-sm, 6px));min-block-size:var(--cngx-target-min, 0px);cursor:pointer}.cngx-incremental-list__retry:hover{background:color-mix(in oklch,var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50))) 8%,transparent)}.cngx-incremental-list__retry:focus-visible{outline:2px solid var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:2px}.cngx-incremental-list__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}}@scope(.cngx-incremental-list[data-skin=divided]){.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card]){:scope{background:var(--cngx-incremental-list-surface, var(--cngx-color-surface, oklch(1 0 0)));border:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-radius, var(--cngx-radius-md, 8px));padding-inline:var(--cngx-incremental-list-card-padding);overflow:hidden}.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=divided][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}}\n"] }]
|
|
784
|
+
}, template: "@switch (view()) {\n @case ('skeleton') {\n @if (loadingTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-progress\n class=\"cngx-incremental-list__progress\"\n variant=\"linear\"\n [state]=\"paginate.state()\"\n [label]=\"loadingLabel()\"\n />\n }\n }\n @case ('empty') {\n @if (emptyTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <cngx-empty-state class=\"cngx-incremental-list__empty\" [title]=\"emptyLabel()\" />\n }\n }\n @case ('error') {\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n }\n @default {\n <!-- aria-busy scoped to the items container, not the host: the polite\n live region below must never sit inside a busy container, or every\n settle announcement is suppressed. -->\n @if (virtualize()) {\n <cngx-incremental-virtualized-body\n [attr.aria-busy]=\"paginate.isBusy() ? 'true' : null\"\n [items]=\"items()\"\n [estimateSize]=\"estimateSize()\"\n [itemTemplate]=\"itemTemplate()\"\n [trackItem]=\"trackItem\"\n (focusEscaped)=\"handleFocusEscaped()\"\n />\n } @else {\n <ul class=\"cngx-incremental-list__items\" role=\"list\" [attr.aria-busy]=\"paginate.isBusy() ? 'true' : null\">\n @for (item of items(); track trackItem($index, item)) {\n <li class=\"cngx-incremental-list__item\">\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{ $implicit: item, index: $index }\"\n />\n } @else {\n {{ itemText(item) }}\n }\n </li>\n }\n </ul>\n }\n @if (view() === 'content+error') {\n <!-- Subsequent-page failure: keep the accumulated list above visible and\n render a reachable retry, rather than silently swallowing the error. -->\n @if (errorTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"errorContext()\" />\n } @else {\n <div class=\"cngx-incremental-list__inline-error\">\n <ng-container [ngTemplateOutlet]=\"builtinError\" />\n </div>\n }\n } @else if (exhausted()) {\n @if (endTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" />\n } @else {\n <p class=\"cngx-incremental-list__message cngx-incremental-list__end\">{{ endLabel() }}</p>\n }\n } @else {\n <ng-content select=\"[cngxIncrementalTrigger]\" />\n }\n }\n}\n\n<ng-template #builtinError>\n <p class=\"cngx-incremental-list__error-text\">{{ errorViewLabel() }}</p>\n <button type=\"button\" class=\"cngx-incremental-list__retry\" (click)=\"retryFn()\">\n {{ retryLabel() }}\n </button>\n</ng-template>\n\n<span cngxLiveRegion class=\"cngx-incremental-list__sr\">{{ statusMessage() }}</span>\n", styles: ["@layer cngx.tokens{.cngx-incremental-list{display:block;--cngx-incremental-list-item-padding: var(--cngx-space-sm, .5rem);--cngx-incremental-list-message-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-error-gap: var(--cngx-space-sm, .5rem);--cngx-incremental-list-card-padding: var(--cngx-space-md, 1rem);--cngx-incremental-list-button-padding: var(--cngx-space-xs, .25rem) var(--cngx-space-md, 1rem);color:var(--cngx-incremental-list-text, var(--cngx-color-text, oklch(.2 .01 250)))}}@layer cngx.components{@scope(.cngx-incremental-list){.cngx-incremental-list__viewport{display:block;overflow-y:auto;max-block-size:var(--cngx-incremental-list-viewport-height, 60vh);overflow-anchor:none;position:relative}.cngx-incremental-list__items{margin:0;padding:0;list-style:none}.cngx-incremental-list__item{padding-block:var(--cngx-incremental-list-item-padding)}.cngx-incremental-list__message{margin:0;padding:var(--cngx-incremental-list-message-padding);text-align:center;color:var( --cngx-incremental-list-message-color, var(--cngx-color-text-muted, oklch(.5 .01 250)) )}.cngx-incremental-list__error,.cngx-incremental-list__inline-error{display:flex;flex-direction:column;align-items:center;gap:var(--cngx-incremental-list-error-gap);padding:var(--cngx-incremental-list-message-padding)}.cngx-incremental-list__inline-error{border-top:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}.cngx-incremental-list__error-text{margin:0;text-align:center;color:var(--cngx-incremental-list-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}.cngx-incremental-list__retry{font:inherit;color:var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));background:transparent;padding:var(--cngx-incremental-list-button-padding);border:1px solid var(--cngx-incremental-list-button-border, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-button-radius, var(--cngx-radius-sm, 6px));min-block-size:var(--cngx-target-min, 0px);cursor:pointer}.cngx-incremental-list__retry:hover{background:color-mix(in oklch,var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50))) 8%,transparent)}.cngx-incremental-list__retry:focus-visible{outline:2px solid var(--cngx-incremental-list-button-fg, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:2px}.cngx-incremental-list__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}}@scope(.cngx-incremental-list[data-skin=divided]){.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card]){:scope{background:var(--cngx-incremental-list-surface, var(--cngx-color-surface, oklch(1 0 0)));border:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)));border-radius:var(--cngx-incremental-list-radius, var(--cngx-radius-md, 8px));padding-inline:var(--cngx-incremental-list-card-padding);overflow:hidden}.cngx-incremental-list__item:not(:last-child){border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=divided][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}@scope(.cngx-incremental-list[data-skin=card][data-virtualize]){.cngx-incremental-list__item{border-bottom:1px solid var(--cngx-incremental-list-divider, var(--cngx-color-border, oklch(.88 .005 250)))}}}\n"] }]
|
|
643
785
|
}], ctorParameters: () => [], propDecorators: { skin: [{ type: i0.Input, args: [{ isSignal: true, alias: "skin", required: false }] }], virtualize: [{ type: i0.Input, args: [{ isSignal: true, alias: "virtualize", required: false }] }], estimateSize: [{ type: i0.Input, args: [{ isSignal: true, alias: "estimateSize", required: false }] }], pageIndexChange: [{ type: i0.Output, args: ["pageIndexChange"] }], pageSizeChange: [{ type: i0.Output, args: ["pageSizeChange"] }], retry: [{ type: i0.Output, args: ["retry"] }], trackBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "trackBy", required: false }] }], itemSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxIncrementalItem), { ...{ read: TemplateRef }, isSignal: true }] }], emptySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxIncrementalEmpty), { ...{ read: TemplateRef }, isSignal: true }] }], errorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxIncrementalError), { ...{ read: TemplateRef }, isSignal: true }] }], endSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxIncrementalEnd), { ...{ read: TemplateRef }, isSignal: true }] }], loadingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxIncrementalLoading), { ...{ read: TemplateRef }, isSignal: true }] }] } });
|
|
644
786
|
|
|
645
787
|
/**
|
|
@@ -650,5 +792,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
650
792
|
* Generated bundle index. Do not edit.
|
|
651
793
|
*/
|
|
652
794
|
|
|
653
|
-
export {
|
|
795
|
+
export { CNGX_COLLECTION_LANGUAGE_EN, CNGX_INCREMENTAL_LIST_CONFIG, CngxIncrementalEmpty, CngxIncrementalEnd, CngxIncrementalError, CngxIncrementalItem, CngxIncrementalList, CngxIncrementalLoading, injectIncrementalListAriaLabels, injectIncrementalListConfig, provideIncrementalListConfig, provideIncrementalListConfigAt, withIncrementalListAriaLabels, withIncrementalListTemplates };
|
|
654
796
|
//# sourceMappingURL=cngx-ui-collection.mjs.map
|