@cngx/ui 0.1.0-rc.8 → 0.3.0
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 +118 -59
- package/action-button/README.md +170 -53
- package/breadcrumb/README.md +5 -6
- package/collection/README.md +1 -1
- package/command-palette/README.md +9 -5
- package/data-grid-accordion/README.md +1 -1
- package/empty-state/README.md +2 -3
- package/feedback/README.md +1 -1
- package/fesm2022/cngx-ui-a11y.mjs +13 -23
- package/fesm2022/cngx-ui-a11y.mjs.map +1 -1
- package/fesm2022/cngx-ui-accordion.mjs +55 -60
- package/fesm2022/cngx-ui-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-action-button.mjs +220 -339
- package/fesm2022/cngx-ui-action-button.mjs.map +1 -1
- package/fesm2022/cngx-ui-breadcrumb.mjs +100 -80
- package/fesm2022/cngx-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/cngx-ui-chart-panel.mjs +18 -31
- package/fesm2022/cngx-ui-chart-panel.mjs.map +1 -1
- package/fesm2022/cngx-ui-collection.mjs +28 -34
- package/fesm2022/cngx-ui-collection.mjs.map +1 -1
- package/fesm2022/cngx-ui-command-palette.mjs +29 -51
- package/fesm2022/cngx-ui-command-palette.mjs.map +1 -1
- package/fesm2022/cngx-ui-context-menu.mjs +138 -89
- package/fesm2022/cngx-ui-context-menu.mjs.map +1 -1
- package/fesm2022/cngx-ui-data-grid-accordion.mjs +135 -77
- package/fesm2022/cngx-ui-data-grid-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-empty-state.mjs +17 -44
- package/fesm2022/cngx-ui-empty-state.mjs.map +1 -1
- package/fesm2022/cngx-ui-feedback.mjs +648 -495
- package/fesm2022/cngx-ui-feedback.mjs.map +1 -1
- package/fesm2022/cngx-ui-layout.mjs +17 -13
- package/fesm2022/cngx-ui-layout.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-accordion.mjs +6 -7
- package/fesm2022/cngx-ui-mat-accordion.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-paginator.mjs +5 -9
- package/fesm2022/cngx-ui-mat-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-stepper.mjs +6 -9
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +315 -134
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-nav-rail.mjs +440 -0
- package/fesm2022/cngx-ui-nav-rail.mjs.map +1 -0
- package/fesm2022/cngx-ui-overlay.mjs +9 -10
- package/fesm2022/cngx-ui-overlay.mjs.map +1 -1
- package/fesm2022/cngx-ui-paginator.mjs +212 -188
- package/fesm2022/cngx-ui-paginator.mjs.map +1 -1
- package/fesm2022/cngx-ui-sidenav.mjs +872 -721
- package/fesm2022/cngx-ui-sidenav.mjs.map +1 -1
- package/fesm2022/cngx-ui-skeleton.mjs +17 -19
- package/fesm2022/cngx-ui-skeleton.mjs.map +1 -1
- package/fesm2022/cngx-ui-speak.mjs +21 -74
- package/fesm2022/cngx-ui-speak.mjs.map +1 -1
- package/fesm2022/cngx-ui-stat-card.mjs +39 -62
- package/fesm2022/cngx-ui-stat-card.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +259 -130
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +148 -50
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-timeline.mjs +48 -32
- package/fesm2022/cngx-ui-timeline.mjs.map +1 -1
- package/fesm2022/cngx-ui-toc.mjs +59 -48
- package/fesm2022/cngx-ui-toc.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +5 -5
- package/fesm2022/cngx-ui.mjs.map +1 -1
- package/mat-tabs/README.md +57 -19
- package/mat-tabs/styles/mat-tabs.css +285 -163
- package/nav-rail/README.md +325 -0
- package/package.json +37 -8
- package/paginator/README.md +10 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +96 -0
- package/schematics/package.json +3 -0
- package/sidenav/README.md +150 -55
- package/skeleton/README.md +1 -1
- package/speak/README.md +1 -2
- package/stepper/README.md +20 -5
- package/tabs/README.md +13 -0
- package/timeline/README.md +1 -1
- package/toc/README.md +1 -1
- package/types/cngx-ui-a11y.d.ts +20 -38
- package/types/cngx-ui-accordion.d.ts +46 -71
- package/types/cngx-ui-action-button.d.ts +113 -151
- package/types/cngx-ui-breadcrumb.d.ts +60 -85
- package/types/cngx-ui-chart-panel.d.ts +22 -40
- package/types/cngx-ui-collection.d.ts +30 -43
- package/types/cngx-ui-command-palette.d.ts +40 -64
- package/types/cngx-ui-context-menu.d.ts +109 -48
- package/types/cngx-ui-data-grid-accordion.d.ts +50 -75
- package/types/cngx-ui-empty-state.d.ts +18 -8
- package/types/cngx-ui-feedback.d.ts +275 -292
- package/types/cngx-ui-layout.d.ts +4 -12
- package/types/cngx-ui-mat-accordion.d.ts +5 -5
- package/types/cngx-ui-mat-paginator.d.ts +4 -10
- package/types/cngx-ui-mat-stepper.d.ts +5 -10
- package/types/cngx-ui-mat-tabs.d.ts +86 -89
- package/types/cngx-ui-nav-rail.d.ts +416 -0
- package/types/cngx-ui-overlay.d.ts +4 -13
- package/types/cngx-ui-paginator.d.ts +186 -161
- package/types/cngx-ui-sidenav.d.ts +557 -437
- package/types/cngx-ui-skeleton.d.ts +7 -13
- package/types/cngx-ui-speak.d.ts +40 -24
- package/types/cngx-ui-stat-card.d.ts +45 -36
- package/types/cngx-ui-stepper.d.ts +205 -84
- package/types/cngx-ui-tabs.d.ts +104 -28
- package/types/cngx-ui-timeline.d.ts +31 -51
- package/types/cngx-ui-toc.d.ts +43 -54
- package/types/cngx-ui.d.ts +1 -1
package/types/cngx-ui-tabs.d.ts
CHANGED
|
@@ -30,11 +30,9 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
30
30
|
* @playground Routed tabs with a CanDeactivate guard ./examples/routed-outlet/routed-outlet.component.ts
|
|
31
31
|
* @see {@link CngxMatTabs} for the Material `<mat-tab-group>` variant with `[cngxMatTabError]`.
|
|
32
32
|
*
|
|
33
|
-
* @category ui/tabs
|
|
34
|
-
* @docsKind primary
|
|
35
33
|
* @wcag AA
|
|
36
34
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-group.component.ts
|
|
37
|
-
* @since 0.
|
|
35
|
+
* @since 0.3.0
|
|
38
36
|
* @relatedTo CngxTabOverflow, CngxTabGroupPresenter, CngxTab, CngxFocusRestore
|
|
39
37
|
* @slot cngxTabIcon Replaces a tab's leading icon; gets the tab.
|
|
40
38
|
* @slot cngxTabAddIcon Replaces the glyph on the add-tab control.
|
|
@@ -42,17 +40,27 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
42
40
|
* @slot cngxTabErrorBadge Marks a tab whose panel holds validation errors.
|
|
43
41
|
* @slot cngxTabBusySpinner Rendered on a tab while its switch commits.
|
|
44
42
|
* @slot cngxTabRejectionIcon Marks a tab whose switch was refused.
|
|
45
|
-
* <example-url
|
|
46
|
-
* <example-url
|
|
47
|
-
* <example-url
|
|
48
|
-
* <example-url
|
|
49
|
-
* <example-url
|
|
50
|
-
* <example-url
|
|
51
|
-
* <example-url
|
|
52
|
-
* <example-url
|
|
43
|
+
* <example-url>/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>
|
|
44
|
+
* <example-url>/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>
|
|
45
|
+
* <example-url>/#/ui/tabs/tab-skins/all-skins-side-by-side</example-url>
|
|
46
|
+
* <example-url>/#/ui/tabs/tab-skins/contained</example-url>
|
|
47
|
+
* <example-url>/#/ui/tabs/tab-skins/line</example-url>
|
|
48
|
+
* <example-url>/#/ui/tabs/tab-skins/pill</example-url>
|
|
49
|
+
* <example-url>/#/ui/tabs/tab-skins/pill-vs-toggle-group</example-url>
|
|
50
|
+
* <example-url>/#/ui/tabs/tab-skins/vertical-skins</example-url>
|
|
51
|
+
* @axis level organism
|
|
53
52
|
*/
|
|
54
53
|
declare class CngxTabGroup implements CngxTabPanelHost {
|
|
54
|
+
/**
|
|
55
|
+
* Accessible name of the tab group host, bound as `[aria-label]`. When unset it falls back to the
|
|
56
|
+
* `tabsLabel` i18n copy, which names the group by default. It is dropped while a non-empty
|
|
57
|
+
* `[aria-labelledby]` is set.
|
|
58
|
+
*/
|
|
55
59
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
60
|
+
/**
|
|
61
|
+
* Id reference of the element that names the tab group host, bound as `[aria-labelledby]`. A non-empty
|
|
62
|
+
* value suppresses the host `aria-label`, including the i18n fallback. Unset by default.
|
|
63
|
+
*/
|
|
56
64
|
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
57
65
|
/**
|
|
58
66
|
* Visual skin. Cascade `input ?? config ?? 'line'`, resolved by
|
|
@@ -99,12 +107,52 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
99
107
|
protected readonly presenter: _cngx_common_tabs.CngxTabGroupHost;
|
|
100
108
|
protected readonly i18n: Signal<_cngx_common_tabs.CngxTabsI18n>;
|
|
101
109
|
protected readonly config: _cngx_common_tabs.CngxTabsConfig;
|
|
102
|
-
/** Default
|
|
103
|
-
protected readonly
|
|
104
|
-
readonly
|
|
105
|
-
readonly
|
|
106
|
-
readonly
|
|
107
|
-
readonly
|
|
110
|
+
/** Default icons for the template's fallback spans. */
|
|
111
|
+
protected readonly alertIcon: {
|
|
112
|
+
readonly viewBox: "0 0 24 24";
|
|
113
|
+
readonly d: "M12 3L2 20.5h20zM12 9.5v5M12 17.5v.01";
|
|
114
|
+
readonly paint: "stroke";
|
|
115
|
+
readonly micro: {
|
|
116
|
+
readonly viewBox: "0 0 12 12";
|
|
117
|
+
readonly d: "M6.514 1.857L11.486 10.143Q12 11 11 11L1 11Q0 11 0.514 10.143L5.486 1.857Q6 1 6.514 1.857ZM5 5V8H7V5ZM5 9V10H7V9Z";
|
|
118
|
+
};
|
|
119
|
+
readonly small: {
|
|
120
|
+
readonly viewBox: "0 0 16 16";
|
|
121
|
+
readonly d: "M8 2L14 14H2ZM7 6V10H9V6ZM7 11V13H9V11Z";
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
protected readonly banIcon: {
|
|
125
|
+
readonly viewBox: "0 0 24 24";
|
|
126
|
+
readonly d: "M2.5 12a9.5 9.5 0 1 0 19 0a9.5 9.5 0 1 0-19 0zM5.3 5.3l13.4 13.4";
|
|
127
|
+
readonly paint: "stroke";
|
|
128
|
+
readonly micro: {
|
|
129
|
+
readonly viewBox: "0 0 12 12";
|
|
130
|
+
readonly d: "M6 0A6 6 0 1 1 6 12A6 6 0 1 1 6 0ZM9.668 8.607A4.5 4.5 0 0 0 3.393 2.332ZM2.332 3.393A4.5 4.5 0 0 0 8.607 9.668Z";
|
|
131
|
+
};
|
|
132
|
+
readonly small: null;
|
|
133
|
+
};
|
|
134
|
+
protected readonly closeIcon: {
|
|
135
|
+
readonly viewBox: "0 0 24 24";
|
|
136
|
+
readonly d: "M6 6l12 12M18 6L6 18";
|
|
137
|
+
readonly paint: "stroke";
|
|
138
|
+
readonly micro: {
|
|
139
|
+
readonly viewBox: "0 0 12 12";
|
|
140
|
+
readonly d: "M2 3L3 2L10 9L9 10ZM9 2L10 3L3 10L2 9Z";
|
|
141
|
+
};
|
|
142
|
+
readonly small: {
|
|
143
|
+
readonly viewBox: "0 0 16 16";
|
|
144
|
+
readonly d: "M3 4L4 3L13 12L12 13ZM12 3L13 4L4 13L3 12Z";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
protected readonly addIcon: {
|
|
148
|
+
readonly viewBox: "0 0 24 24";
|
|
149
|
+
readonly d: "M12 3.5v17M3.5 12h17";
|
|
150
|
+
readonly paint: "stroke";
|
|
151
|
+
readonly micro: {
|
|
152
|
+
readonly viewBox: "0 0 12 12";
|
|
153
|
+
readonly d: "M5 1H6V5H10V6H6V10H5V6H1V5H5Z";
|
|
154
|
+
};
|
|
155
|
+
readonly small: null;
|
|
108
156
|
};
|
|
109
157
|
private readonly hostElement;
|
|
110
158
|
private readonly injector;
|
|
@@ -246,8 +294,9 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
246
294
|
protected busySpinnerContextFor(tab: CngxTabHandle): CngxTabBusySpinnerContext;
|
|
247
295
|
/**
|
|
248
296
|
* Context for `*cngxTabRejectionIcon`. `originLabel` matches the
|
|
249
|
-
* `liveAnnouncement` priority chain so visual + SR phrasing align
|
|
250
|
-
*
|
|
297
|
+
* `liveAnnouncement` priority chain so visual + SR phrasing align;
|
|
298
|
+
* `reason` is the kind of the outcome that set the marker (a refusal
|
|
299
|
+
* or a failure). Allocates fresh per CD for the same reason as
|
|
251
300
|
* {@link busySpinnerContextFor}.
|
|
252
301
|
*/
|
|
253
302
|
protected rejectionIconContextFor(failedIndex: number): CngxTabRejectionIconContext;
|
|
@@ -264,6 +313,12 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
264
313
|
* when navigation did not consume the event.
|
|
265
314
|
*/
|
|
266
315
|
protected handleTabKeydown(tab: CngxTabHandle, event: KeyboardEvent): void;
|
|
316
|
+
/**
|
|
317
|
+
* Activates the tab registered under the given id. `CngxTabPanelHost` contract method, called by the
|
|
318
|
+
* overflow menu when a hidden tab is picked. An unknown id is ignored; otherwise it goes through the
|
|
319
|
+
* presenter `select`, which does nothing for the active or a disabled tab and defers to `commitAction`
|
|
320
|
+
* when one is set.
|
|
321
|
+
*/
|
|
267
322
|
selectById(id: string): void;
|
|
268
323
|
/**
|
|
269
324
|
* Clear the presenter's `lastFailedIndex` rejection flag - exposed
|
|
@@ -271,8 +326,21 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
271
326
|
* decoration without injecting the host token.
|
|
272
327
|
*/
|
|
273
328
|
clearLastFailed(): void;
|
|
329
|
+
/**
|
|
330
|
+
* Returns the `*cngxTabLabel` template of the tab with the given id, or `null` when the id is unknown
|
|
331
|
+
* or the tab has no label slot. `CngxTabPanelHost` contract method: the tab group template calls it per
|
|
332
|
+
* tab, and a skin sub-component can call it through `CNGX_TAB_PANEL_HOST`.
|
|
333
|
+
*/
|
|
274
334
|
labelTemplateFor(id: string): TemplateRef<unknown> | null;
|
|
335
|
+
/**
|
|
336
|
+
* @internal
|
|
337
|
+
*/
|
|
275
338
|
subLabelTemplateFor(id: string): TemplateRef<unknown> | null;
|
|
339
|
+
/**
|
|
340
|
+
* Returns the `*cngxTabContent` template of the tab with the given id, or `null` when the id is unknown
|
|
341
|
+
* or the tab has no content slot. `CngxTabPanelHost` contract method: the tab group template calls it per
|
|
342
|
+
* tab, and a skin sub-component can call it through `CNGX_TAB_PANEL_HOST`.
|
|
343
|
+
*/
|
|
276
344
|
contentTemplateFor(id: string): TemplateRef<unknown> | null;
|
|
277
345
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabGroup, never>;
|
|
278
346
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabGroup, "cngx-tab-group", ["cngxTabGroup"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; "iconLayout": { "alias": "iconLayout"; "required": false; "isSignal": true; }; "panelMode": { "alias": "panelMode"; "required": false; "isSignal": true; }; "fitted": { "alias": "fitted"; "required": false; "isSignal": true; }; "tabAlign": { "alias": "tabAlign"; "required": false; "isSignal": true; }; "closable": { "alias": "closable"; "required": false; "isSignal": true; }; "addable": { "alias": "addable"; "required": false; "isSignal": true; }; }, {}, ["tabDirectives", "errorBadgeSlot", "rejectionIconSlot", "busySpinnerSlot", "iconSlot", "closeIconSlot", "addIconSlot"], ["cngx-tab-overflow", "*"], true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; "loop": "loop"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeIndexChange": "activeIndexChange"; "tabClose": "tabClose"; "tabAdd": "tabAdd"; }; }, { directive: typeof i2.CngxFocusRestore; inputs: {}; outputs: {}; }]>;
|
|
@@ -312,15 +380,24 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
312
380
|
* @playground Native router tabs with a CanDeactivate guard ./examples/routed-nav/routed-nav.component.ts
|
|
313
381
|
* @see {@link CngxTabGroup} for the programmatic tablist organism.
|
|
314
382
|
*
|
|
315
|
-
* @category ui/tabs
|
|
316
|
-
* @docsKind primary
|
|
317
383
|
* @wcag AA
|
|
318
384
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-nav.component.ts
|
|
319
|
-
* @since 0.
|
|
385
|
+
* @since 0.3.0
|
|
320
386
|
* @relatedTo CngxTabLink, CngxTabsRouteSync, CngxTabGroup, CngxMatTabNav
|
|
387
|
+
* @axis level organism
|
|
321
388
|
*/
|
|
322
389
|
declare class CngxTabNav {
|
|
390
|
+
/**
|
|
391
|
+
* Accessible name of the navigation host, bound straight to `[attr.aria-label]` through the
|
|
392
|
+
* `[aria-label]` alias. There is no config or i18n fallback: unset renders no attribute, and it stays
|
|
393
|
+
* set next to `[aria-labelledby]`.
|
|
394
|
+
*/
|
|
323
395
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
396
|
+
/**
|
|
397
|
+
* Id reference of the element that names the navigation host, bound straight to
|
|
398
|
+
* `[attr.aria-labelledby]` through the `[aria-labelledby]` alias. It does not clear `[aria-label]`;
|
|
399
|
+
* unset renders no attribute.
|
|
400
|
+
*/
|
|
324
401
|
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
325
402
|
/**
|
|
326
403
|
* Visual skin. Cascade `input ?? config ?? 'line'`, reflected onto
|
|
@@ -359,17 +436,16 @@ declare class CngxTabNav {
|
|
|
359
436
|
*
|
|
360
437
|
* @playground Overflow showcase ./examples/overflow-showcase/overflow-showcase.component.ts
|
|
361
438
|
*
|
|
362
|
-
* @category ui/tabs
|
|
363
|
-
* @docsKind primary
|
|
364
439
|
* @wcag AA
|
|
365
440
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-overflow.component.ts
|
|
366
|
-
* @since 0.
|
|
441
|
+
* @since 0.3.0
|
|
367
442
|
* @relatedTo CngxTabGroup, CngxPopover, CngxActiveDescendant
|
|
368
443
|
* @slot cngxTabOverflowTrigger Replaces the control that opens the overflow menu.
|
|
369
444
|
* @slot cngxTabOverflowItem Replaces a row in the overflow menu; gets the tab.
|
|
370
|
-
* <example-url
|
|
371
|
-
* <example-url
|
|
372
|
-
* <example-url
|
|
445
|
+
* <example-url>/#/ui/tabs/tab-overflow/8-tabs-in-a-narrow-container</example-url>
|
|
446
|
+
* <example-url>/#/ui/tabs/tab-overflow/all-skins-horizontal</example-url>
|
|
447
|
+
* <example-url>/#/ui/tabs/tab-overflow/all-skins-vertical</example-url>
|
|
448
|
+
* @axis level organism
|
|
373
449
|
*/
|
|
374
450
|
declare class CngxTabOverflow {
|
|
375
451
|
protected readonly panelHost: CngxTabPanelHost;
|
|
@@ -2,7 +2,7 @@ import * as _cngx_common_data from '@cngx/common/data';
|
|
|
2
2
|
import { AsyncView } from '@cngx/common/data';
|
|
3
3
|
import * as _cngx_ui_timeline from '@cngx/ui/timeline';
|
|
4
4
|
import * as _cngx_common_timeline from '@cngx/common/timeline';
|
|
5
|
-
import { CngxTimelineMarkerHost, TimelineDateAccessor, TimelineGroupBy, TimelineDirection, TimelineGroup, CngxTimelineItemContext, CngxTimelineConfig, CngxTimelineDateHeaderContext, CngxTimelineMarkerContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineRetryButtonContext, CngxTimelineTemplates } from '@cngx/common/timeline';
|
|
5
|
+
import { CngxTimelineMarkerHost, TimelineDateAccessor, TimelineGroupBy, TimelineDirection, TimelineGroup, CngxTimelineItemContext, CngxTimelineSkeletonContext, CngxTimelineConfig, CngxTimelineDateHeaderContext, CngxTimelineMarkerContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineRetryButtonContext, CngxTimelineTemplates } from '@cngx/common/timeline';
|
|
6
6
|
import * as _angular_core from '@angular/core';
|
|
7
7
|
import { Signal, InjectionToken, TemplateRef } from '@angular/core';
|
|
8
8
|
import { EmptyReason } from '@cngx/common/card';
|
|
@@ -16,8 +16,6 @@ import { CngxAsyncState } from '@cngx/core/utils';
|
|
|
16
16
|
* timestamp after the body on one line - a feed someone scans. Purely
|
|
17
17
|
* visual: same DOM, same ARIA, same slots, only the `[data-mode]` host
|
|
18
18
|
* attribute changes.
|
|
19
|
-
*
|
|
20
|
-
* @category ui/timeline
|
|
21
19
|
*/
|
|
22
20
|
type CngxTimelineMode = 'narrative' | 'activity';
|
|
23
21
|
/**
|
|
@@ -27,8 +25,6 @@ type CngxTimelineMode = 'narrative' | 'activity';
|
|
|
27
25
|
* `line` (default) is the bare rail. `card` lifts each event body onto its
|
|
28
26
|
* own surface. `bands` tints alternating groups so long timelines stay
|
|
29
27
|
* scannable.
|
|
30
|
-
*
|
|
31
|
-
* @category ui/timeline
|
|
32
28
|
*/
|
|
33
29
|
type CngxTimelineSkin = 'line' | 'card' | 'bands';
|
|
34
30
|
/**
|
|
@@ -45,8 +41,6 @@ type CngxTimelineSkin = 'line' | 'card' | 'bands';
|
|
|
45
41
|
*
|
|
46
42
|
* `alternate` is not supported with `mode="activity"`: alternating a
|
|
47
43
|
* scan-feed defeats the scan. Those rows render `start` and dev mode warns.
|
|
48
|
-
*
|
|
49
|
-
* @category ui/timeline
|
|
50
44
|
*/
|
|
51
45
|
type CngxTimelinePlacement = 'start' | 'end' | 'alternate';
|
|
52
46
|
/**
|
|
@@ -60,8 +54,6 @@ type CngxTimelinePlacement = 'start' | 'end' | 'alternate';
|
|
|
60
54
|
* so a `rejected` stretch stays red and an `upcoming` tail stays dashed.
|
|
61
55
|
* It applies within a band; the gap between groups stays open, because a
|
|
62
56
|
* band is a semantic boundary rather than a rendering accident.
|
|
63
|
-
*
|
|
64
|
-
* @category ui/timeline
|
|
65
57
|
*/
|
|
66
58
|
type CngxTimelineRail = 'segmented' | 'continuous';
|
|
67
59
|
/**
|
|
@@ -77,8 +69,6 @@ type CngxTimelineRail = 'segmented' | 'continuous';
|
|
|
77
69
|
*
|
|
78
70
|
* Named `orientation` rather than `direction` because `[direction]` is
|
|
79
71
|
* already the sort order on this component.
|
|
80
|
-
*
|
|
81
|
-
* @category ui/timeline
|
|
82
72
|
*/
|
|
83
73
|
type CngxTimelineOrientation = 'vertical' | 'horizontal';
|
|
84
74
|
/**
|
|
@@ -116,8 +106,6 @@ type CngxTimelineOrientation = 'vertical' | 'horizontal';
|
|
|
116
106
|
* </cngx-timeline>
|
|
117
107
|
* ```
|
|
118
108
|
*
|
|
119
|
-
* @category ui/timeline
|
|
120
|
-
* @docsKind primary
|
|
121
109
|
* @wcag AA
|
|
122
110
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/timeline/timeline.component.ts
|
|
123
111
|
* @relatedTo CngxTimelineItem, CngxTimelineItemTpl, CNGX_TIMELINE_GROUPING_FACTORY, CNGX_TIMELINE_CONFIG
|
|
@@ -129,19 +117,21 @@ type CngxTimelineOrientation = 'vertical' | 'horizontal';
|
|
|
129
117
|
* @slot cngxTimelineError Rendered when the load fails; gets the error and a retry callback.
|
|
130
118
|
* @slot cngxTimelineRetryButton Replaces the retry control on the error surface.
|
|
131
119
|
* @slot cngxTimelineLoadingTail Rendered below the rows while more history streams in.
|
|
132
|
-
* <example-url
|
|
133
|
-
* <example-url
|
|
134
|
-
* <example-url
|
|
135
|
-
* <example-url
|
|
136
|
-
* <example-url
|
|
137
|
-
* <example-url
|
|
138
|
-
* <example-url
|
|
139
|
-
* <example-url
|
|
140
|
-
* <example-url
|
|
141
|
-
* <example-url
|
|
142
|
-
* <example-url
|
|
143
|
-
* <example-url
|
|
144
|
-
*
|
|
120
|
+
* <example-url>/#/ui/timeline/basics/flat-array</example-url>
|
|
121
|
+
* <example-url>/#/ui/timeline/basics/group-by-week</example-url>
|
|
122
|
+
* <example-url>/#/ui/timeline/basics/direction</example-url>
|
|
123
|
+
* <example-url>/#/ui/timeline/basics/ungrouped</example-url>
|
|
124
|
+
* <example-url>/#/ui/timeline/layout/horizontal</example-url>
|
|
125
|
+
* <example-url>/#/ui/timeline/layout/alternating-infographic</example-url>
|
|
126
|
+
* <example-url>/#/ui/timeline/layout/opposite-time</example-url>
|
|
127
|
+
* <example-url>/#/ui/timeline/integration/data-source</example-url>
|
|
128
|
+
* <example-url>/#/ui/timeline/integration/scroll-spy-nav</example-url>
|
|
129
|
+
* <example-url>/#/ui/timeline/async/error-retry</example-url>
|
|
130
|
+
* <example-url>/#/ui/timeline/async/refreshing-tail</example-url>
|
|
131
|
+
* <example-url>/#/ui/timeline/skins/activity-vs-narrative</example-url>
|
|
132
|
+
* <example-url>/#/ui/timeline/skins/dark</example-url>
|
|
133
|
+
* @since 0.3.0
|
|
134
|
+
* @axis level organism
|
|
145
135
|
*/
|
|
146
136
|
declare class CngxTimeline<T = unknown> implements CngxTimelineMarkerHost {
|
|
147
137
|
private readonly config;
|
|
@@ -238,7 +228,7 @@ declare class CngxTimeline<T = unknown> implements CngxTimelineMarkerHost {
|
|
|
238
228
|
protected readonly errorTpl: Signal<_angular_core.TemplateRef<_cngx_common_timeline.CngxTimelineErrorContext> | null>;
|
|
239
229
|
protected readonly retryButtonTpl: Signal<_angular_core.TemplateRef<_cngx_common_timeline.CngxTimelineRetryButtonContext> | null>;
|
|
240
230
|
protected readonly loadingTailTpl: Signal<_angular_core.TemplateRef<void> | null>;
|
|
241
|
-
protected readonly skeletonTpl: Signal<_angular_core.TemplateRef<
|
|
231
|
+
protected readonly skeletonTpl: Signal<_angular_core.TemplateRef<CngxTimelineSkeletonContext> | null>;
|
|
242
232
|
/**
|
|
243
233
|
* Forwarding façade over the bound `[state]`, published through
|
|
244
234
|
* `CNGX_STATEFUL`. Every member delegates, so swapping the bound state (or
|
|
@@ -293,6 +283,13 @@ declare class CngxTimeline<T = unknown> implements CngxTimelineMarkerHost {
|
|
|
293
283
|
* content will - which is what keeps the swap from reflowing.
|
|
294
284
|
*/
|
|
295
285
|
protected rowSide(index: number): 'start' | 'end';
|
|
286
|
+
/**
|
|
287
|
+
* One context per skeleton row, rebuilt only when the row count or the
|
|
288
|
+
* side rule changes, so the slot outlet sees a stable object per pass.
|
|
289
|
+
*/
|
|
290
|
+
private readonly skeletonContexts;
|
|
291
|
+
/** @internal Context of a consumer `*cngxTimelineSkeleton` row. */
|
|
292
|
+
protected skeletonContext(index: number, count: number): CngxTimelineSkeletonContext;
|
|
296
293
|
/** @internal Track by consumer identity when given, else by reference. */
|
|
297
294
|
protected trackItem: (index: number, item: T) => unknown;
|
|
298
295
|
constructor();
|
|
@@ -303,8 +300,6 @@ declare class CngxTimeline<T = unknown> implements CngxTimelineMarkerHost {
|
|
|
303
300
|
/**
|
|
304
301
|
* The fallback copy the timeline renders when a consumer bound no slot for
|
|
305
302
|
* a surface, resolved from the config cascade.
|
|
306
|
-
*
|
|
307
|
-
* @category ui/timeline
|
|
308
303
|
*/
|
|
309
304
|
interface CngxTimelineFallbackCopy {
|
|
310
305
|
readonly retry: string;
|
|
@@ -328,15 +323,12 @@ interface CngxTimelineFallbackCopy {
|
|
|
328
323
|
* clears the formatter should still get a legible header rather than an
|
|
329
324
|
* empty one that leaves the group unnamed.
|
|
330
325
|
*
|
|
331
|
-
* @
|
|
332
|
-
* @since 0.1.0
|
|
326
|
+
* @since 0.3.0
|
|
333
327
|
*/
|
|
334
328
|
declare function createTimelineFallbackCopy(config: CngxTimelineConfig): Signal<CngxTimelineFallbackCopy>;
|
|
335
329
|
|
|
336
330
|
/**
|
|
337
331
|
* Everything the template needs to decide what the body shows.
|
|
338
|
-
*
|
|
339
|
-
* @category ui/timeline
|
|
340
332
|
*/
|
|
341
333
|
interface CngxTimelineView {
|
|
342
334
|
readonly activeView: Signal<AsyncView>;
|
|
@@ -370,15 +362,12 @@ interface CngxTimelineView {
|
|
|
370
362
|
* than forking the organism - treating `pending` as content, or holding the
|
|
371
363
|
* skeleton through a refresh, is a per-app decision.
|
|
372
364
|
*
|
|
373
|
-
* @category ui/timeline
|
|
374
365
|
* @relatedTo CNGX_TIMELINE_VIEW_FACTORY
|
|
375
|
-
* @since 0.
|
|
366
|
+
* @since 0.3.0
|
|
376
367
|
*/
|
|
377
368
|
declare function createTimelineView(state: () => CngxAsyncState<unknown> | undefined, isEmpty: () => boolean, labels: Signal<CngxTimelineFallbackCopy>): CngxTimelineView;
|
|
378
369
|
/**
|
|
379
370
|
* The shape {@link CNGX_TIMELINE_VIEW_FACTORY} hands out.
|
|
380
|
-
*
|
|
381
|
-
* @category ui/timeline
|
|
382
371
|
*/
|
|
383
372
|
type CngxTimelineViewFactory = (state: () => CngxAsyncState<unknown> | undefined, isEmpty: () => boolean, labels: Signal<CngxTimelineFallbackCopy>) => CngxTimelineView;
|
|
384
373
|
/**
|
|
@@ -404,9 +393,8 @@ type CngxTimelineViewFactory = (state: () => CngxAsyncState<unknown> | undefined
|
|
|
404
393
|
* ]
|
|
405
394
|
* ```
|
|
406
395
|
*
|
|
407
|
-
* @category ui/timeline
|
|
408
396
|
* @relatedTo createTimelineView
|
|
409
|
-
* @since 0.
|
|
397
|
+
* @since 0.3.0
|
|
410
398
|
*/
|
|
411
399
|
declare const CNGX_TIMELINE_VIEW_FACTORY: InjectionToken<CngxTimelineViewFactory>;
|
|
412
400
|
|
|
@@ -414,8 +402,6 @@ declare const CNGX_TIMELINE_VIEW_FACTORY: InjectionToken<CngxTimelineViewFactory
|
|
|
414
402
|
* Anything a cngx slot directive exposes: its own `TemplateRef`. Structural
|
|
415
403
|
* rather than a base class, so a consumer's own slot directive satisfies it
|
|
416
404
|
* by shape alone.
|
|
417
|
-
*
|
|
418
|
-
* @category ui/timeline
|
|
419
405
|
*/
|
|
420
406
|
interface CngxTimelineSlotSource<C> {
|
|
421
407
|
readonly templateRef: TemplateRef<C>;
|
|
@@ -438,16 +424,13 @@ interface CngxTimelineSlotSource<C> {
|
|
|
438
424
|
* Exported because an ejected skin resolves the same three tiers and would
|
|
439
425
|
* otherwise have to restate the rule.
|
|
440
426
|
*
|
|
441
|
-
* @category ui/timeline
|
|
442
427
|
* @relatedTo createTimelineSlots
|
|
443
|
-
* @since 0.
|
|
428
|
+
* @since 0.3.0
|
|
444
429
|
*/
|
|
445
430
|
declare function createTimelineSlotBinding<C>(instance: Signal<CngxTimelineSlotSource<C> | undefined>, configured: () => TemplateRef<C> | undefined): Signal<TemplateRef<C> | null>;
|
|
446
431
|
/**
|
|
447
432
|
* The eight `contentChild()` queries a timeline runs, handed over as one bag
|
|
448
433
|
* because AOT requires them to be declared on the component itself.
|
|
449
|
-
*
|
|
450
|
-
* @category ui/timeline
|
|
451
434
|
*/
|
|
452
435
|
interface CngxTimelineSlotQueries<T> {
|
|
453
436
|
readonly item: Signal<CngxTimelineSlotSource<CngxTimelineItemContext<T>> | undefined>;
|
|
@@ -457,13 +440,11 @@ interface CngxTimelineSlotQueries<T> {
|
|
|
457
440
|
readonly error: Signal<CngxTimelineSlotSource<CngxTimelineErrorContext> | undefined>;
|
|
458
441
|
readonly retryButton: Signal<CngxTimelineSlotSource<CngxTimelineRetryButtonContext> | undefined>;
|
|
459
442
|
readonly loadingTail: Signal<CngxTimelineSlotSource<void> | undefined>;
|
|
460
|
-
readonly skeleton: Signal<CngxTimelineSlotSource<
|
|
443
|
+
readonly skeleton: Signal<CngxTimelineSlotSource<CngxTimelineSkeletonContext> | undefined>;
|
|
461
444
|
}
|
|
462
445
|
/**
|
|
463
446
|
* The same eight, resolved. Every member is already through the cascade, so
|
|
464
447
|
* the template reads one signal per region and never restates the rule.
|
|
465
|
-
*
|
|
466
|
-
* @category ui/timeline
|
|
467
448
|
*/
|
|
468
449
|
interface CngxTimelineSlots<T> {
|
|
469
450
|
readonly item: Signal<TemplateRef<CngxTimelineItemContext<T>> | null>;
|
|
@@ -473,7 +454,7 @@ interface CngxTimelineSlots<T> {
|
|
|
473
454
|
readonly error: Signal<TemplateRef<CngxTimelineErrorContext> | null>;
|
|
474
455
|
readonly retryButton: Signal<TemplateRef<CngxTimelineRetryButtonContext> | null>;
|
|
475
456
|
readonly loadingTail: Signal<TemplateRef<void> | null>;
|
|
476
|
-
readonly skeleton: Signal<TemplateRef<
|
|
457
|
+
readonly skeleton: Signal<TemplateRef<CngxTimelineSkeletonContext> | null>;
|
|
477
458
|
}
|
|
478
459
|
/**
|
|
479
460
|
* Runs {@link createTimelineSlotBinding} over the whole slot set at once, so
|
|
@@ -485,9 +466,8 @@ interface CngxTimelineSlots<T> {
|
|
|
485
466
|
* slots are generic. `TemplateRef` is method-bivariant, so a consumer's
|
|
486
467
|
* concrete template still assigns in.
|
|
487
468
|
*
|
|
488
|
-
* @category ui/timeline
|
|
489
469
|
* @relatedTo createTimelineSlotBinding
|
|
490
|
-
* @since 0.
|
|
470
|
+
* @since 0.3.0
|
|
491
471
|
*/
|
|
492
472
|
declare function createTimelineSlots<T>(queries: CngxTimelineSlotQueries<T>, templates: () => CngxTimelineTemplates | undefined): CngxTimelineSlots<T>;
|
|
493
473
|
|