@cngx/common 0.1.0-rc.6 → 0.1.0-rc.8
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/chart/README.md +85 -0
- package/command/README.md +157 -0
- package/data/README.md +33 -1
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +356 -180
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +84 -42
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +311 -53
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +4360 -1625
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +171 -0
- package/fesm2022/cngx-common-command.mjs.map +1 -0
- package/fesm2022/cngx-common-data.mjs +1556 -616
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +518 -112
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +468 -87
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2725 -1303
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +943 -164
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +769 -103
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +816 -348
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +2330 -1554
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +1170 -0
- package/fesm2022/cngx-common-timeline.mjs.map +1 -0
- package/fesm2022/cngx-common.mjs +2 -2
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +21 -1
- package/package.json +11 -1
- package/popover/README.md +18 -2
- package/stepper/README.md +7 -5
- package/theming/components/cngx-accordion.css +4 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-badge.css +22 -0
- package/theming/components/cngx-bottom-sheet.css +14 -2
- package/theming/components/cngx-breadcrumb.css +8 -0
- package/theming/components/cngx-button-toggle.css +73 -5
- package/theming/components/cngx-data-grid.css +234 -1
- package/theming/components/cngx-dialog.css +25 -0
- package/theming/components/cngx-divider.css +12 -0
- package/theming/components/cngx-listbox.css +48 -12
- package/theming/components/cngx-menu.css +91 -15
- package/theming/components/cngx-popover.css +24 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +2 -2
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +23 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +101 -31
- package/types/cngx-common-audio.d.ts +32 -32
- package/types/cngx-common-card.d.ts +211 -20
- package/types/cngx-common-chart.d.ts +1605 -169
- package/types/cngx-common-command.d.ts +190 -0
- package/types/cngx-common-data.d.ts +842 -163
- package/types/cngx-common-dialog.d.ts +372 -28
- package/types/cngx-common-display.d.ts +432 -148
- package/types/cngx-common-interactive.d.ts +1553 -370
- package/types/cngx-common-layout.d.ts +613 -27
- package/types/cngx-common-popover.d.ts +376 -36
- package/types/cngx-common-stepper.d.ts +414 -114
- package/types/cngx-common-tabs.d.ts +597 -72
- package/types/cngx-common-timeline.d.ts +1125 -0
- package/types/cngx-common.d.ts +1 -1
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { Signal, TemplateRef, InjectionToken, Provider, ModelSignal, WritableSignal, OnInit, Type,
|
|
2
|
+
import { Signal, TemplateRef, InjectionToken, Provider, ModelSignal, WritableSignal, OnInit, Type, EnvironmentProviders } from '@angular/core';
|
|
3
3
|
import { AsyncStatus, CngxAsyncState, CngxStateful } from '@cngx/core/utils';
|
|
4
4
|
export { AsyncStatus, CngxAsyncState } from '@cngx/core/utils';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
|
+
import { CngxMessage } from '@cngx/core/i18n';
|
|
6
7
|
import * as _cngx_common_interactive from '@cngx/common/interactive';
|
|
7
8
|
import { CngxFormFieldControl } from '@cngx/core/tokens';
|
|
8
9
|
import * as i1 from '@cngx/common/a11y';
|
|
9
10
|
import { ActiveDescendantItem, CngxActiveDescendant, CngxAdItemHandle } from '@cngx/common/a11y';
|
|
10
11
|
import { FlatTreeNode, CngxTreeNode } from '@cngx/utils';
|
|
12
|
+
import { CngxDirection } from '@cngx/core';
|
|
11
13
|
|
|
12
14
|
/**
|
|
13
15
|
* Action function that returns a Promise or Observable.
|
|
@@ -19,9 +21,17 @@ type AsyncAction = () => Promise<unknown> | Observable<unknown>;
|
|
|
19
21
|
* Async action handler with loading state, auto-disable, and success/error feedback.
|
|
20
22
|
*
|
|
21
23
|
* Place on any clickable element (button, link, div). Executes the provided
|
|
22
|
-
* async action on click, tracks the full lifecycle as a state machine,
|
|
23
|
-
*
|
|
24
|
-
*
|
|
24
|
+
* async action on click, tracks the full lifecycle as a state machine, and
|
|
25
|
+
* guards against double-clicks. While pending it communicates busy via
|
|
26
|
+
* `aria-busy` + `aria-disabled` and swallows clicks WITHOUT the hard
|
|
27
|
+
* `disabled` attribute, so keyboard focus stays on the control instead of
|
|
28
|
+
* dropping to `<body>` mid-action. Note: the guard prevents the ACTION from
|
|
29
|
+
* re-running and calls `preventDefault()`, but a consumer `(click)` handler
|
|
30
|
+
* on the same element still fires while pending - gate it on `pending()`
|
|
31
|
+
* when it must not. Success and failure are announced through
|
|
32
|
+
* an auto-rendered polite live region (sibling of the host - inside a
|
|
33
|
+
* `<button>` the text would pollute the accessible name); opt out with
|
|
34
|
+
* `[autoAnnounce]="false"` and bind `announcement` to your own region.
|
|
25
35
|
*
|
|
26
36
|
* ### Basic usage
|
|
27
37
|
* ```html
|
|
@@ -55,7 +65,7 @@ type AsyncAction = () => Promise<unknown> | Observable<unknown>;
|
|
|
55
65
|
* @since 0.1.0
|
|
56
66
|
* @relatedTo CngxPending, CngxSucceeded, CngxFailed, CngxActionButton
|
|
57
67
|
* <example-url>http://localhost:4200/#/common/interactive/retry/optimistic-instant-like-toggle</example-url>
|
|
58
|
-
* <example-url>http://localhost:4200/#/common/interactive/retry/
|
|
68
|
+
* <example-url>http://localhost:4200/#/common/interactive/retry/createretry-cngxasyncclick</example-url>
|
|
59
69
|
*/
|
|
60
70
|
declare class CngxAsyncClick {
|
|
61
71
|
private readonly el;
|
|
@@ -64,21 +74,46 @@ declare class CngxAsyncClick {
|
|
|
64
74
|
readonly action: _angular_core.InputSignal<AsyncAction>;
|
|
65
75
|
/** Duration in ms to show success/error state before reset. */
|
|
66
76
|
readonly feedbackDuration: _angular_core.InputSignal<number>;
|
|
67
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* When `false`, clicks are ignored and the element is marked `aria-disabled`
|
|
79
|
+
* (never the hard `disabled` attribute, so focus survives). Communicates the
|
|
80
|
+
* "why" to assistive tech instead of silently swallowing the click.
|
|
81
|
+
*/
|
|
68
82
|
readonly enabled: _angular_core.InputSignal<boolean>;
|
|
69
|
-
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
83
|
+
/**
|
|
84
|
+
* External busy override. When `true`, the element is `aria-busy` even though
|
|
85
|
+
* this directive is not running its own action - for a wrapper that tracks an
|
|
86
|
+
* operation outside the click (e.g. an `[externalState]`). Purely an ARIA
|
|
87
|
+
* hint: it does not block clicks (gate those with `[enabled]`).
|
|
88
|
+
*/
|
|
89
|
+
readonly busy: _angular_core.InputSignal<boolean>;
|
|
90
|
+
private readonly i18n;
|
|
91
|
+
/**
|
|
92
|
+
* Label announced to screen readers on success. Unbound, it resolves to
|
|
93
|
+
* `CNGX_INTERACTIVE_I18N.asyncClickSucceeded` at announcement time.
|
|
94
|
+
*/
|
|
95
|
+
readonly succeededAnnouncement: _angular_core.InputSignal<string | undefined>;
|
|
96
|
+
/**
|
|
97
|
+
* Label announced to screen readers on failure. Unbound, it resolves to
|
|
98
|
+
* `CNGX_INTERACTIVE_I18N.asyncClickFailed` at announcement time.
|
|
99
|
+
*/
|
|
100
|
+
readonly failedAnnouncement: _angular_core.InputSignal<string | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* Auto-render the polite live region announcing success/failure.
|
|
103
|
+
* Opt out (`false`) to wire {@link announcement} to your own region -
|
|
104
|
+
* also when a toast/alert bridge (`cngxToastOn`, `cngxAlertOn`) on the
|
|
105
|
+
* same element already announces the settle, or the user hears it twice.
|
|
106
|
+
*/
|
|
107
|
+
readonly autoAnnounce: _angular_core.InputSignal<boolean>;
|
|
73
108
|
private readonly pendingState;
|
|
74
109
|
private readonly succeededState;
|
|
75
110
|
private readonly failedState;
|
|
76
111
|
private readonly errorState;
|
|
77
112
|
private readonly lastUpdatedState;
|
|
78
113
|
private feedbackTimer;
|
|
79
|
-
private readonly supportsDisabled;
|
|
80
114
|
private destroyed;
|
|
81
115
|
constructor();
|
|
116
|
+
private installAnnounceRegion;
|
|
82
117
|
/** `true` while the action is executing. */
|
|
83
118
|
readonly pending: Signal<boolean>;
|
|
84
119
|
/** `true` for `feedbackDuration` ms after a successful action. */
|
|
@@ -89,7 +124,11 @@ declare class CngxAsyncClick {
|
|
|
89
124
|
readonly error: Signal<unknown>;
|
|
90
125
|
/** Current lifecycle status - use in `@switch` for template branching. */
|
|
91
126
|
readonly status: Signal<AsyncStatus>;
|
|
92
|
-
/**
|
|
127
|
+
/**
|
|
128
|
+
* Screen reader announcement for the current state. Rendered automatically
|
|
129
|
+
* into the auto polite region; only needs manual wiring when
|
|
130
|
+
* `autoAnnounce` is `false`.
|
|
131
|
+
*/
|
|
93
132
|
readonly announcement: Signal<string>;
|
|
94
133
|
/**
|
|
95
134
|
* Full `CngxAsyncState` view of this directive's lifecycle.
|
|
@@ -99,13 +138,11 @@ declare class CngxAsyncClick {
|
|
|
99
138
|
*/
|
|
100
139
|
readonly state: CngxAsyncState<unknown>;
|
|
101
140
|
/** @internal */
|
|
102
|
-
protected readonly shouldDisable: Signal<"" | null>;
|
|
103
|
-
/** @internal */
|
|
104
141
|
protected handleClick(event: Event): Promise<void>;
|
|
105
142
|
private scheduleFeedbackReset;
|
|
106
143
|
private clearFeedback;
|
|
107
144
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAsyncClick, never>;
|
|
108
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxAsyncClick, "[cngxAsyncClick]", ["cngxAsyncClick"], { "action": { "alias": "cngxAsyncClick"; "required": true; "isSignal": true; }; "feedbackDuration": { "alias": "feedbackDuration"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "succeededAnnouncement": { "alias": "succeededAnnouncement"; "required": false; "isSignal": true; }; "failedAnnouncement": { "alias": "failedAnnouncement"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
145
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxAsyncClick, "[cngxAsyncClick]", ["cngxAsyncClick"], { "action": { "alias": "cngxAsyncClick"; "required": true; "isSignal": true; }; "feedbackDuration": { "alias": "feedbackDuration"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "succeededAnnouncement": { "alias": "succeededAnnouncement"; "required": false; "isSignal": true; }; "failedAnnouncement": { "alias": "failedAnnouncement"; "required": false; "isSignal": true; }; "autoAnnounce": { "alias": "autoAnnounce"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
109
146
|
}
|
|
110
147
|
|
|
111
148
|
/**
|
|
@@ -176,6 +213,182 @@ declare class CngxFailed {
|
|
|
176
213
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxFailed, "ng-template[cngxFailed]", never, {}, {}, never, never, true, never>;
|
|
177
214
|
}
|
|
178
215
|
|
|
216
|
+
/**
|
|
217
|
+
* Interactive i18n surface. Library defaults are English; consumers override
|
|
218
|
+
* via {@link provideInteractiveI18n}. Reactive from birth: the token carries a
|
|
219
|
+
* `Signal`, and {@link withInteractiveI18nLabels} accepts a `Signal` of a
|
|
220
|
+
* partial bundle, so a runtime language switch re-derives every read.
|
|
221
|
+
*
|
|
222
|
+
* `asyncClickSucceeded` / `asyncClickFailed` are live-region copy:
|
|
223
|
+
* `CngxAsyncClick` (and `CngxActionButton`, which wraps it) announces the
|
|
224
|
+
* settle it just made, spent once per transition. The other keys are the
|
|
225
|
+
* fallback of string inputs (`CngxCopyBlock`, `CngxRangeSlider`,
|
|
226
|
+
* `CngxBreadcrumb`), resolved in a `computed()`: a bound input wins, and an
|
|
227
|
+
* unbound one follows a language switch. They are optional so a bundle
|
|
228
|
+
* built before they existed keeps compiling; the active language pack (or
|
|
229
|
+
* its English section) fills them at the reading site.
|
|
230
|
+
*
|
|
231
|
+
* @category common/interactive/i18n
|
|
232
|
+
*/
|
|
233
|
+
interface CngxInteractiveI18n {
|
|
234
|
+
/** Announced when an async click action resolves. */
|
|
235
|
+
readonly asyncClickSucceeded: string;
|
|
236
|
+
/** Announced when an async click action rejects. */
|
|
237
|
+
readonly asyncClickFailed: string;
|
|
238
|
+
/** Default of the `CngxCopyBlock` `buttonLabel` input. */
|
|
239
|
+
readonly copy?: string;
|
|
240
|
+
/** Default of the `CngxCopyBlock` `copiedLabel` input. */
|
|
241
|
+
readonly copied?: string;
|
|
242
|
+
/** Default of the `CngxCopyBlock` `srAnnouncement` input (live region). */
|
|
243
|
+
readonly copiedAnnouncement?: string;
|
|
244
|
+
/** Default of the `CngxRangeSlider` `startLabel` input. */
|
|
245
|
+
readonly rangeMinimum?: string;
|
|
246
|
+
/** Default of the `CngxRangeSlider` `endLabel` input. */
|
|
247
|
+
readonly rangeMaximum?: string;
|
|
248
|
+
/** Default of the `CngxBreadcrumb` `label` input (landmark name). */
|
|
249
|
+
readonly breadcrumb?: string;
|
|
250
|
+
/** Default confirmation of `canDeactivateWhenClean`. */
|
|
251
|
+
readonly unsavedChanges?: string;
|
|
252
|
+
/**
|
|
253
|
+
* Visible `start - end` value of `CngxRangeSlider`. Receives both values
|
|
254
|
+
* already formatted; one message, so a locale owns the order and the joiner.
|
|
255
|
+
*/
|
|
256
|
+
readonly rangeValue?: (start: string, end: string) => string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* DI token for the interactive i18n bundle. `providedIn: 'root'`: the
|
|
260
|
+
* interactive section of the active language pack over the English defaults;
|
|
261
|
+
* the value is a `Signal`, shared by every reader under one injector.
|
|
262
|
+
*
|
|
263
|
+
* @category common/interactive/i18n
|
|
264
|
+
* @wcag AA
|
|
265
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/i18n/interactive-i18n.ts
|
|
266
|
+
* @since 0.1.0
|
|
267
|
+
* @relatedTo CngxAsyncClick
|
|
268
|
+
*/
|
|
269
|
+
declare const CNGX_INTERACTIVE_I18N: InjectionToken<Signal<CngxInteractiveI18n>>;
|
|
270
|
+
/**
|
|
271
|
+
* Branded feature-fn for {@link provideInteractiveI18n}.
|
|
272
|
+
*
|
|
273
|
+
* @category common/interactive/i18n
|
|
274
|
+
* @since 0.1.0
|
|
275
|
+
*/
|
|
276
|
+
type CngxInteractiveI18nFeature = ((bundle: Signal<CngxInteractiveI18n>) => Signal<CngxInteractiveI18n>) & {
|
|
277
|
+
readonly _target: 'i18n';
|
|
278
|
+
};
|
|
279
|
+
/**
|
|
280
|
+
* Override i18n labels via a partial bundle - unset keys keep the language
|
|
281
|
+
* pack's copy, or the English default. Pass a `Signal` of a partial bundle to switch languages at
|
|
282
|
+
* runtime.
|
|
283
|
+
*
|
|
284
|
+
* @category common/interactive/i18n
|
|
285
|
+
* @since 0.1.0
|
|
286
|
+
*/
|
|
287
|
+
declare function withInteractiveI18nLabels(overrides: Partial<CngxInteractiveI18n> | Signal<Partial<CngxInteractiveI18n>>): CngxInteractiveI18nFeature;
|
|
288
|
+
/**
|
|
289
|
+
* Provider for the interactive i18n bundle. Returns a plain `Provider`, so it
|
|
290
|
+
* also scopes a subtree through `viewProviders`. The features apply on top of
|
|
291
|
+
* the active language pack.
|
|
292
|
+
*
|
|
293
|
+
* ```ts
|
|
294
|
+
* bootstrapApplication(AppComponent, {
|
|
295
|
+
* providers: [
|
|
296
|
+
* provideInteractiveI18n(
|
|
297
|
+
* withInteractiveI18nLabels({ asyncClickSucceeded: 'Erledigt', asyncClickFailed: 'Fehlgeschlagen' }),
|
|
298
|
+
* ),
|
|
299
|
+
* ],
|
|
300
|
+
* });
|
|
301
|
+
* ```
|
|
302
|
+
*
|
|
303
|
+
* @category common/interactive/i18n
|
|
304
|
+
* @since 0.1.0
|
|
305
|
+
*/
|
|
306
|
+
declare function provideInteractiveI18n(...features: readonly CngxInteractiveI18nFeature[]): Provider;
|
|
307
|
+
/**
|
|
308
|
+
* Inject the resolved interactive i18n bundle signal. Read it inside a
|
|
309
|
+
* `computed()` or template so a runtime override flip re-derives.
|
|
310
|
+
*
|
|
311
|
+
* @category common/interactive/i18n
|
|
312
|
+
* @since 0.1.0
|
|
313
|
+
*/
|
|
314
|
+
declare function injectInteractiveI18n(): Signal<CngxInteractiveI18n>;
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* The interactive section of a {@link CngxLanguagePack}: the copy of the
|
|
318
|
+
* `@cngx/common/interactive` atoms (async click, copy block, range slider,
|
|
319
|
+
* breadcrumb, the unsaved-changes guard). It feeds `CNGX_INTERACTIVE_I18N`.
|
|
320
|
+
*
|
|
321
|
+
* @category common/interactive/i18n
|
|
322
|
+
* @since 0.1.0
|
|
323
|
+
* @relatedTo CNGX_INTERACTIVE_I18N
|
|
324
|
+
*/
|
|
325
|
+
interface CngxInteractiveLanguageSection {
|
|
326
|
+
/** Announced when an async click action resolves. */
|
|
327
|
+
readonly asyncClickSucceeded: string;
|
|
328
|
+
/** Announced when an async click action rejects. */
|
|
329
|
+
readonly asyncClickFailed: string;
|
|
330
|
+
/** Label of the copy-block button. */
|
|
331
|
+
readonly copy: string;
|
|
332
|
+
/** Label of the copy-block button after a copy. */
|
|
333
|
+
readonly copied: string;
|
|
334
|
+
/** Announced after a copy. */
|
|
335
|
+
readonly copiedAnnouncement: string;
|
|
336
|
+
/** Accessible name of the range slider's start thumb. */
|
|
337
|
+
readonly rangeMinimum: string;
|
|
338
|
+
/** Accessible name of the range slider's end thumb. */
|
|
339
|
+
readonly rangeMaximum: string;
|
|
340
|
+
/** Accessible name of the breadcrumb landmark. */
|
|
341
|
+
readonly breadcrumb: string;
|
|
342
|
+
/** Confirmation of `canDeactivateWhenClean` before leaving unsaved changes. */
|
|
343
|
+
readonly unsavedChanges: string;
|
|
344
|
+
/** `{start}`, `{end}`: the visible value of a range slider. */
|
|
345
|
+
readonly rangeValue: CngxMessage;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* The English interactive section: the single source of the interactive
|
|
349
|
+
* atoms' English copy. `CNGX_INTERACTIVE_I18N` defaults to it.
|
|
350
|
+
*
|
|
351
|
+
* @category common/interactive/i18n
|
|
352
|
+
* @since 0.1.0
|
|
353
|
+
* @relatedTo CNGX_INTERACTIVE_I18N
|
|
354
|
+
*/
|
|
355
|
+
declare const CNGX_INTERACTIVE_LANGUAGE_EN: CngxInteractiveLanguageSection;
|
|
356
|
+
declare module '@cngx/core/i18n' {
|
|
357
|
+
interface CngxLanguagePack {
|
|
358
|
+
readonly interactive: CngxInteractiveLanguageSection;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/**
|
|
363
|
+
* The menu section of a {@link CngxLanguagePack}: what the menu family
|
|
364
|
+
* announces. It feeds the `ariaLabels` of `CNGX_MENU_CONFIG`.
|
|
365
|
+
*
|
|
366
|
+
* @category common/interactive/i18n
|
|
367
|
+
* @since 0.1.0
|
|
368
|
+
* @relatedTo CNGX_MENU_CONFIG
|
|
369
|
+
*/
|
|
370
|
+
interface CngxMenuLanguageSection {
|
|
371
|
+
readonly submenuOpened: string;
|
|
372
|
+
readonly submenuClosed: string;
|
|
373
|
+
readonly itemActivated: string;
|
|
374
|
+
readonly itemDisabled: string;
|
|
375
|
+
readonly menuDismissed: string;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* The English menu section: the single source of the menu's English copy.
|
|
379
|
+
* `CNGX_MENU_CONFIG` defaults its `ariaLabels` to it.
|
|
380
|
+
*
|
|
381
|
+
* @category common/interactive/i18n
|
|
382
|
+
* @since 0.1.0
|
|
383
|
+
* @relatedTo CNGX_MENU_CONFIG
|
|
384
|
+
*/
|
|
385
|
+
declare const CNGX_MENU_LANGUAGE_EN: CngxMenuLanguageSection;
|
|
386
|
+
declare module '@cngx/core/i18n' {
|
|
387
|
+
interface CngxLanguagePack {
|
|
388
|
+
readonly menu: CngxMenuLanguageSection;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
179
392
|
/**
|
|
180
393
|
* Display bucket a reflector collapses an {@link CngxAsyncState} into.
|
|
181
394
|
* The `loading` / `refreshing` busy variants fold into `pending` for the
|
|
@@ -219,6 +432,9 @@ declare function reflectAsyncDisplayStatus(state: CngxAsyncState<unknown> | null
|
|
|
219
432
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-status/async-status.directive.ts
|
|
220
433
|
* @since 0.1.0
|
|
221
434
|
* @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed
|
|
435
|
+
* @slot cngxPending Rendered while the tracked operation is in flight.
|
|
436
|
+
* @slot cngxSucceeded Rendered after the operation resolves successfully.
|
|
437
|
+
* @slot cngxFailed Rendered when the operation rejects; gets the error.
|
|
222
438
|
*/
|
|
223
439
|
declare class CngxAsyncStatus {
|
|
224
440
|
private readonly coPlacedAsyncClick;
|
|
@@ -308,6 +524,11 @@ declare class CngxCopyText {
|
|
|
308
524
|
/** Emitted when a copy attempt fails. */
|
|
309
525
|
readonly copyFailed: _angular_core.OutputEmitterRef<unknown>;
|
|
310
526
|
constructor();
|
|
527
|
+
/**
|
|
528
|
+
* Host click handler - fire-and-forget wrapper so the event binding
|
|
529
|
+
* does not leak the promise the public {@link copy} API returns.
|
|
530
|
+
*/
|
|
531
|
+
protected handleClick(): void;
|
|
311
532
|
/** Copies the text to the clipboard. */
|
|
312
533
|
copy(): Promise<void>;
|
|
313
534
|
/** execCommand fallback for environments without Clipboard API. */
|
|
@@ -347,14 +568,26 @@ declare class CngxCopyText {
|
|
|
347
568
|
* <example-url>http://localhost:4200/#/common/interactive/copy/block/code-snippet</example-url>
|
|
348
569
|
*/
|
|
349
570
|
declare class CngxCopyBlock {
|
|
571
|
+
private readonly i18n;
|
|
350
572
|
/** The text value to copy to clipboard. */
|
|
351
573
|
readonly value: _angular_core.InputSignal<string>;
|
|
352
|
-
/** Label for the copy button. */
|
|
353
|
-
readonly buttonLabel: _angular_core.InputSignal<string>;
|
|
354
|
-
/** Label shown after successful copy. */
|
|
355
|
-
readonly copiedLabel: _angular_core.InputSignal<string>;
|
|
356
|
-
/**
|
|
357
|
-
|
|
574
|
+
/** Label for the copy button. Unbound, it follows `CNGX_INTERACTIVE_I18N.copy`. */
|
|
575
|
+
readonly buttonLabel: _angular_core.InputSignal<string | undefined>;
|
|
576
|
+
/** Label shown after successful copy. Unbound, it follows `CNGX_INTERACTIVE_I18N.copied`. */
|
|
577
|
+
readonly copiedLabel: _angular_core.InputSignal<string | undefined>;
|
|
578
|
+
/**
|
|
579
|
+
* Screen reader announcement on copy. Unbound, it follows
|
|
580
|
+
* `CNGX_INTERACTIVE_I18N.copiedAnnouncement`.
|
|
581
|
+
*/
|
|
582
|
+
readonly srAnnouncement: _angular_core.InputSignal<string | undefined>;
|
|
583
|
+
private readonly copyText;
|
|
584
|
+
protected readonly resolvedButtonLabel: _angular_core.Signal<string>;
|
|
585
|
+
protected readonly resolvedCopiedLabel: _angular_core.Signal<string>;
|
|
586
|
+
/**
|
|
587
|
+
* Live-region text. Only the copied state is tracked: a language switch
|
|
588
|
+
* never re-voices the region; the next copy speaks the new language.
|
|
589
|
+
*/
|
|
590
|
+
protected readonly liveAnnouncement: _angular_core.Signal<string>;
|
|
358
591
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCopyBlock, never>;
|
|
359
592
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCopyBlock, "cngx-copy-block", ["cngxCopyBlock"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "buttonLabel": { "alias": "buttonLabel"; "required": false; "isSignal": true; }; "copiedLabel": { "alias": "copiedLabel"; "required": false; "isSignal": true; }; "srAnnouncement": { "alias": "srAnnouncement"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
360
593
|
}
|
|
@@ -406,7 +639,14 @@ declare class CngxRipple {
|
|
|
406
639
|
readonly active: _angular_core.Signal<boolean>;
|
|
407
640
|
private readonly el;
|
|
408
641
|
private readonly doc;
|
|
409
|
-
private
|
|
642
|
+
private readonly destroyRef;
|
|
643
|
+
private readonly prefersReducedMotion;
|
|
644
|
+
/**
|
|
645
|
+
* Cleanups of waves whose animation has not finished yet. Flushed on
|
|
646
|
+
* destroy so the 1s fallback timer never outlives the directive and
|
|
647
|
+
* detached hosts do not keep orphaned wave elements alive.
|
|
648
|
+
*/
|
|
649
|
+
private readonly pendingCleanups;
|
|
410
650
|
constructor();
|
|
411
651
|
/** @internal */
|
|
412
652
|
protected handlePointerDown(event: PointerEvent): void;
|
|
@@ -505,8 +745,13 @@ declare class CngxPressRipple {
|
|
|
505
745
|
interface CngxNavConfig {
|
|
506
746
|
/**
|
|
507
747
|
* Indentation in px per depth level.
|
|
508
|
-
*
|
|
509
|
-
*
|
|
748
|
+
*
|
|
749
|
+
* When set, `CngxNavGroup` / `CngxNavLink` hosts in the provider scope
|
|
750
|
+
* emit it as the `--cngx-nav-indent` CSS custom property. When absent,
|
|
751
|
+
* the hosts emit nothing - consumer stylesheets keep full control via
|
|
752
|
+
* the cascade and the documented `var(--cngx-nav-indent, 12px)`
|
|
753
|
+
* fallback.
|
|
754
|
+
* @default 12 (CSS fallback; not written to the DOM)
|
|
510
755
|
*/
|
|
511
756
|
indent?: number;
|
|
512
757
|
/**
|
|
@@ -517,8 +762,15 @@ interface CngxNavConfig {
|
|
|
517
762
|
singleAccordion?: boolean;
|
|
518
763
|
/**
|
|
519
764
|
* Default animation duration in ms for disclosure transitions.
|
|
520
|
-
*
|
|
521
|
-
*
|
|
765
|
+
*
|
|
766
|
+
* When set, `CngxNavGroup` / `CngxNavLink` hosts in the provider scope
|
|
767
|
+
* emit it as the `--cngx-nav-transition` CSS custom property. When
|
|
768
|
+
* absent, the hosts emit nothing - the cascade and the documented
|
|
769
|
+
* `var(--cngx-nav-transition, 150ms)` fallback apply. Content panels
|
|
770
|
+
* are consumer-rendered siblings, so panel transitions read the token
|
|
771
|
+
* from the consumer's own container (set it there or scope the
|
|
772
|
+
* provider around a styled wrapper).
|
|
773
|
+
* @default 150 (CSS fallback; not written to the DOM)
|
|
522
774
|
*/
|
|
523
775
|
animationDuration?: number;
|
|
524
776
|
}
|
|
@@ -563,6 +815,14 @@ declare const CNGX_NAV_CONFIG: InjectionToken<CngxNavConfig>;
|
|
|
563
815
|
* @category common/interactive
|
|
564
816
|
*/
|
|
565
817
|
declare function provideNavConfig(...features: NavConfigFeature[]): Provider[];
|
|
818
|
+
/**
|
|
819
|
+
* Component-scoped variant - use in `viewProviders` so the nav config
|
|
820
|
+
* only applies to descendants of this component. Same feature merge as
|
|
821
|
+
* {@link provideNavConfig}.
|
|
822
|
+
*
|
|
823
|
+
* @category common/interactive
|
|
824
|
+
*/
|
|
825
|
+
declare function provideNavConfigAt(...features: NavConfigFeature[]): Provider[];
|
|
566
826
|
/**
|
|
567
827
|
* Enables single-accordion mode - only one nav group can be open at a time.
|
|
568
828
|
*
|
|
@@ -652,7 +912,7 @@ declare class CngxDisclosure {
|
|
|
652
912
|
readonly opened: _angular_core.Signal<boolean>;
|
|
653
913
|
/** Emitted when the opened state changes. */
|
|
654
914
|
readonly openedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
655
|
-
/** Opens the disclosure. */
|
|
915
|
+
/** Opens the disclosure. No-op when already open (parity with `close()`). */
|
|
656
916
|
open(): void;
|
|
657
917
|
/** Closes the disclosure. */
|
|
658
918
|
close(): void;
|
|
@@ -717,6 +977,8 @@ declare class CngxNavGroup {
|
|
|
717
977
|
readonly depth: _angular_core.InputSignal<number>;
|
|
718
978
|
private readonly registry;
|
|
719
979
|
private readonly config;
|
|
980
|
+
protected readonly navIndent: string | null;
|
|
981
|
+
protected readonly navTransition: string | null;
|
|
720
982
|
constructor();
|
|
721
983
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxNavGroup, never>;
|
|
722
984
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxNavGroup, "[cngxNavGroup]", ["cngxNavGroup"], { "depth": { "alias": "depth"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof CngxDisclosure; inputs: { "cngxDisclosureOpened": "cngxDisclosureOpened"; "controls": "controls"; }; outputs: { "openedChange": "openedChange"; }; }]>;
|
|
@@ -836,6 +1098,9 @@ declare class CngxNavLabel {
|
|
|
836
1098
|
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>
|
|
837
1099
|
*/
|
|
838
1100
|
declare class CngxNavLink {
|
|
1101
|
+
private readonly config;
|
|
1102
|
+
protected readonly navIndent: string | null;
|
|
1103
|
+
protected readonly navTransition: string | null;
|
|
839
1104
|
/**
|
|
840
1105
|
* `true` when the host `<a>` lacks an `href` attribute and needs `tabindex="0"`
|
|
841
1106
|
* + `role="link"` for keyboard focusability.
|
|
@@ -845,6 +1110,11 @@ declare class CngxNavLink {
|
|
|
845
1110
|
*/
|
|
846
1111
|
readonly needsFocusFix: _angular_core.WritableSignal<boolean>;
|
|
847
1112
|
private readonly initialized;
|
|
1113
|
+
private readonly locale;
|
|
1114
|
+
/** Link text read after the first render; `null` when the consumer set `data-initial`. */
|
|
1115
|
+
private readonly initialSource;
|
|
1116
|
+
/** First character of the link text, uppercased with the app locale. */
|
|
1117
|
+
private readonly initial;
|
|
848
1118
|
constructor();
|
|
849
1119
|
/** Whether this link is the currently active route/item. */
|
|
850
1120
|
readonly active: _angular_core.InputSignal<boolean>;
|
|
@@ -1067,6 +1337,17 @@ declare class CngxHoverIntent {
|
|
|
1067
1337
|
constructor();
|
|
1068
1338
|
protected handleEnter(): void;
|
|
1069
1339
|
protected handleLeave(): void;
|
|
1340
|
+
/**
|
|
1341
|
+
* Feed a satellite element's `pointerenter` into the debounce. For hosts
|
|
1342
|
+
* whose hover surface spans more than the directive's own element (a submenu
|
|
1343
|
+
* parent item plus its popover panel), forward the extra element's pointer
|
|
1344
|
+
* events here so ONE debounced intent covers the combined surface: an enter
|
|
1345
|
+
* on either element cancels a pending leave timer exactly like the host's
|
|
1346
|
+
* own listeners, so crossing the gap between the elements never flickers.
|
|
1347
|
+
*/
|
|
1348
|
+
notifyEnter(): void;
|
|
1349
|
+
/** Satellite counterpart to {@link notifyEnter} for `pointerleave`. */
|
|
1350
|
+
notifyLeave(): void;
|
|
1070
1351
|
private schedule;
|
|
1071
1352
|
private clearPending;
|
|
1072
1353
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxHoverIntent, never>;
|
|
@@ -1144,9 +1425,16 @@ interface CngxSliderCoreOptions {
|
|
|
1144
1425
|
readonly boundedMax?: Signal<number>;
|
|
1145
1426
|
/**
|
|
1146
1427
|
* Maps the current value to an `aria-valuetext` string (currency, dates,
|
|
1147
|
-
* t-shirt sizes). When omitted, `aria-valuetext` mirrors the numeric value
|
|
1428
|
+
* t-shirt sizes). When omitted, `aria-valuetext` mirrors the numeric value,
|
|
1429
|
+
* formatted in {@link CngxSliderCoreOptions.locale} when one is given.
|
|
1148
1430
|
*/
|
|
1149
1431
|
readonly valueText?: (value: number) => string;
|
|
1432
|
+
/**
|
|
1433
|
+
* Locale of the default `aria-valuetext` (no grouping, locale decimal
|
|
1434
|
+
* separator). The slider directives pass `injectLocale()`. When omitted,
|
|
1435
|
+
* the default is `String(value)`.
|
|
1436
|
+
*/
|
|
1437
|
+
readonly locale?: Signal<string>;
|
|
1150
1438
|
}
|
|
1151
1439
|
/**
|
|
1152
1440
|
* Derived view and write surface produced by {@link createSliderCore}. All
|
|
@@ -1201,6 +1489,192 @@ interface CngxSliderCore {
|
|
|
1201
1489
|
*/
|
|
1202
1490
|
declare function createSliderCore(options: CngxSliderCoreOptions): CngxSliderCore;
|
|
1203
1491
|
|
|
1492
|
+
/**
|
|
1493
|
+
* Options for {@link injectInteractiveGroupHost}.
|
|
1494
|
+
*
|
|
1495
|
+
* @category common/interactive
|
|
1496
|
+
*/
|
|
1497
|
+
interface CngxInteractiveGroupHostOptions {
|
|
1498
|
+
/**
|
|
1499
|
+
* Prefix handed to `nextUid()` for the stable host id, e.g.
|
|
1500
|
+
* `'cngx-checkbox-group-'`.
|
|
1501
|
+
*/
|
|
1502
|
+
readonly uidPrefix: string;
|
|
1503
|
+
/**
|
|
1504
|
+
* The host's `invalid` model. `ariaInvalid` ORs it with the resolved
|
|
1505
|
+
* `errorState` so bridge-driven validity and the field-host/aggregator
|
|
1506
|
+
* cascade share one derivation.
|
|
1507
|
+
*/
|
|
1508
|
+
readonly invalid: Signal<boolean>;
|
|
1509
|
+
/**
|
|
1510
|
+
* Optional explicit `[state]` input of the host. When it holds a value,
|
|
1511
|
+
* it wins over a discovered ancestor `CNGX_STATEFUL`; when absent or
|
|
1512
|
+
* `undefined`, the discovered fallback applies.
|
|
1513
|
+
*/
|
|
1514
|
+
readonly state?: Signal<CngxAsyncState<unknown> | undefined>;
|
|
1515
|
+
/**
|
|
1516
|
+
* Optional explicit accessible-name input of the host (emitted as
|
|
1517
|
+
* `aria-label`). While it holds a non-empty value,
|
|
1518
|
+
* {@link CngxInteractiveGroupHost.ariaLabelledBy} yields `null` so the
|
|
1519
|
+
* explicit name is not overridden - `aria-labelledby` beats
|
|
1520
|
+
* `aria-label` in accname precedence.
|
|
1521
|
+
*/
|
|
1522
|
+
readonly label?: Signal<string | undefined>;
|
|
1523
|
+
/**
|
|
1524
|
+
* Optional explicit `aria-labelledby` input of the host. When set, it
|
|
1525
|
+
* wins over the automatic field-label reference - the consumer decides
|
|
1526
|
+
* which element names the group.
|
|
1527
|
+
*/
|
|
1528
|
+
readonly labelledBy?: Signal<string | undefined>;
|
|
1529
|
+
}
|
|
1530
|
+
/**
|
|
1531
|
+
* The scaffolding bundle {@link injectInteractiveGroupHost} returns. Hosts
|
|
1532
|
+
* re-export the fields they surface publicly (`id`, `focused`,
|
|
1533
|
+
* `errorState`) and delegate their `focusin`/`focusout` host listeners to
|
|
1534
|
+
* the handler pair.
|
|
1535
|
+
*
|
|
1536
|
+
* @category common/interactive
|
|
1537
|
+
*/
|
|
1538
|
+
interface CngxInteractiveGroupHost {
|
|
1539
|
+
/** Stable unique host id, prefixed per {@link CngxInteractiveGroupHostOptions.uidPrefix}. */
|
|
1540
|
+
readonly id: Signal<string>;
|
|
1541
|
+
/** `true` while focus is inside the host subtree. */
|
|
1542
|
+
readonly focused: Signal<boolean>;
|
|
1543
|
+
/**
|
|
1544
|
+
* Field-host to aggregator cascade. Inside `<cngx-form-field>` the
|
|
1545
|
+
* form-field's `showError()` decides; outside a form-field but inside
|
|
1546
|
+
* an `CngxErrorAggregator` the aggregator's `shouldShow()` decides;
|
|
1547
|
+
* standalone it stays `false`.
|
|
1548
|
+
*/
|
|
1549
|
+
readonly errorState: Signal<boolean>;
|
|
1550
|
+
/** `invalid() || errorState()` - the shared `aria-invalid` gate. */
|
|
1551
|
+
readonly ariaInvalid: Signal<boolean>;
|
|
1552
|
+
/**
|
|
1553
|
+
* Resolved `aria-labelledby` reference. An explicit `labelledBy` option
|
|
1554
|
+
* always wins; otherwise the surrounding field's `labelId` applies -
|
|
1555
|
+
* only inside a `cngx-form-field` whose host exposes it and while the
|
|
1556
|
+
* explicit `label` option is empty. Group roles take no name from
|
|
1557
|
+
* content - this channel names them inside a field.
|
|
1558
|
+
*/
|
|
1559
|
+
readonly ariaLabelledBy: Signal<string | null>;
|
|
1560
|
+
/**
|
|
1561
|
+
* Effective async state: the explicit `state` option wins over a
|
|
1562
|
+
* discovered ancestor `CNGX_STATEFUL`.
|
|
1563
|
+
*/
|
|
1564
|
+
readonly resolvedState: Signal<CngxAsyncState<unknown> | undefined>;
|
|
1565
|
+
/** `true` while the resolved state reports `status() === 'loading'`. */
|
|
1566
|
+
readonly ariaBusy: Signal<boolean>;
|
|
1567
|
+
/** Bind to the host's `(focusin)` listener. */
|
|
1568
|
+
handleFocusIn(): void;
|
|
1569
|
+
/** Bind to the host's `(focusout)` listener; marks the surrounding field as touched. */
|
|
1570
|
+
handleFocusOut(): void;
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* Shared scaffolding for the interactive form-control hosts (toggle,
|
|
1574
|
+
* checkbox, the standalone interactive chip, and the value groups):
|
|
1575
|
+
* stable uid, focus tracking, the
|
|
1576
|
+
* field-host/aggregator error cascade, the `aria-invalid` gate, and
|
|
1577
|
+
* `[state]`-wins-over-`CNGX_STATEFUL` async-state resolution for
|
|
1578
|
+
* `aria-busy`.
|
|
1579
|
+
*
|
|
1580
|
+
* Call from a field initializer (injection context required - the factory
|
|
1581
|
+
* injects `CNGX_FORM_FIELD_HOST`, `CNGX_ERROR_AGGREGATOR`, and
|
|
1582
|
+
* `CNGX_STATEFUL`, each optional). Declare the `invalid` model and the
|
|
1583
|
+
* `state` input above the call site so the option signals exist when the
|
|
1584
|
+
* initializer runs.
|
|
1585
|
+
*
|
|
1586
|
+
* The factory is wiring, not a swap point: it deliberately has no DI
|
|
1587
|
+
* factory token. Consumers authoring their own form-control atoms get the
|
|
1588
|
+
* same field-host, aggregator, and stateful integration by calling it
|
|
1589
|
+
* directly.
|
|
1590
|
+
*
|
|
1591
|
+
* All host communication stays reactive (Pillar 2): `errorState`,
|
|
1592
|
+
* `ariaInvalid`, and `ariaBusy` are `computed()` members of the returned
|
|
1593
|
+
* bundle. `resolvedState` forwards a stable reference (the bound input
|
|
1594
|
+
* value or the provider's `state` field, never a fresh literal), so
|
|
1595
|
+
* `Object.is` dedupes without an `equal` fn.
|
|
1596
|
+
*
|
|
1597
|
+
* ```ts
|
|
1598
|
+
* private readonly groupHost = injectInteractiveGroupHost({
|
|
1599
|
+
* uidPrefix: 'cngx-checkbox-group-',
|
|
1600
|
+
* invalid: this.invalid,
|
|
1601
|
+
* state: this.state,
|
|
1602
|
+
* });
|
|
1603
|
+
* readonly id = this.groupHost.id;
|
|
1604
|
+
* readonly focused = this.groupHost.focused;
|
|
1605
|
+
* readonly errorState = this.groupHost.errorState;
|
|
1606
|
+
* protected readonly ariaBusy = this.groupHost.ariaBusy;
|
|
1607
|
+
* ```
|
|
1608
|
+
*
|
|
1609
|
+
* @category common/interactive
|
|
1610
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/group-host/group-host.ts
|
|
1611
|
+
* @since 0.1.0
|
|
1612
|
+
* @relatedTo CngxToggle, CngxCheckbox, CngxChipInteraction, CngxCheckboxGroup, CngxRadioGroup, CngxButtonToggleGroup, CngxButtonMultiToggleGroup, CngxChipGroup, CngxMultiChipGroup
|
|
1613
|
+
*/
|
|
1614
|
+
declare function injectInteractiveGroupHost(options: CngxInteractiveGroupHostOptions): CngxInteractiveGroupHost;
|
|
1615
|
+
|
|
1616
|
+
/**
|
|
1617
|
+
* Options for {@link injectMenuItemCore}.
|
|
1618
|
+
*
|
|
1619
|
+
* @category common/interactive/menu
|
|
1620
|
+
*/
|
|
1621
|
+
interface CngxMenuItemCoreOptions<T = unknown> {
|
|
1622
|
+
/** The item's payload value, forwarded to `highlightByValue`. */
|
|
1623
|
+
readonly value: Signal<T | undefined>;
|
|
1624
|
+
/** Disabled state - gates click activation and pointer highlight. */
|
|
1625
|
+
readonly disabled: Signal<boolean>;
|
|
1626
|
+
/** Explicit label input; `label()` falls back to the host's text content. */
|
|
1627
|
+
readonly labelInput: Signal<string | undefined>;
|
|
1628
|
+
/**
|
|
1629
|
+
* Variant activation step, run between `highlightByValue` and
|
|
1630
|
+
* `activateCurrent` on the active-descendant path only (checkbox:
|
|
1631
|
+
* toggle `checked`; radio: select in the group; plain item: omitted).
|
|
1632
|
+
*/
|
|
1633
|
+
readonly onActivate?: () => void;
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* The shared interaction bundle {@link injectMenuItemCore} returns. Menu
|
|
1637
|
+
* item variants re-export `id`/`isHighlighted`/`label` (their
|
|
1638
|
+
* `CngxAdItemHandle` surface) and delegate their host listeners to the
|
|
1639
|
+
* handler pair.
|
|
1640
|
+
*
|
|
1641
|
+
* @category common/interactive/menu
|
|
1642
|
+
*/
|
|
1643
|
+
interface CngxMenuItemCore {
|
|
1644
|
+
/** Stable unique item id used for `aria-activedescendant` targeting. */
|
|
1645
|
+
readonly id: string;
|
|
1646
|
+
/** `true` while the surrounding active-descendant highlights this item. */
|
|
1647
|
+
readonly isHighlighted: Signal<boolean>;
|
|
1648
|
+
/** Label accessor: explicit input wins over the host's trimmed text content. */
|
|
1649
|
+
label(): string;
|
|
1650
|
+
/** Bind to the host's `(click)` listener. */
|
|
1651
|
+
handleClick(): void;
|
|
1652
|
+
/** Bind to the host's `(pointerenter)` listener. */
|
|
1653
|
+
handlePointerEnter(): void;
|
|
1654
|
+
}
|
|
1655
|
+
/**
|
|
1656
|
+
* Shared interaction core of the three menu item variants
|
|
1657
|
+
* (`CngxMenuItem`, `CngxMenuItemCheckbox`, `CngxMenuItemRadio`) -
|
|
1658
|
+
* previously a tripled block. Owns the AD registration surface
|
|
1659
|
+
* (`id`, `isHighlighted`, `label`), the disabled-aware click handler with
|
|
1660
|
+
* the announcer's `itemDisabled` phrase, and the pointer-highlight
|
|
1661
|
+
* handler; only the activation step stays per-variant via `onActivate`.
|
|
1662
|
+
*
|
|
1663
|
+
* Call from a field initializer (injection context required - the core
|
|
1664
|
+
* injects `ElementRef`, the optional surrounding `CngxActiveDescendant`,
|
|
1665
|
+
* the announcer factory, and the menu config). Interaction contract,
|
|
1666
|
+
* preserved verbatim from the variants: a disabled click announces and
|
|
1667
|
+
* stops; without a surrounding active-descendant a click is a complete
|
|
1668
|
+
* no-op (no `onActivate` either); on the AD path the order is
|
|
1669
|
+
* `highlightByValue` -> `onActivate` -> `activateCurrent`.
|
|
1670
|
+
*
|
|
1671
|
+
* @category common/interactive/menu
|
|
1672
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-core.ts
|
|
1673
|
+
* @since 0.1.0
|
|
1674
|
+
* @relatedTo CngxMenuItem, CngxMenuItemCheckbox, CngxMenuItemRadio, CngxMenu
|
|
1675
|
+
*/
|
|
1676
|
+
declare function injectMenuItemCore<T = unknown>(options: CngxMenuItemCoreOptions<T>): CngxMenuItemCore;
|
|
1677
|
+
|
|
1204
1678
|
/**
|
|
1205
1679
|
* Tick stops from `min` to `max` stepping by `step`, for rendering tick marks +
|
|
1206
1680
|
* labels. Returns `[]` when the step grid is invalid or denser than `maxCount`
|
|
@@ -1229,6 +1703,16 @@ interface CngxSliderInteraction {
|
|
|
1229
1703
|
handlePointerUp(event: PointerEvent): void;
|
|
1230
1704
|
}
|
|
1231
1705
|
|
|
1706
|
+
/** Reactive surface {@link createSliderDisabledReason} hands back to the track. */
|
|
1707
|
+
interface CngxSliderDisabledReason {
|
|
1708
|
+
/**
|
|
1709
|
+
* `aria-describedby` value for the track host: the internal reason id
|
|
1710
|
+
* while `disabled && reason` applies, else the consumer passthrough id,
|
|
1711
|
+
* else `null`.
|
|
1712
|
+
*/
|
|
1713
|
+
readonly resolvedDescribedBy: Signal<string | null>;
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1232
1716
|
/**
|
|
1233
1717
|
* Headless single-thumb slider brain. Put `cngxSliderTrack` on your own track
|
|
1234
1718
|
* element and the directive turns it into an APG-conformant `role="slider"`:
|
|
@@ -1276,13 +1760,34 @@ declare class CngxSliderTrack {
|
|
|
1276
1760
|
* larger of one step and a tenth of the range.
|
|
1277
1761
|
*/
|
|
1278
1762
|
readonly largeStep: _angular_core.InputSignal<number | undefined>;
|
|
1279
|
-
/**
|
|
1280
|
-
|
|
1763
|
+
/**
|
|
1764
|
+
* Whether the slider is disabled (blocks keyboard and pointer, `tabindex=-1`).
|
|
1765
|
+
* A `ModelSignal` so form-field bridges can drive it programmatically,
|
|
1766
|
+
* mirroring the checkbox/toggle family's bridge write path.
|
|
1767
|
+
*/
|
|
1768
|
+
readonly disabled: _angular_core.ModelSignal<boolean>;
|
|
1769
|
+
/**
|
|
1770
|
+
* Consumer-supplied "why" for the disabled state (no library default per
|
|
1771
|
+
* the EN-defaults rule). Announced via an sr-only span the directive
|
|
1772
|
+
* appends to the host; both the span's visibility and the host's
|
|
1773
|
+
* `aria-describedby` reference are gated on `disabled() &&
|
|
1774
|
+
* disabledReason()` (Toggle/Radio convergence).
|
|
1775
|
+
*/
|
|
1776
|
+
readonly disabledReason: _angular_core.InputSignal<string>;
|
|
1777
|
+
/**
|
|
1778
|
+
* Optional consumer-supplied id of an external description element.
|
|
1779
|
+
* Consumers bind via `[cngxDescribedBy]="someId"` - same surface as
|
|
1780
|
+
* `CngxChipInteraction`. The active disabled-reason wins.
|
|
1781
|
+
*/
|
|
1782
|
+
readonly describedBy: _angular_core.InputSignal<string | null>;
|
|
1281
1783
|
/** Track axis. Drives `aria-orientation` and the pointer-to-fraction math. */
|
|
1282
1784
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
1283
1785
|
/** Optional `aria-valuetext` formatter (currency, dates, named stops). */
|
|
1284
1786
|
readonly valueText: _angular_core.InputSignal<((value: number) => string) | undefined>;
|
|
1285
1787
|
private readonly el;
|
|
1788
|
+
private readonly locale;
|
|
1789
|
+
/** Disabled-"why" span + gated `aria-describedby` resolution. */
|
|
1790
|
+
protected readonly reason: CngxSliderDisabledReason;
|
|
1286
1791
|
/** Shared value/step/aria derivation. */
|
|
1287
1792
|
protected readonly core: _cngx_common_interactive.CngxSliderCore;
|
|
1288
1793
|
/** Thumb position along the track in `[0, 1]`. For a skin to read. */
|
|
@@ -1295,7 +1800,7 @@ declare class CngxSliderTrack {
|
|
|
1295
1800
|
/** Shared keyboard + pointer-drag handlers (same factory the range thumb uses). */
|
|
1296
1801
|
protected readonly interaction: CngxSliderInteraction;
|
|
1297
1802
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSliderTrack, never>;
|
|
1298
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSliderTrack, "[cngxSliderTrack]", ["cngxSliderTrack"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "largeStep": { "alias": "largeStep"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "valueText": { "alias": "valueText"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
1803
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSliderTrack, "[cngxSliderTrack]", ["cngxSliderTrack"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "largeStep": { "alias": "largeStep"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "required": false; "isSignal": true; }; "describedBy": { "alias": "cngxDescribedBy"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "valueText": { "alias": "valueText"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
1299
1804
|
}
|
|
1300
1805
|
|
|
1301
1806
|
/**
|
|
@@ -1341,10 +1846,14 @@ declare class CngxSlider {
|
|
|
1341
1846
|
protected readonly brain: CngxSliderTrack;
|
|
1342
1847
|
/** Tick marks + labels derivation (shared factory). */
|
|
1343
1848
|
protected readonly ticks: CngxSliderTicksView;
|
|
1344
|
-
|
|
1849
|
+
private readonly locale;
|
|
1850
|
+
/**
|
|
1851
|
+
* Format a value through the bound `valueText` (so tick labels match the
|
|
1852
|
+
* thumb), else with the app locale's number format.
|
|
1853
|
+
*/
|
|
1345
1854
|
protected format(value: number): string;
|
|
1346
1855
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSlider, never>;
|
|
1347
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSlider, "cngx-slider", ["cngxSlider"], { "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "showValueBubble": { "alias": "showValueBubble"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "showTickLabels": { "alias": "showTickLabels"; "required": false; "isSignal": true; }; "thumbGlyph": { "alias": "thumbGlyph"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof CngxSliderTrack; inputs: { "value": "value"; "min": "min"; "max": "max"; "step": "step"; "largeStep": "largeStep"; "disabled": "disabled"; "orientation": "orientation"; "valueText": "valueText"; }; outputs: { "valueChange": "valueChange"; }; }]>;
|
|
1856
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxSlider, "cngx-slider", ["cngxSlider"], { "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "showValueBubble": { "alias": "showValueBubble"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "showTickLabels": { "alias": "showTickLabels"; "required": false; "isSignal": true; }; "thumbGlyph": { "alias": "thumbGlyph"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof CngxSliderTrack; inputs: { "value": "value"; "min": "min"; "max": "max"; "step": "step"; "largeStep": "largeStep"; "disabled": "disabled"; "disabledReason": "disabledReason"; "cngxDescribedBy": "cngxDescribedBy"; "orientation": "orientation"; "valueText": "valueText"; }; outputs: { "valueChange": "valueChange"; }; }]>;
|
|
1348
1857
|
}
|
|
1349
1858
|
|
|
1350
1859
|
/** Which end of a range slider a {@link CngxSliderThumb} drives. */
|
|
@@ -1451,12 +1960,32 @@ declare class CngxRangeSliderTrack implements CngxSliderRangeHost {
|
|
|
1451
1960
|
* Defaults to the larger of one step and a tenth of the range.
|
|
1452
1961
|
*/
|
|
1453
1962
|
readonly largeStep: _angular_core.InputSignal<number | undefined>;
|
|
1454
|
-
/**
|
|
1455
|
-
|
|
1963
|
+
/**
|
|
1964
|
+
* Whether the range slider is disabled. A `ModelSignal` so form-field
|
|
1965
|
+
* bridges can drive it programmatically, mirroring the checkbox/toggle
|
|
1966
|
+
* family's bridge write path.
|
|
1967
|
+
*/
|
|
1968
|
+
readonly disabled: _angular_core.ModelSignal<boolean>;
|
|
1969
|
+
/**
|
|
1970
|
+
* Consumer-supplied "why" for the disabled state (no library default per
|
|
1971
|
+
* the EN-defaults rule). Announced via an sr-only span the directive
|
|
1972
|
+
* appends to the group host; both the span's visibility and the host's
|
|
1973
|
+
* `aria-describedby` reference are gated on `disabled() &&
|
|
1974
|
+
* disabledReason()` (Toggle/Radio convergence).
|
|
1975
|
+
*/
|
|
1976
|
+
readonly disabledReason: _angular_core.InputSignal<string>;
|
|
1977
|
+
/**
|
|
1978
|
+
* Optional consumer-supplied id of an external description element.
|
|
1979
|
+
* Consumers bind via `[cngxDescribedBy]="someId"` - same surface as
|
|
1980
|
+
* `CngxChipInteraction`. The active disabled-reason wins.
|
|
1981
|
+
*/
|
|
1982
|
+
readonly describedBy: _angular_core.InputSignal<string | null>;
|
|
1456
1983
|
/** Track axis shared by both thumbs. */
|
|
1457
1984
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
1458
1985
|
/** Optional `aria-valuetext` formatter shared across both thumbs. */
|
|
1459
1986
|
readonly valueText: _angular_core.InputSignal<((value: number) => string) | undefined>;
|
|
1987
|
+
/** Disabled-"why" span + gated `aria-describedby` resolution. */
|
|
1988
|
+
protected readonly reason: CngxSliderDisabledReason;
|
|
1460
1989
|
private readonly startBounds;
|
|
1461
1990
|
private readonly endBounds;
|
|
1462
1991
|
private readonly el;
|
|
@@ -1467,7 +1996,7 @@ declare class CngxRangeSliderTrack implements CngxSliderRangeHost {
|
|
|
1467
1996
|
commit(position: CngxSliderThumbPosition, value: number): void;
|
|
1468
1997
|
fractionFromPointer(clientX: number, clientY: number): number;
|
|
1469
1998
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxRangeSliderTrack, never>;
|
|
1470
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxRangeSliderTrack, "[cngxRangeSliderTrack]", ["cngxRangeSliderTrack"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "largeStep": { "alias": "largeStep"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "valueText": { "alias": "valueText"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
1999
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxRangeSliderTrack, "[cngxRangeSliderTrack]", ["cngxRangeSliderTrack"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "largeStep": { "alias": "largeStep"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "required": false; "isSignal": true; }; "describedBy": { "alias": "cngxDescribedBy"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "valueText": { "alias": "valueText"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; }, never, never, true, never>;
|
|
1471
2000
|
}
|
|
1472
2001
|
|
|
1473
2002
|
/**
|
|
@@ -1495,10 +2024,20 @@ declare class CngxRangeSliderTrack implements CngxSliderRangeHost {
|
|
|
1495
2024
|
* @relatedTo CngxRangeSliderTrack, CngxSlider, CngxSliderThumb
|
|
1496
2025
|
*/
|
|
1497
2026
|
declare class CngxRangeSlider {
|
|
1498
|
-
|
|
1499
|
-
readonly
|
|
1500
|
-
/**
|
|
1501
|
-
|
|
2027
|
+
private readonly i18n;
|
|
2028
|
+
private readonly locale;
|
|
2029
|
+
/**
|
|
2030
|
+
* Accessible name of the start (minimum) thumb. Unbound, it follows
|
|
2031
|
+
* `CNGX_INTERACTIVE_I18N.rangeMinimum`.
|
|
2032
|
+
*/
|
|
2033
|
+
readonly startLabel: _angular_core.InputSignal<string | undefined>;
|
|
2034
|
+
/**
|
|
2035
|
+
* Accessible name of the end (maximum) thumb. Unbound, it follows
|
|
2036
|
+
* `CNGX_INTERACTIVE_I18N.rangeMaximum`.
|
|
2037
|
+
*/
|
|
2038
|
+
readonly endLabel: _angular_core.InputSignal<string | undefined>;
|
|
2039
|
+
protected readonly resolvedStartLabel: _angular_core.Signal<string>;
|
|
2040
|
+
protected readonly resolvedEndLabel: _angular_core.Signal<string>;
|
|
1502
2041
|
/** Render the formatted `start - end` values centred between the thumbs (visual only). */
|
|
1503
2042
|
readonly showValue: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
1504
2043
|
/** Show the combined `start - end` value as a bubble only while focused / dragged. */
|
|
@@ -1515,9 +2054,15 @@ declare class CngxRangeSlider {
|
|
|
1515
2054
|
protected readonly midFraction: _angular_core.Signal<number>;
|
|
1516
2055
|
/** Tick marks + labels derivation (shared factory). */
|
|
1517
2056
|
protected readonly ticks: CngxSliderTicksView;
|
|
2057
|
+
/** The visible `start - end` value, ordered and joined by the `rangeValue` message. */
|
|
2058
|
+
protected readonly rangeValueText: _angular_core.Signal<string>;
|
|
2059
|
+
/**
|
|
2060
|
+
* Format a value through the bound `valueText` (so tick labels match the
|
|
2061
|
+
* thumbs), else with the app locale's number format.
|
|
2062
|
+
*/
|
|
1518
2063
|
protected format(value: number): string;
|
|
1519
2064
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxRangeSlider, never>;
|
|
1520
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxRangeSlider, "cngx-range-slider", ["cngxRangeSlider"], { "startLabel": { "alias": "startLabel"; "required": false; "isSignal": true; }; "endLabel": { "alias": "endLabel"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "showValueBubble": { "alias": "showValueBubble"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "showTickLabels": { "alias": "showTickLabels"; "required": false; "isSignal": true; }; "thumbGlyph": { "alias": "thumbGlyph"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof CngxRangeSliderTrack; inputs: { "value": "value"; "min": "min"; "max": "max"; "step": "step"; "largeStep": "largeStep"; "disabled": "disabled"; "orientation": "orientation"; "valueText": "valueText"; }; outputs: { "valueChange": "valueChange"; }; }]>;
|
|
2065
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxRangeSlider, "cngx-range-slider", ["cngxRangeSlider"], { "startLabel": { "alias": "startLabel"; "required": false; "isSignal": true; }; "endLabel": { "alias": "endLabel"; "required": false; "isSignal": true; }; "showValue": { "alias": "showValue"; "required": false; "isSignal": true; }; "showValueBubble": { "alias": "showValueBubble"; "required": false; "isSignal": true; }; "showTicks": { "alias": "showTicks"; "required": false; "isSignal": true; }; "showTickLabels": { "alias": "showTickLabels"; "required": false; "isSignal": true; }; "thumbGlyph": { "alias": "thumbGlyph"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof CngxRangeSliderTrack; inputs: { "value": "value"; "min": "min"; "max": "max"; "step": "step"; "largeStep": "largeStep"; "disabled": "disabled"; "disabledReason": "disabledReason"; "cngxDescribedBy": "cngxDescribedBy"; "orientation": "orientation"; "valueText": "valueText"; }; outputs: { "valueChange": "valueChange"; }; }]>;
|
|
1521
2066
|
}
|
|
1522
2067
|
|
|
1523
2068
|
/**
|
|
@@ -1542,6 +2087,7 @@ declare class CngxSliderThumb {
|
|
|
1542
2087
|
readonly position: _angular_core.InputSignal<CngxSliderThumbPosition>;
|
|
1543
2088
|
protected readonly range: CngxSliderRangeHost;
|
|
1544
2089
|
private readonly el;
|
|
2090
|
+
private readonly locale;
|
|
1545
2091
|
/** Sibling-clamped bounds for this thumb, selected reactively by position. */
|
|
1546
2092
|
protected readonly bounds: Signal<_cngx_common_interactive.CngxSliderThumbBounds>;
|
|
1547
2093
|
private readonly value;
|
|
@@ -1796,7 +2342,7 @@ declare class CngxAccordionPanel implements OnInit {
|
|
|
1796
2342
|
protected readonly tabindex: _angular_core.Signal<0 | -1>;
|
|
1797
2343
|
ngOnInit(): void;
|
|
1798
2344
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
1799
|
-
protected
|
|
2345
|
+
protected handleClick(): void;
|
|
1800
2346
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAccordionPanel, never>;
|
|
1801
2347
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxAccordionPanel, "[cngxAccordionPanel]", ["cngxAccordionPanel"], { "panelId": { "alias": "panelId"; "required": true; "isSignal": true; }; "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1802
2348
|
}
|
|
@@ -1898,8 +2444,13 @@ declare const CNGX_BREADCRUMB: InjectionToken<CngxBreadcrumbHost>;
|
|
|
1898
2444
|
* <example-url>http://localhost:4200/#/common/interactive/breadcrumb/basic-trail</example-url>
|
|
1899
2445
|
*/
|
|
1900
2446
|
declare class CngxBreadcrumb implements CngxBreadcrumbHost {
|
|
1901
|
-
|
|
1902
|
-
|
|
2447
|
+
private readonly i18n;
|
|
2448
|
+
/**
|
|
2449
|
+
* Accessible name of the navigation landmark. Unbound, it follows
|
|
2450
|
+
* `CNGX_INTERACTIVE_I18N.breadcrumb`, including a runtime language switch.
|
|
2451
|
+
*/
|
|
2452
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
2453
|
+
protected readonly resolvedLabel: _angular_core.Signal<string>;
|
|
1903
2454
|
/** Maximum crumbs to show before the middle collapses. Unset = never collapse. */
|
|
1904
2455
|
readonly maxVisible: _angular_core.InputSignal<number | undefined>;
|
|
1905
2456
|
/** Swappable collapse rule; defaults to keep-first + last (max - 1). */
|
|
@@ -1978,41 +2529,6 @@ declare function createBreadcrumbCollapse(): CngxBreadcrumbCollapseStrategy;
|
|
|
1978
2529
|
*/
|
|
1979
2530
|
declare const CNGX_BREADCRUMB_COLLAPSE_STRATEGY: InjectionToken<CngxBreadcrumbCollapseStrategy>;
|
|
1980
2531
|
|
|
1981
|
-
/**
|
|
1982
|
-
* One width breakpoint for the responsive breadcrumb collapse: at `minWidth`
|
|
1983
|
-
* pixels and above, show at most `maxVisible` crumbs before the middle folds
|
|
1984
|
-
* into the overflow menu. A tier list is resolved by {@link resolveBreadcrumbTier}.
|
|
1985
|
-
*/
|
|
1986
|
-
interface CngxBreadcrumbWidthTier {
|
|
1987
|
-
/** Lower bound (inclusive, px) at which this tier's `maxVisible` applies. */
|
|
1988
|
-
readonly minWidth: number;
|
|
1989
|
-
/** Crumb cap once this tier is the active one. Fed to the count-based collapse. */
|
|
1990
|
-
readonly maxVisible: number;
|
|
1991
|
-
}
|
|
1992
|
-
/**
|
|
1993
|
-
* Default width tiers, matching the headless `responsive-collapse` recipe: 640px
|
|
1994
|
-
* and up shows 6, 440px and up shows 4, anything narrower shows 2. The `0` floor
|
|
1995
|
-
* guarantees a match for every non-negative width.
|
|
1996
|
-
*/
|
|
1997
|
-
declare const DEFAULT_BREADCRUMB_WIDTH_TIERS: readonly CngxBreadcrumbWidthTier[];
|
|
1998
|
-
/**
|
|
1999
|
-
* Pure width->count resolver: returns the `maxVisible` of the tier with the
|
|
2000
|
-
* highest `minWidth` that is still `<= width`. Order-independent - the tier list
|
|
2001
|
-
* is normalised (sorted by descending `minWidth`) before matching, so a consumer
|
|
2002
|
-
* may pass tiers in any order. When `width` sits below every tier's `minWidth`
|
|
2003
|
-
* the narrowest tier's `maxVisible` is the floor; an empty tier list yields
|
|
2004
|
-
* `Number.POSITIVE_INFINITY` (never collapse), leaving the trail intact.
|
|
2005
|
-
*
|
|
2006
|
-
* No DOM, no Angular - the width source (a `CngxResizeObserver`) lives in the
|
|
2007
|
-
* bar; this stays jsdom-testable and shared by the bar and the headless recipe.
|
|
2008
|
-
*
|
|
2009
|
-
* @category common/interactive/breadcrumb
|
|
2010
|
-
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/breadcrumb/breadcrumb-responsive.ts
|
|
2011
|
-
* @since 0.1.0
|
|
2012
|
-
* @relatedTo CngxBreadcrumb, CngxBreadcrumbWidthTier, DEFAULT_BREADCRUMB_WIDTH_TIERS
|
|
2013
|
-
*/
|
|
2014
|
-
declare function resolveBreadcrumbTier(width: number, tiers: readonly CngxBreadcrumbWidthTier[]): number;
|
|
2015
|
-
|
|
2016
2532
|
/**
|
|
2017
2533
|
* Single-value boolean switch with W3C `role="switch"` semantics. Click,
|
|
2018
2534
|
* Space, and Enter all flip `value`; the directive form (`[cngxToggle]`)
|
|
@@ -2028,11 +2544,13 @@ declare function resolveBreadcrumbTier(width: number, tiers: readonly CngxBreadc
|
|
|
2028
2544
|
* one direction.
|
|
2029
2545
|
*
|
|
2030
2546
|
* `disabledReason` is consumer-supplied free text (no library default
|
|
2031
|
-
* per `feedback_en_default_locale`)
|
|
2032
|
-
*
|
|
2033
|
-
*
|
|
2034
|
-
*
|
|
2035
|
-
*
|
|
2547
|
+
* per `feedback_en_default_locale`). Per Pillar 2 the description span is
|
|
2548
|
+
* always in the DOM, but both its `aria-hidden` and the host's
|
|
2549
|
+
* `aria-describedby` reference are gated on `disabled() && disabledReason()`,
|
|
2550
|
+
* so a reason set on an enabled control announces nothing and stays out of
|
|
2551
|
+
* reading order. Gating the reference alone is not enough: accname 1.2 §2A
|
|
2552
|
+
* traverses a directly-referenced hidden node, so the span's visibility must
|
|
2553
|
+
* track the same condition as the reference.
|
|
2036
2554
|
*
|
|
2037
2555
|
* Typical usage prefers the `<div>`/`<cngx-toggle>` element form because
|
|
2038
2556
|
* `role="switch"` on a native `<button>` would conflict with the
|
|
@@ -2112,15 +2630,13 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
2112
2630
|
*/
|
|
2113
2631
|
protected readonly hasProjectedLabel: _angular_core.Signal<boolean>;
|
|
2114
2632
|
constructor();
|
|
2633
|
+
private readonly groupHost;
|
|
2115
2634
|
/** Stable per-instance id used for `<label for>` wiring. */
|
|
2116
2635
|
readonly id: _angular_core.Signal<string>;
|
|
2117
|
-
private readonly focusedState;
|
|
2118
2636
|
/** Whether the host element currently has DOM focus. */
|
|
2119
2637
|
readonly focused: _angular_core.Signal<boolean>;
|
|
2120
2638
|
/** True when the toggle is `false` (off) - boolean atom semantics. */
|
|
2121
2639
|
readonly empty: _angular_core.Signal<boolean>;
|
|
2122
|
-
private readonly fieldHost;
|
|
2123
|
-
private readonly aggregator;
|
|
2124
2640
|
/**
|
|
2125
2641
|
* Field-host→aggregator cascade. Inside `<cngx-form-field>` the
|
|
2126
2642
|
* presenter governs visibility (touched / strategy / scope). Outside
|
|
@@ -2161,8 +2677,11 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
2161
2677
|
*
|
|
2162
2678
|
* `aria-checked` is a reactive computed: `indeterminate() ? 'mixed' :
|
|
2163
2679
|
* value() ? 'true' : 'false'`. The description span for
|
|
2164
|
-
* `disabledReason` follows the same always
|
|
2165
|
-
* `
|
|
2680
|
+
* `disabledReason` follows the same rule as `CngxToggle`: always in the
|
|
2681
|
+
* DOM, but both its `aria-hidden` and the host's `aria-describedby`
|
|
2682
|
+
* reference are gated on `disabled() && disabledReason()`, so a reason
|
|
2683
|
+
* set on an enabled checkbox announces nothing and stays out of reading
|
|
2684
|
+
* order.
|
|
2166
2685
|
*
|
|
2167
2686
|
* ```html
|
|
2168
2687
|
* <cngx-checkbox [(value)]="acceptTerms">I accept the terms</cngx-checkbox>
|
|
@@ -2206,7 +2725,7 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
2206
2725
|
* Optional id of an external error message element (e.g. a sibling
|
|
2207
2726
|
* rendered by `<cngx-form-field>` or a consumer-owned `<span>`).
|
|
2208
2727
|
* The host emits `aria-errormessage="<id>"` only when
|
|
2209
|
-
* `aria-invalid="true"`
|
|
2728
|
+
* `aria-invalid="true"` - symmetric with the sibling `aria-invalid`
|
|
2210
2729
|
* host binding (both gate on `invalid() || errorState()`). Consumers
|
|
2211
2730
|
* MUST render an element with the supplied id; passing an id without
|
|
2212
2731
|
* a matching element produces a dangling AT reference. Default
|
|
@@ -2217,6 +2736,13 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
2217
2736
|
readonly checkGlyph: _angular_core.InputSignal<TemplateRef<void> | null>;
|
|
2218
2737
|
readonly dashGlyph: _angular_core.InputSignal<TemplateRef<void> | null>;
|
|
2219
2738
|
protected readonly describedId: string;
|
|
2739
|
+
/**
|
|
2740
|
+
* `aria-describedby` reference, gated on `disabled() && disabledReason()`
|
|
2741
|
+
* (Toggle/Radio convergence): accname 1.2 §2A traverses a directly
|
|
2742
|
+
* referenced hidden node, so the id must only be emitted while the
|
|
2743
|
+
* description applies.
|
|
2744
|
+
*/
|
|
2745
|
+
protected readonly describedById: _angular_core.Signal<string | null>;
|
|
2220
2746
|
private readonly rovingParent;
|
|
2221
2747
|
/**
|
|
2222
2748
|
* When inside a `CngxRovingTabindex` parent (typically `CngxCheckboxGroup`),
|
|
@@ -2226,8 +2752,8 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
2226
2752
|
*/
|
|
2227
2753
|
protected readonly hostTabindex: _angular_core.Signal<number | null>;
|
|
2228
2754
|
protected readonly ariaChecked: _angular_core.Signal<"true" | "false" | "mixed">;
|
|
2755
|
+
private readonly groupHost;
|
|
2229
2756
|
readonly id: _angular_core.Signal<string>;
|
|
2230
|
-
private readonly focusedState;
|
|
2231
2757
|
readonly focused: _angular_core.Signal<boolean>;
|
|
2232
2758
|
/**
|
|
2233
2759
|
* Empty when value is `false` AND not in tri-state intermediate. An
|
|
@@ -2235,8 +2761,6 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
2235
2761
|
* count as empty for forms purposes.
|
|
2236
2762
|
*/
|
|
2237
2763
|
readonly empty: _angular_core.Signal<boolean>;
|
|
2238
|
-
private readonly fieldHost;
|
|
2239
|
-
private readonly aggregator;
|
|
2240
2764
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
2241
2765
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
2242
2766
|
protected handleClick(): void;
|
|
@@ -2289,7 +2813,9 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
2289
2813
|
* `[state]` is an optional `CngxAsyncState<unknown>` input; when bound,
|
|
2290
2814
|
* `aria-busy` reflects `state.status() === 'loading'` reactively so AT
|
|
2291
2815
|
* announces the busy moment without the consumer wiring the attribute
|
|
2292
|
-
* by hand.
|
|
2816
|
+
* by hand. Without an explicit binding the group discovers an ancestor
|
|
2817
|
+
* `CNGX_STATEFUL` provider as fallback - the input always wins when
|
|
2818
|
+
* both are present.
|
|
2293
2819
|
*
|
|
2294
2820
|
* ```html
|
|
2295
2821
|
* <cngx-checkbox-group
|
|
@@ -2331,7 +2857,7 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
2331
2857
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
2332
2858
|
/**
|
|
2333
2859
|
* Optional id of an external error message element. The host emits
|
|
2334
|
-
* `aria-errormessage="<id>"` only when `aria-invalid="true"`
|
|
2860
|
+
* `aria-errormessage="<id>"` only when `aria-invalid="true"` -
|
|
2335
2861
|
* symmetric with the sibling `aria-invalid` host binding (both gate
|
|
2336
2862
|
* on `invalid() || errorState()`). Consumers MUST render an element
|
|
2337
2863
|
* with the supplied id. Default `null` skips the attribute.
|
|
@@ -2339,8 +2865,20 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
2339
2865
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
2340
2866
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
2341
2867
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
2868
|
+
/**
|
|
2869
|
+
* Explicit `aria-labelledby` target id. Wins over the automatic
|
|
2870
|
+
* field-label reference applied inside a `cngx-form-field`.
|
|
2871
|
+
*/
|
|
2872
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
2342
2873
|
readonly allValues: _angular_core.InputSignal<readonly T[] | undefined>;
|
|
2343
|
-
|
|
2874
|
+
/**
|
|
2875
|
+
* Optional async state driving `aria-busy`. An explicit binding wins;
|
|
2876
|
+
* when it is absent or `undefined`, an ancestor `CNGX_STATEFUL`
|
|
2877
|
+
* provider is discovered as fallback. A bare `state` attribute (empty
|
|
2878
|
+
* string) is treated as unset. `aria-busy` reflects
|
|
2879
|
+
* `status() === 'loading'`.
|
|
2880
|
+
*/
|
|
2881
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
2344
2882
|
readonly keyFn: _angular_core.InputSignal<(value: T) => unknown>;
|
|
2345
2883
|
private readonly controller;
|
|
2346
2884
|
constructor();
|
|
@@ -2348,23 +2886,22 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
2348
2886
|
readonly noneSelected: _angular_core.Signal<boolean>;
|
|
2349
2887
|
readonly allSelected: _angular_core.Signal<boolean>;
|
|
2350
2888
|
readonly someSelected: _angular_core.Signal<boolean>;
|
|
2889
|
+
private readonly groupHost;
|
|
2890
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
|
|
2351
2891
|
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
2352
2892
|
toggleAll(): void;
|
|
2353
2893
|
select(value: T): void;
|
|
2354
2894
|
deselect(value: T): void;
|
|
2355
2895
|
readonly id: _angular_core.Signal<string>;
|
|
2356
|
-
private readonly focusedState;
|
|
2357
2896
|
readonly focused: _angular_core.Signal<boolean>;
|
|
2358
2897
|
/** Empty when no values selected. */
|
|
2359
2898
|
readonly empty: _angular_core.Signal<boolean>;
|
|
2360
|
-
private readonly fieldHost;
|
|
2361
|
-
private readonly aggregator;
|
|
2362
2899
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
2363
2900
|
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
2364
2901
|
protected handleFocusIn(): void;
|
|
2365
2902
|
protected handleFocusOut(): void;
|
|
2366
2903
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCheckboxGroup<any>, never>;
|
|
2367
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCheckboxGroup<any>, "cngx-checkbox-group, [cngxCheckboxGroup]", ["cngxCheckboxGroup"], { "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "allValues": { "alias": "allValues"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; }, { "selectedValues": "selectedValuesChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
2904
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCheckboxGroup<any>, "cngx-checkbox-group, [cngxCheckboxGroup]", ["cngxCheckboxGroup"], { "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "allValues": { "alias": "allValues"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; }, { "selectedValues": "selectedValuesChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
2368
2905
|
}
|
|
2369
2906
|
|
|
2370
2907
|
/**
|
|
@@ -2407,7 +2944,7 @@ interface CngxButtonToggleGroupContract<T = unknown> {
|
|
|
2407
2944
|
* The leaf injects this token AND `CNGX_BUTTON_MULTI_TOGGLE_GROUP`
|
|
2408
2945
|
* with `{ optional: true }` on both; the present token determines the
|
|
2409
2946
|
* leaf's keyboard semantics + ARIA pattern (`aria-checked` for single,
|
|
2410
|
-
* `aria-
|
|
2947
|
+
* `aria-pressed` for multi), chosen at injection time, NOT at
|
|
2411
2948
|
* runtime - there is no `[selectionMode]` flag.
|
|
2412
2949
|
*
|
|
2413
2950
|
* @category common/interactive
|
|
@@ -2484,29 +3021,40 @@ declare class CngxButtonToggleGroup<T = unknown> implements CngxButtonToggleGrou
|
|
|
2484
3021
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
2485
3022
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
2486
3023
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
2487
|
-
|
|
2488
|
-
|
|
3024
|
+
/**
|
|
3025
|
+
* Explicit `aria-labelledby` target id. Wins over the automatic
|
|
3026
|
+
* field-label reference applied inside a `cngx-form-field`.
|
|
3027
|
+
*/
|
|
3028
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
3029
|
+
/**
|
|
3030
|
+
* Optional async state driving `aria-busy`. An explicit binding wins;
|
|
3031
|
+
* when it is absent or `undefined`, an ancestor `CNGX_STATEFUL`
|
|
3032
|
+
* provider is discovered as fallback. A bare `state` attribute (empty
|
|
3033
|
+
* string) is treated as unset. `aria-busy` reflects
|
|
3034
|
+
* `status() === 'loading'`.
|
|
3035
|
+
*/
|
|
3036
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
2489
3037
|
private readonly roving;
|
|
2490
3038
|
consumePendingArrowSelect(value: T): boolean;
|
|
3039
|
+
private readonly groupHost;
|
|
3040
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
|
|
3041
|
+
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
2491
3042
|
readonly id: _angular_core.Signal<string>;
|
|
2492
|
-
private readonly focusedState;
|
|
2493
3043
|
readonly focused: _angular_core.Signal<boolean>;
|
|
2494
3044
|
/** Empty when no toggle is selected. */
|
|
2495
3045
|
readonly empty: _angular_core.Signal<boolean>;
|
|
2496
|
-
private readonly fieldHost;
|
|
2497
|
-
private readonly aggregator;
|
|
2498
3046
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
2499
3047
|
protected handleFocusIn(): void;
|
|
2500
3048
|
protected handleFocusOut(): void;
|
|
2501
3049
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxButtonToggleGroup<any>, never>;
|
|
2502
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxButtonToggleGroup<any>, "cngx-button-toggle-group, [cngxButtonToggleGroup]", ["cngxButtonToggleGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
3050
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxButtonToggleGroup<any>, "cngx-button-toggle-group, [cngxButtonToggleGroup]", ["cngxButtonToggleGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
2503
3051
|
}
|
|
2504
3052
|
|
|
2505
3053
|
/**
|
|
2506
3054
|
* Multi-select parent contract every `CngxButtonMultiToggleGroup`
|
|
2507
3055
|
* provides via `useExisting`. `CngxButtonToggle` leaves that detect
|
|
2508
3056
|
* a multi-mode parent (via `inject(CNGX_BUTTON_MULTI_TOGGLE_GROUP, {
|
|
2509
|
-
* optional: true })`) bind `aria-
|
|
3057
|
+
* optional: true })`) bind `aria-pressed` (toolbar APG) instead of
|
|
2510
3058
|
* `aria-checked` (radiogroup APG) AT INJECTION TIME. Mode is static
|
|
2511
3059
|
* per atom instance - there is no `[selectionMode]` flag.
|
|
2512
3060
|
*
|
|
@@ -2517,7 +3065,7 @@ declare class CngxButtonToggleGroup<T = unknown> implements CngxButtonToggleGrou
|
|
|
2517
3065
|
*
|
|
2518
3066
|
* `isSelected(value)` returns the per-value membership signal from
|
|
2519
3067
|
* the group's internal `SelectionController` so the leaf can render
|
|
2520
|
-
* `aria-
|
|
3068
|
+
* `aria-pressed` reactively without re-querying the array on every
|
|
2521
3069
|
* keystroke. The signal identity is stable per value (per
|
|
2522
3070
|
* `createSelectionController` contract) - safe to read inside a
|
|
2523
3071
|
* `computed()` on the leaf.
|
|
@@ -2564,7 +3112,7 @@ declare const CNGX_BUTTON_MULTI_TOGGLE_GROUP: InjectionToken<CngxButtonMultiTogg
|
|
|
2564
3112
|
* `feedback_select_family_split`). Consumers pick this component or
|
|
2565
3113
|
* `<cngx-button-toggle-group>` at template authoring time. Leaves
|
|
2566
3114
|
* (`CngxButtonToggle`) inject EITHER token with `{ optional: true }`
|
|
2567
|
-
* and choose `aria-checked` (single) vs `aria-
|
|
3115
|
+
* and choose `aria-checked` (single) vs `aria-pressed` (multi)
|
|
2568
3116
|
* AT INJECTION TIME, never at runtime.
|
|
2569
3117
|
*
|
|
2570
3118
|
* Internals lean on `createSelectionController` from
|
|
@@ -2621,25 +3169,36 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
2621
3169
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
2622
3170
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
2623
3171
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
2624
|
-
|
|
3172
|
+
/**
|
|
3173
|
+
* Explicit `aria-labelledby` target id. Wins over the automatic
|
|
3174
|
+
* field-label reference applied inside a `cngx-form-field`.
|
|
3175
|
+
*/
|
|
3176
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
3177
|
+
/**
|
|
3178
|
+
* Optional async state driving `aria-busy`. An explicit binding wins;
|
|
3179
|
+
* when it is absent or `undefined`, an ancestor `CNGX_STATEFUL`
|
|
3180
|
+
* provider is discovered as fallback. A bare `state` attribute (empty
|
|
3181
|
+
* string) is treated as unset. `aria-busy` reflects
|
|
3182
|
+
* `status() === 'loading'`.
|
|
3183
|
+
*/
|
|
3184
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
2625
3185
|
readonly keyFn: _angular_core.InputSignal<(value: T) => unknown>;
|
|
2626
|
-
protected readonly ariaBusy: Signal<boolean>;
|
|
2627
3186
|
private readonly controller;
|
|
2628
3187
|
constructor();
|
|
2629
3188
|
isSelected(value: T): Signal<boolean>;
|
|
2630
3189
|
toggle(value: T): void;
|
|
3190
|
+
private readonly groupHost;
|
|
3191
|
+
protected readonly ariaLabelledBy: Signal<string | null>;
|
|
3192
|
+
protected readonly ariaBusy: Signal<boolean>;
|
|
2631
3193
|
readonly id: Signal<string>;
|
|
2632
|
-
private readonly focusedState;
|
|
2633
3194
|
readonly focused: Signal<boolean>;
|
|
2634
3195
|
/** Empty when no toggles are selected. */
|
|
2635
3196
|
readonly empty: Signal<boolean>;
|
|
2636
|
-
private readonly fieldHost;
|
|
2637
|
-
private readonly aggregator;
|
|
2638
3197
|
readonly errorState: Signal<boolean>;
|
|
2639
3198
|
protected handleFocusIn(): void;
|
|
2640
3199
|
protected handleFocusOut(): void;
|
|
2641
3200
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxButtonMultiToggleGroup<any>, never>;
|
|
2642
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxButtonMultiToggleGroup<any>, "cngx-button-multi-toggle-group, [cngxButtonMultiToggleGroup]", ["cngxButtonMultiToggleGroup"], { "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; }, { "selectedValues": "selectedValuesChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
3201
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxButtonMultiToggleGroup<any>, "cngx-button-multi-toggle-group, [cngxButtonMultiToggleGroup]", ["cngxButtonMultiToggleGroup"], { "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; }, { "selectedValues": "selectedValuesChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
2643
3202
|
}
|
|
2644
3203
|
|
|
2645
3204
|
/**
|
|
@@ -2660,8 +3219,12 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
2660
3219
|
*
|
|
2661
3220
|
* The present token determines:
|
|
2662
3221
|
*
|
|
2663
|
-
* - the ARIA pattern
|
|
2664
|
-
*
|
|
3222
|
+
* - the ARIA pattern, bound on the host AT INJECTION TIME: a single leaf
|
|
3223
|
+
* takes `role="radio"` + `aria-checked` (radiogroup APG); a multi leaf
|
|
3224
|
+
* stays a native `role="button"` toggle with `aria-pressed` (toolbar
|
|
3225
|
+
* APG). Both `aria-checked` and the listbox `selected` state are
|
|
3226
|
+
* undefined for `role="button"` in ARIA 1.2, so the single leaf carries
|
|
3227
|
+
* the radio role that makes `aria-checked` valid rather than dropped,
|
|
2665
3228
|
* - the activation contract (single: `group.value.set(...)`; multi:
|
|
2666
3229
|
* `group.toggle(...)`),
|
|
2667
3230
|
* - whether `(focus)` consumes the parent's pending arrow-select
|
|
@@ -2718,8 +3281,9 @@ declare class CngxButtonToggle<T = unknown> {
|
|
|
2718
3281
|
readonly describedBy: _angular_core.InputSignal<string | null>;
|
|
2719
3282
|
protected readonly toggleChecked: _angular_core.Signal<boolean>;
|
|
2720
3283
|
protected readonly toggleDisabled: _angular_core.Signal<boolean>;
|
|
3284
|
+
protected readonly hostRole: _angular_core.Signal<"radio" | null>;
|
|
2721
3285
|
protected readonly ariaChecked: _angular_core.Signal<"true" | "false" | null>;
|
|
2722
|
-
protected readonly
|
|
3286
|
+
protected readonly ariaPressed: _angular_core.Signal<"true" | "false" | null>;
|
|
2723
3287
|
protected handleFocus(): void;
|
|
2724
3288
|
protected handleSelect(): void;
|
|
2725
3289
|
protected handleKeydown(event: Event): void;
|
|
@@ -2872,20 +3436,31 @@ declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>,
|
|
|
2872
3436
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
2873
3437
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
2874
3438
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
2875
|
-
|
|
3439
|
+
/**
|
|
3440
|
+
* Explicit `aria-labelledby` target id. Wins over the automatic
|
|
3441
|
+
* field-label reference applied inside a `cngx-form-field`.
|
|
3442
|
+
*/
|
|
3443
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
3444
|
+
/**
|
|
3445
|
+
* Optional async state driving `aria-busy`. An explicit binding wins;
|
|
3446
|
+
* when it is absent or `undefined`, an ancestor `CNGX_STATEFUL`
|
|
3447
|
+
* provider is discovered as fallback. A bare `state` attribute (empty
|
|
3448
|
+
* string) is treated as unset. `aria-busy` reflects
|
|
3449
|
+
* `status() === 'loading'`.
|
|
3450
|
+
*/
|
|
3451
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
2876
3452
|
readonly nameInput: _angular_core.InputSignal<string | undefined>;
|
|
2877
|
-
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
2878
3453
|
private readonly fallbackName;
|
|
2879
3454
|
readonly name: _angular_core.Signal<string>;
|
|
2880
3455
|
private readonly registry;
|
|
2881
3456
|
private readonly roving;
|
|
3457
|
+
private readonly groupHost;
|
|
3458
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
|
|
3459
|
+
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
2882
3460
|
readonly id: _angular_core.Signal<string>;
|
|
2883
|
-
private readonly focusedState;
|
|
2884
3461
|
readonly focused: _angular_core.Signal<boolean>;
|
|
2885
3462
|
/** Empty when no radio is selected. */
|
|
2886
3463
|
readonly empty: _angular_core.Signal<boolean>;
|
|
2887
|
-
private readonly fieldHost;
|
|
2888
|
-
private readonly aggregator;
|
|
2889
3464
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
2890
3465
|
constructor();
|
|
2891
3466
|
register(radio: CngxRadioRegistration<T>): void;
|
|
@@ -2894,7 +3469,7 @@ declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>,
|
|
|
2894
3469
|
protected handleFocusIn(): void;
|
|
2895
3470
|
protected handleFocusOut(): void;
|
|
2896
3471
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxRadioGroup<any>, never>;
|
|
2897
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxRadioGroup<any>, "cngx-radio-group, [cngxRadioGroup]", ["cngxRadioGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "nameInput": { "alias": "name"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: {}; outputs: {}; }]>;
|
|
3472
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxRadioGroup<any>, "cngx-radio-group, [cngxRadioGroup]", ["cngxRadioGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "nameInput": { "alias": "name"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: {}; outputs: {}; }]>;
|
|
2898
3473
|
}
|
|
2899
3474
|
|
|
2900
3475
|
/**
|
|
@@ -2956,6 +3531,16 @@ declare class CngxRadio<T = unknown> {
|
|
|
2956
3531
|
protected readonly describedId: string;
|
|
2957
3532
|
protected readonly radioChecked: _angular_core.Signal<boolean>;
|
|
2958
3533
|
protected readonly radioDisabled: _angular_core.Signal<boolean>;
|
|
3534
|
+
/**
|
|
3535
|
+
* `aria-describedby` reference to the reason span, gated on
|
|
3536
|
+
* `radioDisabled() && disabledReason()` - the effective disabled state
|
|
3537
|
+
* (`aria-disabled` reflects the same signal), so a reason set on an
|
|
3538
|
+
* enabled leaf announces nothing while a group-disabled leaf still
|
|
3539
|
+
* surfaces its reason. Gating on the per-leaf `disabled()` alone would
|
|
3540
|
+
* drop the announcement when the parent group disables the leaf. accname
|
|
3541
|
+
* 1.2 §2A traverses a directly-referenced hidden node, so the span's
|
|
3542
|
+
* `aria-hidden` tracks the same condition.
|
|
3543
|
+
*/
|
|
2959
3544
|
protected readonly describedById: _angular_core.Signal<string | null>;
|
|
2960
3545
|
constructor();
|
|
2961
3546
|
protected handleFocus(): void;
|
|
@@ -3057,13 +3642,16 @@ declare const CNGX_CHIP_GROUP_HOST: InjectionToken<CngxChipGroupHost<unknown>>;
|
|
|
3057
3642
|
* toggle does not double-fire alongside the chip's `(remove)`
|
|
3058
3643
|
* output.
|
|
3059
3644
|
*
|
|
3060
|
-
* **Disabled "why".**
|
|
3061
|
-
*
|
|
3062
|
-
*
|
|
3063
|
-
* `
|
|
3064
|
-
*
|
|
3065
|
-
*
|
|
3066
|
-
*
|
|
3645
|
+
* **Disabled "why".** The directive appends a hidden span to the host
|
|
3646
|
+
* via `Renderer2` (always-in-DOM per Pillar 2 - the id stays stable
|
|
3647
|
+
* across renders). Both the span's `aria-hidden` and the host's
|
|
3648
|
+
* `aria-describedby` reference are gated on `disabled() &&
|
|
3649
|
+
* disabledReason()` (Toggle/Radio convergence): a reason set on an
|
|
3650
|
+
* enabled chip announces nothing and stays out of reading order.
|
|
3651
|
+
* Outside that state, consumers may still pass a custom id via
|
|
3652
|
+
* `cngxDescribedBy` and the `aria-describedby` host binding routes to
|
|
3653
|
+
* that. The two paths are mutually exclusive: the active
|
|
3654
|
+
* disabled-reason wins.
|
|
3067
3655
|
*
|
|
3068
3656
|
* ```html
|
|
3069
3657
|
* <cngx-chip cngxChipInteraction [value]="'red'" [(selected)]="redOn">
|
|
@@ -3147,13 +3735,11 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
3147
3735
|
readonly removeRequest: _angular_core.OutputEmitterRef<void>;
|
|
3148
3736
|
private readonly describedId;
|
|
3149
3737
|
protected readonly resolvedDescribedBy: _angular_core.Signal<string | null>;
|
|
3738
|
+
private readonly groupHost;
|
|
3150
3739
|
readonly id: _angular_core.Signal<string>;
|
|
3151
|
-
private readonly focusedState;
|
|
3152
3740
|
readonly focused: _angular_core.Signal<boolean>;
|
|
3153
3741
|
/** Empty when the chip is unselected - boolean atom semantics. */
|
|
3154
3742
|
readonly empty: _angular_core.Signal<boolean>;
|
|
3155
|
-
private readonly fieldHost;
|
|
3156
|
-
private readonly errorAggregator;
|
|
3157
3743
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
3158
3744
|
constructor();
|
|
3159
3745
|
protected handleClick(event: MouseEvent): void;
|
|
@@ -3334,25 +3920,36 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
3334
3920
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
3335
3921
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
3336
3922
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
3337
|
-
|
|
3923
|
+
/**
|
|
3924
|
+
* Explicit `aria-labelledby` target id. Wins over the automatic
|
|
3925
|
+
* field-label reference applied inside a `cngx-form-field`.
|
|
3926
|
+
*/
|
|
3927
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
3928
|
+
/**
|
|
3929
|
+
* Optional async state driving `aria-busy`. An explicit binding wins;
|
|
3930
|
+
* when it is absent or `undefined`, an ancestor `CNGX_STATEFUL`
|
|
3931
|
+
* provider is discovered as fallback. A bare `state` attribute (empty
|
|
3932
|
+
* string) is treated as unset. `aria-busy` reflects
|
|
3933
|
+
* `status() === 'loading'`.
|
|
3934
|
+
*/
|
|
3935
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
3338
3936
|
/** CngxChipGroupHost - leaf-side cascade source. */
|
|
3339
3937
|
readonly isDisabled: _angular_core.ModelSignal<boolean>;
|
|
3938
|
+
private readonly groupHost;
|
|
3939
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
|
|
3340
3940
|
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
3341
3941
|
isSelected(value: T): boolean;
|
|
3342
3942
|
toggle(value: T): void;
|
|
3343
3943
|
remove(value: T): void;
|
|
3344
3944
|
readonly id: _angular_core.Signal<string>;
|
|
3345
|
-
private readonly focusedState;
|
|
3346
3945
|
readonly focused: _angular_core.Signal<boolean>;
|
|
3347
3946
|
/** Empty when no chip is selected. */
|
|
3348
3947
|
readonly empty: _angular_core.Signal<boolean>;
|
|
3349
|
-
private readonly fieldHost;
|
|
3350
|
-
private readonly errorAggregator;
|
|
3351
3948
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
3352
3949
|
protected handleFocusIn(): void;
|
|
3353
3950
|
protected handleFocusOut(): void;
|
|
3354
3951
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxChipGroup<any>, never>;
|
|
3355
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxChipGroup<any>, "cngx-chip-group, [cngxChipGroup]", ["cngxChipGroup"], { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
3952
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxChipGroup<any>, "cngx-chip-group, [cngxChipGroup]", ["cngxChipGroup"], { "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; }, { "selected": "selectedChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
3356
3953
|
}
|
|
3357
3954
|
|
|
3358
3955
|
/**
|
|
@@ -3456,11 +4053,25 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
3456
4053
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
3457
4054
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
3458
4055
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
3459
|
-
|
|
4056
|
+
/**
|
|
4057
|
+
* Explicit `aria-labelledby` target id. Wins over the automatic
|
|
4058
|
+
* field-label reference applied inside a `cngx-form-field`.
|
|
4059
|
+
*/
|
|
4060
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
4061
|
+
/**
|
|
4062
|
+
* Optional async state driving `aria-busy`. An explicit binding wins;
|
|
4063
|
+
* when it is absent or `undefined`, an ancestor `CNGX_STATEFUL`
|
|
4064
|
+
* provider is discovered as fallback. A bare `state` attribute (empty
|
|
4065
|
+
* string) is treated as unset. `aria-busy` reflects
|
|
4066
|
+
* `status() === 'loading'`.
|
|
4067
|
+
*/
|
|
4068
|
+
readonly state: _angular_core.InputSignalWithTransform<CngxAsyncState<unknown> | undefined, "" | CngxAsyncState<unknown> | undefined>;
|
|
3460
4069
|
readonly keyFn: _angular_core.InputSignal<(value: T) => unknown>;
|
|
3461
4070
|
/** CngxChipGroupHost - leaf-side cascade source. */
|
|
3462
4071
|
readonly isDisabled: _angular_core.ModelSignal<boolean>;
|
|
3463
4072
|
private readonly controller;
|
|
4073
|
+
private readonly groupHost;
|
|
4074
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
|
|
3464
4075
|
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
3465
4076
|
/** Public membership count - useful for label hints + announcements. */
|
|
3466
4077
|
readonly selectedCount: _angular_core.Signal<number>;
|
|
@@ -3469,17 +4080,14 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
3469
4080
|
toggle(value: T): void;
|
|
3470
4081
|
remove(value: T): void;
|
|
3471
4082
|
readonly id: _angular_core.Signal<string>;
|
|
3472
|
-
private readonly focusedState;
|
|
3473
4083
|
readonly focused: _angular_core.Signal<boolean>;
|
|
3474
4084
|
/** Empty when no chips are selected. */
|
|
3475
4085
|
readonly empty: _angular_core.Signal<boolean>;
|
|
3476
|
-
private readonly fieldHost;
|
|
3477
|
-
private readonly errorAggregator;
|
|
3478
4086
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
3479
4087
|
protected handleFocusIn(): void;
|
|
3480
4088
|
protected handleFocusOut(): void;
|
|
3481
4089
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMultiChipGroup<any>, never>;
|
|
3482
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMultiChipGroup<any>, "cngx-multi-chip-group, [cngxMultiChipGroup]", ["cngxMultiChipGroup"], { "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; }, { "selectedValues": "selectedValuesChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
4090
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxMultiChipGroup<any>, "cngx-multi-chip-group, [cngxMultiChipGroup]", ["cngxMultiChipGroup"], { "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "keyFn": { "alias": "keyFn"; "required": false; "isSignal": true; }; }, { "selectedValues": "selectedValuesChange"; "disabled": "disabledChange"; "required": "requiredChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingTabindex; inputs: { "orientation": "orientation"; }; outputs: {}; }]>;
|
|
3483
4091
|
}
|
|
3484
4092
|
|
|
3485
4093
|
/**
|
|
@@ -3662,8 +4270,9 @@ interface CngxTreeControllerOptions<T> {
|
|
|
3662
4270
|
* the call in `untracked(() => ctrl.parentOf(id))`.
|
|
3663
4271
|
*
|
|
3664
4272
|
* ## Mutations
|
|
3665
|
-
* All mutators (`expand`, `collapse`, `toggle`, `
|
|
3666
|
-
* peek at the expansion set via `untracked()` so invoking
|
|
4273
|
+
* All mutators (`expand`, `collapse`, `toggle`, `reveal`, `expandAll`,
|
|
4274
|
+
* `collapseAll`) peek at the expansion set via `untracked()` so invoking
|
|
4275
|
+
* them from
|
|
3667
4276
|
* inside an `effect()` never latches that effect onto the expansion set.
|
|
3668
4277
|
*
|
|
3669
4278
|
* @category common/interactive/tree
|
|
@@ -3700,6 +4309,13 @@ interface CngxTreeController<T> {
|
|
|
3700
4309
|
expand(id: string): void;
|
|
3701
4310
|
collapse(id: string): void;
|
|
3702
4311
|
toggle(id: string): void;
|
|
4312
|
+
/**
|
|
4313
|
+
* Expand every ancestor of `id` so the node becomes visible. The node's
|
|
4314
|
+
* own expansion state stays untouched. No-op for unknown ids, for
|
|
4315
|
+
* root-level nodes, and when every ancestor is already expanded (the
|
|
4316
|
+
* expansion set keeps its reference in that case).
|
|
4317
|
+
*/
|
|
4318
|
+
reveal(id: string): void;
|
|
3703
4319
|
/** Expand every node that has children. No-op when already fully expanded. */
|
|
3704
4320
|
expandAll(): void;
|
|
3705
4321
|
collapseAll(): void;
|
|
@@ -3720,9 +4336,9 @@ interface CngxTreeController<T> {
|
|
|
3720
4336
|
* - Existing signal bindings created before destroy keep working - the
|
|
3721
4337
|
* underlying `expandedIds` signal is still live, so downstream updates
|
|
3722
4338
|
* continue to propagate.
|
|
3723
|
-
* - Mutators (`expand` / `collapse` / `toggle` / `
|
|
3724
|
-
* `collapseAll`) continue to function; post-destroy
|
|
3725
|
-
* repopulate the cache.
|
|
4339
|
+
* - Mutators (`expand` / `collapse` / `toggle` / `reveal` /
|
|
4340
|
+
* `expandAll` / `collapseAll`) continue to function; post-destroy
|
|
4341
|
+
* writes do NOT repopulate the cache.
|
|
3726
4342
|
*
|
|
3727
4343
|
* Idempotent. Prefer this over a hard teardown so long-lived consumer
|
|
3728
4344
|
* bindings that outlive the controller's active phase degrade
|
|
@@ -3998,6 +4614,7 @@ declare class CngxHierarchicalNav<T = unknown> {
|
|
|
3998
4614
|
readonly controller: _angular_core.InputSignal<CngxTreeController<T>>;
|
|
3999
4615
|
private readonly ad;
|
|
4000
4616
|
private readonly strategy;
|
|
4617
|
+
private readonly direction;
|
|
4001
4618
|
/** Emitted with the id that was just expanded via ArrowRight. */
|
|
4002
4619
|
readonly expand: _angular_core.OutputEmitterRef<string>;
|
|
4003
4620
|
/** Emitted with the id that was just collapsed via ArrowLeft. */
|
|
@@ -4006,8 +4623,14 @@ declare class CngxHierarchicalNav<T = unknown> {
|
|
|
4006
4623
|
readonly movedToParent: _angular_core.OutputEmitterRef<string>;
|
|
4007
4624
|
/** Emitted with the id of the child the active-descendant moved to. */
|
|
4008
4625
|
readonly movedToChild: _angular_core.OutputEmitterRef<string>;
|
|
4009
|
-
handleRight(event: Event): void;
|
|
4010
|
-
handleLeft(event: Event): void;
|
|
4626
|
+
protected handleRight(event: Event): void;
|
|
4627
|
+
protected handleLeft(event: Event): void;
|
|
4628
|
+
/**
|
|
4629
|
+
* Resolve the physical arrow to its inline-logical intent before routing:
|
|
4630
|
+
* under `rtl` physical ArrowLeft expands / moves-to-child and physical
|
|
4631
|
+
* ArrowRight collapses / moves-to-parent. The strategy stays direction-naive.
|
|
4632
|
+
*/
|
|
4633
|
+
private handlePhysicalArrow;
|
|
4011
4634
|
/**
|
|
4012
4635
|
* Shared guard + action-dispatch wrapper. Degrades silently when AD
|
|
4013
4636
|
* isn't composed on the host or nothing is highlighted.
|
|
@@ -4087,6 +4710,13 @@ interface CngxHierarchicalNavStrategy {
|
|
|
4087
4710
|
* `'noop'` when it didn't - so consumers bound to `(movedToChild)` /
|
|
4088
4711
|
* `(movedToParent)` only see state-change-truthful emissions.
|
|
4089
4712
|
*
|
|
4713
|
+
* `onArrowRight` / `onArrowLeft` are the inline-forward / inline-back
|
|
4714
|
+
* intents, not physical keys. `CngxHierarchicalNav` resolves the physical
|
|
4715
|
+
* arrow to its logical intent by writing direction (`resolveInlineArrowKey`)
|
|
4716
|
+
* before calling the strategy, so under `rtl` physical ArrowLeft routes to
|
|
4717
|
+
* `onArrowRight`. Custom strategies stay direction-naive and inherit correct
|
|
4718
|
+
* RTL behaviour for free.
|
|
4719
|
+
*
|
|
4090
4720
|
* @category common/interactive/tree
|
|
4091
4721
|
*/
|
|
4092
4722
|
declare function createW3CTreeStrategy(): CngxHierarchicalNavStrategy;
|
|
@@ -4124,7 +4754,7 @@ declare function createW3CTreeStrategy(): CngxHierarchicalNavStrategy;
|
|
|
4124
4754
|
declare const CNGX_HIERARCHICAL_NAV_STRATEGY: InjectionToken<CngxHierarchicalNavStrategy>;
|
|
4125
4755
|
|
|
4126
4756
|
/**
|
|
4127
|
-
* Configuration for `
|
|
4757
|
+
* Configuration for `createRetry()`.
|
|
4128
4758
|
*
|
|
4129
4759
|
* @category common/interactive/retry
|
|
4130
4760
|
*/
|
|
@@ -4137,7 +4767,7 @@ interface RetryConfig {
|
|
|
4137
4767
|
backoff?: 'linear' | 'exponential';
|
|
4138
4768
|
}
|
|
4139
4769
|
/**
|
|
4140
|
-
* State exposed by the retryable action
|
|
4770
|
+
* State exposed by the retryable action - read-only signals for UI feedback.
|
|
4141
4771
|
*
|
|
4142
4772
|
* @category common/interactive/retry
|
|
4143
4773
|
*/
|
|
@@ -4156,11 +4786,11 @@ interface RetryState {
|
|
|
4156
4786
|
* Full `CngxAsyncState` view of the retry lifecycle.
|
|
4157
4787
|
*
|
|
4158
4788
|
* Bind to any `[state]` consumer to connect the feedback system.
|
|
4159
|
-
* `retrying` (delay between retries) maps to `'pending'`
|
|
4789
|
+
* `retrying` (delay between retries) maps to `'pending'` - the feedback
|
|
4160
4790
|
* system sees "still working" during retry delays.
|
|
4161
4791
|
*/
|
|
4162
4792
|
readonly state: CngxAsyncState<unknown>;
|
|
4163
|
-
/** Manually reset
|
|
4793
|
+
/** Manually reset - clears exhausted state, resets attempt counter. */
|
|
4164
4794
|
reset(): void;
|
|
4165
4795
|
}
|
|
4166
4796
|
/**
|
|
@@ -4173,7 +4803,7 @@ interface RetryState {
|
|
|
4173
4803
|
* Composes naturally with `CngxAsyncClick` and `CngxActionButton`:
|
|
4174
4804
|
*
|
|
4175
4805
|
* ```typescript
|
|
4176
|
-
* const [saveWithRetry, retryState] =
|
|
4806
|
+
* const [saveWithRetry, retryState] = createRetry(
|
|
4177
4807
|
* () => this.http.post('/api/save', data),
|
|
4178
4808
|
* { maxAttempts: 3, delay: 1000, backoff: 'exponential' }
|
|
4179
4809
|
* );
|
|
@@ -4186,7 +4816,15 @@ interface RetryState {
|
|
|
4186
4816
|
*
|
|
4187
4817
|
* @category common/interactive/retry
|
|
4188
4818
|
*/
|
|
4189
|
-
declare function
|
|
4819
|
+
declare function createRetry(action: AsyncAction, config?: RetryConfig): [AsyncAction, RetryState];
|
|
4820
|
+
/**
|
|
4821
|
+
* Alias of {@link createRetry} under the pre-convention name.
|
|
4822
|
+
*
|
|
4823
|
+
* @deprecated Use `createRetry` - this name is removed at the v1.0 cut
|
|
4824
|
+
* (`with*` is reserved for provider feature functions).
|
|
4825
|
+
* @category common/interactive/retry
|
|
4826
|
+
*/
|
|
4827
|
+
declare const withRetry: typeof createRetry;
|
|
4190
4828
|
|
|
4191
4829
|
/**
|
|
4192
4830
|
* State exposed by the optimistic action.
|
|
@@ -4214,11 +4852,11 @@ interface OptimisticState {
|
|
|
4214
4852
|
* On success, applies the server-confirmed value. On failure, rolls back to the
|
|
4215
4853
|
* previous value.
|
|
4216
4854
|
*
|
|
4217
|
-
* This is a utility function, not a directive
|
|
4855
|
+
* This is a utility function, not a directive - it composes with any signal.
|
|
4218
4856
|
*
|
|
4219
4857
|
* ```typescript
|
|
4220
4858
|
* readonly name = signal('Alice');
|
|
4221
|
-
* readonly [updateName, nameState] =
|
|
4859
|
+
* readonly [updateName, nameState] = createOptimistic(
|
|
4222
4860
|
* this.name,
|
|
4223
4861
|
* (value) => this.http.put('/api/name', { name: value })
|
|
4224
4862
|
* );
|
|
@@ -4229,7 +4867,7 @@ interface OptimisticState {
|
|
|
4229
4867
|
* @if (nameState.rolledBack()) { <span>Reverted</span> }
|
|
4230
4868
|
* ```
|
|
4231
4869
|
*
|
|
4232
|
-
* **Note:** The internal subscription is unmanaged
|
|
4870
|
+
* **Note:** The internal subscription is unmanaged - there is no `DestroyRef` available
|
|
4233
4871
|
* in a plain factory function. If the component is destroyed mid-flight, the subscription
|
|
4234
4872
|
* completes silently. For long-running actions, ensure the component outlives the action
|
|
4235
4873
|
* or cancel via the Observable itself.
|
|
@@ -4240,7 +4878,15 @@ interface OptimisticState {
|
|
|
4240
4878
|
*
|
|
4241
4879
|
* @category common/interactive/optimistic
|
|
4242
4880
|
*/
|
|
4243
|
-
declare function
|
|
4881
|
+
declare function createOptimistic<T>(current: WritableSignal<T>, action: (value: T) => Observable<T>): [(newValue: T) => void, OptimisticState];
|
|
4882
|
+
/**
|
|
4883
|
+
* Alias of {@link createOptimistic} under the pre-convention name.
|
|
4884
|
+
*
|
|
4885
|
+
* @deprecated Use `createOptimistic` - this name is removed at the
|
|
4886
|
+
* v1.0 cut (exported factories carry the `create` prefix).
|
|
4887
|
+
* @category common/interactive/optimistic
|
|
4888
|
+
*/
|
|
4889
|
+
declare const optimistic: typeof createOptimistic;
|
|
4244
4890
|
|
|
4245
4891
|
/**
|
|
4246
4892
|
* Detects long-press gestures via Pointer Events.
|
|
@@ -4433,7 +5079,14 @@ declare class CngxSwipeDismiss {
|
|
|
4433
5079
|
readonly swiping: _angular_core.Signal<boolean>;
|
|
4434
5080
|
/** Progress of the current swipe from 0 to 1 (clamped). */
|
|
4435
5081
|
readonly swipeProgress: _angular_core.Signal<number>;
|
|
5082
|
+
/**
|
|
5083
|
+
* The `touch-action` the host should advertise, derived from the dismiss
|
|
5084
|
+
* direction: a horizontal dismiss hands vertical panning back to native
|
|
5085
|
+
* scrolling and vice versa. No value is written while disabled.
|
|
5086
|
+
*/
|
|
5087
|
+
protected readonly touchAction: _angular_core.Signal<string | null>;
|
|
4436
5088
|
constructor();
|
|
5089
|
+
/** Signed delta along the dismiss direction; movement away from it is negative. */
|
|
4437
5090
|
private getDelta;
|
|
4438
5091
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSwipeDismiss, never>;
|
|
4439
5092
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSwipeDismiss, "[cngxSwipeDismiss]", ["cngxSwipeDismiss"], { "direction": { "alias": "cngxSwipeDismiss"; "required": true; "isSignal": true; }; "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; }, { "swiped": "swiped"; }, never, never, true, never>;
|
|
@@ -4495,7 +5148,7 @@ interface CngxReorderEvent<T> {
|
|
|
4495
5148
|
* <span class="chip-strip" [cngxReorder]="values" (reordered)="apply($event)">
|
|
4496
5149
|
* @for (v of values(); track v; let i = $index) {
|
|
4497
5150
|
* <span class="chip" [attr.data-reorder-index]="i">
|
|
4498
|
-
* <button cngxReorderHandle aria-label="
|
|
5151
|
+
* <button cngxReorderHandle aria-label="Move item">⋮⋮</button>
|
|
4499
5152
|
* {{ v.label }}
|
|
4500
5153
|
* </span>
|
|
4501
5154
|
* }
|
|
@@ -4581,7 +5234,16 @@ declare class CngxReorder<T = unknown> {
|
|
|
4581
5234
|
readonly dragOverIndex: Signal<number | null>;
|
|
4582
5235
|
private readonly hostEl;
|
|
4583
5236
|
private readonly doc;
|
|
5237
|
+
private readonly direction;
|
|
4584
5238
|
private readonly destroyRef;
|
|
5239
|
+
/**
|
|
5240
|
+
* Cleanups of click suppressors whose window is still open. Routed
|
|
5241
|
+
* through ONE destroy hook (below) instead of a fresh
|
|
5242
|
+
* `DestroyRef.onDestroy` registration per completed drag - those
|
|
5243
|
+
* registrations were never released and accumulated over the
|
|
5244
|
+
* directive's lifetime.
|
|
5245
|
+
*/
|
|
5246
|
+
private readonly pendingSuppressorCleanups;
|
|
4585
5247
|
constructor();
|
|
4586
5248
|
private wirePointer;
|
|
4587
5249
|
private wireKeyboard;
|
|
@@ -4598,8 +5260,8 @@ declare class CngxReorder<T = unknown> {
|
|
|
4598
5260
|
* itself after the first event, after a short watchdog timeout if
|
|
4599
5261
|
* no click ever fires (browsers skip the click when mouse travel
|
|
4600
5262
|
* exceeds the platform drag threshold), and on directive destroy
|
|
4601
|
-
*
|
|
4602
|
-
* iterations.
|
|
5263
|
+
* (via the routed `pendingSuppressorCleanups` set) so test fixtures
|
|
5264
|
+
* never leak a document-level handler across iterations.
|
|
4603
5265
|
*/
|
|
4604
5266
|
private installClickSuppressor;
|
|
4605
5267
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxReorder<any>, never>;
|
|
@@ -4626,6 +5288,14 @@ interface CngxChipStripRovingOptions {
|
|
|
4626
5288
|
* legitimate idle state - the controller becomes a no-op focuser.
|
|
4627
5289
|
*/
|
|
4628
5290
|
readonly container: Signal<HTMLElement | null | undefined>;
|
|
5291
|
+
/**
|
|
5292
|
+
* Document writing direction. Omit to read the ambient
|
|
5293
|
+
* {@link injectDirection} signal (the common case); pass an explicit
|
|
5294
|
+
* signal to force a direction for this strip. Mirrors the `direction`
|
|
5295
|
+
* option the tab / stepper / slider keyboard factories take, so under
|
|
5296
|
+
* `rtl` plain ArrowLeft roves forward and ArrowRight back on the inline axis.
|
|
5297
|
+
*/
|
|
5298
|
+
readonly direction?: Signal<CngxDirection>;
|
|
4629
5299
|
/**
|
|
4630
5300
|
* Attribute name used to identify each chip wrapper. Combined with
|
|
4631
5301
|
* the active index into a `[attr="index"]` query. Defaults to
|
|
@@ -4770,7 +5440,7 @@ declare class CngxKeyboardShortcut {
|
|
|
4770
5440
|
/** Shortcut combo string, e.g. `'mod+s'`, `'ctrl+shift+k'`, `'escape'`. */
|
|
4771
5441
|
readonly shortcut: _angular_core.InputSignal<string>;
|
|
4772
5442
|
/** `'global'` listens on document; `'self'` listens only on the host element. */
|
|
4773
|
-
readonly scope: _angular_core.InputSignal<"
|
|
5443
|
+
readonly scope: _angular_core.InputSignal<"self" | "global">;
|
|
4774
5444
|
/** Whether the shortcut is active. */
|
|
4775
5445
|
readonly enabled: _angular_core.InputSignal<boolean>;
|
|
4776
5446
|
/** Emitted when the shortcut fires. */
|
|
@@ -4919,7 +5589,7 @@ declare class CngxBeforeUnload {
|
|
|
4919
5589
|
* Works with Angular's `CanDeactivateFn`. The `isDirty` callback is evaluated
|
|
4920
5590
|
* on each navigation attempt. When dirty, shows a `confirm` dialog.
|
|
4921
5591
|
*
|
|
4922
|
-
* Uses `DOCUMENT` injection for SSR safety
|
|
5592
|
+
* Uses `DOCUMENT` injection for SSR safety - returns `true` (allow) when
|
|
4923
5593
|
* no window is available.
|
|
4924
5594
|
*
|
|
4925
5595
|
* Pair with `CngxBeforeUnload` for full coverage (browser close + route change):
|
|
@@ -4934,7 +5604,9 @@ declare class CngxBeforeUnload {
|
|
|
4934
5604
|
* ```
|
|
4935
5605
|
*
|
|
4936
5606
|
* @param isDirty - Callback that returns `true` when there are unsaved changes.
|
|
4937
|
-
* @param message - Confirmation message.
|
|
5607
|
+
* @param message - Confirmation message. Unset, it reads `unsavedChanges` of
|
|
5608
|
+
* `CNGX_INTERACTIVE_I18N` (English `'You have unsaved changes. Leave anyway?'`)
|
|
5609
|
+
* when the guard runs, so it follows the active language.
|
|
4938
5610
|
* @returns A functional guard compatible with Angular's `canDeactivate`.
|
|
4939
5611
|
*
|
|
4940
5612
|
* @category common/interactive/guard
|
|
@@ -5005,8 +5677,9 @@ declare class CngxCloseButton {
|
|
|
5005
5677
|
*
|
|
5006
5678
|
* Designed as a `hostDirective` composition primitive - attach it to
|
|
5007
5679
|
* components that need hover state without implementing their own
|
|
5008
|
-
* mouseenter/mouseleave logic.
|
|
5009
|
-
*
|
|
5680
|
+
* mouseenter/mouseleave logic. Host components read the read-only
|
|
5681
|
+
* `hovered` signal via `inject(CngxHoverable, { host: true })`; the
|
|
5682
|
+
* pointer events are the only writers.
|
|
5010
5683
|
*
|
|
5011
5684
|
* Used internally by `CngxTreetableRow` for row highlight-on-hover.
|
|
5012
5685
|
*
|
|
@@ -5034,8 +5707,12 @@ declare class CngxCloseButton {
|
|
|
5034
5707
|
* @relatedTo CngxPressable, CngxRipple
|
|
5035
5708
|
*/
|
|
5036
5709
|
declare class CngxHoverable {
|
|
5710
|
+
/** Backing state for {@link hovered}. */
|
|
5711
|
+
private readonly hoveredState;
|
|
5037
5712
|
/** `true` while the pointer is over the host element. */
|
|
5038
|
-
readonly hovered: _angular_core.
|
|
5713
|
+
readonly hovered: _angular_core.Signal<boolean>;
|
|
5714
|
+
protected handleMouseEnter(): void;
|
|
5715
|
+
protected handleMouseLeave(): void;
|
|
5039
5716
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxHoverable, never>;
|
|
5040
5717
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxHoverable, "[cngxHoverable]", ["cngxHoverable"], {}, {}, never, never, true, never>;
|
|
5041
5718
|
}
|
|
@@ -5101,14 +5778,30 @@ declare class CngxSpeak {
|
|
|
5101
5778
|
readonly pitch: _angular_core.InputSignal<number>;
|
|
5102
5779
|
/** Speech volume (0–1, default 1). */
|
|
5103
5780
|
readonly volume: _angular_core.InputSignal<number>;
|
|
5104
|
-
/**
|
|
5781
|
+
/**
|
|
5782
|
+
* BCP 47 language tag (e.g. `'de-DE'`). Empty string uses the app locale,
|
|
5783
|
+
* in the order cngx formatters read it: a provided `CNGX_LOCALE`
|
|
5784
|
+
* (`provideLocale`, `provideCngxI18n`), else a `LOCALE_ID` other than
|
|
5785
|
+
* `'en-US'`, else `<html lang>`, else the browser's default voice language.
|
|
5786
|
+
*
|
|
5787
|
+
* `'en-US'` is Angular's implicit `LOCALE_ID` when an app sets none, and an
|
|
5788
|
+
* explicit `'en-US'` cannot be told apart from it. A voice is chosen by its
|
|
5789
|
+
* language, so treating that default as a choice would read German page
|
|
5790
|
+
* text with an English voice; it falls through to `<html lang>` instead.
|
|
5791
|
+
* An app that wants American English speech says so with `provideLocale`,
|
|
5792
|
+
* `<html lang>` or this input.
|
|
5793
|
+
*/
|
|
5105
5794
|
readonly lang: _angular_core.InputSignal<string>;
|
|
5795
|
+
private readonly appLocale;
|
|
5796
|
+
private readonly locale;
|
|
5797
|
+
private readonly documentElement;
|
|
5106
5798
|
/** Controls auto-speak on text changes. Does NOT affect `speak()` or `cancel()`. */
|
|
5107
5799
|
readonly enabled: _angular_core.InputSignal<boolean>;
|
|
5108
5800
|
private readonly speakingState;
|
|
5109
5801
|
private readonly supportedState;
|
|
5110
5802
|
private readonly synth;
|
|
5111
5803
|
private readonly initialized;
|
|
5804
|
+
private activeUtterance;
|
|
5112
5805
|
/** Whether the browser supports the SpeechSynthesis API. */
|
|
5113
5806
|
readonly supported: boolean;
|
|
5114
5807
|
/** `true` while an utterance is being spoken. */
|
|
@@ -5116,11 +5809,20 @@ declare class CngxSpeak {
|
|
|
5116
5809
|
constructor();
|
|
5117
5810
|
/** Speak arbitrary text. Always works regardless of `enabled`. */
|
|
5118
5811
|
speak(text: string): void;
|
|
5119
|
-
/**
|
|
5812
|
+
/**
|
|
5813
|
+
* Cancel this directive's ongoing speech. A no-op while no own utterance
|
|
5814
|
+
* is live, so an idle instance never clears the shared synthesis queue.
|
|
5815
|
+
* (Starting a new utterance still interrupts whatever is playing -
|
|
5816
|
+
* `SpeechSynthesis` is a single audio channel.)
|
|
5817
|
+
*/
|
|
5120
5818
|
cancel(): void;
|
|
5121
5819
|
/** Toggle speech: speak text if idle, cancel if speaking. */
|
|
5122
5820
|
toggle(): void;
|
|
5821
|
+
private resolveAppLanguage;
|
|
5123
5822
|
private performSpeak;
|
|
5823
|
+
private cancelOwn;
|
|
5824
|
+
/** Ignores stale callbacks of a replaced utterance so a new one keeps `speaking` intact. */
|
|
5825
|
+
private finishUtterance;
|
|
5124
5826
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSpeak, never>;
|
|
5125
5827
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSpeak, "[cngxSpeak]", ["cngxSpeak"], { "text": { "alias": "cngxSpeak"; "required": true; "isSignal": true; }; "rate": { "alias": "rate"; "required": false; "isSignal": true; }; "pitch": { "alias": "pitch"; "required": false; "isSignal": true; }; "volume": { "alias": "volume"; "required": false; "isSignal": true; }; "lang": { "alias": "lang"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
5126
5828
|
}
|
|
@@ -5252,7 +5954,8 @@ declare class CngxOption implements CngxAdItemHandle {
|
|
|
5252
5954
|
readonly isSelected: Signal<boolean>;
|
|
5253
5955
|
/**
|
|
5254
5956
|
* Reactive visibility derived from the optional `CNGX_OPTION_FILTER_HOST`
|
|
5255
|
-
* host's `searchTerm` and `matches` policy
|
|
5957
|
+
* host's `searchTerm` and `matches` policy (called with this option as the
|
|
5958
|
+
* fourth argument). `false` when no host is
|
|
5256
5959
|
* provided or the term is empty; `true` only when the host's policy
|
|
5257
5960
|
* explicitly rejects the option for the current term.
|
|
5258
5961
|
*
|
|
@@ -5395,9 +6098,13 @@ interface CngxOptionFilterHost {
|
|
|
5395
6098
|
readonly searchTerm: Signal<string>;
|
|
5396
6099
|
/**
|
|
5397
6100
|
* Decides whether the option is a match for the active term. Receives the
|
|
5398
|
-
* option's value, its resolved plain-text label,
|
|
6101
|
+
* option's value, its resolved plain-text label, the current term, and the
|
|
6102
|
+
* calling `CngxOption` instance. The option is a stable identity across
|
|
6103
|
+
* filter runs, so a host can key per-option caches (a folded label, a
|
|
6104
|
+
* stable `{ value, label }` record) on it; a host that only needs value and
|
|
6105
|
+
* label leaves the parameter out.
|
|
5399
6106
|
*/
|
|
5400
|
-
matches<T>(value: T, label: string, term: string): boolean;
|
|
6107
|
+
matches<T>(value: T, label: string, term: string, option?: CngxOption): boolean;
|
|
5401
6108
|
}
|
|
5402
6109
|
/**
|
|
5403
6110
|
* DI token a host provides on itself when it wants to drive per-option
|
|
@@ -5480,6 +6187,34 @@ declare const CNGX_OPTION_INTERACTION_HOST: InjectionToken<CngxOptionInteraction
|
|
|
5480
6187
|
* @category common/interactive/listbox
|
|
5481
6188
|
*/
|
|
5482
6189
|
type ListboxMatchFn = (option: ActiveDescendantItem, term: string) => boolean;
|
|
6190
|
+
/**
|
|
6191
|
+
* The default listbox matcher: an accent- and case-tolerant substring match
|
|
6192
|
+
* of `option.label` against the term in the locale `locale` holds, built on
|
|
6193
|
+
* {@link createLabelMatcher}. It accepts any object with a `label`, so the
|
|
6194
|
+
* same function serves as a `ListboxMatchFn` and as a select-family matcher
|
|
6195
|
+
* over stable option definitions. The option object is the cache key, so each
|
|
6196
|
+
* label is folded once per label text and locale; the cache is a `WeakMap`
|
|
6197
|
+
* owned by the returned function and never outlives the options. An empty
|
|
6198
|
+
* term matches every option.
|
|
6199
|
+
*
|
|
6200
|
+
* Reach for it when a component filters `ActiveDescendantItem`s and wants the
|
|
6201
|
+
* same match a `CngxListboxSearch` applies by default, e.g. as the last arm
|
|
6202
|
+
* of an `input() ?? config ?? default` cascade. Create it once per host in an
|
|
6203
|
+
* injection context (field initializer) so the cache lives as long as the host.
|
|
6204
|
+
*
|
|
6205
|
+
* ```typescript
|
|
6206
|
+
* private readonly labelMatch = createListboxLabelMatch(injectLocale());
|
|
6207
|
+
* protected readonly matchFn = computed(() => this.matchFnInput() ?? this.labelMatch);
|
|
6208
|
+
* ```
|
|
6209
|
+
*
|
|
6210
|
+
* @category common/interactive
|
|
6211
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-search.directive.ts
|
|
6212
|
+
* @since 0.1.0
|
|
6213
|
+
* @relatedTo createLabelMatcher, CngxListboxSearch
|
|
6214
|
+
*/
|
|
6215
|
+
declare function createListboxLabelMatch(locale: Signal<string>): (option: {
|
|
6216
|
+
readonly label: string;
|
|
6217
|
+
}, term: string) => boolean;
|
|
5483
6218
|
/**
|
|
5484
6219
|
* Search input for a `CngxListbox`.
|
|
5485
6220
|
*
|
|
@@ -5497,13 +6232,16 @@ type ListboxMatchFn = (option: ActiveDescendantItem, term: string) => boolean;
|
|
|
5497
6232
|
* <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>
|
|
5498
6233
|
*/
|
|
5499
6234
|
declare class CngxListboxSearch {
|
|
5500
|
-
/**
|
|
6235
|
+
/**
|
|
6236
|
+
* Custom matcher. Defaults to a substring match on `label` that ignores
|
|
6237
|
+
* case and accents in the app locale.
|
|
6238
|
+
*/
|
|
5501
6239
|
readonly matchFn: _angular_core.InputSignal<ListboxMatchFn>;
|
|
5502
6240
|
private readonly search;
|
|
5503
6241
|
/** Current debounced search term (proxied from CngxSearch). */
|
|
5504
|
-
readonly term:
|
|
6242
|
+
readonly term: Signal<string>;
|
|
5505
6243
|
/** True when term is non-empty. */
|
|
5506
|
-
readonly hasValue:
|
|
6244
|
+
readonly hasValue: Signal<boolean>;
|
|
5507
6245
|
/** Clears the input. */
|
|
5508
6246
|
clear(): void;
|
|
5509
6247
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxListboxSearch, never>;
|
|
@@ -5543,7 +6281,7 @@ declare class CngxListboxSearch {
|
|
|
5543
6281
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox.directive.ts
|
|
5544
6282
|
* @since 0.1.0
|
|
5545
6283
|
* @relatedTo CngxListboxSearch, CngxListboxTrigger, CngxOption, CngxOptionGroup, CngxActiveDescendant
|
|
5546
|
-
*
|
|
6284
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/base/synced-listboxes</example-url>
|
|
5547
6285
|
* <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>
|
|
5548
6286
|
* <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>
|
|
5549
6287
|
* <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>
|
|
@@ -5647,7 +6385,7 @@ declare class CngxListbox<T = unknown> {
|
|
|
5647
6385
|
private hasOption;
|
|
5648
6386
|
private handleActivation;
|
|
5649
6387
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxListbox<any>, never>;
|
|
5650
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxListbox<any>, "[cngxListbox]", ["cngxListbox"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "cngxSearchRef": { "alias": "cngxSearchRef"; "required": false; "isSignal": true; }; "externalActivation": { "alias": "externalActivation"; "required": false; "isSignal": true; }; "explicitOptions": { "alias": "explicitOptions"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "selectedValues": "selectedValuesChange"; }, ["contentOptions"], never, true, [{ directive: typeof i1.CngxActiveDescendant; inputs: { "items": "items"; "orientation": "orientation"; "loop": "loop"; "typeahead": "typeahead"; "autoHighlightFirst": "autoHighlightFirst"; "virtualCount": "virtualCount"; }; outputs: {}; }]>;
|
|
6388
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxListbox<any>, "[cngxListbox]", ["cngxListbox"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "selectedValues": { "alias": "selectedValues"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "cngxSearchRef": { "alias": "cngxSearchRef"; "required": false; "isSignal": true; }; "externalActivation": { "alias": "externalActivation"; "required": false; "isSignal": true; }; "explicitOptions": { "alias": "explicitOptions"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "selectedValues": "selectedValuesChange"; }, ["contentOptions"], never, true, [{ directive: typeof i1.CngxActiveDescendant; inputs: { "items": "items"; "orientation": "orientation"; "loop": "loop"; "typeahead": "typeahead"; "autoHighlightFirst": "autoHighlightFirst"; "virtualCount": "virtualCount"; "windowStart": "windowStart"; }; outputs: { "activated": "activated"; }; }]>;
|
|
5651
6389
|
}
|
|
5652
6390
|
|
|
5653
6391
|
/**
|
|
@@ -5656,7 +6394,7 @@ declare class CngxListbox<T = unknown> {
|
|
|
5656
6394
|
* entry-point circular dependency (popover already imports from interactive
|
|
5657
6395
|
* for `CngxCloseButton`).
|
|
5658
6396
|
*/
|
|
5659
|
-
interface PopoverController$
|
|
6397
|
+
interface PopoverController$1 {
|
|
5660
6398
|
readonly isVisible: () => boolean;
|
|
5661
6399
|
show(): void;
|
|
5662
6400
|
hide(): void;
|
|
@@ -5690,7 +6428,7 @@ declare class CngxListboxTrigger<T = unknown> {
|
|
|
5690
6428
|
/** Listbox controlled by this trigger. */
|
|
5691
6429
|
readonly listbox: _angular_core.InputSignal<CngxListbox<T>>;
|
|
5692
6430
|
/** Popover that wraps the listbox panel. */
|
|
5693
|
-
readonly popover: _angular_core.InputSignal<PopoverController$
|
|
6431
|
+
readonly popover: _angular_core.InputSignal<PopoverController$1>;
|
|
5694
6432
|
/** Whether activating an option closes the popover. */
|
|
5695
6433
|
readonly closeOnSelect: _angular_core.InputSignal<boolean>;
|
|
5696
6434
|
/** Mirrors `CngxPopover.isVisible()` for host binding and external read. */
|
|
@@ -5737,15 +6475,36 @@ interface CngxMenuSubmenuLike {
|
|
|
5737
6475
|
readonly id: string;
|
|
5738
6476
|
/** Reactive open state, mirrored from the wrapped popover. */
|
|
5739
6477
|
readonly isOpen: Signal<boolean>;
|
|
5740
|
-
/**
|
|
5741
|
-
|
|
6478
|
+
/**
|
|
6479
|
+
* The submenu's inner menu host (its `CngxMenu` instance), or `null` while
|
|
6480
|
+
* unwired. An inert companion never resolves one - the context-menu
|
|
6481
|
+
* organism applies the directive to every item, so leaf items register a
|
|
6482
|
+
* brain whose `inner` stays `null`; the focus stack treats those as inert.
|
|
6483
|
+
*/
|
|
6484
|
+
readonly inner: CngxMenuHost | null;
|
|
6485
|
+
/**
|
|
6486
|
+
* Debounced pointer intent over the submenu's combined hover surface
|
|
6487
|
+
* (parent item plus popover panel). The companion only DERIVES this signal;
|
|
6488
|
+
* it never opens or closes anything off it - the surrounding trigger routes
|
|
6489
|
+
* intent edges through the focus stack via
|
|
6490
|
+
* `connectSubmenuHoverToFocusStack`, so a hover-opened submenu is
|
|
6491
|
+
* keyboard-visible exactly like a keyboard-opened one. Optional: a
|
|
6492
|
+
* companion without a pointer surface omits it and stays keyboard-only.
|
|
6493
|
+
*/
|
|
6494
|
+
readonly hoverIntent?: Signal<boolean>;
|
|
5742
6495
|
open(): void;
|
|
5743
6496
|
close(): void;
|
|
5744
6497
|
}
|
|
5745
6498
|
/**
|
|
5746
|
-
* DI token a submenu-companion directive provides
|
|
5747
|
-
*
|
|
5748
|
-
*
|
|
6499
|
+
* DI token a submenu-companion directive provides so composers can resolve
|
|
6500
|
+
* its {@link CngxMenuSubmenuLike} contract via `inject(CNGX_MENU_SUBMENU_ITEM)`
|
|
6501
|
+
* from within the submenu subtree.
|
|
6502
|
+
*
|
|
6503
|
+
* Note: the surrounding `CngxMenu` does NOT discover submenus through this
|
|
6504
|
+
* token. Discovery is DI registration via
|
|
6505
|
+
* {@link CngxMenuHost.registerSubmenuItem} (which crosses component view
|
|
6506
|
+
* boundaries a content query cannot), and the result is exposed on
|
|
6507
|
+
* `CngxMenuHost.submenuItems`.
|
|
5749
6508
|
*
|
|
5750
6509
|
* @category common/interactive/menu
|
|
5751
6510
|
* @wcag AA
|
|
@@ -5753,6 +6512,52 @@ interface CngxMenuSubmenuLike {
|
|
|
5753
6512
|
* @since 0.1.0
|
|
5754
6513
|
*/
|
|
5755
6514
|
declare const CNGX_MENU_SUBMENU_ITEM: InjectionToken<CngxMenuSubmenuLike>;
|
|
6515
|
+
/**
|
|
6516
|
+
* Structural popover surface the submenu brain drives. Typed structurally so
|
|
6517
|
+
* `@cngx/common/interactive` stays free of a `@cngx/common/popover` import
|
|
6518
|
+
* (menu-accepted-debt §7) - a concrete `CngxPopover` satisfies it.
|
|
6519
|
+
*
|
|
6520
|
+
* @category common/interactive/menu
|
|
6521
|
+
*/
|
|
6522
|
+
interface CngxMenuSubmenuPopoverRef {
|
|
6523
|
+
readonly isVisible: () => boolean;
|
|
6524
|
+
show(): void;
|
|
6525
|
+
hide(): void;
|
|
6526
|
+
/** Register the submenu parent item as the popover's anchor, or clear it. */
|
|
6527
|
+
setAnchorElement(el: HTMLElement | null): void;
|
|
6528
|
+
/** Popover unique id signal - composes the `anchor-name` CSS value. */
|
|
6529
|
+
readonly id: () => string;
|
|
6530
|
+
/** Popover host element - submenu hover listeners attach here. */
|
|
6531
|
+
readonly elementRef: {
|
|
6532
|
+
readonly nativeElement: HTMLElement;
|
|
6533
|
+
};
|
|
6534
|
+
}
|
|
6535
|
+
/**
|
|
6536
|
+
* Wiring a component shell provides so `CngxMenuItemSubmenu` resolves its
|
|
6537
|
+
* popover and inner menu from DI instead of from `[cngxMenuItemSubmenu]` /
|
|
6538
|
+
* `[submenuMenu]` inputs. Lets `@cngx/ui/context-menu` wire the submenu
|
|
6539
|
+
* brain internally (Bridge-Input-Regel) - the brain stays inert (no
|
|
6540
|
+
* `aria-haspopup` / `aria-expanded`) until one source is present.
|
|
6541
|
+
*
|
|
6542
|
+
* @category common/interactive/menu
|
|
6543
|
+
*/
|
|
6544
|
+
interface CngxMenuSubmenuWiring {
|
|
6545
|
+
/** The submenu popover surface, or `undefined` while no submenu is wired. */
|
|
6546
|
+
popover(): CngxMenuSubmenuPopoverRef | undefined;
|
|
6547
|
+
/** The inner menu host, or `undefined` while no submenu is wired. */
|
|
6548
|
+
menu(): CngxMenuHost | undefined;
|
|
6549
|
+
}
|
|
6550
|
+
/**
|
|
6551
|
+
* DI token a component shell provides to wire `CngxMenuItemSubmenu`'s popover
|
|
6552
|
+
* and inner menu without template inputs. Resolution order in the brain:
|
|
6553
|
+
* explicit input first, then this token, else inert.
|
|
6554
|
+
*
|
|
6555
|
+
* @category common/interactive/menu
|
|
6556
|
+
* @wcag AA
|
|
6557
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-submenu.token.ts
|
|
6558
|
+
* @since 0.1.0
|
|
6559
|
+
*/
|
|
6560
|
+
declare const CNGX_MENU_SUBMENU_WIRING: InjectionToken<CngxMenuSubmenuWiring>;
|
|
5756
6561
|
|
|
5757
6562
|
/**
|
|
5758
6563
|
* Structural contract a `CngxMenu` (or a future menu-bar / nested menu
|
|
@@ -5778,6 +6583,16 @@ interface CngxMenuHost {
|
|
|
5778
6583
|
* `CngxMenu.focus()`.
|
|
5779
6584
|
*/
|
|
5780
6585
|
focus(): void;
|
|
6586
|
+
/**
|
|
6587
|
+
* Register a submenu companion with this menu so ArrowRight / ArrowLeft
|
|
6588
|
+
* focus-stack routing can discover it. Returns a deregister callback the
|
|
6589
|
+
* companion invokes on destroy. Preferred over a content query because DI
|
|
6590
|
+
* registration crosses the component view boundaries that
|
|
6591
|
+
* `contentChildren` cannot see (a `[cngxMenuItemSubmenu]` declared inside a
|
|
6592
|
+
* wrapper component's own template is invisible to the surrounding menu's
|
|
6593
|
+
* content query, but its element injector still resolves `CNGX_MENU_HOST`).
|
|
6594
|
+
*/
|
|
6595
|
+
registerSubmenuItem(item: CngxMenuSubmenuLike): () => void;
|
|
5781
6596
|
}
|
|
5782
6597
|
/**
|
|
5783
6598
|
* DI token a menu host provides for sub-component composers (e.g. an
|
|
@@ -5818,13 +6633,23 @@ declare class CngxMenu implements CngxMenuHost {
|
|
|
5818
6633
|
readonly ad: CngxActiveDescendant;
|
|
5819
6634
|
private readonly elementRef;
|
|
5820
6635
|
private readonly announcer;
|
|
5821
|
-
private readonly
|
|
6636
|
+
private readonly ariaLabels;
|
|
6637
|
+
/** Internal registry backing {@link submenuItems}. */
|
|
6638
|
+
private readonly _submenuItems;
|
|
5822
6639
|
/**
|
|
5823
|
-
* Submenu directives registered
|
|
5824
|
-
*
|
|
5825
|
-
* arrow-
|
|
6640
|
+
* Submenu directives registered against this menu via DI. Empty when the
|
|
6641
|
+
* menu has no submenus. Drives the trigger's focus-stack arrow-right /
|
|
6642
|
+
* arrow-left semantics. Registration (not a content query) so a
|
|
6643
|
+
* `[cngxMenuItemSubmenu]` declared inside a wrapper component's template
|
|
6644
|
+
* is still discovered - see {@link registerSubmenuItem}.
|
|
5826
6645
|
*/
|
|
5827
6646
|
readonly submenuItems: _angular_core.Signal<readonly CngxMenuSubmenuLike[]>;
|
|
6647
|
+
/**
|
|
6648
|
+
* Register a submenu companion (a {@link CngxMenuSubmenuLike}) and return
|
|
6649
|
+
* its deregister callback. Called from `CngxMenuItemSubmenu`'s constructor;
|
|
6650
|
+
* the companion invokes the returned callback on destroy.
|
|
6651
|
+
*/
|
|
6652
|
+
registerSubmenuItem(item: CngxMenuSubmenuLike): () => void;
|
|
5828
6653
|
/** Emits the activated item's value on Enter/Space/click. */
|
|
5829
6654
|
readonly itemActivated: _angular_core.OutputRef<unknown>;
|
|
5830
6655
|
constructor();
|
|
@@ -5841,7 +6666,7 @@ declare class CngxMenu implements CngxMenuHost {
|
|
|
5841
6666
|
*/
|
|
5842
6667
|
focus(): void;
|
|
5843
6668
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenu, never>;
|
|
5844
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenu, "[cngxMenu]", ["cngxMenu"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; }, { "itemActivated": "itemActivated"; },
|
|
6669
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenu, "[cngxMenu]", ["cngxMenu"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; }, { "itemActivated": "itemActivated"; }, never, never, true, [{ directive: typeof i1.CngxActiveDescendant; inputs: { "orientation": "orientation"; "loop": "loop"; "typeahead": "typeahead"; "autoHighlightFirst": "autoHighlightFirst"; }; outputs: {}; }]>;
|
|
5845
6670
|
}
|
|
5846
6671
|
|
|
5847
6672
|
/**
|
|
@@ -5867,11 +6692,8 @@ declare class CngxMenuItem<T = unknown> implements CngxAdItemHandle {
|
|
|
5867
6692
|
readonly value: _angular_core.InputSignal<T | undefined>;
|
|
5868
6693
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
5869
6694
|
readonly labelInput: _angular_core.InputSignal<string | undefined>;
|
|
6695
|
+
private readonly core;
|
|
5870
6696
|
readonly id: string;
|
|
5871
|
-
private readonly elementRef;
|
|
5872
|
-
private readonly ad;
|
|
5873
|
-
private readonly announcer;
|
|
5874
|
-
private readonly menuConfig;
|
|
5875
6697
|
readonly isHighlighted: _angular_core.Signal<boolean>;
|
|
5876
6698
|
readonly label: () => string;
|
|
5877
6699
|
protected handleClick(): void;
|
|
@@ -5956,25 +6778,6 @@ declare class CngxMenuItemKbd {
|
|
|
5956
6778
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenuItemKbd, "[cngxMenuItemKbd]", ["cngxMenuItemKbd"], {}, {}, never, never, true, never>;
|
|
5957
6779
|
}
|
|
5958
6780
|
|
|
5959
|
-
/** See `CngxListboxTrigger` - same structural contract. */
|
|
5960
|
-
interface PopoverController$2 {
|
|
5961
|
-
readonly isVisible: () => boolean;
|
|
5962
|
-
show(): void;
|
|
5963
|
-
hide(): void;
|
|
5964
|
-
readonly anchorElement: {
|
|
5965
|
-
set(el: HTMLElement | null): void;
|
|
5966
|
-
};
|
|
5967
|
-
/**
|
|
5968
|
-
* Popover unique id signal - used to compose the `anchor-name` CSS value
|
|
5969
|
-
* the browser's CSS Anchor Positioning expects on the anchor element.
|
|
5970
|
-
*/
|
|
5971
|
-
readonly id: () => string;
|
|
5972
|
-
/**
|
|
5973
|
-
* Popover host element - the submenu directive attaches hover listeners to
|
|
5974
|
-
* it so the submenu stays open while the user mouses over its items.
|
|
5975
|
-
*/
|
|
5976
|
-
readonly elementRef: ElementRef<HTMLElement>;
|
|
5977
|
-
}
|
|
5978
6781
|
/**
|
|
5979
6782
|
* Companion directive applied to a `[cngxMenuItem]` that opens a nested
|
|
5980
6783
|
* submenu. The directive itself does NOT render `role="menuitem"` - that
|
|
@@ -5983,14 +6786,20 @@ interface PopoverController$2 {
|
|
|
5983
6786
|
* submenu source so the menu trigger can drive arrow-right / arrow-left
|
|
5984
6787
|
* focus-stack semantics.
|
|
5985
6788
|
*
|
|
5986
|
-
*
|
|
5987
|
-
* - `cngxMenuItemSubmenu
|
|
5988
|
-
*
|
|
5989
|
-
*
|
|
6789
|
+
* Wiring, two ways (Bridge-Input-Regel):
|
|
6790
|
+
* - `cngxMenuItemSubmenu` + `submenuMenu` inputs bind the popover and the
|
|
6791
|
+
* inner `CngxMenu` directly, or
|
|
6792
|
+
* - a component shell provides `CNGX_MENU_SUBMENU_WIRING` and omits both
|
|
6793
|
+
* inputs, so the brain resolves them from DI.
|
|
5990
6794
|
*
|
|
5991
|
-
*
|
|
5992
|
-
*
|
|
5993
|
-
*
|
|
6795
|
+
* Until one source is present the brain stays inert: it renders neither
|
|
6796
|
+
* `aria-haspopup` nor `aria-expanded` and opens nothing.
|
|
6797
|
+
*
|
|
6798
|
+
* The submenu popover needs no `[exclusive]` binding: a popover nested
|
|
6799
|
+
* inside another never evicts its ancestor, so opening the submenu leaves
|
|
6800
|
+
* the parent popover open by default. An explicit `[exclusive]="false"`
|
|
6801
|
+
* remains valid (it additionally opts the submenu out of evicting
|
|
6802
|
+
* unrelated sibling popovers) but is no longer required for nesting.
|
|
5994
6803
|
*
|
|
5995
6804
|
* @category common/interactive/menu
|
|
5996
6805
|
* @docsKind primary
|
|
@@ -6001,39 +6810,63 @@ interface PopoverController$2 {
|
|
|
6001
6810
|
* <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>
|
|
6002
6811
|
*/
|
|
6003
6812
|
declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
6004
|
-
/**
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6813
|
+
/**
|
|
6814
|
+
* Popover wrapping the submenu. Optional - a component shell can instead
|
|
6815
|
+
* provide `CNGX_MENU_SUBMENU_WIRING` (Bridge-Input-Regel: an optional DI
|
|
6816
|
+
* fallback forbids `input.required`; the empty-string transform keeps a
|
|
6817
|
+
* bare `cngxMenuItemSubmenu` attribute from binding `''`).
|
|
6818
|
+
*/
|
|
6819
|
+
readonly popover: _angular_core.InputSignalWithTransform<CngxMenuSubmenuPopoverRef | undefined, "" | CngxMenuSubmenuPopoverRef | undefined>;
|
|
6820
|
+
/** Inner `CngxMenuHost` (the submenu's own `CngxMenu`). Optional; resolved from DI wiring when omitted. */
|
|
6821
|
+
readonly submenuMenu: _angular_core.InputSignalWithTransform<CngxMenuHost | undefined, "" | CngxMenuHost | undefined>;
|
|
6008
6822
|
private readonly elementRef;
|
|
6009
6823
|
private readonly menuItem;
|
|
6824
|
+
private readonly menuHost;
|
|
6825
|
+
private readonly wiring;
|
|
6826
|
+
private readonly announcer;
|
|
6827
|
+
private readonly ariaLabels;
|
|
6828
|
+
private readonly destroyRef;
|
|
6010
6829
|
private readonly ownId;
|
|
6011
|
-
/**
|
|
6012
|
-
|
|
6830
|
+
/** Popover resolved from the input, else the DI wiring fallback. */
|
|
6831
|
+
private readonly resolvedPopover;
|
|
6832
|
+
/** Inner menu resolved from the input, else the DI wiring fallback. */
|
|
6833
|
+
private readonly resolvedMenu;
|
|
6834
|
+
/** True once both the popover and inner menu are wired (input or DI). */
|
|
6835
|
+
private readonly wired;
|
|
6836
|
+
/**
|
|
6837
|
+
* Effective id used by `CngxMenuHost.submenuItems().find(s => s.id ===
|
|
6013
6838
|
* activeId)`. When applied alongside `[cngxMenuItem]` the directive
|
|
6014
6839
|
* mirrors the sibling's id so the trigger's lookup matches the AD's
|
|
6015
6840
|
* `activeId`. When applied alone (no sibling), falls back to a fresh
|
|
6016
|
-
* `nextUid
|
|
6017
|
-
* lookup is moot, but the host element still receives a valid id.
|
|
6841
|
+
* `nextUid`.
|
|
6018
6842
|
*/
|
|
6019
6843
|
get id(): string;
|
|
6020
6844
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
6021
|
-
/**
|
|
6022
|
-
protected readonly
|
|
6023
|
-
|
|
6845
|
+
/** `aria-haspopup="menu"` only while wired; `null` keeps the brain inert. */
|
|
6846
|
+
protected readonly ariaHaspopup: _angular_core.Signal<string | null>;
|
|
6847
|
+
/** `aria-expanded` mirrors open state while wired; `null` otherwise. */
|
|
6848
|
+
protected readonly ariaExpanded: _angular_core.Signal<boolean | null>;
|
|
6849
|
+
/** CSS Anchor Positioning name - `null` while unwired. */
|
|
6850
|
+
protected readonly cssAnchorName: _angular_core.Signal<string | null>;
|
|
6851
|
+
get inner(): CngxMenuHost | null;
|
|
6024
6852
|
open(): void;
|
|
6025
6853
|
close(): void;
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
private
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6854
|
+
/**
|
|
6855
|
+
* Composed hover-intent atom (hostDirective). Its own host listeners cover
|
|
6856
|
+
* the parent item; the constructor effect feeds the popover panel in as a
|
|
6857
|
+
* satellite surface, so `active()` settles `true` after `submenuOpenDelay`
|
|
6858
|
+
* ms over either element and back `false` after `submenuCloseDelay` ms off
|
|
6859
|
+
* both. The atom owns every timer (and its destroy cleanup).
|
|
6860
|
+
*/
|
|
6861
|
+
private readonly intent;
|
|
6862
|
+
/**
|
|
6863
|
+
* `CngxMenuSubmenuLike.hoverIntent` - the debounced combined-surface hover
|
|
6864
|
+
* state. Derivation only: the brain never opens or closes anything off it.
|
|
6865
|
+
* The surrounding trigger routes the edges through its focus stack
|
|
6866
|
+
* (`connectSubmenuHoverToFocusStack`), so a hover-opened submenu is
|
|
6867
|
+
* stack-tracked and keyboard-visible exactly like a keyboard-opened one.
|
|
6868
|
+
*/
|
|
6869
|
+
readonly hoverIntent: _angular_core.Signal<boolean>;
|
|
6037
6870
|
/**
|
|
6038
6871
|
* Transition tracker for `isOpen`. `linkedSignal` carries an explicit
|
|
6039
6872
|
* structural `equal` so the effect below only fires on a real
|
|
@@ -6042,7 +6875,7 @@ declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
|
6042
6875
|
private readonly transition;
|
|
6043
6876
|
constructor();
|
|
6044
6877
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuItemSubmenu, never>;
|
|
6045
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenuItemSubmenu, "[cngxMenuItemSubmenu]", ["cngxMenuItemSubmenu"], { "popover": { "alias": "cngxMenuItemSubmenu"; "required":
|
|
6878
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenuItemSubmenu, "[cngxMenuItemSubmenu]", ["cngxMenuItemSubmenu"], { "popover": { "alias": "cngxMenuItemSubmenu"; "required": false; "isSignal": true; }; "submenuMenu": { "alias": "submenuMenu"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof CngxHoverIntent; inputs: {}; outputs: {}; }]>;
|
|
6046
6879
|
}
|
|
6047
6880
|
|
|
6048
6881
|
/**
|
|
@@ -6057,18 +6890,18 @@ declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
|
6057
6890
|
*
|
|
6058
6891
|
* The chain matches the
|
|
6059
6892
|
* `projects/forms/select/shared/select-base.css:759` precedent
|
|
6060
|
-
* (`flip-block, flip-inline, flip-block flip-inline`)
|
|
6893
|
+
* (`flip-block, flip-inline, flip-block flip-inline`) - `flip-inline`
|
|
6061
6894
|
* is the dominant submenu clip case (right submenu hits the viewport
|
|
6062
6895
|
* right edge → flips to the left side of its parent item),
|
|
6063
6896
|
* `flip-block` covers the vertical case, and the composed form
|
|
6064
6897
|
* covers diagonal clipping.
|
|
6065
6898
|
*
|
|
6066
6899
|
* `CngxMenuItemSubmenu` emits a one-shot dev-mode warning when a
|
|
6067
|
-
* submenu popover ships without `positionTryFallbacks`
|
|
6900
|
+
* submenu popover ships without `positionTryFallbacks` - the const
|
|
6068
6901
|
* is documented as the canonical opt-in.
|
|
6069
6902
|
*
|
|
6070
6903
|
* Typed as a string-literal tuple via `as const` rather than the
|
|
6071
|
-
* `PopoverPositionTryFallback` union from `@cngx/common/popover`
|
|
6904
|
+
* `PopoverPositionTryFallback` union from `@cngx/common/popover` -
|
|
6072
6905
|
* the cross-entry-point import would reverse the existing
|
|
6073
6906
|
* `popover -> interactive` dependency direction and break ng-packagr.
|
|
6074
6907
|
* Consumers binding the const to `[positionTryFallbacks]` get
|
|
@@ -6097,11 +6930,8 @@ declare class CngxMenuItemCheckbox<T = unknown> implements CngxAdItemHandle {
|
|
|
6097
6930
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
6098
6931
|
readonly labelInput: _angular_core.InputSignal<string | undefined>;
|
|
6099
6932
|
readonly checked: _angular_core.ModelSignal<boolean>;
|
|
6933
|
+
private readonly core;
|
|
6100
6934
|
readonly id: string;
|
|
6101
|
-
private readonly elementRef;
|
|
6102
|
-
private readonly ad;
|
|
6103
|
-
private readonly announcer;
|
|
6104
|
-
private readonly menuConfig;
|
|
6105
6935
|
readonly isHighlighted: _angular_core.Signal<boolean>;
|
|
6106
6936
|
readonly label: () => string;
|
|
6107
6937
|
protected handleClick(): void;
|
|
@@ -6127,12 +6957,9 @@ declare class CngxMenuItemRadio<T = unknown> implements CngxAdItemHandle {
|
|
|
6127
6957
|
readonly value: _angular_core.InputSignal<T>;
|
|
6128
6958
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
6129
6959
|
readonly labelInput: _angular_core.InputSignal<string | undefined>;
|
|
6130
|
-
readonly id: string;
|
|
6131
|
-
private readonly elementRef;
|
|
6132
|
-
private readonly ad;
|
|
6133
6960
|
private readonly group;
|
|
6134
|
-
private readonly
|
|
6135
|
-
|
|
6961
|
+
private readonly core;
|
|
6962
|
+
readonly id: string;
|
|
6136
6963
|
readonly isHighlighted: _angular_core.Signal<boolean>;
|
|
6137
6964
|
/** Whether this radio is the currently selected value in its group. */
|
|
6138
6965
|
readonly checked: _angular_core.Signal<boolean>;
|
|
@@ -6292,6 +7119,13 @@ interface CngxMenuNavStrategy {
|
|
|
6292
7119
|
* `close-submenu`. Otherwise → `move-to-parent` (an enclosing menubar
|
|
6293
7120
|
* interprets that; a standalone menu trigger treats it as noop).
|
|
6294
7121
|
*
|
|
7122
|
+
* `onArrowRight` / `onArrowLeft` are the inline-forward / inline-back
|
|
7123
|
+
* intents, not physical keys. The dispatch site resolves the physical
|
|
7124
|
+
* arrow to its logical intent by writing direction before calling the
|
|
7125
|
+
* strategy (`resolveInlineArrowKey`), so under `rtl` physical ArrowLeft
|
|
7126
|
+
* routes to `onArrowRight`. Custom strategies therefore stay
|
|
7127
|
+
* direction-naive and inherit correct RTL behaviour for free.
|
|
7128
|
+
*
|
|
6295
7129
|
* @category common/interactive/menu
|
|
6296
7130
|
*/
|
|
6297
7131
|
declare function createW3CMenuStrategy(): CngxMenuNavStrategy;
|
|
@@ -6309,18 +7143,217 @@ declare function createW3CMenuStrategy(): CngxMenuNavStrategy;
|
|
|
6309
7143
|
declare const CNGX_MENU_NAV_STRATEGY: InjectionToken<CngxMenuNavStrategy>;
|
|
6310
7144
|
|
|
6311
7145
|
/**
|
|
6312
|
-
*
|
|
6313
|
-
*
|
|
7146
|
+
* Minimal popover surface the focus stack hides when the outermost menu
|
|
7147
|
+
* level closes. Typed structurally to keep `@cngx/common/interactive` free
|
|
7148
|
+
* of a `@cngx/common/popover` import (menu-accepted-debt §7).
|
|
6314
7149
|
*
|
|
6315
7150
|
* @category common/interactive/menu
|
|
6316
7151
|
*/
|
|
6317
|
-
interface
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
7152
|
+
interface CngxMenuFocusStackPopoverRef {
|
|
7153
|
+
hide(): void;
|
|
7154
|
+
}
|
|
7155
|
+
/**
|
|
7156
|
+
* Dependencies for {@link createMenuFocusStack}. The caller injects the
|
|
7157
|
+
* keyboard policy and `Document` and passes them in, so the factory itself
|
|
7158
|
+
* stays pure and swappable via {@link CNGX_MENU_FOCUS_STACK_FACTORY}.
|
|
7159
|
+
*
|
|
7160
|
+
* @category common/interactive/menu
|
|
7161
|
+
*/
|
|
7162
|
+
interface CngxMenuFocusStackDeps {
|
|
7163
|
+
/** Root menu host - the bottom of the submenu chain. */
|
|
7164
|
+
readonly rootMenu: () => CngxMenuHost;
|
|
7165
|
+
/** Popover to hide when the outermost level closes. */
|
|
7166
|
+
readonly popover: () => CngxMenuFocusStackPopoverRef;
|
|
7167
|
+
/** Keyboard policy consulted on ArrowRight / ArrowLeft. */
|
|
7168
|
+
readonly nav: CngxMenuNavStrategy;
|
|
7169
|
+
/** Document used to capture the pre-open focus target. */
|
|
7170
|
+
readonly document: Document;
|
|
6323
7171
|
}
|
|
7172
|
+
/**
|
|
7173
|
+
* Submenu focus-stack model shared by `CngxMenuTrigger` and the
|
|
7174
|
+
* context-menu trigger core. Owns the active submenu chain, the
|
|
7175
|
+
* saved-focus slot restored after close, and the W3C APG
|
|
7176
|
+
* ArrowRight / ArrowLeft / Escape / activation routing.
|
|
7177
|
+
*
|
|
7178
|
+
* @category common/interactive/menu
|
|
7179
|
+
*/
|
|
7180
|
+
interface CngxMenuFocusStack {
|
|
7181
|
+
/** Active submenu chain - empty when only the root menu is open. */
|
|
7182
|
+
readonly stack: Signal<readonly CngxMenuHost[]>;
|
|
7183
|
+
/** Top-of-stack menu host, or the root when the stack is empty. */
|
|
7184
|
+
effectiveMenu(): CngxMenuHost;
|
|
7185
|
+
/**
|
|
7186
|
+
* The submenu companion of the effective menu's active item, or `undefined`
|
|
7187
|
+
* when the active item is a leaf (or nothing is active). The single lookup
|
|
7188
|
+
* shared by keyboard, click, and hover activation - callers guard on the
|
|
7189
|
+
* result and route it to {@link openSubmenuFor} / {@link noteSubmenuOpened}.
|
|
7190
|
+
*/
|
|
7191
|
+
activeSubmenu(): CngxMenuSubmenuLike | undefined;
|
|
7192
|
+
/** Capture the currently focused element (once) for post-close restore. */
|
|
7193
|
+
captureFocus(): void;
|
|
7194
|
+
/** Restore focus to the captured element after the close DOM settles. */
|
|
7195
|
+
restoreFocus(): void;
|
|
7196
|
+
/**
|
|
7197
|
+
* Drop the captured element without focusing it. For ownership handoffs
|
|
7198
|
+
* where another opener now owns focus and a restore would yank it away.
|
|
7199
|
+
* Optional so custom factory implementations stay assignable.
|
|
7200
|
+
*/
|
|
7201
|
+
discardFocus?(): void;
|
|
7202
|
+
/** Escape: pop the innermost submenu, or hide the popover at the root. */
|
|
7203
|
+
handleEscape(event: KeyboardEvent): void;
|
|
7204
|
+
/** ArrowRight: open the active item's submenu when the policy allows. */
|
|
7205
|
+
handleArrowRight(menu: CngxMenuHost, event: KeyboardEvent): void;
|
|
7206
|
+
/** ArrowLeft: pop the current submenu level when one is open. */
|
|
7207
|
+
handleArrowLeft(menu: CngxMenuHost, event: KeyboardEvent): void;
|
|
7208
|
+
/** Enter/Space: open a submenu parent, else activate the leaf and close. */
|
|
7209
|
+
handleActivation(menu: CngxMenuHost, event: KeyboardEvent): void;
|
|
7210
|
+
/**
|
|
7211
|
+
* Open a specific submenu through the stack - the single open-only primitive
|
|
7212
|
+
* shared by keyboard activation, pointer click, and hover. Delegates to the
|
|
7213
|
+
* same private open the ArrowRight path uses: opens the submenu popover
|
|
7214
|
+
* (flipping its `aria-expanded`), pushes the inner menu onto the stack, and
|
|
7215
|
+
* highlights the inner menu's first item. Idempotent - a no-op when the
|
|
7216
|
+
* submenu's inner menu is already on the stack, so repeated activation or
|
|
7217
|
+
* hover never double-pushes. Chain-correcting: hover can target a submenu
|
|
7218
|
+
* whose parent menu is not the top of the stack (a sibling parent while
|
|
7219
|
+
* another branch is open), so any levels above the submenu's parent menu
|
|
7220
|
+
* are popped first and the stack stays a strict chain. A no-op on an inert
|
|
7221
|
+
* brain (`inner` never resolved - an organism leaf item): there is nothing
|
|
7222
|
+
* to open and the open branch must survive a sweep across a leaf row. Also
|
|
7223
|
+
* a no-op when the submenu's parent menu is not part of the open chain
|
|
7224
|
+
* (its branch was popped since the caller resolved the submenu) - opening
|
|
7225
|
+
* there would show an orphaned popover and fork the stack.
|
|
7226
|
+
*/
|
|
7227
|
+
openSubmenuFor(submenu: CngxMenuSubmenuLike): void;
|
|
7228
|
+
/**
|
|
7229
|
+
* Close a specific submenu through the stack - the close counterpart to
|
|
7230
|
+
* {@link openSubmenuFor} shared by hover leave and programmatic close.
|
|
7231
|
+
* Pops the stack innermost-first until the submenu's inner menu is off it
|
|
7232
|
+
* (closing any open descendants on the way), so keyboard routing falls
|
|
7233
|
+
* back to the parent level. When the submenu is not stack-tracked (already
|
|
7234
|
+
* popped by a sibling's chain-correcting open) it only ensures the popover
|
|
7235
|
+
* is hidden. Idempotent on a closed submenu; a no-op on an inert brain.
|
|
7236
|
+
*/
|
|
7237
|
+
closeSubmenuFor(submenu: CngxMenuSubmenuLike): void;
|
|
7238
|
+
/**
|
|
7239
|
+
* Record that a submenu is already open, pushing its inner menu onto the
|
|
7240
|
+
* stack and highlighting the first item WITHOUT calling `submenu.open()`.
|
|
7241
|
+
* Safety net for opens the stack did not perform itself - e.g. the
|
|
7242
|
+
* organism's programmatic `openAsSubmenu` seam - so an externally opened
|
|
7243
|
+
* submenu is stack-tracked (ArrowLeft / Escape pop it) exactly like a
|
|
7244
|
+
* keyboard-opened one, with no risk of re-entering the open path. Hover
|
|
7245
|
+
* does not need it: it routes through {@link openSubmenuFor} via
|
|
7246
|
+
* `connectSubmenuHoverToFocusStack`, and this call is then an idempotent
|
|
7247
|
+
* no-op because the submenu is already on the stack.
|
|
7248
|
+
*/
|
|
7249
|
+
noteSubmenuOpened(submenu: CngxMenuSubmenuLike): void;
|
|
7250
|
+
/** Close every open submenu innermost-first, then hide the popover. */
|
|
7251
|
+
closeAll(): void;
|
|
7252
|
+
/**
|
|
7253
|
+
* Close every open submenu innermost-first and clear the stack WITHOUT
|
|
7254
|
+
* hiding the root popover. Called on the trigger's close path so a stale
|
|
7255
|
+
* submenu chain never survives a non-Escape dismissal (outside-click, blur,
|
|
7256
|
+
* scroll): the root popover is already closing, and a reopened menu must
|
|
7257
|
+
* start from the root, not a submenu that no longer exists.
|
|
7258
|
+
*/
|
|
7259
|
+
reset(): void;
|
|
7260
|
+
}
|
|
7261
|
+
/**
|
|
7262
|
+
* Factory that builds a {@link CngxMenuFocusStack} from its dependencies.
|
|
7263
|
+
* Matches the token {@link CNGX_MENU_FOCUS_STACK_FACTORY} so consumers can
|
|
7264
|
+
* swap the focus-stack model (alternative keyboard pattern, telemetry
|
|
7265
|
+
* wrapping, test double) enterprise-wide.
|
|
7266
|
+
*
|
|
7267
|
+
* @category common/interactive/menu
|
|
7268
|
+
*/
|
|
7269
|
+
type CngxMenuFocusStackFactory = (deps: CngxMenuFocusStackDeps) => CngxMenuFocusStack;
|
|
7270
|
+
/**
|
|
7271
|
+
* Default focus-stack implementation. Behaviour matches the W3C APG Menu
|
|
7272
|
+
* Button pattern that `CngxMenuTrigger` shipped inline before extraction.
|
|
7273
|
+
*
|
|
7274
|
+
* @category common/interactive/menu
|
|
7275
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-focus-stack.ts
|
|
7276
|
+
* @since 0.1.0
|
|
7277
|
+
*/
|
|
7278
|
+
declare function createMenuFocusStack(deps: CngxMenuFocusStackDeps): CngxMenuFocusStack;
|
|
7279
|
+
/**
|
|
7280
|
+
* Dependencies for {@link connectSubmenuHoverToFocusStack}.
|
|
7281
|
+
*
|
|
7282
|
+
* @category common/interactive/menu
|
|
7283
|
+
*/
|
|
7284
|
+
interface CngxSubmenuHoverRoutingDeps {
|
|
7285
|
+
/** The trigger's focus-stack model that owns the open submenu chain. */
|
|
7286
|
+
readonly focusStack: CngxMenuFocusStack;
|
|
7287
|
+
/** Root menu host - the bottom of the submenu chain. */
|
|
7288
|
+
readonly rootMenu: () => CngxMenuHost;
|
|
7289
|
+
/**
|
|
7290
|
+
* Open-state of the root popover. When provided, a settled hover intent
|
|
7291
|
+
* opens only while the root menu is open: a dwell timer can outlive a
|
|
7292
|
+
* dismissal (hidden elements do not reliably fire `pointerleave`), and its
|
|
7293
|
+
* late true edge must not show an orphaned submenu popover. The edge is
|
|
7294
|
+
* still consumed, so reopening the root never retroactively opens a
|
|
7295
|
+
* submenu from a stale dwell. Close edges route regardless - closing is
|
|
7296
|
+
* always safe. Absent: opens are not gated.
|
|
7297
|
+
*/
|
|
7298
|
+
readonly rootOpen?: () => boolean;
|
|
7299
|
+
}
|
|
7300
|
+
/**
|
|
7301
|
+
* Route submenu hover intent through the focus stack. Watches the
|
|
7302
|
+
* {@link CngxMenuSubmenuLike.hoverIntent} signal of every submenu companion
|
|
7303
|
+
* registered anywhere in the menu tree and routes its edges through the same
|
|
7304
|
+
* primitives keyboard and click use: a settled hover opens via
|
|
7305
|
+
* {@link CngxMenuFocusStack.openSubmenuFor} (stack-tracked, first item
|
|
7306
|
+
* highlighted, keyboard-visible), a settled un-hover closes via
|
|
7307
|
+
* {@link CngxMenuFocusStack.closeSubmenuFor} (stack popped innermost-first).
|
|
7308
|
+
* The submenu companion itself owns NO open/close mechanics for hover - it
|
|
7309
|
+
* only derives intent.
|
|
7310
|
+
*
|
|
7311
|
+
* The walk covers the WHOLE registered tree, not just the open chain: a
|
|
7312
|
+
* submenu whose menu drops out of the chain (popped by a chain-correcting
|
|
7313
|
+
* open, cleared by `reset()`) still decays its intent afterwards, and that
|
|
7314
|
+
* false edge must be observed or the bookkeeping would go stale and fire a
|
|
7315
|
+
* spurious close when the menu re-enters the chain. Items in a hidden menu
|
|
7316
|
+
* cannot produce real pointer events, so the extra tracking never opens
|
|
7317
|
+
* anything on its own.
|
|
7318
|
+
*
|
|
7319
|
+
* Edge-driven, not state-reconciling: a keyboard-opened submenu whose intent
|
|
7320
|
+
* never settled `true` is left alone, so pointer-less operation is unchanged.
|
|
7321
|
+
*
|
|
7322
|
+
* Must run in an injection context (constructor / field initializer) - it
|
|
7323
|
+
* installs an `effect`. Every focus-stack owner wires it once:
|
|
7324
|
+
* `CngxMenuTrigger`, `CngxContextMenuTrigger`, and `CngxContextMenuFor`.
|
|
7325
|
+
*
|
|
7326
|
+
* @category common/interactive/menu
|
|
7327
|
+
* @wcag AA
|
|
7328
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-focus-stack.ts
|
|
7329
|
+
* @since 0.1.0
|
|
7330
|
+
* @relatedTo CngxMenuItemSubmenu, CngxMenuTrigger, CngxContextMenuTrigger, CNGX_MENU_FOCUS_STACK_FACTORY
|
|
7331
|
+
*/
|
|
7332
|
+
declare function connectSubmenuHoverToFocusStack(deps: CngxSubmenuHoverRoutingDeps): void;
|
|
7333
|
+
/**
|
|
7334
|
+
* DI token carrying the {@link CngxMenuFocusStackFactory}. Defaults to
|
|
7335
|
+
* {@link createMenuFocusStack}; override via `providers` / `viewProviders`
|
|
7336
|
+
* to swap the submenu focus-stack model (non-W3C keyboard routing,
|
|
7337
|
+
* telemetry-wrapped traversal, test-doubled stack) without forking the
|
|
7338
|
+
* trigger.
|
|
7339
|
+
*
|
|
7340
|
+
* @category common/interactive/menu
|
|
7341
|
+
* @wcag AA
|
|
7342
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-focus-stack.ts
|
|
7343
|
+
* @since 0.1.0
|
|
7344
|
+
* @relatedTo CngxMenuTrigger, CngxContextMenuTrigger, CNGX_MENU_NAV_STRATEGY
|
|
7345
|
+
*/
|
|
7346
|
+
declare const CNGX_MENU_FOCUS_STACK_FACTORY: InjectionToken<CngxMenuFocusStackFactory>;
|
|
7347
|
+
|
|
7348
|
+
/**
|
|
7349
|
+
* Localised UI strings the menu announces or otherwise renders. English by
|
|
7350
|
+
* default; consumers override via {@link withAriaLabels}. The same shape as
|
|
7351
|
+
* the menu section of a language pack, declared once as
|
|
7352
|
+
* {@link CngxMenuLanguageSection}.
|
|
7353
|
+
*
|
|
7354
|
+
* @category common/interactive/menu
|
|
7355
|
+
*/
|
|
7356
|
+
type CngxMenuAriaLabels = CngxMenuLanguageSection;
|
|
6324
7357
|
/**
|
|
6325
7358
|
* Resolved configuration consumed by every menu directive in the family.
|
|
6326
7359
|
* Default values live in {@link DEFAULT_MENU_CONFIG}; override at app
|
|
@@ -6330,9 +7363,14 @@ interface CngxMenuAriaLabels {
|
|
|
6330
7363
|
* @category common/interactive/menu
|
|
6331
7364
|
*/
|
|
6332
7365
|
interface CngxMenuConfig {
|
|
6333
|
-
readonly ariaLabels: CngxMenuAriaLabels
|
|
7366
|
+
readonly ariaLabels: CngxMenuAriaLabels | Signal<CngxMenuAriaLabels>;
|
|
6334
7367
|
readonly typeaheadDebounce: number;
|
|
7368
|
+
/** Hover dwell (ms) before a hovered submenu parent opens. Default `0`. */
|
|
6335
7369
|
readonly submenuOpenDelay: number;
|
|
7370
|
+
/**
|
|
7371
|
+
* Hover dwell (ms) before a hover-opened submenu closes once the pointer
|
|
7372
|
+
* has left both the parent item and the popover. Default `150`.
|
|
7373
|
+
*/
|
|
6336
7374
|
readonly submenuCloseDelay: number;
|
|
6337
7375
|
readonly closeOnSelect: boolean;
|
|
6338
7376
|
/**
|
|
@@ -6374,18 +7412,18 @@ type CngxMenuConfigFeature = ((config: CngxMenuConfig) => CngxMenuConfig) & {
|
|
|
6374
7412
|
readonly _target?: 'config';
|
|
6375
7413
|
};
|
|
6376
7414
|
/**
|
|
6377
|
-
* Library-default menu configuration
|
|
6378
|
-
*
|
|
6379
|
-
* `
|
|
7415
|
+
* Library-default menu configuration with the English labels. The token's
|
|
7416
|
+
* default reads `ariaLabels` from the menu section of the active language
|
|
7417
|
+
* pack instead; `withAriaLabels` overrides single labels on top.
|
|
6380
7418
|
*
|
|
6381
7419
|
* @category common/interactive/menu
|
|
6382
7420
|
*/
|
|
6383
7421
|
declare const DEFAULT_MENU_CONFIG: CngxMenuConfig;
|
|
6384
7422
|
/**
|
|
6385
7423
|
* DI token carrying the resolved {@link CngxMenuConfig}. Defaults to
|
|
6386
|
-
* {@link DEFAULT_MENU_CONFIG}
|
|
6387
|
-
*
|
|
6388
|
-
* `viewProviders`).
|
|
7424
|
+
* {@link DEFAULT_MENU_CONFIG} with the language pack's labels at root;
|
|
7425
|
+
* override via {@link provideMenuConfig} (app-wide) or
|
|
7426
|
+
* {@link provideMenuConfigAt} (component scope via `viewProviders`).
|
|
6389
7427
|
*
|
|
6390
7428
|
* @category common/interactive/menu
|
|
6391
7429
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-config.ts
|
|
@@ -6433,7 +7471,7 @@ declare function injectMenuConfig(): CngxMenuConfig;
|
|
|
6433
7471
|
*
|
|
6434
7472
|
* @category common/interactive/menu
|
|
6435
7473
|
*/
|
|
6436
|
-
declare function withAriaLabels(partial: Partial<CngxMenuAriaLabels>): CngxMenuConfigFeature;
|
|
7474
|
+
declare function withAriaLabels(partial: Partial<CngxMenuAriaLabels> | Signal<Partial<CngxMenuAriaLabels>>): CngxMenuConfigFeature;
|
|
6437
7475
|
/**
|
|
6438
7476
|
* Override the typeahead debounce window (milliseconds) for menu
|
|
6439
7477
|
* navigation. Default: `300`.
|
|
@@ -6442,24 +7480,28 @@ declare function withAriaLabels(partial: Partial<CngxMenuAriaLabels>): CngxMenuC
|
|
|
6442
7480
|
*/
|
|
6443
7481
|
declare function withTypeaheadDebounce(ms: number): CngxMenuConfigFeature;
|
|
6444
7482
|
/**
|
|
6445
|
-
* Override the
|
|
6446
|
-
* submenu
|
|
6447
|
-
*
|
|
7483
|
+
* Override the hover dwell (milliseconds) before a hovered submenu parent
|
|
7484
|
+
* opens its submenu. Feeds the enter delay of the hover intent
|
|
7485
|
+
* `CngxMenuItemSubmenu` composes - a pointer that merely sweeps across the
|
|
7486
|
+
* parent never opens. Default: `0` (open on the first settled hover tick).
|
|
7487
|
+
* Keyboard and click open paths are unaffected.
|
|
6448
7488
|
*
|
|
6449
7489
|
* @category common/interactive/menu
|
|
6450
7490
|
*/
|
|
6451
7491
|
declare function withSubmenuOpenDelay(ms: number): CngxMenuConfigFeature;
|
|
6452
7492
|
/**
|
|
6453
|
-
* Override the
|
|
6454
|
-
*
|
|
6455
|
-
*
|
|
7493
|
+
* Override the hover dwell (milliseconds) before a hover-opened submenu
|
|
7494
|
+
* closes after the pointer has left both the parent item and the submenu
|
|
7495
|
+
* popover. Feeds the leave delay of the hover intent `CngxMenuItemSubmenu`
|
|
7496
|
+
* composes - the grace window for crossing the gap between parent and
|
|
7497
|
+
* popover. Default: `150`.
|
|
6456
7498
|
*
|
|
6457
7499
|
* @category common/interactive/menu
|
|
6458
7500
|
*/
|
|
6459
7501
|
declare function withSubmenuCloseDelay(ms: number): CngxMenuConfigFeature;
|
|
6460
7502
|
/**
|
|
6461
7503
|
* Whether activating a leaf item closes the menu. Default: `true`
|
|
6462
|
-
* (menu semantics
|
|
7504
|
+
* (menu semantics - distinct from listbox/combobox which stay open).
|
|
6463
7505
|
*
|
|
6464
7506
|
* @category common/interactive/menu
|
|
6465
7507
|
*/
|
|
@@ -6738,13 +7780,13 @@ interface CngxMenuAnnouncerLike {
|
|
|
6738
7780
|
*/
|
|
6739
7781
|
type CngxMenuAnnouncerFactory = () => CngxMenuAnnouncerLike;
|
|
6740
7782
|
/**
|
|
6741
|
-
* Global polite live-region announcer for the menu family.
|
|
6742
|
-
*
|
|
6743
|
-
*
|
|
7783
|
+
* Global polite live-region announcer for the menu family. Delegates to
|
|
7784
|
+
* the shared {@link CngxLiveAnnouncer}, announcing menu state transitions
|
|
7785
|
+
* (submenu open/close, item activation) through its polite region.
|
|
6744
7786
|
*
|
|
6745
7787
|
* Scoped `providedIn: 'root'` so every menu in the app shares the same
|
|
6746
|
-
* region;
|
|
6747
|
-
*
|
|
7788
|
+
* region; the announcer clears then re-sets one frame later so screen
|
|
7789
|
+
* readers treat repeated identical messages as fresh events.
|
|
6748
7790
|
*
|
|
6749
7791
|
* Default factory output for {@link CNGX_MENU_ANNOUNCER_FACTORY}.
|
|
6750
7792
|
* Consumers obtain the announcer via the factory token, never by
|
|
@@ -6757,16 +7799,13 @@ type CngxMenuAnnouncerFactory = () => CngxMenuAnnouncerLike;
|
|
|
6757
7799
|
* @relatedTo CngxMenu, CngxMenuTrigger, CngxMenuItemSubmenu
|
|
6758
7800
|
*/
|
|
6759
7801
|
declare class CngxMenuAnnouncer implements CngxMenuAnnouncerLike {
|
|
6760
|
-
private readonly
|
|
6761
|
-
private politeElement;
|
|
6762
|
-
private clearTimer;
|
|
7802
|
+
private readonly announcer;
|
|
6763
7803
|
/**
|
|
6764
7804
|
* Announce a message via the polite live region. Empty messages are
|
|
6765
7805
|
* ignored. The region is cleared ~16ms before being repopulated so AT
|
|
6766
7806
|
* picks up identical-text repeats as a new event.
|
|
6767
7807
|
*/
|
|
6768
7808
|
announce(message: string): void;
|
|
6769
|
-
private ensureRegion;
|
|
6770
7809
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuAnnouncer, never>;
|
|
6771
7810
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CngxMenuAnnouncer>;
|
|
6772
7811
|
}
|
|
@@ -6813,18 +7852,156 @@ declare const CNGX_MENU_ANNOUNCER_FACTORY: InjectionToken<CngxMenuAnnouncerFacto
|
|
|
6813
7852
|
*/
|
|
6814
7853
|
declare function injectMenuAnnouncer(): CngxMenuAnnouncerLike;
|
|
6815
7854
|
|
|
6816
|
-
/**
|
|
6817
|
-
|
|
7855
|
+
/**
|
|
7856
|
+
* Popover surface the context-menu core drives at pointer coordinates.
|
|
7857
|
+
* Typed structurally to keep `@cngx/common/interactive` free of a
|
|
7858
|
+
* `@cngx/common/popover` import (menu-accepted-debt §7).
|
|
7859
|
+
*
|
|
7860
|
+
* @category common/interactive/menu
|
|
7861
|
+
*/
|
|
7862
|
+
interface CngxContextMenuTriggerPopoverRef extends CngxMenuDismissPopoverRef {
|
|
6818
7863
|
show(): void;
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
};
|
|
7864
|
+
/** Register the virtual pointer-coordinate anchor, or clear it. */
|
|
7865
|
+
setAnchorElement(el: HTMLElement | null): void;
|
|
6822
7866
|
/**
|
|
6823
7867
|
* Popover unique id signal - used to compose the `anchor-name` CSS value
|
|
6824
7868
|
* the browser's CSS Anchor Positioning expects on the anchor element.
|
|
6825
7869
|
*/
|
|
6826
7870
|
readonly id: () => string;
|
|
6827
7871
|
}
|
|
7872
|
+
/**
|
|
7873
|
+
* Decision returned by the {@link CngxContextMenuTriggerCoreDeps.resolveOpen}
|
|
7874
|
+
* seam. `open: false` leaves the native context menu untouched; `open: true`
|
|
7875
|
+
* carries the per-open context handed to `commitContext`.
|
|
7876
|
+
*
|
|
7877
|
+
* @category common/interactive/menu
|
|
7878
|
+
*/
|
|
7879
|
+
type CngxContextMenuOpenDecision = {
|
|
7880
|
+
readonly open: false;
|
|
7881
|
+
} | {
|
|
7882
|
+
readonly open: true;
|
|
7883
|
+
readonly context: unknown;
|
|
7884
|
+
};
|
|
7885
|
+
/**
|
|
7886
|
+
* Dependencies for {@link createContextMenuTriggerCore}. The caller injects
|
|
7887
|
+
* the DI-backed collaborators (dismiss factory, announcer, config) and
|
|
7888
|
+
* passes them in, keeping the core a pure factory.
|
|
7889
|
+
*
|
|
7890
|
+
* @category common/interactive/menu
|
|
7891
|
+
*/
|
|
7892
|
+
interface CngxContextMenuTriggerCoreDeps {
|
|
7893
|
+
/** Menu the popover wraps. */
|
|
7894
|
+
readonly menu: () => CngxMenuHost;
|
|
7895
|
+
/** Popover panel opened at pointer coordinates. */
|
|
7896
|
+
readonly popover: () => CngxContextMenuTriggerPopoverRef;
|
|
7897
|
+
/** Trigger host element - anchor for Shift+F10 and the dismiss filter. */
|
|
7898
|
+
readonly hostElement: HTMLElement;
|
|
7899
|
+
/** Document used for the transient anchor and focus capture. */
|
|
7900
|
+
readonly document: Document;
|
|
7901
|
+
/** Menu config supplying dismissal aria-labels. */
|
|
7902
|
+
readonly menuConfig: CngxMenuConfig;
|
|
7903
|
+
/** Dismiss-handler factory (from `CNGX_MENU_DISMISS_HANDLER_FACTORY`). */
|
|
7904
|
+
readonly dismissFactory: CngxMenuDismissHandlerFactory;
|
|
7905
|
+
/** Announcer for AT dismissal messages. */
|
|
7906
|
+
readonly announcer: CngxMenuAnnouncerLike;
|
|
7907
|
+
/** Keyboard policy for ArrowRight/ArrowLeft submenu routing. */
|
|
7908
|
+
readonly nav: CngxMenuNavStrategy;
|
|
7909
|
+
/**
|
|
7910
|
+
* Document writing direction. Resolves the physical arrow to its
|
|
7911
|
+
* inline-logical intent at the dispatch site, so under `rtl` physical
|
|
7912
|
+
* ArrowLeft opens the submenu and physical ArrowRight pops it.
|
|
7913
|
+
*/
|
|
7914
|
+
readonly direction: Signal<CngxDirection>;
|
|
7915
|
+
/** Focus-stack factory (from `CNGX_MENU_FOCUS_STACK_FACTORY`). */
|
|
7916
|
+
readonly focusStackFactory: CngxMenuFocusStackFactory;
|
|
7917
|
+
/**
|
|
7918
|
+
* Veto/datum seam. Evaluated as the FIRST thing in the `contextmenu`
|
|
7919
|
+
* handler, BEFORE `preventDefault()`. `{ open: false }` leaves the native
|
|
7920
|
+
* menu untouched (no `preventDefault`, no anchor, no open).
|
|
7921
|
+
* `{ open: true, context }` prevents default, hands `context` to
|
|
7922
|
+
* {@link commitContext}, then opens. Defaults to always-open with
|
|
7923
|
+
* `undefined` context, so a consumer that omits it keeps the plain
|
|
7924
|
+
* right-click-always-opens behaviour.
|
|
7925
|
+
*/
|
|
7926
|
+
readonly resolveOpen?: (event: MouseEvent) => CngxContextMenuOpenDecision;
|
|
7927
|
+
/**
|
|
7928
|
+
* Veto/datum seam for the keyboard open gesture (`Shift+F10`). Evaluated
|
|
7929
|
+
* before `preventDefault()`, mirroring {@link resolveOpen}; the resolved
|
|
7930
|
+
* context goes through {@link commitContext} exactly like a pointer open,
|
|
7931
|
+
* so a keyboard open never serves a stale datum from an earlier
|
|
7932
|
+
* right-click. Defaults to always-open with `undefined` context.
|
|
7933
|
+
*/
|
|
7934
|
+
readonly resolveKeyboardOpen?: (event: KeyboardEvent) => CngxContextMenuOpenDecision;
|
|
7935
|
+
/** Receives the resolved context on a successful open. No-op by default. */
|
|
7936
|
+
readonly commitContext?: (context: unknown) => void;
|
|
7937
|
+
}
|
|
7938
|
+
/**
|
|
7939
|
+
* Shared context-menu trigger core. Owns the `contextmenu` / `Shift+F10`
|
|
7940
|
+
* handling, the transient pointer-anchor lifecycle, the dismiss binding,
|
|
7941
|
+
* announcer calls, and focus save/restore. Consumed by both
|
|
7942
|
+
* `CngxContextMenuTrigger` (directive) and `CngxContextMenuFor` (organism
|
|
7943
|
+
* trigger) so the two share one implementation without inheritance.
|
|
7944
|
+
*
|
|
7945
|
+
* @category common/interactive/menu
|
|
7946
|
+
*/
|
|
7947
|
+
interface CngxContextMenuTriggerCore {
|
|
7948
|
+
/** The dismissal source that closed the menu most recently. */
|
|
7949
|
+
readonly lastDismissSource: Signal<CngxMenuDismissSource | null>;
|
|
7950
|
+
/**
|
|
7951
|
+
* The core's submenu focus-stack model. Exposed for host-side wiring the
|
|
7952
|
+
* pure factory cannot install itself - the DI hosts pass it to
|
|
7953
|
+
* `connectSubmenuHoverToFocusStack` (an `effect`, so it needs their
|
|
7954
|
+
* injection context) to route submenu hover intent through the stack.
|
|
7955
|
+
*/
|
|
7956
|
+
readonly focusStack: CngxMenuFocusStack;
|
|
7957
|
+
/** `contextmenu` host handler - consults `resolveOpen` before opening. */
|
|
7958
|
+
handleContextMenu(event: MouseEvent): void;
|
|
7959
|
+
/** Keydown host handler - `Shift+F10` opens at the host centre. */
|
|
7960
|
+
handleKeydown(event: KeyboardEvent): void;
|
|
7961
|
+
/**
|
|
7962
|
+
* Open the submenu of the effective menu's active item through the focus
|
|
7963
|
+
* stack. No-op when the active item is a leaf (or nothing is active) and
|
|
7964
|
+
* idempotent when that submenu is already open. The DI host wires the
|
|
7965
|
+
* surrounding menu's `CngxActiveDescendant.activated` output to this method
|
|
7966
|
+
* so pointer click and Enter/Space open a submenu parent deterministically,
|
|
7967
|
+
* off the `activated` event rather than a forwarded keydown that races the
|
|
7968
|
+
* AD's own listener. No `activated` subscription lives inside this pure
|
|
7969
|
+
* factory - only the imperative open.
|
|
7970
|
+
*/
|
|
7971
|
+
openActiveSubmenu(): void;
|
|
7972
|
+
/**
|
|
7973
|
+
* Record that the active item's submenu is already open, pushing it onto
|
|
7974
|
+
* the focus stack WITHOUT re-opening it. Safety net for opens the stack did
|
|
7975
|
+
* not perform itself - the organism panel forwards it from the item's
|
|
7976
|
+
* `openAsSubmenu` terminal, covering programmatic opens; for hover and
|
|
7977
|
+
* click the stack already opened the submenu and this is an idempotent
|
|
7978
|
+
* no-op. No-op on a leaf.
|
|
7979
|
+
*/
|
|
7980
|
+
noteActiveSubmenuOpened(): void;
|
|
7981
|
+
/** Drive from the directive's `isOpen` effect (inside `untracked`). */
|
|
7982
|
+
syncOpenState(open: boolean): void;
|
|
7983
|
+
/**
|
|
7984
|
+
* Relinquish an open WITHOUT restoring focus: detach the dismiss binding,
|
|
7985
|
+
* clear the submenu stack, and discard the saved pre-open focus. For the
|
|
7986
|
+
* shared-panel handoff - when a sibling trigger claims the still-visible
|
|
7987
|
+
* panel, the losing core must stand down silently; a `syncOpenState(false)`
|
|
7988
|
+
* would yank focus out of the menu the new owner just opened.
|
|
7989
|
+
*/
|
|
7990
|
+
standDown(): void;
|
|
7991
|
+
/** Teardown - call from the directive's `DestroyRef.onDestroy`. */
|
|
7992
|
+
destroy(): void;
|
|
7993
|
+
}
|
|
7994
|
+
/**
|
|
7995
|
+
* Build a {@link CngxContextMenuTriggerCore} from its dependencies. Pure
|
|
7996
|
+
* factory - no Angular DI; the caller resolves collaborators and passes
|
|
7997
|
+
* them in.
|
|
7998
|
+
*
|
|
7999
|
+
* @category common/interactive/menu
|
|
8000
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/context-menu-trigger-core.ts
|
|
8001
|
+
* @since 0.1.0
|
|
8002
|
+
*/
|
|
8003
|
+
declare function createContextMenuTriggerCore(deps: CngxContextMenuTriggerCoreDeps): CngxContextMenuTriggerCore;
|
|
8004
|
+
|
|
6828
8005
|
/**
|
|
6829
8006
|
* Opens a `CngxMenu`-bearing popover at pointer coordinates in response to
|
|
6830
8007
|
* `contextmenu` (right-click) or `Shift+F10` (keyboard equivalent).
|
|
@@ -6836,8 +8013,15 @@ interface PopoverController$1 extends CngxMenuDismissPopoverRef {
|
|
|
6836
8013
|
* `[exclusive]="true"` (default) so that opening this menu light-dismisses
|
|
6837
8014
|
* any other popover.
|
|
6838
8015
|
*
|
|
8016
|
+
* A thin shell over {@link createContextMenuTriggerCore}: the core owns the
|
|
8017
|
+
* `contextmenu` / `Shift+F10` handling, the transient pointer anchor, the
|
|
8018
|
+
* dismiss binding, and focus save/restore, so `CngxContextMenuFor`
|
|
8019
|
+
* (`@cngx/ui/context-menu`) can reuse the same implementation without
|
|
8020
|
+
* inheritance. This directive supplies no `resolveOpen` seam, so it keeps
|
|
8021
|
+
* the always-open, always-`preventDefault` behaviour.
|
|
8022
|
+
*
|
|
6839
8023
|
* Anchoring uses a transient zero-size DOM element positioned at the
|
|
6840
|
-
* pointer coords,
|
|
8024
|
+
* pointer coords, installed via the popover's `setAnchorElement` - virtual
|
|
6841
8025
|
* `getBoundingClientRect` objects are not yet supported as anchors, so
|
|
6842
8026
|
* the transient div is the workaround.
|
|
6843
8027
|
*
|
|
@@ -6871,16 +8055,10 @@ declare class CngxContextMenuTrigger {
|
|
|
6871
8055
|
/** Menu controlled by this trigger. */
|
|
6872
8056
|
readonly menu: _angular_core.InputSignal<CngxMenuHost>;
|
|
6873
8057
|
/** Popover that wraps the menu panel. */
|
|
6874
|
-
readonly popover: _angular_core.InputSignal<
|
|
8058
|
+
readonly popover: _angular_core.InputSignal<CngxContextMenuTriggerPopoverRef>;
|
|
6875
8059
|
/** Mirrors `popover.isVisible()`. */
|
|
6876
8060
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
6877
|
-
private readonly
|
|
6878
|
-
private readonly hostElRef;
|
|
6879
|
-
private readonly menuConfig;
|
|
6880
|
-
private readonly announcer;
|
|
6881
|
-
private readonly dismissBinding;
|
|
6882
|
-
private virtualAnchor;
|
|
6883
|
-
private savedFocus;
|
|
8061
|
+
private readonly core;
|
|
6884
8062
|
/**
|
|
6885
8063
|
* The dismissal source that closed the menu most recently. `null`
|
|
6886
8064
|
* before the first close. Surface for demos, telemetry, and audit
|
|
@@ -6890,10 +8068,6 @@ declare class CngxContextMenuTrigger {
|
|
|
6890
8068
|
constructor();
|
|
6891
8069
|
protected handleContextMenu(event: MouseEvent): void;
|
|
6892
8070
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
6893
|
-
private openAt;
|
|
6894
|
-
private restoreFocus;
|
|
6895
|
-
private ensureVirtualAnchor;
|
|
6896
|
-
private removeVirtualAnchor;
|
|
6897
8071
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxContextMenuTrigger, never>;
|
|
6898
8072
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxContextMenuTrigger, "[cngxContextMenuTrigger]", ["cngxContextMenuTrigger"], { "menu": { "alias": "cngxContextMenuTrigger"; "required": true; "isSignal": true; }; "popover": { "alias": "popover"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
6899
8073
|
}
|
|
@@ -6950,7 +8124,9 @@ interface PopoverController extends CngxMenuDismissPopoverRef {
|
|
|
6950
8124
|
* its inner `CngxMenu` is pushed onto the stack so subsequent ArrowDown /
|
|
6951
8125
|
* Up / Home / End / Enter target the submenu's items via its own
|
|
6952
8126
|
* `CngxActiveDescendant`. ArrowLeft / Escape pop the stack and close the
|
|
6953
|
-
* top submenu.
|
|
8127
|
+
* top submenu. The stack model is supplied by
|
|
8128
|
+
* {@link CNGX_MENU_FOCUS_STACK_FACTORY}, so it is shared verbatim with the
|
|
8129
|
+
* context-menu trigger core and swappable enterprise-wide.
|
|
6954
8130
|
*
|
|
6955
8131
|
* ### Focus model
|
|
6956
8132
|
*
|
|
@@ -6991,25 +8167,19 @@ declare class CngxMenuTrigger {
|
|
|
6991
8167
|
readonly popover: _angular_core.InputSignal<PopoverController>;
|
|
6992
8168
|
/** Mirrors `CngxPopover.isVisible()`. */
|
|
6993
8169
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
6994
|
-
private readonly nav;
|
|
6995
|
-
/**
|
|
6996
|
-
* Active submenu chain - empty when only the outer menu is open. Each
|
|
6997
|
-
* entry is the `inner` host of an open submenu, top entry being the
|
|
6998
|
-
* deepest. Keystrokes target the top entry's AD.
|
|
6999
|
-
*/
|
|
7000
|
-
private readonly submenuStack;
|
|
7001
|
-
/**
|
|
7002
|
-
* Focused element captured at popover-open time. Restored after close via
|
|
7003
|
-
* `queueMicrotask` so the focus write happens after the popover-close DOM
|
|
7004
|
-
* mutation settles. Captured reactively via the `isOpen` effect below so
|
|
7005
|
-
* mouse-driven open paths (consumer's `(click)="pop.toggle()"`) get the
|
|
7006
|
-
* same treatment as keyboard-driven open paths.
|
|
7007
|
-
*/
|
|
7008
|
-
private savedFocus;
|
|
7009
8170
|
private readonly doc;
|
|
8171
|
+
private readonly direction;
|
|
7010
8172
|
private readonly hostElRef;
|
|
7011
8173
|
private readonly menuConfig;
|
|
8174
|
+
private readonly ariaLabels;
|
|
7012
8175
|
private readonly announcer;
|
|
8176
|
+
/**
|
|
8177
|
+
* Submenu focus-stack model - the active submenu chain, the saved-focus
|
|
8178
|
+
* slot restored after close, and the ArrowRight / ArrowLeft / Escape /
|
|
8179
|
+
* activation routing that consults `CNGX_MENU_NAV_STRATEGY`. Shared with
|
|
8180
|
+
* the context-menu trigger core via {@link CNGX_MENU_FOCUS_STACK_FACTORY}.
|
|
8181
|
+
*/
|
|
8182
|
+
private readonly focusStack;
|
|
7013
8183
|
private readonly dismissBinding;
|
|
7014
8184
|
/**
|
|
7015
8185
|
* The dismissal source that closed the menu most recently. `null`
|
|
@@ -7018,16 +8188,8 @@ declare class CngxMenuTrigger {
|
|
|
7018
8188
|
*/
|
|
7019
8189
|
readonly lastDismissSource: _angular_core.Signal<_cngx_common_interactive.CngxMenuDismissSource | null>;
|
|
7020
8190
|
constructor();
|
|
7021
|
-
private
|
|
8191
|
+
private openActiveSubmenu;
|
|
7022
8192
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
7023
|
-
private handleArrowRight;
|
|
7024
|
-
private handleArrowLeft;
|
|
7025
|
-
private handleActivation;
|
|
7026
|
-
private findSubmenu;
|
|
7027
|
-
private openSubmenu;
|
|
7028
|
-
private popSubmenu;
|
|
7029
|
-
private closeAll;
|
|
7030
|
-
private restoreFocus;
|
|
7031
8193
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuTrigger, never>;
|
|
7032
8194
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenuTrigger, "[cngxMenuTrigger]", ["cngxMenuTrigger"], { "menu": { "alias": "cngxMenuTrigger"; "required": true; "isSignal": true; }; "popover": { "alias": "popover"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
7033
8195
|
}
|
|
@@ -7293,7 +8455,7 @@ declare class CngxErrorSource {
|
|
|
7293
8455
|
* toggles. The span carries `role="status"` (or `role="alert"` when
|
|
7294
8456
|
* politeness is `'assertive'`), `aria-live`, `aria-atomic="true"`, and
|
|
7295
8457
|
* `aria-relevant="additions text"`. Visually-hidden styling is applied
|
|
7296
|
-
* inline via `--cngx-sr-only-*` CSS custom properties
|
|
8458
|
+
* inline via `--cngx-sr-only-*` CSS custom properties - no global
|
|
7297
8459
|
* stylesheet required.
|
|
7298
8460
|
*
|
|
7299
8461
|
* Set `[autoAnnounce]="false"` to take ownership of the live region in
|
|
@@ -7374,16 +8536,18 @@ declare class CngxErrorAggregator implements CngxErrorAggregatorContract {
|
|
|
7374
8536
|
* test harnesses) can inspect or drive form-error state without traversing
|
|
7375
8537
|
* the DOM. Directives with `cngxErrorScopeName` / `cngxErrorAggregatorName`
|
|
7376
8538
|
* inputs auto-register here when the registry is provided in the host
|
|
7377
|
-
* environment
|
|
8539
|
+
* environment via {@link provideErrorRegistry}.
|
|
7378
8540
|
*
|
|
7379
|
-
* Not `providedIn: 'root'`
|
|
8541
|
+
* Not `providedIn: 'root'` - consumers opt in by including
|
|
7380
8542
|
* `provideErrorRegistry()` in their `bootstrapApplication` providers. When
|
|
7381
8543
|
* the registry is absent, the directives skip registration and keep their
|
|
7382
8544
|
* pure DOM behaviour.
|
|
7383
8545
|
*
|
|
7384
|
-
* @
|
|
7385
|
-
*
|
|
7386
|
-
*
|
|
8546
|
+
* @category common/interactive/error
|
|
8547
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/error-registry.ts
|
|
8548
|
+
* @since 0.1.0
|
|
8549
|
+
* @relatedTo CngxErrorScope, CngxErrorAggregator, CngxErrorSource
|
|
8550
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/registry/provider-and-reveal-features</example-url>
|
|
7387
8551
|
*/
|
|
7388
8552
|
declare class CngxErrorRegistry {
|
|
7389
8553
|
private readonly scopesState;
|
|
@@ -7412,13 +8576,17 @@ declare class CngxErrorRegistry {
|
|
|
7412
8576
|
* registered instance.
|
|
7413
8577
|
*
|
|
7414
8578
|
* To perform a true swap, call `unregisterScope(name)` first, then
|
|
7415
|
-
* `registerScope(name, newScope)`
|
|
8579
|
+
* `registerScope(name, newScope)` - the unregister cycle changes the
|
|
7416
8580
|
* key set, the equal fn emits, and the new instance becomes the live
|
|
7417
8581
|
* value.
|
|
7418
8582
|
*/
|
|
7419
8583
|
registerScope(name: string, scope: CngxErrorScopeContract): void;
|
|
7420
|
-
/**
|
|
7421
|
-
|
|
8584
|
+
/**
|
|
8585
|
+
* Removes the named scope, but only when `scope` is the stored instance.
|
|
8586
|
+
* No-op if absent or if a different instance holds the name - a late
|
|
8587
|
+
* destroy of a swap-absorbed duplicate must not evict the live winner.
|
|
8588
|
+
*/
|
|
8589
|
+
unregisterScope(name: string, scope: CngxErrorScopeContract): void;
|
|
7422
8590
|
/** Returns the named scope, or `undefined` when not registered. */
|
|
7423
8591
|
getScope(name: string): CngxErrorScopeContract | undefined;
|
|
7424
8592
|
/**
|
|
@@ -7433,8 +8601,12 @@ declare class CngxErrorRegistry {
|
|
|
7433
8601
|
* for a true swap.
|
|
7434
8602
|
*/
|
|
7435
8603
|
registerAggregator(name: string, aggregator: CngxErrorAggregatorContract): void;
|
|
7436
|
-
/**
|
|
7437
|
-
|
|
8604
|
+
/**
|
|
8605
|
+
* Removes the named aggregator, but only when `aggregator` is the stored
|
|
8606
|
+
* instance. No-op if absent or if a different instance holds the name - a
|
|
8607
|
+
* late destroy of a swap-absorbed duplicate must not evict the live winner.
|
|
8608
|
+
*/
|
|
8609
|
+
unregisterAggregator(name: string, aggregator: CngxErrorAggregatorContract): void;
|
|
7438
8610
|
/** Returns the named aggregator, or `undefined` when not registered. */
|
|
7439
8611
|
getAggregator(name: string): CngxErrorAggregatorContract | undefined;
|
|
7440
8612
|
/** Reveals the named scope. Idempotent; no-op if name not registered. */
|
|
@@ -7453,7 +8625,7 @@ declare class CngxErrorRegistry {
|
|
|
7453
8625
|
* Creates a programmatic {@link CngxErrorScopeContract}, optionally
|
|
7454
8626
|
* registered under `name` in the ambient {@link CngxErrorRegistry}.
|
|
7455
8627
|
*
|
|
7456
|
-
* Use when an error scope must exist without a DOM host
|
|
8628
|
+
* Use when an error scope must exist without a DOM host - e.g. inside a
|
|
7457
8629
|
* route guard, an HTTP interceptor, or a service that drives error
|
|
7458
8630
|
* visibility programmatically. When `name` is set and a registry is
|
|
7459
8631
|
* provided in the host environment, the scope auto-registers and
|
|
@@ -7462,9 +8634,11 @@ declare class CngxErrorRegistry {
|
|
|
7462
8634
|
* Must be called in an injection context (constructor, factory provider,
|
|
7463
8635
|
* `runInInjectionContext`).
|
|
7464
8636
|
*
|
|
7465
|
-
* @
|
|
7466
|
-
*
|
|
7467
|
-
*
|
|
8637
|
+
* @category common/interactive/error
|
|
8638
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/inject-error-scope.ts
|
|
8639
|
+
* @since 0.1.0
|
|
8640
|
+
* @relatedTo CngxErrorScope
|
|
8641
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/registry/inject-error-scope-programmatic</example-url>
|
|
7468
8642
|
*/
|
|
7469
8643
|
declare function injectErrorScope(name?: string): CngxErrorScopeContract;
|
|
7470
8644
|
|
|
@@ -7494,25 +8668,30 @@ declare function injectErrorScope(name?: string): CngxErrorScopeContract;
|
|
|
7494
8668
|
* ({@link `@cngx/common/interactive`#CngxErrorAggregator}) and the
|
|
7495
8669
|
* function form share a single source of truth.
|
|
7496
8670
|
*
|
|
7497
|
-
* @
|
|
7498
|
-
*
|
|
7499
|
-
*
|
|
8671
|
+
* @category common/interactive/error
|
|
8672
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/inject-error-aggregator.ts
|
|
8673
|
+
* @since 0.1.0
|
|
8674
|
+
* @relatedTo CngxErrorAggregator
|
|
8675
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/registry/inject-error-aggregator-programmatic</example-url>
|
|
7500
8676
|
*/
|
|
7501
8677
|
declare function injectErrorAggregator(name?: string, sources?: Record<string, Signal<boolean>>, scope?: CngxErrorScopeContract, labels?: Record<string, string>): CngxErrorAggregatorContract;
|
|
7502
8678
|
|
|
7503
8679
|
/**
|
|
7504
|
-
*
|
|
7505
|
-
*
|
|
7506
|
-
*
|
|
8680
|
+
* Feature-composition accumulator for {@link provideErrorRegistry}.
|
|
8681
|
+
*
|
|
8682
|
+
* @internal
|
|
7507
8683
|
*/
|
|
7508
8684
|
interface _ErrorRegistryConfig {
|
|
7509
8685
|
revealOnSubmit?: boolean;
|
|
7510
8686
|
revealOnNavigate?: boolean;
|
|
7511
8687
|
}
|
|
7512
8688
|
/**
|
|
7513
|
-
*
|
|
7514
|
-
*
|
|
7515
|
-
*
|
|
8689
|
+
* A feature configuration function accepted by {@link provideErrorRegistry},
|
|
8690
|
+
* returned by the `with*` helpers. Mirrors the `NavConfigFeature` shape.
|
|
8691
|
+
*
|
|
8692
|
+
* @category common/interactive/error
|
|
8693
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/provide-error-registry.ts
|
|
8694
|
+
* @since 0.1.0
|
|
7516
8695
|
*/
|
|
7517
8696
|
interface ErrorRegistryFeature {
|
|
7518
8697
|
/** @internal */
|
|
@@ -7537,15 +8716,17 @@ interface ErrorRegistryFeature {
|
|
|
7537
8716
|
* });
|
|
7538
8717
|
* ```
|
|
7539
8718
|
*
|
|
7540
|
-
* @
|
|
7541
|
-
*
|
|
7542
|
-
*
|
|
8719
|
+
* @category common/interactive/error
|
|
8720
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/provide-error-registry.ts
|
|
8721
|
+
* @since 0.1.0
|
|
8722
|
+
* @relatedTo CngxErrorScope, CngxErrorAggregator
|
|
8723
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/registry/provider-and-reveal-features</example-url>
|
|
7543
8724
|
*/
|
|
7544
8725
|
declare function provideErrorRegistry(...features: ErrorRegistryFeature[]): EnvironmentProviders;
|
|
7545
8726
|
/**
|
|
7546
8727
|
* Reveals every registered scope on any DOM `submit` event.
|
|
7547
8728
|
*
|
|
7548
|
-
* **Coarse-grained
|
|
8729
|
+
* **Coarse-grained - affects every registered scope, every form.** The
|
|
7549
8730
|
* feature installs a capture-phase document listener that calls
|
|
7550
8731
|
* `registry.revealAll()` on any submit anywhere in the document, even
|
|
7551
8732
|
* when the submit fires from a form unrelated to the scope of interest.
|
|
@@ -7554,12 +8735,13 @@ declare function provideErrorRegistry(...features: ErrorRegistryFeature[]): Envi
|
|
|
7554
8735
|
*
|
|
7555
8736
|
* For finer-grained reveals (per-form, per-flow), skip this feature and
|
|
7556
8737
|
* call `registry.reveal(name)` from the consumer's submit handler
|
|
7557
|
-
* instead
|
|
8738
|
+
* instead - the scope-name registration path stays available without
|
|
7558
8739
|
* the global listener.
|
|
7559
8740
|
*
|
|
7560
|
-
* @
|
|
7561
|
-
*
|
|
7562
|
-
*
|
|
8741
|
+
* @category common/interactive/error
|
|
8742
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/provide-error-registry.ts
|
|
8743
|
+
* @since 0.1.0
|
|
8744
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/registry/provider-and-reveal-features</example-url>
|
|
7563
8745
|
*/
|
|
7564
8746
|
declare function withGlobalRevealOnSubmit(): ErrorRegistryFeature;
|
|
7565
8747
|
/**
|
|
@@ -7575,11 +8757,12 @@ declare function withGlobalRevealOnSubmit(): ErrorRegistryFeature;
|
|
|
7575
8757
|
* the common pattern (reveal-all on attempted navigation) but surface
|
|
7576
8758
|
* the implication when wiring a guard that cancels based on form errors.
|
|
7577
8759
|
*
|
|
7578
|
-
* @
|
|
7579
|
-
*
|
|
7580
|
-
*
|
|
8760
|
+
* @category common/interactive/error
|
|
8761
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-registry/provide-error-registry.ts
|
|
8762
|
+
* @since 0.1.0
|
|
8763
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/registry/provider-and-reveal-features</example-url>
|
|
7581
8764
|
*/
|
|
7582
8765
|
declare function withRevealOnNavigate(): ErrorRegistryFeature;
|
|
7583
8766
|
|
|
7584
|
-
export { CNGX_ACCORDION, CNGX_BREADCRUMB, CNGX_BREADCRUMB_COLLAPSE_STRATEGY, CNGX_BUTTON_MULTI_TOGGLE_GROUP, CNGX_BUTTON_TOGGLE_GROUP, CNGX_CHIP_GROUP_HOST, CNGX_CHIP_STRIP_ROVING_FACTORY, CNGX_CLOSE_ICON, CNGX_CONTROL_VALUE, CNGX_ERROR_AGGREGATOR, CNGX_ERROR_SCOPE, CNGX_HIERARCHICAL_NAV_STRATEGY, CNGX_HOVER_INTENT_DEFAULTS, CNGX_MENU_ANNOUNCER_FACTORY, CNGX_MENU_CONFIG, CNGX_MENU_DISMISS_HANDLER_FACTORY, CNGX_MENU_HOST, CNGX_MENU_NAV_STRATEGY, CNGX_MENU_RADIO_GROUP, CNGX_MENU_SUBMENU_ITEM, CNGX_NAV_CONFIG, CNGX_OPTION_CONTAINER, CNGX_OPTION_FILTER_HOST, CNGX_OPTION_INTERACTION_HOST, CNGX_OPTION_STATUS_HOST, CNGX_RADIO_GROUP, CNGX_SLIDER_RANGE, CNGX_SUBMENU_TRY_FALLBACKS, CNGX_TREE_CONFIG, CNGX_TREE_CONTROLLER_FACTORY, CngxAccordion, CngxAccordionPanel, CngxAsyncClick, CngxAsyncStatus, CngxBeforeUnload, CngxBreadcrumb, CngxBreadcrumbItem, CngxBreadcrumbSeparator, CngxButtonMultiToggleGroup, CngxButtonToggle, CngxButtonToggleGroup, CngxCheckbox, CngxCheckboxGroup, CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction, CngxClickOutside, CngxCloseButton, CngxContextMenuTrigger, CngxCopyBlock, CngxCopyText, CngxDisclosure, CngxErrorAggregator, CngxErrorRegistry, CngxErrorScope, CngxErrorSource, CngxErrorState, CngxExpandable, CngxFailed, CngxHierarchicalNav, CngxHoverIntent, CngxHoverable, CngxKeyboardShortcut, CngxListbox, CngxListboxSearch, CngxListboxTrigger, CngxLongPress, CngxMenu, CngxMenuAnnouncer, CngxMenuGroup, CngxMenuItem, CngxMenuItemCheckbox, CngxMenuItemIcon, CngxMenuItemKbd, CngxMenuItemLabel, CngxMenuItemRadio, CngxMenuItemSubmenu, CngxMenuItemSuffix, CngxMenuSeparator, CngxMenuTrigger, CngxMultiChipGroup, CngxNavBadge, CngxNavGroup, CngxNavGroupRegistry, CngxNavLabel, CngxNavLink, CngxOption, CngxOptionGroup, CngxPending, CngxPressRipple, CngxPressable, CngxRadio, CngxRadioGroup, CngxRangeSlider, CngxRangeSliderTrack, CngxReorder, CngxRipple, CngxSearch, CngxSlider, CngxSliderThumb, CngxSliderTrack, CngxSpeak, CngxSucceeded, CngxSwipe, CngxSwipeDismiss, CngxToggle,
|
|
7585
|
-
export type { AsyncAction, CngxAccordionHeaderHandle, CngxAccordionHost, CngxAccordionKeyboardNav, CngxAccordionKeyboardNavHost, CngxAccordionKeyboardNavOptions, CngxAsyncDisplayStatus, CngxBreadcrumbCollapseStrategy, CngxBreadcrumbHost,
|
|
8767
|
+
export { CNGX_ACCORDION, CNGX_BREADCRUMB, CNGX_BREADCRUMB_COLLAPSE_STRATEGY, CNGX_BUTTON_MULTI_TOGGLE_GROUP, CNGX_BUTTON_TOGGLE_GROUP, CNGX_CHIP_GROUP_HOST, CNGX_CHIP_STRIP_ROVING_FACTORY, CNGX_CLOSE_ICON, CNGX_CONTROL_VALUE, CNGX_ERROR_AGGREGATOR, CNGX_ERROR_SCOPE, CNGX_HIERARCHICAL_NAV_STRATEGY, CNGX_HOVER_INTENT_DEFAULTS, CNGX_INTERACTIVE_I18N, CNGX_INTERACTIVE_LANGUAGE_EN, CNGX_MENU_ANNOUNCER_FACTORY, CNGX_MENU_CONFIG, CNGX_MENU_DISMISS_HANDLER_FACTORY, CNGX_MENU_FOCUS_STACK_FACTORY, CNGX_MENU_HOST, CNGX_MENU_LANGUAGE_EN, CNGX_MENU_NAV_STRATEGY, CNGX_MENU_RADIO_GROUP, CNGX_MENU_SUBMENU_ITEM, CNGX_MENU_SUBMENU_WIRING, CNGX_NAV_CONFIG, CNGX_OPTION_CONTAINER, CNGX_OPTION_FILTER_HOST, CNGX_OPTION_INTERACTION_HOST, CNGX_OPTION_STATUS_HOST, CNGX_RADIO_GROUP, CNGX_SLIDER_RANGE, CNGX_SUBMENU_TRY_FALLBACKS, CNGX_TREE_CONFIG, CNGX_TREE_CONTROLLER_FACTORY, CngxAccordion, CngxAccordionPanel, CngxAsyncClick, CngxAsyncStatus, CngxBeforeUnload, CngxBreadcrumb, CngxBreadcrumbItem, CngxBreadcrumbSeparator, CngxButtonMultiToggleGroup, CngxButtonToggle, CngxButtonToggleGroup, CngxCheckbox, CngxCheckboxGroup, CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction, CngxClickOutside, CngxCloseButton, CngxContextMenuTrigger, CngxCopyBlock, CngxCopyText, CngxDisclosure, CngxErrorAggregator, CngxErrorRegistry, CngxErrorScope, CngxErrorSource, CngxErrorState, CngxExpandable, CngxFailed, CngxHierarchicalNav, CngxHoverIntent, CngxHoverable, CngxKeyboardShortcut, CngxListbox, CngxListboxSearch, CngxListboxTrigger, CngxLongPress, CngxMenu, CngxMenuAnnouncer, CngxMenuGroup, CngxMenuItem, CngxMenuItemCheckbox, CngxMenuItemIcon, CngxMenuItemKbd, CngxMenuItemLabel, CngxMenuItemRadio, CngxMenuItemSubmenu, CngxMenuItemSuffix, CngxMenuSeparator, CngxMenuTrigger, CngxMultiChipGroup, CngxNavBadge, CngxNavGroup, CngxNavGroupRegistry, CngxNavLabel, CngxNavLink, CngxOption, CngxOptionGroup, CngxPending, CngxPressRipple, CngxPressable, CngxRadio, CngxRadioGroup, CngxRangeSlider, CngxRangeSliderTrack, CngxReorder, CngxRipple, CngxSearch, CngxSlider, CngxSliderThumb, CngxSliderTrack, CngxSpeak, CngxSucceeded, CngxSwipe, CngxSwipeDismiss, CngxToggle, DEFAULT_MENU_CONFIG, canDeactivateWhenClean, connectSubmenuHoverToFocusStack, createAccordionKeyboardNav, createBreadcrumbCollapse, createChipStripRoving, createContextMenuTriggerCore, createListboxLabelMatch, createMenuAnnouncer, createMenuDismissHandler, createMenuFocusStack, createMenuRadioController, createMenuTriggerDismissBinding, createOptimistic, createRetry, createSliderCore, createTreeAdItems, createTreeController, createW3CMenuStrategy, createW3CTreeStrategy, injectErrorAggregator, injectErrorScope, injectInteractiveGroupHost, injectInteractiveI18n, injectMenuAnnouncer, injectMenuConfig, injectMenuItemCore, injectNavConfig, injectTreeConfig, optimistic, provideCngxMenu, provideErrorRegistry, provideInteractiveI18n, provideMenuConfig, provideMenuConfigAt, provideNavConfig, provideNavConfigAt, provideTreeConfig, provideTreeConfigAt, reflectAsyncDisplayStatus, withAriaLabels, withCloseOnSelect, withDefaultInitiallyExpanded, withDefaultKeyFn, withDefaultLabelFn, withDefaultNodeIdFn, withDismissOnBlur, withDismissOnOutsideClick, withDismissOnScroll, withGlobalRevealOnSubmit, withInteractiveI18nLabels, withNavAnimation, withNavIndent, withRetry, withRevealOnNavigate, withSingleAccordion, withSubmenuCloseDelay, withSubmenuOpenDelay, withTreeCacheLimit, withTypeaheadDebounce };
|
|
8768
|
+
export type { AsyncAction, CngxAccordionHeaderHandle, CngxAccordionHost, CngxAccordionKeyboardNav, CngxAccordionKeyboardNavHost, CngxAccordionKeyboardNavOptions, CngxAsyncDisplayStatus, CngxBreadcrumbCollapseStrategy, CngxBreadcrumbHost, CngxButtonMultiToggleGroupContract, CngxButtonToggleGroupContract, CngxChipGroupHost, CngxChipStripRovingController, CngxChipStripRovingFactory, CngxChipStripRovingOptions, CngxContextMenuOpenDecision, CngxContextMenuTriggerCore, CngxContextMenuTriggerCoreDeps, CngxContextMenuTriggerPopoverRef, CngxControlValue, CngxErrorAggregatorContract, CngxErrorAggregatorSourceEntry, CngxErrorScopeContract, CngxHierarchicalNavAction, CngxHierarchicalNavContext, CngxHierarchicalNavStrategy, CngxHoverIntentDefaults, CngxInteractiveGroupHost, CngxInteractiveGroupHostOptions, CngxInteractiveI18n, CngxInteractiveI18nFeature, CngxInteractiveLanguageSection, CngxMenuAnnouncerFactory, CngxMenuAnnouncerLike, CngxMenuAriaLabels, CngxMenuConfig, CngxMenuConfigFeature, CngxMenuDismissHandler, CngxMenuDismissHandlerFactory, CngxMenuDismissHandlerOptions, CngxMenuDismissPopoverRef, CngxMenuDismissSource, CngxMenuFeature, CngxMenuFocusStack, CngxMenuFocusStackDeps, CngxMenuFocusStackFactory, CngxMenuFocusStackPopoverRef, CngxMenuHost, CngxMenuItemCore, CngxMenuItemCoreOptions, CngxMenuLanguageSection, CngxMenuNavAction, CngxMenuNavContext, CngxMenuNavStrategy, CngxMenuRadioGroup, CngxMenuRadioGroupFactory, CngxMenuSubmenuLike, CngxMenuSubmenuPopoverRef, CngxMenuSubmenuWiring, CngxMenuTriggerDismissBinding, CngxMenuTriggerDismissBindingOptions, CngxNavConfig, CngxOptionContainer, CngxOptionContainerGroup, CngxOptionContainerOption, CngxOptionFilterHost, CngxOptionInteractionHost, CngxOptionStatus, CngxOptionStatusHost, CngxRadioGroupContract, CngxRadioRegistration, CngxReorderEvent, CngxReorderModifier, CngxSliderCore, CngxSliderCoreOptions, CngxSliderRangeHost, CngxSliderThumbBounds, CngxSliderThumbPosition, CngxSubmenuHoverRoutingDeps, CngxTreeConfig, CngxTreeConfigFeature, CngxTreeController, CngxTreeControllerFactory, CngxTreeControllerOptions, ErrorRegistryFeature, ListboxMatchFn, NavBadgeVariant, NavConfigFeature, OptimisticState, RetryConfig, RetryState, SwipeAxis, SwipeDirection };
|