@cngx/common 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/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- 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/stepper/README.md +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { Signal, InjectionToken, ModelSignal, TemplateRef, OnInit, AfterContentInit, EnvironmentProviders, Provider, Injector } from '@angular/core';
|
|
3
|
+
import { CngxTransitionOutcome, CngxCommitController } from '@cngx/common/data';
|
|
3
4
|
import { CngxAsyncState, StatusTransition } from '@cngx/core/utils';
|
|
4
5
|
import { Observable } from 'rxjs';
|
|
5
6
|
import { CngxErrorAggregatorContract } from '@cngx/common/interactive';
|
|
6
7
|
import { Router, ActivatedRoute } from '@angular/router';
|
|
7
|
-
import {
|
|
8
|
+
import { CngxMessage } from '@cngx/core/i18n';
|
|
8
9
|
import { CngxDirection } from '@cngx/core';
|
|
9
10
|
import { CngxActiveDescendant, ActiveDescendantItem } from '@cngx/common/a11y';
|
|
10
11
|
import { CngxPopover } from '@cngx/common/popover';
|
|
@@ -90,10 +91,25 @@ interface CngxTabGroupHost {
|
|
|
90
91
|
*/
|
|
91
92
|
readonly commitTransition: StatusTransition;
|
|
92
93
|
/**
|
|
93
|
-
*
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
94
|
+
* Settle record of the most recent commit that did not land:
|
|
95
|
+
* `kind: 'refused'` when `commitAction` answered `false`, `'failed'`
|
|
96
|
+
* when it threw, rejected or errored; `index` is the rejected target,
|
|
97
|
+
* `sequence` is bumped once per settled refusal or failure. Kept
|
|
98
|
+
* through {@link clearLastFailed} (which only hides the marker), so the
|
|
99
|
+
* announcement record survives a cleared decoration. Closing a tab
|
|
100
|
+
* before the target shifts `index` and keeps `sequence`; closing the
|
|
101
|
+
* target itself drops the record. A refusal leaves `commitState` at
|
|
102
|
+
* `'idle'` with its data intact, so this is the only place a refusal
|
|
103
|
+
* is visible as such.
|
|
104
|
+
*/
|
|
105
|
+
readonly lastOutcome: Signal<CngxTransitionOutcome | undefined>;
|
|
106
|
+
/**
|
|
107
|
+
* Tab index of the most recently rejected (refused or failed) commit
|
|
108
|
+
* target, both optimistic and pessimistic modes, or `undefined` when no
|
|
109
|
+
* rejection marker is shown. Derived from {@link lastOutcome}; cleared
|
|
110
|
+
* on the next successful re-pick of the same index or via
|
|
111
|
+
* {@link clearLastFailed}. Drives the persistent rejection-icon
|
|
112
|
+
* decoration.
|
|
97
113
|
*
|
|
98
114
|
* @remarks
|
|
99
115
|
* The `pending → error` pulse keyframe (`cngx-tab-pulse-error`)
|
|
@@ -106,7 +122,7 @@ interface CngxTabGroupHost {
|
|
|
106
122
|
/**
|
|
107
123
|
* Safe-harbour origin index captured at the start of an active
|
|
108
124
|
* commit window. Written when `select()` opens a transition under
|
|
109
|
-
* `commitAction`; retained on
|
|
125
|
+
* `commitAction`; retained on a refusal or failure so the live-region phrase
|
|
110
126
|
* can resolve the origin label; cleared on `success`. Outside the
|
|
111
127
|
* commit window the slot may carry a stale value - consumers must
|
|
112
128
|
* gate reads by joining with `lastFailedIndex`. The origin is
|
|
@@ -114,7 +130,13 @@ interface CngxTabGroupHost {
|
|
|
114
130
|
*/
|
|
115
131
|
readonly originIndexDuringCommit: Signal<number | undefined>;
|
|
116
132
|
register(handle: CngxTabHandle): void;
|
|
117
|
-
|
|
133
|
+
/**
|
|
134
|
+
* Remove a registration. Pass the registering `handle` so a destroyed
|
|
135
|
+
* instance can only evict itself: under an id collision the presenter's
|
|
136
|
+
* idempotent re-register replaces the stored handle, and the OLD
|
|
137
|
+
* instance's late destroy must not tear down the NEW instance's entry.
|
|
138
|
+
*/
|
|
139
|
+
unregister(id: string, handle?: CngxTabHandle): void;
|
|
118
140
|
select(index: number): void;
|
|
119
141
|
selectNext(): void;
|
|
120
142
|
selectPrevious(): void;
|
|
@@ -134,10 +156,11 @@ interface CngxTabGroupHost {
|
|
|
134
156
|
*/
|
|
135
157
|
requestAdd(): void;
|
|
136
158
|
/**
|
|
137
|
-
* Clear {@link lastFailedIndex} without unwinding
|
|
159
|
+
* Clear the {@link lastFailedIndex} marker without unwinding
|
|
138
160
|
* {@link originIndexDuringCommit} (consumers gate reads on
|
|
139
|
-
* `lastFailedIndex` anyway)
|
|
140
|
-
* changes and the rollback marker is
|
|
161
|
+
* `lastFailedIndex` anyway) and without touching {@link lastOutcome}.
|
|
162
|
+
* Call when the bound data source changes and the rollback marker is
|
|
163
|
+
* no longer meaningful.
|
|
141
164
|
*/
|
|
142
165
|
clearLastFailed(): void;
|
|
143
166
|
}
|
|
@@ -185,9 +208,20 @@ type CngxTabsCommitAction = (fromIndex: number, toIndex: number) => boolean | Pr
|
|
|
185
208
|
* <example-url>http://localhost:4200/#/ui/tabs/tab-commit-action/optimistic-pessimistic-commits-with-bridge-directives</example-url>
|
|
186
209
|
*/
|
|
187
210
|
declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
211
|
+
private readonly config;
|
|
188
212
|
readonly activeIndex: i0.ModelSignal<number>;
|
|
189
|
-
|
|
190
|
-
|
|
213
|
+
/**
|
|
214
|
+
* @internal Two-field alias - bind the public `[orientation]`; read
|
|
215
|
+
* the resolved {@link orientation} computed (input ?? config ?? default).
|
|
216
|
+
*/
|
|
217
|
+
readonly orientationInput: i0.InputSignal<"horizontal" | "vertical" | undefined>;
|
|
218
|
+
readonly orientation: Signal<"horizontal" | "vertical">;
|
|
219
|
+
/**
|
|
220
|
+
* @internal Two-field alias - bind the public `[loop]`; read the
|
|
221
|
+
* resolved {@link loop} computed (input ?? config ?? default).
|
|
222
|
+
*/
|
|
223
|
+
readonly loopInput: i0.InputSignal<boolean | undefined>;
|
|
224
|
+
readonly loop: Signal<boolean>;
|
|
191
225
|
/**
|
|
192
226
|
* Async-commit action gating the transition.
|
|
193
227
|
* When non-null, `select(...)` routes through {@link CngxTabsCommitHandler}; the
|
|
@@ -207,9 +241,9 @@ declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
|
207
241
|
*
|
|
208
242
|
* @internal Two-field alias - bind the public `[commitMode]`; read
|
|
209
243
|
* the resolved {@link commitMode} computed (DI fallback mode wins
|
|
210
|
-
* when a routed action is active).
|
|
244
|
+
* when a routed action is active, else input ?? config ?? default).
|
|
211
245
|
*/
|
|
212
|
-
readonly commitModeInput: i0.InputSignal<"optimistic" | "pessimistic">;
|
|
246
|
+
readonly commitModeInput: i0.InputSignal<"optimistic" | "pessimistic" | undefined>;
|
|
213
247
|
private readonly injector;
|
|
214
248
|
private injectedActionSource;
|
|
215
249
|
private resolveInjectedAction;
|
|
@@ -229,7 +263,7 @@ declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
|
229
263
|
readonly commitMode: Signal<"optimistic" | "pessimistic">;
|
|
230
264
|
/**
|
|
231
265
|
* Emitted when a tab's close affordance is activated (the close
|
|
232
|
-
* button or Delete
|
|
266
|
+
* button or Delete on the focused tab). The presenter has
|
|
233
267
|
* already moved the active index onto the surviving neighbour; the
|
|
234
268
|
* consumer removes the tab from its own data in the handler.
|
|
235
269
|
*/
|
|
@@ -258,8 +292,12 @@ declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
|
258
292
|
* the tracker's `linkedSignal` is allocated once per presenter.
|
|
259
293
|
*/
|
|
260
294
|
readonly commitTransition: StatusTransition;
|
|
261
|
-
private readonly
|
|
295
|
+
private readonly lastOutcomeState;
|
|
296
|
+
private readonly clearedSequenceState;
|
|
297
|
+
private outcomeSequence;
|
|
262
298
|
private readonly originIndexDuringCommitState;
|
|
299
|
+
/** {@inheritDoc CngxTabGroupHost.lastOutcome} */
|
|
300
|
+
readonly lastOutcome: Signal<CngxTransitionOutcome | undefined>;
|
|
263
301
|
/** {@inheritDoc CngxTabGroupHost.lastFailedIndex} */
|
|
264
302
|
readonly lastFailedIndex: Signal<number | undefined>;
|
|
265
303
|
/** {@inheritDoc CngxTabGroupHost.originIndexDuringCommit} */
|
|
@@ -269,7 +307,7 @@ declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
|
269
307
|
private readonly clampedIndex;
|
|
270
308
|
readonly activeId: Signal<string | null>;
|
|
271
309
|
register(handle: CngxTabHandle): void;
|
|
272
|
-
unregister(id: string): void;
|
|
310
|
+
unregister(id: string, handle?: CngxTabHandle): void;
|
|
273
311
|
/** {@inheritDoc CngxTabGroupHost.clearLastFailed} */
|
|
274
312
|
clearLastFailed(): void;
|
|
275
313
|
select(index: number): void;
|
|
@@ -279,7 +317,7 @@ declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
|
279
317
|
requestClose(id: string): void;
|
|
280
318
|
requestAdd(): void;
|
|
281
319
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTabGroupPresenter, never>;
|
|
282
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTabGroupPresenter, "[cngxTabGroup]", ["cngxTabGroup"], { "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; "
|
|
320
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTabGroupPresenter, "[cngxTabGroup]", ["cngxTabGroup"], { "activeIndex": { "alias": "activeIndex"; "required": false; "isSignal": true; }; "orientationInput": { "alias": "orientation"; "required": false; "isSignal": true; }; "loopInput": { "alias": "loop"; "required": false; "isSignal": true; }; "commitActionInput": { "alias": "commitAction"; "required": false; "isSignal": true; }; "commitModeInput": { "alias": "commitMode"; "required": false; "isSignal": true; }; }, { "activeIndex": "activeIndexChange"; "tabClose": "tabClose"; "tabAdd": "tabAdd"; }, never, never, true, never>;
|
|
283
321
|
}
|
|
284
322
|
|
|
285
323
|
/**
|
|
@@ -694,9 +732,11 @@ declare class CngxTabLink implements OnInit {
|
|
|
694
732
|
/** `true` when the presenter's `activeId` equals this link's id. */
|
|
695
733
|
protected readonly selected: Signal<boolean>;
|
|
696
734
|
/**
|
|
697
|
-
* Id of the injected SR error-message descriptor.
|
|
698
|
-
*
|
|
699
|
-
*
|
|
735
|
+
* Id of the injected SR error-message descriptor. The `aria-describedby`
|
|
736
|
+
* host binding emits it only while `hasError()` - `aria-hidden` on a
|
|
737
|
+
* directly-referenced node does not suppress it (accname 1.2 traverses
|
|
738
|
+
* the reference), so the id reference itself is gated, not just the
|
|
739
|
+
* span's visibility.
|
|
700
740
|
*/
|
|
701
741
|
protected readonly descriptorId: Signal<string>;
|
|
702
742
|
/** The injected descriptor `<span>`, created in {@link ngOnInit}. */
|
|
@@ -753,8 +793,11 @@ declare class CngxTabLink implements OnInit {
|
|
|
753
793
|
* @relatedTo CngxTabGroupPresenter, CngxTab
|
|
754
794
|
*/
|
|
755
795
|
declare class CngxTabsFragmentSync implements AfterContentInit {
|
|
756
|
-
readonly
|
|
757
|
-
readonly
|
|
796
|
+
readonly modeInput: i0.InputSignal<"fragment" | "queryParam" | undefined>;
|
|
797
|
+
readonly paramNameInput: i0.InputSignal<string | undefined>;
|
|
798
|
+
private readonly config;
|
|
799
|
+
readonly mode: i0.Signal<"fragment" | "queryParam">;
|
|
800
|
+
readonly paramName: i0.Signal<string>;
|
|
758
801
|
/**
|
|
759
802
|
* Whether reflecting the active tab into the URL replaces the current
|
|
760
803
|
* history entry instead of pushing a new one. Default `true`, which is
|
|
@@ -799,10 +842,17 @@ declare class CngxTabsFragmentSync implements AfterContentInit {
|
|
|
799
842
|
*/
|
|
800
843
|
ngAfterContentInit(): void;
|
|
801
844
|
private seedFromUrl;
|
|
845
|
+
/**
|
|
846
|
+
* Reflect `id` into the URL. Fragment mode re-serializes the existing
|
|
847
|
+
* fragment params so foreign state (`#foo=1&tab=x`) survives the
|
|
848
|
+
* write; values are URI-encoded symmetric to {@link parseFragment}.
|
|
849
|
+
*/
|
|
850
|
+
private writeUrl;
|
|
851
|
+
private serializeFragment;
|
|
802
852
|
private readUrlValue;
|
|
803
853
|
private parseFragment;
|
|
804
854
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTabsFragmentSync, never>;
|
|
805
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTabsFragmentSync, "[cngxTabsFragmentSync]", ["cngxTabsFragmentSync"], { "
|
|
855
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTabsFragmentSync, "[cngxTabsFragmentSync]", ["cngxTabsFragmentSync"], { "modeInput": { "alias": "mode"; "required": false; "isSignal": true; }; "paramNameInput": { "alias": "paramName"; "required": false; "isSignal": true; }; "replaceUrl": { "alias": "replaceUrl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
806
856
|
}
|
|
807
857
|
|
|
808
858
|
/**
|
|
@@ -990,7 +1040,7 @@ declare class CngxTabsRouteSync implements CngxTabsCommitActionSource, AfterCont
|
|
|
990
1040
|
readonly mode: Signal<'optimistic' | 'pessimistic'>;
|
|
991
1041
|
/**
|
|
992
1042
|
* Router commit-action read by the presenter via the DI fallback.
|
|
993
|
-
* `null` when
|
|
1043
|
+
* `null` when the router is not set up (graceful no-op). Rebuilt only
|
|
994
1044
|
* when `routeFor` changes; the navigation gate itself is the async
|
|
995
1045
|
* op inside the action.
|
|
996
1046
|
*/
|
|
@@ -1048,19 +1098,30 @@ interface CngxTabRouterCommitOptions {
|
|
|
1048
1098
|
/**
|
|
1049
1099
|
* Builds a {@link CngxTabsCommitAction} that gates a tab switch through
|
|
1050
1100
|
* `@angular/router`. The action navigates to the target tab's route and
|
|
1051
|
-
* resolves on
|
|
1101
|
+
* resolves on this navigation's own `navigate()` promise:
|
|
1052
1102
|
*
|
|
1053
|
-
* - `NavigationEnd` → `true` (commit the switch)
|
|
1054
|
-
* - `
|
|
1055
|
-
*
|
|
1103
|
+
* - resolved `true` (`NavigationEnd`) → `true` (commit the switch)
|
|
1104
|
+
* - resolved `null` (a skipped same-URL navigation, the route is
|
|
1105
|
+
* already active) → `true`
|
|
1106
|
+
* - resolved `false` (`NavigationCancel` - a `CanDeactivate` guard
|
|
1107
|
+
* blocked, or a newer navigation superseded this one) → `false`, a
|
|
1108
|
+
* refused switch: nothing failed, the commit state stores no error
|
|
1109
|
+
* - rejected (`NavigationError` - a guard or resolver threw) → the
|
|
1110
|
+
* observable errors with the router's original error, a failed
|
|
1111
|
+
* switch: the commit state goes to `'error'` and keeps that error
|
|
1112
|
+
*
|
|
1113
|
+
* This is the router's own model: a guard answering `false` cancels,
|
|
1114
|
+
* only a throw is an error.
|
|
1056
1115
|
*
|
|
1057
1116
|
* Routed tabs reuse the presenter's commit lifecycle verbatim - the
|
|
1058
1117
|
* router navigation is simply the async op. \
|
|
1059
1118
|
* In pessimistic mode the active tab follows the *resolved* route, so a cancelled guard keeps
|
|
1060
|
-
* the old tab with zero extra gate machinery.
|
|
1061
|
-
*
|
|
1062
|
-
* navigation
|
|
1063
|
-
* controller's `cancel()`
|
|
1119
|
+
* the old tab with zero extra gate machinery. Correlating on the
|
|
1120
|
+
* promise (not `router.events`) means a concurrent unrelated
|
|
1121
|
+
* navigation's outcome can never resolve this commit; the commit
|
|
1122
|
+
* controller's `cancel()` closes the subscriber on supersede, and a
|
|
1123
|
+
* late promise resolution lands on the closed subscriber and is
|
|
1124
|
+
* dropped by RxJS itself.
|
|
1064
1125
|
*
|
|
1065
1126
|
* @category common/tabs
|
|
1066
1127
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/router-commit.ts
|
|
@@ -1070,7 +1131,7 @@ declare function createTabRouterCommit(opts: CngxTabRouterCommitOptions): CngxTa
|
|
|
1070
1131
|
|
|
1071
1132
|
/**
|
|
1072
1133
|
* Context for the `*cngxTabOverflowItem` template. Replaces the
|
|
1073
|
-
* default
|
|
1134
|
+
* default text (the tab label, or `unlabeledTab(position)`) inside the More popover; the
|
|
1074
1135
|
* surrounding `<li role="menuitem">` shell (`aria-disabled`, click
|
|
1075
1136
|
* handler, `data-tab-id`) stays library-owned.
|
|
1076
1137
|
*
|
|
@@ -1240,9 +1301,10 @@ declare class CngxTabCloseIcon {
|
|
|
1240
1301
|
}
|
|
1241
1302
|
|
|
1242
1303
|
/**
|
|
1243
|
-
* Context for the `*cngxTabErrorBadge` template. Renders only
|
|
1244
|
-
* the tab's `
|
|
1245
|
-
*
|
|
1304
|
+
* Context for the `*cngxTabErrorBadge` template. Renders only while
|
|
1305
|
+
* the tab's folded `hasError()` is `true` - the direct `[error]` flag
|
|
1306
|
+
* OR the aggregator's `shouldShow()`; the visibility gate stays
|
|
1307
|
+
* library-owned. Sibling shape to `CngxStepBadgeContext`.
|
|
1246
1308
|
*
|
|
1247
1309
|
* @category common/tabs/slots
|
|
1248
1310
|
*/
|
|
@@ -1336,6 +1398,10 @@ declare class CngxTabIcon {
|
|
|
1336
1398
|
* for the synchronous-rejection edge case. Sibling shape to
|
|
1337
1399
|
* `CngxStepRejectionContext`.
|
|
1338
1400
|
*
|
|
1401
|
+
* `reason` tells the two commit outcomes apart: `'refused'` when the
|
|
1402
|
+
* commit action answered `false`, `'failed'` when it threw, rejected or
|
|
1403
|
+
* errored. Both render the slot; pick a glyph or copy per reason.
|
|
1404
|
+
*
|
|
1339
1405
|
* @category common/tabs/slots
|
|
1340
1406
|
*/
|
|
1341
1407
|
interface CngxTabRejectionIconContext {
|
|
@@ -1343,12 +1409,15 @@ interface CngxTabRejectionIconContext {
|
|
|
1343
1409
|
readonly failedIndex: number;
|
|
1344
1410
|
/** Resolved label of the safe-harbour tab, when derivable. */
|
|
1345
1411
|
readonly originLabel: string | undefined;
|
|
1412
|
+
/** Why the commit did not land (`presenter.lastOutcome().kind`). */
|
|
1413
|
+
readonly reason: 'refused' | 'failed';
|
|
1346
1414
|
}
|
|
1347
1415
|
/**
|
|
1348
1416
|
* Structural slot for the rejection-decoration template. 3-stage
|
|
1349
1417
|
* cascade: per-instance directive >
|
|
1350
1418
|
* `CNGX_TABS_CONFIG.templates.rejectionIcon` >
|
|
1351
|
-
* `CNGX_TABS_GLYPHS.rejectionIcon
|
|
1419
|
+
* `CNGX_TABS_GLYPHS.rejectionIcon` (a failed commit) or
|
|
1420
|
+
* `CNGX_TABS_GLYPHS.refusedIcon` (a refused one).
|
|
1352
1421
|
*
|
|
1353
1422
|
* ```html
|
|
1354
1423
|
* <cngx-tab-group>
|
|
@@ -1621,8 +1690,10 @@ interface CngxTabsConfig {
|
|
|
1621
1690
|
* {@link withTabsAddable}.
|
|
1622
1691
|
*/
|
|
1623
1692
|
readonly addable?: boolean;
|
|
1624
|
-
|
|
1625
|
-
readonly
|
|
1693
|
+
/** Landmark labels; a `Signal` switches the language at runtime. */
|
|
1694
|
+
readonly ariaLabels?: CngxTabsAriaLabels | Signal<CngxTabsAriaLabels>;
|
|
1695
|
+
/** Role descriptions; a `Signal` switches the language at runtime. */
|
|
1696
|
+
readonly fallbackLabels?: CngxTabsFallbackLabels | Signal<CngxTabsFallbackLabels>;
|
|
1626
1697
|
/**
|
|
1627
1698
|
* Quiescence window (ms) for the overflow IO debounce. Burst
|
|
1628
1699
|
* emissions during strip animations collapse to one write; the
|
|
@@ -1818,17 +1889,19 @@ declare function withTabsAddable(addable: boolean): CngxTabsConfigFeature;
|
|
|
1818
1889
|
/**
|
|
1819
1890
|
* Merge ARIA labels into the cascade. Keys not provided keep their
|
|
1820
1891
|
* library defaults; per-instance overrides on the tab group still win.
|
|
1892
|
+
* Pass a `Signal` to switch the language at runtime.
|
|
1821
1893
|
*
|
|
1822
1894
|
* @category common/tabs
|
|
1823
1895
|
*/
|
|
1824
|
-
declare function withTabsAriaLabels(labels: CngxTabsAriaLabels): CngxTabsConfigFeature;
|
|
1896
|
+
declare function withTabsAriaLabels(labels: CngxTabsAriaLabels | Signal<CngxTabsAriaLabels>): CngxTabsConfigFeature;
|
|
1825
1897
|
/**
|
|
1826
|
-
* Merge
|
|
1827
|
-
*
|
|
1898
|
+
* Merge the tablist / tab-panel `aria-roledescription` fallbacks into the
|
|
1899
|
+
* cascade. Keys not provided keep their library defaults. Pass a `Signal`
|
|
1900
|
+
* to switch the language at runtime.
|
|
1828
1901
|
*
|
|
1829
1902
|
* @category common/tabs
|
|
1830
1903
|
*/
|
|
1831
|
-
declare function withTabsFallbackLabels(labels: CngxTabsFallbackLabels): CngxTabsConfigFeature;
|
|
1904
|
+
declare function withTabsFallbackLabels(labels: CngxTabsFallbackLabels | Signal<CngxTabsFallbackLabels>): CngxTabsConfigFeature;
|
|
1832
1905
|
/**
|
|
1833
1906
|
* Override the IO-debounce window (ms). See
|
|
1834
1907
|
* {@link CngxTabsConfig.overflowStabilizeMs}.
|
|
@@ -1988,6 +2061,90 @@ interface CngxTabsHostAttrs {
|
|
|
1988
2061
|
*/
|
|
1989
2062
|
declare function createTabsHostAttrs(inputs: CngxTabsHostAttrsInputs): CngxTabsHostAttrs;
|
|
1990
2063
|
|
|
2064
|
+
/**
|
|
2065
|
+
* The tabs section of a {@link CngxLanguagePack}: the copy of
|
|
2066
|
+
* `@cngx/common/tabs` and of the tab organisms in `@cngx/ui/tabs` and
|
|
2067
|
+
* `@cngx/ui/mat-tabs`. It feeds `CNGX_TABS_I18N` and the copy keys of
|
|
2068
|
+
* `CNGX_TABS_CONFIG` (`ariaLabels`, `fallbackLabels`). Messages use `{name}`
|
|
2069
|
+
* placeholders; a plural message picks its form from `{count}`.
|
|
2070
|
+
*
|
|
2071
|
+
* @category common/tabs/i18n
|
|
2072
|
+
* @since 0.1.0
|
|
2073
|
+
* @relatedTo CNGX_TABS_I18N, CNGX_TABS_CONFIG
|
|
2074
|
+
*/
|
|
2075
|
+
interface CngxTabsLanguageSection {
|
|
2076
|
+
/** Accessible name of the tab-group landmark. */
|
|
2077
|
+
readonly tabsRegion: string;
|
|
2078
|
+
/** Last-tier tab-group label, used when `tabsRegion` is unset. */
|
|
2079
|
+
readonly tabsLabel: string;
|
|
2080
|
+
/** `aria-roledescription` of the tablist. */
|
|
2081
|
+
readonly tabRoleDescription: string;
|
|
2082
|
+
/** `aria-roledescription` of each tab panel. */
|
|
2083
|
+
readonly tabPanelRoleDescription: string;
|
|
2084
|
+
/** `{label}`, `{position}`, `{count}`: the accessible name of a tab. */
|
|
2085
|
+
readonly selectedTab: CngxMessage;
|
|
2086
|
+
/** `{label}`, `{detail}`: a tab label with its secondary label. */
|
|
2087
|
+
readonly tabLabelWithDetail: CngxMessage;
|
|
2088
|
+
/** Plural on `{count}`: the number of errors on a tab. */
|
|
2089
|
+
readonly tabHasErrors: CngxMessage;
|
|
2090
|
+
/** Plural on `{count}`: the overflow trigger label. */
|
|
2091
|
+
readonly moreTabsLabel: CngxMessage;
|
|
2092
|
+
/**
|
|
2093
|
+
* `{position}`: the name of a tab without a label - its overflow row, its
|
|
2094
|
+
* close button and the origin tab named after a rollback or a refusal.
|
|
2095
|
+
*/
|
|
2096
|
+
readonly unlabeledTab: CngxMessage;
|
|
2097
|
+
/**
|
|
2098
|
+
* `{position}`, `{count}`: the accessible name of a tab without a label and
|
|
2099
|
+
* the tab named in the live phrase after a move to it - the label-less
|
|
2100
|
+
* twin of `selectedTab`.
|
|
2101
|
+
*/
|
|
2102
|
+
readonly unlabeledTabOfCount: CngxMessage;
|
|
2103
|
+
/** `{tab}`: announced after a move to an earlier tab, `{tab}` being its name. */
|
|
2104
|
+
readonly previousTab: CngxMessage;
|
|
2105
|
+
/** `{tab}`: announced after a move to a later tab. */
|
|
2106
|
+
readonly nextTab: CngxMessage;
|
|
2107
|
+
/** `{label}`: accessible name of a tab's close button. */
|
|
2108
|
+
readonly closeTab: CngxMessage;
|
|
2109
|
+
readonly addTab: string;
|
|
2110
|
+
/** `{label}`: announced once a closed tab is removed. */
|
|
2111
|
+
readonly closedTab: CngxMessage;
|
|
2112
|
+
/** Announced once a tab without a label is removed. */
|
|
2113
|
+
readonly closedUnlabeledTab: string;
|
|
2114
|
+
/**
|
|
2115
|
+
* Announced when a tab commit fails and no origin tab resolves (a
|
|
2116
|
+
* programmatic commit-state write, or an origin tab removed meanwhile); a
|
|
2117
|
+
* resolvable origin speaks `commitRolledBackTo` instead.
|
|
2118
|
+
*/
|
|
2119
|
+
readonly commitFailedRetry: string;
|
|
2120
|
+
/** Announced while a tab commit is in flight. */
|
|
2121
|
+
readonly commitInFlight: string;
|
|
2122
|
+
/** `{origin}`: announced when a failed commit reverts to the origin tab. */
|
|
2123
|
+
readonly commitRolledBackTo: CngxMessage;
|
|
2124
|
+
/** `{origin}`: announced when the commit action refuses a tab switch. */
|
|
2125
|
+
readonly commitRefused: CngxMessage;
|
|
2126
|
+
/**
|
|
2127
|
+
* Announced when the commit action refuses a tab switch and the origin tab
|
|
2128
|
+
* is unknown or was removed meanwhile; a label-less origin is named by
|
|
2129
|
+
* `unlabeledTab`.
|
|
2130
|
+
*/
|
|
2131
|
+
readonly commitRefusedGeneric: string;
|
|
2132
|
+
}
|
|
2133
|
+
/**
|
|
2134
|
+
* The English tabs section: the single source of the tabs' English copy.
|
|
2135
|
+
* `CNGX_TABS_I18N` and the `CNGX_TABS_CONFIG` labels default to it.
|
|
2136
|
+
*
|
|
2137
|
+
* @category common/tabs/i18n
|
|
2138
|
+
* @since 0.1.0
|
|
2139
|
+
* @relatedTo CNGX_TABS_I18N, CNGX_TABS_CONFIG
|
|
2140
|
+
*/
|
|
2141
|
+
declare const CNGX_TABS_LANGUAGE_EN: CngxTabsLanguageSection;
|
|
2142
|
+
declare module '@cngx/core/i18n' {
|
|
2143
|
+
interface CngxLanguagePack {
|
|
2144
|
+
readonly tabs: CngxTabsLanguageSection;
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
|
|
1991
2148
|
/**
|
|
1992
2149
|
* Tabs i18n surface. Library defaults are English; consumers
|
|
1993
2150
|
* override via {@link provideTabsI18n}. Sibling to
|
|
@@ -1996,6 +2153,11 @@ declare function createTabsHostAttrs(inputs: CngxTabsHostAttrsInputs): CngxTabsH
|
|
|
1996
2153
|
* @category common/tabs/i18n
|
|
1997
2154
|
*/
|
|
1998
2155
|
interface CngxTabsI18n {
|
|
2156
|
+
/**
|
|
2157
|
+
* Last tier of the tab-group `aria-label`. It only applies when
|
|
2158
|
+
* `CNGX_TABS_CONFIG.ariaLabels.tabsRegion` is unset; that key defaults
|
|
2159
|
+
* to `'Tabs'`, so localise the landmark through `withTabsAriaLabels(...)`.
|
|
2160
|
+
*/
|
|
1999
2161
|
readonly tabsLabel: string;
|
|
2000
2162
|
readonly selectedTab: (label: string, position: number, count: number) => string;
|
|
2001
2163
|
/**
|
|
@@ -2008,8 +2170,28 @@ interface CngxTabsI18n {
|
|
|
2008
2170
|
readonly tabLabelWithDetail: (label: string, detail: string) => string;
|
|
2009
2171
|
readonly tabHasErrors: (count: number) => string;
|
|
2010
2172
|
readonly moreTabsLabel: (count: number) => string;
|
|
2011
|
-
|
|
2012
|
-
|
|
2173
|
+
/**
|
|
2174
|
+
* Name of a tab without a label, e.g. a row of the overflow list.
|
|
2175
|
+
* Receives the 1-based position; English `Tab 3`.
|
|
2176
|
+
*/
|
|
2177
|
+
readonly unlabeledTab: (position: number) => string;
|
|
2178
|
+
/**
|
|
2179
|
+
* Accessible name of a tab without a label, with its position in the group:
|
|
2180
|
+
* the label-less twin of {@link selectedTab}. Receives the 1-based position
|
|
2181
|
+
* and the tab count; English `Tab 2 of 5`.
|
|
2182
|
+
*/
|
|
2183
|
+
readonly unlabeledTabOfCount: (position: number, count: number) => string;
|
|
2184
|
+
/**
|
|
2185
|
+
* Commit-success announcement after a move to an earlier tab. Receives
|
|
2186
|
+
* the position phrase from {@link selectedTab} and owns the whole
|
|
2187
|
+
* sentence, so a locale can reorder it or drop the separator, e.g.
|
|
2188
|
+
* `Previous tab: Tab 1 of 3: Profile`. Unlike the stepper's
|
|
2189
|
+
* `previousStep` / `nextStep`, which are button labels, this key returns
|
|
2190
|
+
* the full live-region sentence.
|
|
2191
|
+
*/
|
|
2192
|
+
readonly previousTab: (positionPhrase: string) => string;
|
|
2193
|
+
/** Sibling of {@link previousTab} after a move to a later tab. */
|
|
2194
|
+
readonly nextTab: (positionPhrase: string) => string;
|
|
2013
2195
|
/**
|
|
2014
2196
|
* Accessible name for a tab's close button. Receives the tab label
|
|
2015
2197
|
* (or a generic fallback when unlabeled) and yields the button's
|
|
@@ -2018,11 +2200,18 @@ interface CngxTabsI18n {
|
|
|
2018
2200
|
readonly closeTab: (label: string) => string;
|
|
2019
2201
|
/** Accessible name for the add-tab button. */
|
|
2020
2202
|
readonly addTab: string;
|
|
2203
|
+
/**
|
|
2204
|
+
* Live-region confirmation once a closed tab's removal has actually
|
|
2205
|
+
* landed in the registry. Receives the closed tab's label (or an
|
|
2206
|
+
* empty string when unlabeled).
|
|
2207
|
+
*/
|
|
2208
|
+
readonly closedTab: (label: string) => string;
|
|
2021
2209
|
/**
|
|
2022
2210
|
* @deprecated Superseded by {@link commitRolledBackTo}. Retained as
|
|
2023
2211
|
* the defensive fallback in `liveAnnouncement` when the origin
|
|
2024
|
-
* label is unresolvable - fires for
|
|
2025
|
-
* `commitState` writes that bypass `select()
|
|
2212
|
+
* label is unresolvable - fires for a failed commit from an unlabeled
|
|
2213
|
+
* tab or programmatic `commitState` writes that bypass `select()`,
|
|
2214
|
+
* never for a refusal ({@link commitRefusedGeneric}). See
|
|
2026
2215
|
* `tabs-accepted-debt §4`.
|
|
2027
2216
|
*/
|
|
2028
2217
|
readonly commitFailedRetry: string;
|
|
@@ -2034,17 +2223,33 @@ interface CngxTabsI18n {
|
|
|
2034
2223
|
* `originIndexDuringCommit` are set.
|
|
2035
2224
|
*/
|
|
2036
2225
|
readonly commitRolledBackTo: (originLabel: string) => string;
|
|
2226
|
+
/**
|
|
2227
|
+
* Origin-aware refusal phrase. Read when the commit action answered
|
|
2228
|
+
* `false` and the origin label resolves. Receives the label of the tab
|
|
2229
|
+
* the user stayed on, yields e.g. `Tab switch not allowed - stayed on
|
|
2230
|
+
* "Profile".`. A refusal is not a failure, so it never reads the
|
|
2231
|
+
* failure copy ({@link commitRolledBackTo}, {@link commitFailedRetry}).
|
|
2232
|
+
*/
|
|
2233
|
+
readonly commitRefused: (originLabel: string) => string;
|
|
2234
|
+
/**
|
|
2235
|
+
* Refusal phrase for an origin without a label. Twin of
|
|
2236
|
+
* {@link commitFailedRetry} for the refused outcome.
|
|
2237
|
+
*/
|
|
2238
|
+
readonly commitRefusedGeneric: string;
|
|
2037
2239
|
}
|
|
2038
2240
|
/**
|
|
2039
|
-
* DI token for the tabs i18n bundle
|
|
2040
|
-
*
|
|
2241
|
+
* DI token for the tabs i18n bundle, as a `Signal` so a runtime language
|
|
2242
|
+
* switch re-renders every label it feeds. `providedIn: 'root'`: the tabs
|
|
2243
|
+
* section of the active language pack over the English defaults, formatted
|
|
2244
|
+
* for the app locale. Provide it through {@link provideTabsI18n}; a
|
|
2245
|
+
* `{ provide, useValue }` entry must supply a `Signal<CngxTabsI18n>`.
|
|
2041
2246
|
*
|
|
2042
2247
|
* @category common/tabs/i18n
|
|
2043
2248
|
* @wcag AA
|
|
2044
2249
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/tabs/i18n/tabs-i18n.ts
|
|
2045
2250
|
* @since 0.1.0
|
|
2046
2251
|
*/
|
|
2047
|
-
declare const CNGX_TABS_I18N: InjectionToken<CngxTabsI18n
|
|
2252
|
+
declare const CNGX_TABS_I18N: InjectionToken<Signal<CngxTabsI18n>>;
|
|
2048
2253
|
/**
|
|
2049
2254
|
* Branded feature-fn for {@link provideTabsI18n} and
|
|
2050
2255
|
* {@link provideCngxTabs}. The hidden `_target` discriminator routes
|
|
@@ -2053,28 +2258,28 @@ declare const CNGX_TABS_I18N: InjectionToken<CngxTabsI18n>;
|
|
|
2053
2258
|
*
|
|
2054
2259
|
* @category common/tabs/i18n
|
|
2055
2260
|
*/
|
|
2056
|
-
type CngxTabsI18nFeature = ((bundle: CngxTabsI18n) => CngxTabsI18n) & {
|
|
2261
|
+
type CngxTabsI18nFeature = ((bundle: Signal<CngxTabsI18n>) => Signal<CngxTabsI18n>) & {
|
|
2057
2262
|
readonly _target: 'i18n';
|
|
2058
2263
|
};
|
|
2059
2264
|
/**
|
|
2060
2265
|
* Override i18n labels via a partial bundle - unset keys keep the
|
|
2061
|
-
* English default. Same shape as `withTabsAriaLabels` /
|
|
2266
|
+
* language pack's copy, or the English default. Same shape as `withTabsAriaLabels` /
|
|
2062
2267
|
* `withTabsFallbackLabels` so `provideCngxTabs` composes both
|
|
2063
|
-
* surfaces uniformly.
|
|
2268
|
+
* surfaces uniformly. Pass a `Signal` to switch the language at runtime.
|
|
2064
2269
|
*
|
|
2065
2270
|
* @category common/tabs/i18n
|
|
2066
2271
|
*/
|
|
2067
|
-
declare function withTabsI18nLabels(overrides: Partial<CngxTabsI18n>): CngxTabsI18nFeature;
|
|
2272
|
+
declare function withTabsI18nLabels(overrides: Partial<CngxTabsI18n> | Signal<Partial<CngxTabsI18n>>): CngxTabsI18nFeature;
|
|
2068
2273
|
/**
|
|
2069
2274
|
* Provider for the tabs i18n bundle. Compose `withTabsI18nLabels(...)`
|
|
2070
2275
|
* (and future i18n `with*` features); unset keys fall back to the
|
|
2071
|
-
* English
|
|
2276
|
+
* language pack, then English. The features apply on top of the active pack.
|
|
2072
2277
|
*
|
|
2073
2278
|
* ```ts
|
|
2074
2279
|
* bootstrapApplication(AppComponent, {
|
|
2075
2280
|
* providers: [
|
|
2076
2281
|
* provideTabsI18n(
|
|
2077
|
-
* withTabsI18nLabels({ tabsLabel: 'Reiter',
|
|
2282
|
+
* withTabsI18nLabels({ tabsLabel: 'Reiter', addTab: 'Neuer Reiter' }),
|
|
2078
2283
|
* ),
|
|
2079
2284
|
* ],
|
|
2080
2285
|
* });
|
|
@@ -2084,11 +2289,12 @@ declare function withTabsI18nLabels(overrides: Partial<CngxTabsI18n>): CngxTabsI
|
|
|
2084
2289
|
*/
|
|
2085
2290
|
declare function provideTabsI18n(...features: readonly CngxTabsI18nFeature[]): Provider;
|
|
2086
2291
|
/**
|
|
2087
|
-
* Inject the resolved tabs i18n bundle.
|
|
2292
|
+
* Inject the resolved tabs i18n bundle. Read it inside a `computed()`,
|
|
2293
|
+
* template or handler so a language switch reaches the label.
|
|
2088
2294
|
*
|
|
2089
2295
|
* @category common/tabs/i18n
|
|
2090
2296
|
*/
|
|
2091
|
-
declare function injectTabsI18n(): CngxTabsI18n
|
|
2297
|
+
declare function injectTabsI18n(): Signal<CngxTabsI18n>;
|
|
2092
2298
|
|
|
2093
2299
|
/**
|
|
2094
2300
|
* Union of feature kinds the tabs aggregator accepts. \
|
|
@@ -2151,6 +2357,14 @@ declare function provideCngxTabs(...features: readonly CngxTabsFeature[]): Envir
|
|
|
2151
2357
|
*/
|
|
2152
2358
|
declare function provideCngxTabsAt(...features: readonly CngxTabsFeature[]): Provider[];
|
|
2153
2359
|
|
|
2360
|
+
/**
|
|
2361
|
+
* How a commit-gated tab switch settled. `'refused'` is a `false` answer
|
|
2362
|
+
* from `commitAction` (the action declined on purpose, nothing failed);
|
|
2363
|
+
* `'failed'` is a throw, a rejected promise or an erroring observable.
|
|
2364
|
+
*
|
|
2365
|
+
* @category common/tabs
|
|
2366
|
+
*/
|
|
2367
|
+
type CngxTabsCommitResolution = 'accepted' | 'refused' | 'failed';
|
|
2154
2368
|
/**
|
|
2155
2369
|
* Adapts the shared commit-controller to the tabs action shape. \
|
|
2156
2370
|
* The presenter delegates to {@link beginTransition} when `commitAction`
|
|
@@ -2163,10 +2377,11 @@ interface CngxTabsCommitHandler {
|
|
|
2163
2377
|
* Start a tab-transition commit. \
|
|
2164
2378
|
* Returns synchronously - read the
|
|
2165
2379
|
* controller's `state` signal for in-flight status. `onResolve`
|
|
2166
|
-
* fires once
|
|
2167
|
-
*
|
|
2380
|
+
* fires once: `'accepted'` when the action answers `true`,
|
|
2381
|
+
* `'refused'` when it answers `false`, `'failed'` when it throws,
|
|
2382
|
+
* rejects or errors; skipped on supersede.
|
|
2168
2383
|
*/
|
|
2169
|
-
beginTransition(fromIndex: number, toIndex: number, action: CngxTabsCommitAction, onResolve: (
|
|
2384
|
+
beginTransition(fromIndex: number, toIndex: number, action: CngxTabsCommitAction, onResolve: (outcome: CngxTabsCommitResolution) => void): void;
|
|
2170
2385
|
/** Cancel the in-flight transition without firing callbacks. */
|
|
2171
2386
|
cancel(): void;
|
|
2172
2387
|
/** Live `pending` flag from the controller. */
|
|
@@ -2182,8 +2397,10 @@ interface CngxTabsCommitHandlerOptions {
|
|
|
2182
2397
|
}
|
|
2183
2398
|
/**
|
|
2184
2399
|
* Wraps a {@link CngxCommitController} with the action-shape adapter
|
|
2185
|
-
* that
|
|
2186
|
-
*
|
|
2400
|
+
* that resolves `Observable<boolean>` / `Promise<boolean>` / `boolean`
|
|
2401
|
+
* returns into one {@link CngxTabsCommitResolution}: `true` accepts,
|
|
2402
|
+
* `false` refuses (the controller settles to `'idle'` and stores no
|
|
2403
|
+
* error), a throw fails.
|
|
2187
2404
|
*
|
|
2188
2405
|
* @category common/tabs
|
|
2189
2406
|
*/
|
|
@@ -2404,7 +2621,8 @@ declare class CngxTabAddIcon {
|
|
|
2404
2621
|
interface CngxTabDismissalsOptions {
|
|
2405
2622
|
readonly host: CngxTabGroupHost;
|
|
2406
2623
|
readonly config: CngxTabsConfig;
|
|
2407
|
-
|
|
2624
|
+
/** Tabs i18n bundle Signal (`injectTabsI18n()`). */
|
|
2625
|
+
readonly i18n: Signal<CngxTabsI18n>;
|
|
2408
2626
|
readonly closable: Signal<boolean | undefined>;
|
|
2409
2627
|
readonly addable: Signal<boolean | undefined>;
|
|
2410
2628
|
readonly hostElement: HTMLElement;
|
|
@@ -2427,6 +2645,15 @@ interface CngxTabDismissals {
|
|
|
2427
2645
|
closeButtonLabel(tab: CngxTabHandle): string;
|
|
2428
2646
|
/** Stable `*cngxTabCloseIcon` context (`{ tab }`) per tab. */
|
|
2429
2647
|
closeIconContextFor(tab: CngxTabHandle): CngxTabCloseIconContext;
|
|
2648
|
+
/**
|
|
2649
|
+
* Live-region phrase confirming a landed close (`i18n.closedTab`).
|
|
2650
|
+
* Derived from the registry transition - it updates when a requested
|
|
2651
|
+
* close's id actually leaves the registry, so an async consumer
|
|
2652
|
+
* removal announces on completion, not on request. Feed it into
|
|
2653
|
+
* `createTabGroupAnnouncements` (options.closedAnnouncement) so the
|
|
2654
|
+
* live region resolves one priority chain.
|
|
2655
|
+
*/
|
|
2656
|
+
readonly closedAnnouncement: Signal<string>;
|
|
2430
2657
|
/** Close a tab and restore focus to the new active tab / add button. */
|
|
2431
2658
|
handleClose(tab: CngxTabHandle, event?: Event): void;
|
|
2432
2659
|
/** Delete on a focused closable tab requests its close (APG). */
|
|
@@ -2491,6 +2718,14 @@ interface CngxTabKeyboardNavOptions {
|
|
|
2491
2718
|
* `rtl` (APG); the vertical axis and Home/End stay direction-invariant.
|
|
2492
2719
|
*/
|
|
2493
2720
|
readonly direction: Signal<CngxDirection>;
|
|
2721
|
+
/**
|
|
2722
|
+
* Enables the rejection focus-release effect. Under a pessimistic
|
|
2723
|
+
* commit, focus follows the intended target while the action is in
|
|
2724
|
+
* flight; a refusal or failure keeps the roving stop on the origin, so
|
|
2725
|
+
* without the release the user is stranded on a `tabindex="-1"`
|
|
2726
|
+
* button. Omitted, the effect is skipped (headless usage).
|
|
2727
|
+
*/
|
|
2728
|
+
readonly injector?: Injector;
|
|
2494
2729
|
}
|
|
2495
2730
|
/**
|
|
2496
2731
|
* Resolved keyboard surface for `<cngx-tab-group>`'s tablist. The
|
|
@@ -2626,12 +2861,20 @@ declare function createTabGroupTemplateBindings(opts: CngxTabGroupTemplateBindin
|
|
|
2626
2861
|
*/
|
|
2627
2862
|
interface CngxTabGroupAnnouncementsOptions {
|
|
2628
2863
|
readonly presenter: CngxTabGroupHost;
|
|
2629
|
-
|
|
2864
|
+
/** Tabs i18n bundle Signal (`injectTabsI18n()`). */
|
|
2865
|
+
readonly i18n: Signal<CngxTabsI18n>;
|
|
2630
2866
|
readonly config: CngxTabsConfig;
|
|
2631
2867
|
/** Per-instance `aria-label` Input on the organism. */
|
|
2632
2868
|
readonly ariaLabel: Signal<string | undefined>;
|
|
2633
2869
|
/** Per-instance `aria-labelledby` Input on the organism. */
|
|
2634
2870
|
readonly ariaLabelledBy: Signal<string | undefined>;
|
|
2871
|
+
/**
|
|
2872
|
+
* Landed-close phrase from `createTabDismissals`. When supplied,
|
|
2873
|
+
* `liveAnnouncement` surfaces it while no commit phrase applies and
|
|
2874
|
+
* expires it on the next commit activity, so a stale close can never
|
|
2875
|
+
* re-enter (and re-announce through) the live region.
|
|
2876
|
+
*/
|
|
2877
|
+
readonly closedAnnouncement?: Signal<string>;
|
|
2635
2878
|
}
|
|
2636
2879
|
/**
|
|
2637
2880
|
* Resolved bundle returned by {@link createTabGroupAnnouncements}.
|
|
@@ -2665,12 +2908,19 @@ interface CngxTabGroupAnnouncements {
|
|
|
2665
2908
|
* `announce()`. Empty between transitions so the region stays
|
|
2666
2909
|
* quiet on no-op ticks.
|
|
2667
2910
|
*
|
|
2668
|
-
*
|
|
2669
|
-
*
|
|
2911
|
+
* Refusal: `commitRefused(origin)` once, held until the next commit,
|
|
2912
|
+
* an active-index move, a cleared outcome or a new close phrase. The
|
|
2913
|
+
* origin is its label, or `unlabeledTab(position)` without one;
|
|
2914
|
+
* `commitRefusedGeneric` when no origin tab resolves (none recorded,
|
|
2915
|
+
* or removed meanwhile).
|
|
2670
2916
|
*
|
|
2671
|
-
*
|
|
2917
|
+
* Error arm: `commitRolledBackTo(origin)` when the origin tab
|
|
2918
|
+
* resolves, named the same way; otherwise `commitFailedRetry`.
|
|
2919
|
+
*
|
|
2920
|
+
* Success arm: `previousTab|nextTab(selectedTab(...))` when
|
|
2672
2921
|
* the index moved; bare `selectedTab(...)` when it didn't (initial
|
|
2673
|
-
* mount, or commit-success that lands on the same tab).
|
|
2922
|
+
* mount, or commit-success that lands on the same tab). A label-less
|
|
2923
|
+
* tab reads `unlabeledTabOfCount(...)` in place of `selectedTab`.
|
|
2674
2924
|
*/
|
|
2675
2925
|
readonly liveAnnouncement: Signal<string>;
|
|
2676
2926
|
/**
|
|
@@ -2686,10 +2936,28 @@ interface CngxTabGroupAnnouncements {
|
|
|
2686
2936
|
/**
|
|
2687
2937
|
* Verbose tab-button `aria-label` - `selectedTab(label, position,
|
|
2688
2938
|
* count)` so AT hears "Tab 2 of 5: Settings" instead of inferring
|
|
2689
|
-
* position from tablist enumeration
|
|
2690
|
-
*
|
|
2939
|
+
* position from tablist enumeration; `unlabeledTabOfCount(position,
|
|
2940
|
+
* count)` ("Tab 2 of 5") for a tab without a label. The visual span
|
|
2941
|
+
* keeps the bare label.
|
|
2691
2942
|
*/
|
|
2692
2943
|
tabAriaLabel(tab: CngxTabHandle, position: number): string;
|
|
2944
|
+
/**
|
|
2945
|
+
* Tab-button `aria-labelledby`, or `null` when {@link tabAriaLabel}
|
|
2946
|
+
* names the button. A tab without a `[label]` string whose
|
|
2947
|
+
* `*cngxTabLabel` template renders is named by that rendered content:
|
|
2948
|
+
* the ids of its label node ({@link tabLabelId}) and, when a sub-label
|
|
2949
|
+
* renders, its sub-label node ({@link tabSubLabelId}). Name-from-content
|
|
2950
|
+
* is ruled out by the sr-only descriptor inside the button, so the
|
|
2951
|
+
* reference is explicit. Bind `aria-label` only while this is `null`.
|
|
2952
|
+
*
|
|
2953
|
+
* @param hasLabelTemplate A `*cngxTabLabel` template renders for `tab`.
|
|
2954
|
+
* @param hasSubLabelTemplate A `*cngxTabSubLabel` template renders for `tab`.
|
|
2955
|
+
*/
|
|
2956
|
+
tabLabelledBy(tab: CngxTabHandle, hasLabelTemplate: boolean, hasSubLabelTemplate: boolean): string | null;
|
|
2957
|
+
/** Id of the node that renders a tab's label, the target of {@link tabLabelledBy}. */
|
|
2958
|
+
tabLabelId(tab: CngxTabHandle): string;
|
|
2959
|
+
/** Id of the node that renders a tab's sub-label, the target of {@link tabLabelledBy}. */
|
|
2960
|
+
tabSubLabelId(tab: CngxTabHandle): string;
|
|
2693
2961
|
}
|
|
2694
2962
|
/**
|
|
2695
2963
|
* Pure factory bundling the `<cngx-tab-group>` AT-announcement +
|
|
@@ -2802,8 +3070,14 @@ declare function createTabNavAnnouncement(options: CngxTabNavAnnouncementOptions
|
|
|
2802
3070
|
declare const CNGX_TABS_GLYPHS: {
|
|
2803
3071
|
/** Default visual for `*cngxTabErrorBadge` when no override is bound. */
|
|
2804
3072
|
readonly errorBadge: "!";
|
|
2805
|
-
/** Default visual for `*cngxTabRejectionIcon` when no override is bound. */
|
|
3073
|
+
/** Default visual for `*cngxTabRejectionIcon` on a failed commit when no override is bound. */
|
|
2806
3074
|
readonly rejectionIcon: "!";
|
|
3075
|
+
/**
|
|
3076
|
+
* Default visual for `*cngxTabRejectionIcon` on a refused commit (the
|
|
3077
|
+
* action answered `false`). A distinct glyph, so a refusal never differs
|
|
3078
|
+
* from a failure by colour alone (WCAG 1.4.1).
|
|
3079
|
+
*/
|
|
3080
|
+
readonly refusedIcon: "⊘";
|
|
2807
3081
|
/** Default visual for a tab's close button when no override is bound. */
|
|
2808
3082
|
readonly closeIcon: "×";
|
|
2809
3083
|
/** Default visual for the add-tab button when no override is bound. */
|
|
@@ -2840,6 +3114,10 @@ interface CngxTabOverflowTemplateBindingsOptions {
|
|
|
2840
3114
|
readonly hiddenTabs: Signal<readonly CngxTabHandle[]>;
|
|
2841
3115
|
/** Commit-aware select callback - invoked from `itemContext.pick`. */
|
|
2842
3116
|
readonly pickTab: (tab: CngxTabHandle) => void;
|
|
3117
|
+
/** Every tab of the strip; an unlabelled tab is named by its position in it. */
|
|
3118
|
+
readonly tabs: Signal<readonly CngxTabHandle[]>;
|
|
3119
|
+
/** Resolved tabs copy (`unlabeledTab`). */
|
|
3120
|
+
readonly i18n: Signal<CngxTabsI18n>;
|
|
2843
3121
|
}
|
|
2844
3122
|
/**
|
|
2845
3123
|
* Output of {@link createTabOverflowTemplateBindings}. Carries the two
|
|
@@ -2853,6 +3131,11 @@ interface CngxTabOverflowTemplateBindings {
|
|
|
2853
3131
|
readonly itemTemplate: Signal<TemplateRef<CngxTabOverflowItemContext> | null>;
|
|
2854
3132
|
readonly triggerContext: Signal<CngxTabOverflowTriggerContext>;
|
|
2855
3133
|
readonly buildItemContext: (tab: CngxTabHandle, index: number) => CngxTabOverflowItemContext;
|
|
3134
|
+
/**
|
|
3135
|
+
* Default text of an overflow row and its typeahead label: the tab label,
|
|
3136
|
+
* or `unlabeledTab(position)` for an unlabelled tab - never the tab id.
|
|
3137
|
+
*/
|
|
3138
|
+
readonly itemLabel: (tab: CngxTabHandle) => string;
|
|
2856
3139
|
/**
|
|
2857
3140
|
* `ActiveDescendantItem[]` projection of `hiddenTabs()` for
|
|
2858
3141
|
* `CngxActiveDescendant.items`. \
|
|
@@ -3072,5 +3355,5 @@ type CngxDirectiveByIdMapFactory = <T extends {
|
|
|
3072
3355
|
*/
|
|
3073
3356
|
declare const CNGX_DIRECTIVE_BY_ID_MAP_FACTORY: InjectionToken<CngxDirectiveByIdMapFactory>;
|
|
3074
3357
|
|
|
3075
|
-
export { CNGX_DIRECTIVE_BY_ID_MAP_FACTORY, CNGX_DOM_ANCHOR_RETRY_FACTORY, CNGX_ORGANISM_SCROLL_SYNC_FACTORY, CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY, CNGX_TABS_COMMIT_ACTION, CNGX_TABS_COMMIT_HANDLER_FACTORY, CNGX_TABS_CONFIG, CNGX_TABS_GLYPHS, CNGX_TABS_I18N, CNGX_TAB_GROUP_HOST, CNGX_TAB_NAV_HOST, CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY, CNGX_TAB_PANEL_HOST, CNGX_TAB_URL_MATCH_STRATEGY, CngxTab, CngxTabAddIcon, CngxTabBusySpinner, CngxTabCloseIcon, CngxTabContent, CngxTabErrorBadge, CngxTabGroupPresenter, CngxTabIcon, CngxTabLabel, CngxTabLink, CngxTabOverflowItem, CngxTabOverflowTrigger, CngxTabRejectionIcon, CngxTabSubLabel, CngxTabsFragmentSync, CngxTabsRouteSync, createCngxTabOverflowDefaultDomAdapter, createDirectiveByIdMap, createDomAnchorRetry, createOrganismScrollSync, createOverflowPopoverHighlightSync, createTabDismissals, createTabGroupAnnouncements, createTabGroupTemplateBindings, createTabKeyboardNav, createTabNavAnnouncement, createTabOverflowTemplateBindings, createTabRouterCommit, createTabUrlMatch, createTabsCommitHandler, createTabsHostAttrs, injectTabsConfig, injectTabsI18n, provideCngxTabs, provideCngxTabsAt, provideTabsConfig, provideTabsConfigAt, provideTabsI18n, tabOverflowOptionId, withDefaultOrientation, withTabAddIconTemplate, withTabBusySpinnerTemplate, withTabCloseIconTemplate, withTabErrorBadgeTemplate, withTabIconTemplate, withTabOverflowItemTemplate, withTabOverflowMaxDeferMs, withTabOverflowStabilizeMs, withTabOverflowTriggerTemplate, withTabRejectionIconTemplate, withTabsAddable, withTabsAlign, withTabsAriaLabels, withTabsClosable, withTabsCommitMode, withTabsDefaultOrientation, withTabsFallbackLabels, withTabsFitted, withTabsFragmentSync, withTabsI18nLabels, withTabsIconLayout, withTabsLinkAriaCurrent, withTabsPanelMode, withTabsRouteMatch, withTabsRouterSync, withTabsRovingLoop, withTabsSkin };
|
|
3076
|
-
export type { CngxDirectiveByIdMapFactory, CngxDirectiveByIdMapOptions, CngxDomAnchorRetryFactory, CngxDomAnchorRetryHandle, CngxDomAnchorRetryOptions, CngxDomAnchorRetryResult, CngxOrganismScrollSyncFactory, CngxOrganismScrollSyncOptions, CngxOverflowPopoverHighlightSyncFactory, CngxTabAlign, CngxTabBusySpinnerContext, CngxTabCloseEvent, CngxTabCloseIconContext, CngxTabDismissals, CngxTabDismissalsOptions, CngxTabErrorBadgeContext, CngxTabGroupAnnouncements, CngxTabGroupAnnouncementsOptions, CngxTabGroupHost, CngxTabGroupTemplateBindings, CngxTabGroupTemplateBindingsOptions, CngxTabHandle, CngxTabIconContext, CngxTabIconLayout, CngxTabKeyboardNav, CngxTabKeyboardNavOptions, CngxTabMatchMode, CngxTabNavAnnouncement, CngxTabNavAnnouncementOptions, CngxTabOverflowDomAdapter, CngxTabOverflowDomAdapterFactory, CngxTabOverflowItemContext, CngxTabOverflowTemplateBindings, CngxTabOverflowTemplateBindingsOptions, CngxTabOverflowTriggerContext, CngxTabPanelHost, CngxTabRejectionIconContext, CngxTabRouterCommitOptions, CngxTabUrlMatch, CngxTabUrlMatchContext, CngxTabUrlMatchFactory, CngxTabsAriaLabels, CngxTabsCommitAction, CngxTabsCommitActionSource, CngxTabsCommitHandler, CngxTabsCommitHandlerFactory, CngxTabsCommitHandlerOptions, CngxTabsConfig, CngxTabsConfigFeature, CngxTabsFallbackLabels, CngxTabsFeature, CngxTabsHostAttrs, CngxTabsHostAttrsInputs, CngxTabsI18n, CngxTabsI18nFeature, CngxTabsPanelMode, CngxTabsSkin, CngxTabsTemplates };
|
|
3358
|
+
export { CNGX_DIRECTIVE_BY_ID_MAP_FACTORY, CNGX_DOM_ANCHOR_RETRY_FACTORY, CNGX_ORGANISM_SCROLL_SYNC_FACTORY, CNGX_OVERFLOW_POPOVER_HIGHLIGHT_FACTORY, CNGX_TABS_COMMIT_ACTION, CNGX_TABS_COMMIT_HANDLER_FACTORY, CNGX_TABS_CONFIG, CNGX_TABS_GLYPHS, CNGX_TABS_I18N, CNGX_TABS_LANGUAGE_EN, CNGX_TAB_GROUP_HOST, CNGX_TAB_NAV_HOST, CNGX_TAB_OVERFLOW_DOM_ADAPTER_FACTORY, CNGX_TAB_PANEL_HOST, CNGX_TAB_URL_MATCH_STRATEGY, CngxTab, CngxTabAddIcon, CngxTabBusySpinner, CngxTabCloseIcon, CngxTabContent, CngxTabErrorBadge, CngxTabGroupPresenter, CngxTabIcon, CngxTabLabel, CngxTabLink, CngxTabOverflowItem, CngxTabOverflowTrigger, CngxTabRejectionIcon, CngxTabSubLabel, CngxTabsFragmentSync, CngxTabsRouteSync, createCngxTabOverflowDefaultDomAdapter, createDirectiveByIdMap, createDomAnchorRetry, createOrganismScrollSync, createOverflowPopoverHighlightSync, createTabDismissals, createTabGroupAnnouncements, createTabGroupTemplateBindings, createTabKeyboardNav, createTabNavAnnouncement, createTabOverflowTemplateBindings, createTabRouterCommit, createTabUrlMatch, createTabsCommitHandler, createTabsHostAttrs, injectTabsConfig, injectTabsI18n, provideCngxTabs, provideCngxTabsAt, provideTabsConfig, provideTabsConfigAt, provideTabsI18n, tabOverflowOptionId, withDefaultOrientation, withTabAddIconTemplate, withTabBusySpinnerTemplate, withTabCloseIconTemplate, withTabErrorBadgeTemplate, withTabIconTemplate, withTabOverflowItemTemplate, withTabOverflowMaxDeferMs, withTabOverflowStabilizeMs, withTabOverflowTriggerTemplate, withTabRejectionIconTemplate, withTabsAddable, withTabsAlign, withTabsAriaLabels, withTabsClosable, withTabsCommitMode, withTabsDefaultOrientation, withTabsFallbackLabels, withTabsFitted, withTabsFragmentSync, withTabsI18nLabels, withTabsIconLayout, withTabsLinkAriaCurrent, withTabsPanelMode, withTabsRouteMatch, withTabsRouterSync, withTabsRovingLoop, withTabsSkin };
|
|
3359
|
+
export type { CngxDirectiveByIdMapFactory, CngxDirectiveByIdMapOptions, CngxDomAnchorRetryFactory, CngxDomAnchorRetryHandle, CngxDomAnchorRetryOptions, CngxDomAnchorRetryResult, CngxOrganismScrollSyncFactory, CngxOrganismScrollSyncOptions, CngxOverflowPopoverHighlightSyncFactory, CngxTabAlign, CngxTabBusySpinnerContext, CngxTabCloseEvent, CngxTabCloseIconContext, CngxTabDismissals, CngxTabDismissalsOptions, CngxTabErrorBadgeContext, CngxTabGroupAnnouncements, CngxTabGroupAnnouncementsOptions, CngxTabGroupHost, CngxTabGroupTemplateBindings, CngxTabGroupTemplateBindingsOptions, CngxTabHandle, CngxTabIconContext, CngxTabIconLayout, CngxTabKeyboardNav, CngxTabKeyboardNavOptions, CngxTabMatchMode, CngxTabNavAnnouncement, CngxTabNavAnnouncementOptions, CngxTabOverflowDomAdapter, CngxTabOverflowDomAdapterFactory, CngxTabOverflowItemContext, CngxTabOverflowTemplateBindings, CngxTabOverflowTemplateBindingsOptions, CngxTabOverflowTriggerContext, CngxTabPanelHost, CngxTabRejectionIconContext, CngxTabRouterCommitOptions, CngxTabUrlMatch, CngxTabUrlMatchContext, CngxTabUrlMatchFactory, CngxTabsAriaLabels, CngxTabsCommitAction, CngxTabsCommitActionSource, CngxTabsCommitHandler, CngxTabsCommitHandlerFactory, CngxTabsCommitHandlerOptions, CngxTabsCommitResolution, CngxTabsConfig, CngxTabsConfigFeature, CngxTabsFallbackLabels, CngxTabsFeature, CngxTabsHostAttrs, CngxTabsHostAttrsInputs, CngxTabsI18n, CngxTabsI18nFeature, CngxTabsLanguageSection, CngxTabsPanelMode, CngxTabsSkin, CngxTabsTemplates };
|