@cngx/common 0.0.1-rc.0 → 0.1.0-rc.1
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/a11y/README.md +13 -16
- package/card/README.md +2 -21
- package/chart/README.md +5 -8
- package/data/README.md +45 -47
- package/dialog/README.md +12 -15
- package/display/README.md +5 -9
- package/fesm2022/cngx-common-a11y.mjs +164 -51
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +157 -69
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +389 -92
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +311 -151
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +167 -29
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +445 -110
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2059 -435
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +188 -31
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +711 -90
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +1479 -73
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1144 -85
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +2 -2
- package/fesm2022/cngx-common.mjs.map +1 -1
- package/interactive/README.md +5 -5
- package/layout/README.md +2 -2
- package/package.json +7 -6
- package/popover/README.md +8 -34
- package/stepper/README.md +69 -8
- package/tabs/README.md +6 -6
- package/theming/components/cngx-async.css +74 -0
- package/theming/components/cngx-backdrop.css +73 -0
- package/theming/components/cngx-badge.css +340 -0
- package/theming/components/cngx-bottom-sheet.css +201 -0
- package/theming/components/cngx-button-toggle.css +99 -0
- package/theming/components/cngx-dialog.css +358 -0
- package/theming/components/cngx-divider.css +145 -0
- package/theming/components/cngx-listbox.css +220 -0
- package/theming/components/cngx-menu.css +371 -0
- package/theming/components/cngx-ripple.css +116 -0
- package/theming/components/cngx-tooltip.css +265 -0
- package/theming/system-tokens.css +24 -0
- package/types/cngx-common-a11y.d.ts +159 -38
- package/types/cngx-common-card.d.ts +137 -22
- package/types/cngx-common-chart.d.ts +337 -40
- package/types/cngx-common-data.d.ts +277 -45
- package/types/cngx-common-dialog.d.ts +162 -22
- package/types/cngx-common-display.d.ts +422 -78
- package/types/cngx-common-interactive.d.ts +1880 -305
- package/types/cngx-common-layout.d.ts +191 -28
- package/types/cngx-common-popover.d.ts +632 -87
- package/types/cngx-common-stepper.d.ts +1360 -45
- package/types/cngx-common-tabs.d.ts +1139 -56
- package/types/cngx-common.d.ts +1 -1
- package/README.md +0 -18
|
@@ -7,8 +7,13 @@ import { CngxFormFieldControl } from '@cngx/core/tokens';
|
|
|
7
7
|
import * as i1 from '@cngx/common/a11y';
|
|
8
8
|
import { ActiveDescendantItem, CngxActiveDescendant, CngxAdItemHandle } from '@cngx/common/a11y';
|
|
9
9
|
import { FlatTreeNode, CngxTreeNode } from '@cngx/utils';
|
|
10
|
+
import * as _cngx_common_interactive from '@cngx/common/interactive';
|
|
10
11
|
|
|
11
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Action function that returns a Promise or Observable.
|
|
14
|
+
*
|
|
15
|
+
* @category common/interactive
|
|
16
|
+
*/
|
|
12
17
|
type AsyncAction = () => Promise<unknown> | Observable<unknown>;
|
|
13
18
|
/**
|
|
14
19
|
* Async action handler with loading state, auto-disable, and success/error feedback.
|
|
@@ -42,6 +47,15 @@ type AsyncAction = () => Promise<unknown> | Observable<unknown>;
|
|
|
42
47
|
* ```html
|
|
43
48
|
* <a role="button" [cngxAsyncClick]="navigate" #btn="cngxAsyncClick">Go</a>
|
|
44
49
|
* ```
|
|
50
|
+
*
|
|
51
|
+
* @category common/interactive
|
|
52
|
+
* @docsKind primary
|
|
53
|
+
* @wcag AA
|
|
54
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-click.directive.ts
|
|
55
|
+
* @since 0.1.0
|
|
56
|
+
* @relatedTo CngxPending, CngxSucceeded, CngxFailed, CngxActionButton
|
|
57
|
+
* <example-url>http://localhost:4200/#/common/interactive/retry/optimistic-instant-like-toggle</example-url>
|
|
58
|
+
* <example-url>http://localhost:4200/#/common/interactive/retry/withretry-cngxasyncclick</example-url>
|
|
45
59
|
*/
|
|
46
60
|
declare class CngxAsyncClick {
|
|
47
61
|
private readonly el;
|
|
@@ -73,15 +87,15 @@ declare class CngxAsyncClick {
|
|
|
73
87
|
readonly failed: Signal<boolean>;
|
|
74
88
|
/** The error value from a failed action. Cleared on reset. */
|
|
75
89
|
readonly error: Signal<unknown>;
|
|
76
|
-
/** Current lifecycle status
|
|
90
|
+
/** Current lifecycle status - use in `@switch` for template branching. */
|
|
77
91
|
readonly status: Signal<AsyncStatus>;
|
|
78
|
-
/** Screen reader announcement for the current state
|
|
92
|
+
/** Screen reader announcement for the current state - bind to an `aria-live` region. */
|
|
79
93
|
readonly announcement: Signal<string>;
|
|
80
94
|
/**
|
|
81
95
|
* Full `CngxAsyncState` view of this directive's lifecycle.
|
|
82
96
|
*
|
|
83
97
|
* Bind to any state consumer (`[state]="btn.state"`) to connect the
|
|
84
|
-
* feedback system
|
|
98
|
+
* feedback system - toasts, alerts, skeletons, async containers.
|
|
85
99
|
*/
|
|
86
100
|
readonly state: CngxAsyncState<unknown>;
|
|
87
101
|
/** @internal */
|
|
@@ -103,6 +117,15 @@ declare class CngxAsyncClick {
|
|
|
103
117
|
* ```html
|
|
104
118
|
* <ng-template cngxPending>Saving...</ng-template>
|
|
105
119
|
* ```
|
|
120
|
+
*
|
|
121
|
+
* @category common/interactive
|
|
122
|
+
* @wcag AA
|
|
123
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts
|
|
124
|
+
* @since 0.1.0
|
|
125
|
+
* @relatedTo CngxSucceeded, CngxFailed, CngxAsyncClick
|
|
126
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>
|
|
127
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>
|
|
128
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>
|
|
106
129
|
*/
|
|
107
130
|
declare class CngxPending {
|
|
108
131
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -115,6 +138,15 @@ declare class CngxPending {
|
|
|
115
138
|
* ```html
|
|
116
139
|
* <ng-template cngxSucceeded>Saved!</ng-template>
|
|
117
140
|
* ```
|
|
141
|
+
*
|
|
142
|
+
* @category common/interactive
|
|
143
|
+
* @wcag AA
|
|
144
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts
|
|
145
|
+
* @since 0.1.0
|
|
146
|
+
* @relatedTo CngxPending, CngxFailed, CngxAsyncClick
|
|
147
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>
|
|
148
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>
|
|
149
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>
|
|
118
150
|
*/
|
|
119
151
|
declare class CngxSucceeded {
|
|
120
152
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -128,6 +160,15 @@ declare class CngxSucceeded {
|
|
|
128
160
|
* ```html
|
|
129
161
|
* <ng-template cngxFailed let-err>Failed: {{ err }}</ng-template>
|
|
130
162
|
* ```
|
|
163
|
+
*
|
|
164
|
+
* @category common/interactive
|
|
165
|
+
* @wcag AA
|
|
166
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-click/async-status-templates.ts
|
|
167
|
+
* @since 0.1.0
|
|
168
|
+
* @relatedTo CngxPending, CngxSucceeded, CngxAsyncClick
|
|
169
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/random-outcome</example-url>
|
|
170
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/string-labels</example-url>
|
|
171
|
+
* <example-url>http://localhost:4200/#/ui/action-button/async-button/template-slots</example-url>
|
|
131
172
|
*/
|
|
132
173
|
declare class CngxFailed {
|
|
133
174
|
readonly templateRef: TemplateRef<any>;
|
|
@@ -136,7 +177,82 @@ declare class CngxFailed {
|
|
|
136
177
|
}
|
|
137
178
|
|
|
138
179
|
/**
|
|
139
|
-
*
|
|
180
|
+
* Display bucket a reflector collapses an {@link CngxAsyncState} into.
|
|
181
|
+
* The `loading` / `refreshing` busy variants fold into `pending` for the
|
|
182
|
+
* visible status, while `isBusy` carries the full busy set for ARIA.
|
|
183
|
+
*
|
|
184
|
+
* @category common/interactive
|
|
185
|
+
*/
|
|
186
|
+
type CngxAsyncDisplayStatus = 'idle' | 'pending' | 'success' | 'error';
|
|
187
|
+
/**
|
|
188
|
+
* Single source for collapsing a {@link CngxAsyncState} into its display
|
|
189
|
+
* bucket. Owned by the {@link CngxAsyncStatus} reflector so every consumer
|
|
190
|
+
* (the reflector directive, `CngxActionButton`'s `[externalState]` branch)
|
|
191
|
+
* maps an externally-owned state the same way - one reflection code path.
|
|
192
|
+
*
|
|
193
|
+
* @category common/interactive
|
|
194
|
+
*/
|
|
195
|
+
declare function reflectAsyncDisplayStatus(state: CngxAsyncState<unknown> | null | undefined): CngxAsyncDisplayStatus;
|
|
196
|
+
/**
|
|
197
|
+
* Reflects an externally-owned {@link CngxAsyncState} onto its host -
|
|
198
|
+
* the read-only sibling of `CngxAsyncClick`. Where `CngxAsyncClick`
|
|
199
|
+
* *runs* an action and owns its own lifecycle, `CngxAsyncStatus` *reads*
|
|
200
|
+
* a state someone else produces (a presenter's `commitState`, a resource)
|
|
201
|
+
* and surfaces it as `aria-busy`, an optional disabled gate, and the
|
|
202
|
+
* pending / succeeded / failed slot markers.
|
|
203
|
+
*
|
|
204
|
+
* One responsibility - reflection - kept distinct from running an action
|
|
205
|
+
* (Pillar 3). `aria-busy` lives in the `computed()` graph (Pillar 2) and
|
|
206
|
+
* is owned here exclusively: never co-place this with `CngxAsyncClick` on
|
|
207
|
+
* the same element, since both bind `aria-busy` (dev mode warns).
|
|
208
|
+
*
|
|
209
|
+
* ```html
|
|
210
|
+
* <button [cngxAsyncStatus]="presenter.commitState" disableWhilePending>
|
|
211
|
+
* Continue
|
|
212
|
+
* <ng-template cngxPending>Saving…</ng-template>
|
|
213
|
+
* </button>
|
|
214
|
+
* ```
|
|
215
|
+
*
|
|
216
|
+
* @category common/interactive
|
|
217
|
+
* @docsKind primary
|
|
218
|
+
* @wcag AA
|
|
219
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/async-status/async-status.directive.ts
|
|
220
|
+
* @since 0.1.0
|
|
221
|
+
* @relatedTo CngxAsyncClick, CngxPending, CngxSucceeded, CngxFailed
|
|
222
|
+
*/
|
|
223
|
+
declare class CngxAsyncStatus {
|
|
224
|
+
private readonly coPlacedAsyncClick;
|
|
225
|
+
constructor();
|
|
226
|
+
/** The externally-owned state to reflect. `null` reflects as idle. */
|
|
227
|
+
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | null>;
|
|
228
|
+
/** When `true`, the host reflects `aria-disabled` / `disabled` while busy. */
|
|
229
|
+
readonly disableWhilePending: _angular_core.InputSignal<boolean>;
|
|
230
|
+
/** Display bucket of the reflected state (`loading`/`refreshing` → `pending`). */
|
|
231
|
+
readonly status: Signal<CngxAsyncDisplayStatus>;
|
|
232
|
+
/** `true` while the reflected state is busy (`loading` | `pending` | `refreshing`). */
|
|
233
|
+
readonly isBusy: Signal<boolean>;
|
|
234
|
+
/** The reflected error value, or `undefined`. */
|
|
235
|
+
readonly error: Signal<unknown>;
|
|
236
|
+
/** @internal */
|
|
237
|
+
protected readonly pendingTpl: Signal<CngxPending | undefined>;
|
|
238
|
+
/** @internal */
|
|
239
|
+
protected readonly succeededTpl: Signal<CngxSucceeded | undefined>;
|
|
240
|
+
/** @internal */
|
|
241
|
+
protected readonly failedTpl: Signal<CngxFailed | undefined>;
|
|
242
|
+
/**
|
|
243
|
+
* The projected slot marker matching the current display bucket, or
|
|
244
|
+
* `null` when none is projected. Bind via
|
|
245
|
+
* `*ngTemplateOutlet="status.activeTemplate()"`.
|
|
246
|
+
*/
|
|
247
|
+
readonly activeTemplate: Signal<TemplateRef<unknown> | null>;
|
|
248
|
+
/** @internal - `''` (set) while gated-and-busy, else `null` (absent). */
|
|
249
|
+
protected readonly disabledAttr: Signal<"" | null>;
|
|
250
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxAsyncStatus, never>;
|
|
251
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxAsyncStatus, "[cngxAsyncStatus]", ["cngxAsyncStatus"], { "state": { "alias": "cngxAsyncStatus"; "required": false; "isSignal": true; }; "disableWhilePending": { "alias": "disableWhilePending"; "required": false; "isSignal": true; }; }, {}, ["pendingTpl", "succeededTpl", "failedTpl"], never, true, never>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Clipboard copy behavior - forms-free version for `@cngx/common`.
|
|
140
256
|
*
|
|
141
257
|
* Place on a button or any clickable element. Copies the provided text to the
|
|
142
258
|
* clipboard. Shows a `copied` signal for visual feedback (auto-resets after
|
|
@@ -161,6 +277,15 @@ declare class CngxFailed {
|
|
|
161
277
|
* {{ cp.copied() ? 'Link copied to clipboard' : '' }}
|
|
162
278
|
* </span>
|
|
163
279
|
* ```
|
|
280
|
+
*
|
|
281
|
+
* @category common/interactive
|
|
282
|
+
* @docsKind primary
|
|
283
|
+
* @wcag AA
|
|
284
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/copy/copy-text.directive.ts
|
|
285
|
+
* @since 0.1.0
|
|
286
|
+
* @relatedTo CngxCopyBlock, CngxCopyValue
|
|
287
|
+
* <example-url>http://localhost:4200/#/common/interactive/copy/text/copy-token</example-url>
|
|
288
|
+
* <example-url>http://localhost:4200/#/common/interactive/copy/text/copy-url-with-sr-announcement</example-url>
|
|
164
289
|
*/
|
|
165
290
|
declare class CngxCopyText {
|
|
166
291
|
private readonly destroyRef;
|
|
@@ -211,6 +336,15 @@ declare class CngxCopyText {
|
|
|
211
336
|
* {{ apiKey() }}
|
|
212
337
|
* </cngx-copy-block>
|
|
213
338
|
* ```
|
|
339
|
+
*
|
|
340
|
+
* @category common/interactive
|
|
341
|
+
* @docsKind primary
|
|
342
|
+
* @wcag AA
|
|
343
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/copy/copy-block.ts
|
|
344
|
+
* @since 0.1.0
|
|
345
|
+
* @relatedTo CngxCopyText
|
|
346
|
+
* <example-url>http://localhost:4200/#/common/interactive/copy/block/api-key</example-url>
|
|
347
|
+
* <example-url>http://localhost:4200/#/common/interactive/copy/block/code-snippet</example-url>
|
|
214
348
|
*/
|
|
215
349
|
declare class CngxCopyBlock {
|
|
216
350
|
/** The text value to copy to clipboard. */
|
|
@@ -230,8 +364,8 @@ declare class CngxCopyBlock {
|
|
|
230
364
|
*
|
|
231
365
|
* Creates a `<span class="cngx-ripple__wave">` on pointer contact, positions it
|
|
232
366
|
* via CSS custom properties (`--cngx-ripple-x`, `--cngx-ripple-y`, `--cngx-ripple-size`),
|
|
233
|
-
* and removes it after the animation completes. ALL visual treatment
|
|
234
|
-
* shape
|
|
367
|
+
* and removes it after the animation completes. ALL visual treatment - color, duration,
|
|
368
|
+
* shape - is the consumer's CSS responsibility.
|
|
235
369
|
*
|
|
236
370
|
* Ships a companion `_ripple.scss` with sensible defaults.
|
|
237
371
|
*
|
|
@@ -251,9 +385,17 @@ declare class CngxCopyBlock {
|
|
|
251
385
|
* ```html
|
|
252
386
|
* <button cngxRipple [rippleDisabled]="isReducedMotion()">Click</button>
|
|
253
387
|
* ```
|
|
388
|
+
*
|
|
389
|
+
* @category common/interactive
|
|
390
|
+
* @docsKind primary
|
|
391
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/ripple.directive.ts
|
|
392
|
+
* @since 0.1.0
|
|
393
|
+
* @relatedTo CngxPressable, CngxPressRipple, CngxHoverable
|
|
394
|
+
* <example-url>http://localhost:4200/#/common/interactive/ripple/base/button-ripples</example-url>
|
|
395
|
+
* <example-url>http://localhost:4200/#/common/interactive/ripple/base/card-with-ripple</example-url>
|
|
254
396
|
*/
|
|
255
397
|
declare class CngxRipple {
|
|
256
|
-
/** Ripple color
|
|
398
|
+
/** Ripple color - passed as `--cngx-ripple-color` on the wave element. */
|
|
257
399
|
readonly color: _angular_core.InputSignal<string>;
|
|
258
400
|
/** Whether the ripple originates from the center of the host. */
|
|
259
401
|
readonly centered: _angular_core.InputSignal<boolean>;
|
|
@@ -275,7 +417,7 @@ declare class CngxRipple {
|
|
|
275
417
|
/**
|
|
276
418
|
* Provides instant press feedback via CSS class on `pointerdown`.
|
|
277
419
|
*
|
|
278
|
-
* Click feedback fires too late
|
|
420
|
+
* Click feedback fires too late - press feedback is immediate (0ms latency).
|
|
279
421
|
* The class is removed on `pointerup` with an optional delay to prevent
|
|
280
422
|
* a visual flash on quick taps.
|
|
281
423
|
*
|
|
@@ -297,9 +439,17 @@ declare class CngxRipple {
|
|
|
297
439
|
* Tappable card
|
|
298
440
|
* </div>
|
|
299
441
|
* ```
|
|
442
|
+
*
|
|
443
|
+
* @category common/interactive
|
|
444
|
+
* @docsKind primary
|
|
445
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/pressable.directive.ts
|
|
446
|
+
* @since 0.1.0
|
|
447
|
+
* @relatedTo CngxRipple, CngxPressRipple, CngxHoverable
|
|
448
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/pressable/press-feedback-on-buttons</example-url>
|
|
449
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/pressable/tappable-card</example-url>
|
|
300
450
|
*/
|
|
301
451
|
declare class CngxPressable {
|
|
302
|
-
/** Minimum time in ms the pressed class stays active
|
|
452
|
+
/** Minimum time in ms the pressed class stays active - prevents flash on quick taps. */
|
|
303
453
|
readonly releaseDelay: _angular_core.InputSignal<number>;
|
|
304
454
|
private readonly pressedState;
|
|
305
455
|
/** Whether the element is currently in the pressed state. */
|
|
@@ -307,11 +457,11 @@ declare class CngxPressable {
|
|
|
307
457
|
/** Pending timer handle for the delayed release. */
|
|
308
458
|
private releaseTimer;
|
|
309
459
|
constructor();
|
|
310
|
-
/** @internal
|
|
460
|
+
/** @internal - sets pressed state immediately on pointer contact (0ms latency). */
|
|
311
461
|
protected handlePointerDown(): void;
|
|
312
|
-
/** @internal
|
|
462
|
+
/** @internal - releases after `releaseDelay` ms to prevent flash on quick taps. */
|
|
313
463
|
protected handlePointerUp(): void;
|
|
314
|
-
/** @internal
|
|
464
|
+
/** @internal - immediate release on cancel/leave (no delay). */
|
|
315
465
|
protected handlePointerCancel(): void;
|
|
316
466
|
private clearTimer;
|
|
317
467
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPressable, never>;
|
|
@@ -334,13 +484,24 @@ declare class CngxPressable {
|
|
|
334
484
|
* ```html
|
|
335
485
|
* <button cngxPressRipple [rippleColor]="'rgba(0,0,0,0.2)'">Click</button>
|
|
336
486
|
* ```
|
|
487
|
+
*
|
|
488
|
+
* @category common/interactive
|
|
489
|
+
* @docsKind primary
|
|
490
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/ripple/press-ripple.directive.ts
|
|
491
|
+
* @since 0.1.0
|
|
492
|
+
* @relatedTo CngxPressable, CngxRipple
|
|
493
|
+
* <example-url>http://localhost:4200/#/common/interactive/ripple/press/buttons-with-press-ripple</example-url>
|
|
337
494
|
*/
|
|
338
495
|
declare class CngxPressRipple {
|
|
339
496
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPressRipple, never>;
|
|
340
497
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPressRipple, "[cngxPressRipple]", ["cngxPressRipple"], {}, {}, never, never, true, [{ directive: typeof CngxPressable; inputs: { "pressableReleaseDelay": "pressableReleaseDelay"; }; outputs: {}; }, { directive: typeof CngxRipple; inputs: { "rippleColor": "rippleColor"; "rippleCentered": "rippleCentered"; "rippleDisabled": "rippleDisabled"; }; outputs: {}; }]>;
|
|
341
498
|
}
|
|
342
499
|
|
|
343
|
-
/**
|
|
500
|
+
/**
|
|
501
|
+
* Configuration options for the cngx nav system.
|
|
502
|
+
*
|
|
503
|
+
* @category common/interactive
|
|
504
|
+
*/
|
|
344
505
|
interface CngxNavConfig {
|
|
345
506
|
/**
|
|
346
507
|
* Indentation in px per depth level.
|
|
@@ -361,7 +522,11 @@ interface CngxNavConfig {
|
|
|
361
522
|
*/
|
|
362
523
|
animationDuration?: number;
|
|
363
524
|
}
|
|
364
|
-
/**
|
|
525
|
+
/**
|
|
526
|
+
* A feature configuration function returned by `withXxx()` helpers.
|
|
527
|
+
*
|
|
528
|
+
* @category common/interactive
|
|
529
|
+
*/
|
|
365
530
|
interface NavConfigFeature {
|
|
366
531
|
/** @internal */
|
|
367
532
|
readonly apply: (config: CngxNavConfig) => CngxNavConfig;
|
|
@@ -378,6 +543,10 @@ interface NavConfigFeature {
|
|
|
378
543
|
* })
|
|
379
544
|
* class SidebarComponent { }
|
|
380
545
|
* ```
|
|
546
|
+
*
|
|
547
|
+
* @category common/interactive
|
|
548
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-config.ts
|
|
549
|
+
* @since 0.1.0
|
|
381
550
|
*/
|
|
382
551
|
declare const CNGX_NAV_CONFIG: InjectionToken<CngxNavConfig>;
|
|
383
552
|
/**
|
|
@@ -390,23 +559,33 @@ declare const CNGX_NAV_CONFIG: InjectionToken<CngxNavConfig>;
|
|
|
390
559
|
* ```typescript
|
|
391
560
|
* providers: [provideNavConfig(withSingleAccordion(), withNavIndent(16))]
|
|
392
561
|
* ```
|
|
562
|
+
*
|
|
563
|
+
* @category common/interactive
|
|
393
564
|
*/
|
|
394
565
|
declare function provideNavConfig(...features: NavConfigFeature[]): Provider[];
|
|
395
566
|
/**
|
|
396
|
-
* Enables single-accordion mode
|
|
567
|
+
* Enables single-accordion mode - only one nav group can be open at a time.
|
|
568
|
+
*
|
|
569
|
+
* @category common/interactive
|
|
397
570
|
*/
|
|
398
571
|
declare function withSingleAccordion(): NavConfigFeature;
|
|
399
572
|
/**
|
|
400
573
|
* Sets the indentation per depth level in px.
|
|
574
|
+
*
|
|
575
|
+
* @category common/interactive
|
|
401
576
|
*/
|
|
402
577
|
declare function withNavIndent(px: number): NavConfigFeature;
|
|
403
578
|
/**
|
|
404
579
|
* Sets the animation duration for nav group expand/collapse in ms.
|
|
580
|
+
*
|
|
581
|
+
* @category common/interactive
|
|
405
582
|
*/
|
|
406
583
|
declare function withNavAnimation(ms: number): NavConfigFeature;
|
|
407
584
|
/**
|
|
408
585
|
* Injects the resolved nav config, merging provided values with defaults.
|
|
409
586
|
* Must be called in an injection context.
|
|
587
|
+
*
|
|
588
|
+
* @category common/interactive
|
|
410
589
|
*/
|
|
411
590
|
declare function injectNavConfig(): Readonly<Required<CngxNavConfig>>;
|
|
412
591
|
|
|
@@ -414,7 +593,7 @@ declare function injectNavConfig(): Readonly<Required<CngxNavConfig>>;
|
|
|
414
593
|
* Generic expand/collapse (disclosure) behavior.
|
|
415
594
|
*
|
|
416
595
|
* Applied to the **trigger** element (button, heading, etc.). Manages
|
|
417
|
-
* `aria-expanded` and `aria-controls` host attributes directly
|
|
596
|
+
* `aria-expanded` and `aria-controls` host attributes directly - no need
|
|
418
597
|
* to compose `CngxAriaExpanded` separately.
|
|
419
598
|
*
|
|
420
599
|
* Supports controlled (`[cngxDisclosureOpened]`) and uncontrolled modes,
|
|
@@ -452,6 +631,16 @@ declare function injectNavConfig(): Readonly<Required<CngxNavConfig>>;
|
|
|
452
631
|
* <a href="/security">Security</a>
|
|
453
632
|
* </div>
|
|
454
633
|
* ```
|
|
634
|
+
*
|
|
635
|
+
* @category common/interactive
|
|
636
|
+
* @docsKind primary
|
|
637
|
+
* @wcag AA
|
|
638
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/disclosure.directive.ts
|
|
639
|
+
* @since 0.1.0
|
|
640
|
+
* @relatedTo CngxNavGroup, CngxExpandable
|
|
641
|
+
* <example-url>http://localhost:4200/#/common/interactive/disclosure/basic-uncontrolled</example-url>
|
|
642
|
+
* <example-url>http://localhost:4200/#/common/interactive/disclosure/controlled-mode</example-url>
|
|
643
|
+
* <example-url>http://localhost:4200/#/common/interactive/disclosure/faq-accordion</example-url>
|
|
455
644
|
*/
|
|
456
645
|
declare class CngxDisclosure {
|
|
457
646
|
/** Controlled opened state. When bound, takes precedence over internal state. */
|
|
@@ -459,7 +648,7 @@ declare class CngxDisclosure {
|
|
|
459
648
|
/** The `id` of the controlled content element. Sets `aria-controls`. */
|
|
460
649
|
readonly controls: _angular_core.InputSignal<string | undefined>;
|
|
461
650
|
private readonly openedState;
|
|
462
|
-
/** Resolved opened state
|
|
651
|
+
/** Resolved opened state - controlled input wins over internal state. */
|
|
463
652
|
readonly opened: _angular_core.Signal<boolean>;
|
|
464
653
|
/** Emitted when the opened state changes. */
|
|
465
654
|
readonly openedChange: _angular_core.OutputEmitterRef<boolean>;
|
|
@@ -474,7 +663,7 @@ declare class CngxDisclosure {
|
|
|
474
663
|
}
|
|
475
664
|
|
|
476
665
|
/**
|
|
477
|
-
* Navigation accordion group
|
|
666
|
+
* Navigation accordion group - a collapsible section in a sidebar nav.
|
|
478
667
|
*
|
|
479
668
|
* Composes `CngxDisclosure` as a `hostDirective` for expand/collapse behavior.
|
|
480
669
|
* Adds nav-specific semantics: depth tracking and CSS classes for styling.
|
|
@@ -510,9 +699,19 @@ declare class CngxDisclosure {
|
|
|
510
699
|
* ],
|
|
511
700
|
* })
|
|
512
701
|
* ```
|
|
702
|
+
*
|
|
703
|
+
* @category common/interactive
|
|
704
|
+
* @docsKind primary
|
|
705
|
+
* @wcag AA
|
|
706
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-group.directive.ts
|
|
707
|
+
* @since 0.1.0
|
|
708
|
+
* @relatedTo CngxNavLink, CngxDisclosure, CngxNavGroupRegistry, CngxNavLabel
|
|
709
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>
|
|
710
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>
|
|
711
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>
|
|
513
712
|
*/
|
|
514
713
|
declare class CngxNavGroup {
|
|
515
|
-
/** The composed disclosure instance
|
|
714
|
+
/** The composed disclosure instance - use `disclosure.opened()` to read state. */
|
|
516
715
|
readonly disclosure: CngxDisclosure;
|
|
517
716
|
/** Nesting depth for indentation. Consumer sets manually. */
|
|
518
717
|
readonly depth: _angular_core.InputSignal<number>;
|
|
@@ -530,7 +729,7 @@ interface NavGroupRef {
|
|
|
530
729
|
/**
|
|
531
730
|
* Scoped registry for single-accordion coordination.
|
|
532
731
|
*
|
|
533
|
-
* Provided at the sidebar/nav container level
|
|
732
|
+
* Provided at the sidebar/nav container level - only groups within the
|
|
534
733
|
* same provider scope coordinate. Not `providedIn: 'root'` on purpose.
|
|
535
734
|
*
|
|
536
735
|
* ```typescript
|
|
@@ -541,6 +740,12 @@ interface NavGroupRef {
|
|
|
541
740
|
* ],
|
|
542
741
|
* })
|
|
543
742
|
* ```
|
|
743
|
+
*
|
|
744
|
+
* @category common/interactive
|
|
745
|
+
* @wcag AA
|
|
746
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-group-registry.ts
|
|
747
|
+
* @since 0.1.0
|
|
748
|
+
* @relatedTo CngxNavGroup, CngxDisclosure
|
|
544
749
|
*/
|
|
545
750
|
declare class CngxNavGroupRegistry {
|
|
546
751
|
private readonly groups;
|
|
@@ -561,7 +766,7 @@ declare class CngxNavGroupRegistry {
|
|
|
561
766
|
* Use `[heading]="true"` to opt in to `role="heading"` with `aria-level`
|
|
562
767
|
* when the label genuinely represents a heading in the document outline.
|
|
563
768
|
*
|
|
564
|
-
* ### Section label (default
|
|
769
|
+
* ### Section label (default - no heading role)
|
|
565
770
|
* ```html
|
|
566
771
|
* <span cngxNavLabel>@cngx/common</span>
|
|
567
772
|
* ```
|
|
@@ -570,6 +775,15 @@ declare class CngxNavGroupRegistry {
|
|
|
570
775
|
* ```html
|
|
571
776
|
* <span cngxNavLabel [heading]="true" [level]="3">Settings</span>
|
|
572
777
|
* ```
|
|
778
|
+
*
|
|
779
|
+
* @category common/interactive
|
|
780
|
+
* @wcag AA
|
|
781
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-label.directive.ts
|
|
782
|
+
* @since 0.1.0
|
|
783
|
+
* @relatedTo CngxNavLink, CngxNavGroup, CngxNavBadge
|
|
784
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>
|
|
785
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>
|
|
786
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>
|
|
573
787
|
*/
|
|
574
788
|
declare class CngxNavLabel {
|
|
575
789
|
/** Whether to apply `role="heading"`. Off by default to avoid inflating the heading outline. */
|
|
@@ -585,7 +799,7 @@ declare class CngxNavLabel {
|
|
|
585
799
|
* sidebar or nav menu.
|
|
586
800
|
*
|
|
587
801
|
* Sets a `--cngx-nav-depth` CSS custom property for indentation and
|
|
588
|
-
* toggles an `active` class. Does NOT depend on `@angular/router`
|
|
802
|
+
* toggles an `active` class. Does NOT depend on `@angular/router` -
|
|
589
803
|
* the consumer wires `routerLinkActive` or binds `[active]` manually.
|
|
590
804
|
*
|
|
591
805
|
* ### With Router
|
|
@@ -609,6 +823,17 @@ declare class CngxNavLabel {
|
|
|
609
823
|
* <a cngxNavLink [depth]="1">Nested</a>
|
|
610
824
|
* <a cngxNavLink [depth]="2">Deep nested</a>
|
|
611
825
|
* ```
|
|
826
|
+
*
|
|
827
|
+
* @category common/interactive
|
|
828
|
+
* @docsKind primary
|
|
829
|
+
* @wcag AA
|
|
830
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-link.directive.ts
|
|
831
|
+
* @selector [cngxNavLink]
|
|
832
|
+
* @since 0.1.0
|
|
833
|
+
* @relatedTo CngxNavGroup, CngxNavLabel, CngxNavBadge, CngxDisclosure
|
|
834
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>
|
|
835
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>
|
|
836
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>
|
|
612
837
|
*/
|
|
613
838
|
declare class CngxNavLink {
|
|
614
839
|
/**
|
|
@@ -632,16 +857,20 @@ declare class CngxNavLink {
|
|
|
632
857
|
* Common values: `'page'` (default), `'step'`, `'location'`, `'true'`.
|
|
633
858
|
*/
|
|
634
859
|
readonly ariaCurrent: _angular_core.InputSignal<string>;
|
|
635
|
-
/** Nesting depth for indentation. Consumer sets manually
|
|
860
|
+
/** Nesting depth for indentation. Consumer sets manually - no ancestor injection. */
|
|
636
861
|
readonly depth: _angular_core.InputSignal<number>;
|
|
637
862
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxNavLink, never>;
|
|
638
863
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxNavLink, "a[cngxNavLink], button[cngxNavLink]", ["cngxNavLink"], { "active": { "alias": "active"; "required": false; "isSignal": true; }; "scrollOnActive": { "alias": "scrollOnActive"; "required": false; "isSignal": true; }; "ariaCurrent": { "alias": "ariaCurrent"; "required": false; "isSignal": true; }; "depth": { "alias": "depth"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
639
864
|
}
|
|
640
865
|
|
|
641
|
-
/**
|
|
866
|
+
/**
|
|
867
|
+
* Visual variant for the nav badge.
|
|
868
|
+
*
|
|
869
|
+
* @category common/interactive
|
|
870
|
+
*/
|
|
642
871
|
type NavBadgeVariant = 'count' | 'dot' | 'status';
|
|
643
872
|
/**
|
|
644
|
-
* Inline badge for navigation items
|
|
873
|
+
* Inline badge for navigation items - shows counts, dots, or status indicators.
|
|
645
874
|
*
|
|
646
875
|
* For generic in-place counter/dot indicators on arbitrary hosts (buttons,
|
|
647
876
|
* avatars, icons), prefer `CngxBadge` from `@cngx/common/display`. `CngxNavBadge`
|
|
@@ -651,7 +880,7 @@ type NavBadgeVariant = 'count' | 'dot' | 'status';
|
|
|
651
880
|
* Applies `aria-hidden="true"` by default because badges typically duplicate
|
|
652
881
|
* information already conveyed by the link text. When the badge conveys
|
|
653
882
|
* unique information (e.g., unread count), provide `[ariaLabel]` to make
|
|
654
|
-
* it accessible
|
|
883
|
+
* it accessible - this removes `aria-hidden` and adds a visually-hidden label.
|
|
655
884
|
*
|
|
656
885
|
* ### Decorative badge (aria-hidden, default)
|
|
657
886
|
* ```html
|
|
@@ -670,6 +899,15 @@ type NavBadgeVariant = 'count' | 'dot' | 'status';
|
|
|
670
899
|
* ```html
|
|
671
900
|
* <a cngxNavLink>Updates <span cngxNavBadge variant="dot" [value]="1"></span></a>
|
|
672
901
|
* ```
|
|
902
|
+
*
|
|
903
|
+
* @category common/interactive
|
|
904
|
+
* @wcag AA
|
|
905
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/nav/nav-badge.directive.ts
|
|
906
|
+
* @since 0.1.0
|
|
907
|
+
* @relatedTo CngxNavLink, CngxNavGroup, CngxNavLabel, CngxBadge
|
|
908
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-badge-counts-and-dots</example-url>
|
|
909
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-group-accordion-sections</example-url>
|
|
910
|
+
* <example-url>http://localhost:4200/#/common/interactive/nav/nav-links-active-state-depth</example-url>
|
|
673
911
|
*/
|
|
674
912
|
declare class CngxNavBadge {
|
|
675
913
|
/** The badge value. Hidden when empty string, null, undefined, or 0. */
|
|
@@ -689,32 +927,42 @@ declare class CngxNavBadge {
|
|
|
689
927
|
|
|
690
928
|
/**
|
|
691
929
|
* Passive expand/collapse contract for elements whose open state is driven
|
|
692
|
-
* from the outside
|
|
930
|
+
* from the outside - typically a `CngxTreeController` or any component that
|
|
693
931
|
* manages a shared expansion set. Mirrors `aria-expanded` and (optionally)
|
|
694
932
|
* `aria-controls` into the host; carries no interaction of its own.
|
|
695
933
|
*
|
|
696
934
|
* Use `CngxDisclosure` instead for self-triggering expanders (FAQ, accordion
|
|
697
935
|
* headings). The distinction is deliberate: a tree-item row is a selection
|
|
698
|
-
* target, not a toggle
|
|
936
|
+
* target, not a toggle - clicks, Enter, and Space belong to the selection
|
|
699
937
|
* flow, while expand/collapse is wired to ArrowLeft/Right via a sibling nav
|
|
700
938
|
* directive or to a dedicated twisty button.
|
|
701
939
|
*
|
|
702
940
|
* ```html
|
|
703
|
-
* <div
|
|
704
|
-
*
|
|
705
|
-
*
|
|
706
|
-
*
|
|
707
|
-
*
|
|
708
|
-
*
|
|
709
|
-
*
|
|
710
|
-
*
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
*
|
|
941
|
+
* <div role="tree" aria-label="Files">
|
|
942
|
+
* <div
|
|
943
|
+
* role="treeitem"
|
|
944
|
+
* aria-level="1"
|
|
945
|
+
* cngxExpandable
|
|
946
|
+
* [cngxExpandableOpen]="ctrl.isExpanded(id)()"
|
|
947
|
+
* [controls]="childrenId"
|
|
948
|
+
* >
|
|
949
|
+
* <button
|
|
950
|
+
* type="button"
|
|
951
|
+
* tabindex="-1"
|
|
952
|
+
* (click)="ctrl.toggle(id)"
|
|
953
|
+
* >▸</button>
|
|
954
|
+
* <span>{{ label }}</span>
|
|
955
|
+
* </div>
|
|
956
|
+
* <div [id]="childrenId" [hidden]="!ctrl.isExpanded(id)()">…</div>
|
|
715
957
|
* </div>
|
|
716
|
-
* <div [id]="childrenId" [hidden]="!ctrl.isExpanded(id)()">…</div>
|
|
717
958
|
* ```
|
|
959
|
+
*
|
|
960
|
+
* @category common/interactive
|
|
961
|
+
* @docsKind primary
|
|
962
|
+
* @wcag AA
|
|
963
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/expandable/expandable.directive.ts
|
|
964
|
+
* @since 0.1.0
|
|
965
|
+
* @relatedTo CngxHierarchicalNav, CngxTreeController, CngxRovingTabindex
|
|
718
966
|
*/
|
|
719
967
|
declare class CngxExpandable {
|
|
720
968
|
/** Controlled expanded state. When bound, wins over internal state. */
|
|
@@ -748,9 +996,11 @@ declare class CngxExpandable {
|
|
|
748
996
|
*
|
|
749
997
|
* `disabled` stays a `WritableSignal<boolean>` because consumers
|
|
750
998
|
* typically derive it externally (`computed(() => parentDisabled() ||
|
|
751
|
-
* fieldDisabled())` and forward into the atom)
|
|
999
|
+
* fieldDisabled())` and forward into the atom) - `model<boolean>()`
|
|
752
1000
|
* would force every implementer into a two-way binding they do not
|
|
753
1001
|
* need.
|
|
1002
|
+
*
|
|
1003
|
+
* @category common/interactive
|
|
754
1004
|
*/
|
|
755
1005
|
interface CngxControlValue<T = unknown> {
|
|
756
1006
|
readonly value: ModelSignal<T>;
|
|
@@ -765,9 +1015,13 @@ interface CngxControlValue<T = unknown> {
|
|
|
765
1015
|
* No `providedIn`, no factory: providing the token is the atom's
|
|
766
1016
|
* responsibility. A surrounding consumer that wants a sane fallback
|
|
767
1017
|
* (e.g. an inert read-only value) supplies one in its own `providers`
|
|
768
|
-
* block
|
|
1018
|
+
* block - the token deliberately does not invent a default because
|
|
769
1019
|
* "what is the value of an unbound control?" has no library-level
|
|
770
1020
|
* answer.
|
|
1021
|
+
*
|
|
1022
|
+
* @category common/interactive
|
|
1023
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/control-value/control-value.token.ts
|
|
1024
|
+
* @since 0.1.0
|
|
771
1025
|
*/
|
|
772
1026
|
declare const CNGX_CONTROL_VALUE: InjectionToken<CngxControlValue<unknown>>;
|
|
773
1027
|
|
|
@@ -778,7 +1032,7 @@ declare const CNGX_CONTROL_VALUE: InjectionToken<CngxControlValue<unknown>>;
|
|
|
778
1032
|
* the element form (`<cngx-toggle>`) renders a track + thumb skin and
|
|
779
1033
|
* accepts label content via `<ng-content>`.
|
|
780
1034
|
*
|
|
781
|
-
* `value` is a `ModelSignal<boolean>`
|
|
1035
|
+
* `value` is a `ModelSignal<boolean>` - consumers two-way-bind via
|
|
782
1036
|
* `[(value)]` and the directive emits `valueChange` on every flip.
|
|
783
1037
|
* `disabled` is also a `ModelSignal<boolean>` so the
|
|
784
1038
|
* `CngxFormBridge` (Phase 7) can drive it via `setDisabledState`
|
|
@@ -786,7 +1040,7 @@ declare const CNGX_CONTROL_VALUE: InjectionToken<CngxControlValue<unknown>>;
|
|
|
786
1040
|
* one direction.
|
|
787
1041
|
*
|
|
788
1042
|
* `disabledReason` is consumer-supplied free text (no library default
|
|
789
|
-
* per `feedback_en_default_locale`)
|
|
1043
|
+
* per `feedback_en_default_locale`) - when present it lands in a hidden
|
|
790
1044
|
* `<span>` referenced by the host's `aria-describedby`. Per Pillar 2,
|
|
791
1045
|
* the description span is always in the DOM (visibility toggles via
|
|
792
1046
|
* `aria-hidden`); the host's `aria-describedby` is only emitted when a
|
|
@@ -813,6 +1067,21 @@ declare const CNGX_CONTROL_VALUE: InjectionToken<CngxControlValue<unknown>>;
|
|
|
813
1067
|
* <ng-template #icon><span aria-hidden="true">★</span></ng-template>
|
|
814
1068
|
* <cngx-toggle [(value)]="featured" [thumbGlyph]="icon">Featured</cngx-toggle>
|
|
815
1069
|
* ```
|
|
1070
|
+
*
|
|
1071
|
+
* @category common/interactive
|
|
1072
|
+
* @docsKind primary
|
|
1073
|
+
* @wcag AA
|
|
1074
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/toggle/toggle.component.ts
|
|
1075
|
+
* @selector cngx-toggle
|
|
1076
|
+
* @since 0.1.0
|
|
1077
|
+
* @relatedTo CngxCheckbox, CngxButtonToggle, CngxRadio
|
|
1078
|
+
* <example-url>http://localhost:4200/#/common/interactive/toggle/basic-two-way-binding</example-url>
|
|
1079
|
+
* <example-url>http://localhost:4200/#/common/interactive/toggle/custom-thumb-glyph</example-url>
|
|
1080
|
+
* <example-url>http://localhost:4200/#/common/interactive/toggle/disabled-with-reason</example-url>
|
|
1081
|
+
* <example-url>http://localhost:4200/#/common/interactive/toggle/label-position</example-url>
|
|
1082
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1083
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1084
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
816
1085
|
*/
|
|
817
1086
|
declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldControl {
|
|
818
1087
|
readonly value: _angular_core.ModelSignal<boolean>;
|
|
@@ -820,7 +1089,7 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
820
1089
|
/**
|
|
821
1090
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
822
1091
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
823
|
-
* adapters) can drive it without a parallel API path
|
|
1092
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
824
1093
|
* typically read only.
|
|
825
1094
|
*/
|
|
826
1095
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -829,7 +1098,7 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
829
1098
|
* rendered by `<cngx-form-field>` or a consumer-owned `<span>`).
|
|
830
1099
|
* When set, the host emits `aria-errormessage="<id>"` so AT can
|
|
831
1100
|
* locate the message; consumers MUST render an element with that id
|
|
832
|
-
*
|
|
1101
|
+
* - passing an id without a matching element produces a dangling
|
|
833
1102
|
* AT reference. Default `null` skips the attribute entirely.
|
|
834
1103
|
* Note: WAI-ARIA dictates that AT ignores this attribute when
|
|
835
1104
|
* `aria-invalid` is absent or `"false"`, so a stable always-emitted
|
|
@@ -846,7 +1115,7 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
846
1115
|
private readonly focusedState;
|
|
847
1116
|
/** Whether the host element currently has DOM focus. */
|
|
848
1117
|
readonly focused: _angular_core.Signal<boolean>;
|
|
849
|
-
/** True when the toggle is `false` (off)
|
|
1118
|
+
/** True when the toggle is `false` (off) - boolean atom semantics. */
|
|
850
1119
|
readonly empty: _angular_core.Signal<boolean>;
|
|
851
1120
|
private readonly fieldHost;
|
|
852
1121
|
private readonly aggregator;
|
|
@@ -871,7 +1140,7 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
871
1140
|
* `role="checkbox"` semantics. Click, Space, and Enter all advance
|
|
872
1141
|
* `value`; an indeterminate checkbox advances to `value=true`,
|
|
873
1142
|
* `indeterminate=false` in a single step (per WAI-ARIA tristate
|
|
874
|
-
* semantics
|
|
1143
|
+
* semantics - there is no path that lands the checkbox back in
|
|
875
1144
|
* `'mixed'` from a user click).
|
|
876
1145
|
*
|
|
877
1146
|
* `value` and `indeterminate` are both `ModelSignal<boolean>` so
|
|
@@ -883,9 +1152,10 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
883
1152
|
* across the family.
|
|
884
1153
|
*
|
|
885
1154
|
* Visual indicator state is delegated to `<cngx-checkbox-indicator>`
|
|
886
|
-
* from `@cngx/common/display`;
|
|
887
|
-
* keyboard, and ARIA wiring
|
|
888
|
-
*
|
|
1155
|
+
* from `@cngx/common/display`; this interactive molecule owns role,
|
|
1156
|
+
* keyboard, and ARIA wiring and composes the display atom. Per
|
|
1157
|
+
* Pillar 3, the visual atom is
|
|
1158
|
+
* reused - never re-drawn here.
|
|
889
1159
|
*
|
|
890
1160
|
* `aria-checked` is a reactive computed: `indeterminate() ? 'mixed' :
|
|
891
1161
|
* value() ? 'true' : 'false'`. The description span for
|
|
@@ -901,6 +1171,23 @@ declare class CngxToggle implements CngxControlValue<boolean>, CngxFormFieldCont
|
|
|
901
1171
|
* (valueChange)="toggleAll($event)"
|
|
902
1172
|
* >Select all</cngx-checkbox>
|
|
903
1173
|
* ```
|
|
1174
|
+
*
|
|
1175
|
+
* @category common/interactive
|
|
1176
|
+
* @docsKind primary
|
|
1177
|
+
* @wcag AA
|
|
1178
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/checkbox/checkbox.component.ts
|
|
1179
|
+
* @selector cngx-checkbox
|
|
1180
|
+
* @since 0.1.0
|
|
1181
|
+
* @relatedTo CngxCheckboxGroup, CngxCheckboxIndicator, CngxToggle, CngxRadio
|
|
1182
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/group/basic-select-all-master-projected-leaves</example-url>
|
|
1183
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/group/disabled-cascade</example-url>
|
|
1184
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/base/basic-two-way-binding</example-url>
|
|
1185
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/base/custom-check-dash-glyphs</example-url>
|
|
1186
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/base/disabled</example-url>
|
|
1187
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/base/tri-state-select-all-pattern</example-url>
|
|
1188
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1189
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1190
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
904
1191
|
*/
|
|
905
1192
|
declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldControl {
|
|
906
1193
|
readonly value: _angular_core.ModelSignal<boolean>;
|
|
@@ -909,28 +1196,34 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
909
1196
|
/**
|
|
910
1197
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
911
1198
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
912
|
-
* adapters) can drive it without a parallel API path
|
|
1199
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
913
1200
|
* typically read only.
|
|
914
1201
|
*/
|
|
915
1202
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
916
1203
|
/**
|
|
917
1204
|
* Optional id of an external error message element (e.g. a sibling
|
|
918
1205
|
* rendered by `<cngx-form-field>` or a consumer-owned `<span>`).
|
|
919
|
-
*
|
|
920
|
-
*
|
|
921
|
-
*
|
|
922
|
-
*
|
|
923
|
-
*
|
|
924
|
-
* `
|
|
925
|
-
* id is harmless when the field is valid.
|
|
1206
|
+
* The host emits `aria-errormessage="<id>"` only when
|
|
1207
|
+
* `aria-invalid="true"` — symmetric with the sibling `aria-invalid`
|
|
1208
|
+
* host binding (both gate on `invalid() || errorState()`). Consumers
|
|
1209
|
+
* MUST render an element with the supplied id; passing an id without
|
|
1210
|
+
* a matching element produces a dangling AT reference. Default
|
|
1211
|
+
* `null` skips the attribute entirely.
|
|
926
1212
|
*/
|
|
927
1213
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
928
1214
|
readonly disabledReason: _angular_core.InputSignal<string>;
|
|
929
1215
|
readonly checkGlyph: _angular_core.InputSignal<TemplateRef<void> | null>;
|
|
930
1216
|
readonly dashGlyph: _angular_core.InputSignal<TemplateRef<void> | null>;
|
|
931
1217
|
protected readonly describedId: string;
|
|
932
|
-
|
|
933
|
-
|
|
1218
|
+
private readonly rovingParent;
|
|
1219
|
+
/**
|
|
1220
|
+
* When inside a `CngxRovingTabindex` parent (typically `CngxCheckboxGroup`),
|
|
1221
|
+
* yields `null` so the roving controller owns the `tabindex` attribute
|
|
1222
|
+
* uncontested. Standalone, falls back to the WAI-ARIA default of
|
|
1223
|
+
* `0` (or `-1` when disabled). Mirrors `CngxCard.hostTabindex`.
|
|
1224
|
+
*/
|
|
1225
|
+
protected readonly hostTabindex: _angular_core.Signal<number | null>;
|
|
1226
|
+
protected readonly ariaChecked: _angular_core.Signal<"true" | "false" | "mixed">;
|
|
934
1227
|
readonly id: _angular_core.Signal<string>;
|
|
935
1228
|
private readonly focusedState;
|
|
936
1229
|
readonly focused: _angular_core.Signal<boolean>;
|
|
@@ -943,13 +1236,14 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
943
1236
|
private readonly fieldHost;
|
|
944
1237
|
private readonly aggregator;
|
|
945
1238
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
1239
|
+
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
946
1240
|
protected handleClick(): void;
|
|
947
1241
|
protected handleKeydown(event: Event): void;
|
|
948
1242
|
protected handleFocusIn(): void;
|
|
949
1243
|
protected handleFocusOut(): void;
|
|
950
1244
|
private advance;
|
|
951
1245
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCheckbox, never>;
|
|
952
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCheckbox, "cngx-checkbox, [cngxCheckbox]", ["cngxCheckbox"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "required": false; "isSignal": true; }; "checkGlyph": { "alias": "checkGlyph"; "required": false; "isSignal": true; }; "dashGlyph": { "alias": "dashGlyph"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "indeterminate": "indeterminateChange"; "disabled": "disabledChange"; "invalid": "invalidChange"; }, never, ["*"], true,
|
|
1246
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCheckbox, "cngx-checkbox, [cngxCheckbox]", ["cngxCheckbox"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "errorMessageId": { "alias": "errorMessageId"; "required": false; "isSignal": true; }; "disabledReason": { "alias": "disabledReason"; "required": false; "isSignal": true; }; "checkGlyph": { "alias": "checkGlyph"; "required": false; "isSignal": true; }; "dashGlyph": { "alias": "dashGlyph"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "indeterminate": "indeterminateChange"; "disabled": "disabledChange"; "invalid": "invalidChange"; }, never, ["*"], true, [{ directive: typeof i1.CngxRovingItem; inputs: { "cngxRovingItemDisabled": "disabled"; }; outputs: {}; }]>;
|
|
953
1247
|
}
|
|
954
1248
|
|
|
955
1249
|
/**
|
|
@@ -961,21 +1255,21 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
961
1255
|
* checkbox to the group.
|
|
962
1256
|
*
|
|
963
1257
|
* Internals lean on `createSelectionController` from `@cngx/core/utils`
|
|
964
|
-
* for membership tracking
|
|
1258
|
+
* for membership tracking - the controller's structural-equality
|
|
965
1259
|
* `selected` snapshot prevents downstream computed cascades from
|
|
966
1260
|
* thrashing when a re-emission produces the same logical contents
|
|
967
1261
|
* with a different array reference.
|
|
968
1262
|
*
|
|
969
1263
|
* `value` is a structural alias of `selectedValues` so the group
|
|
970
1264
|
* satisfies `CngxControlValue<T[]>` without owning two synchronised
|
|
971
|
-
* models
|
|
1265
|
+
* models - both names point to the same `ModelSignal<T[]>` instance.
|
|
972
1266
|
*
|
|
973
1267
|
* Per Pillar 1 (Ableitung statt Verwaltung), every derived flag is a
|
|
974
|
-
* `computed()`
|
|
1268
|
+
* `computed()` - there is no manual sync between membership and the
|
|
975
1269
|
* exposed flags. Per Pillar 3 (Komposition statt Konfiguration), the
|
|
976
1270
|
* group composes `CngxRovingTabindex` as a host directive and emits
|
|
977
|
-
* no implicit children
|
|
978
|
-
* (or any other CNGX_CONTROL_VALUE-bearing
|
|
1271
|
+
* no implicit children - consumers project `<cngx-checkbox>` instances
|
|
1272
|
+
* (or any other CNGX_CONTROL_VALUE-bearing leaf) and bind each leaf's
|
|
979
1273
|
* value-tracking themselves.
|
|
980
1274
|
*
|
|
981
1275
|
* `[allValues]` is optional; when supplied, `allSelected` reflects
|
|
@@ -986,7 +1280,7 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
986
1280
|
*
|
|
987
1281
|
* `[keyFn]` lets consumers with object-typed values map each value
|
|
988
1282
|
* to a stable membership key (typically `(v) => v.id`). Without it,
|
|
989
|
-
* membership uses identity / primitive equality
|
|
1283
|
+
* membership uses identity / primitive equality - which silently
|
|
990
1284
|
* breaks across re-emissions when the consumer refetches array
|
|
991
1285
|
* elements with the same id but new references.
|
|
992
1286
|
*
|
|
@@ -1007,6 +1301,19 @@ declare class CngxCheckbox implements CngxControlValue<boolean>, CngxFormFieldCo
|
|
|
1007
1301
|
* >{{ opt }}</cngx-checkbox>
|
|
1008
1302
|
* </cngx-checkbox-group>
|
|
1009
1303
|
* ```
|
|
1304
|
+
*
|
|
1305
|
+
* @category common/interactive
|
|
1306
|
+
* @docsKind primary
|
|
1307
|
+
* @wcag AA
|
|
1308
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/checkbox-group/checkbox-group.component.ts
|
|
1309
|
+
* @selector cngx-checkbox-group
|
|
1310
|
+
* @since 0.1.0
|
|
1311
|
+
* @relatedTo CngxCheckbox, CngxRovingTabindex, CngxRadioGroup
|
|
1312
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/group/basic-select-all-master-projected-leaves</example-url>
|
|
1313
|
+
* <example-url>http://localhost:4200/#/common/interactive/checkbox/group/disabled-cascade</example-url>
|
|
1314
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1315
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1316
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1010
1317
|
*/
|
|
1011
1318
|
declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, CngxFormFieldControl {
|
|
1012
1319
|
readonly selectedValues: _angular_core.ModelSignal<T[]>;
|
|
@@ -1016,17 +1323,16 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
1016
1323
|
/**
|
|
1017
1324
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1018
1325
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1019
|
-
* adapters) can drive it without a parallel API path
|
|
1326
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1020
1327
|
* typically read only.
|
|
1021
1328
|
*/
|
|
1022
1329
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
1023
1330
|
/**
|
|
1024
|
-
* Optional id of an external error message element.
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
1027
|
-
*
|
|
1028
|
-
*
|
|
1029
|
-
* id is harmless when the field is valid.
|
|
1331
|
+
* Optional id of an external error message element. The host emits
|
|
1332
|
+
* `aria-errormessage="<id>"` only when `aria-invalid="true"` —
|
|
1333
|
+
* symmetric with the sibling `aria-invalid` host binding (both gate
|
|
1334
|
+
* on `invalid() || errorState()`). Consumers MUST render an element
|
|
1335
|
+
* with the supplied id. Default `null` skips the attribute.
|
|
1030
1336
|
*/
|
|
1031
1337
|
readonly errorMessageId: _angular_core.InputSignal<string | null>;
|
|
1032
1338
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
@@ -1052,6 +1358,7 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
1052
1358
|
private readonly fieldHost;
|
|
1053
1359
|
private readonly aggregator;
|
|
1054
1360
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
1361
|
+
protected readonly ariaInvalid: _angular_core.Signal<boolean>;
|
|
1055
1362
|
protected handleFocusIn(): void;
|
|
1056
1363
|
protected handleFocusOut(): void;
|
|
1057
1364
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCheckboxGroup<any>, never>;
|
|
@@ -1061,8 +1368,8 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
1061
1368
|
/**
|
|
1062
1369
|
* Single-select parent contract every `CngxButtonToggleGroup` provides
|
|
1063
1370
|
* via `useExisting`. `CngxButtonToggle` leaves inject this token (or
|
|
1064
|
-
* `CNGX_BUTTON_MULTI_TOGGLE_GROUP` for the multi case)
|
|
1065
|
-
* concrete group class
|
|
1371
|
+
* `CNGX_BUTTON_MULTI_TOGGLE_GROUP` for the multi case) - never the
|
|
1372
|
+
* concrete group class - so the leaf stays decompose-ready and free
|
|
1066
1373
|
* of cyclic type dependencies.
|
|
1067
1374
|
*
|
|
1068
1375
|
* `value` is a `ModelSignal<T | undefined>` because the group's
|
|
@@ -1071,13 +1378,15 @@ declare class CngxCheckboxGroup<T = unknown> implements CngxControlValue<T[]>, C
|
|
|
1071
1378
|
* pick. `disabled` is a read-only `Signal<boolean>` so the leaf can
|
|
1072
1379
|
* combine it with its own per-toggle `disabled()` to compute
|
|
1073
1380
|
* `toggleDisabled`.
|
|
1381
|
+
*
|
|
1382
|
+
* @category common/interactive
|
|
1074
1383
|
*/
|
|
1075
1384
|
interface CngxButtonToggleGroupContract<T = unknown> {
|
|
1076
1385
|
readonly value: ModelSignal<T | undefined>;
|
|
1077
1386
|
readonly disabled: Signal<boolean>;
|
|
1078
1387
|
/**
|
|
1079
1388
|
* Consume the group's "last interaction was a roving-arrow keydown"
|
|
1080
|
-
* flag. Called by a leaf's `(focus)` handler
|
|
1389
|
+
* flag. Called by a leaf's `(focus)` handler - when the flag is
|
|
1081
1390
|
* true, the leaf forwards its value to the group's `value` model
|
|
1082
1391
|
* (W3C APG auto-select-on-arrow-nav semantics, radiogroup variant)
|
|
1083
1392
|
* and the flag is cleared so a subsequent Tab-into focus does not
|
|
@@ -1090,14 +1399,19 @@ interface CngxButtonToggleGroupContract<T = unknown> {
|
|
|
1090
1399
|
* DI token a `CngxButtonToggle` leaf injects to find its single-mode
|
|
1091
1400
|
* parent group. Always provided via
|
|
1092
1401
|
* `{ provide: CNGX_BUTTON_TOGGLE_GROUP, useExisting:
|
|
1093
|
-
* CngxButtonToggleGroup }`
|
|
1402
|
+
* CngxButtonToggleGroup }` - never via concrete-class injection (per
|
|
1094
1403
|
* `reference_atomic_decompose` §4).
|
|
1095
1404
|
*
|
|
1096
1405
|
* The leaf injects this token AND `CNGX_BUTTON_MULTI_TOGGLE_GROUP`
|
|
1097
1406
|
* with `{ optional: true }` on both; the present token determines the
|
|
1098
1407
|
* leaf's keyboard semantics + ARIA pattern (`aria-checked` for single,
|
|
1099
1408
|
* `aria-selected` for multi), chosen at injection time, NOT at
|
|
1100
|
-
* runtime
|
|
1409
|
+
* runtime - there is no `[selectionMode]` flag.
|
|
1410
|
+
*
|
|
1411
|
+
* @category common/interactive
|
|
1412
|
+
* @wcag AA
|
|
1413
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle-group.token.ts
|
|
1414
|
+
* @since 0.1.0
|
|
1101
1415
|
*/
|
|
1102
1416
|
declare const CNGX_BUTTON_TOGGLE_GROUP: InjectionToken<CngxButtonToggleGroupContract<unknown>>;
|
|
1103
1417
|
|
|
@@ -1105,14 +1419,14 @@ declare const CNGX_BUTTON_TOGGLE_GROUP: InjectionToken<CngxButtonToggleGroupCont
|
|
|
1105
1419
|
* Single-select button-toggle group. Owns a `value = model<T |
|
|
1106
1420
|
* undefined>` (the canonical single-value source) and exposes the
|
|
1107
1421
|
* parent contract via `CNGX_BUTTON_TOGGLE_GROUP`. Behaves as a W3C
|
|
1108
|
-
* APG `radiogroup`
|
|
1422
|
+
* APG `radiogroup` - arrow keys move focus AND select (auto-select
|
|
1109
1423
|
* variant); Tab + programmatic focus do not select on focus alone;
|
|
1110
1424
|
* Space and Enter select the currently-focused toggle.
|
|
1111
1425
|
*
|
|
1112
1426
|
* Mode is **static**: this component is the single-select half of a
|
|
1113
1427
|
* deliberate split (per `feedback_select_family_split`). Consumers
|
|
1114
1428
|
* pick `<cngx-button-toggle-group>` for radiogroup semantics or
|
|
1115
|
-
* `<cngx-button-multi-toggle-group>` for toolbar semantics
|
|
1429
|
+
* `<cngx-button-multi-toggle-group>` for toolbar semantics - never a
|
|
1116
1430
|
* runtime `[selectionMode]` flag, never a shape-shifter. The leaf
|
|
1117
1431
|
* `CngxButtonToggle` injects EITHER this token OR
|
|
1118
1432
|
* `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (`{ optional: true }` on both)
|
|
@@ -1123,7 +1437,7 @@ declare const CNGX_BUTTON_TOGGLE_GROUP: InjectionToken<CngxButtonToggleGroupCont
|
|
|
1123
1437
|
* is raised on host `(keydown)` for any roving-relevant key
|
|
1124
1438
|
* (Arrow*, Home, End); each focused leaf consumes the flag in its
|
|
1125
1439
|
* `(focus)` handler via `consumePendingArrowSelect()`. The signal
|
|
1126
|
-
* write happens inside a DOM event handler
|
|
1440
|
+
* write happens inside a DOM event handler - never inside an
|
|
1127
1441
|
* `effect()`.
|
|
1128
1442
|
*
|
|
1129
1443
|
* ```html
|
|
@@ -1133,6 +1447,20 @@ declare const CNGX_BUTTON_TOGGLE_GROUP: InjectionToken<CngxButtonToggleGroupCont
|
|
|
1133
1447
|
* <button cngxButtonToggle value="table">Table</button>
|
|
1134
1448
|
* </cngx-button-toggle-group>
|
|
1135
1449
|
* ```
|
|
1450
|
+
*
|
|
1451
|
+
* @category common/interactive
|
|
1452
|
+
* @docsKind primary
|
|
1453
|
+
* @wcag AA
|
|
1454
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle-group.component.ts
|
|
1455
|
+
* @selector cngx-button-toggle-group
|
|
1456
|
+
* @since 0.1.0
|
|
1457
|
+
* @relatedTo CngxButtonToggle, CngxRadioGroup
|
|
1458
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/basic-view-switcher</example-url>
|
|
1459
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/disabled-group-cascade-vs-per-toggle</example-url>
|
|
1460
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/vertical-orientation</example-url>
|
|
1461
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1462
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1463
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1136
1464
|
*/
|
|
1137
1465
|
declare class CngxButtonToggleGroup<T = unknown> implements CngxButtonToggleGroupContract<T>, CngxControlValue<T | undefined>, CngxFormFieldControl {
|
|
1138
1466
|
readonly value: _angular_core.ModelSignal<T | undefined>;
|
|
@@ -1141,7 +1469,7 @@ declare class CngxButtonToggleGroup<T = unknown> implements CngxButtonToggleGrou
|
|
|
1141
1469
|
/**
|
|
1142
1470
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1143
1471
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1144
|
-
* adapters) can drive it without a parallel API path
|
|
1472
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1145
1473
|
* typically read only.
|
|
1146
1474
|
*/
|
|
1147
1475
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -1181,7 +1509,7 @@ declare class CngxButtonToggleGroup<T = unknown> implements CngxButtonToggleGrou
|
|
|
1181
1509
|
* a multi-mode parent (via `inject(CNGX_BUTTON_MULTI_TOGGLE_GROUP, {
|
|
1182
1510
|
* optional: true })`) bind `aria-selected` (toolbar APG) instead of
|
|
1183
1511
|
* `aria-checked` (radiogroup APG) AT INJECTION TIME. Mode is static
|
|
1184
|
-
* per atom instance
|
|
1512
|
+
* per atom instance - there is no `[selectionMode]` flag.
|
|
1185
1513
|
*
|
|
1186
1514
|
* `selectedValues` is a `ModelSignal<T[]>` so the consumer can
|
|
1187
1515
|
* two-way-bind via `[(selectedValues)]` and the leaves can mutate
|
|
@@ -1192,12 +1520,14 @@ declare class CngxButtonToggleGroup<T = unknown> implements CngxButtonToggleGrou
|
|
|
1192
1520
|
* the group's internal `SelectionController` so the leaf can render
|
|
1193
1521
|
* `aria-selected` reactively without re-querying the array on every
|
|
1194
1522
|
* keystroke. The signal identity is stable per value (per
|
|
1195
|
-
* `createSelectionController` contract)
|
|
1523
|
+
* `createSelectionController` contract) - safe to read inside a
|
|
1196
1524
|
* `computed()` on the leaf.
|
|
1197
1525
|
*
|
|
1198
1526
|
* `toggle(value)` is the single mutation entry-point the leaf calls
|
|
1199
1527
|
* on Space / Enter / click. The group routes it through its
|
|
1200
1528
|
* controller and writes `selectedValues` accordingly.
|
|
1529
|
+
*
|
|
1530
|
+
* @category common/interactive
|
|
1201
1531
|
*/
|
|
1202
1532
|
interface CngxButtonMultiToggleGroupContract<T = unknown> {
|
|
1203
1533
|
readonly selectedValues: ModelSignal<T[]>;
|
|
@@ -1209,20 +1539,25 @@ interface CngxButtonMultiToggleGroupContract<T = unknown> {
|
|
|
1209
1539
|
* DI token a `CngxButtonToggle` leaf injects to find its multi-mode
|
|
1210
1540
|
* parent group. Always provided via
|
|
1211
1541
|
* `{ provide: CNGX_BUTTON_MULTI_TOGGLE_GROUP, useExisting:
|
|
1212
|
-
* CngxButtonMultiToggleGroup }`
|
|
1542
|
+
* CngxButtonMultiToggleGroup }` - never via concrete-class injection
|
|
1213
1543
|
* (per `reference_atomic_decompose` §4).
|
|
1214
1544
|
*
|
|
1215
1545
|
* The leaf injects this token with `{ optional: true }` alongside
|
|
1216
1546
|
* `CNGX_BUTTON_TOGGLE_GROUP` (also optional). Exactly one parent
|
|
1217
1547
|
* must be present; the leaf throws a dev-mode error otherwise.
|
|
1548
|
+
*
|
|
1549
|
+
* @category common/interactive
|
|
1550
|
+
* @wcag AA
|
|
1551
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-multi-toggle-group.token.ts
|
|
1552
|
+
* @since 0.1.0
|
|
1218
1553
|
*/
|
|
1219
1554
|
declare const CNGX_BUTTON_MULTI_TOGGLE_GROUP: InjectionToken<CngxButtonMultiToggleGroupContract<unknown>>;
|
|
1220
1555
|
|
|
1221
1556
|
/**
|
|
1222
1557
|
* Multi-select button-toggle group. Owns a `selectedValues =
|
|
1223
1558
|
* model<T[]>([])` (the canonical multi-value source) and exposes the
|
|
1224
|
-
* parent contract via `CNGX_BUTTON_MULTI_TOGGLE_GROUP`.
|
|
1225
|
-
* W3C APG `toolbar`
|
|
1559
|
+
* parent contract via `CNGX_BUTTON_MULTI_TOGGLE_GROUP`.
|
|
1560
|
+
* Behaves as a W3C APG `toolbar` - arrow keys MOVE focus only (no auto-select);
|
|
1226
1561
|
* Space and Enter on a focused leaf toggle that leaf's membership.
|
|
1227
1562
|
*
|
|
1228
1563
|
* Mode is **static**: this is the multi-select half of the
|
|
@@ -1234,14 +1569,14 @@ declare const CNGX_BUTTON_MULTI_TOGGLE_GROUP: InjectionToken<CngxButtonMultiTogg
|
|
|
1234
1569
|
* AT INJECTION TIME, never at runtime.
|
|
1235
1570
|
*
|
|
1236
1571
|
* Internals lean on `createSelectionController` from
|
|
1237
|
-
* `@cngx/core/utils` for membership tracking
|
|
1572
|
+
* `@cngx/core/utils` for membership tracking - the controller's
|
|
1238
1573
|
* stable per-value `isSelected` signals (memoised by key) let leaves
|
|
1239
1574
|
* read membership inside their own `computed()` without triggering a
|
|
1240
1575
|
* fresh array walk on every change-detection pass.
|
|
1241
1576
|
*
|
|
1242
1577
|
* `value` is a structural alias of `selectedValues` so the group
|
|
1243
1578
|
* satisfies `CngxControlValue<T[]>` without owning two synchronised
|
|
1244
|
-
* models
|
|
1579
|
+
* models - both names point to the same `ModelSignal<T[]>` instance.
|
|
1245
1580
|
*
|
|
1246
1581
|
* ```html
|
|
1247
1582
|
* <cngx-button-multi-toggle-group label="Filters" [(selectedValues)]="filters">
|
|
@@ -1250,6 +1585,19 @@ declare const CNGX_BUTTON_MULTI_TOGGLE_GROUP: InjectionToken<CngxButtonMultiTogg
|
|
|
1250
1585
|
* <button cngxButtonToggle value="archived">Archived</button>
|
|
1251
1586
|
* </cngx-button-multi-toggle-group>
|
|
1252
1587
|
* ```
|
|
1588
|
+
*
|
|
1589
|
+
* @category common/interactive
|
|
1590
|
+
* @docsKind primary
|
|
1591
|
+
* @wcag AA
|
|
1592
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-multi-toggle-group.component.ts
|
|
1593
|
+
* @selector cngx-button-multi-toggle-group
|
|
1594
|
+
* @since 0.1.0
|
|
1595
|
+
* @relatedTo CngxButtonToggle, CngxButtonToggleGroup
|
|
1596
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/basic-multi-filter-toolbar</example-url>
|
|
1597
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/disabled-group-cascade-vs-per-toggle</example-url>
|
|
1598
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1599
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1600
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1253
1601
|
*/
|
|
1254
1602
|
declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMultiToggleGroupContract<T>, CngxControlValue<T[]>, CngxFormFieldControl {
|
|
1255
1603
|
readonly selectedValues: _angular_core.ModelSignal<T[]>;
|
|
@@ -1259,7 +1607,7 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
1259
1607
|
/**
|
|
1260
1608
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1261
1609
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1262
|
-
* adapters) can drive it without a parallel API path
|
|
1610
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1263
1611
|
* typically read only.
|
|
1264
1612
|
*/
|
|
1265
1613
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -1303,9 +1651,10 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
1303
1651
|
* disabled propagation to the form-submission engine).
|
|
1304
1652
|
*
|
|
1305
1653
|
* Injects EITHER `CNGX_BUTTON_TOGGLE_GROUP` (single, radiogroup) OR
|
|
1306
|
-
* `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (multi, toolbar)
|
|
1307
|
-
* concrete group class
|
|
1308
|
-
*
|
|
1654
|
+
* `CNGX_BUTTON_MULTI_TOGGLE_GROUP` (multi, toolbar) - never the
|
|
1655
|
+
* concrete group class - both with `{ optional: true }`.
|
|
1656
|
+
*
|
|
1657
|
+
* Exactly one parent must be present; the constructor throws when both or
|
|
1309
1658
|
* neither resolve. The resolved parent is stored as a discriminated
|
|
1310
1659
|
* union (`{ mode: 'single' | 'multi'; group }`) so every downstream
|
|
1311
1660
|
* branch narrows without non-null assertions.
|
|
@@ -1317,11 +1666,11 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
1317
1666
|
* - the activation contract (single: `group.value.set(...)`; multi:
|
|
1318
1667
|
* `group.toggle(...)`),
|
|
1319
1668
|
* - whether `(focus)` consumes the parent's pending arrow-select
|
|
1320
|
-
* flag (single only
|
|
1669
|
+
* flag (single only - multi follows toolbar APG, which does not
|
|
1321
1670
|
* auto-select on arrow nav).
|
|
1322
1671
|
*
|
|
1323
|
-
* Mode is **static** per atom instance
|
|
1324
|
-
* `[selectionMode]` flag. Per `feedback_select_family_split`,
|
|
1672
|
+
* Mode is **static** per atom instance.
|
|
1673
|
+
* There is no runtime `[selectionMode]` flag. Per `feedback_select_family_split`,
|
|
1325
1674
|
* single + multi are two distinct groups reusing this leaf; the
|
|
1326
1675
|
* decision is made by the consumer at template-authoring time.
|
|
1327
1676
|
*
|
|
@@ -1330,26 +1679,38 @@ declare class CngxButtonMultiToggleGroup<T = unknown> implements CngxButtonMulti
|
|
|
1330
1679
|
* navigation in either parent group skips per-toggle-disabled leaves
|
|
1331
1680
|
* automatically.
|
|
1332
1681
|
*
|
|
1333
|
-
* **Group-disabled cascade vs roving
|
|
1334
|
-
* group-level `[disabled]` cascade short-circuits `handleSelect` /
|
|
1682
|
+
* **Group-disabled cascade vs roving.**
|
|
1683
|
+
* Thev group-level `[disabled]` cascade short-circuits `handleSelect` /
|
|
1335
1684
|
* `handleKeydown` / `handleFocus` (see `toggleDisabled` computed),
|
|
1336
|
-
* but does NOT propagate into `CngxRovingItem.disabled
|
|
1337
|
-
* forbids re-binding a host-directive's read-only `InputSignal`
|
|
1685
|
+
* but does NOT propagate into `CngxRovingItem.disabled`.
|
|
1686
|
+
* Angular forbids re-binding a host-directive's read-only `InputSignal`
|
|
1338
1687
|
* input from a wrapping host. As a result, a fully-disabled group
|
|
1339
1688
|
* lets visual focus transit through its toggles via Arrow keys;
|
|
1340
|
-
* every selection pathway short-circuits silently.
|
|
1341
|
-
* `CngxRadio`; tracked in `form-primitives-accepted-debt.md §4`.
|
|
1689
|
+
* every selection pathway short-circuits silently.
|
|
1342
1690
|
* Re-evaluation is gated on `CngxRovingItem.disabled` becoming a
|
|
1343
1691
|
* writable surface in `@cngx/common/a11y`.
|
|
1344
1692
|
*
|
|
1345
1693
|
* **Disabled "why" via aria-describedby.** Pillar 2 requires
|
|
1346
1694
|
* disabled state to communicate a reason. The leaf exposes
|
|
1347
|
-
* `[describedBy]` (alias `cngxDescribedBy`)
|
|
1348
|
-
* binds to the host's `aria-describedby`. Consumers render the
|
|
1695
|
+
* `[describedBy]` (alias `cngxDescribedBy`).
|
|
1696
|
+
* A reactive input that binds to the host's `aria-describedby`. Consumers render the
|
|
1349
1697
|
* description element themselves and pass its id; the directive does
|
|
1350
1698
|
* not own a sr-only span (it is a `@Directive` on a native
|
|
1351
|
-
* `<button>`
|
|
1352
|
-
* `<button aria-describedby>` semantics apply.
|
|
1699
|
+
* `<button>` - no template to inject siblings into).
|
|
1700
|
+
* Native `<button aria-describedby>` semantics apply.
|
|
1701
|
+
*
|
|
1702
|
+
* @category common/interactive
|
|
1703
|
+
* @docsKind primary
|
|
1704
|
+
* @wcag AA
|
|
1705
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/button-toggle/button-toggle.directive.ts
|
|
1706
|
+
* @selector button[cngxButtonToggle]
|
|
1707
|
+
* @since 0.1.0
|
|
1708
|
+
* @relatedTo CngxButtonToggleGroup, CngxButtonMultiToggleGroup, CngxRadio
|
|
1709
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/basic-multi-filter-toolbar</example-url>
|
|
1710
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/multi-group/disabled-group-cascade-vs-per-toggle</example-url>
|
|
1711
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/basic-view-switcher</example-url>
|
|
1712
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/disabled-group-cascade-vs-per-toggle</example-url>
|
|
1713
|
+
* <example-url>http://localhost:4200/#/common/interactive/button-toggle/group/vertical-orientation</example-url>
|
|
1353
1714
|
*/
|
|
1354
1715
|
declare class CngxButtonToggle<T = unknown> {
|
|
1355
1716
|
private readonly resolved;
|
|
@@ -1358,8 +1719,8 @@ declare class CngxButtonToggle<T = unknown> {
|
|
|
1358
1719
|
readonly describedBy: _angular_core.InputSignal<string | null>;
|
|
1359
1720
|
protected readonly toggleChecked: _angular_core.Signal<boolean>;
|
|
1360
1721
|
protected readonly toggleDisabled: _angular_core.Signal<boolean>;
|
|
1361
|
-
protected readonly ariaChecked: _angular_core.Signal<"
|
|
1362
|
-
protected readonly ariaSelected: _angular_core.Signal<"
|
|
1722
|
+
protected readonly ariaChecked: _angular_core.Signal<"true" | "false" | null>;
|
|
1723
|
+
protected readonly ariaSelected: _angular_core.Signal<"true" | "false" | null>;
|
|
1363
1724
|
protected handleFocus(): void;
|
|
1364
1725
|
protected handleSelect(): void;
|
|
1365
1726
|
protected handleKeydown(event: Event): void;
|
|
@@ -1375,6 +1736,10 @@ declare class CngxButtonToggle<T = unknown> {
|
|
|
1375
1736
|
* value-equality check (`group.value() === radio.value()`) both
|
|
1376
1737
|
* have access to the leaf without injecting the concrete radio
|
|
1377
1738
|
* class.
|
|
1739
|
+
*
|
|
1740
|
+
* @category common/interactive
|
|
1741
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts
|
|
1742
|
+
* @since 0.1.0
|
|
1378
1743
|
*/
|
|
1379
1744
|
interface CngxRadioRegistration<T = unknown> {
|
|
1380
1745
|
readonly id: string;
|
|
@@ -1394,9 +1759,13 @@ interface CngxRadioRegistration<T = unknown> {
|
|
|
1394
1759
|
* read-only `Signal<boolean>` projected from the group's own
|
|
1395
1760
|
* `model<boolean>`; leaves combine it with their own per-radio
|
|
1396
1761
|
* `disabled()` to compute `radioDisabled`. `name` is the HTML
|
|
1397
|
-
* `name` attribute applied to all radio inputs in this group
|
|
1762
|
+
* `name` attribute applied to all radio inputs in this group -
|
|
1398
1763
|
* defaults to a `nextUid('cngx-radio-group')` value when the
|
|
1399
1764
|
* consumer does not supply one.
|
|
1765
|
+
*
|
|
1766
|
+
* @category common/interactive
|
|
1767
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts
|
|
1768
|
+
* @since 0.1.0
|
|
1400
1769
|
*/
|
|
1401
1770
|
interface CngxRadioGroupContract<T = unknown> {
|
|
1402
1771
|
readonly value: ModelSignal<T | undefined>;
|
|
@@ -1406,7 +1775,7 @@ interface CngxRadioGroupContract<T = unknown> {
|
|
|
1406
1775
|
unregister(id: string): void;
|
|
1407
1776
|
/**
|
|
1408
1777
|
* Consume the group's "last interaction was a roving-arrow keydown"
|
|
1409
|
-
* flag. Called by a leaf's `(focus)` handler
|
|
1778
|
+
* flag. Called by a leaf's `(focus)` handler - when the flag is
|
|
1410
1779
|
* true, the leaf forwards its value to the group's `value` model
|
|
1411
1780
|
* (W3C APG auto-select-on-arrow-nav semantics) and the flag is
|
|
1412
1781
|
* cleared so a subsequent Tab-into focus does not double-select.
|
|
@@ -1419,8 +1788,13 @@ interface CngxRadioGroupContract<T = unknown> {
|
|
|
1419
1788
|
* DI token a `CngxRadio` leaf injects to find its parent group.
|
|
1420
1789
|
* Always provided via
|
|
1421
1790
|
* `{ provide: CNGX_RADIO_GROUP, useExisting: CngxRadioGroup }`
|
|
1422
|
-
*
|
|
1791
|
+
* - never via concrete-class injection (per
|
|
1423
1792
|
* `reference_atomic_decompose` §4).
|
|
1793
|
+
*
|
|
1794
|
+
* @category common/interactive
|
|
1795
|
+
* @wcag AA
|
|
1796
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.token.ts
|
|
1797
|
+
* @since 0.1.0
|
|
1424
1798
|
*/
|
|
1425
1799
|
declare const CNGX_RADIO_GROUP: InjectionToken<CngxRadioGroupContract<unknown>>;
|
|
1426
1800
|
|
|
@@ -1430,7 +1804,7 @@ declare const CNGX_RADIO_GROUP: InjectionToken<CngxRadioGroupContract<unknown>>;
|
|
|
1430
1804
|
* `CNGX_RADIO_GROUP`. The group composes `CngxRovingTabindex` as a
|
|
1431
1805
|
* host directive (with `inputs: ['orientation']` exposed) so arrow-
|
|
1432
1806
|
* key navigation across radios is wired from day one. Leaf
|
|
1433
|
-
* registration is imperative
|
|
1807
|
+
* registration is imperative - `register()` / `unregister()` keep a
|
|
1434
1808
|
* Map in declaration order so the group can resolve the active
|
|
1435
1809
|
* radio by id without re-querying content children on every change
|
|
1436
1810
|
* detection cycle.
|
|
@@ -1453,7 +1827,7 @@ declare const CNGX_RADIO_GROUP: InjectionToken<CngxRadioGroupContract<unknown>>;
|
|
|
1453
1827
|
* (plain field write) and value-set (signal write inside a DOM
|
|
1454
1828
|
* event handler, not an effect) are both legal under the pillar
|
|
1455
1829
|
* rules. Tab-into-group fires focus without a preceding arrow
|
|
1456
|
-
* keydown, so the flag stays false and no auto-select happens
|
|
1830
|
+
* keydown, so the flag stays false and no auto-select happens -
|
|
1457
1831
|
* Tab leaves the consumer's `value` untouched.
|
|
1458
1832
|
*
|
|
1459
1833
|
* ```html
|
|
@@ -1463,6 +1837,21 @@ declare const CNGX_RADIO_GROUP: InjectionToken<CngxRadioGroupContract<unknown>>;
|
|
|
1463
1837
|
* <cngx-radio value="invoice" disabled>Invoice</cngx-radio>
|
|
1464
1838
|
* </cngx-radio-group>
|
|
1465
1839
|
* ```
|
|
1840
|
+
*
|
|
1841
|
+
* @category common/interactive
|
|
1842
|
+
* @docsKind primary
|
|
1843
|
+
* @wcag AA
|
|
1844
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio-group.component.ts
|
|
1845
|
+
* @selector cngx-radio-group
|
|
1846
|
+
* @since 0.1.0
|
|
1847
|
+
* @relatedTo CngxRadio, CngxButtonToggleGroup, CngxChipGroup
|
|
1848
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/basic-vertical-group</example-url>
|
|
1849
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/custom-dot-glyph</example-url>
|
|
1850
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/disabled-group-cascades-per-radio-overrides</example-url>
|
|
1851
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/orientation-horizontal</example-url>
|
|
1852
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1853
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1854
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1466
1855
|
*/
|
|
1467
1856
|
declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>, CngxControlValue<T | undefined>, CngxFormFieldControl {
|
|
1468
1857
|
readonly value: _angular_core.ModelSignal<T | undefined>;
|
|
@@ -1471,7 +1860,7 @@ declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>,
|
|
|
1471
1860
|
/**
|
|
1472
1861
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1473
1862
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1474
|
-
* adapters) can drive it without a parallel API path
|
|
1863
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1475
1864
|
* typically read only.
|
|
1476
1865
|
*/
|
|
1477
1866
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -1501,6 +1890,7 @@ declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>,
|
|
|
1501
1890
|
private readonly fieldHost;
|
|
1502
1891
|
private readonly aggregator;
|
|
1503
1892
|
readonly errorState: _angular_core.Signal<boolean>;
|
|
1893
|
+
constructor();
|
|
1504
1894
|
register(radio: CngxRadioRegistration<T>): void;
|
|
1505
1895
|
unregister(id: string): void;
|
|
1506
1896
|
consumePendingArrowSelect(value: T): boolean;
|
|
@@ -1508,35 +1898,35 @@ declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>,
|
|
|
1508
1898
|
protected handleFocusIn(): void;
|
|
1509
1899
|
protected handleFocusOut(): void;
|
|
1510
1900
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxRadioGroup<any>, never>;
|
|
1511
|
-
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: {
|
|
1901
|
+
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: {}; }]>;
|
|
1512
1902
|
}
|
|
1513
1903
|
|
|
1514
1904
|
/**
|
|
1515
1905
|
* Single radio leaf. Injects the parent group via `CNGX_RADIO_GROUP`
|
|
1516
1906
|
* (token, never the concrete `CngxRadioGroup` class) and writes
|
|
1517
1907
|
* `group.value.set(this.value())` when the user picks it. The leaf
|
|
1518
|
-
* does not own a value of its own
|
|
1908
|
+
* does not own a value of its own - `value` is a required `input<T>`
|
|
1519
1909
|
* supplied by the consumer; checked-ness is derived from
|
|
1520
1910
|
* `group.value() === this.value()`.
|
|
1521
1911
|
*
|
|
1522
1912
|
* Composes `CngxRovingItem` as a host directive with input
|
|
1523
1913
|
* forwarding (`'cngxRovingItemDisabled: disabled'`) so the
|
|
1524
1914
|
* consumer's `[disabled]` binding flows into both the radio's
|
|
1525
|
-
* own `disabled` model AND the roving directive's skip-test
|
|
1915
|
+
* own `disabled` model AND the roving directive's skip-test -
|
|
1526
1916
|
* arrow-key navigation in the parent group (driven by
|
|
1527
1917
|
* `CngxRovingTabindex`) skips per-radio-disabled leaves
|
|
1528
1918
|
* automatically. Group-level `[disabled]` is a separate cascade
|
|
1529
1919
|
* via `radioDisabled = computed(() => group.disabled() ||
|
|
1530
1920
|
* disabled())`; it blocks click + Space/Enter + auto-select
|
|
1531
1921
|
* (`consumePendingArrowSelect` returns false when the group is
|
|
1532
|
-
* disabled) but is NOT forwarded to roving
|
|
1922
|
+
* disabled) but is NOT forwarded to roving - a fully-disabled
|
|
1533
1923
|
* group lets focus transit visually while every selection
|
|
1534
1924
|
* pathway short-circuits.
|
|
1535
1925
|
*
|
|
1536
1926
|
* Selection on click, Space, or Enter (auto-select also fires
|
|
1537
1927
|
* on arrow nav via `consumePendingArrowSelect`); Tab and
|
|
1538
1928
|
* programmatic focus do not select on focus alone (W3C APG
|
|
1539
|
-
* variant
|
|
1929
|
+
* variant - the parent group's keyboard contract makes this
|
|
1540
1930
|
* explicit).
|
|
1541
1931
|
*
|
|
1542
1932
|
* The `[attr.name]` host binding is **cosmetic** (parity with
|
|
@@ -1544,6 +1934,21 @@ declare class CngxRadioGroup<T = unknown> implements CngxRadioGroupContract<T>,
|
|
|
1544
1934
|
* the `<div role="radio">` host does not participate in HTML
|
|
1545
1935
|
* form submission, so the attribute carries no functional
|
|
1546
1936
|
* weight.
|
|
1937
|
+
*
|
|
1938
|
+
* @category common/interactive
|
|
1939
|
+
* @docsKind primary
|
|
1940
|
+
* @wcag AA
|
|
1941
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/radio/radio.component.ts
|
|
1942
|
+
* @selector cngx-radio
|
|
1943
|
+
* @since 0.1.0
|
|
1944
|
+
* @relatedTo CngxRadioGroup, CngxButtonToggle, CngxChipInGroup
|
|
1945
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/basic-vertical-group</example-url>
|
|
1946
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/custom-dot-glyph</example-url>
|
|
1947
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/disabled-group-cascades-per-radio-overrides</example-url>
|
|
1948
|
+
* <example-url>http://localhost:4200/#/common/interactive/radio/orientation-horizontal</example-url>
|
|
1949
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
1950
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
1951
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1547
1952
|
*/
|
|
1548
1953
|
declare class CngxRadio<T = unknown> {
|
|
1549
1954
|
protected readonly group: CngxRadioGroupContract<T>;
|
|
@@ -1567,8 +1972,8 @@ declare class CngxRadio<T = unknown> {
|
|
|
1567
1972
|
/**
|
|
1568
1973
|
* Parent contract every chip-group molecule (`CngxChipGroup` single,
|
|
1569
1974
|
* `CngxMultiChipGroup` multi) provides via `useExisting`.
|
|
1570
|
-
* `CngxChipInGroup` leaves inject this token (NOT optional)
|
|
1571
|
-
* the concrete group class
|
|
1975
|
+
* `CngxChipInGroup` leaves inject this token (NOT optional) - never
|
|
1976
|
+
* the concrete group class - so the leaf stays decompose-ready and
|
|
1572
1977
|
* free of cyclic type dependencies, and the Phase 5 split between
|
|
1573
1978
|
* single + multi groups can share the same leaf implementation.
|
|
1574
1979
|
*
|
|
@@ -1576,7 +1981,7 @@ declare class CngxRadio<T = unknown> {
|
|
|
1576
1981
|
* `toggle(value)` / `remove(value)`. `isDisabled` is a
|
|
1577
1982
|
* `Signal<boolean>` so the leaf's reactive `aria-disabled` and the
|
|
1578
1983
|
* disabled-cascade derivation track it without re-injection. Per
|
|
1579
|
-
* `reference_atomic_decompose` §4
|
|
1984
|
+
* `reference_atomic_decompose` §4 - leaf communicates with its
|
|
1580
1985
|
* parent via DI token, never via concrete parent-class injection.
|
|
1581
1986
|
*
|
|
1582
1987
|
* Mode (single vs multi) is intentionally NOT exposed on this
|
|
@@ -1584,6 +1989,10 @@ declare class CngxRadio<T = unknown> {
|
|
|
1584
1989
|
* consumer / bridge surface in scope reads it. A future feature
|
|
1585
1990
|
* that needs mode discovery can extend the interface then; until
|
|
1586
1991
|
* then the field stays out of the public surface.
|
|
1992
|
+
*
|
|
1993
|
+
* @category common/interactive
|
|
1994
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group-host.token.ts
|
|
1995
|
+
* @since 0.1.0
|
|
1587
1996
|
*/
|
|
1588
1997
|
interface CngxChipGroupHost<T = unknown> {
|
|
1589
1998
|
isSelected(value: T): boolean;
|
|
@@ -1594,20 +2003,25 @@ interface CngxChipGroupHost<T = unknown> {
|
|
|
1594
2003
|
/**
|
|
1595
2004
|
* DI token a `CngxChipInGroup` leaf injects to find its parent chip
|
|
1596
2005
|
* group. Always provided via
|
|
1597
|
-
* `{ provide: CNGX_CHIP_GROUP_HOST, useExisting: <Self> }`
|
|
2006
|
+
* `{ provide: CNGX_CHIP_GROUP_HOST, useExisting: <Self> }` - never
|
|
1598
2007
|
* via concrete-class injection. Required (NOT optional) on the leaf
|
|
1599
2008
|
* side: a leaf without a parent throws `NullInjectorError` at
|
|
1600
|
-
* construction (fail-fast
|
|
2009
|
+
* construction (fail-fast - silent dual-source-of-truth would be
|
|
1601
2010
|
* worse).
|
|
1602
2011
|
*
|
|
1603
2012
|
* Standalone chips outside any group use `[cngxChipInteraction]`
|
|
1604
2013
|
* instead, which provides `CNGX_CONTROL_VALUE` directly without ever
|
|
1605
2014
|
* touching this token.
|
|
2015
|
+
*
|
|
2016
|
+
* @category common/interactive
|
|
2017
|
+
* @wcag AA
|
|
2018
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group-host.token.ts
|
|
2019
|
+
* @since 0.1.0
|
|
1606
2020
|
*/
|
|
1607
2021
|
declare const CNGX_CHIP_GROUP_HOST: InjectionToken<CngxChipGroupHost<unknown>>;
|
|
1608
2022
|
|
|
1609
2023
|
/**
|
|
1610
|
-
* Standalone interactive chip
|
|
2024
|
+
* Standalone interactive chip - applies onto `<cngx-chip>` from
|
|
1611
2025
|
* `@cngx/common/display` and wires `role="option"` selection
|
|
1612
2026
|
* semantics with a local-owned form-bound boolean. Provides
|
|
1613
2027
|
* `CNGX_CONTROL_VALUE` so `CngxFormBridge` (Phase 7) can adapt it
|
|
@@ -1617,7 +2031,7 @@ declare const CNGX_CHIP_GROUP_HOST: InjectionToken<CngxChipGroupHost<unknown>>;
|
|
|
1617
2031
|
* **Use this when** the chip stands alone (e.g. a removable filter
|
|
1618
2032
|
* tag, a single suggestion chip outside any chip-group). For chips
|
|
1619
2033
|
* inside a `<cngx-chip-group>` / `<cngx-multi-chip-group>`, use
|
|
1620
|
-
* `[cngxChipInGroup]` instead
|
|
2034
|
+
* `[cngxChipInGroup]` instead - that variant derives `selected`
|
|
1621
2035
|
* from the parent's selection controller as a `computed()`,
|
|
1622
2036
|
* eliminating the dual-source-of-truth a local model would create.
|
|
1623
2037
|
* A dev-mode guard (via `afterNextRender`) throws if a standalone
|
|
@@ -1636,7 +2050,7 @@ declare const CNGX_CHIP_GROUP_HOST: InjectionToken<CngxChipGroupHost<unknown>>;
|
|
|
1636
2050
|
* **A11y.** `role="option"` + reactive `aria-selected`,
|
|
1637
2051
|
* `aria-disabled`, and `tabindex` (-1 when disabled, 0 otherwise).
|
|
1638
2052
|
* Click + Space + Enter toggle. Backspace + Delete fire
|
|
1639
|
-
* `removeRequest`
|
|
2053
|
+
* `removeRequest` - an output, NOT a state mutation. The consumer
|
|
1640
2054
|
* decides whether removing the chip means dropping it from a list,
|
|
1641
2055
|
* deselecting, or something else.
|
|
1642
2056
|
*
|
|
@@ -1649,7 +2063,7 @@ declare const CNGX_CHIP_GROUP_HOST: InjectionToken<CngxChipGroupHost<unknown>>;
|
|
|
1649
2063
|
*
|
|
1650
2064
|
* **Disabled "why".** When `disabledReason` is set, the directive
|
|
1651
2065
|
* appends a hidden span to the host via `Renderer2` (always-in-DOM
|
|
1652
|
-
* per Pillar 2
|
|
2066
|
+
* per Pillar 2 - the id stays stable across renders). When
|
|
1653
2067
|
* `disabledReason` is empty, consumers may still pass a custom id
|
|
1654
2068
|
* via `cngxDescribedBy` and the `aria-describedby` host binding
|
|
1655
2069
|
* routes to that. The two paths are mutually exclusive: a non-empty
|
|
@@ -1671,15 +2085,28 @@ declare const CNGX_CHIP_GROUP_HOST: InjectionToken<CngxChipGroupHost<unknown>>;
|
|
|
1671
2085
|
* cngxDescribedBy="chip-locked-reason"
|
|
1672
2086
|
* >{{ tag }}</cngx-chip>
|
|
1673
2087
|
* ```
|
|
2088
|
+
*
|
|
2089
|
+
* @category common/interactive
|
|
2090
|
+
* @docsKind primary
|
|
2091
|
+
* @wcag AA
|
|
2092
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-interaction/chip-interaction.directive.ts
|
|
2093
|
+
* @since 0.1.0
|
|
2094
|
+
* @relatedTo CngxChipInGroup, CngxChipGroup, CngxMultiChipGroup, CngxChipInput
|
|
2095
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/interaction/basic-toggle-on-click-space-or-enter</example-url>
|
|
2096
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/interaction/disabled-state</example-url>
|
|
2097
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/interaction/removable-with-removerequest-on-backspace-delete</example-url>
|
|
2098
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
2099
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
2100
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1674
2101
|
*/
|
|
1675
2102
|
declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boolean>, CngxFormFieldControl {
|
|
1676
2103
|
/**
|
|
1677
|
-
* Chip payload
|
|
2104
|
+
* Chip payload - required identifier the consumer associates with
|
|
1678
2105
|
* this chip (e.g. a tag string, filter id, entity reference). The
|
|
1679
2106
|
* directive does not inspect or compare it; it is forwarded to
|
|
1680
2107
|
* `(removeRequest)` listeners and visible in the DOM via the
|
|
1681
2108
|
* consumer's own bindings. Aliased so consumers write `[value]="x"`
|
|
1682
|
-
*
|
|
2109
|
+
* - see naming note in the class JSDoc.
|
|
1683
2110
|
*/
|
|
1684
2111
|
readonly chipValue: _angular_core.InputSignal<T>;
|
|
1685
2112
|
/**
|
|
@@ -1693,7 +2120,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1693
2120
|
/**
|
|
1694
2121
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1695
2122
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1696
|
-
* adapters) can drive it without a parallel API path
|
|
2123
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1697
2124
|
* typically read only.
|
|
1698
2125
|
*/
|
|
1699
2126
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -1702,7 +2129,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1702
2129
|
* rendered by `<cngx-form-field>` or a consumer-owned `<span>`).
|
|
1703
2130
|
* When set, the host emits `aria-errormessage="<id>"` so AT can
|
|
1704
2131
|
* locate the message; consumers MUST render an element with that id
|
|
1705
|
-
*
|
|
2132
|
+
* - passing an id without a matching element produces a dangling
|
|
1706
2133
|
* AT reference. Default `null` skips the attribute entirely.
|
|
1707
2134
|
* Note: WAI-ARIA dictates that AT ignores this attribute when
|
|
1708
2135
|
* `aria-invalid` is absent or `"false"`, so a stable always-emitted
|
|
@@ -1720,14 +2147,14 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1720
2147
|
* internal disabled-reason id when `disabledReason` is set.
|
|
1721
2148
|
*/
|
|
1722
2149
|
readonly describedBy: _angular_core.InputSignal<string | null>;
|
|
1723
|
-
/** Fires on Backspace/Delete keydown
|
|
2150
|
+
/** Fires on Backspace/Delete keydown - consumer owns the removal. */
|
|
1724
2151
|
readonly removeRequest: _angular_core.OutputEmitterRef<void>;
|
|
1725
2152
|
private readonly describedId;
|
|
1726
2153
|
protected readonly resolvedDescribedBy: _angular_core.Signal<string | null>;
|
|
1727
2154
|
readonly id: _angular_core.Signal<string>;
|
|
1728
2155
|
private readonly focusedState;
|
|
1729
2156
|
readonly focused: _angular_core.Signal<boolean>;
|
|
1730
|
-
/** Empty when the chip is unselected
|
|
2157
|
+
/** Empty when the chip is unselected - boolean atom semantics. */
|
|
1731
2158
|
readonly empty: _angular_core.Signal<boolean>;
|
|
1732
2159
|
private readonly fieldHost;
|
|
1733
2160
|
private readonly errorAggregator;
|
|
@@ -1743,7 +2170,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1743
2170
|
}
|
|
1744
2171
|
|
|
1745
2172
|
/**
|
|
1746
|
-
* In-group chip leaf
|
|
2173
|
+
* In-group chip leaf - applies onto `<cngx-chip>` from
|
|
1747
2174
|
* `@cngx/common/display` and wires `role="option"` semantics that
|
|
1748
2175
|
* defer all selection mutations to the surrounding chip-group via
|
|
1749
2176
|
* `CNGX_CHIP_GROUP_HOST`. Required parent (NOT optional): a
|
|
@@ -1754,7 +2181,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1754
2181
|
* **No local model.** `selected` is a `computed()` reading
|
|
1755
2182
|
* `parent.isSelected(value())`; the chip never holds its own
|
|
1756
2183
|
* selection state. This is the fix for the dual-source-of-truth
|
|
1757
|
-
* problem flagged in `cngx-plan-review` (form-primitives §1)
|
|
2184
|
+
* problem flagged in `cngx-plan-review` (form-primitives §1) - a
|
|
1758
2185
|
* single value-flow per directive: the parent's selection
|
|
1759
2186
|
* controller is canonical, the leaf is a pure projection of it.
|
|
1760
2187
|
*
|
|
@@ -1773,7 +2200,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1773
2200
|
* **Group-disabled cascade vs roving (accepted debt §4).** The
|
|
1774
2201
|
* group-level `[disabled]` cascade short-circuits `handleSelect` /
|
|
1775
2202
|
* `handleRemove` (see `chipDisabled` computed), but does NOT
|
|
1776
|
-
* propagate into `CngxRovingItem.disabled`
|
|
2203
|
+
* propagate into `CngxRovingItem.disabled` - Angular forbids
|
|
1777
2204
|
* re-binding a host-directive's read-only `InputSignal`. As a
|
|
1778
2205
|
* result, a fully-disabled group lets visual focus transit through
|
|
1779
2206
|
* its chips via Arrow keys; every selection / remove pathway
|
|
@@ -1782,7 +2209,7 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1782
2209
|
* Re-evaluation is gated on `CngxRovingItem.disabled` becoming a
|
|
1783
2210
|
* writable surface in `@cngx/common/a11y`.
|
|
1784
2211
|
*
|
|
1785
|
-
* **Disabled "why".** No internal sr-only span
|
|
2212
|
+
* **Disabled "why".** No internal sr-only span - the directive
|
|
1786
2213
|
* applies onto a projected `<cngx-chip>` and has no template.
|
|
1787
2214
|
* Consumers wanting a reason announcement render the description
|
|
1788
2215
|
* element themselves and pass its id via `[describedBy]`. Same
|
|
@@ -1805,6 +2232,18 @@ declare class CngxChipInteraction<T = unknown> implements CngxControlValue<boole
|
|
|
1805
2232
|
* }
|
|
1806
2233
|
* </cngx-multi-chip-group>
|
|
1807
2234
|
* ```
|
|
2235
|
+
*
|
|
2236
|
+
* @category common/interactive
|
|
2237
|
+
* @docsKind primary
|
|
2238
|
+
* @wcag AA
|
|
2239
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-in-group/chip-in-group.directive.ts
|
|
2240
|
+
* @since 0.1.0
|
|
2241
|
+
* @relatedTo CngxChipGroup, CngxMultiChipGroup, CngxChipInteraction
|
|
2242
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>
|
|
2243
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>
|
|
2244
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
2245
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
2246
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1808
2247
|
*/
|
|
1809
2248
|
declare class CngxChipInGroup<T = unknown> {
|
|
1810
2249
|
protected readonly parent: CngxChipGroupHost<T>;
|
|
@@ -1831,19 +2270,19 @@ declare class CngxChipInGroup<T = unknown> {
|
|
|
1831
2270
|
* Mode is **static** per `feedback_select_family_split`: this is the
|
|
1832
2271
|
* single-select half of a deliberate split. Consumers pick
|
|
1833
2272
|
* `<cngx-chip-group>` for single-pick semantics or
|
|
1834
|
-
* `<cngx-multi-chip-group>` for multi-pick semantics
|
|
2273
|
+
* `<cngx-multi-chip-group>` for multi-pick semantics - never a
|
|
1835
2274
|
* runtime `[selectionMode]` flag.
|
|
1836
2275
|
*
|
|
1837
2276
|
* `value` is a structural alias of `selected` so the group satisfies
|
|
1838
2277
|
* `CngxControlValue<T | undefined>` without owning two synchronised
|
|
1839
|
-
* models
|
|
2278
|
+
* models - both names point to the same `ModelSignal<T | undefined>`
|
|
1840
2279
|
* instance. Mirrors `CngxCheckboxGroup`'s `selectedValues` / `value`
|
|
1841
2280
|
* pairing.
|
|
1842
2281
|
*
|
|
1843
2282
|
* `[state]` accepts `CngxAsyncState<unknown>` for async-loaded chip
|
|
1844
2283
|
* lists; reactively drives `aria-busy` so AT announces the busy
|
|
1845
2284
|
* moment without consumer wiring. Slot directives for
|
|
1846
|
-
* skeleton/empty/error are deferred
|
|
2285
|
+
* skeleton/empty/error are deferred - the harmonized Phase 3-4 group
|
|
1847
2286
|
* surface ships only the `aria-busy` projection of `[state]`, and
|
|
1848
2287
|
* chip-group follows that precedent for cross-family consistency
|
|
1849
2288
|
* (plan deviation 2026-05-01: skeleton/empty/error slot directives
|
|
@@ -1851,9 +2290,9 @@ declare class CngxChipInGroup<T = unknown> {
|
|
|
1851
2290
|
* cross-family harmonization pass).
|
|
1852
2291
|
*
|
|
1853
2292
|
* Per Pillar 1 (Ableitung statt Verwaltung), `aria-busy` is a
|
|
1854
|
-
* `computed()` from `state.status()`
|
|
2293
|
+
* `computed()` from `state.status()` - never a manual write. Per
|
|
1855
2294
|
* Pillar 3 (Komposition statt Konfiguration), the group composes
|
|
1856
|
-
* `CngxRovingTabindex` and emits no implicit children
|
|
2295
|
+
* `CngxRovingTabindex` and emits no implicit children - consumers
|
|
1857
2296
|
* project chip rows themselves.
|
|
1858
2297
|
*
|
|
1859
2298
|
* ```html
|
|
@@ -1863,6 +2302,18 @@ declare class CngxChipInGroup<T = unknown> {
|
|
|
1863
2302
|
* <cngx-chip cngxChipInGroup [value]="'lg'">Large</cngx-chip>
|
|
1864
2303
|
* </cngx-chip-group>
|
|
1865
2304
|
* ```
|
|
2305
|
+
*
|
|
2306
|
+
* @category common/interactive
|
|
2307
|
+
* @docsKind primary
|
|
2308
|
+
* @wcag AA
|
|
2309
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-group/chip-group.component.ts
|
|
2310
|
+
* @selector cngx-chip-group
|
|
2311
|
+
* @since 0.1.0
|
|
2312
|
+
* @relatedTo CngxMultiChipGroup, CngxChipInGroup, CngxChipInteraction, CngxRadioGroup
|
|
2313
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/group/basic-pick-exactly-one-size</example-url>
|
|
2314
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
2315
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
2316
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1866
2317
|
*/
|
|
1867
2318
|
declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefined>, CngxChipGroupHost<T>, CngxFormFieldControl {
|
|
1868
2319
|
readonly selected: _angular_core.ModelSignal<T | undefined>;
|
|
@@ -1872,7 +2323,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1872
2323
|
/**
|
|
1873
2324
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1874
2325
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1875
|
-
* adapters) can drive it without a parallel API path
|
|
2326
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1876
2327
|
* typically read only.
|
|
1877
2328
|
*/
|
|
1878
2329
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -1888,7 +2339,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1888
2339
|
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
1889
2340
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
1890
2341
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
1891
|
-
/** CngxChipGroupHost
|
|
2342
|
+
/** CngxChipGroupHost - leaf-side cascade source. */
|
|
1892
2343
|
readonly isDisabled: _angular_core.ModelSignal<boolean>;
|
|
1893
2344
|
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
1894
2345
|
isSelected(value: T): boolean;
|
|
@@ -1921,7 +2372,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1921
2372
|
* multi-select half of the chip-group split.
|
|
1922
2373
|
*
|
|
1923
2374
|
* Internals lean on `createSelectionController` from `@cngx/core/utils`
|
|
1924
|
-
* for membership tracking
|
|
2375
|
+
* for membership tracking - the controller's structural-equality
|
|
1925
2376
|
* `selected` snapshot prevents downstream computed cascades from
|
|
1926
2377
|
* thrashing when a re-emission produces the same logical contents
|
|
1927
2378
|
* with a different array reference. Mirrors `CngxCheckboxGroup`'s
|
|
@@ -1929,7 +2380,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1929
2380
|
*
|
|
1930
2381
|
* `value` is a structural alias of `selectedValues` so the group
|
|
1931
2382
|
* satisfies `CngxControlValue<T[]>` without owning two synchronised
|
|
1932
|
-
* models
|
|
2383
|
+
* models - both names point to the same `ModelSignal<T[]>` instance.
|
|
1933
2384
|
*
|
|
1934
2385
|
* `[keyFn]` lets consumers with object-typed values map each value
|
|
1935
2386
|
* to a stable membership key (typically `(v) => v.id`). Without it,
|
|
@@ -1937,7 +2388,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1937
2388
|
*
|
|
1938
2389
|
* `[state]` accepts `CngxAsyncState<unknown>` for async-loaded chip
|
|
1939
2390
|
* lists; reactively drives `aria-busy`. Slot directives for
|
|
1940
|
-
* skeleton/empty/error are deferred
|
|
2391
|
+
* skeleton/empty/error are deferred - the harmonized Phase 3-4 group
|
|
1941
2392
|
* surface ships only the `aria-busy` projection of `[state]`, and
|
|
1942
2393
|
* chip-group follows that precedent for cross-family consistency
|
|
1943
2394
|
* (plan deviation 2026-05-01: see `CngxChipGroup` JSDoc).
|
|
@@ -1947,7 +2398,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1947
2398
|
* NOT `createChipStripRoving`. The strip-roving controller would solve
|
|
1948
2399
|
* clamp-on-removal automatically but its tabindex contract requires
|
|
1949
2400
|
* the parent to bind `[attr.tabindex]` per chip wrapper at the
|
|
1950
|
-
* template level
|
|
2401
|
+
* template level - which a content-projected `CngxChipInGroup` leaf
|
|
1951
2402
|
* model does not allow. Tracked in `form-primitives-accepted-debt §5`;
|
|
1952
2403
|
* UX consequence is a one-shot focus reset to index 0 after
|
|
1953
2404
|
* mid-strip removal, instead of clamping to the next valid sibling.
|
|
@@ -1956,7 +2407,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1956
2407
|
* `createChipRemovalHandler` from `@cngx/forms/select` would drive
|
|
1957
2408
|
* the remove path. That import is a layer violation
|
|
1958
2409
|
* (`@cngx/common/interactive` is Level 2; `@cngx/forms/select` is
|
|
1959
|
-
* Level 3). Removal here is a thin `controller.deselect(value)`
|
|
2410
|
+
* Level 3). Removal here is a thin `controller.deselect(value)` -
|
|
1960
2411
|
* the WeakMap-closure-cache machinery in the select-family handler
|
|
1961
2412
|
* targets `ngTemplateOutlet` chip-slot stability, which content-
|
|
1962
2413
|
* projected chip-in-group leaves do not exhibit.
|
|
@@ -1964,7 +2415,7 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1964
2415
|
* Per Pillar 1 (Ableitung statt Verwaltung), `aria-busy` is a
|
|
1965
2416
|
* `computed()` from `state.status()`. Per Pillar 3 (Komposition
|
|
1966
2417
|
* statt Konfiguration), the group composes `CngxRovingTabindex` and
|
|
1967
|
-
* emits no implicit children
|
|
2418
|
+
* emits no implicit children - consumers project chip rows themselves.
|
|
1968
2419
|
*
|
|
1969
2420
|
* ```html
|
|
1970
2421
|
* <cngx-multi-chip-group label="Tags" [(selectedValues)]="tags">
|
|
@@ -1973,6 +2424,18 @@ declare class CngxChipGroup<T = unknown> implements CngxControlValue<T | undefin
|
|
|
1973
2424
|
* }
|
|
1974
2425
|
* </cngx-multi-chip-group>
|
|
1975
2426
|
* ```
|
|
2427
|
+
*
|
|
2428
|
+
* @category common/interactive
|
|
2429
|
+
* @docsKind primary
|
|
2430
|
+
* @wcag AA
|
|
2431
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/multi-chip-group/multi-chip-group.component.ts
|
|
2432
|
+
* @selector cngx-multi-chip-group
|
|
2433
|
+
* @since 0.1.0
|
|
2434
|
+
* @relatedTo CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction
|
|
2435
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>
|
|
2436
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/coming-in-a-follow-up</example-url>
|
|
2437
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/reactive-forms-same-atom-just-bind-formcontrol</example-url>
|
|
2438
|
+
* <example-url>http://localhost:4200/#/forms/field/form-primitives/signal-forms-drop-the-atom-into-cngx-form-field</example-url>
|
|
1976
2439
|
*/
|
|
1977
2440
|
declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>, CngxChipGroupHost<T>, CngxFormFieldControl {
|
|
1978
2441
|
readonly selectedValues: _angular_core.ModelSignal<T[]>;
|
|
@@ -1982,7 +2445,7 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
1982
2445
|
/**
|
|
1983
2446
|
* Bridge-writable invalid state. `model<boolean>` mirrors `disabled`
|
|
1984
2447
|
* so external integrations (RF/Signal-Forms bridges, custom validity
|
|
1985
|
-
* adapters) can drive it without a parallel API path
|
|
2448
|
+
* adapters) can drive it without a parallel API path - consumers
|
|
1986
2449
|
* typically read only.
|
|
1987
2450
|
*/
|
|
1988
2451
|
readonly invalid: _angular_core.ModelSignal<boolean>;
|
|
@@ -1999,11 +2462,11 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
1999
2462
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
2000
2463
|
readonly state: _angular_core.InputSignal<CngxAsyncState<unknown> | undefined>;
|
|
2001
2464
|
readonly keyFn: _angular_core.InputSignal<(value: T) => unknown>;
|
|
2002
|
-
/** CngxChipGroupHost
|
|
2465
|
+
/** CngxChipGroupHost - leaf-side cascade source. */
|
|
2003
2466
|
readonly isDisabled: _angular_core.ModelSignal<boolean>;
|
|
2004
2467
|
private readonly controller;
|
|
2005
2468
|
protected readonly ariaBusy: _angular_core.Signal<boolean>;
|
|
2006
|
-
/** Public membership count
|
|
2469
|
+
/** Public membership count - useful for label hints + announcements. */
|
|
2007
2470
|
readonly selectedCount: _angular_core.Signal<number>;
|
|
2008
2471
|
constructor();
|
|
2009
2472
|
isSelected(value: T): boolean;
|
|
@@ -2029,7 +2492,7 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
2029
2492
|
* and on multi-token paste. Pairs naturally with
|
|
2030
2493
|
* `<cngx-multi-chip-group>` or any consumer-managed chip list.
|
|
2031
2494
|
*
|
|
2032
|
-
* **Validation slot
|
|
2495
|
+
* **Validation slot - async-state producer.** The directive provides
|
|
2033
2496
|
* `CNGX_STATEFUL` via `useExisting`, exposing a
|
|
2034
2497
|
* `ManualAsyncState<string>` slot driven by `[validateToken]`
|
|
2035
2498
|
* invocations. Bridge directives (`<cngx-toast-on />`,
|
|
@@ -2038,20 +2501,20 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
2038
2501
|
*
|
|
2039
2502
|
* State machine: `idle → pending → success | error` per separator-key
|
|
2040
2503
|
* invocation. Concurrent validations supersede via a monotonic
|
|
2041
|
-
* `validationId`
|
|
2504
|
+
* `validationId` - when a second token is entered before the first
|
|
2042
2505
|
* resolves, the first's resolution is dropped and only the latest
|
|
2043
2506
|
* outcome touches the slot. Mirrors `createCommitController`'s
|
|
2044
2507
|
* supersede contract.
|
|
2045
2508
|
*
|
|
2046
2509
|
* **Removal contract.** `(tokenRemoved)` fires on Backspace at empty
|
|
2047
|
-
* input
|
|
2510
|
+
* input - semantically "user wants to remove the last chip". The
|
|
2048
2511
|
* directive does not own the chip list; the consumer drops the last
|
|
2049
2512
|
* entry from their state in response.
|
|
2050
2513
|
*
|
|
2051
2514
|
* **Duplicates.** `[existingTokens]` is read on every separator-key
|
|
2052
2515
|
* invocation; when `allowDuplicates` is `false` (default), a token
|
|
2053
2516
|
* already present in the list is silently dropped. The directive
|
|
2054
|
-
* does not track a private "previously emitted" set
|
|
2517
|
+
* does not track a private "previously emitted" set - that would be
|
|
2055
2518
|
* an unbounded memory leak. Consumers pass their canonical chip
|
|
2056
2519
|
* list as `[existingTokens]`.
|
|
2057
2520
|
*
|
|
@@ -2073,6 +2536,15 @@ declare class CngxMultiChipGroup<T = unknown> implements CngxControlValue<T[]>,
|
|
|
2073
2536
|
* />
|
|
2074
2537
|
* <cngx-toast-on />
|
|
2075
2538
|
* ```
|
|
2539
|
+
*
|
|
2540
|
+
* @category common/interactive
|
|
2541
|
+
* @docsKind primary
|
|
2542
|
+
* @wcag AA
|
|
2543
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/chip-input/chip-input.directive.ts
|
|
2544
|
+
* @since 0.1.0
|
|
2545
|
+
* @relatedTo CngxMultiChipGroup, CngxChipInteraction, CngxChipInGroup
|
|
2546
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/input/async-validation-with-supersede-semantics</example-url>
|
|
2547
|
+
* <example-url>http://localhost:4200/#/common/interactive/chip/input/synchronous-tokenization</example-url>
|
|
2076
2548
|
*/
|
|
2077
2549
|
declare class CngxChipInput implements CngxStateful<string> {
|
|
2078
2550
|
readonly separators: _angular_core.InputSignal<readonly string[]>;
|
|
@@ -2088,7 +2560,7 @@ declare class CngxChipInput implements CngxStateful<string> {
|
|
|
2088
2560
|
private readonly errorState;
|
|
2089
2561
|
private readonly hadSuccess;
|
|
2090
2562
|
/**
|
|
2091
|
-
* Validation slot
|
|
2563
|
+
* Validation slot - `CngxStateful<string>` contract surface. The
|
|
2092
2564
|
* view is built from raw signals via `buildAsyncStateView` rather
|
|
2093
2565
|
* than `createManualState` (which lives in `@cngx/common/data`)
|
|
2094
2566
|
* because `@cngx/common/data → @cngx/common/interactive` already
|
|
@@ -2118,16 +2590,20 @@ declare class CngxChipInput implements CngxStateful<string> {
|
|
|
2118
2590
|
* `expandedIds`, to selection memoization (`keyFn` consumers), and to the
|
|
2119
2591
|
* stable-identity `isExpanded(id)` signal cache. A non-stable id (e.g. the
|
|
2120
2592
|
* path-based fallback from `flattenTree`) silently breaks all three the
|
|
2121
|
-
* moment the tree is sorted or filtered
|
|
2593
|
+
* moment the tree is sorted or filtered - exactly the Sort/Filter
|
|
2122
2594
|
* integration pattern this stack is designed to support. Forcing the
|
|
2123
2595
|
* caller to think about identity at construction eliminates that whole
|
|
2124
2596
|
* class of heisenbugs.
|
|
2597
|
+
*
|
|
2598
|
+
* @category common/interactive/tree
|
|
2599
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts
|
|
2600
|
+
* @since 0.1.0
|
|
2125
2601
|
*/
|
|
2126
2602
|
interface CngxTreeControllerOptions<T> {
|
|
2127
|
-
/** Source tree
|
|
2603
|
+
/** Source tree - the controller re-derives on every change. */
|
|
2128
2604
|
readonly nodes: Signal<readonly CngxTreeNode<T>[]>;
|
|
2129
2605
|
/**
|
|
2130
|
-
* Derives a stable id per flat node
|
|
2606
|
+
* Derives a stable id per flat node - must survive re-ordering and
|
|
2131
2607
|
* filtering of the source tree. Use a domain id (`(v) => v.id`)
|
|
2132
2608
|
* rather than a positional fallback.
|
|
2133
2609
|
*
|
|
@@ -2168,8 +2644,8 @@ interface CngxTreeControllerOptions<T> {
|
|
|
2168
2644
|
* - No `effect()`, no subscriptions. The only writable slot is the internal
|
|
2169
2645
|
* expandedIds set; every other accessor is a `computed()` or pure fn.
|
|
2170
2646
|
* - `isExpanded(id)` returns the SAME `Signal` instance per id across the
|
|
2171
|
-
* controller's lifetime
|
|
2172
|
-
* - Controller is a11y-agnostic
|
|
2647
|
+
* controller's lifetime - safe to pass into OnPush children without churn.
|
|
2648
|
+
* - Controller is a11y-agnostic - adapters like `createTreeAdItems` live
|
|
2173
2649
|
* in sibling files so `@cngx/core`-level reuse stays clean.
|
|
2174
2650
|
*
|
|
2175
2651
|
* ## Reactivity contract
|
|
@@ -2177,14 +2653,14 @@ interface CngxTreeControllerOptions<T> {
|
|
|
2177
2653
|
*
|
|
2178
2654
|
* - **Reactive** (`Signal<…>` returners): `flatNodes`, `visibleNodes`,
|
|
2179
2655
|
* `expandedIds`, `isExpanded(id)`. Bind these in templates and wrap in
|
|
2180
|
-
* `computed()` freely
|
|
2656
|
+
* `computed()` freely - Angular tracks their dependencies automatically.
|
|
2181
2657
|
*
|
|
2182
2658
|
* - **Snapshot** (plain-return methods): `findById`, `parentOf`,
|
|
2183
2659
|
* `firstChildOf`, `childrenOfValue`, `descendantsOfValue`. These read
|
|
2184
2660
|
* the underlying indexes reactively when called inside a tracked
|
|
2185
2661
|
* context, but intentionally return raw values rather than signals.
|
|
2186
|
-
* They are intended for imperative call-sites
|
|
2187
|
-
* commit flows, AD-activation dispatch
|
|
2662
|
+
* They are intended for imperative call-sites - keydown handlers,
|
|
2663
|
+
* commit flows, AD-activation dispatch - where the caller wants a
|
|
2188
2664
|
* one-shot lookup, not a subscription. If you *do* call them from
|
|
2189
2665
|
* inside an `effect()` that should NOT re-fire on tree changes, wrap
|
|
2190
2666
|
* the call in `untracked(() => ctrl.parentOf(id))`.
|
|
@@ -2193,6 +2669,10 @@ interface CngxTreeControllerOptions<T> {
|
|
|
2193
2669
|
* All mutators (`expand`, `collapse`, `toggle`, `expandAll`, `collapseAll`)
|
|
2194
2670
|
* peek at the expansion set via `untracked()` so invoking them from
|
|
2195
2671
|
* inside an `effect()` never latches that effect onto the expansion set.
|
|
2672
|
+
*
|
|
2673
|
+
* @category common/interactive/tree
|
|
2674
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts
|
|
2675
|
+
* @since 0.1.0
|
|
2196
2676
|
*/
|
|
2197
2677
|
interface CngxTreeController<T> {
|
|
2198
2678
|
/** Flat DFS projection with ARIA metadata + backref to the source node. */
|
|
@@ -2208,7 +2688,7 @@ interface CngxTreeController<T> {
|
|
|
2208
2688
|
*
|
|
2209
2689
|
* Returns a fresh array per call. SelectionController's cascade
|
|
2210
2690
|
* `isIndeterminate` walk invokes `childrenFn` once per tree node on
|
|
2211
|
-
* every membership change
|
|
2691
|
+
* every membership change - a cascade-toggle on a 10k-descendant root
|
|
2212
2692
|
* triggers O(n) fresh allocations per recompute. Tracked as a perf
|
|
2213
2693
|
* follow-up: memoize by (tree-version, value-key) if the 10k demo
|
|
2214
2694
|
* surfaces measurable jitter; spec `tree-controller.spec.ts` carries
|
|
@@ -2217,7 +2697,7 @@ interface CngxTreeController<T> {
|
|
|
2217
2697
|
childrenOfValue(value: T): T[];
|
|
2218
2698
|
/**
|
|
2219
2699
|
* All descendant values (DFS, exclusive of self), for cascade-select.
|
|
2220
|
-
* Same allocation caveat as `childrenOfValue`
|
|
2700
|
+
* Same allocation caveat as `childrenOfValue` - returns a fresh array;
|
|
2221
2701
|
* cascade-select on wide subtrees allocates O(descendants) per call.
|
|
2222
2702
|
*/
|
|
2223
2703
|
descendantsOfValue(value: T): T[];
|
|
@@ -2238,10 +2718,10 @@ interface CngxTreeController<T> {
|
|
|
2238
2718
|
parentOf(id: string): FlatTreeNode<T> | undefined;
|
|
2239
2719
|
firstChildOf(id: string): FlatTreeNode<T> | undefined;
|
|
2240
2720
|
/**
|
|
2241
|
-
* Release the `isExpanded(id)` signal-cache. **Soft contract**
|
|
2721
|
+
* Release the `isExpanded(id)` signal-cache. **Soft contract** - matches
|
|
2242
2722
|
* `createSelectionController`'s destroy semantics:
|
|
2243
2723
|
* - New `isExpanded(id)` queries return a shared `Signal<false>` constant.
|
|
2244
|
-
* - Existing signal bindings created before destroy keep working
|
|
2724
|
+
* - Existing signal bindings created before destroy keep working - the
|
|
2245
2725
|
* underlying `expandedIds` signal is still live, so downstream updates
|
|
2246
2726
|
* continue to propagate.
|
|
2247
2727
|
* - Mutators (`expand` / `collapse` / `toggle` / `expandAll` /
|
|
@@ -2254,7 +2734,13 @@ interface CngxTreeController<T> {
|
|
|
2254
2734
|
*/
|
|
2255
2735
|
destroy(): void;
|
|
2256
2736
|
}
|
|
2257
|
-
/**
|
|
2737
|
+
/**
|
|
2738
|
+
* Factory signature carried by the DI token.
|
|
2739
|
+
*
|
|
2740
|
+
* @category common/interactive/tree
|
|
2741
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts
|
|
2742
|
+
* @since 0.1.0
|
|
2743
|
+
*/
|
|
2258
2744
|
type CngxTreeControllerFactory = <T>(opts: CngxTreeControllerOptions<T>) => CngxTreeController<T>;
|
|
2259
2745
|
/**
|
|
2260
2746
|
* Injection token that resolves the factory used to instantiate a
|
|
@@ -2262,8 +2748,12 @@ type CngxTreeControllerFactory = <T>(opts: CngxTreeControllerOptions<T>) => Cngx
|
|
|
2262
2748
|
* override via `providers`/`viewProviders` for telemetry wrappers, audit
|
|
2263
2749
|
* logging, or server-synced expansion state.
|
|
2264
2750
|
*
|
|
2265
|
-
* Symmetrical to `CNGX_SELECTION_CONTROLLER_FACTORY` in `@cngx/core/utils`
|
|
2751
|
+
* Symmetrical to `CNGX_SELECTION_CONTROLLER_FACTORY` in `@cngx/core/utils` -
|
|
2266
2752
|
* same override surface, one concern below: tree-aware derived views.
|
|
2753
|
+
*
|
|
2754
|
+
* @category common/interactive/tree
|
|
2755
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts
|
|
2756
|
+
* @since 0.1.0
|
|
2267
2757
|
*/
|
|
2268
2758
|
declare const CNGX_TREE_CONTROLLER_FACTORY: InjectionToken<CngxTreeControllerFactory>;
|
|
2269
2759
|
/**
|
|
@@ -2274,6 +2764,10 @@ declare const CNGX_TREE_CONTROLLER_FACTORY: InjectionToken<CngxTreeControllerFac
|
|
|
2274
2764
|
*
|
|
2275
2765
|
* See {@link CngxTreeController} for the returned surface and
|
|
2276
2766
|
* {@link CngxTreeControllerOptions} for the configuration cascade.
|
|
2767
|
+
*
|
|
2768
|
+
* @category common/interactive/tree
|
|
2769
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-controller.ts
|
|
2770
|
+
* @since 0.1.0
|
|
2277
2771
|
*/
|
|
2278
2772
|
declare function createTreeController<T>(opts: CngxTreeControllerOptions<T>): CngxTreeController<T>;
|
|
2279
2773
|
|
|
@@ -2284,9 +2778,13 @@ declare function createTreeController<T>(opts: CngxTreeControllerOptions<T>): Cn
|
|
|
2284
2778
|
* `CngxTreeController` stays free of the `@cngx/common/a11y` import and
|
|
2285
2779
|
* can be reused from contexts that do not render through AD.
|
|
2286
2780
|
*
|
|
2287
|
-
* Returns a structurally-equal memoized computed
|
|
2781
|
+
* Returns a structurally-equal memoized computed - consumers can pass the
|
|
2288
2782
|
* signal straight into `[items]="adItems()"` without worrying about cascade
|
|
2289
2783
|
* re-renders on irrelevant tree re-emissions.
|
|
2784
|
+
*
|
|
2785
|
+
* @category common/interactive/tree
|
|
2786
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-ad-items.ts
|
|
2787
|
+
* @since 0.1.0
|
|
2290
2788
|
*/
|
|
2291
2789
|
declare function createTreeAdItems<T>(ctrl: CngxTreeController<T>): Signal<ActiveDescendantItem[]>;
|
|
2292
2790
|
|
|
@@ -2308,17 +2806,21 @@ declare function createTreeAdItems<T>(ctrl: CngxTreeController<T>): Signal<Activ
|
|
|
2308
2806
|
* Library default (createTreeController / flattenTree)
|
|
2309
2807
|
* ```
|
|
2310
2808
|
*
|
|
2311
|
-
* All fields are optional
|
|
2809
|
+
* All fields are optional - omit the ones you don't need. Typed with
|
|
2312
2810
|
* `unknown` T-parameters because config values flow through the DI
|
|
2313
2811
|
* system where per-instance generics can't be preserved; per-
|
|
2314
2812
|
* controller options are still properly typed via the call site's
|
|
2315
2813
|
* `CngxTreeControllerOptions<T>`.
|
|
2814
|
+
*
|
|
2815
|
+
* @category common/interactive/tree
|
|
2816
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2817
|
+
* @since 0.1.0
|
|
2316
2818
|
*/
|
|
2317
2819
|
interface CngxTreeConfig {
|
|
2318
2820
|
/**
|
|
2319
2821
|
* Fallback for `nodeIdFn` when a caller omits it. With a config
|
|
2320
2822
|
* default set, `CngxTreeControllerOptions.nodeIdFn` becomes
|
|
2321
|
-
* effectively optional
|
|
2823
|
+
* effectively optional - the factory throws in dev mode only when
|
|
2322
2824
|
* neither place provides a function.
|
|
2323
2825
|
*/
|
|
2324
2826
|
readonly defaultNodeIdFn?: (value: unknown, path: readonly number[]) => string;
|
|
@@ -2327,7 +2829,7 @@ interface CngxTreeConfig {
|
|
|
2327
2829
|
/** Fallback for `keyFn`. Library default is identity. */
|
|
2328
2830
|
readonly defaultKeyFn?: (value: unknown) => unknown;
|
|
2329
2831
|
/**
|
|
2330
|
-
* Bound the `isExpanded(id)` signal cache. Default: unlimited
|
|
2832
|
+
* Bound the `isExpanded(id)` signal cache. Default: unlimited -
|
|
2331
2833
|
* keeps the stable-identity guarantee (`isExpanded(v) === isExpanded(v)`
|
|
2332
2834
|
* always holds for the lifetime of the controller). When set, the
|
|
2333
2835
|
* cache FIFO-evicts its oldest entry as soon as the size exceeds
|
|
@@ -2344,11 +2846,19 @@ interface CngxTreeConfig {
|
|
|
2344
2846
|
* DI token carrying the merged {@link CngxTreeConfig}. Defaults to an
|
|
2345
2847
|
* empty object so consumers who never call {@link provideTreeConfig}
|
|
2346
2848
|
* see library-default behaviour unchanged.
|
|
2849
|
+
*
|
|
2850
|
+
* @category common/interactive/tree
|
|
2851
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2852
|
+
* @since 0.1.0
|
|
2347
2853
|
*/
|
|
2348
2854
|
declare const CNGX_TREE_CONFIG: InjectionToken<CngxTreeConfig>;
|
|
2349
2855
|
/**
|
|
2350
|
-
* Feature returned by a `with*` function
|
|
2856
|
+
* Feature returned by a `with*` function - merged by
|
|
2351
2857
|
* {@link provideTreeConfig}.
|
|
2858
|
+
*
|
|
2859
|
+
* @category common/interactive/tree
|
|
2860
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2861
|
+
* @since 0.1.0
|
|
2352
2862
|
*/
|
|
2353
2863
|
interface CngxTreeConfigFeature {
|
|
2354
2864
|
readonly config: Partial<CngxTreeConfig>;
|
|
@@ -2358,23 +2868,43 @@ interface CngxTreeConfigFeature {
|
|
|
2358
2868
|
* Use this to enforce a domain id convention across the whole app
|
|
2359
2869
|
* (e.g. `(v) => (v as { uuid: string }).uuid`) without repeating it
|
|
2360
2870
|
* at every call site.
|
|
2871
|
+
*
|
|
2872
|
+
* @category common/interactive/tree
|
|
2873
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2874
|
+
* @since 0.1.0
|
|
2361
2875
|
*/
|
|
2362
2876
|
declare function withDefaultNodeIdFn<T>(fn: (value: T, path: readonly number[]) => string): CngxTreeConfigFeature;
|
|
2363
2877
|
/**
|
|
2364
2878
|
* App-wide default `labelFn`. Library default is `String(value)`.
|
|
2879
|
+
*
|
|
2880
|
+
* @category common/interactive/tree
|
|
2881
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2882
|
+
* @since 0.1.0
|
|
2365
2883
|
*/
|
|
2366
2884
|
declare function withDefaultLabelFn<T>(fn: (value: T) => string): CngxTreeConfigFeature;
|
|
2367
2885
|
/**
|
|
2368
2886
|
* App-wide default `keyFn`. Library default is identity.
|
|
2887
|
+
*
|
|
2888
|
+
* @category common/interactive/tree
|
|
2889
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2890
|
+
* @since 0.1.0
|
|
2369
2891
|
*/
|
|
2370
2892
|
declare function withDefaultKeyFn<T>(fn: (value: T) => unknown): CngxTreeConfigFeature;
|
|
2371
2893
|
/**
|
|
2372
2894
|
* Bound the `isExpanded(id)` signal cache. See
|
|
2373
2895
|
* {@link CngxTreeConfig.cacheLimit} for the trade-off.
|
|
2896
|
+
*
|
|
2897
|
+
* @category common/interactive/tree
|
|
2898
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2899
|
+
* @since 0.1.0
|
|
2374
2900
|
*/
|
|
2375
2901
|
declare function withTreeCacheLimit(limit: number): CngxTreeConfigFeature;
|
|
2376
2902
|
/**
|
|
2377
2903
|
* App-wide default `initiallyExpanded` seed.
|
|
2904
|
+
*
|
|
2905
|
+
* @category common/interactive/tree
|
|
2906
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2907
|
+
* @since 0.1.0
|
|
2378
2908
|
*/
|
|
2379
2909
|
declare function withDefaultInitiallyExpanded(mode: 'all' | 'none' | readonly string[]): CngxTreeConfigFeature;
|
|
2380
2910
|
/**
|
|
@@ -2392,16 +2922,28 @@ declare function withDefaultInitiallyExpanded(mode: 'all' | 'none' | readonly st
|
|
|
2392
2922
|
* ],
|
|
2393
2923
|
* });
|
|
2394
2924
|
* ```
|
|
2925
|
+
*
|
|
2926
|
+
* @category common/interactive/tree
|
|
2927
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2928
|
+
* @since 0.1.0
|
|
2395
2929
|
*/
|
|
2396
2930
|
declare function provideTreeConfig(...features: CngxTreeConfigFeature[]): Provider[];
|
|
2397
2931
|
/**
|
|
2398
|
-
* Sub-tree / component-scoped variant
|
|
2932
|
+
* Sub-tree / component-scoped variant - use in `viewProviders` so the
|
|
2399
2933
|
* tree config only applies to descendants of this component.
|
|
2934
|
+
*
|
|
2935
|
+
* @category common/interactive/tree
|
|
2936
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2937
|
+
* @since 0.1.0
|
|
2400
2938
|
*/
|
|
2401
2939
|
declare function provideTreeConfigAt(...features: CngxTreeConfigFeature[]): Provider[];
|
|
2402
2940
|
/**
|
|
2403
2941
|
* Inject the currently-resolved config. Safe to call in any injection
|
|
2404
2942
|
* context; returns `{}` if no `provideTreeConfig` is registered.
|
|
2943
|
+
*
|
|
2944
|
+
* @category common/interactive/tree
|
|
2945
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/tree-controller/tree-config.ts
|
|
2946
|
+
* @since 0.1.0
|
|
2405
2947
|
*/
|
|
2406
2948
|
declare function injectTreeConfig(): CngxTreeConfig;
|
|
2407
2949
|
|
|
@@ -2425,7 +2967,7 @@ declare function injectTreeConfig(): CngxTreeConfig;
|
|
|
2425
2967
|
* Attaches on the same element as `CngxActiveDescendant`; injects the AD
|
|
2426
2968
|
* instance (`host: true`, optional) and leaves vertical `ArrowUp`/`Down`,
|
|
2427
2969
|
* `Home`/`End`, and typeahead to AD's own handler. The two directives
|
|
2428
|
-
* coexist without conflict
|
|
2970
|
+
* coexist without conflict - in vertical orientation AD's `isNavKey`
|
|
2429
2971
|
* branches for `ArrowLeft`/`ArrowRight` are already no-ops.
|
|
2430
2972
|
*
|
|
2431
2973
|
* Outputs are informational and state-change-truthful: `expand` /
|
|
@@ -2444,10 +2986,17 @@ declare function injectTreeConfig(): CngxTreeConfig;
|
|
|
2444
2986
|
* tabindex="0"
|
|
2445
2987
|
* ></ul>
|
|
2446
2988
|
* ```
|
|
2989
|
+
*
|
|
2990
|
+
* @category common/interactive/tree
|
|
2991
|
+
* @docsKind primary
|
|
2992
|
+
* @wcag AA
|
|
2993
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hierarchical-nav/hierarchical-nav.directive.ts
|
|
2994
|
+
* @since 0.1.0
|
|
2995
|
+
* @relatedTo CngxActiveDescendant, CngxTreeController, CngxRovingTabindex
|
|
2447
2996
|
*/
|
|
2448
2997
|
declare class CngxHierarchicalNav<T = unknown> {
|
|
2449
2998
|
/**
|
|
2450
|
-
* The tree controller that owns expansion state. Required
|
|
2999
|
+
* The tree controller that owns expansion state. Required - without it
|
|
2451
3000
|
* the directive has nothing to reason about.
|
|
2452
3001
|
*/
|
|
2453
3002
|
readonly controller: _angular_core.InputSignal<CngxTreeController<T>>;
|
|
@@ -2478,6 +3027,8 @@ declare class CngxHierarchicalNav<T = unknown> {
|
|
|
2478
3027
|
* output, calls `event.preventDefault()` for anything non-`noop`, and
|
|
2479
3028
|
* (for move actions) relies on the strategy having already called
|
|
2480
3029
|
* `ad.highlightByValue` on the context.
|
|
3030
|
+
*
|
|
3031
|
+
* @category common/interactive/tree
|
|
2481
3032
|
*/
|
|
2482
3033
|
type CngxHierarchicalNavAction = {
|
|
2483
3034
|
readonly kind: 'expand';
|
|
@@ -2498,6 +3049,8 @@ type CngxHierarchicalNavAction = {
|
|
|
2498
3049
|
* Context passed to every strategy step. `ad` is guaranteed non-null
|
|
2499
3050
|
* (the directive checks before invoking the strategy); `activeId` is
|
|
2500
3051
|
* the current `ad.activeId()` snapshot captured at key-press time.
|
|
3052
|
+
*
|
|
3053
|
+
* @category common/interactive/tree
|
|
2501
3054
|
*/
|
|
2502
3055
|
interface CngxHierarchicalNavContext<T> {
|
|
2503
3056
|
readonly controller: CngxTreeController<T>;
|
|
@@ -2512,10 +3065,12 @@ interface CngxHierarchicalNavContext<T> {
|
|
|
2512
3065
|
* "ArrowLeft collapses but never jumps to parent") can register their
|
|
2513
3066
|
* own strategy via `CNGX_HIERARCHICAL_NAV_STRATEGY`.
|
|
2514
3067
|
*
|
|
2515
|
-
* Strategy steps are synchronous, side-effect-allowed functions
|
|
3068
|
+
* Strategy steps are synchronous, side-effect-allowed functions -
|
|
2516
3069
|
* they may call `ctrl.expand()` / `ctrl.collapse()` / `ad.highlightByValue()`
|
|
2517
3070
|
* before returning the corresponding action. The directive then emits
|
|
2518
3071
|
* the informational output + prevents default key handling.
|
|
3072
|
+
*
|
|
3073
|
+
* @category common/interactive/tree
|
|
2519
3074
|
*/
|
|
2520
3075
|
interface CngxHierarchicalNavStrategy {
|
|
2521
3076
|
onArrowRight<T>(ctx: CngxHierarchicalNavContext<T>): CngxHierarchicalNavAction;
|
|
@@ -2533,8 +3088,10 @@ interface CngxHierarchicalNavStrategy {
|
|
|
2533
3088
|
*
|
|
2534
3089
|
* Move actions internally verify that `ad.highlightByValue` actually
|
|
2535
3090
|
* changed `activeId` (e.g. disabled skip rejection), and downgrade to
|
|
2536
|
-
* `'noop'` when it didn't
|
|
3091
|
+
* `'noop'` when it didn't - so consumers bound to `(movedToChild)` /
|
|
2537
3092
|
* `(movedToParent)` only see state-change-truthful emissions.
|
|
3093
|
+
*
|
|
3094
|
+
* @category common/interactive/tree
|
|
2538
3095
|
*/
|
|
2539
3096
|
declare function createW3CTreeStrategy(): CngxHierarchicalNavStrategy;
|
|
2540
3097
|
/**
|
|
@@ -2562,10 +3119,19 @@ declare function createW3CTreeStrategy(): CngxHierarchicalNavStrategy;
|
|
|
2562
3119
|
* ],
|
|
2563
3120
|
* });
|
|
2564
3121
|
* ```
|
|
3122
|
+
*
|
|
3123
|
+
* @category common/interactive/tree
|
|
3124
|
+
* @wcag AA
|
|
3125
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hierarchical-nav/hierarchical-nav-strategy.ts
|
|
3126
|
+
* @since 0.1.0
|
|
2565
3127
|
*/
|
|
2566
3128
|
declare const CNGX_HIERARCHICAL_NAV_STRATEGY: InjectionToken<CngxHierarchicalNavStrategy>;
|
|
2567
3129
|
|
|
2568
|
-
/**
|
|
3130
|
+
/**
|
|
3131
|
+
* Configuration for `withRetry()`.
|
|
3132
|
+
*
|
|
3133
|
+
* @category common/interactive/retry
|
|
3134
|
+
*/
|
|
2569
3135
|
interface RetryConfig {
|
|
2570
3136
|
/** Maximum number of attempts (including the first). Default: `3`. */
|
|
2571
3137
|
maxAttempts?: number;
|
|
@@ -2574,7 +3140,11 @@ interface RetryConfig {
|
|
|
2574
3140
|
/** Backoff strategy. `'exponential'` doubles the delay each attempt. Default: `'exponential'`. */
|
|
2575
3141
|
backoff?: 'linear' | 'exponential';
|
|
2576
3142
|
}
|
|
2577
|
-
/**
|
|
3143
|
+
/**
|
|
3144
|
+
* State exposed by the retryable action — read-only signals for UI feedback.
|
|
3145
|
+
*
|
|
3146
|
+
* @category common/interactive/retry
|
|
3147
|
+
*/
|
|
2578
3148
|
interface RetryState {
|
|
2579
3149
|
/** Current attempt number (1-based). `0` before first invocation. */
|
|
2580
3150
|
readonly attempt: Signal<number>;
|
|
@@ -2617,10 +3187,16 @@ interface RetryState {
|
|
|
2617
3187
|
* <ng-container [cngxToastOn]="retryState.state"
|
|
2618
3188
|
* toastSuccess="Saved" toastError="All retries failed" />
|
|
2619
3189
|
* ```
|
|
3190
|
+
*
|
|
3191
|
+
* @category common/interactive/retry
|
|
2620
3192
|
*/
|
|
2621
3193
|
declare function withRetry(action: AsyncAction, config?: RetryConfig): [AsyncAction, RetryState];
|
|
2622
3194
|
|
|
2623
|
-
/**
|
|
3195
|
+
/**
|
|
3196
|
+
* State exposed by the optimistic action.
|
|
3197
|
+
*
|
|
3198
|
+
* @category common/interactive/optimistic
|
|
3199
|
+
*/
|
|
2624
3200
|
interface OptimisticState {
|
|
2625
3201
|
/** Whether a rollback occurred on the last invocation. */
|
|
2626
3202
|
readonly rolledBack: Signal<boolean>;
|
|
@@ -2665,12 +3241,16 @@ interface OptimisticState {
|
|
|
2665
3241
|
* @param current - The writable signal to update optimistically.
|
|
2666
3242
|
* @param action - Async action that confirms the value. Should return the confirmed value.
|
|
2667
3243
|
* @returns Tuple of `[applyFn, state]`.
|
|
3244
|
+
*
|
|
3245
|
+
* @category common/interactive/optimistic
|
|
2668
3246
|
*/
|
|
2669
3247
|
declare function optimistic<T>(current: WritableSignal<T>, action: (value: T) => Observable<T>): [(newValue: T) => void, OptimisticState];
|
|
2670
3248
|
|
|
2671
3249
|
/**
|
|
2672
3250
|
* Detects long-press gestures via Pointer Events.
|
|
2673
3251
|
*
|
|
3252
|
+
* @category common/interactive/gestures
|
|
3253
|
+
*
|
|
2674
3254
|
* Fires `longPressed` after the pointer is held down for the `threshold` duration
|
|
2675
3255
|
* without moving more than 10px. Cancels on pointer move (prevents accidental
|
|
2676
3256
|
* triggers during scrolling), pointer up, pointer cancel, and pointer leave.
|
|
@@ -2691,6 +3271,13 @@ declare function optimistic<T>(current: WritableSignal<T>, action: (value: T) =>
|
|
|
2691
3271
|
* Hold for action
|
|
2692
3272
|
* </div>
|
|
2693
3273
|
* ```
|
|
3274
|
+
* @docsKind primary
|
|
3275
|
+
* @wcag AA
|
|
3276
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/long-press.directive.ts
|
|
3277
|
+
* @since 0.1.0
|
|
3278
|
+
* @relatedTo CngxSwipeDismiss, CngxPressable
|
|
3279
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/long-press/custom-threshold</example-url>
|
|
3280
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/long-press/long-press-with-visual-feedback</example-url>
|
|
2694
3281
|
*/
|
|
2695
3282
|
declare class CngxLongPress {
|
|
2696
3283
|
/** Time in ms the pointer must be held to trigger. */
|
|
@@ -2709,11 +3296,105 @@ declare class CngxLongPress {
|
|
|
2709
3296
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxLongPress, "[cngxLongPress]", ["cngxLongPress"], { "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "moveThreshold": { "alias": "moveThreshold"; "required": false; "isSignal": true; }; }, { "longPressed": "longPressed"; }, never, never, true, never>;
|
|
2710
3297
|
}
|
|
2711
3298
|
|
|
2712
|
-
/**
|
|
3299
|
+
/**
|
|
3300
|
+
* Swipe direction - matches drawer positions for natural composition.
|
|
3301
|
+
*
|
|
3302
|
+
* @category common/interactive/gestures
|
|
3303
|
+
*/
|
|
2713
3304
|
type SwipeDirection = 'left' | 'right' | 'up' | 'down';
|
|
3305
|
+
/**
|
|
3306
|
+
* Axis a swipe gesture is allowed to register on. `'x'` accepts
|
|
3307
|
+
* left/right, `'y'` accepts up/down, `'both'` accepts any dominant axis.
|
|
3308
|
+
*
|
|
3309
|
+
* @category common/interactive/gestures
|
|
3310
|
+
*/
|
|
3311
|
+
type SwipeAxis = 'x' | 'y' | 'both';
|
|
3312
|
+
|
|
3313
|
+
/**
|
|
3314
|
+
* Detects directional swipe gestures via Pointer Events and reports the
|
|
3315
|
+
* resolved direction.
|
|
3316
|
+
*
|
|
3317
|
+
* @category common/interactive/gestures
|
|
3318
|
+
*
|
|
3319
|
+
* Generic navigation atom: unlike {@link CngxSwipeDismiss} (one fixed
|
|
3320
|
+
* direction, dismiss intent), this emits `swiped` with the dominant
|
|
3321
|
+
* direction so a single host can drive bidirectional flows - carousels,
|
|
3322
|
+
* paged views, prev/next steppers. The `axis` input pins the gesture to
|
|
3323
|
+
* horizontal or vertical so an orthogonal scroll never fires it.
|
|
3324
|
+
* Exposes `swiping`, `swipeProgress`, and `swipeDirection` signals for
|
|
3325
|
+
* real-time feedback mid-gesture.
|
|
3326
|
+
*
|
|
3327
|
+
* ### Carousel: route left/right into a presenter
|
|
3328
|
+
* ```html
|
|
3329
|
+
* <section cngxSwipe axis="x" (swiped)="onSwipe($event)">…</section>
|
|
3330
|
+
* ```
|
|
3331
|
+
* ```ts
|
|
3332
|
+
* onSwipe(direction: SwipeDirection): void {
|
|
3333
|
+
* if (direction === 'left') {
|
|
3334
|
+
* this.next();
|
|
3335
|
+
* } else if (direction === 'right') {
|
|
3336
|
+
* this.previous();
|
|
3337
|
+
* }
|
|
3338
|
+
* }
|
|
3339
|
+
* ```
|
|
3340
|
+
* @docsKind primary
|
|
3341
|
+
* @wcag AA
|
|
3342
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/swipe.directive.ts
|
|
3343
|
+
* @since 0.1.0
|
|
3344
|
+
* @relatedTo CngxSwipeDismiss, CngxLongPress
|
|
3345
|
+
* <example-url>http://localhost:4200/#/ui/stepper/dot-stepper/mobile-carousel</example-url>
|
|
3346
|
+
*/
|
|
3347
|
+
declare class CngxSwipe {
|
|
3348
|
+
/** Minimum distance in px on the dominant axis to register a swipe. */
|
|
3349
|
+
readonly threshold: _angular_core.InputSignal<number>;
|
|
3350
|
+
/** Axis the gesture is allowed to register on. */
|
|
3351
|
+
readonly axis: _angular_core.InputSignal<SwipeAxis>;
|
|
3352
|
+
/** Whether the directive is active. */
|
|
3353
|
+
readonly enabled: _angular_core.InputSignal<boolean>;
|
|
3354
|
+
/** Emitted with the dominant direction when a swipe passes the threshold. */
|
|
3355
|
+
readonly swiped: _angular_core.OutputEmitterRef<SwipeDirection>;
|
|
3356
|
+
private readonly swipingState;
|
|
3357
|
+
private readonly swipeProgressState;
|
|
3358
|
+
private readonly swipeDirectionState;
|
|
3359
|
+
/** Whether a swipe gesture is currently in progress. */
|
|
3360
|
+
readonly swiping: _angular_core.Signal<boolean>;
|
|
3361
|
+
/** Progress of the current swipe from 0 to 1 (clamped). */
|
|
3362
|
+
readonly swipeProgress: _angular_core.Signal<number>;
|
|
3363
|
+
/** Dominant direction of the in-flight gesture, or `null` when idle. */
|
|
3364
|
+
readonly swipeDirection: _angular_core.Signal<SwipeDirection | null>;
|
|
3365
|
+
/**
|
|
3366
|
+
* The `touch-action` the host should advertise, derived from `axis`.
|
|
3367
|
+
* A pinned axis hands the orthogonal direction back to native
|
|
3368
|
+
* scrolling (`x` -> `pan-y`, `y` -> `pan-x`); `both` claims the
|
|
3369
|
+
* whole surface (`none`). When disabled, no value is written so the
|
|
3370
|
+
* element keeps its native scroll behaviour untouched.
|
|
3371
|
+
*/
|
|
3372
|
+
protected readonly touchAction: _angular_core.Signal<string | null>;
|
|
3373
|
+
constructor();
|
|
3374
|
+
/**
|
|
3375
|
+
* Resolve the swipe direction + distance for a pointer delta.
|
|
3376
|
+
*
|
|
3377
|
+
* When `axis` is pinned, only that axis's delta decides direction
|
|
3378
|
+
* and distance - the orthogonal component is irrelevant, not an
|
|
3379
|
+
* abort reason. The previous endpoint-dominance check (`|dx| >= |dy|`)
|
|
3380
|
+
* discarded a clearly horizontal drag the moment a natural thumb arc
|
|
3381
|
+
* left `|dy|` slightly larger at release, which made a pinned swipe
|
|
3382
|
+
* register only on a near-perfect straight line. `touch-action`
|
|
3383
|
+
* (advertised from the same `axis`) is the real guard against an
|
|
3384
|
+
* orthogonal scroll firing the gesture: the browser cancels the
|
|
3385
|
+
* pointer before pointerup, so a clean cycle reaching here is already
|
|
3386
|
+
* the intended direction. `both` keeps the dominant-axis heuristic.
|
|
3387
|
+
*/
|
|
3388
|
+
private read;
|
|
3389
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxSwipe, never>;
|
|
3390
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxSwipe, "[cngxSwipe]", ["cngxSwipe"], { "threshold": { "alias": "threshold"; "required": false; "isSignal": true; }; "axis": { "alias": "axis"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; }, { "swiped": "swiped"; }, never, never, true, never>;
|
|
3391
|
+
}
|
|
3392
|
+
|
|
2714
3393
|
/**
|
|
2715
3394
|
* Detects directional swipe gestures via Pointer Events.
|
|
2716
3395
|
*
|
|
3396
|
+
* @category common/interactive/gestures
|
|
3397
|
+
*
|
|
2717
3398
|
* Generic atom usable for drawers (swipe-to-close), bottom sheets,
|
|
2718
3399
|
* carousels, and dismissible cards. Emits `swiped` when the gesture
|
|
2719
3400
|
* completes past the threshold. Exposes `swiping` and `swipeProgress`
|
|
@@ -2734,6 +3415,12 @@ type SwipeDirection = 'left' | 'right' | 'up' | 'down';
|
|
|
2734
3415
|
* …
|
|
2735
3416
|
* </div>
|
|
2736
3417
|
* ```
|
|
3418
|
+
* @docsKind primary
|
|
3419
|
+
* @wcag AA
|
|
3420
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/gestures/swipe-dismiss.directive.ts
|
|
3421
|
+
* @since 0.1.0
|
|
3422
|
+
* @relatedTo CngxLongPress, CngxDrawer
|
|
3423
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/swipe-dismiss/directional-swipe</example-url>
|
|
2737
3424
|
*/
|
|
2738
3425
|
declare class CngxSwipeDismiss {
|
|
2739
3426
|
/** Direction of the swipe that triggers dismissal. */
|
|
@@ -2758,18 +3445,26 @@ declare class CngxSwipeDismiss {
|
|
|
2758
3445
|
|
|
2759
3446
|
/**
|
|
2760
3447
|
* Modifier key that arms the keyboard-reorder handler. Plain arrow keys
|
|
2761
|
-
* keep their default meaning (focus navigation)
|
|
3448
|
+
* keep their default meaning (focus navigation) - only the configured
|
|
2762
3449
|
* modifier + arrow produces a move.
|
|
3450
|
+
*
|
|
3451
|
+
* @category common/interactive/reorder
|
|
3452
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts
|
|
3453
|
+
* @since 0.1.0
|
|
2763
3454
|
*/
|
|
2764
3455
|
type CngxReorderModifier = 'ctrl' | 'alt' | 'meta';
|
|
2765
3456
|
/**
|
|
2766
3457
|
* Payload emitted by `(reordered)` whenever a pointer drag or a modifier +
|
|
2767
3458
|
* arrow keyboard move settles on a new position.
|
|
2768
3459
|
*
|
|
2769
|
-
* `next` is a fresh array
|
|
3460
|
+
* `next` is a fresh array - the source signal is never mutated in place,
|
|
2770
3461
|
* so downstream `computed()` graphs see a new reference and re-evaluate.
|
|
2771
3462
|
* Consumers own the write back to the source signal (directly, or via a
|
|
2772
3463
|
* commit controller for optimistic / pessimistic policies).
|
|
3464
|
+
*
|
|
3465
|
+
* @category common/interactive/reorder
|
|
3466
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts
|
|
3467
|
+
* @since 0.1.0
|
|
2773
3468
|
*/
|
|
2774
3469
|
interface CngxReorderEvent<T> {
|
|
2775
3470
|
readonly fromIndex: number;
|
|
@@ -2785,7 +3480,7 @@ interface CngxReorderEvent<T> {
|
|
|
2785
3480
|
* tracking when the user drifts outside the container. The drop target is
|
|
2786
3481
|
* resolved from `document.elementFromPoint` on every `pointermove`. The
|
|
2787
3482
|
* drag ends on `pointerup`, `pointercancel`, or a top-level `Escape`
|
|
2788
|
-
* press
|
|
3483
|
+
* press - only the first two emit `reordered`; Escape cancels the drag
|
|
2789
3484
|
* without a mutation.
|
|
2790
3485
|
*
|
|
2791
3486
|
* **Keyboard flow.** When the focused element is inside an item and the
|
|
@@ -2810,12 +3505,24 @@ interface CngxReorderEvent<T> {
|
|
|
2810
3505
|
* }
|
|
2811
3506
|
* </span>
|
|
2812
3507
|
* ```
|
|
3508
|
+
*
|
|
3509
|
+
* @category common/interactive/reorder
|
|
3510
|
+
* @docsKind primary
|
|
3511
|
+
* @wcag AA
|
|
3512
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/reorder.directive.ts
|
|
3513
|
+
* @since 0.1.0
|
|
3514
|
+
* @relatedTo CngxReorderableMultiSelect, CngxChipStripRovingController
|
|
3515
|
+
* <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/basic-drag-chips-via-mouse-touch</example-url>
|
|
3516
|
+
* <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/commit-action-optimistic-pessimistic-with-supersede</example-url>
|
|
3517
|
+
* <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/keyboard-reorder-alt-arrow-home-end</example-url>
|
|
3518
|
+
* <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/optional-drag-handle-glyph</example-url>
|
|
3519
|
+
* <example-url>http://localhost:4200/#/forms/select/reorderable-multi-select/pre-seeded-values-reorder-log</example-url>
|
|
2813
3520
|
*/
|
|
2814
3521
|
declare class CngxReorder<T = unknown> {
|
|
2815
3522
|
/**
|
|
2816
3523
|
* Signal describing the current, authoritative order. The directive
|
|
2817
3524
|
* reads it lazily at drag-start and at keyboard-move time so drag
|
|
2818
|
-
* sessions always resolve against the freshest value
|
|
3525
|
+
* sessions always resolve against the freshest value - consumers that
|
|
2819
3526
|
* mutate the source signal during a drag (rare) still get consistent
|
|
2820
3527
|
* results.
|
|
2821
3528
|
*/
|
|
@@ -2839,7 +3546,7 @@ declare class CngxReorder<T = unknown> {
|
|
|
2839
3546
|
/**
|
|
2840
3547
|
* Optional escape-hatch selector for drag targets. When set and the
|
|
2841
3548
|
* `pointerdown` target matches `ignoreSelector` (via `closest`), the
|
|
2842
|
-
* gesture is dropped
|
|
3549
|
+
* gesture is dropped - useful when the whole item is draggable but
|
|
2843
3550
|
* interactive children (close buttons, inline edit fields, menu
|
|
2844
3551
|
* triggers) must keep their own click semantics. Applied after
|
|
2845
3552
|
* `handleSelector`, so the two can overlap: e.g.
|
|
@@ -2847,19 +3554,19 @@ declare class CngxReorder<T = unknown> {
|
|
|
2847
3554
|
* `ignoreSelector = 'button, a, [contenteditable]'` yields
|
|
2848
3555
|
* whole-row drag with interactive child exemptions.
|
|
2849
3556
|
*
|
|
2850
|
-
* `null` (default) disables the filter
|
|
3557
|
+
* `null` (default) disables the filter - the `handleSelector` alone
|
|
2851
3558
|
* decides whether a drag starts.
|
|
2852
3559
|
*/
|
|
2853
3560
|
readonly ignoreSelector: _angular_core.InputSignal<string | null>;
|
|
2854
|
-
/** Modifier key required for keyboard-driven reorder. Defaults to `'
|
|
3561
|
+
/** Modifier key required for keyboard-driven reorder. Defaults to `'alt'`. */
|
|
2855
3562
|
readonly keyboardModifier: _angular_core.InputSignal<CngxReorderModifier>;
|
|
2856
3563
|
/** Disables both pointer and keyboard flows. */
|
|
2857
3564
|
readonly disabled: _angular_core.InputSignal<boolean>;
|
|
2858
3565
|
/** Emitted once a drag or keyboard move settles on a new position. */
|
|
2859
3566
|
readonly reordered: _angular_core.OutputEmitterRef<CngxReorderEvent<T>>;
|
|
2860
|
-
/** Informational
|
|
3567
|
+
/** Informational - index of the item picked up by pointer drag. */
|
|
2861
3568
|
readonly dragStart: _angular_core.OutputEmitterRef<number>;
|
|
2862
|
-
/** Informational
|
|
3569
|
+
/** Informational - fires after `reordered` (or alone, if Escape cancelled). */
|
|
2863
3570
|
readonly dragEnd: _angular_core.OutputEmitterRef<void>;
|
|
2864
3571
|
private readonly activeDrag;
|
|
2865
3572
|
/** `true` while a pointer drag is in progress. */
|
|
@@ -2905,6 +3612,10 @@ declare class CngxReorder<T = unknown> {
|
|
|
2905
3612
|
|
|
2906
3613
|
/**
|
|
2907
3614
|
* Configuration for {@link createChipStripRoving}.
|
|
3615
|
+
*
|
|
3616
|
+
* @category common/interactive/reorder
|
|
3617
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts
|
|
3618
|
+
* @since 0.1.0
|
|
2908
3619
|
*/
|
|
2909
3620
|
interface CngxChipStripRovingOptions {
|
|
2910
3621
|
/**
|
|
@@ -2916,7 +3627,7 @@ interface CngxChipStripRovingOptions {
|
|
|
2916
3627
|
/**
|
|
2917
3628
|
* Element hosting the chip wrappers. Read lazily at `focusAt()` time
|
|
2918
3629
|
* so the controller doesn't depend on view-init timing. `null` is a
|
|
2919
|
-
* legitimate idle state
|
|
3630
|
+
* legitimate idle state - the controller becomes a no-op focuser.
|
|
2920
3631
|
*/
|
|
2921
3632
|
readonly container: Signal<HTMLElement | null | undefined>;
|
|
2922
3633
|
/**
|
|
@@ -2933,6 +3644,10 @@ interface CngxChipStripRovingOptions {
|
|
|
2933
3644
|
* `activeIndex` signal the consumer binds into
|
|
2934
3645
|
* `[attr.tabindex]="i === roving.activeIndex() ? 0 : -1"`, plus a
|
|
2935
3646
|
* keyboard handler and imperative focus helpers.
|
|
3647
|
+
*
|
|
3648
|
+
* @category common/interactive/reorder
|
|
3649
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts
|
|
3650
|
+
* @since 0.1.0
|
|
2936
3651
|
*/
|
|
2937
3652
|
interface CngxChipStripRovingController {
|
|
2938
3653
|
/**
|
|
@@ -2941,7 +3656,7 @@ interface CngxChipStripRovingController {
|
|
|
2941
3656
|
*/
|
|
2942
3657
|
readonly activeIndex: Signal<number>;
|
|
2943
3658
|
/**
|
|
2944
|
-
* Announce that a chip at `index` received focus
|
|
3659
|
+
* Announce that a chip at `index` received focus - typically wired
|
|
2945
3660
|
* on the chip wrapper's `(focus)`. Idempotent; keeps the active
|
|
2946
3661
|
* index in sync with whatever the user's focus sequence did (mouse
|
|
2947
3662
|
* click, Tab into the strip, etc.).
|
|
@@ -2950,7 +3665,7 @@ interface CngxChipStripRovingController {
|
|
|
2950
3665
|
/**
|
|
2951
3666
|
* Keyboard handler for the chip-strip container. Handles plain
|
|
2952
3667
|
* `ArrowLeft` / `ArrowRight` / `ArrowUp` / `ArrowDown` / `Home` /
|
|
2953
|
-
* `End`
|
|
3668
|
+
* `End` - moves `activeIndex` and focuses the chip at the new
|
|
2954
3669
|
* position. Events carrying any of `Ctrl` / `Alt` / `Meta` are
|
|
2955
3670
|
* ignored (modifier-gated keys belong to the paired
|
|
2956
3671
|
* {@link CngxReorder} directive).
|
|
@@ -2971,6 +3686,10 @@ interface CngxChipStripRovingController {
|
|
|
2971
3686
|
}
|
|
2972
3687
|
/**
|
|
2973
3688
|
* Signature of the factory behind {@link CNGX_CHIP_STRIP_ROVING_FACTORY}.
|
|
3689
|
+
*
|
|
3690
|
+
* @category common/interactive/reorder
|
|
3691
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts
|
|
3692
|
+
* @since 0.1.0
|
|
2974
3693
|
*/
|
|
2975
3694
|
type CngxChipStripRovingFactory = (opts: CngxChipStripRovingOptions) => CngxChipStripRovingController;
|
|
2976
3695
|
/**
|
|
@@ -2984,13 +3703,16 @@ type CngxChipStripRovingFactory = (opts: CngxChipStripRovingOptions) => CngxChip
|
|
|
2984
3703
|
* `(keydown)` listener that doesn't check modifier keys. Co-located
|
|
2985
3704
|
* with {@link CngxReorder} on the same chip-strip element it
|
|
2986
3705
|
* double-fires on `Ctrl+Arrow` (the reorder emits, then roving also
|
|
2987
|
-
* moves focus
|
|
3706
|
+
* moves focus - racy). This controller deliberately skips
|
|
2988
3707
|
* modifier-pressed events so the paired reorder directive owns that
|
|
2989
3708
|
* gesture.
|
|
2990
3709
|
*
|
|
2991
3710
|
* **Injection context.** Must be called in an injection context
|
|
2992
|
-
* (component constructor / field init) because it installs an
|
|
2993
|
-
*
|
|
3711
|
+
* (component constructor / field init) because it installs an * `effect()` for the active-index clamp on count shrink.
|
|
3712
|
+
*
|
|
3713
|
+
* @category common/interactive/reorder
|
|
3714
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts
|
|
3715
|
+
* @since 0.1.0
|
|
2994
3716
|
*/
|
|
2995
3717
|
declare function createChipStripRoving(opts: CngxChipStripRovingOptions): CngxChipStripRovingController;
|
|
2996
3718
|
/**
|
|
@@ -3004,12 +3726,19 @@ declare function createChipStripRoving(opts: CngxChipStripRovingOptions): CngxCh
|
|
|
3004
3726
|
*
|
|
3005
3727
|
* Symmetrical to {@link CNGX_TREE_CONTROLLER_FACTORY} /
|
|
3006
3728
|
* `CNGX_SELECTION_CONTROLLER_FACTORY`.
|
|
3729
|
+
*
|
|
3730
|
+
* @category common/interactive/reorder
|
|
3731
|
+
* @wcag AA
|
|
3732
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/reorder/chip-strip-roving.ts
|
|
3733
|
+
* @since 0.1.0
|
|
3007
3734
|
*/
|
|
3008
3735
|
declare const CNGX_CHIP_STRIP_ROVING_FACTORY: InjectionToken<CngxChipStripRovingFactory>;
|
|
3009
3736
|
|
|
3010
3737
|
/**
|
|
3011
3738
|
* Declarative keyboard shortcut handler.
|
|
3012
3739
|
*
|
|
3740
|
+
* @category common/interactive/keyboard
|
|
3741
|
+
*
|
|
3013
3742
|
* Binds a keyboard shortcut to the host element without global event listeners
|
|
3014
3743
|
* in a service. Supports `mod` as a platform-aware modifier (`Meta` on macOS,
|
|
3015
3744
|
* `Ctrl` elsewhere).
|
|
@@ -3033,6 +3762,13 @@ declare const CNGX_CHIP_STRIP_ROVING_FACTORY: InjectionToken<CngxChipStripRoving
|
|
|
3033
3762
|
* Press Escape to close
|
|
3034
3763
|
* </div>
|
|
3035
3764
|
* ```
|
|
3765
|
+
* @docsKind primary
|
|
3766
|
+
* @wcag AA
|
|
3767
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/keyboard-shortcut.directive.ts
|
|
3768
|
+
* @since 0.1.0
|
|
3769
|
+
* @relatedTo CngxClickOutside, CngxSearch
|
|
3770
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/keyboard-shortcut/global-shortcut</example-url>
|
|
3771
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/keyboard-shortcut/self-scoped-shortcut</example-url>
|
|
3036
3772
|
*/
|
|
3037
3773
|
declare class CngxKeyboardShortcut {
|
|
3038
3774
|
/** Shortcut combo string, e.g. `'mod+s'`, `'ctrl+shift+k'`, `'escape'`. */
|
|
@@ -3062,14 +3798,21 @@ declare class CngxKeyboardShortcut {
|
|
|
3062
3798
|
/**
|
|
3063
3799
|
* Debounced search term tracker for `<input>` elements.
|
|
3064
3800
|
*
|
|
3801
|
+
* @category common/interactive/keyboard
|
|
3802
|
+
*
|
|
3065
3803
|
* Converts the DOM `input` event stream into a debounced Signal. The raw
|
|
3066
|
-
* Observable is never exposed
|
|
3804
|
+
* Observable is never exposed - signal at the API boundary.
|
|
3067
3805
|
*
|
|
3068
3806
|
* ### Basic usage
|
|
3069
3807
|
* ```html
|
|
3070
3808
|
* <input cngxSearch #search="cngxSearch" placeholder="Search..." />
|
|
3071
3809
|
* <button (click)="search.clear()">Clear</button>
|
|
3072
3810
|
* ```
|
|
3811
|
+
*
|
|
3812
|
+
* @docsKind primary
|
|
3813
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/search.directive.ts
|
|
3814
|
+
* @since 0.1.0
|
|
3815
|
+
* @relatedTo CngxKeyboardShortcut, CngxListboxSearch
|
|
3073
3816
|
*/
|
|
3074
3817
|
declare class CngxSearch {
|
|
3075
3818
|
/** Debounce delay in milliseconds. @defaultValue 300 */
|
|
@@ -3094,6 +3837,8 @@ declare class CngxSearch {
|
|
|
3094
3837
|
/**
|
|
3095
3838
|
* Emits when the user interacts outside the host element.
|
|
3096
3839
|
*
|
|
3840
|
+
* @category common/interactive/keyboard
|
|
3841
|
+
*
|
|
3097
3842
|
* Listens for a configurable DOM event on the document and checks whether
|
|
3098
3843
|
* the event target is outside the host element's subtree. Useful for closing
|
|
3099
3844
|
* dropdowns, popovers, modals, and any overlay that should dismiss on
|
|
@@ -3113,6 +3858,12 @@ declare class CngxSearch {
|
|
|
3113
3858
|
* ```html
|
|
3114
3859
|
* <div cngxClickOutside [eventType]="'click'" (clickOutside)="dismiss()">…</div>
|
|
3115
3860
|
* ```
|
|
3861
|
+
* @docsKind primary
|
|
3862
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/keyboard/click-outside.directive.ts
|
|
3863
|
+
* @since 0.1.0
|
|
3864
|
+
* @relatedTo CngxKeyboardShortcut, CngxPopover
|
|
3865
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/click-outside/dropdown</example-url>
|
|
3866
|
+
* <example-url>http://localhost:4200/#/common/interactive/gestures/click-outside/enabled-toggle</example-url>
|
|
3116
3867
|
*/
|
|
3117
3868
|
declare class CngxClickOutside {
|
|
3118
3869
|
/** The DOM event type to listen for. `'pointerdown'` covers both mouse and touch. */
|
|
@@ -3131,9 +3882,11 @@ declare class CngxClickOutside {
|
|
|
3131
3882
|
/**
|
|
3132
3883
|
* Prevents accidental page navigation when there are unsaved changes.
|
|
3133
3884
|
*
|
|
3885
|
+
* @category common/interactive/guard
|
|
3886
|
+
*
|
|
3134
3887
|
* Sets a `beforeunload` event handler that shows the browser's native
|
|
3135
3888
|
* confirmation dialog when `enabled` is `true`. Does NOT integrate with
|
|
3136
|
-
* the Angular Router
|
|
3889
|
+
* the Angular Router - for route guard protection, use `canDeactivateWhenClean()`.
|
|
3137
3890
|
*
|
|
3138
3891
|
* ### Protect a form
|
|
3139
3892
|
* ```html
|
|
@@ -3150,6 +3903,11 @@ declare class CngxClickOutside {
|
|
|
3150
3903
|
* // In template:
|
|
3151
3904
|
* <form [cngxBeforeUnload]="editForm.dirty()">…</form>
|
|
3152
3905
|
* ```
|
|
3906
|
+
*
|
|
3907
|
+
* @docsKind primary
|
|
3908
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/guard/before-unload.directive.ts
|
|
3909
|
+
* @since 0.1.0
|
|
3910
|
+
* @relatedTo canDeactivateWhenClean
|
|
3153
3911
|
*/
|
|
3154
3912
|
declare class CngxBeforeUnload {
|
|
3155
3913
|
/** Whether the beforeunload guard is active. */
|
|
@@ -3182,44 +3940,63 @@ declare class CngxBeforeUnload {
|
|
|
3182
3940
|
* @param isDirty - Callback that returns `true` when there are unsaved changes.
|
|
3183
3941
|
* @param message - Confirmation message. Default: `'You have unsaved changes. Leave anyway?'`
|
|
3184
3942
|
* @returns A functional guard compatible with Angular's `canDeactivate`.
|
|
3943
|
+
*
|
|
3944
|
+
* @category common/interactive/guard
|
|
3185
3945
|
*/
|
|
3186
3946
|
declare function canDeactivateWhenClean(isDirty: () => boolean, message?: string): () => boolean;
|
|
3187
3947
|
|
|
3188
3948
|
/**
|
|
3189
3949
|
* Injection token for a custom close icon component.
|
|
3190
3950
|
* Set via `provideFeedback(withCloseIcon(MyIcon))` which forwards to this token.
|
|
3951
|
+
*
|
|
3952
|
+
* @category common/interactive
|
|
3953
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/close-button/close-button.ts
|
|
3954
|
+
* @since 0.1.0
|
|
3191
3955
|
*/
|
|
3192
3956
|
declare const CNGX_CLOSE_ICON: InjectionToken<Type<unknown>>;
|
|
3193
3957
|
/**
|
|
3194
|
-
* Shared close/dismiss button
|
|
3958
|
+
* Shared close/dismiss button molecule.
|
|
3195
3959
|
*
|
|
3196
|
-
*
|
|
3197
|
-
*
|
|
3960
|
+
* Composes the native `<button>` shell with an optional projected icon
|
|
3961
|
+
* and the `CNGX_CLOSE_ICON` DI swap; owns ARIA wiring, focus ring,
|
|
3962
|
+
* density, and a default X glyph as the projection fallback.
|
|
3198
3963
|
*
|
|
3199
3964
|
* Used internally by `CngxAlert`, `CngxToastOutlet`, and `CngxPopoverPanel`.
|
|
3200
3965
|
* Can also be used standalone by consumers for dialogs, drawers, chips, etc.
|
|
3201
3966
|
*
|
|
3202
|
-
* All visual properties are CSS Custom Properties
|
|
3967
|
+
* All visual properties are CSS Custom Properties - density is controlled
|
|
3203
3968
|
* via the `feedback.density()` SCSS mixin or direct overrides.
|
|
3204
3969
|
*
|
|
3205
3970
|
* ### Standalone
|
|
3206
3971
|
* ```html
|
|
3207
|
-
* <cngx-close-button (
|
|
3972
|
+
* <cngx-close-button label="Close dialog" (click)="close()" />
|
|
3208
3973
|
* ```
|
|
3209
3974
|
*
|
|
3210
3975
|
* ### Inside a component (click handled by parent)
|
|
3211
3976
|
* ```html
|
|
3212
|
-
* <cngx-close-button />
|
|
3977
|
+
* <cngx-close-button label="Close" />
|
|
3213
3978
|
* ```
|
|
3979
|
+
*
|
|
3980
|
+
* @category common/interactive
|
|
3981
|
+
* @docsKind primary
|
|
3982
|
+
* @wcag AA
|
|
3983
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/close-button/close-button.ts
|
|
3984
|
+
* @since 0.1.0
|
|
3985
|
+
* @relatedTo CNGX_CLOSE_ICON, CngxAlert, CngxToastOutlet, CngxPopover
|
|
3986
|
+
* <example-url>http://localhost:4200/#/common/interactive/close-button/basic</example-url>
|
|
3987
|
+
* <example-url>http://localhost:4200/#/common/interactive/close-button/projected-icon</example-url>
|
|
3988
|
+
* <example-url>http://localhost:4200/#/common/interactive/close-button/contextual-labels</example-url>
|
|
3989
|
+
* <example-url>http://localhost:4200/#/common/interactive/close-button/inside-a-dismissible-card</example-url>
|
|
3214
3990
|
*/
|
|
3215
3991
|
declare class CngxCloseButton {
|
|
3216
3992
|
/**
|
|
3217
|
-
*
|
|
3218
|
-
*
|
|
3219
|
-
*
|
|
3993
|
+
* Required accessible label for the inner `<button>` (`aria-label`).
|
|
3994
|
+
* Describe the dismissable artifact, not the affordance:
|
|
3995
|
+
* `"Close session-expired alert"`, not `"Close"`. A bare `"Close"`
|
|
3996
|
+
* reads identically across every dismiss target on the page.
|
|
3220
3997
|
*/
|
|
3221
3998
|
readonly label: _angular_core.InputSignal<string>;
|
|
3222
|
-
/** @internal
|
|
3999
|
+
/** @internal - global icon from CNGX_CLOSE_ICON token. */
|
|
3223
4000
|
protected readonly customIcon: Type<unknown> | null;
|
|
3224
4001
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxCloseButton, never>;
|
|
3225
4002
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxCloseButton, "cngx-close-button", never, { "label": { "alias": "label"; "required": true; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
@@ -3228,7 +4005,9 @@ declare class CngxCloseButton {
|
|
|
3228
4005
|
/**
|
|
3229
4006
|
* Tracks whether the host element is currently hovered via mouse pointer.
|
|
3230
4007
|
*
|
|
3231
|
-
*
|
|
4008
|
+
* @category common/interactive
|
|
4009
|
+
*
|
|
4010
|
+
* Designed as a `hostDirective` composition primitive - attach it to
|
|
3232
4011
|
* components that need hover state without implementing their own
|
|
3233
4012
|
* mouseenter/mouseleave logic. The `hovered` signal is writable so
|
|
3234
4013
|
* host components can read it via `inject(CngxHoverable, { host: true })`.
|
|
@@ -3252,6 +4031,11 @@ declare class CngxCloseButton {
|
|
|
3252
4031
|
* Hover me
|
|
3253
4032
|
* </div>
|
|
3254
4033
|
* ```
|
|
4034
|
+
*
|
|
4035
|
+
* @docsKind primary
|
|
4036
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/hoverable/hoverable.directive.ts
|
|
4037
|
+
* @since 0.1.0
|
|
4038
|
+
* @relatedTo CngxPressable, CngxRipple
|
|
3255
4039
|
*/
|
|
3256
4040
|
declare class CngxHoverable {
|
|
3257
4041
|
/** `true` while the pointer is over the host element. */
|
|
@@ -3263,7 +4047,9 @@ declare class CngxHoverable {
|
|
|
3263
4047
|
/**
|
|
3264
4048
|
* Headless text-to-speech directive using the browser's SpeechSynthesis API.
|
|
3265
4049
|
*
|
|
3266
|
-
*
|
|
4050
|
+
* @category common/interactive
|
|
4051
|
+
*
|
|
4052
|
+
* A read-aloud feature for cognitive accessibility - dyslexia support, reading
|
|
3267
4053
|
* assistance, or convenience. Not a screen reader replacement (use
|
|
3268
4054
|
* `CngxLiveRegion` for ARIA live regions).
|
|
3269
4055
|
*
|
|
@@ -3273,7 +4059,7 @@ declare class CngxHoverable {
|
|
|
3273
4059
|
*
|
|
3274
4060
|
* Pair with `CngxSpeakButton` (`@cngx/ui`) for a ready-made speaker button.
|
|
3275
4061
|
*
|
|
3276
|
-
* ### Headless
|
|
4062
|
+
* ### Headless - consumer-owned button
|
|
3277
4063
|
* ```html
|
|
3278
4064
|
* <p [cngxSpeak]="text" #tts="cngxSpeak">
|
|
3279
4065
|
* {{ text }}
|
|
@@ -3299,6 +4085,16 @@ declare class CngxHoverable {
|
|
|
3299
4085
|
* <button (click)="tts.speak(liveCounter().toString())">Read current value</button>
|
|
3300
4086
|
* </div>
|
|
3301
4087
|
* ```
|
|
4088
|
+
* @docsKind primary
|
|
4089
|
+
* @wcag AAA
|
|
4090
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/speak/speak.directive.ts
|
|
4091
|
+
* @since 0.1.0
|
|
4092
|
+
* @relatedTo CngxSpeakButton, CngxLiveRegion
|
|
4093
|
+
* <example-url>http://localhost:4200/#/common/interactive/speak/form-error-read-aloud-on-demand</example-url>
|
|
4094
|
+
* <example-url>http://localhost:4200/#/common/interactive/speak/headless-read-aloud</example-url>
|
|
4095
|
+
* <example-url>http://localhost:4200/#/ui/speak/speak-button/material-integration-theme-scss-mat-icon-button</example-url>
|
|
4096
|
+
* <example-url>http://localhost:4200/#/ui/speak/speak-button/styled-speaker-icon</example-url>
|
|
4097
|
+
* <example-url>http://localhost:4200/#/ui/speak/speak-button/theming-css-custom-properties</example-url>
|
|
3302
4098
|
*/
|
|
3303
4099
|
declare class CngxSpeak {
|
|
3304
4100
|
/** Text to speak. When `enabled` is `true`, speech triggers on every change to a non-empty value. */
|
|
@@ -3340,8 +4136,10 @@ declare class CngxSpeak {
|
|
|
3340
4136
|
* `kind` separates pending (in-flight commit) from error (failed commit) so
|
|
3341
4137
|
* styling can branch on the host attribute `[attr.data-status]`. `tpl`
|
|
3342
4138
|
* carries the actual glyph; the host MAY return `tpl: null` to reserve
|
|
3343
|
-
* layout space without rendering anything (rare
|
|
4139
|
+
* layout space without rendering anything (rare - used for force-revealing
|
|
3344
4140
|
* the slot during animation transitions).
|
|
4141
|
+
*
|
|
4142
|
+
* @category common/interactive/listbox
|
|
3345
4143
|
*/
|
|
3346
4144
|
interface CngxOptionStatus {
|
|
3347
4145
|
readonly kind: 'pending' | 'error';
|
|
@@ -3357,6 +4155,8 @@ interface CngxOptionStatus {
|
|
|
3357
4155
|
* the option calls `host.statusFor(value)` once and consumes the returned
|
|
3358
4156
|
* `Signal<CngxOptionStatus | null>` reactively; the host owns the policy
|
|
3359
4157
|
* for resolving which value gets which status at any given commit-id.
|
|
4158
|
+
*
|
|
4159
|
+
* @category common/interactive/listbox
|
|
3360
4160
|
*/
|
|
3361
4161
|
interface CngxOptionStatusHost {
|
|
3362
4162
|
/**
|
|
@@ -3370,9 +4170,13 @@ interface CngxOptionStatusHost {
|
|
|
3370
4170
|
* itself when commit-driven status indicators should reach individual
|
|
3371
4171
|
* options without invading the consumer-authored option template.
|
|
3372
4172
|
*
|
|
3373
|
-
* `CngxOption` injects this token with `{ optional: true }`
|
|
4173
|
+
* `CngxOption` injects this token with `{ optional: true }` - standalone
|
|
3374
4174
|
* use (no host provides the token) results in a stable `null` status with
|
|
3375
4175
|
* no DOM cost.
|
|
4176
|
+
*
|
|
4177
|
+
* @category common/interactive/listbox
|
|
4178
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-status-host.ts
|
|
4179
|
+
* @since 0.1.0
|
|
3376
4180
|
*/
|
|
3377
4181
|
declare const CNGX_OPTION_STATUS_HOST: InjectionToken<CngxOptionStatusHost>;
|
|
3378
4182
|
|
|
@@ -3385,6 +4189,23 @@ declare const CNGX_OPTION_STATUS_HOST: InjectionToken<CngxOptionStatusHost>;
|
|
|
3385
4189
|
* Selection state (`isSelected`) is driven externally by the enclosing listbox.
|
|
3386
4190
|
* In V1 of the stack, `CngxListbox` reads `value()` via the AD item list and
|
|
3387
4191
|
* exposes its own selection through `CngxOption.isSelected()`.
|
|
4192
|
+
*
|
|
4193
|
+
* @category common/interactive/listbox
|
|
4194
|
+
* @docsKind primary
|
|
4195
|
+
* @wcag AA
|
|
4196
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option.directive.ts
|
|
4197
|
+
* @since 0.1.0
|
|
4198
|
+
* @relatedTo CngxListbox, CngxOptionGroup, CngxActiveDescendant
|
|
4199
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>
|
|
4200
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>
|
|
4201
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>
|
|
4202
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/base/single-select</example-url>
|
|
4203
|
+
* <example-url>http://localhost:4200/#/common/interactive/option/flat-options-with-ad</example-url>
|
|
4204
|
+
* <example-url>http://localhost:4200/#/common/interactive/option/grouped-options</example-url>
|
|
4205
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/material-mat-select-via-cngxbindfield</example-url>
|
|
4206
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/reactive-forms-adapted-via-adaptformcontrol</example-url>
|
|
4207
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-multi-select-min-2</example-url>
|
|
4208
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-single-select</example-url>
|
|
3388
4209
|
*/
|
|
3389
4210
|
declare class CngxOption implements CngxAdItemHandle {
|
|
3390
4211
|
/** Discriminator for `CNGX_OPTION_CONTAINER` consumers. */
|
|
@@ -3439,11 +4260,11 @@ declare class CngxOption implements CngxAdItemHandle {
|
|
|
3439
4260
|
* provided or the term is empty; `true` only when the host's policy
|
|
3440
4261
|
* explicitly rejects the option for the current term.
|
|
3441
4262
|
*
|
|
3442
|
-
* Boolean
|
|
4263
|
+
* Boolean - default `Object.is` equality is sufficient.
|
|
3443
4264
|
*/
|
|
3444
4265
|
readonly hidden: Signal<boolean>;
|
|
3445
4266
|
/**
|
|
3446
|
-
* Resolved label as a Signal
|
|
4267
|
+
* Resolved label as a Signal - explicit `label` input wins, falling back to
|
|
3447
4268
|
* the host element's trimmed `textContent` (the W3C-defined plain-text
|
|
3448
4269
|
* projection of the subtree). Plain text by construction; never reads
|
|
3449
4270
|
* `innerHTML`. Consumers can text-interpolate this safely on a closed
|
|
@@ -3457,7 +4278,7 @@ declare class CngxOption implements CngxAdItemHandle {
|
|
|
3457
4278
|
*/
|
|
3458
4279
|
readonly label: Signal<string>;
|
|
3459
4280
|
/**
|
|
3460
|
-
* Back-compat callable alias
|
|
4281
|
+
* Back-compat callable alias - `CngxAdItemHandle.label` accepts both
|
|
3461
4282
|
* `Signal<string>` and `() => string`, so this arrow keeps any
|
|
3462
4283
|
* consumer that called `option.resolvedLabel()` imperatively working
|
|
3463
4284
|
* unchanged.
|
|
@@ -3475,14 +4296,23 @@ declare class CngxOption implements CngxAdItemHandle {
|
|
|
3475
4296
|
/**
|
|
3476
4297
|
* Groups related `CngxOption`s under a visual and semantic header.
|
|
3477
4298
|
*
|
|
3478
|
-
* Renders `role="group"` and `aria-label`
|
|
4299
|
+
* Renders `role="group"` and `aria-label` - children stay flat in the AD item
|
|
3479
4300
|
* list; grouping is purely presentational and for ATs that render group labels.
|
|
3480
4301
|
*
|
|
3481
4302
|
* Hierarchy-aware projection roots (e.g. `CngxSelectShell`) query
|
|
3482
4303
|
* `CNGX_OPTION_CONTAINER` to walk the direct children in DOM order and read
|
|
3483
4304
|
* each group's `options` to populate `CngxSelectOptionGroupDef.options`.
|
|
3484
|
-
* Nested option groups are unsupported
|
|
4305
|
+
* Nested option groups are unsupported - a dev-warning fires when one is
|
|
3485
4306
|
* detected.
|
|
4307
|
+
*
|
|
4308
|
+
* @category common/interactive/listbox
|
|
4309
|
+
* @docsKind primary
|
|
4310
|
+
* @wcag AA
|
|
4311
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-group.directive.ts
|
|
4312
|
+
* @since 0.1.0
|
|
4313
|
+
* @relatedTo CngxOption, CngxListbox
|
|
4314
|
+
* <example-url>http://localhost:4200/#/common/interactive/option/flat-options-with-ad</example-url>
|
|
4315
|
+
* <example-url>http://localhost:4200/#/common/interactive/option/grouped-options</example-url>
|
|
3486
4316
|
*/
|
|
3487
4317
|
declare class CngxOptionGroup {
|
|
3488
4318
|
/** Discriminator for `CNGX_OPTION_CONTAINER` consumers. */
|
|
@@ -3509,6 +4339,8 @@ declare class CngxOptionGroup {
|
|
|
3509
4339
|
* `{ kind: 'group' }`. Both providers expose `useExisting` so consumers
|
|
3510
4340
|
* can `inject(CNGX_OPTION_CONTAINER)` and reach the directive instance
|
|
3511
4341
|
* through the discriminator.
|
|
4342
|
+
*
|
|
4343
|
+
* @category common/interactive/listbox
|
|
3512
4344
|
*/
|
|
3513
4345
|
type CngxOptionContainer = (CngxOptionContainerOption & {
|
|
3514
4346
|
readonly kind: 'option';
|
|
@@ -3519,6 +4351,8 @@ type CngxOptionContainer = (CngxOptionContainerOption & {
|
|
|
3519
4351
|
* Public surface a `CngxOption` exposes when registered under
|
|
3520
4352
|
* `CNGX_OPTION_CONTAINER`. Kept structural so consumers can walk the
|
|
3521
4353
|
* projection tree without importing the directive class directly.
|
|
4354
|
+
*
|
|
4355
|
+
* @category common/interactive/listbox
|
|
3522
4356
|
*/
|
|
3523
4357
|
interface CngxOptionContainerOption {
|
|
3524
4358
|
readonly id: string;
|
|
@@ -3541,6 +4375,9 @@ interface CngxOptionContainerGroup {
|
|
|
3541
4375
|
* { descendants: false })` and walk the result preserving DOM order.
|
|
3542
4376
|
* The discriminated `kind` field separates leaves from groups without
|
|
3543
4377
|
* forcing the consumer to import either directive class.
|
|
4378
|
+
*
|
|
4379
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-container.ts
|
|
4380
|
+
* @since 0.1.0
|
|
3544
4381
|
*/
|
|
3545
4382
|
declare const CNGX_OPTION_CONTAINER: InjectionToken<CngxOptionContainer>;
|
|
3546
4383
|
|
|
@@ -3551,9 +4388,11 @@ declare const CNGX_OPTION_CONTAINER: InjectionToken<CngxOptionContainer>;
|
|
|
3551
4388
|
* `searchTerm` signal and a host-owned `matches` policy.
|
|
3552
4389
|
*
|
|
3553
4390
|
* Splitting policy from visibility keeps the option agnostic about HOW
|
|
3554
|
-
* filtering decides
|
|
4391
|
+
* filtering decides - substring, fuzzy, server-driven - and gives the
|
|
3555
4392
|
* host a single point of control. Empty search term ALWAYS resolves to
|
|
3556
4393
|
* "show everything"; the option short-circuits before calling `matches`.
|
|
4394
|
+
*
|
|
4395
|
+
* @category common/interactive/listbox
|
|
3557
4396
|
*/
|
|
3558
4397
|
interface CngxOptionFilterHost {
|
|
3559
4398
|
/** Current search term. Empty string means "no filter active". */
|
|
@@ -3569,9 +4408,13 @@ interface CngxOptionFilterHost {
|
|
|
3569
4408
|
* `hidden` visibility through a reactive search term and a `matches`
|
|
3570
4409
|
* policy.
|
|
3571
4410
|
*
|
|
3572
|
-
* `CngxOption` injects this token with `{ optional: true }`
|
|
4411
|
+
* `CngxOption` injects this token with `{ optional: true }` - standalone
|
|
3573
4412
|
* use (no host provides the token) leaves every option visible at all
|
|
3574
4413
|
* times with no DOM cost.
|
|
4414
|
+
*
|
|
4415
|
+
* @category common/interactive/listbox
|
|
4416
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-filter-host.ts
|
|
4417
|
+
* @since 0.1.0
|
|
3575
4418
|
*/
|
|
3576
4419
|
declare const CNGX_OPTION_FILTER_HOST: InjectionToken<CngxOptionFilterHost>;
|
|
3577
4420
|
|
|
@@ -3583,15 +4426,17 @@ declare const CNGX_OPTION_FILTER_HOST: InjectionToken<CngxOptionFilterHost>;
|
|
|
3583
4426
|
*
|
|
3584
4427
|
* The need arises with content-projected options: at construction time,
|
|
3585
4428
|
* the option's element-injector chain anchors in the consumer's
|
|
3586
|
-
* authoring view
|
|
4429
|
+
* authoring view - which has no surrounding `CngxActiveDescendant`. The
|
|
3587
4430
|
* shell that owns the listbox + AD provides this token via `useExisting`,
|
|
3588
4431
|
* and projected options consult it as a fallback.
|
|
3589
4432
|
*
|
|
3590
4433
|
* Splitting the contract into a narrow surface (`activeId` /
|
|
3591
4434
|
* `activate` / `highlight`) keeps the option agnostic about HOW the
|
|
3592
|
-
* host wires its AD
|
|
4435
|
+
* host wires its AD - the shell forwards to its inner listbox's AD,
|
|
3593
4436
|
* a hypothetical custom host could route through telemetry / multi-AD
|
|
3594
4437
|
* coordination / etc. without changing the option directive.
|
|
4438
|
+
*
|
|
4439
|
+
* @category common/interactive/listbox
|
|
3595
4440
|
*/
|
|
3596
4441
|
interface CngxOptionInteractionHost {
|
|
3597
4442
|
/**
|
|
@@ -3621,22 +4466,39 @@ interface CngxOptionInteractionHost {
|
|
|
3621
4466
|
* (`CNGX_OPTION_CONTAINER`, `CNGX_OPTION_STATUS_HOST`,
|
|
3622
4467
|
* `CNGX_OPTION_FILTER_HOST`, `CNGX_SELECT_SHELL_SEARCH_HOST`).
|
|
3623
4468
|
*
|
|
3624
|
-
* `CngxOption` injects this token with `{ optional: true }`
|
|
4469
|
+
* `CngxOption` injects this token with `{ optional: true }` -
|
|
3625
4470
|
* standalone use (no host provides the token) leaves option behaviour
|
|
3626
4471
|
* unchanged because the option's own AD inject takes precedence when
|
|
3627
4472
|
* available.
|
|
4473
|
+
*
|
|
4474
|
+
* @category common/interactive/listbox
|
|
4475
|
+
* @wcag AA
|
|
4476
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/option-interaction-host.ts
|
|
4477
|
+
* @since 0.1.0
|
|
3628
4478
|
*/
|
|
3629
4479
|
declare const CNGX_OPTION_INTERACTION_HOST: InjectionToken<CngxOptionInteractionHost>;
|
|
3630
4480
|
|
|
3631
|
-
/**
|
|
4481
|
+
/**
|
|
4482
|
+
* Matcher function used by CngxListboxSearch to filter options.
|
|
4483
|
+
*
|
|
4484
|
+
* @category common/interactive/listbox
|
|
4485
|
+
*/
|
|
3632
4486
|
type ListboxMatchFn = (option: ActiveDescendantItem, term: string) => boolean;
|
|
3633
4487
|
/**
|
|
3634
4488
|
* Search input for a `CngxListbox`.
|
|
3635
4489
|
*
|
|
3636
|
-
* Builds on `CngxSearch` via `hostDirectives`
|
|
4490
|
+
* Builds on `CngxSearch` via `hostDirectives` - inherits debounce, term
|
|
3637
4491
|
* tracking, and clear semantics. Adds a `matchFn` input that listboxes read
|
|
3638
4492
|
* to filter their options. A listbox that has a `CngxListboxSearch` injected
|
|
3639
4493
|
* ancestor reads `term` and `matchFn` from it reactively.
|
|
4494
|
+
*
|
|
4495
|
+
* @category common/interactive/listbox
|
|
4496
|
+
* @docsKind primary
|
|
4497
|
+
* @wcag AA
|
|
4498
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-search.directive.ts
|
|
4499
|
+
* @since 0.1.0
|
|
4500
|
+
* @relatedTo CngxListbox, CngxSearch, CngxListboxTrigger
|
|
4501
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>
|
|
3640
4502
|
*/
|
|
3641
4503
|
declare class CngxListboxSearch {
|
|
3642
4504
|
/** Custom matcher. Defaults to case-insensitive substring match on `label`. */
|
|
@@ -3659,10 +4521,10 @@ declare class CngxListboxSearch {
|
|
|
3659
4521
|
* selection state via two-way `[(value)]` / `[(selectedValues)]` bindings, and
|
|
3660
4522
|
* drives `aria-selected` / `aria-multiselectable` reactively.
|
|
3661
4523
|
*
|
|
3662
|
-
* `value` and `selectedValues` are `model()` signals
|
|
4524
|
+
* `value` and `selectedValues` are `model()` signals - `[value]`,
|
|
3663
4525
|
* `(valueChange)`, and `[(value)]` bindings all work identically. Forms
|
|
3664
4526
|
* integration (`<cngx-form-field>`) is bolted on via the sibling
|
|
3665
|
-
* `CngxListboxFieldBridge` directive from `@cngx/forms/field`
|
|
4527
|
+
* `CngxListboxFieldBridge` directive from `@cngx/forms/field` - this atom
|
|
3666
4528
|
* stays Forms-agnostic.
|
|
3667
4529
|
*
|
|
3668
4530
|
* ### Material / CDK equivalent
|
|
@@ -3674,10 +4536,25 @@ declare class CngxListboxSearch {
|
|
|
3674
4536
|
*
|
|
3675
4537
|
* 1. Single source of truth for ARIA: every attribute is a `computed()`.
|
|
3676
4538
|
* 2. Selection shares the same `CngxActiveDescendant` used by menus and
|
|
3677
|
-
* comboboxes
|
|
4539
|
+
* comboboxes - one mental model for all typeahead widgets.
|
|
3678
4540
|
* 3. `isAllSelected` and `selectedLabels` are derived signals, not manual
|
|
3679
4541
|
* callbacks.
|
|
3680
4542
|
* 4. Forms integration is decoupled: the listbox never imports `@angular/forms`.
|
|
4543
|
+
*
|
|
4544
|
+
* @category common/interactive/listbox
|
|
4545
|
+
* @docsKind primary
|
|
4546
|
+
* @wcag AA
|
|
4547
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox.directive.ts
|
|
4548
|
+
* @since 0.1.0
|
|
4549
|
+
* @relatedTo CngxListboxSearch, CngxListboxTrigger, CngxOption, CngxOptionGroup, CngxActiveDescendant
|
|
4550
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/search/command-palette</example-url>
|
|
4551
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>
|
|
4552
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/base/multi-select</example-url>
|
|
4553
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/base/single-select</example-url>
|
|
4554
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/material-mat-select-via-cngxbindfield</example-url>
|
|
4555
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/reactive-forms-adapted-via-adaptformcontrol</example-url>
|
|
4556
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-multi-select-min-2</example-url>
|
|
4557
|
+
* <example-url>http://localhost:4200/#/forms/field/listbox-forms/signal-forms-single-select</example-url>
|
|
3681
4558
|
*/
|
|
3682
4559
|
declare class CngxListbox<T = unknown> {
|
|
3683
4560
|
/** Accessible label for the listbox region. */
|
|
@@ -3694,7 +4571,7 @@ declare class CngxListbox<T = unknown> {
|
|
|
3694
4571
|
* Optional explicit reference to a `CngxListboxSearch` whose term drives
|
|
3695
4572
|
* `filteredOptions`. Consumers wire this up with a template reference:
|
|
3696
4573
|
* `[cngxSearchRef]="search"` and `#search="cngxListboxSearch"`. No ancestor
|
|
3697
|
-
* injection
|
|
4574
|
+
* injection - orthogonal composition, like `CngxSortHeader` + `CngxSortRef`.
|
|
3698
4575
|
*/
|
|
3699
4576
|
readonly cngxSearchRef: _angular_core.InputSignal<CngxListboxSearch | null>;
|
|
3700
4577
|
/**
|
|
@@ -3705,7 +4582,7 @@ declare class CngxListbox<T = unknown> {
|
|
|
3705
4582
|
*
|
|
3706
4583
|
* **Why this exists.**
|
|
3707
4584
|
* The commit flow needs to snapshot the pre-pick value synchronously when
|
|
3708
|
-
* the user clicks an option
|
|
4585
|
+
* the user clicks an option - to roll back to it on error. Without this
|
|
3709
4586
|
* flag, CngxListbox writes `value` via two-way binding BEFORE the consumer's
|
|
3710
4587
|
* own `ad.activated` subscriber runs, and the pre-pick value is already
|
|
3711
4588
|
* gone by the time we try to snapshot it. Flipping this flag lets the
|
|
@@ -3762,7 +4639,7 @@ declare class CngxListbox<T = unknown> {
|
|
|
3762
4639
|
/** Clear all selections. */
|
|
3763
4640
|
clear(): void;
|
|
3764
4641
|
/**
|
|
3765
|
-
* Select every non-disabled option. Only valid in multi mode
|
|
4642
|
+
* Select every non-disabled option. Only valid in multi mode - in single
|
|
3766
4643
|
* mode this is a no-op.
|
|
3767
4644
|
*/
|
|
3768
4645
|
selectAll(): void;
|
|
@@ -3791,7 +4668,7 @@ interface PopoverController$3 {
|
|
|
3791
4668
|
* Trigger atom for listbox dropdowns.
|
|
3792
4669
|
*
|
|
3793
4670
|
* Pairs a focusable element (button) with a `CngxListbox` and a `CngxPopover`
|
|
3794
|
-
* through explicit template references
|
|
4671
|
+
* through explicit template references - no ancestor injection, consistent
|
|
3795
4672
|
* with the `CngxSortHeader` / `CngxSortRef` orthogonal composition pattern.
|
|
3796
4673
|
*
|
|
3797
4674
|
* Implements the WAI-ARIA combobox-less listbox trigger keyboard model:
|
|
@@ -3803,6 +4680,14 @@ interface PopoverController$3 {
|
|
|
3803
4680
|
* | open | ArrowDown / ArrowUp / Home / End | delegate to AD primitives |
|
|
3804
4681
|
* | open | Enter / Space | activate; close if `closeOnSelect()` |
|
|
3805
4682
|
* | any | Escape | close and restore focus to trigger |
|
|
4683
|
+
*
|
|
4684
|
+
* @category common/interactive/listbox
|
|
4685
|
+
* @docsKind primary
|
|
4686
|
+
* @wcag AA
|
|
4687
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/listbox/listbox-trigger.directive.ts
|
|
4688
|
+
* @since 0.1.0
|
|
4689
|
+
* @relatedTo CngxListbox, CngxListboxSearch, CngxPopoverTrigger, CngxActiveDescendant
|
|
4690
|
+
* <example-url>http://localhost:4200/#/common/interactive/listbox/trigger/select-dropdown</example-url>
|
|
3806
4691
|
*/
|
|
3807
4692
|
declare class CngxListboxTrigger<T = unknown> {
|
|
3808
4693
|
/** Listbox controlled by this trigger. */
|
|
@@ -3816,7 +4701,7 @@ declare class CngxListboxTrigger<T = unknown> {
|
|
|
3816
4701
|
/**
|
|
3817
4702
|
* Fires when the user presses Backspace on an empty input. Only
|
|
3818
4703
|
* emitted when the host element is an `<input>` with a co-located
|
|
3819
|
-
* `CngxListboxSearch`
|
|
4704
|
+
* `CngxListboxSearch` - the tag-input convention "Backspace on empty
|
|
3820
4705
|
* deletes the trailing chip" lives at the trigger, so consumers only
|
|
3821
4706
|
* wire one subscription to own the delete path. On non-input hosts
|
|
3822
4707
|
* (classic button triggers) the event never fires.
|
|
@@ -3847,9 +4732,11 @@ declare class CngxListboxTrigger<T = unknown> {
|
|
|
3847
4732
|
* arrow-right / arrow-left keyboard semantics through a focus-stack
|
|
3848
4733
|
* model. The trigger looks up a submenu by matching the active item's
|
|
3849
4734
|
* `id` against this contract's `id`.
|
|
4735
|
+
*
|
|
4736
|
+
* @category common/interactive/menu
|
|
3850
4737
|
*/
|
|
3851
4738
|
interface CngxMenuSubmenuLike {
|
|
3852
|
-
/** Host element id
|
|
4739
|
+
/** Host element id - matches the surrounding `CngxMenuItem` id. */
|
|
3853
4740
|
readonly id: string;
|
|
3854
4741
|
/** Reactive open state, mirrored from the wrapped popover. */
|
|
3855
4742
|
readonly isOpen: Signal<boolean>;
|
|
@@ -3862,6 +4749,11 @@ interface CngxMenuSubmenuLike {
|
|
|
3862
4749
|
* DI token a submenu-companion directive provides. The surrounding menu
|
|
3863
4750
|
* collects every provider via `contentChildren(CNGX_MENU_SUBMENU_ITEM,
|
|
3864
4751
|
* { descendants: true })` and exposes the array on `CngxMenuHost.submenuItems`.
|
|
4752
|
+
*
|
|
4753
|
+
* @category common/interactive/menu
|
|
4754
|
+
* @wcag AA
|
|
4755
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-submenu.token.ts
|
|
4756
|
+
* @since 0.1.0
|
|
3865
4757
|
*/
|
|
3866
4758
|
declare const CNGX_MENU_SUBMENU_ITEM: InjectionToken<CngxMenuSubmenuLike>;
|
|
3867
4759
|
|
|
@@ -3870,6 +4762,8 @@ declare const CNGX_MENU_SUBMENU_ITEM: InjectionToken<CngxMenuSubmenuLike>;
|
|
|
3870
4762
|
* host) exposes to composers. Triggers and submenu directives depend on
|
|
3871
4763
|
* this interface rather than on the concrete `CngxMenu` class so the
|
|
3872
4764
|
* coupling stays substitutable.
|
|
4765
|
+
*
|
|
4766
|
+
* @category common/interactive/menu
|
|
3873
4767
|
*/
|
|
3874
4768
|
interface CngxMenuHost {
|
|
3875
4769
|
readonly ad: CngxActiveDescendant;
|
|
@@ -3880,13 +4774,25 @@ interface CngxMenuHost {
|
|
|
3880
4774
|
* `submenuItems`.
|
|
3881
4775
|
*/
|
|
3882
4776
|
readonly submenuItems: Signal<readonly CngxMenuSubmenuLike[]>;
|
|
4777
|
+
/**
|
|
4778
|
+
* Move DOM focus to the menu container element. Triggers that need to
|
|
4779
|
+
* transfer focus into the menu after open call this. Consumers must
|
|
4780
|
+
* ensure the host element carries a non-negative tabindex; see
|
|
4781
|
+
* `CngxMenu.focus()`.
|
|
4782
|
+
*/
|
|
4783
|
+
focus(): void;
|
|
3883
4784
|
}
|
|
3884
4785
|
/**
|
|
3885
4786
|
* DI token a menu host provides for sub-component composers (e.g. an
|
|
3886
4787
|
* inside-the-menu submenu trigger) that resolve the host via `inject()`.
|
|
3887
4788
|
* Triggers that live on a different element pass a template-ref through
|
|
3888
|
-
* an input typed against `CngxMenuHost` instead
|
|
4789
|
+
* an input typed against `CngxMenuHost` instead - DI across element
|
|
3889
4790
|
* boundaries cannot reach the menu.
|
|
4791
|
+
*
|
|
4792
|
+
* @category common/interactive/menu
|
|
4793
|
+
* @wcag AA
|
|
4794
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-host.token.ts
|
|
4795
|
+
* @since 0.1.0
|
|
3890
4796
|
*/
|
|
3891
4797
|
declare const CNGX_MENU_HOST: InjectionToken<CngxMenuHost>;
|
|
3892
4798
|
|
|
@@ -3895,13 +4801,25 @@ declare const CNGX_MENU_HOST: InjectionToken<CngxMenuHost>;
|
|
|
3895
4801
|
*
|
|
3896
4802
|
* Uses `CngxActiveDescendant` as a `hostDirective` so items rendered with
|
|
3897
4803
|
* `CngxMenuItem` (or its sub-roles) are tracked automatically. No selection
|
|
3898
|
-
* state
|
|
4804
|
+
* state - menus fire actions through the `itemActivated` output.
|
|
4805
|
+
*
|
|
4806
|
+
* @category common/interactive/menu
|
|
4807
|
+
* @docsKind primary
|
|
4808
|
+
* @wcag AA
|
|
4809
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu.directive.ts
|
|
4810
|
+
* @since 0.1.0
|
|
4811
|
+
* @relatedTo CngxMenuTrigger, CngxMenuItem, CngxMenuGroup, CngxContextMenuTrigger, CngxActiveDescendant
|
|
4812
|
+
* <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>
|
|
4813
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>
|
|
4814
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>
|
|
4815
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
3899
4816
|
*/
|
|
3900
4817
|
declare class CngxMenu implements CngxMenuHost {
|
|
3901
4818
|
/** Accessible label. */
|
|
3902
4819
|
readonly label: _angular_core.InputSignal<string>;
|
|
3903
|
-
/** Underlying `CngxActiveDescendant`
|
|
4820
|
+
/** Underlying `CngxActiveDescendant` - exposed for trigger composition. */
|
|
3904
4821
|
readonly ad: CngxActiveDescendant;
|
|
4822
|
+
private readonly elementRef;
|
|
3905
4823
|
private readonly announcer;
|
|
3906
4824
|
private readonly menuConfig;
|
|
3907
4825
|
/**
|
|
@@ -3913,17 +4831,40 @@ declare class CngxMenu implements CngxMenuHost {
|
|
|
3913
4831
|
/** Emits the activated item's value on Enter/Space/click. */
|
|
3914
4832
|
readonly itemActivated: _angular_core.OutputRef<unknown>;
|
|
3915
4833
|
constructor();
|
|
4834
|
+
/**
|
|
4835
|
+
* Move DOM focus to the menu container so its host
|
|
4836
|
+
* `CngxActiveDescendant` receives keyboard input. Consumers (notably
|
|
4837
|
+
* `CngxContextMenuTrigger`) call this after open to transfer focus
|
|
4838
|
+
* from the trigger zone into the menu. The host element MUST carry a
|
|
4839
|
+
* non-negative `tabindex` for focus to land - the menu's stories use
|
|
4840
|
+
* `tabindex="0"` and consumers should mirror that.
|
|
4841
|
+
*
|
|
4842
|
+
* `preventScroll: true` keeps the popover anchored when focusing into
|
|
4843
|
+
* a menu that lives outside the visual viewport edge.
|
|
4844
|
+
*/
|
|
4845
|
+
focus(): void;
|
|
3916
4846
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenu, never>;
|
|
3917
4847
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenu, "[cngxMenu]", ["cngxMenu"], { "label": { "alias": "label"; "required": true; "isSignal": true; }; }, { "itemActivated": "itemActivated"; }, ["submenuItems"], never, true, [{ directive: typeof i1.CngxActiveDescendant; inputs: { "orientation": "orientation"; "loop": "loop"; "typeahead": "typeahead"; "autoHighlightFirst": "autoHighlightFirst"; }; outputs: {}; }]>;
|
|
3918
4848
|
}
|
|
3919
4849
|
|
|
3920
4850
|
/**
|
|
3921
4851
|
* A single action menuitem registered with a surrounding `CngxActiveDescendant`.
|
|
3922
|
-
* Unlike `CngxOption`, menu items carry no selection state
|
|
4852
|
+
* Unlike `CngxOption`, menu items carry no selection state - activation fires
|
|
3923
4853
|
* the AD's `activated` output and the consumer dispatches the action.
|
|
3924
4854
|
*
|
|
3925
4855
|
* Click activates (honouring the disabled state). `pointerenter` highlights
|
|
3926
4856
|
* without activating, matching native menu behaviour.
|
|
4857
|
+
*
|
|
4858
|
+
* @category common/interactive/menu
|
|
4859
|
+
* @docsKind primary
|
|
4860
|
+
* @wcag AA
|
|
4861
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item.directive.ts
|
|
4862
|
+
* @since 0.1.0
|
|
4863
|
+
* @relatedTo CngxMenu, CngxMenuItemCheckbox, CngxMenuItemRadio, CngxMenuItemSubmenu
|
|
4864
|
+
* <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>
|
|
4865
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>
|
|
4866
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>
|
|
4867
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
3927
4868
|
*/
|
|
3928
4869
|
declare class CngxMenuItem<T = unknown> implements CngxAdItemHandle {
|
|
3929
4870
|
readonly value: _angular_core.InputSignal<T | undefined>;
|
|
@@ -3944,9 +4885,17 @@ declare class CngxMenuItem<T = unknown> implements CngxAdItemHandle {
|
|
|
3944
4885
|
|
|
3945
4886
|
/**
|
|
3946
4887
|
* Marker directive for the leading icon position inside a `[cngxMenuItem]`.
|
|
3947
|
-
* Applies
|
|
3948
|
-
*
|
|
3949
|
-
*
|
|
4888
|
+
* Applies `cngx-menu-item__icon` to the host element and defaults the host
|
|
4889
|
+
* to `aria-hidden="true"` - the slot is decorative, the item's accessible
|
|
4890
|
+
* name comes from the projected label. Consumers needing a screen-reader
|
|
4891
|
+
* label on the icon override the default with `[attr.aria-hidden]="null"`.
|
|
4892
|
+
*
|
|
4893
|
+
* @category common/interactive/menu
|
|
4894
|
+
* @wcag AA
|
|
4895
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts
|
|
4896
|
+
* @since 0.1.0
|
|
4897
|
+
* @relatedTo CngxMenuItem, CngxMenuItemLabel, CngxMenuItemSuffix, CngxMenuItemKbd
|
|
4898
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
3950
4899
|
*/
|
|
3951
4900
|
declare class CngxMenuItemIcon {
|
|
3952
4901
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuItemIcon, never>;
|
|
@@ -3954,7 +4903,16 @@ declare class CngxMenuItemIcon {
|
|
|
3954
4903
|
}
|
|
3955
4904
|
/**
|
|
3956
4905
|
* Marker directive for the primary label position inside a
|
|
3957
|
-
* `[cngxMenuItem]`. Applies `cngx-menu-item__label`.
|
|
4906
|
+
* `[cngxMenuItem]`. Applies `cngx-menu-item__label`. No `aria-hidden`
|
|
4907
|
+
* default - the label is the menu item's accessible name and must reach
|
|
4908
|
+
* assistive technology.
|
|
4909
|
+
*
|
|
4910
|
+
* @category common/interactive/menu
|
|
4911
|
+
* @wcag AA
|
|
4912
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts
|
|
4913
|
+
* @since 0.1.0
|
|
4914
|
+
* @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemSuffix, CngxMenuItemKbd
|
|
4915
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
3958
4916
|
*/
|
|
3959
4917
|
declare class CngxMenuItemLabel {
|
|
3960
4918
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuItemLabel, never>;
|
|
@@ -3962,8 +4920,19 @@ declare class CngxMenuItemLabel {
|
|
|
3962
4920
|
}
|
|
3963
4921
|
/**
|
|
3964
4922
|
* Marker directive for a trailing detail slot inside a `[cngxMenuItem]`
|
|
3965
|
-
*
|
|
3966
|
-
* keyboard-shortcut hint. Applies `cngx-menu-item__suffix
|
|
4923
|
+
* - secondary text or a status pill that sits between the label and the
|
|
4924
|
+
* keyboard-shortcut hint. Applies `cngx-menu-item__suffix` and defaults
|
|
4925
|
+
* the host to `aria-hidden="true"`. The slot is supplemental, the
|
|
4926
|
+
* primary name belongs to the label. Override with
|
|
4927
|
+
* `[attr.aria-hidden]="null"` when the suffix carries meaning AT needs
|
|
4928
|
+
* (status text, semantic badge).
|
|
4929
|
+
*
|
|
4930
|
+
* @category common/interactive/menu
|
|
4931
|
+
* @wcag AA
|
|
4932
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts
|
|
4933
|
+
* @since 0.1.0
|
|
4934
|
+
* @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemKbd
|
|
4935
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
3967
4936
|
*/
|
|
3968
4937
|
declare class CngxMenuItemSuffix {
|
|
3969
4938
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuItemSuffix, never>;
|
|
@@ -3971,15 +4940,26 @@ declare class CngxMenuItemSuffix {
|
|
|
3971
4940
|
}
|
|
3972
4941
|
/**
|
|
3973
4942
|
* Marker directive for the keyboard-shortcut hint position inside a
|
|
3974
|
-
* `[cngxMenuItem]`. Applies `cngx-menu-item__kbd
|
|
3975
|
-
*
|
|
4943
|
+
* `[cngxMenuItem]`. Applies `cngx-menu-item__kbd` and defaults the host
|
|
4944
|
+
* to `aria-hidden="true"` - the visual hint duplicates the underlying
|
|
4945
|
+
* accelerator already wired to the consumer's command, AT readout of the
|
|
4946
|
+
* hint would just repeat the label. Typically placed on a `<kbd>`.
|
|
4947
|
+
* Override with `[attr.aria-hidden]="null"` if the hint is a consumer's
|
|
4948
|
+
* primary affordance.
|
|
4949
|
+
*
|
|
4950
|
+
* @category common/interactive/menu
|
|
4951
|
+
* @wcag AA
|
|
4952
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-slot.directives.ts
|
|
4953
|
+
* @since 0.1.0
|
|
4954
|
+
* @relatedTo CngxMenuItem, CngxMenuItemIcon, CngxMenuItemLabel, CngxMenuItemSuffix
|
|
4955
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
3976
4956
|
*/
|
|
3977
4957
|
declare class CngxMenuItemKbd {
|
|
3978
4958
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuItemKbd, never>;
|
|
3979
4959
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenuItemKbd, "[cngxMenuItemKbd]", ["cngxMenuItemKbd"], {}, {}, never, never, true, never>;
|
|
3980
4960
|
}
|
|
3981
4961
|
|
|
3982
|
-
/** See `CngxListboxTrigger`
|
|
4962
|
+
/** See `CngxListboxTrigger` - same structural contract. */
|
|
3983
4963
|
interface PopoverController$2 {
|
|
3984
4964
|
readonly isVisible: () => boolean;
|
|
3985
4965
|
show(): void;
|
|
@@ -3988,19 +4968,19 @@ interface PopoverController$2 {
|
|
|
3988
4968
|
set(el: HTMLElement | null): void;
|
|
3989
4969
|
};
|
|
3990
4970
|
/**
|
|
3991
|
-
* Popover unique id signal
|
|
4971
|
+
* Popover unique id signal - used to compose the `anchor-name` CSS value
|
|
3992
4972
|
* the browser's CSS Anchor Positioning expects on the anchor element.
|
|
3993
4973
|
*/
|
|
3994
4974
|
readonly id: () => string;
|
|
3995
4975
|
/**
|
|
3996
|
-
* Popover host element
|
|
4976
|
+
* Popover host element - the submenu directive attaches hover listeners to
|
|
3997
4977
|
* it so the submenu stays open while the user mouses over its items.
|
|
3998
4978
|
*/
|
|
3999
4979
|
readonly elementRef: ElementRef<HTMLElement>;
|
|
4000
4980
|
}
|
|
4001
4981
|
/**
|
|
4002
4982
|
* Companion directive applied to a `[cngxMenuItem]` that opens a nested
|
|
4003
|
-
* submenu. The directive itself does NOT render `role="menuitem"`
|
|
4983
|
+
* submenu. The directive itself does NOT render `role="menuitem"` - that
|
|
4004
4984
|
* stays on `CngxMenuItem`. Adds `aria-haspopup="menu"` and reactive
|
|
4005
4985
|
* `aria-expanded`, registers itself with the surrounding menu as a
|
|
4006
4986
|
* submenu source so the menu trigger can drive arrow-right / arrow-left
|
|
@@ -4014,6 +4994,14 @@ interface PopoverController$2 {
|
|
|
4014
4994
|
* The submenu's `<div cngxPopover>` MUST set `[exclusive]="false"` so that
|
|
4015
4995
|
* opening it does not light-dismiss the parent popover. This is the only
|
|
4016
4996
|
* extra wiring the consumer needs beyond the two inputs.
|
|
4997
|
+
*
|
|
4998
|
+
* @category common/interactive/menu
|
|
4999
|
+
* @docsKind primary
|
|
5000
|
+
* @wcag AA
|
|
5001
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-submenu.directive.ts
|
|
5002
|
+
* @since 0.1.0
|
|
5003
|
+
* @relatedTo CngxMenuItem, CngxMenu, CngxMenuTrigger
|
|
5004
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>
|
|
4017
5005
|
*/
|
|
4018
5006
|
declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
4019
5007
|
/** Popover wrapping the submenu. Required. */
|
|
@@ -4028,12 +5016,12 @@ declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
|
4028
5016
|
* activeId)`. When applied alongside `[cngxMenuItem]` the directive
|
|
4029
5017
|
* mirrors the sibling's id so the trigger's lookup matches the AD's
|
|
4030
5018
|
* `activeId`. When applied alone (no sibling), falls back to a fresh
|
|
4031
|
-
* `nextUid`
|
|
5019
|
+
* `nextUid` - the AD will never highlight this element so the trigger
|
|
4032
5020
|
* lookup is moot, but the host element still receives a valid id.
|
|
4033
5021
|
*/
|
|
4034
5022
|
get id(): string;
|
|
4035
5023
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
4036
|
-
/** CSS Anchor Positioning name
|
|
5024
|
+
/** CSS Anchor Positioning name - matches the popover's `position-anchor`. */
|
|
4037
5025
|
protected readonly cssAnchorName: _angular_core.Signal<string>;
|
|
4038
5026
|
get inner(): CngxMenuHost;
|
|
4039
5027
|
open(): void;
|
|
@@ -4060,10 +5048,52 @@ declare class CngxMenuItemSubmenu implements CngxMenuSubmenuLike {
|
|
|
4060
5048
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxMenuItemSubmenu, "[cngxMenuItemSubmenu]", ["cngxMenuItemSubmenu"], { "popover": { "alias": "cngxMenuItemSubmenu"; "required": true; "isSignal": true; }; "submenuMenu": { "alias": "submenuMenu"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
4061
5049
|
}
|
|
4062
5050
|
|
|
5051
|
+
/**
|
|
5052
|
+
* Recommended `position-try-fallbacks` chain for menu submenu popovers.
|
|
5053
|
+
*
|
|
5054
|
+
* Consumers wire the const on the submenu's `cngxPopover` element:
|
|
5055
|
+
* ```html
|
|
5056
|
+
* <div cngxPopover [positionTryFallbacks]="CNGX_SUBMENU_TRY_FALLBACKS">
|
|
5057
|
+
* <!-- submenu items -->
|
|
5058
|
+
* </div>
|
|
5059
|
+
* ```
|
|
5060
|
+
*
|
|
5061
|
+
* The chain matches the
|
|
5062
|
+
* `projects/forms/select/shared/select-base.css:759` precedent
|
|
5063
|
+
* (`flip-block, flip-inline, flip-block flip-inline`) — `flip-inline`
|
|
5064
|
+
* is the dominant submenu clip case (right submenu hits the viewport
|
|
5065
|
+
* right edge → flips to the left side of its parent item),
|
|
5066
|
+
* `flip-block` covers the vertical case, and the composed form
|
|
5067
|
+
* covers diagonal clipping.
|
|
5068
|
+
*
|
|
5069
|
+
* `CngxMenuItemSubmenu` emits a one-shot dev-mode warning when a
|
|
5070
|
+
* submenu popover ships without `positionTryFallbacks` — the const
|
|
5071
|
+
* is documented as the canonical opt-in.
|
|
5072
|
+
*
|
|
5073
|
+
* Typed as a string-literal tuple via `as const` rather than the
|
|
5074
|
+
* `PopoverPositionTryFallback` union from `@cngx/common/popover` —
|
|
5075
|
+
* the cross-entry-point import would reverse the existing
|
|
5076
|
+
* `popover -> interactive` dependency direction and break ng-packagr.
|
|
5077
|
+
* Consumers binding the const to `[positionTryFallbacks]` get
|
|
5078
|
+
* compile-time type checking from the input's typed signature on the
|
|
5079
|
+
* popover side.
|
|
5080
|
+
*
|
|
5081
|
+
* @category common/interactive/menu
|
|
5082
|
+
*/
|
|
5083
|
+
declare const CNGX_SUBMENU_TRY_FALLBACKS: readonly ["flip-inline", "flip-block", "flip-block flip-inline"];
|
|
5084
|
+
|
|
4063
5085
|
/**
|
|
4064
5086
|
* Checkable menu item (`role="menuitemcheckbox"`). Activation toggles
|
|
4065
5087
|
* `checked` and emits `checkedChange`. Unlike `CngxMenuItem`, the item
|
|
4066
5088
|
* carries its own selection state.
|
|
5089
|
+
*
|
|
5090
|
+
* @category common/interactive/menu
|
|
5091
|
+
* @docsKind primary
|
|
5092
|
+
* @wcag AA
|
|
5093
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-checkbox.directive.ts
|
|
5094
|
+
* @since 0.1.0
|
|
5095
|
+
* @relatedTo CngxMenuItem, CngxMenuItemRadio, CngxMenu
|
|
5096
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>
|
|
4067
5097
|
*/
|
|
4068
5098
|
declare class CngxMenuItemCheckbox<T = unknown> implements CngxAdItemHandle {
|
|
4069
5099
|
readonly value: _angular_core.InputSignal<T | undefined>;
|
|
@@ -4085,8 +5115,16 @@ declare class CngxMenuItemCheckbox<T = unknown> implements CngxAdItemHandle {
|
|
|
4085
5115
|
|
|
4086
5116
|
/**
|
|
4087
5117
|
* Radio-style menu item (`role="menuitemradio"`). Mutual exclusion is scoped
|
|
4088
|
-
* to the enclosing `CngxMenuGroup`
|
|
5118
|
+
* to the enclosing `CngxMenuGroup` - only one radio per group is checked at
|
|
4089
5119
|
* a time.
|
|
5120
|
+
*
|
|
5121
|
+
* @category common/interactive/menu
|
|
5122
|
+
* @docsKind primary
|
|
5123
|
+
* @wcag AA
|
|
5124
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-item-radio.directive.ts
|
|
5125
|
+
* @since 0.1.0
|
|
5126
|
+
* @relatedTo CngxMenuItem, CngxMenuItemCheckbox, CngxMenuGroup
|
|
5127
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>
|
|
4090
5128
|
*/
|
|
4091
5129
|
declare class CngxMenuItemRadio<T = unknown> implements CngxAdItemHandle {
|
|
4092
5130
|
readonly value: _angular_core.InputSignal<T>;
|
|
@@ -4113,6 +5151,8 @@ declare class CngxMenuItemRadio<T = unknown> implements CngxAdItemHandle {
|
|
|
4113
5151
|
* `CngxMenuItemRadio` children. Children read `selectedValue()` to compute
|
|
4114
5152
|
* `aria-checked` and call `select(value)` to update on click; the host owns
|
|
4115
5153
|
* the writable signal so consumers two-way bind through it.
|
|
5154
|
+
*
|
|
5155
|
+
* @category common/interactive/menu
|
|
4116
5156
|
*/
|
|
4117
5157
|
interface CngxMenuRadioGroup<T> {
|
|
4118
5158
|
readonly selectedValue: ModelSignal<T | undefined>;
|
|
@@ -4120,8 +5160,10 @@ interface CngxMenuRadioGroup<T> {
|
|
|
4120
5160
|
select(value: T): void;
|
|
4121
5161
|
}
|
|
4122
5162
|
/**
|
|
4123
|
-
* Factory shape
|
|
5163
|
+
* Factory shape - pass into a custom DI provider to wrap selection in
|
|
4124
5164
|
* telemetry, server-sync, or audit logging without forking `CngxMenuGroup`.
|
|
5165
|
+
*
|
|
5166
|
+
* @category common/interactive/menu
|
|
4125
5167
|
*/
|
|
4126
5168
|
type CngxMenuRadioGroupFactory = <T>(deps: {
|
|
4127
5169
|
readonly selectedValue: ModelSignal<T | undefined>;
|
|
@@ -4132,12 +5174,19 @@ type CngxMenuRadioGroupFactory = <T>(deps: {
|
|
|
4132
5174
|
* signals. `CngxMenuGroup` implements the contract directly; this factory
|
|
4133
5175
|
* exists for hand-built menu hosts that do not declare a directive but
|
|
4134
5176
|
* still need to provide `CNGX_MENU_RADIO_GROUP`.
|
|
5177
|
+
*
|
|
5178
|
+
* @category common/interactive/menu
|
|
4135
5179
|
*/
|
|
4136
5180
|
declare const createMenuRadioController: CngxMenuRadioGroupFactory;
|
|
4137
5181
|
/**
|
|
4138
5182
|
* DI token a radio-grouping menu host provides for `CngxMenuItemRadio` to
|
|
4139
5183
|
* resolve. Items inject with `{ optional: true }` so a radio item rendered
|
|
4140
5184
|
* outside any group still works (it just reports `aria-checked="false"`).
|
|
5185
|
+
*
|
|
5186
|
+
* @category common/interactive/menu
|
|
5187
|
+
* @wcag AA
|
|
5188
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-radio-controller.ts
|
|
5189
|
+
* @since 0.1.0
|
|
4141
5190
|
*/
|
|
4142
5191
|
declare const CNGX_MENU_RADIO_GROUP: InjectionToken<CngxMenuRadioGroup<unknown>>;
|
|
4143
5192
|
|
|
@@ -4146,6 +5195,14 @@ declare const CNGX_MENU_RADIO_GROUP: InjectionToken<CngxMenuRadioGroup<unknown>>
|
|
|
4146
5195
|
* label. For radio groups, the host owns the selected value and exposes it
|
|
4147
5196
|
* to enclosed `CngxMenuItemRadio` children through the
|
|
4148
5197
|
* `CNGX_MENU_RADIO_GROUP` contract.
|
|
5198
|
+
*
|
|
5199
|
+
* @category common/interactive/menu
|
|
5200
|
+
* @docsKind primary
|
|
5201
|
+
* @wcag AA
|
|
5202
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-group.directive.ts
|
|
5203
|
+
* @since 0.1.0
|
|
5204
|
+
* @relatedTo CngxMenu, CngxMenuItemRadio, CngxMenuItem
|
|
5205
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/checkable/text-formatting-menu</example-url>
|
|
4149
5206
|
*/
|
|
4150
5207
|
declare class CngxMenuGroup implements CngxMenuRadioGroup<unknown> {
|
|
4151
5208
|
/** Accessible group label. */
|
|
@@ -4163,8 +5220,16 @@ declare class CngxMenuGroup implements CngxMenuRadioGroup<unknown> {
|
|
|
4163
5220
|
* Visual + semantic separator inside a `CngxMenu`. Renders `role="separator"`
|
|
4164
5221
|
* with `aria-orientation="horizontal"`. Does **not** register `CNGX_AD_ITEM`,
|
|
4165
5222
|
* so the surrounding `CngxActiveDescendant` skips it during arrow-key
|
|
4166
|
-
* navigation and typeahead
|
|
5223
|
+
* navigation and typeahead - required for action-menu and dropdown-menu
|
|
4167
5224
|
* patterns where separators visually group items but are not selectable.
|
|
5225
|
+
*
|
|
5226
|
+
* @category common/interactive/menu
|
|
5227
|
+
* @wcag AA
|
|
5228
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-separator.directive.ts
|
|
5229
|
+
* @since 0.1.0
|
|
5230
|
+
* @relatedTo CngxMenu, CngxMenuItem, CngxMenuGroup
|
|
5231
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>
|
|
5232
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/base/action-menu-with-separator</example-url>
|
|
4168
5233
|
*/
|
|
4169
5234
|
declare class CngxMenuSeparator {
|
|
4170
5235
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxMenuSeparator, never>;
|
|
@@ -4176,6 +5241,8 @@ declare class CngxMenuSeparator {
|
|
|
4176
5241
|
* menu trigger or a future menubar directive) interpret the action: fire
|
|
4177
5242
|
* the matching side effect (open/close a popover, hand focus to a parent
|
|
4178
5243
|
* menu) and `event.preventDefault()` for anything non-`noop`.
|
|
5244
|
+
*
|
|
5245
|
+
* @category common/interactive/menu
|
|
4179
5246
|
*/
|
|
4180
5247
|
type CngxMenuNavAction = {
|
|
4181
5248
|
readonly kind: 'open-submenu';
|
|
@@ -4192,6 +5259,8 @@ type CngxMenuNavAction = {
|
|
|
4192
5259
|
* `CngxActiveDescendant.activeId()` snapshot at key-press time;
|
|
4193
5260
|
* `hasSubmenu`/`submenuOpen` describe whatever submenu state the consumer
|
|
4194
5261
|
* tracks for the active item.
|
|
5262
|
+
*
|
|
5263
|
+
* @category common/interactive/menu
|
|
4195
5264
|
*/
|
|
4196
5265
|
interface CngxMenuNavContext {
|
|
4197
5266
|
readonly activeId: string | null;
|
|
@@ -4205,9 +5274,11 @@ interface CngxMenuNavContext {
|
|
|
4205
5274
|
* always opens, never traverses into the submenu") register their own
|
|
4206
5275
|
* via `CNGX_MENU_NAV_STRATEGY`.
|
|
4207
5276
|
*
|
|
4208
|
-
* Strategy steps are pure decisions
|
|
5277
|
+
* Strategy steps are pure decisions - they do not call popover.show() or
|
|
4209
5278
|
* touch any signal directly. The directive that consults the strategy
|
|
4210
5279
|
* acts on the returned action.
|
|
5280
|
+
*
|
|
5281
|
+
* @category common/interactive/menu
|
|
4211
5282
|
*/
|
|
4212
5283
|
interface CngxMenuNavStrategy {
|
|
4213
5284
|
onArrowRight(ctx: CngxMenuNavContext): CngxMenuNavAction;
|
|
@@ -4223,6 +5294,8 @@ interface CngxMenuNavStrategy {
|
|
|
4223
5294
|
* - **ArrowLeft** when a submenu is open at the current level →
|
|
4224
5295
|
* `close-submenu`. Otherwise → `move-to-parent` (an enclosing menubar
|
|
4225
5296
|
* interprets that; a standalone menu trigger treats it as noop).
|
|
5297
|
+
*
|
|
5298
|
+
* @category common/interactive/menu
|
|
4226
5299
|
*/
|
|
4227
5300
|
declare function createW3CMenuStrategy(): CngxMenuNavStrategy;
|
|
4228
5301
|
/**
|
|
@@ -4230,24 +5303,34 @@ declare function createW3CMenuStrategy(): CngxMenuNavStrategy;
|
|
|
4230
5303
|
* directives consult on every ArrowLeft/ArrowRight press. Defaults to
|
|
4231
5304
|
* {@link createW3CMenuStrategy}; override via `providers` /
|
|
4232
5305
|
* `viewProviders` for alternative keyboard semantics.
|
|
5306
|
+
*
|
|
5307
|
+
* @category common/interactive/menu
|
|
5308
|
+
* @wcag AA
|
|
5309
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-nav-strategy.ts
|
|
5310
|
+
* @since 0.1.0
|
|
4233
5311
|
*/
|
|
4234
5312
|
declare const CNGX_MENU_NAV_STRATEGY: InjectionToken<CngxMenuNavStrategy>;
|
|
4235
5313
|
|
|
4236
5314
|
/**
|
|
4237
5315
|
* Localised UI strings the menu announces or otherwise renders. English by
|
|
4238
5316
|
* default; consumers override via {@link withAriaLabels}.
|
|
5317
|
+
*
|
|
5318
|
+
* @category common/interactive/menu
|
|
4239
5319
|
*/
|
|
4240
5320
|
interface CngxMenuAriaLabels {
|
|
4241
5321
|
readonly submenuOpened: string;
|
|
4242
5322
|
readonly submenuClosed: string;
|
|
4243
5323
|
readonly itemActivated: string;
|
|
4244
5324
|
readonly itemDisabled: string;
|
|
5325
|
+
readonly menuDismissed: string;
|
|
4245
5326
|
}
|
|
4246
5327
|
/**
|
|
4247
5328
|
* Resolved configuration consumed by every menu directive in the family.
|
|
4248
5329
|
* Default values live in {@link DEFAULT_MENU_CONFIG}; override at app
|
|
4249
5330
|
* scope via {@link provideMenuConfig} or per-component via
|
|
4250
5331
|
* {@link provideMenuConfigAt}.
|
|
5332
|
+
*
|
|
5333
|
+
* @category common/interactive/menu
|
|
4251
5334
|
*/
|
|
4252
5335
|
interface CngxMenuConfig {
|
|
4253
5336
|
readonly ariaLabels: CngxMenuAriaLabels;
|
|
@@ -4255,6 +5338,31 @@ interface CngxMenuConfig {
|
|
|
4255
5338
|
readonly submenuOpenDelay: number;
|
|
4256
5339
|
readonly submenuCloseDelay: number;
|
|
4257
5340
|
readonly closeOnSelect: boolean;
|
|
5341
|
+
/**
|
|
5342
|
+
* Whether `pointerdown` outside both the menu's popover and the
|
|
5343
|
+
* trigger host dismisses the menu. Native context menus, browser
|
|
5344
|
+
* right-click menus, and major web apps all close on outside click.
|
|
5345
|
+
* Default `true`.
|
|
5346
|
+
*/
|
|
5347
|
+
readonly dismissOnOutsideClick: boolean;
|
|
5348
|
+
/**
|
|
5349
|
+
* Whether window `scroll` while the menu is open dismisses it. Default
|
|
5350
|
+
* `false` - consumers with scrollable menu panels (long lists,
|
|
5351
|
+
* treeselect-style) often want the menu to remain anchored during
|
|
5352
|
+
* scroll. Opt in via {@link withDismissOnScroll}.
|
|
5353
|
+
*/
|
|
5354
|
+
readonly dismissOnScroll: boolean;
|
|
5355
|
+
/**
|
|
5356
|
+
* Whether the "context lost" bundle dismisses the menu. The bundle
|
|
5357
|
+
* covers BOTH window `blur` (system notification, OS-native menu
|
|
5358
|
+
* overlaying, tab switch) AND document `pointercancel` outside the
|
|
5359
|
+
* popover and trigger host (palm rejection on touch devices,
|
|
5360
|
+
* gesture cancelled by the browser). The two sources share one
|
|
5361
|
+
* toggle by design; consumers needing one without the other replace
|
|
5362
|
+
* the entire handler via {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.
|
|
5363
|
+
* Default `true`.
|
|
5364
|
+
*/
|
|
5365
|
+
readonly dismissOnBlur: boolean;
|
|
4258
5366
|
}
|
|
4259
5367
|
/**
|
|
4260
5368
|
* Single feature-flag function consumed by {@link provideMenuConfig} and
|
|
@@ -4262,14 +5370,18 @@ interface CngxMenuConfig {
|
|
|
4262
5370
|
* future config surfaces (e.g. submenu-only or announcer overrides) can
|
|
4263
5371
|
* compose through the same `provideCngxMenu` aggregator without breaking
|
|
4264
5372
|
* the public API of existing `with*` features.
|
|
5373
|
+
*
|
|
5374
|
+
* @category common/interactive/menu
|
|
4265
5375
|
*/
|
|
4266
5376
|
type CngxMenuConfigFeature = ((config: CngxMenuConfig) => CngxMenuConfig) & {
|
|
4267
5377
|
readonly _target?: 'config';
|
|
4268
5378
|
};
|
|
4269
5379
|
/**
|
|
4270
|
-
* Library-default menu configuration. **English-only**
|
|
5380
|
+
* Library-default menu configuration. **English-only** - German (or any
|
|
4271
5381
|
* other locale) is consumer-supplied via `withAriaLabels` per the
|
|
4272
5382
|
* `feedback_en_default_locale` rule.
|
|
5383
|
+
*
|
|
5384
|
+
* @category common/interactive/menu
|
|
4273
5385
|
*/
|
|
4274
5386
|
declare const DEFAULT_MENU_CONFIG: CngxMenuConfig;
|
|
4275
5387
|
/**
|
|
@@ -4277,6 +5389,10 @@ declare const DEFAULT_MENU_CONFIG: CngxMenuConfig;
|
|
|
4277
5389
|
* {@link DEFAULT_MENU_CONFIG} at root; override via {@link provideMenuConfig}
|
|
4278
5390
|
* (app-wide) or {@link provideMenuConfigAt} (component scope via
|
|
4279
5391
|
* `viewProviders`).
|
|
5392
|
+
*
|
|
5393
|
+
* @category common/interactive/menu
|
|
5394
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-config.ts
|
|
5395
|
+
* @since 0.1.0
|
|
4280
5396
|
*/
|
|
4281
5397
|
declare const CNGX_MENU_CONFIG: InjectionToken<CngxMenuConfig>;
|
|
4282
5398
|
/**
|
|
@@ -4293,17 +5409,23 @@ declare const CNGX_MENU_CONFIG: InjectionToken<CngxMenuConfig>;
|
|
|
4293
5409
|
* ],
|
|
4294
5410
|
* });
|
|
4295
5411
|
* ```
|
|
5412
|
+
*
|
|
5413
|
+
* @category common/interactive/menu
|
|
4296
5414
|
*/
|
|
4297
5415
|
declare function provideMenuConfig(...features: CngxMenuConfigFeature[]): EnvironmentProviders;
|
|
4298
5416
|
/**
|
|
4299
5417
|
* Component-scoped menu configuration override. Pass into a directive or
|
|
4300
5418
|
* component's `viewProviders`; features merge on top of the parent
|
|
4301
5419
|
* config (root or an enclosing scope).
|
|
5420
|
+
*
|
|
5421
|
+
* @category common/interactive/menu
|
|
4302
5422
|
*/
|
|
4303
5423
|
declare function provideMenuConfigAt(...features: CngxMenuConfigFeature[]): Provider[];
|
|
4304
5424
|
/**
|
|
4305
5425
|
* Resolves the {@link CngxMenuConfig} from the current injection scope.
|
|
4306
5426
|
* Must run inside an injection context.
|
|
5427
|
+
*
|
|
5428
|
+
* @category common/interactive/menu
|
|
4307
5429
|
*/
|
|
4308
5430
|
declare function injectMenuConfig(): CngxMenuConfig;
|
|
4309
5431
|
|
|
@@ -4311,36 +5433,301 @@ declare function injectMenuConfig(): CngxMenuConfig;
|
|
|
4311
5433
|
* Override one or more ARIA strings (English defaults). Unset keys keep
|
|
4312
5434
|
* their default value, so consumers can supply only the locale strings
|
|
4313
5435
|
* they care about.
|
|
5436
|
+
*
|
|
5437
|
+
* @category common/interactive/menu
|
|
4314
5438
|
*/
|
|
4315
5439
|
declare function withAriaLabels(partial: Partial<CngxMenuAriaLabels>): CngxMenuConfigFeature;
|
|
4316
5440
|
/**
|
|
4317
5441
|
* Override the typeahead debounce window (milliseconds) for menu
|
|
4318
5442
|
* navigation. Default: `300`.
|
|
5443
|
+
*
|
|
5444
|
+
* @category common/interactive/menu
|
|
4319
5445
|
*/
|
|
4320
5446
|
declare function withTypeaheadDebounce(ms: number): CngxMenuConfigFeature;
|
|
4321
5447
|
/**
|
|
4322
5448
|
* Override the delay between hovering a submenu parent and opening the
|
|
4323
5449
|
* submenu (milliseconds). Default: `0` (open immediately on activation).
|
|
4324
5450
|
* Reserved for hover-driven menubar implementations.
|
|
5451
|
+
*
|
|
5452
|
+
* @category common/interactive/menu
|
|
4325
5453
|
*/
|
|
4326
5454
|
declare function withSubmenuOpenDelay(ms: number): CngxMenuConfigFeature;
|
|
4327
5455
|
/**
|
|
4328
5456
|
* Override the delay between leaving a submenu parent and closing the
|
|
4329
5457
|
* submenu (milliseconds). Default: `0`. Reserved for hover-driven
|
|
4330
5458
|
* menubar implementations.
|
|
5459
|
+
*
|
|
5460
|
+
* @category common/interactive/menu
|
|
4331
5461
|
*/
|
|
4332
5462
|
declare function withSubmenuCloseDelay(ms: number): CngxMenuConfigFeature;
|
|
4333
5463
|
/**
|
|
4334
5464
|
* Whether activating a leaf item closes the menu. Default: `true`
|
|
4335
5465
|
* (menu semantics — distinct from listbox/combobox which stay open).
|
|
5466
|
+
*
|
|
5467
|
+
* @category common/interactive/menu
|
|
4336
5468
|
*/
|
|
4337
5469
|
declare function withCloseOnSelect(close: boolean): CngxMenuConfigFeature;
|
|
5470
|
+
/**
|
|
5471
|
+
* Whether `pointerdown` outside the menu's popover and the trigger host
|
|
5472
|
+
* dismisses the menu. Default: `true`. Pass `false` for ESC-only
|
|
5473
|
+
* semantics (e.g. a tutorial overlay that wants to keep the menu open
|
|
5474
|
+
* while the user clicks through other UI).
|
|
5475
|
+
*
|
|
5476
|
+
* @category common/interactive/menu
|
|
5477
|
+
*/
|
|
5478
|
+
declare function withDismissOnOutsideClick(dismiss: boolean): CngxMenuConfigFeature;
|
|
5479
|
+
/**
|
|
5480
|
+
* Whether window `scroll` while the menu is open dismisses it. Default:
|
|
5481
|
+
* `false`. Opt in when the menu should follow native context-menu
|
|
5482
|
+
* behaviour and close as soon as the page scrolls. Scroll-dismiss
|
|
5483
|
+
* listens to `window` only - the nearest scrollable ancestor is not
|
|
5484
|
+
* traversed.
|
|
5485
|
+
*
|
|
5486
|
+
* @category common/interactive/menu
|
|
5487
|
+
*/
|
|
5488
|
+
declare function withDismissOnScroll(dismiss: boolean): CngxMenuConfigFeature;
|
|
5489
|
+
/**
|
|
5490
|
+
* Whether the "context lost" bundle dismisses the menu. The bundle
|
|
5491
|
+
* covers BOTH window `blur` (system notification, OS-native menu
|
|
5492
|
+
* overlaying, tab switch) AND document `pointercancel` outside the
|
|
5493
|
+
* popover and trigger host (palm rejection on touch, gesture cancelled
|
|
5494
|
+
* by the browser). The two sources share one toggle because consumers
|
|
5495
|
+
* who want one rarely want the other off; consumers needing one
|
|
5496
|
+
* without the other replace the entire handler via
|
|
5497
|
+
* {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}. Set to `false` to keep
|
|
5498
|
+
* both listeners off; `lastDismissSource` will then never report
|
|
5499
|
+
* `'blur'` or `'pointer-cancel'`.
|
|
5500
|
+
*
|
|
5501
|
+
* Default: `true`.
|
|
5502
|
+
*
|
|
5503
|
+
* @category common/interactive/menu
|
|
5504
|
+
*/
|
|
5505
|
+
declare function withDismissOnBlur(dismiss: boolean): CngxMenuConfigFeature;
|
|
5506
|
+
|
|
5507
|
+
/**
|
|
5508
|
+
* Structural contract the menu dismiss handler reads from the popover.
|
|
5509
|
+
* Mirrors the inline `PopoverController` shape in
|
|
5510
|
+
* `menu-trigger.directive.ts` / `context-menu-trigger.directive.ts` to keep
|
|
5511
|
+
* `@cngx/common/interactive` free of `@cngx/common/popover` imports - the
|
|
5512
|
+
* popover module already depends on this entry-point and the reverse
|
|
5513
|
+
* import would close a circular ng-packagr dependency.
|
|
5514
|
+
*
|
|
5515
|
+
* @category common/interactive/menu
|
|
5516
|
+
*/
|
|
5517
|
+
interface CngxMenuDismissPopoverRef {
|
|
5518
|
+
readonly isVisible: () => boolean;
|
|
5519
|
+
hide(): void;
|
|
5520
|
+
readonly elementRef: {
|
|
5521
|
+
readonly nativeElement: HTMLElement;
|
|
5522
|
+
};
|
|
5523
|
+
}
|
|
5524
|
+
/**
|
|
5525
|
+
* Identifier for the dismissal path that fired most recently.
|
|
5526
|
+
*
|
|
5527
|
+
* - `outside-click` - pointerdown outside both the popover and the trigger
|
|
5528
|
+
* host.
|
|
5529
|
+
* - `scroll` - window scroll while the menu is open.
|
|
5530
|
+
* - `blur` - window blur (system notification, OS-native context menu
|
|
5531
|
+
* overlaying the cngx menu).
|
|
5532
|
+
* - `pointer-cancel` - document pointercancel originating OUTSIDE the
|
|
5533
|
+
* popover and host (palm rejection from outside the menu, gesture
|
|
5534
|
+
* cancelled by the browser). In-menu palm rejections do not dismiss.
|
|
5535
|
+
* - `escape` - document `keydown` matching the `Escape` key while the
|
|
5536
|
+
* popover is visible. Detected by the factory's capture-phase keydown
|
|
5537
|
+
* listener so the source is recorded regardless of where DOM focus
|
|
5538
|
+
* sits (trigger button, menu container, or elsewhere).
|
|
5539
|
+
*
|
|
5540
|
+
* **Intent, not effect.** The factory records `'escape'` synchronously
|
|
5541
|
+
* on the keystroke and does NOT call `popover.hide()`. Whether the
|
|
5542
|
+
* menu actually closes is owned by `CngxPopover.closeOnEscape`:
|
|
5543
|
+
* consumers who set `[closeOnEscape]="false"` keep their menu open
|
|
5544
|
+
* even though `lastSource` reports `'escape'`. The other sources
|
|
5545
|
+
* (`outside-click`, `scroll`, `blur`, `pointer-cancel`) call
|
|
5546
|
+
* `popover.hide()` themselves and so always coincide with an actual
|
|
5547
|
+
* close - `'escape'` is the one source where intent and effect can
|
|
5548
|
+
* diverge.
|
|
5549
|
+
*
|
|
5550
|
+
* @category common/interactive/menu
|
|
5551
|
+
*/
|
|
5552
|
+
type CngxMenuDismissSource = 'outside-click' | 'scroll' | 'blur' | 'pointer-cancel' | 'escape';
|
|
5553
|
+
/**
|
|
5554
|
+
* Options for {@link createMenuDismissHandler}.
|
|
5555
|
+
*
|
|
5556
|
+
* Each boolean toggles its listener (pair) independently. When
|
|
5557
|
+
* `dismissOnBlur` is `true`, both window `blur` and document
|
|
5558
|
+
* `pointercancel` listeners install together - they represent the same
|
|
5559
|
+
* "context lost" semantic and consumers who want one rarely want the
|
|
5560
|
+
* other off.
|
|
5561
|
+
*
|
|
5562
|
+
* @category common/interactive/menu
|
|
5563
|
+
*/
|
|
5564
|
+
interface CngxMenuDismissHandlerOptions {
|
|
5565
|
+
/** Popover whose `.hide()` runs when any dismissal source fires. */
|
|
5566
|
+
readonly popover: CngxMenuDismissPopoverRef;
|
|
5567
|
+
/**
|
|
5568
|
+
* Trigger host element. Pointerdown / pointercancel events whose
|
|
5569
|
+
* target lies inside this element are NOT treated as dismissal -
|
|
5570
|
+
* interactions with the trigger itself should never close the menu
|
|
5571
|
+
* it just opened.
|
|
5572
|
+
*/
|
|
5573
|
+
readonly hostElement: HTMLElement;
|
|
5574
|
+
/** Install document `pointerdown` outside-click listener. */
|
|
5575
|
+
readonly dismissOnOutsideClick: boolean;
|
|
5576
|
+
/** Install window `scroll` listener (capture, passive). */
|
|
5577
|
+
readonly dismissOnScroll: boolean;
|
|
5578
|
+
/**
|
|
5579
|
+
* Install window `blur` AND document `pointercancel` listeners.
|
|
5580
|
+
* Bundled together because both signal context loss. `pointercancel`
|
|
5581
|
+
* events whose target lies inside the popover or trigger host are
|
|
5582
|
+
* filtered out (in-menu palm rejection must not dismiss).
|
|
5583
|
+
*/
|
|
5584
|
+
readonly dismissOnBlur: boolean;
|
|
5585
|
+
/**
|
|
5586
|
+
* Synchronous callback invoked from the DOM event handler whenever a
|
|
5587
|
+
* dismissal source fires. Runs AFTER `popover.hide()` so consumers
|
|
5588
|
+
* observing the source see the post-close state. Used by
|
|
5589
|
+
* {@link createMenuTriggerDismissBinding} to write a reactive
|
|
5590
|
+
* `lastSource` signal from outside any Angular `effect()` context.
|
|
5591
|
+
*/
|
|
5592
|
+
readonly onDismiss?: (source: CngxMenuDismissSource) => void;
|
|
5593
|
+
/**
|
|
5594
|
+
* Sources whose listeners should NOT install even when their toggle
|
|
5595
|
+
* is `true`. Lets a consumer keep `dismissOnBlur: true` but skip the
|
|
5596
|
+
* bundled `pointer-cancel` listener (or vice versa) with a one-line
|
|
5597
|
+
* factory wrapper:
|
|
5598
|
+
*
|
|
5599
|
+
* ```ts
|
|
5600
|
+
* providers: [{
|
|
5601
|
+
* provide: CNGX_MENU_DISMISS_HANDLER_FACTORY,
|
|
5602
|
+
* useValue: (opts) => createMenuDismissHandler({
|
|
5603
|
+
* ...opts,
|
|
5604
|
+
* skipSources: new Set(['pointer-cancel']),
|
|
5605
|
+
* }),
|
|
5606
|
+
* }]
|
|
5607
|
+
* ```
|
|
5608
|
+
*
|
|
5609
|
+
* `'escape'` may be skipped too; the popover's global Escape listener
|
|
5610
|
+
* still owns the close path, so skipping only stops the source from
|
|
5611
|
+
* being recorded on `lastSource`.
|
|
5612
|
+
*/
|
|
5613
|
+
readonly skipSources?: ReadonlySet<CngxMenuDismissSource>;
|
|
5614
|
+
}
|
|
5615
|
+
/**
|
|
5616
|
+
* Handler returned by {@link createMenuDismissHandler}. Call `attach()`
|
|
5617
|
+
* once per menu open; invoke the returned teardown on close.
|
|
5618
|
+
*
|
|
5619
|
+
* Source observation runs through
|
|
5620
|
+
* {@link CngxMenuDismissHandlerOptions.onDismiss}; the handler exposes
|
|
5621
|
+
* no reactive state of its own so the trigger directive can store it as
|
|
5622
|
+
* a plain field rather than a signal (avoids a signal write inside the
|
|
5623
|
+
* `isOpen` effect).
|
|
5624
|
+
*
|
|
5625
|
+
* @category common/interactive/menu
|
|
5626
|
+
*/
|
|
5627
|
+
interface CngxMenuDismissHandler {
|
|
5628
|
+
/**
|
|
5629
|
+
* Install the listeners enabled by the options. Returns a teardown
|
|
5630
|
+
* closure that removes every installed listener. Each `attach()` must
|
|
5631
|
+
* be balanced by exactly one teardown call.
|
|
5632
|
+
*/
|
|
5633
|
+
attach(): () => void;
|
|
5634
|
+
}
|
|
5635
|
+
/**
|
|
5636
|
+
* Factory signature for {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.
|
|
5637
|
+
*
|
|
5638
|
+
* @category common/interactive/menu
|
|
5639
|
+
*/
|
|
5640
|
+
type CngxMenuDismissHandlerFactory = (opts: CngxMenuDismissHandlerOptions) => CngxMenuDismissHandler;
|
|
5641
|
+
/**
|
|
5642
|
+
* Default factory. Pure closure over `opts` - no Angular DI. Mirrors the
|
|
5643
|
+
* shape of `@cngx/forms/select`'s `createDismissHandler` so future
|
|
5644
|
+
* cross-family consolidation has a clean target.
|
|
5645
|
+
*
|
|
5646
|
+
* Override via {@link CNGX_MENU_DISMISS_HANDLER_FACTORY} for
|
|
5647
|
+
* telemetry-wrapped or test-doubled dismissal.
|
|
5648
|
+
*
|
|
5649
|
+
* @category common/interactive/menu
|
|
5650
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts
|
|
5651
|
+
* @since 0.1.0
|
|
5652
|
+
*/
|
|
5653
|
+
declare function createMenuDismissHandler(opts: CngxMenuDismissHandlerOptions): CngxMenuDismissHandler;
|
|
5654
|
+
/**
|
|
5655
|
+
* Factory token for {@link CngxMenuDismissHandler}. Default
|
|
5656
|
+
* {@link createMenuDismissHandler}. Override via
|
|
5657
|
+
* `{ provide: CNGX_MENU_DISMISS_HANDLER_FACTORY, useFactory: () => myHandler }`
|
|
5658
|
+
* at app root for telemetry instrumentation, or in `viewProviders` for a
|
|
5659
|
+
* single feature scope.
|
|
5660
|
+
*
|
|
5661
|
+
* @category common/interactive/menu
|
|
5662
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts
|
|
5663
|
+
* @since 0.1.0
|
|
5664
|
+
*/
|
|
5665
|
+
declare const CNGX_MENU_DISMISS_HANDLER_FACTORY: InjectionToken<CngxMenuDismissHandlerFactory>;
|
|
5666
|
+
/**
|
|
5667
|
+
* Options for {@link createMenuTriggerDismissBinding}. The popover is
|
|
5668
|
+
* passed as a thunk because trigger directives resolve their popover
|
|
5669
|
+
* input lazily (after Angular binds inputs) - the binding cannot capture
|
|
5670
|
+
* the concrete reference at construction time.
|
|
5671
|
+
*
|
|
5672
|
+
* @category common/interactive/menu
|
|
5673
|
+
*/
|
|
5674
|
+
interface CngxMenuTriggerDismissBindingOptions {
|
|
5675
|
+
readonly popover: () => CngxMenuDismissPopoverRef;
|
|
5676
|
+
readonly hostElement: HTMLElement;
|
|
5677
|
+
readonly menuConfig: CngxMenuConfig;
|
|
5678
|
+
readonly factory: CngxMenuDismissHandlerFactory;
|
|
5679
|
+
/**
|
|
5680
|
+
* Synchronous notification invoked from the DOM event handler after
|
|
5681
|
+
* the binding's `lastSource` signal is updated. Trigger directives
|
|
5682
|
+
* use it to call `CngxMenuAnnouncer.announce(...)` so screen readers
|
|
5683
|
+
* hear which path closed the menu. Runs from the same call stack as
|
|
5684
|
+
* the source DOM event - safe for signal reads.
|
|
5685
|
+
*/
|
|
5686
|
+
readonly onDismiss?: (source: CngxMenuDismissSource) => void;
|
|
5687
|
+
}
|
|
5688
|
+
/**
|
|
5689
|
+
* Trigger-side dismiss lifecycle. Owns the reactive `lastSource` signal
|
|
5690
|
+
* and the attach/detach pair both trigger directives invoke from their
|
|
5691
|
+
* `isOpen` effect. Extracted so `CngxMenuTrigger` and
|
|
5692
|
+
* `CngxContextMenuTrigger` share the same wiring without forking it.
|
|
5693
|
+
*
|
|
5694
|
+
* @category common/interactive/menu
|
|
5695
|
+
*/
|
|
5696
|
+
interface CngxMenuTriggerDismissBinding {
|
|
5697
|
+
/**
|
|
5698
|
+
* Resolve the popover thunk, instantiate the handler on first call,
|
|
5699
|
+
* and install its listeners. Idempotent within a single open cycle.
|
|
5700
|
+
*/
|
|
5701
|
+
attach(): void;
|
|
5702
|
+
/** Remove the listeners installed by the last `attach()`. Idempotent. */
|
|
5703
|
+
detach(): void;
|
|
5704
|
+
/**
|
|
5705
|
+
* The dismissal source that closed the menu most recently. `null`
|
|
5706
|
+
* before the first close. Read by templates / telemetry sinks.
|
|
5707
|
+
*/
|
|
5708
|
+
readonly lastSource: Signal<CngxMenuDismissSource | null>;
|
|
5709
|
+
}
|
|
5710
|
+
/**
|
|
5711
|
+
* Build the dismiss lifecycle for a menu-bearing trigger directive.
|
|
5712
|
+
* Lazily instantiates the handler on first `attach()` so the trigger's
|
|
5713
|
+
* popover input is bound before the factory reads it. The returned
|
|
5714
|
+
* `lastSource` signal is owned by this binding - the factory writes it
|
|
5715
|
+
* via its `onDismiss` callback, which runs from DOM event handlers
|
|
5716
|
+
* (never inside an Angular `effect()`).
|
|
5717
|
+
*
|
|
5718
|
+
* @category common/interactive/menu
|
|
5719
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/dismiss-handler.ts
|
|
5720
|
+
* @since 0.1.0
|
|
5721
|
+
*/
|
|
5722
|
+
declare function createMenuTriggerDismissBinding(opts: CngxMenuTriggerDismissBindingOptions): CngxMenuTriggerDismissBinding;
|
|
4338
5723
|
|
|
4339
5724
|
/**
|
|
4340
5725
|
* Public surface every menu-side consumer talks to. The class
|
|
4341
5726
|
* `CngxMenuAnnouncer` is the default implementation; consumers wire a
|
|
4342
5727
|
* custom (telemetry-wrapping, locale-aware, test-doubled) one by
|
|
4343
5728
|
* overriding `CNGX_MENU_ANNOUNCER_FACTORY`.
|
|
5729
|
+
*
|
|
5730
|
+
* @category common/interactive/menu
|
|
4344
5731
|
*/
|
|
4345
5732
|
interface CngxMenuAnnouncerLike {
|
|
4346
5733
|
announce(message: string): void;
|
|
@@ -4349,6 +5736,8 @@ interface CngxMenuAnnouncerLike {
|
|
|
4349
5736
|
* Factory shape consumed by `CNGX_MENU_ANNOUNCER_FACTORY`. The default
|
|
4350
5737
|
* factory is {@link createMenuAnnouncer}; override returns any object
|
|
4351
5738
|
* that satisfies {@link CngxMenuAnnouncerLike}.
|
|
5739
|
+
*
|
|
5740
|
+
* @category common/interactive/menu
|
|
4352
5741
|
*/
|
|
4353
5742
|
type CngxMenuAnnouncerFactory = () => CngxMenuAnnouncerLike;
|
|
4354
5743
|
/**
|
|
@@ -4363,6 +5752,12 @@ type CngxMenuAnnouncerFactory = () => CngxMenuAnnouncerLike;
|
|
|
4363
5752
|
* Default factory output for {@link CNGX_MENU_ANNOUNCER_FACTORY}.
|
|
4364
5753
|
* Consumers obtain the announcer via the factory token, never by
|
|
4365
5754
|
* `inject(CngxMenuAnnouncer)` directly, so a swap is enterprise-wide.
|
|
5755
|
+
*
|
|
5756
|
+
* @category common/interactive/menu
|
|
5757
|
+
* @wcag AA
|
|
5758
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-announcer.ts
|
|
5759
|
+
* @since 0.1.0
|
|
5760
|
+
* @relatedTo CngxMenu, CngxMenuTrigger, CngxMenuItemSubmenu
|
|
4366
5761
|
*/
|
|
4367
5762
|
declare class CngxMenuAnnouncer implements CngxMenuAnnouncerLike {
|
|
4368
5763
|
private readonly doc;
|
|
@@ -4384,6 +5779,8 @@ declare class CngxMenuAnnouncer implements CngxMenuAnnouncerLike {
|
|
|
4384
5779
|
* {@link CNGX_MENU_ANNOUNCER_FACTORY}.
|
|
4385
5780
|
*
|
|
4386
5781
|
* Must run inside an injection context.
|
|
5782
|
+
*
|
|
5783
|
+
* @category common/interactive/menu
|
|
4387
5784
|
*/
|
|
4388
5785
|
declare function createMenuAnnouncer(): CngxMenuAnnouncerLike;
|
|
4389
5786
|
/**
|
|
@@ -4404,24 +5801,29 @@ declare function createMenuAnnouncer(): CngxMenuAnnouncerLike;
|
|
|
4404
5801
|
* ],
|
|
4405
5802
|
* });
|
|
4406
5803
|
* ```
|
|
5804
|
+
*
|
|
5805
|
+
* @category common/interactive/menu
|
|
5806
|
+
* @wcag AA
|
|
5807
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-announcer.ts
|
|
5808
|
+
* @since 0.1.0
|
|
4407
5809
|
*/
|
|
4408
5810
|
declare const CNGX_MENU_ANNOUNCER_FACTORY: InjectionToken<CngxMenuAnnouncerFactory>;
|
|
4409
5811
|
/**
|
|
4410
5812
|
* Resolve the {@link CngxMenuAnnouncerLike} from the current injection
|
|
4411
5813
|
* scope via the factory token. Must run inside an injection context.
|
|
5814
|
+
*
|
|
5815
|
+
* @category common/interactive/menu
|
|
4412
5816
|
*/
|
|
4413
5817
|
declare function injectMenuAnnouncer(): CngxMenuAnnouncerLike;
|
|
4414
5818
|
|
|
4415
|
-
/** See `CngxListboxTrigger`
|
|
4416
|
-
interface PopoverController$1 {
|
|
4417
|
-
readonly isVisible: () => boolean;
|
|
5819
|
+
/** See `CngxListboxTrigger` - same structural contract. */
|
|
5820
|
+
interface PopoverController$1 extends CngxMenuDismissPopoverRef {
|
|
4418
5821
|
show(): void;
|
|
4419
|
-
hide(): void;
|
|
4420
5822
|
readonly anchorElement: {
|
|
4421
5823
|
set(el: HTMLElement | null): void;
|
|
4422
5824
|
};
|
|
4423
5825
|
/**
|
|
4424
|
-
* Popover unique id signal
|
|
5826
|
+
* Popover unique id signal - used to compose the `anchor-name` CSS value
|
|
4425
5827
|
* the browser's CSS Anchor Positioning expects on the anchor element.
|
|
4426
5828
|
*/
|
|
4427
5829
|
readonly id: () => string;
|
|
@@ -4438,13 +5840,35 @@ interface PopoverController$1 {
|
|
|
4438
5840
|
* any other popover.
|
|
4439
5841
|
*
|
|
4440
5842
|
* Anchoring uses a transient zero-size DOM element positioned at the
|
|
4441
|
-
* pointer coords, set on the popover's `anchorElement` signal
|
|
4442
|
-
* `
|
|
4443
|
-
*
|
|
5843
|
+
* pointer coords, set on the popover's `anchorElement` signal - virtual
|
|
5844
|
+
* `getBoundingClientRect` objects are not yet supported as anchors, so
|
|
5845
|
+
* the transient div is the workaround.
|
|
4444
5846
|
*
|
|
4445
5847
|
* Touch-driven opening via long-press is deliberately out of scope for the
|
|
4446
5848
|
* initial commit; consumers can compose `CngxLongPress` against the same
|
|
4447
5849
|
* popover anchor pattern as a follow-up.
|
|
5850
|
+
*
|
|
5851
|
+
* ### Dismissal
|
|
5852
|
+
*
|
|
5853
|
+
* Four sources close the menu by default: `Escape`, `pointerdown` outside
|
|
5854
|
+
* both the popover and the trigger host, window `blur`, and document
|
|
5855
|
+
* `pointercancel`. Window `scroll` is opt-in via
|
|
5856
|
+
* {@link withDismissOnScroll}. Touch users get backdrop dismissal through
|
|
5857
|
+
* the same `pointerdown` listener - no ESC dependency. The dismissal
|
|
5858
|
+
* source that fired most recently is readable through
|
|
5859
|
+
* {@link lastDismissSource}.
|
|
5860
|
+
*
|
|
5861
|
+
* Override individual sources at app root with `withDismissOnOutsideClick`,
|
|
5862
|
+
* `withDismissOnScroll`, `withDismissOnBlur`, or swap the whole handler via
|
|
5863
|
+
* {@link CNGX_MENU_DISMISS_HANDLER_FACTORY}.
|
|
5864
|
+
*
|
|
5865
|
+
* @category common/interactive/menu
|
|
5866
|
+
* @docsKind primary
|
|
5867
|
+
* @wcag AA
|
|
5868
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/context-menu-trigger.directive.ts
|
|
5869
|
+
* @since 0.1.0
|
|
5870
|
+
* @relatedTo CngxMenu, CngxMenuTrigger, CngxPopover
|
|
5871
|
+
* <example-url>http://localhost:4200/#/common/interactive/context-menu/right-click-target-zone</example-url>
|
|
4448
5872
|
*/
|
|
4449
5873
|
declare class CngxContextMenuTrigger {
|
|
4450
5874
|
/** Menu controlled by this trigger. */
|
|
@@ -4455,8 +5879,17 @@ declare class CngxContextMenuTrigger {
|
|
|
4455
5879
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
4456
5880
|
private readonly doc;
|
|
4457
5881
|
private readonly hostElRef;
|
|
5882
|
+
private readonly menuConfig;
|
|
5883
|
+
private readonly announcer;
|
|
5884
|
+
private readonly dismissBinding;
|
|
4458
5885
|
private virtualAnchor;
|
|
4459
5886
|
private savedFocus;
|
|
5887
|
+
/**
|
|
5888
|
+
* The dismissal source that closed the menu most recently. `null`
|
|
5889
|
+
* before the first close. Surface for demos, telemetry, and audit
|
|
5890
|
+
* sinks - reads which path fired without re-installing listeners.
|
|
5891
|
+
*/
|
|
5892
|
+
readonly lastDismissSource: _angular_core.Signal<_cngx_common_interactive.CngxMenuDismissSource | null>;
|
|
4460
5893
|
constructor();
|
|
4461
5894
|
protected handleContextMenu(event: MouseEvent): void;
|
|
4462
5895
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
@@ -4474,6 +5907,8 @@ declare class CngxContextMenuTrigger {
|
|
|
4474
5907
|
* (e.g. submenu-only or announcer overrides) will widen this union and
|
|
4475
5908
|
* `provideCngxMenu` will dispatch to the matching `provide*Config` based on
|
|
4476
5909
|
* each feature's hidden `_target` discriminator.
|
|
5910
|
+
*
|
|
5911
|
+
* @category common/interactive/menu
|
|
4477
5912
|
*/
|
|
4478
5913
|
type CngxMenuFeature = CngxMenuConfigFeature;
|
|
4479
5914
|
/**
|
|
@@ -4497,20 +5932,20 @@ type CngxMenuFeature = CngxMenuConfigFeature;
|
|
|
4497
5932
|
* ],
|
|
4498
5933
|
* });
|
|
4499
5934
|
* ```
|
|
5935
|
+
*
|
|
5936
|
+
* @category common/interactive/menu
|
|
4500
5937
|
*/
|
|
4501
5938
|
declare function provideCngxMenu(...features: CngxMenuFeature[]): EnvironmentProviders;
|
|
4502
5939
|
|
|
4503
|
-
/** See `CngxListboxTrigger`
|
|
4504
|
-
interface PopoverController {
|
|
4505
|
-
readonly isVisible: () => boolean;
|
|
5940
|
+
/** See `CngxListboxTrigger` - same structural contract. */
|
|
5941
|
+
interface PopoverController extends CngxMenuDismissPopoverRef {
|
|
4506
5942
|
show(): void;
|
|
4507
|
-
hide(): void;
|
|
4508
5943
|
}
|
|
4509
5944
|
/**
|
|
4510
5945
|
* Trigger atom for dropdown menus.
|
|
4511
5946
|
*
|
|
4512
5947
|
* Pairs a focusable element with a `CngxMenu` and a `CngxPopover` through
|
|
4513
|
-
* explicit template references
|
|
5948
|
+
* explicit template references - identical keyboard model to
|
|
4514
5949
|
* `CngxListboxTrigger` except `closeOnSelect` is hardcoded `true` (menu
|
|
4515
5950
|
* semantics: activating an item dismisses the menu).
|
|
4516
5951
|
*
|
|
@@ -4519,6 +5954,38 @@ interface PopoverController {
|
|
|
4519
5954
|
* Up / Home / End / Enter target the submenu's items via its own
|
|
4520
5955
|
* `CngxActiveDescendant`. ArrowLeft / Escape pop the stack and close the
|
|
4521
5956
|
* top submenu.
|
|
5957
|
+
*
|
|
5958
|
+
* ### Focus model
|
|
5959
|
+
*
|
|
5960
|
+
* The dropdown trigger deliberately keeps DOM focus on the trigger
|
|
5961
|
+
* button while the menu is open - WAI-ARIA APG Menu Button Pattern -
|
|
5962
|
+
* and drives the menu's `CngxActiveDescendant` from there via host
|
|
5963
|
+
* keydown. It does NOT call {@link CngxMenuHost.focus} after open;
|
|
5964
|
+
* that path is reserved for {@link CngxContextMenuTrigger}, where the
|
|
5965
|
+
* trigger zone is non-focusable consumer content and the menu
|
|
5966
|
+
* container itself must take focus to receive keyboard input.
|
|
5967
|
+
*
|
|
5968
|
+
* ### Dismissal
|
|
5969
|
+
*
|
|
5970
|
+
* Four dismissal sources close the menu by default: `Escape`, `pointerdown`
|
|
5971
|
+
* outside both the popover and the trigger host, window `blur`, and
|
|
5972
|
+
* document `pointercancel`. Window `scroll` is opt-in via
|
|
5973
|
+
* {@link withDismissOnScroll}. The source that fired most recently is
|
|
5974
|
+
* readable through {@link lastDismissSource}.
|
|
5975
|
+
*
|
|
5976
|
+
* Override individual sources at app root with `withDismissOnOutsideClick`,
|
|
5977
|
+
* `withDismissOnScroll`, `withDismissOnBlur`, or swap the whole handler via
|
|
5978
|
+
* {@link CNGX_MENU_DISMISS_HANDLER_FACTORY} for telemetry-wrapped or
|
|
5979
|
+
* test-doubled dismissal.
|
|
5980
|
+
*
|
|
5981
|
+
* @category common/interactive/menu
|
|
5982
|
+
* @docsKind primary
|
|
5983
|
+
* @wcag AA
|
|
5984
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/menu/menu-trigger.directive.ts
|
|
5985
|
+
* @since 0.1.0
|
|
5986
|
+
* @relatedTo CngxMenu, CngxContextMenuTrigger, CngxMenuItemSubmenu, CngxPopoverTrigger
|
|
5987
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/submenu/two-level-submenu</example-url>
|
|
5988
|
+
* <example-url>http://localhost:4200/#/common/interactive/menu/trigger/dropdown-menu</example-url>
|
|
4522
5989
|
*/
|
|
4523
5990
|
declare class CngxMenuTrigger {
|
|
4524
5991
|
/** Menu controlled by this trigger. */
|
|
@@ -4529,7 +5996,7 @@ declare class CngxMenuTrigger {
|
|
|
4529
5996
|
readonly isOpen: _angular_core.Signal<boolean>;
|
|
4530
5997
|
private readonly nav;
|
|
4531
5998
|
/**
|
|
4532
|
-
* Active submenu chain
|
|
5999
|
+
* Active submenu chain - empty when only the outer menu is open. Each
|
|
4533
6000
|
* entry is the `inner` host of an open submenu, top entry being the
|
|
4534
6001
|
* deepest. Keystrokes target the top entry's AD.
|
|
4535
6002
|
*/
|
|
@@ -4543,6 +6010,16 @@ declare class CngxMenuTrigger {
|
|
|
4543
6010
|
*/
|
|
4544
6011
|
private savedFocus;
|
|
4545
6012
|
private readonly doc;
|
|
6013
|
+
private readonly hostElRef;
|
|
6014
|
+
private readonly menuConfig;
|
|
6015
|
+
private readonly announcer;
|
|
6016
|
+
private readonly dismissBinding;
|
|
6017
|
+
/**
|
|
6018
|
+
* The dismissal source that closed the menu most recently. `null`
|
|
6019
|
+
* before the first close. Surface for demos, telemetry, and audit
|
|
6020
|
+
* sinks - reads which path fired without re-installing listeners.
|
|
6021
|
+
*/
|
|
6022
|
+
readonly lastDismissSource: _angular_core.Signal<_cngx_common_interactive.CngxMenuDismissSource | null>;
|
|
4546
6023
|
constructor();
|
|
4547
6024
|
private effectiveMenu;
|
|
4548
6025
|
protected handleKeydown(event: KeyboardEvent): void;
|
|
@@ -4561,14 +6038,14 @@ declare class CngxMenuTrigger {
|
|
|
4561
6038
|
/**
|
|
4562
6039
|
* Marks any DOM element as carrying an error state.
|
|
4563
6040
|
*
|
|
4564
|
-
* Generic host-element marker
|
|
6041
|
+
* Generic host-element marker - works on cngx, Material, CDK, native HTML,
|
|
4565
6042
|
* and third-party hosts. Toggles the `.cngx-error` class hook plus reactive
|
|
4566
6043
|
* `aria-invalid` / `aria-errormessage` attributes when the bound boolean is
|
|
4567
6044
|
* true. The directive is purely presentational; it does not own the error
|
|
4568
6045
|
* state itself, it only reflects it.
|
|
4569
6046
|
*
|
|
4570
6047
|
* The `cngxErrorState` input takes a plain `boolean`. Consumers binding a
|
|
4571
|
-
* signal write `[cngxErrorState]="form.email().invalid()"`
|
|
6048
|
+
* signal write `[cngxErrorState]="form.email().invalid()"` - the signal is
|
|
4572
6049
|
* invoked at the binding site (canonical Angular pattern), not detected at
|
|
4573
6050
|
* runtime.
|
|
4574
6051
|
*
|
|
@@ -4579,15 +6056,24 @@ declare class CngxMenuTrigger {
|
|
|
4579
6056
|
* />
|
|
4580
6057
|
* <span id="email-error" role="alert">Please enter a valid email.</span>
|
|
4581
6058
|
* ```
|
|
6059
|
+
*
|
|
6060
|
+
* @category common/interactive/error
|
|
6061
|
+
* @docsKind primary
|
|
6062
|
+
* @wcag AA
|
|
6063
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-state/error-state.directive.ts
|
|
6064
|
+
* @since 0.1.0
|
|
6065
|
+
* @relatedTo CngxErrorAggregator, CngxErrorSource, CngxErrorScope
|
|
6066
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/state/basic-boolean-flag-flips-aria-invalid-aria-errormessage</example-url>
|
|
6067
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/state/without-message-id-class-hook-aria-invalid-only</example-url>
|
|
4582
6068
|
*/
|
|
4583
6069
|
declare class CngxErrorState {
|
|
4584
6070
|
readonly cngxErrorState: _angular_core.InputSignal<boolean>;
|
|
4585
6071
|
/** Optional id of the element rendering the error message text. */
|
|
4586
6072
|
readonly cngxErrorMessageId: _angular_core.InputSignal<string | null>;
|
|
4587
|
-
/** @internal
|
|
4588
|
-
protected readonly ariaInvalid: _angular_core.Signal<"
|
|
6073
|
+
/** @internal - explicit boolean, always present in the DOM (cngx ARIA convention). */
|
|
6074
|
+
protected readonly ariaInvalid: _angular_core.Signal<"true" | "false">;
|
|
4589
6075
|
/**
|
|
4590
|
-
* @internal
|
|
6076
|
+
* @internal - emitted whenever a non-empty message id is bound, regardless
|
|
4591
6077
|
* of the error flag. cngx convention: ID-bearing ARIA attributes stay in
|
|
4592
6078
|
* the DOM; visibility of the message element is controlled by the
|
|
4593
6079
|
* consumer via `aria-hidden` on the message itself.
|
|
@@ -4602,15 +6088,17 @@ declare class CngxErrorState {
|
|
|
4602
6088
|
*
|
|
4603
6089
|
* The scope encapsulates the "should errors be visible right now?"
|
|
4604
6090
|
* decision. A scope starts hidden (`showErrors === false`) and reveals
|
|
4605
|
-
* when {@link reveal} is called
|
|
6091
|
+
* when {@link reveal} is called - typically on form submit, on route
|
|
4606
6092
|
* navigation, or on programmatic error trigger.
|
|
4607
6093
|
*
|
|
4608
6094
|
* Descendant directives (`CngxErrorAggregator`, `CngxErrorState`) read
|
|
4609
6095
|
* the scope's `showErrors` signal to gate their own visibility, so a
|
|
4610
6096
|
* single `reveal()` propagates atomically through the subtree.
|
|
6097
|
+
*
|
|
6098
|
+
* @category common/interactive/error
|
|
4611
6099
|
*/
|
|
4612
6100
|
interface CngxErrorScopeContract {
|
|
4613
|
-
/** Reactive flag
|
|
6101
|
+
/** Reactive flag - `true` when errors should be visible to the user. */
|
|
4614
6102
|
readonly showErrors: Signal<boolean>;
|
|
4615
6103
|
/** Reveals errors in this scope (idempotent). */
|
|
4616
6104
|
reveal(): void;
|
|
@@ -4625,13 +6113,20 @@ interface CngxErrorScopeContract {
|
|
|
4625
6113
|
* Provided by {@link CngxErrorScope} via `useExisting`; descendants inject
|
|
4626
6114
|
* with `{ optional: true }` and fall back gracefully when no scope is
|
|
4627
6115
|
* present (no-op).
|
|
6116
|
+
*
|
|
6117
|
+
* @category common/interactive/error
|
|
6118
|
+
* @wcag AA
|
|
6119
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-scope/error-scope.token.ts
|
|
6120
|
+
* @since 0.1.0
|
|
4628
6121
|
*/
|
|
4629
6122
|
declare const CNGX_ERROR_SCOPE: InjectionToken<CngxErrorScopeContract>;
|
|
4630
6123
|
|
|
4631
6124
|
/**
|
|
4632
6125
|
* Marks a DOM subtree as an error visibility scope.
|
|
4633
6126
|
*
|
|
4634
|
-
*
|
|
6127
|
+
* @category common/interactive/error
|
|
6128
|
+
*
|
|
6129
|
+
* The scope starts hidden - descendant aggregators and error states do
|
|
4635
6130
|
* not reveal until the consumer calls {@link reveal}, typically via a
|
|
4636
6131
|
* `(submit)` handler, a route guard, or an HTTP interceptor reveal-on-422
|
|
4637
6132
|
* pattern.
|
|
@@ -4647,6 +6142,16 @@ declare const CNGX_ERROR_SCOPE: InjectionToken<CngxErrorScopeContract>;
|
|
|
4647
6142
|
* <input [cngxErrorState]="email().invalid()" />
|
|
4648
6143
|
* </form>
|
|
4649
6144
|
* ```
|
|
6145
|
+
*
|
|
6146
|
+
* @docsKind primary
|
|
6147
|
+
* @wcag AA
|
|
6148
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-scope/error-scope.directive.ts
|
|
6149
|
+
* @since 0.1.0
|
|
6150
|
+
* @relatedTo CngxErrorAggregator, CngxErrorState, CngxErrorSource
|
|
6151
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>
|
|
6152
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>
|
|
6153
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>
|
|
6154
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>
|
|
4650
6155
|
*/
|
|
4651
6156
|
declare class CngxErrorScope implements CngxErrorScopeContract {
|
|
4652
6157
|
/** Optional name; enables programmatic lookup via {@link CngxErrorRegistry}. */
|
|
@@ -4669,6 +6174,8 @@ declare class CngxErrorScope implements CngxErrorScopeContract {
|
|
|
4669
6174
|
* `key` uniquely identifies the source within its aggregator. `condition`
|
|
4670
6175
|
* is the live signal the aggregator reads on every recompute. `label` is
|
|
4671
6176
|
* an optional human-readable string included in announcements.
|
|
6177
|
+
*
|
|
6178
|
+
* @category common/interactive/error
|
|
4672
6179
|
*/
|
|
4673
6180
|
interface CngxErrorAggregatorSourceEntry {
|
|
4674
6181
|
readonly key: string;
|
|
@@ -4678,11 +6185,13 @@ interface CngxErrorAggregatorSourceEntry {
|
|
|
4678
6185
|
/**
|
|
4679
6186
|
* Contract every {@link CngxErrorAggregator} (or external override) fulfils.
|
|
4680
6187
|
*
|
|
4681
|
-
* The aggregator is the live A11y surface
|
|
6188
|
+
* The aggregator is the live A11y surface - it computes `hasError` /
|
|
4682
6189
|
* `errorCount` / `activeErrors` / `errorLabels` / `shouldShow` /
|
|
4683
6190
|
* `announcement` from its registered sources and exposes them to the
|
|
4684
6191
|
* surrounding host. Sources register via {@link addSource} on init and
|
|
4685
6192
|
* deregister via {@link removeSource} on teardown.
|
|
6193
|
+
*
|
|
6194
|
+
* @category common/interactive/error
|
|
4686
6195
|
*/
|
|
4687
6196
|
interface CngxErrorAggregatorContract {
|
|
4688
6197
|
/** `true` when at least one registered source's condition is `true`. */
|
|
@@ -4693,9 +6202,9 @@ interface CngxErrorAggregatorContract {
|
|
|
4693
6202
|
readonly activeErrors: Signal<readonly string[]>;
|
|
4694
6203
|
/** Labels of currently active error sources (only entries with non-null labels). */
|
|
4695
6204
|
readonly errorLabels: Signal<readonly string[]>;
|
|
4696
|
-
/** `true` when errors should be visible
|
|
6205
|
+
/** `true` when errors should be visible - `hasError` AND scope reveal-state. */
|
|
4697
6206
|
readonly shouldShow: Signal<boolean>;
|
|
4698
|
-
/** SR-friendly announcement text
|
|
6207
|
+
/** SR-friendly announcement text - joins active labels into one phrase. */
|
|
4699
6208
|
readonly announcement: Signal<string>;
|
|
4700
6209
|
/** Registers (or replaces) a source by `key`. */
|
|
4701
6210
|
addSource(entry: CngxErrorAggregatorSourceEntry): void;
|
|
@@ -4709,6 +6218,11 @@ interface CngxErrorAggregatorContract {
|
|
|
4709
6218
|
* Provided by {@link CngxErrorAggregator} via `useExisting`; descendant
|
|
4710
6219
|
* `CngxErrorSource` directives inject with `{ optional: true }` so they
|
|
4711
6220
|
* function as no-ops outside an aggregator.
|
|
6221
|
+
*
|
|
6222
|
+
* @category common/interactive/error
|
|
6223
|
+
* @wcag AA
|
|
6224
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-aggregator/error-aggregator.token.ts
|
|
6225
|
+
* @since 0.1.0
|
|
4712
6226
|
*/
|
|
4713
6227
|
declare const CNGX_ERROR_AGGREGATOR: InjectionToken<CngxErrorAggregatorContract>;
|
|
4714
6228
|
|
|
@@ -4716,14 +6230,16 @@ declare const CNGX_ERROR_AGGREGATOR: InjectionToken<CngxErrorAggregatorContract>
|
|
|
4716
6230
|
* Registers a single error condition with the nearest
|
|
4717
6231
|
* {@link CngxErrorAggregator} ancestor.
|
|
4718
6232
|
*
|
|
4719
|
-
*
|
|
6233
|
+
* @category common/interactive/error
|
|
6234
|
+
*
|
|
6235
|
+
* Pure DI propagation - no DOM output. The directive is a no-op when no
|
|
4720
6236
|
* aggregator is present (the optional injection returns `null`).
|
|
4721
6237
|
* Useful for surfacing errors that live outside the form-field
|
|
4722
6238
|
* presenter, e.g. server-side validation, async availability checks,
|
|
4723
6239
|
* or business-rule conflicts.
|
|
4724
6240
|
*
|
|
4725
6241
|
* The `when` input takes a plain `boolean`. Consumers binding a signal
|
|
4726
|
-
* write `[when]="form.email().invalid()"`
|
|
6242
|
+
* write `[when]="form.email().invalid()"` - the signal is invoked at the
|
|
4727
6243
|
* binding site (canonical Angular pattern), mirroring `CngxErrorState`
|
|
4728
6244
|
* discipline.
|
|
4729
6245
|
*
|
|
@@ -4735,6 +6251,17 @@ declare const CNGX_ERROR_AGGREGATOR: InjectionToken<CngxErrorAggregatorContract>
|
|
|
4735
6251
|
* label="Email already in use"></span>
|
|
4736
6252
|
* </fieldset>
|
|
4737
6253
|
* ```
|
|
6254
|
+
*
|
|
6255
|
+
* @docsKind primary
|
|
6256
|
+
* @wcag AA
|
|
6257
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-source/error-source.directive.ts
|
|
6258
|
+
* @since 0.1.0
|
|
6259
|
+
* @relatedTo CngxErrorAggregator, CngxErrorScope, CngxErrorState
|
|
6260
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>
|
|
6261
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>
|
|
6262
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>
|
|
6263
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>
|
|
6264
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>
|
|
4738
6265
|
*/
|
|
4739
6266
|
declare class CngxErrorSource {
|
|
4740
6267
|
/** Unique key within the parent aggregator. Required. */
|
|
@@ -4753,33 +6280,81 @@ declare class CngxErrorSource {
|
|
|
4753
6280
|
* Aggregates one-or-more {@link CngxErrorSource} children into a single
|
|
4754
6281
|
* live A11y surface.
|
|
4755
6282
|
*
|
|
6283
|
+
* @category common/interactive/error
|
|
6284
|
+
*
|
|
4756
6285
|
* Each registered source contributes a key + a live `Signal<boolean>` +
|
|
4757
6286
|
* an optional label. Derived signals (`hasError`, `errorCount`,
|
|
4758
6287
|
* `activeErrors`, `errorLabels`, `shouldShow`, `announcement`) are
|
|
4759
6288
|
* `computed()` with structural `equal` fns so unrelated re-emissions
|
|
4760
6289
|
* upstream do not cascade through descendants.
|
|
4761
6290
|
*
|
|
4762
|
-
*
|
|
4763
|
-
*
|
|
6291
|
+
* ### Live region
|
|
6292
|
+
*
|
|
6293
|
+
* By default the directive appends a visually-hidden `<span>` to the
|
|
6294
|
+
* host element and writes {@link announcement} into its `textContent`
|
|
6295
|
+
* reactively, so an `aria-live` announcement fires the moment a source
|
|
6296
|
+
* toggles. The span carries `role="status"` (or `role="alert"` when
|
|
6297
|
+
* politeness is `'assertive'`), `aria-live`, `aria-atomic="true"`, and
|
|
6298
|
+
* `aria-relevant="additions text"`. Visually-hidden styling is applied
|
|
6299
|
+
* inline via `--cngx-sr-only-*` CSS custom properties — no global
|
|
6300
|
+
* stylesheet required.
|
|
6301
|
+
*
|
|
6302
|
+
* Set `[autoAnnounce]="false"` to take ownership of the live region in
|
|
6303
|
+
* consumer markup (for example, when routing announcements through
|
|
6304
|
+
* CDK's `LiveAnnouncer` service). Use `[announcePoliteness]` to switch
|
|
6305
|
+
* to `'assertive'` for safety-critical errors or `'off'` to suppress
|
|
6306
|
+
* announcements entirely while keeping the visual error surface.
|
|
4764
6307
|
*
|
|
4765
6308
|
* ```html
|
|
4766
6309
|
* <fieldset cngxErrorAggregator #agg="cngxErrorAggregator">
|
|
4767
6310
|
* <span cngxErrorSource="format" [when]="email().invalid()" label="Format"></span>
|
|
4768
6311
|
* <span cngxErrorSource="taken" [when]="taken()" label="Already used"></span>
|
|
6312
|
+
*
|
|
6313
|
+
* @if (agg.shouldShow()) {
|
|
6314
|
+
* <ul role="alert">
|
|
6315
|
+
* @for (label of agg.errorLabels(); track label) {
|
|
6316
|
+
* <li>{{ label }}</li>
|
|
6317
|
+
* }
|
|
6318
|
+
* </ul>
|
|
6319
|
+
* }
|
|
4769
6320
|
* </fieldset>
|
|
4770
|
-
* <span class="cngx-sr-only" aria-live="polite" aria-atomic="true">
|
|
4771
|
-
* {{ agg.announcement() }}
|
|
4772
|
-
* </span>
|
|
4773
6321
|
* ```
|
|
6322
|
+
*
|
|
6323
|
+
* @docsKind primary
|
|
6324
|
+
* @wcag AA
|
|
6325
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/interactive/error-aggregator/error-aggregator.directive.ts
|
|
6326
|
+
* @since 0.1.0
|
|
6327
|
+
* @relatedTo CngxErrorSource, CngxErrorScope, CngxErrorState, CngxErrorRegistry
|
|
6328
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-card-host-no-scope-errors-visible-immediately</example-url>
|
|
6329
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/cngx-popover-panel-host</example-url>
|
|
6330
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/material-mat-tab-label-with-error-count-badge</example-url>
|
|
6331
|
+
* <example-url>http://localhost:4200/#/common/interactive/error/aggregator/native-form-scope-reveal-on-submit</example-url>
|
|
6332
|
+
* <example-url>http://localhost:4200/#/ui/stepper/stepper-error-aggregation/per-step-error-badges</example-url>
|
|
6333
|
+
* <example-url>http://localhost:4200/#/ui/tabs/tab-error-aggregation/per-tab-error-badges</example-url>
|
|
4774
6334
|
*/
|
|
4775
6335
|
declare class CngxErrorAggregator implements CngxErrorAggregatorContract {
|
|
4776
6336
|
/** External scope override; falls back to ancestor `CNGX_ERROR_SCOPE`. */
|
|
4777
6337
|
readonly scope: _angular_core.InputSignal<CngxErrorScopeContract | undefined>;
|
|
4778
6338
|
/** Optional name; enables programmatic lookup via {@link CngxErrorRegistry}. */
|
|
4779
6339
|
readonly aggregatorName: _angular_core.InputSignal<string | undefined>;
|
|
6340
|
+
/**
|
|
6341
|
+
* When `true` (default), the directive appends its own visually-hidden
|
|
6342
|
+
* `<span>` to the host element and writes {@link announcement} into its
|
|
6343
|
+
* `textContent`. Set to `false` to take ownership of the live region in
|
|
6344
|
+
* consumer markup (e.g. when routing announcements through CDK's
|
|
6345
|
+
* `LiveAnnouncer`).
|
|
6346
|
+
*/
|
|
6347
|
+
readonly autoAnnounce: _angular_core.InputSignal<boolean>;
|
|
6348
|
+
/**
|
|
6349
|
+
* Politeness of the auto-rendered live region. Mirrors the WAI-ARIA
|
|
6350
|
+
* `aria-live` value. `'polite'` queues after the current utterance,
|
|
6351
|
+
* `'assertive'` interrupts, `'off'` disables announcement (the span is
|
|
6352
|
+
* still rendered but is not announced).
|
|
6353
|
+
*/
|
|
6354
|
+
readonly announcePoliteness: _angular_core.InputSignal<"polite" | "assertive" | "off">;
|
|
4780
6355
|
private readonly ancestorScope;
|
|
4781
6356
|
private readonly sourcesState;
|
|
4782
|
-
/** @internal
|
|
6357
|
+
/** @internal - the resolved scope (input wins, else ancestor, else `null`). */
|
|
4783
6358
|
protected readonly effectiveScope: _angular_core.Signal<CngxErrorScopeContract | null>;
|
|
4784
6359
|
private readonly contract;
|
|
4785
6360
|
readonly hasError: _angular_core.Signal<boolean>;
|
|
@@ -4792,7 +6367,7 @@ declare class CngxErrorAggregator implements CngxErrorAggregatorContract {
|
|
|
4792
6367
|
removeSource(key: string): void;
|
|
4793
6368
|
constructor();
|
|
4794
6369
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxErrorAggregator, never>;
|
|
4795
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxErrorAggregator, "[cngxErrorAggregator]", ["cngxErrorAggregator"], { "scope": { "alias": "scope"; "required": false; "isSignal": true; }; "aggregatorName": { "alias": "cngxErrorAggregatorName"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
6370
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxErrorAggregator, "[cngxErrorAggregator]", ["cngxErrorAggregator"], { "scope": { "alias": "scope"; "required": false; "isSignal": true; }; "aggregatorName": { "alias": "cngxErrorAggregatorName"; "required": false; "isSignal": true; }; "autoAnnounce": { "alias": "autoAnnounce"; "required": false; "isSignal": true; }; "announcePoliteness": { "alias": "announcePoliteness"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
4796
6371
|
}
|
|
4797
6372
|
|
|
4798
6373
|
/**
|
|
@@ -4900,7 +6475,7 @@ declare function injectErrorScope(name?: string): CngxErrorScopeContract;
|
|
|
4900
6475
|
* Creates a programmatic {@link CngxErrorAggregatorContract}, optionally
|
|
4901
6476
|
* registered under `name` in the ambient {@link CngxErrorRegistry}.
|
|
4902
6477
|
*
|
|
4903
|
-
* Positional arguments
|
|
6478
|
+
* Positional arguments - NOT a config-options-bag - per Pillar 3
|
|
4904
6479
|
* (Komposition statt Konfiguration). When `name` is set and a registry is
|
|
4905
6480
|
* provided, auto-registers and auto-deregisters on the surrounding
|
|
4906
6481
|
* `DestroyRef`.
|
|
@@ -4922,7 +6497,7 @@ declare function injectErrorScope(name?: string): CngxErrorScopeContract;
|
|
|
4922
6497
|
* ({@link `@cngx/common/interactive`#CngxErrorAggregator}) and the
|
|
4923
6498
|
* function form share a single source of truth.
|
|
4924
6499
|
*
|
|
4925
|
-
* @internal Staged API
|
|
6500
|
+
* @internal Staged API - single-consumer.
|
|
4926
6501
|
* See form-primitives-accepted-debt.md §A for the re-evaluation trigger
|
|
4927
6502
|
* and collapse plan.
|
|
4928
6503
|
*/
|
|
@@ -5009,5 +6584,5 @@ declare function withGlobalRevealOnSubmit(): ErrorRegistryFeature;
|
|
|
5009
6584
|
*/
|
|
5010
6585
|
declare function withRevealOnNavigate(): ErrorRegistryFeature;
|
|
5011
6586
|
|
|
5012
|
-
export { 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_MENU_ANNOUNCER_FACTORY, CNGX_MENU_CONFIG, 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_TREE_CONFIG, CNGX_TREE_CONTROLLER_FACTORY, CngxAsyncClick, CngxBeforeUnload, CngxButtonMultiToggleGroup, CngxButtonToggle, CngxButtonToggleGroup, CngxCheckbox, CngxCheckboxGroup, CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction, CngxClickOutside, CngxCloseButton, CngxContextMenuTrigger, CngxCopyBlock, CngxCopyText, CngxDisclosure, CngxErrorAggregator, CngxErrorRegistry, CngxErrorScope, CngxErrorSource, CngxErrorState, CngxExpandable, CngxFailed, CngxHierarchicalNav, 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, CngxReorder, CngxRipple, CngxSearch, CngxSpeak, CngxSucceeded, CngxSwipeDismiss, CngxToggle, DEFAULT_MENU_CONFIG, canDeactivateWhenClean, createChipStripRoving, createMenuAnnouncer, createMenuRadioController, createTreeAdItems, createTreeController, createW3CMenuStrategy, createW3CTreeStrategy, injectErrorAggregator, injectErrorScope, injectMenuAnnouncer, injectMenuConfig, injectNavConfig, injectTreeConfig, optimistic, provideCngxMenu, provideErrorRegistry, provideMenuConfig, provideMenuConfigAt, provideNavConfig, provideTreeConfig, provideTreeConfigAt, withAriaLabels, withCloseOnSelect, withDefaultInitiallyExpanded, withDefaultKeyFn, withDefaultLabelFn, withDefaultNodeIdFn, withGlobalRevealOnSubmit, withNavAnimation, withNavIndent, withRetry, withRevealOnNavigate, withSingleAccordion, withSubmenuCloseDelay, withSubmenuOpenDelay, withTreeCacheLimit, withTypeaheadDebounce };
|
|
5013
|
-
export type { AsyncAction, CngxButtonMultiToggleGroupContract, CngxButtonToggleGroupContract, CngxChipGroupHost, CngxChipStripRovingController, CngxChipStripRovingFactory, CngxChipStripRovingOptions, CngxControlValue, CngxErrorAggregatorContract, CngxErrorAggregatorSourceEntry, CngxErrorScopeContract, CngxHierarchicalNavAction, CngxHierarchicalNavContext, CngxHierarchicalNavStrategy, CngxMenuAnnouncerFactory, CngxMenuAnnouncerLike, CngxMenuAriaLabels, CngxMenuConfig, CngxMenuConfigFeature, CngxMenuFeature, CngxMenuHost, CngxMenuNavAction, CngxMenuNavContext, CngxMenuNavStrategy, CngxMenuRadioGroup, CngxMenuRadioGroupFactory, CngxMenuSubmenuLike, CngxNavConfig, CngxOptionContainer, CngxOptionContainerGroup, CngxOptionContainerOption, CngxOptionFilterHost, CngxOptionInteractionHost, CngxOptionStatus, CngxOptionStatusHost, CngxRadioGroupContract, CngxRadioRegistration, CngxReorderEvent, CngxReorderModifier, CngxTreeConfig, CngxTreeConfigFeature, CngxTreeController, CngxTreeControllerFactory, CngxTreeControllerOptions, ErrorRegistryFeature, ListboxMatchFn, NavBadgeVariant, NavConfigFeature, OptimisticState, RetryConfig, RetryState, SwipeDirection };
|
|
6587
|
+
export { 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_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_SUBMENU_TRY_FALLBACKS, CNGX_TREE_CONFIG, CNGX_TREE_CONTROLLER_FACTORY, CngxAsyncClick, CngxAsyncStatus, CngxBeforeUnload, CngxButtonMultiToggleGroup, CngxButtonToggle, CngxButtonToggleGroup, CngxCheckbox, CngxCheckboxGroup, CngxChipGroup, CngxChipInGroup, CngxChipInput, CngxChipInteraction, CngxClickOutside, CngxCloseButton, CngxContextMenuTrigger, CngxCopyBlock, CngxCopyText, CngxDisclosure, CngxErrorAggregator, CngxErrorRegistry, CngxErrorScope, CngxErrorSource, CngxErrorState, CngxExpandable, CngxFailed, CngxHierarchicalNav, 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, CngxReorder, CngxRipple, CngxSearch, CngxSpeak, CngxSucceeded, CngxSwipe, CngxSwipeDismiss, CngxToggle, DEFAULT_MENU_CONFIG, canDeactivateWhenClean, createChipStripRoving, createMenuAnnouncer, createMenuDismissHandler, createMenuRadioController, createMenuTriggerDismissBinding, createTreeAdItems, createTreeController, createW3CMenuStrategy, createW3CTreeStrategy, injectErrorAggregator, injectErrorScope, injectMenuAnnouncer, injectMenuConfig, injectNavConfig, injectTreeConfig, optimistic, provideCngxMenu, provideErrorRegistry, provideMenuConfig, provideMenuConfigAt, provideNavConfig, provideTreeConfig, provideTreeConfigAt, reflectAsyncDisplayStatus, withAriaLabels, withCloseOnSelect, withDefaultInitiallyExpanded, withDefaultKeyFn, withDefaultLabelFn, withDefaultNodeIdFn, withDismissOnBlur, withDismissOnOutsideClick, withDismissOnScroll, withGlobalRevealOnSubmit, withNavAnimation, withNavIndent, withRetry, withRevealOnNavigate, withSingleAccordion, withSubmenuCloseDelay, withSubmenuOpenDelay, withTreeCacheLimit, withTypeaheadDebounce };
|
|
6588
|
+
export type { AsyncAction, CngxAsyncDisplayStatus, CngxButtonMultiToggleGroupContract, CngxButtonToggleGroupContract, CngxChipGroupHost, CngxChipStripRovingController, CngxChipStripRovingFactory, CngxChipStripRovingOptions, CngxControlValue, CngxErrorAggregatorContract, CngxErrorAggregatorSourceEntry, CngxErrorScopeContract, CngxHierarchicalNavAction, CngxHierarchicalNavContext, CngxHierarchicalNavStrategy, CngxMenuAnnouncerFactory, CngxMenuAnnouncerLike, CngxMenuAriaLabels, CngxMenuConfig, CngxMenuConfigFeature, CngxMenuDismissHandler, CngxMenuDismissHandlerFactory, CngxMenuDismissHandlerOptions, CngxMenuDismissPopoverRef, CngxMenuDismissSource, CngxMenuFeature, CngxMenuHost, CngxMenuNavAction, CngxMenuNavContext, CngxMenuNavStrategy, CngxMenuRadioGroup, CngxMenuRadioGroupFactory, CngxMenuSubmenuLike, CngxMenuTriggerDismissBinding, CngxMenuTriggerDismissBindingOptions, CngxNavConfig, CngxOptionContainer, CngxOptionContainerGroup, CngxOptionContainerOption, CngxOptionFilterHost, CngxOptionInteractionHost, CngxOptionStatus, CngxOptionStatusHost, CngxRadioGroupContract, CngxRadioRegistration, CngxReorderEvent, CngxReorderModifier, CngxTreeConfig, CngxTreeConfigFeature, CngxTreeController, CngxTreeControllerFactory, CngxTreeControllerOptions, ErrorRegistryFeature, ListboxMatchFn, NavBadgeVariant, NavConfigFeature, OptimisticState, RetryConfig, RetryState, SwipeAxis, SwipeDirection };
|