@cngx/ui 0.1.0-rc.0 → 0.1.0-rc.2
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/fesm2022/cngx-ui-mat-stepper.mjs +76 -229
- package/fesm2022/cngx-ui-mat-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-mat-tabs.mjs +366 -40
- package/fesm2022/cngx-ui-mat-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui-stepper.mjs +299 -39
- package/fesm2022/cngx-ui-stepper.mjs.map +1 -1
- package/fesm2022/cngx-ui-tabs.mjs +344 -31
- package/fesm2022/cngx-ui-tabs.mjs.map +1 -1
- package/fesm2022/cngx-ui.mjs +1 -1
- package/mat-stepper/README.md +37 -14
- package/mat-tabs/styles/mat-tabs.css +58 -40
- package/package.json +3 -3
- package/stepper/README.md +98 -0
- package/tabs/README.md +18 -0
- package/types/cngx-ui-mat-stepper.d.ts +64 -113
- package/types/cngx-ui-mat-tabs.d.ts +175 -13
- package/types/cngx-ui-stepper.d.ts +187 -18
- package/types/cngx-ui-tabs.d.ts +227 -17
package/types/cngx-ui-tabs.d.ts
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import * as _cngx_common_tabs from '@cngx/common/tabs';
|
|
2
|
-
import { CngxTabPanelHost, CngxTabGroupAnnouncements, CngxTabGroupTemplateBindings, CngxTabHandle, CngxTabErrorBadgeContext, CngxTabBusySpinnerContext, CngxTabRejectionIconContext, tabOverflowOptionId } from '@cngx/common/tabs';
|
|
2
|
+
import { CngxTabPanelHost, CngxTabsSkin, CngxTabIconLayout, CngxTabsPanelMode, CngxTabAlign, CngxTabDismissals, CngxTabKeyboardNav, CngxTabGroupAnnouncements, CngxTabsHostAttrs, CngxTabGroupTemplateBindings, CngxTabHandle, CngxTabIconContext, CngxTabErrorBadgeContext, CngxTabBusySpinnerContext, CngxTabRejectionIconContext, tabOverflowOptionId } from '@cngx/common/tabs';
|
|
3
3
|
import * as _angular_core from '@angular/core';
|
|
4
4
|
import { Signal, TemplateRef } from '@angular/core';
|
|
5
5
|
import * as i2 from '@cngx/common/a11y';
|
|
6
6
|
import { CngxPopover } from '@cngx/common/popover';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* CNGX tab-group organism.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* CNGX tab-group organism. \
|
|
10
|
+
* Thin shell over {@link CngxTabGroupPresenter}
|
|
11
|
+
* and `CngxFocusRestore` via `hostDirectives`. The APG tablist keyboard
|
|
12
|
+
* model (automatic activation: arrow keys move focus AND select; Home/End
|
|
13
|
+
* jump to first/last; the active tab is the lone tab stop) lives in
|
|
14
|
+
* {@link createTabKeyboardNav}, deriving the roving stop from the
|
|
15
|
+
* presenter's `activeId` rather than a competing index. Material variant
|
|
16
|
+
* lives at `[cngxMatTabs]` in `@cngx/ui/mat-tabs`.
|
|
12
17
|
*
|
|
13
18
|
* All ARIA attrs are signal-driven - never one-shot bindings.
|
|
14
19
|
* `CngxLiveRegion` is mounted as a child `<span>` rather than a
|
|
15
20
|
* host directive: its `role="status"` would clobber the wrapper's
|
|
16
21
|
* `role="group"` landmark.
|
|
17
22
|
*
|
|
23
|
+
* @playground Material theme coverage across all skins ./examples/material-theme-coverage/skins-coverage.component.ts
|
|
24
|
+
* @playground Overflow "More" menu under resize ./examples/overflow-resize/overflow-resize.component.ts
|
|
25
|
+
* @playground Async commit-action (optimistic / pessimistic) ./examples/async-commit/async-commit.component.ts
|
|
26
|
+
* @playground Dismissable + addable tabs ./examples/dynamic-tabs/dynamic-tabs.component.ts
|
|
18
27
|
* @playground Form error aggregation ./examples/form-errors/form-errors.component.ts
|
|
28
|
+
* @playground Routed tabs with a CanDeactivate guard ./examples/routed-outlet/routed-outlet.component.ts
|
|
19
29
|
* @see {@link CngxMatTabs} for the Material `<mat-tab-group>` variant with `[cngxMatTabError]`.
|
|
20
30
|
*
|
|
21
31
|
* @category ui/tabs
|
|
@@ -23,26 +33,70 @@ import { CngxPopover } from '@cngx/common/popover';
|
|
|
23
33
|
* @wcag AA
|
|
24
34
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-group.component.ts
|
|
25
35
|
* @since 0.1.0
|
|
26
|
-
* @relatedTo CngxTabOverflow, CngxTabGroupPresenter, CngxTab,
|
|
36
|
+
* @relatedTo CngxTabOverflow, CngxTabGroupPresenter, CngxTab, CngxFocusRestore
|
|
27
37
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>
|
|
28
38
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>
|
|
29
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
30
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
31
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
32
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
33
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
34
|
-
* <example-url>http://localhost:4200/#/ui/tabs/tab-
|
|
39
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/all-skins-side-by-side</example-url>
|
|
40
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/contained</example-url>
|
|
41
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/line</example-url>
|
|
42
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/pill</example-url>
|
|
43
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/pill-vs-toggle-group</example-url>
|
|
44
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-skins/vertical-skins</example-url>
|
|
35
45
|
*/
|
|
36
46
|
declare class CngxTabGroup implements CngxTabPanelHost {
|
|
37
47
|
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
38
48
|
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
49
|
+
/**
|
|
50
|
+
* Visual skin. Cascade `input ?? config ?? 'line'`, resolved by
|
|
51
|
+
* {@link hostAttrs} and reflected onto `[data-skin]`. The skin is a
|
|
52
|
+
* pure CSS concern - structure, slots, ARIA, and keyboard behaviour
|
|
53
|
+
* are identical across all values. Public (consumer-facing input,
|
|
54
|
+
* like `ariaLabel`); the resolved value, not the raw input, is what
|
|
55
|
+
* the host binding reads.
|
|
56
|
+
*/
|
|
57
|
+
readonly skin: _angular_core.InputSignal<CngxTabsSkin | undefined>;
|
|
58
|
+
/**
|
|
59
|
+
* Icon layout. Cascade `input ?? config ?? 'start'`, reflected onto
|
|
60
|
+
* `[data-icon-layout]`. Orthogonal to skin and orientation.
|
|
61
|
+
*/
|
|
62
|
+
readonly iconLayout: _angular_core.InputSignal<CngxTabIconLayout | undefined>;
|
|
63
|
+
/**
|
|
64
|
+
* Panel render strategy. Cascade `input ?? config ?? 'eager'`,
|
|
65
|
+
* reflected onto `[data-panel-mode]`. `'eager'` (default) renders every
|
|
66
|
+
* panel's content up front (byte-identical to before this input
|
|
67
|
+
* existed); `'lazy'` keep-alives content after first activation;
|
|
68
|
+
* `'lazy-destroy'` renders only the active panel's content. The panel
|
|
69
|
+
* `<div>` always stays in the DOM regardless.
|
|
70
|
+
*/
|
|
71
|
+
readonly panelMode: _angular_core.InputSignal<CngxTabsPanelMode | undefined>;
|
|
72
|
+
/** Stretch tabs to fill the strip width (horizontal only); reflects `[data-fitted]`. Cascade `input ?? config ?? false`. */
|
|
73
|
+
readonly fitted: _angular_core.InputSignal<boolean | undefined>;
|
|
74
|
+
/** Tab-cluster alignment when not fitted (horizontal only); reflects `[data-tab-align]`. Cascade `input ?? config ?? 'start'`. */
|
|
75
|
+
readonly tabAlign: _angular_core.InputSignal<CngxTabAlign | undefined>;
|
|
76
|
+
/**
|
|
77
|
+
* Whether tabs render a close affordance. Cascade
|
|
78
|
+
* `input ?? config ?? false`. A per-`CngxTab` `[closable]` override
|
|
79
|
+
* wins over this group default. When on, each closable tab gets a
|
|
80
|
+
* close button (and Delete on the focused tab closes it); the
|
|
81
|
+
* `(tabClose)` output fires with the tab id and index for the
|
|
82
|
+
* consumer to remove from its data.
|
|
83
|
+
*/
|
|
84
|
+
readonly closable: _angular_core.InputSignal<boolean | undefined>;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the group renders an add-tab button after the strip. Cascade
|
|
87
|
+
* `input ?? config ?? false`. When on, the `(tabAdd)` output fires for
|
|
88
|
+
* the consumer to append a tab to its data.
|
|
89
|
+
*/
|
|
90
|
+
readonly addable: _angular_core.InputSignal<boolean | undefined>;
|
|
39
91
|
protected readonly presenter: _cngx_common_tabs.CngxTabGroupHost;
|
|
40
92
|
protected readonly i18n: _cngx_common_tabs.CngxTabsI18n;
|
|
41
93
|
protected readonly config: _cngx_common_tabs.CngxTabsConfig;
|
|
42
|
-
/** Default-glyph table for the template's fallback spans.
|
|
94
|
+
/** Default-glyph table for the template's fallback spans. */
|
|
43
95
|
protected readonly glyphs: {
|
|
44
96
|
readonly errorBadge: "!";
|
|
45
97
|
readonly rejectionIcon: "!";
|
|
98
|
+
readonly closeIcon: "\u00D7";
|
|
99
|
+
readonly addIcon: "+";
|
|
46
100
|
};
|
|
47
101
|
private readonly hostElement;
|
|
48
102
|
private readonly injector;
|
|
@@ -56,6 +110,23 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
56
110
|
private readonly errorBadgeSlot;
|
|
57
111
|
private readonly rejectionIconSlot;
|
|
58
112
|
private readonly busySpinnerSlot;
|
|
113
|
+
private readonly iconSlot;
|
|
114
|
+
private readonly closeIconSlot;
|
|
115
|
+
private readonly addIconSlot;
|
|
116
|
+
/**
|
|
117
|
+
* Dismissable / addable affordance surface (close + add resolution,
|
|
118
|
+
* close interaction, focus restoration). Level-2 helper keeps the
|
|
119
|
+
* cascade + handlers off the organism class (LOC guard).
|
|
120
|
+
*/
|
|
121
|
+
protected readonly dismiss: CngxTabDismissals;
|
|
122
|
+
/**
|
|
123
|
+
* APG tablist keyboard model (automatic activation). Owns arrow / Home /
|
|
124
|
+
* End resolution, the `host.select()` activation, and focus movement;
|
|
125
|
+
* derives each tab's roving `tabindex` from the presenter's `activeId`
|
|
126
|
+
* (single source of truth). Level-2 helper keeps the keyboard logic off
|
|
127
|
+
* the organism class (LOC guard).
|
|
128
|
+
*/
|
|
129
|
+
protected readonly keyboard: CngxTabKeyboardNav;
|
|
59
130
|
/**
|
|
60
131
|
* AT-announcement bundle from `@cngx/common/tabs/announcements/`.
|
|
61
132
|
* Owns role descriptions, resolved aria-label, live-region phrasing,
|
|
@@ -63,11 +134,28 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
63
134
|
* direction prefix.
|
|
64
135
|
*/
|
|
65
136
|
protected readonly announcements: CngxTabGroupAnnouncements;
|
|
137
|
+
/**
|
|
138
|
+
* Resolved skin / icon-layout cascade (`input ?? config ?? default`),
|
|
139
|
+
* read by the `[data-skin]` / `[data-icon-layout]` host bindings. The
|
|
140
|
+
* Level-2 helper keeps the cascade off the organism class (LOC guard).
|
|
141
|
+
*/
|
|
142
|
+
protected readonly hostAttrs: CngxTabsHostAttrs;
|
|
143
|
+
/**
|
|
144
|
+
* Whether the active panel contains a natively-focusable descendant.
|
|
145
|
+
* Resolved by a post-render DOM probe (the only way to know - the
|
|
146
|
+
* panel content is consumer-projected). Drives {@link panelTabindex}:
|
|
147
|
+
* a panel with no focusable child earns one tab stop so keyboard users
|
|
148
|
+
* can still reach its content (APG tabpanel pattern); a panel that
|
|
149
|
+
* already has reachable content does not (no redundant stop). Boolean
|
|
150
|
+
* with default `Object.is`, so a stable probe never re-triggers CD.
|
|
151
|
+
*/
|
|
152
|
+
private readonly activePanelHasFocusable;
|
|
66
153
|
constructor();
|
|
67
154
|
private readonly tabDirectiveById;
|
|
68
155
|
/**
|
|
69
|
-
* Resolved 3-stage cascade for `errorBadge`, `rejectionIcon`,
|
|
70
|
-
* `null` -> render built-in default
|
|
156
|
+
* Resolved 3-stage cascade for `errorBadge`, `rejectionIcon`,
|
|
157
|
+
* `busySpinner`, `icon`. `null` -> render built-in default (or, for
|
|
158
|
+
* `icon`, render nothing).
|
|
71
159
|
*/
|
|
72
160
|
protected readonly templates: CngxTabGroupTemplateBindings;
|
|
73
161
|
readonly tabs: Signal<readonly CngxTabHandle[]>;
|
|
@@ -78,9 +166,50 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
78
166
|
protected isTabBusy(tab: CngxTabHandle): boolean;
|
|
79
167
|
protected tabHeaderId(tab: CngxTabHandle): string;
|
|
80
168
|
protected tabPanelId(tab: CngxTabHandle): string;
|
|
169
|
+
/**
|
|
170
|
+
* APG tabpanel `tabindex`: `0` only when the selected panel has no
|
|
171
|
+
* focusable descendant (so its content is keyboard-reachable from the
|
|
172
|
+
* tablist), else `null` - never a redundant tab stop. Inactive panels
|
|
173
|
+
* are `null` (they are `[hidden]`).
|
|
174
|
+
*/
|
|
175
|
+
protected panelTabindex(tab: CngxTabHandle): 0 | null;
|
|
176
|
+
/**
|
|
177
|
+
* Keep-alive set for `panelMode='lazy'`: the ids of every tab that has
|
|
178
|
+
* ever been activated. Derived history (Pillar 1) - a `linkedSignal`
|
|
179
|
+
* accumulating onto its own previous value as `activeId` moves, NOT an
|
|
180
|
+
* `effect` that writes a set. The structural `equal` (size + membership)
|
|
181
|
+
* means re-activating an already-seen tab returns an equal set, so the
|
|
182
|
+
* reference is stable and downstream `shouldRenderContent` reads do not
|
|
183
|
+
* churn. Unbounded by design: `lazy` trades retention (every visited
|
|
184
|
+
* panel's content stays alive for the directive's life) for keep-alive;
|
|
185
|
+
* the set is bounded by tab count, and `lazy-destroy` is the bounded
|
|
186
|
+
* alternative when retention is unwanted.
|
|
187
|
+
*/
|
|
188
|
+
private readonly seenIds;
|
|
189
|
+
/**
|
|
190
|
+
* Whether a tab's panel content should be rendered now. The panel
|
|
191
|
+
* `<div>` is always in the DOM (the `aria-controls` target); only its
|
|
192
|
+
* inner content is gated. `eager` is byte-identical to the original
|
|
193
|
+
* behaviour (everything rendered, visibility toggled via `[hidden]`).
|
|
194
|
+
*/
|
|
195
|
+
protected shouldRenderContent(tab: CngxTabHandle): boolean;
|
|
81
196
|
protected tabDescriptorId(tab: CngxTabHandle): string;
|
|
82
|
-
/**
|
|
197
|
+
/**
|
|
198
|
+
* `true` when the tab is in error - the folded `hasError` (direct
|
|
199
|
+
* `[error]` flag OR the aggregator's reveal-gated `shouldShow()`), so
|
|
200
|
+
* a direct-error tab lights the badge without an aggregator while
|
|
201
|
+
* deferred-reveal aggregators stay silent until revealed.
|
|
202
|
+
*/
|
|
83
203
|
protected showErrorBadge(tab: CngxTabHandle): boolean;
|
|
204
|
+
/**
|
|
205
|
+
* Context for `*cngxTabIcon`. Allocates fresh per CD - `active` is
|
|
206
|
+
* reactive (selection), and `*ngTemplateOutlet` only re-evaluates
|
|
207
|
+
* `let-*` bindings when the context reference changes (`Object.is`
|
|
208
|
+
* input-diff); a `WeakMap`-cached object with a mutated `active`
|
|
209
|
+
* would leave consumer bindings stale. Same pattern as
|
|
210
|
+
* {@link busySpinnerContextFor}.
|
|
211
|
+
*/
|
|
212
|
+
protected iconContextFor(tab: CngxTabHandle, index: number): CngxTabIconContext;
|
|
84
213
|
/**
|
|
85
214
|
* Stable per-tab `*cngxTabErrorBadge` context cache. Context is
|
|
86
215
|
* `{ tab }` only (no reactive fields), so a `WeakMap` keeps the
|
|
@@ -107,6 +236,18 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
107
236
|
*/
|
|
108
237
|
protected rejectionIconContextFor(failedIndex: number): CngxTabRejectionIconContext;
|
|
109
238
|
protected handleHeaderClick(tab: CngxTabHandle): void;
|
|
239
|
+
/**
|
|
240
|
+
* Roving `tabindex` for a tab button: `0` for the active tab, `-1` for
|
|
241
|
+
* the rest, so the tablist is a single tab stop (APG) and `Tab` lands
|
|
242
|
+
* on the active tab. Derived in {@link keyboard} from `activeId`.
|
|
243
|
+
*/
|
|
244
|
+
protected tabTabindex(tab: CngxTabHandle): 0 | -1;
|
|
245
|
+
/**
|
|
246
|
+
* Single `(keydown)` entry for a tab button: APG navigation
|
|
247
|
+
* (arrows / Home / End, automatic activation) first, then Delete-to-close
|
|
248
|
+
* when navigation did not consume the event.
|
|
249
|
+
*/
|
|
250
|
+
protected handleTabKeydown(tab: CngxTabHandle, event: KeyboardEvent): void;
|
|
110
251
|
selectById(id: string): void;
|
|
111
252
|
/**
|
|
112
253
|
* Clear the presenter's `lastFailedIndex` rejection flag - exposed
|
|
@@ -115,9 +256,76 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
115
256
|
*/
|
|
116
257
|
clearLastFailed(): void;
|
|
117
258
|
labelTemplateFor(id: string): TemplateRef<unknown> | null;
|
|
259
|
+
subLabelTemplateFor(id: string): TemplateRef<unknown> | null;
|
|
118
260
|
contentTemplateFor(id: string): TemplateRef<unknown> | null;
|
|
119
261
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabGroup, never>;
|
|
120
|
-
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; }; }, {}, ["tabDirectives", "errorBadgeSlot", "rejectionIconSlot", "busySpinnerSlot"], ["cngx-tab-overflow", "*"], true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; "loop": "loop"; "commitAction": "commitAction"; "commitMode": "commitMode"; }; outputs: { "activeIndexChange": "activeIndexChange";
|
|
262
|
+
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: {}; }]>;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* CNGX tab-nav organism. \
|
|
267
|
+
* A `role="navigation"` landmark that wraps consumer-authored
|
|
268
|
+
* `<a cngxTabLink routerLink>` anchors into a tab bar. Native parallel of
|
|
269
|
+
* `[cngxMatTabNav]` in `@cngx/ui/mat-tabs`, and the link-driven sibling of
|
|
270
|
+
* the programmatic `<cngx-tab-group>` tablist: a navigation of natively
|
|
271
|
+
* focusable links is a different WAI-ARIA pattern than an automatic-
|
|
272
|
+
* activation tablist, so it is a separate organism, not a skin flag.
|
|
273
|
+
*
|
|
274
|
+
* Thin shell over {@link CngxTabGroupPresenter} via `hostDirectives` - the
|
|
275
|
+
* registry, `activeIndex`, and `activeId` come from the same brain the
|
|
276
|
+
* tablist organism and the Material bridge compose. There is no keyboard
|
|
277
|
+
* model and no commit gating: links are natural `Tab` stops, `Enter`
|
|
278
|
+
* activates the `routerLink`, and the router runs `CanDeactivate` natively.
|
|
279
|
+
* Add `[cngxTabsRouteSync]` to drive the active link from the route - it
|
|
280
|
+
* reflects `NavigationEnd` onto `activeIndex`; its commit-action stays
|
|
281
|
+
* dormant because nothing here calls `presenter.select()`.
|
|
282
|
+
*
|
|
283
|
+
* `CngxLiveRegion` is mounted as a child `<span>` rather than a host
|
|
284
|
+
* directive: its `role="status"` would clobber the host's `role="navigation"`
|
|
285
|
+
* landmark. Its content is the active link's label (Pillar 2 - the active
|
|
286
|
+
* change is announced).
|
|
287
|
+
*
|
|
288
|
+
* ```html
|
|
289
|
+
* <cngx-tab-nav cngxTabsRouteSync aria-label="Sections">
|
|
290
|
+
* <a cngxTabLink id="overview" routerLink="overview">Overview</a>
|
|
291
|
+
* <a cngxTabLink id="profile" routerLink="profile">Profile</a>
|
|
292
|
+
* </cngx-tab-nav>
|
|
293
|
+
* <router-outlet></router-outlet>
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* @playground Native router tabs with a CanDeactivate guard ./examples/routed-nav/routed-nav.component.ts
|
|
297
|
+
* @see {@link CngxTabGroup} for the programmatic tablist organism.
|
|
298
|
+
*
|
|
299
|
+
* @category ui/tabs
|
|
300
|
+
* @docsKind primary
|
|
301
|
+
* @wcag AA
|
|
302
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/ui/tabs/tab-nav.component.ts
|
|
303
|
+
* @since 0.1.0
|
|
304
|
+
* @relatedTo CngxTabLink, CngxTabsRouteSync, CngxTabGroup, CngxMatTabNav
|
|
305
|
+
*/
|
|
306
|
+
declare class CngxTabNav {
|
|
307
|
+
readonly ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
308
|
+
readonly ariaLabelledBy: _angular_core.InputSignal<string | undefined>;
|
|
309
|
+
/**
|
|
310
|
+
* Visual skin. Cascade `input ?? config ?? 'line'`, reflected onto
|
|
311
|
+
* `[data-skin]`. Resolved inline (single axis) rather than via
|
|
312
|
+
* `createTabsHostAttrs`: that helper resolves five tablist axes the nav
|
|
313
|
+
* does not use, so pulling it here would fabricate dead inputs - inline
|
|
314
|
+
* resolution is Komposition statt Konfiguration (Pillar 3).
|
|
315
|
+
*/
|
|
316
|
+
readonly skin: _angular_core.InputSignal<CngxTabsSkin | undefined>;
|
|
317
|
+
protected readonly presenter: _cngx_common_tabs.CngxTabGroupHost;
|
|
318
|
+
private readonly config;
|
|
319
|
+
protected readonly resolvedSkin: Signal<CngxTabsSkin>;
|
|
320
|
+
/**
|
|
321
|
+
* Active link's accessible label, fed to the polite live region. Derived
|
|
322
|
+
* from `activeId` through the registered handle (Pillar 1 - single
|
|
323
|
+
* source, the route-fed active index). Empty string before any link is
|
|
324
|
+
* active so the region stays silent.
|
|
325
|
+
*/
|
|
326
|
+
protected readonly liveAnnouncement: Signal<string>;
|
|
327
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxTabNav, never>;
|
|
328
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabNav, "cngx-tab-nav", ["cngxTabNav"], { "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledBy": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "skin": { "alias": "skin"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, [{ directive: typeof _cngx_common_tabs.CngxTabGroupPresenter; inputs: { "activeIndex": "activeIndex"; "orientation": "orientation"; }; outputs: { "activeIndexChange": "activeIndexChange"; }; }]>;
|
|
121
329
|
}
|
|
122
330
|
|
|
123
331
|
/**
|
|
@@ -142,6 +350,8 @@ declare class CngxTabGroup implements CngxTabPanelHost {
|
|
|
142
350
|
* @since 0.1.0
|
|
143
351
|
* @relatedTo CngxTabGroup, CngxPopover, CngxActiveDescendant
|
|
144
352
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/8-tabs-in-a-narrow-container</example-url>
|
|
353
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/all-skins-horizontal</example-url>
|
|
354
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-overflow/all-skins-vertical</example-url>
|
|
145
355
|
*/
|
|
146
356
|
declare class CngxTabOverflow {
|
|
147
357
|
protected readonly panelHost: CngxTabPanelHost;
|
|
@@ -190,4 +400,4 @@ declare class CngxTabOverflow {
|
|
|
190
400
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxTabOverflow, "cngx-tab-overflow", ["cngxTabOverflow"], {}, {}, ["triggerSlot", "itemSlot"], never, true, never>;
|
|
191
401
|
}
|
|
192
402
|
|
|
193
|
-
export { CngxTabGroup, CngxTabOverflow };
|
|
403
|
+
export { CngxTabGroup, CngxTabNav, CngxTabOverflow };
|