@cngx/common 0.1.0-rc.8 → 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/command/README.md +29 -0
- package/data/README.md +5 -2
- package/fesm2022/cngx-common-a11y.mjs +403 -84
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +16 -13
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +4 -3
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +55 -36
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +60 -6
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +185 -37
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +86 -48
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +27 -23
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +324 -122
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +129 -26
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +947 -33
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +300 -166
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +251 -80
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +16 -10
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/layout/README.md +16 -0
- package/package.json +20 -7
- package/popover/README.md +40 -0
- 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 +5 -4
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +10 -6
- package/types/cngx-common-a11y.d.ts +167 -14
- package/types/cngx-common-chart.d.ts +8 -7
- package/types/cngx-common-command.d.ts +19 -2
- package/types/cngx-common-data.d.ts +164 -26
- package/types/cngx-common-dialog.d.ts +3 -7
- package/types/cngx-common-interactive.d.ts +52 -17
- package/types/cngx-common-layout.d.ts +37 -5
- package/types/cngx-common-popover.d.ts +353 -13
- package/types/cngx-common-stepper.d.ts +168 -129
- package/types/cngx-common-tabs.d.ts +149 -30
- package/types/cngx-common-timeline.d.ts +27 -7
|
@@ -1,11 +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
8
|
import { CngxMessage } from '@cngx/core/i18n';
|
|
8
|
-
import { CngxCommitController } from '@cngx/common/data';
|
|
9
9
|
import { CngxDirection } from '@cngx/core';
|
|
10
10
|
import { CngxActiveDescendant, ActiveDescendantItem } from '@cngx/common/a11y';
|
|
11
11
|
import { CngxPopover } from '@cngx/common/popover';
|
|
@@ -91,10 +91,25 @@ interface CngxTabGroupHost {
|
|
|
91
91
|
*/
|
|
92
92
|
readonly commitTransition: StatusTransition;
|
|
93
93
|
/**
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
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.
|
|
98
113
|
*
|
|
99
114
|
* @remarks
|
|
100
115
|
* The `pending → error` pulse keyframe (`cngx-tab-pulse-error`)
|
|
@@ -107,7 +122,7 @@ interface CngxTabGroupHost {
|
|
|
107
122
|
/**
|
|
108
123
|
* Safe-harbour origin index captured at the start of an active
|
|
109
124
|
* commit window. Written when `select()` opens a transition under
|
|
110
|
-
* `commitAction`; retained on
|
|
125
|
+
* `commitAction`; retained on a refusal or failure so the live-region phrase
|
|
111
126
|
* can resolve the origin label; cleared on `success`. Outside the
|
|
112
127
|
* commit window the slot may carry a stale value - consumers must
|
|
113
128
|
* gate reads by joining with `lastFailedIndex`. The origin is
|
|
@@ -141,10 +156,11 @@ interface CngxTabGroupHost {
|
|
|
141
156
|
*/
|
|
142
157
|
requestAdd(): void;
|
|
143
158
|
/**
|
|
144
|
-
* Clear {@link lastFailedIndex} without unwinding
|
|
159
|
+
* Clear the {@link lastFailedIndex} marker without unwinding
|
|
145
160
|
* {@link originIndexDuringCommit} (consumers gate reads on
|
|
146
|
-
* `lastFailedIndex` anyway)
|
|
147
|
-
* 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.
|
|
148
164
|
*/
|
|
149
165
|
clearLastFailed(): void;
|
|
150
166
|
}
|
|
@@ -276,8 +292,12 @@ declare class CngxTabGroupPresenter implements CngxTabGroupHost {
|
|
|
276
292
|
* the tracker's `linkedSignal` is allocated once per presenter.
|
|
277
293
|
*/
|
|
278
294
|
readonly commitTransition: StatusTransition;
|
|
279
|
-
private readonly
|
|
295
|
+
private readonly lastOutcomeState;
|
|
296
|
+
private readonly clearedSequenceState;
|
|
297
|
+
private outcomeSequence;
|
|
280
298
|
private readonly originIndexDuringCommitState;
|
|
299
|
+
/** {@inheritDoc CngxTabGroupHost.lastOutcome} */
|
|
300
|
+
readonly lastOutcome: Signal<CngxTransitionOutcome | undefined>;
|
|
281
301
|
/** {@inheritDoc CngxTabGroupHost.lastFailedIndex} */
|
|
282
302
|
readonly lastFailedIndex: Signal<number | undefined>;
|
|
283
303
|
/** {@inheritDoc CngxTabGroupHost.originIndexDuringCommit} */
|
|
@@ -1020,7 +1040,7 @@ declare class CngxTabsRouteSync implements CngxTabsCommitActionSource, AfterCont
|
|
|
1020
1040
|
readonly mode: Signal<'optimistic' | 'pessimistic'>;
|
|
1021
1041
|
/**
|
|
1022
1042
|
* Router commit-action read by the presenter via the DI fallback.
|
|
1023
|
-
* `null` when
|
|
1043
|
+
* `null` when the router is not set up (graceful no-op). Rebuilt only
|
|
1024
1044
|
* when `routeFor` changes; the navigation gate itself is the async
|
|
1025
1045
|
* op inside the action.
|
|
1026
1046
|
*/
|
|
@@ -1081,9 +1101,17 @@ interface CngxTabRouterCommitOptions {
|
|
|
1081
1101
|
* resolves on this navigation's own `navigate()` promise:
|
|
1082
1102
|
*
|
|
1083
1103
|
* - resolved `true` (`NavigationEnd`) → `true` (commit the switch)
|
|
1104
|
+
* - resolved `null` (a skipped same-URL navigation, the route is
|
|
1105
|
+
* already active) → `true`
|
|
1084
1106
|
* - resolved `false` (`NavigationCancel` - a `CanDeactivate` guard
|
|
1085
|
-
* blocked, or a newer navigation superseded this one) → `false
|
|
1086
|
-
*
|
|
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.
|
|
1087
1115
|
*
|
|
1088
1116
|
* Routed tabs reuse the presenter's commit lifecycle verbatim - the
|
|
1089
1117
|
* router navigation is simply the async op. \
|
|
@@ -1370,6 +1398,10 @@ declare class CngxTabIcon {
|
|
|
1370
1398
|
* for the synchronous-rejection edge case. Sibling shape to
|
|
1371
1399
|
* `CngxStepRejectionContext`.
|
|
1372
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
|
+
*
|
|
1373
1405
|
* @category common/tabs/slots
|
|
1374
1406
|
*/
|
|
1375
1407
|
interface CngxTabRejectionIconContext {
|
|
@@ -1377,12 +1409,15 @@ interface CngxTabRejectionIconContext {
|
|
|
1377
1409
|
readonly failedIndex: number;
|
|
1378
1410
|
/** Resolved label of the safe-harbour tab, when derivable. */
|
|
1379
1411
|
readonly originLabel: string | undefined;
|
|
1412
|
+
/** Why the commit did not land (`presenter.lastOutcome().kind`). */
|
|
1413
|
+
readonly reason: 'refused' | 'failed';
|
|
1380
1414
|
}
|
|
1381
1415
|
/**
|
|
1382
1416
|
* Structural slot for the rejection-decoration template. 3-stage
|
|
1383
1417
|
* cascade: per-instance directive >
|
|
1384
1418
|
* `CNGX_TABS_CONFIG.templates.rejectionIcon` >
|
|
1385
|
-
* `CNGX_TABS_GLYPHS.rejectionIcon
|
|
1419
|
+
* `CNGX_TABS_GLYPHS.rejectionIcon` (a failed commit) or
|
|
1420
|
+
* `CNGX_TABS_GLYPHS.refusedIcon` (a refused one).
|
|
1386
1421
|
*
|
|
1387
1422
|
* ```html
|
|
1388
1423
|
* <cngx-tab-group>
|
|
@@ -2054,8 +2089,17 @@ interface CngxTabsLanguageSection {
|
|
|
2054
2089
|
readonly tabHasErrors: CngxMessage;
|
|
2055
2090
|
/** Plural on `{count}`: the overflow trigger label. */
|
|
2056
2091
|
readonly moreTabsLabel: CngxMessage;
|
|
2057
|
-
/**
|
|
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
|
+
*/
|
|
2058
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;
|
|
2059
2103
|
/** `{tab}`: announced after a move to an earlier tab, `{tab}` being its name. */
|
|
2060
2104
|
readonly previousTab: CngxMessage;
|
|
2061
2105
|
/** `{tab}`: announced after a move to a later tab. */
|
|
@@ -2067,11 +2111,24 @@ interface CngxTabsLanguageSection {
|
|
|
2067
2111
|
readonly closedTab: CngxMessage;
|
|
2068
2112
|
/** Announced once a tab without a label is removed. */
|
|
2069
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
|
+
*/
|
|
2070
2119
|
readonly commitFailedRetry: string;
|
|
2071
2120
|
/** Announced while a tab commit is in flight. */
|
|
2072
2121
|
readonly commitInFlight: string;
|
|
2073
2122
|
/** `{origin}`: announced when a failed commit reverts to the origin tab. */
|
|
2074
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;
|
|
2075
2132
|
}
|
|
2076
2133
|
/**
|
|
2077
2134
|
* The English tabs section: the single source of the tabs' English copy.
|
|
@@ -2118,6 +2175,12 @@ interface CngxTabsI18n {
|
|
|
2118
2175
|
* Receives the 1-based position; English `Tab 3`.
|
|
2119
2176
|
*/
|
|
2120
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;
|
|
2121
2184
|
/**
|
|
2122
2185
|
* Commit-success announcement after a move to an earlier tab. Receives
|
|
2123
2186
|
* the position phrase from {@link selectedTab} and owns the whole
|
|
@@ -2146,8 +2209,9 @@ interface CngxTabsI18n {
|
|
|
2146
2209
|
/**
|
|
2147
2210
|
* @deprecated Superseded by {@link commitRolledBackTo}. Retained as
|
|
2148
2211
|
* the defensive fallback in `liveAnnouncement` when the origin
|
|
2149
|
-
* label is unresolvable - fires for
|
|
2150
|
-
* `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
|
|
2151
2215
|
* `tabs-accepted-debt §4`.
|
|
2152
2216
|
*/
|
|
2153
2217
|
readonly commitFailedRetry: string;
|
|
@@ -2159,6 +2223,19 @@ interface CngxTabsI18n {
|
|
|
2159
2223
|
* `originIndexDuringCommit` are set.
|
|
2160
2224
|
*/
|
|
2161
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;
|
|
2162
2239
|
}
|
|
2163
2240
|
/**
|
|
2164
2241
|
* DI token for the tabs i18n bundle, as a `Signal` so a runtime language
|
|
@@ -2280,6 +2357,14 @@ declare function provideCngxTabs(...features: readonly CngxTabsFeature[]): Envir
|
|
|
2280
2357
|
*/
|
|
2281
2358
|
declare function provideCngxTabsAt(...features: readonly CngxTabsFeature[]): Provider[];
|
|
2282
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';
|
|
2283
2368
|
/**
|
|
2284
2369
|
* Adapts the shared commit-controller to the tabs action shape. \
|
|
2285
2370
|
* The presenter delegates to {@link beginTransition} when `commitAction`
|
|
@@ -2292,10 +2377,11 @@ interface CngxTabsCommitHandler {
|
|
|
2292
2377
|
* Start a tab-transition commit. \
|
|
2293
2378
|
* Returns synchronously - read the
|
|
2294
2379
|
* controller's `state` signal for in-flight status. `onResolve`
|
|
2295
|
-
* fires once
|
|
2296
|
-
*
|
|
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.
|
|
2297
2383
|
*/
|
|
2298
|
-
beginTransition(fromIndex: number, toIndex: number, action: CngxTabsCommitAction, onResolve: (
|
|
2384
|
+
beginTransition(fromIndex: number, toIndex: number, action: CngxTabsCommitAction, onResolve: (outcome: CngxTabsCommitResolution) => void): void;
|
|
2299
2385
|
/** Cancel the in-flight transition without firing callbacks. */
|
|
2300
2386
|
cancel(): void;
|
|
2301
2387
|
/** Live `pending` flag from the controller. */
|
|
@@ -2311,8 +2397,10 @@ interface CngxTabsCommitHandlerOptions {
|
|
|
2311
2397
|
}
|
|
2312
2398
|
/**
|
|
2313
2399
|
* Wraps a {@link CngxCommitController} with the action-shape adapter
|
|
2314
|
-
* that
|
|
2315
|
-
*
|
|
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.
|
|
2316
2404
|
*
|
|
2317
2405
|
* @category common/tabs
|
|
2318
2406
|
*/
|
|
@@ -2633,7 +2721,7 @@ interface CngxTabKeyboardNavOptions {
|
|
|
2633
2721
|
/**
|
|
2634
2722
|
* Enables the rejection focus-release effect. Under a pessimistic
|
|
2635
2723
|
* commit, focus follows the intended target while the action is in
|
|
2636
|
-
* flight; a
|
|
2724
|
+
* flight; a refusal or failure keeps the roving stop on the origin, so
|
|
2637
2725
|
* without the release the user is stranded on a `tabindex="-1"`
|
|
2638
2726
|
* button. Omitted, the effect is skipped (headless usage).
|
|
2639
2727
|
*/
|
|
@@ -2820,12 +2908,19 @@ interface CngxTabGroupAnnouncements {
|
|
|
2820
2908
|
* `announce()`. Empty between transitions so the region stays
|
|
2821
2909
|
* quiet on no-op ticks.
|
|
2822
2910
|
*
|
|
2823
|
-
*
|
|
2824
|
-
*
|
|
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).
|
|
2916
|
+
*
|
|
2917
|
+
* Error arm: `commitRolledBackTo(origin)` when the origin tab
|
|
2918
|
+
* resolves, named the same way; otherwise `commitFailedRetry`.
|
|
2825
2919
|
*
|
|
2826
2920
|
* Success arm: `previousTab|nextTab(selectedTab(...))` when
|
|
2827
2921
|
* the index moved; bare `selectedTab(...)` when it didn't (initial
|
|
2828
|
-
* 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`.
|
|
2829
2924
|
*/
|
|
2830
2925
|
readonly liveAnnouncement: Signal<string>;
|
|
2831
2926
|
/**
|
|
@@ -2841,10 +2936,28 @@ interface CngxTabGroupAnnouncements {
|
|
|
2841
2936
|
/**
|
|
2842
2937
|
* Verbose tab-button `aria-label` - `selectedTab(label, position,
|
|
2843
2938
|
* count)` so AT hears "Tab 2 of 5: Settings" instead of inferring
|
|
2844
|
-
* position from tablist enumeration
|
|
2845
|
-
*
|
|
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.
|
|
2846
2942
|
*/
|
|
2847
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;
|
|
2848
2961
|
}
|
|
2849
2962
|
/**
|
|
2850
2963
|
* Pure factory bundling the `<cngx-tab-group>` AT-announcement +
|
|
@@ -2957,8 +3070,14 @@ declare function createTabNavAnnouncement(options: CngxTabNavAnnouncementOptions
|
|
|
2957
3070
|
declare const CNGX_TABS_GLYPHS: {
|
|
2958
3071
|
/** Default visual for `*cngxTabErrorBadge` when no override is bound. */
|
|
2959
3072
|
readonly errorBadge: "!";
|
|
2960
|
-
/** Default visual for `*cngxTabRejectionIcon` when no override is bound. */
|
|
3073
|
+
/** Default visual for `*cngxTabRejectionIcon` on a failed commit when no override is bound. */
|
|
2961
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: "⊘";
|
|
2962
3081
|
/** Default visual for a tab's close button when no override is bound. */
|
|
2963
3082
|
readonly closeIcon: "×";
|
|
2964
3083
|
/** Default visual for the add-tab button when no override is bound. */
|
|
@@ -3237,4 +3356,4 @@ type CngxDirectiveByIdMapFactory = <T extends {
|
|
|
3237
3356
|
declare const CNGX_DIRECTIVE_BY_ID_MAP_FACTORY: InjectionToken<CngxDirectiveByIdMapFactory>;
|
|
3238
3357
|
|
|
3239
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 };
|
|
3240
|
-
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, CngxTabsLanguageSection, CngxTabsPanelMode, CngxTabsSkin, CngxTabsTemplates };
|
|
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 };
|
|
@@ -792,14 +792,33 @@ declare class CngxTimelineLoadingTail {
|
|
|
792
792
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineLoadingTail, never>;
|
|
793
793
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineLoadingTail, "ng-template[cngxTimelineLoadingTail]", ["cngxTimelineLoadingTail"], {}, {}, never, never, true, never>;
|
|
794
794
|
}
|
|
795
|
+
/**
|
|
796
|
+
* Context of one `*cngxTimelineSkeleton` placeholder row. A placeholder has
|
|
797
|
+
* no data, only a position: the same index, row count and side the built-in
|
|
798
|
+
* placeholder uses, so a custom shape lands where the content row will.
|
|
799
|
+
*
|
|
800
|
+
* @category common/timeline
|
|
801
|
+
* @since 0.1.0
|
|
802
|
+
*/
|
|
803
|
+
interface CngxTimelineSkeletonContext {
|
|
804
|
+
/** Same as `index`, for `let-index` shorthand. */
|
|
805
|
+
readonly $implicit: number;
|
|
806
|
+
/** 0-based position of the placeholder row. */
|
|
807
|
+
readonly index: number;
|
|
808
|
+
/** Number of placeholder rows (`[skeletonRowCount]`). */
|
|
809
|
+
readonly count: number;
|
|
810
|
+
/** Side the content row at this index will sit on, from `placement` and `mode`. */
|
|
811
|
+
readonly side: 'start' | 'end';
|
|
812
|
+
}
|
|
795
813
|
/**
|
|
796
814
|
* One placeholder row in the first-load body, replacing the built-in
|
|
797
815
|
* marker-rail-and-two-bars shape. Rendered `[skeletonRowCount]` times.
|
|
798
816
|
*
|
|
799
|
-
*
|
|
800
|
-
*
|
|
801
|
-
*
|
|
802
|
-
*
|
|
817
|
+
* The context carries the row's position only ({@link CngxTimelineSkeletonContext}):
|
|
818
|
+
* `index`, `count` and the `side` the content row will sit on, so a custom
|
|
819
|
+
* shape follows `placement="end"` / `"alternate"` and the swap to content
|
|
820
|
+
* does not reflow. Bind this when the real rows are taller or busier than
|
|
821
|
+
* the default shape.
|
|
803
822
|
*
|
|
804
823
|
* Whatever renders here sits inside an `aria-hidden` wrapper - the load is
|
|
805
824
|
* announced through the timeline's live region, not through the placeholder.
|
|
@@ -810,7 +829,8 @@ declare class CngxTimelineLoadingTail {
|
|
|
810
829
|
* @since 0.1.0
|
|
811
830
|
*/
|
|
812
831
|
declare class CngxTimelineSkeleton {
|
|
813
|
-
readonly templateRef: TemplateRef<
|
|
832
|
+
readonly templateRef: TemplateRef<CngxTimelineSkeletonContext>;
|
|
833
|
+
static ngTemplateContextGuard(_dir: CngxTimelineSkeleton, ctx: unknown): ctx is CngxTimelineSkeletonContext;
|
|
814
834
|
static ɵfac: i0.ɵɵFactoryDeclaration<CngxTimelineSkeleton, never>;
|
|
815
835
|
static ɵdir: i0.ɵɵDirectiveDeclaration<CngxTimelineSkeleton, "ng-template[cngxTimelineSkeleton]", ["cngxTimelineSkeleton"], {}, {}, never, never, true, never>;
|
|
816
836
|
}
|
|
@@ -955,7 +975,7 @@ interface CngxTimelineTemplates {
|
|
|
955
975
|
/** Default refreshing tail (`*cngxTimelineLoadingTail`). */
|
|
956
976
|
readonly loadingTail?: TemplateRef<void>;
|
|
957
977
|
/** Default placeholder row for the first-load body (`*cngxTimelineSkeleton`). */
|
|
958
|
-
readonly skeleton?: TemplateRef<
|
|
978
|
+
readonly skeleton?: TemplateRef<CngxTimelineSkeletonContext>;
|
|
959
979
|
}
|
|
960
980
|
/**
|
|
961
981
|
* Timeline config surface. Resolution priority: \
|
|
@@ -1122,4 +1142,4 @@ declare module '@cngx/core/i18n' {
|
|
|
1122
1142
|
}
|
|
1123
1143
|
|
|
1124
1144
|
export { CNGX_TIMELINE_CONFIG, CNGX_TIMELINE_GROUPING_FACTORY, CNGX_TIMELINE_LANGUAGE_EN, CNGX_TIMELINE_MARKER_HOST, CngxTimelineConnector, CngxTimelineContent, CngxTimelineDateHeader, CngxTimelineEmpty, CngxTimelineError, CngxTimelineItem, CngxTimelineItemTpl, CngxTimelineLoadingTail, CngxTimelineMarker, CngxTimelineMarkerContent, CngxTimelineMarkerTpl, CngxTimelineOpposite, CngxTimelineRetryButton, CngxTimelineSkeleton, CngxTimelineTime, createTimelineGrouping, injectTimelineConfig, provideTimelineConfig, provideTimelineConfigAt, withTimelineLabels, withTimelineTemplates };
|
|
1125
|
-
export type { CngxTimelineConfig, CngxTimelineConfigFeature, CngxTimelineDateHeaderContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineGroupingFactory, CngxTimelineItemContext, CngxTimelineLabels, CngxTimelineLanguageSection, CngxTimelineMarkerContext, CngxTimelineMarkerHost, CngxTimelineRetryButtonContext, CngxTimelineTemplates, TimelineConnectorPosition, TimelineDateAccessor, TimelineDirection, TimelineGroup, TimelineGroupBy, TimelineGroupKey, TimelineGrouping, TimelineGroupingFn, TimelineGroupingOptions, TimelineStatus };
|
|
1145
|
+
export type { CngxTimelineConfig, CngxTimelineConfigFeature, CngxTimelineDateHeaderContext, CngxTimelineEmptyContext, CngxTimelineErrorContext, CngxTimelineGroupingFactory, CngxTimelineItemContext, CngxTimelineLabels, CngxTimelineLanguageSection, CngxTimelineMarkerContext, CngxTimelineMarkerHost, CngxTimelineRetryButtonContext, CngxTimelineSkeletonContext, CngxTimelineTemplates, TimelineConnectorPosition, TimelineDateAccessor, TimelineDirection, TimelineGroup, TimelineGroupBy, TimelineGroupKey, TimelineGrouping, TimelineGroupingFn, TimelineGroupingOptions, TimelineStatus };
|