@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnDestroy,
|
|
2
|
+
import { OnDestroy, InjectionToken, Signal, ElementRef } from '@angular/core';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Manages `aria-expanded` and optionally `aria-controls` on the host element.
|
|
@@ -33,7 +33,6 @@ import { OnDestroy, ElementRef, InjectionToken, Signal } from '@angular/core';
|
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
35
|
* @category common/a11y
|
|
36
|
-
* @docsKind primary
|
|
37
36
|
* @wcag AA
|
|
38
37
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/aria-expanded.directive.ts
|
|
39
38
|
* @since 0.1.0
|
|
@@ -80,7 +79,6 @@ declare class CngxAriaExpanded {
|
|
|
80
79
|
* ```
|
|
81
80
|
*
|
|
82
81
|
* @category common/a11y
|
|
83
|
-
* @docsKind primary
|
|
84
82
|
* @wcag AA
|
|
85
83
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-region.directive.ts
|
|
86
84
|
* @since 0.1.0
|
|
@@ -104,7 +102,13 @@ declare class CngxLiveRegion {
|
|
|
104
102
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxLiveRegion, "[cngxLiveRegion]", ["cngxLiveRegion"], { "politeness": { "alias": "politeness"; "required": false; "isSignal": true; }; "atomic": { "alias": "atomic"; "required": false; "isSignal": true; }; "relevant": { "alias": "relevant"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
105
103
|
}
|
|
106
104
|
|
|
107
|
-
|
|
105
|
+
/**
|
|
106
|
+
* Politeness channel for {@link CngxLiveAnnouncer.announce}: `'polite'` queues
|
|
107
|
+
* after the current utterance, `'assertive'` interrupts it immediately.
|
|
108
|
+
*
|
|
109
|
+
* @category common/a11y
|
|
110
|
+
*/
|
|
111
|
+
type AriaLivePoliteness = 'polite' | 'assertive';
|
|
108
112
|
/**
|
|
109
113
|
* Imperative, reusable polite/assertive live-region announcer.
|
|
110
114
|
*
|
|
@@ -122,6 +126,24 @@ type Politeness = 'polite' | 'assertive';
|
|
|
122
126
|
* polite one. Per region, the text is cleared and re-set one frame later so an
|
|
123
127
|
* identical consecutive message is still re-read by the screen reader.
|
|
124
128
|
*
|
|
129
|
+
* A modal dialog hides everything outside it from assistive technology, so a
|
|
130
|
+
* body region is silent while one is open. Pass the announcing element as the
|
|
131
|
+
* third argument and the message goes to a region pair inside its enclosing
|
|
132
|
+
* `[aria-modal="true"]` container instead; without a modal ancestor it goes to
|
|
133
|
+
* the body regions as before. When another modal covers that one, the topmost
|
|
134
|
+
* open modal receives it: the last `[aria-modal="true"]` element in document
|
|
135
|
+
* order that is open and not inside an `[inert]` subtree. That covers a modal
|
|
136
|
+
* nested inside the scope's own one as well as a sibling stacked on top of it,
|
|
137
|
+
* which is how `CngxDialog` stacks dialogs (every host is appended to
|
|
138
|
+
* `document.body`); a covered modal is hidden from assistive technology, so
|
|
139
|
+
* its region would be silent. The pair is created with both regions on first
|
|
140
|
+
* use and its first write waits until the regions have settled in the DOM. A
|
|
141
|
+
* message still pending when its modal closes moves to the next enclosing open
|
|
142
|
+
* modal, else to the topmost modal still open, else to the body regions, and
|
|
143
|
+
* the pair is removed. The scope is opt-in per call - an unscoped announcement
|
|
144
|
+
* never guesses a modal. {@link injectScopedLiveRegion} is the injection-time
|
|
145
|
+
* alternative when the caller knows its overlay host up front.
|
|
146
|
+
*
|
|
125
147
|
* SSR-safe: all DOM access is guarded by `isPlatformBrowser`; on the server
|
|
126
148
|
* `announce()` is a no-op and no region is created.
|
|
127
149
|
*
|
|
@@ -129,10 +151,10 @@ type Politeness = 'polite' | 'assertive';
|
|
|
129
151
|
* const announcer = inject(CngxLiveAnnouncer);
|
|
130
152
|
* announcer.announce('Copied');
|
|
131
153
|
* announcer.announce('Save failed', 'assertive');
|
|
154
|
+
* announcer.announce('Alert dismissed', 'polite', hostElement); // inside a modal
|
|
132
155
|
* ```
|
|
133
156
|
*
|
|
134
157
|
* @category common/a11y
|
|
135
|
-
* @docsKind primary
|
|
136
158
|
* @wcag AA
|
|
137
159
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/live-announcer.ts
|
|
138
160
|
* @since 0.1.0
|
|
@@ -141,9 +163,13 @@ type Politeness = 'polite' | 'assertive';
|
|
|
141
163
|
declare class CngxLiveAnnouncer implements OnDestroy {
|
|
142
164
|
private readonly doc;
|
|
143
165
|
private readonly isBrowser;
|
|
144
|
-
private
|
|
145
|
-
|
|
146
|
-
|
|
166
|
+
private regions;
|
|
167
|
+
/**
|
|
168
|
+
* One pair per open `aria-modal` container, released once it closes.
|
|
169
|
+
* `outer` is the container's parent at creation, the route for its unwritten
|
|
170
|
+
* messages when it is removed from the DOM.
|
|
171
|
+
*/
|
|
172
|
+
private readonly modalRegions;
|
|
147
173
|
/**
|
|
148
174
|
* Announces `message` through the fixed-politeness live region.
|
|
149
175
|
*
|
|
@@ -151,14 +177,93 @@ declare class CngxLiveAnnouncer implements OnDestroy {
|
|
|
151
177
|
* @param politeness `'polite'` (default) queues after the current
|
|
152
178
|
* utterance; `'assertive'` interrupts immediately. Each politeness owns its
|
|
153
179
|
* own region, so the two never overwrite each other.
|
|
180
|
+
* @param scope The announcing element. When it sits inside an
|
|
181
|
+
* `[aria-modal="true"]` container, the message is written into a region
|
|
182
|
+
* inside the topmost open modal (that container unless another modal
|
|
183
|
+
* covers it), which a screen reader still reads while the modal hides the
|
|
184
|
+
* rest of the page. `null` / omitted: the body regions.
|
|
154
185
|
*/
|
|
155
|
-
announce(message: string, politeness?:
|
|
186
|
+
announce(message: string, politeness?: AriaLivePoliteness, scope?: Element | null): void;
|
|
156
187
|
ngOnDestroy(): void;
|
|
157
|
-
|
|
188
|
+
/**
|
|
189
|
+
* `fromModal` marks a message that was already scoped to a modal which has
|
|
190
|
+
* since closed: with no open modal around its new scope it still goes to the
|
|
191
|
+
* topmost open modal rather than to the silent body regions.
|
|
192
|
+
*/
|
|
193
|
+
private route;
|
|
194
|
+
/**
|
|
195
|
+
* The topmost open modal when `scope` sits in an open modal (or the message
|
|
196
|
+
* comes from a closed one), else `null` for the body regions. Falls back to
|
|
197
|
+
* the scope's own modal when no candidate outside an inert subtree is open.
|
|
198
|
+
*/
|
|
199
|
+
private targetModal;
|
|
200
|
+
private enclosingOpenModal;
|
|
201
|
+
private redirectIfClosed;
|
|
202
|
+
private releaseClosedModals;
|
|
203
|
+
/** Drop the pair of a closed modal; its unwritten messages move outward. */
|
|
204
|
+
private release;
|
|
205
|
+
private outerOf;
|
|
158
206
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxLiveAnnouncer, never>;
|
|
159
207
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CngxLiveAnnouncer>;
|
|
160
208
|
}
|
|
161
209
|
|
|
210
|
+
/**
|
|
211
|
+
* A message whose write into its live region has not landed yet.
|
|
212
|
+
*
|
|
213
|
+
* @category common/a11y
|
|
214
|
+
*/
|
|
215
|
+
interface CngxPendingAnnouncement {
|
|
216
|
+
readonly message: string;
|
|
217
|
+
readonly politeness: AriaLivePoliteness;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Polite + assertive live regions inside one host element.
|
|
222
|
+
*
|
|
223
|
+
* @category common/a11y
|
|
224
|
+
*/
|
|
225
|
+
interface CngxScopedLiveRegion {
|
|
226
|
+
/** Speak `message` from the region of `politeness` (default `'polite'`). */
|
|
227
|
+
announce(message: string, politeness?: AriaLivePoliteness): void;
|
|
228
|
+
/** Create both regions now, so they are in the DOM before the first message. */
|
|
229
|
+
ensure(): void;
|
|
230
|
+
/** Cancel every write that has not landed yet and return what it would have said. */
|
|
231
|
+
takePending(): readonly CngxPendingAnnouncement[];
|
|
232
|
+
/** Cancel pending writes and remove the regions. Runs on destroy as well. */
|
|
233
|
+
destroy(): void;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Create a polite + assertive live-region pair inside `host`.
|
|
237
|
+
*
|
|
238
|
+
* The scoped counterpart to {@link CngxLiveAnnouncer}: same regions, same
|
|
239
|
+
* clear-then-set timing, but appended to an overlay host instead of
|
|
240
|
+
* `document.body`. Use it for modal overlays: under `aria-modal` VoiceOver
|
|
241
|
+
* drops body-level live regions and speaks them late after the overlay
|
|
242
|
+
* closes, while a region inside the modal is spoken on every platform.
|
|
243
|
+
* Polite and assertive keep separate regions, so an assertive error never
|
|
244
|
+
* clobbers a polite status.
|
|
245
|
+
*
|
|
246
|
+
* Must run in an injection context; the regions are removed when that context
|
|
247
|
+
* is destroyed. No-op on the server.
|
|
248
|
+
*
|
|
249
|
+
* ```typescript
|
|
250
|
+
* private readonly region = injectScopedLiveRegion(inject(ElementRef).nativeElement);
|
|
251
|
+
*
|
|
252
|
+
* protected handleSaveFailed(): void {
|
|
253
|
+
* this.region.announce('Save failed', 'assertive');
|
|
254
|
+
* }
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* @param host - Element that receives the two visually hidden regions.
|
|
258
|
+
*
|
|
259
|
+
* @category common/a11y
|
|
260
|
+
* @wcag AA
|
|
261
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/aria/scoped-live-region.ts
|
|
262
|
+
* @since 0.1.0
|
|
263
|
+
* @relatedTo CngxLiveAnnouncer, CngxLiveRegion
|
|
264
|
+
*/
|
|
265
|
+
declare function injectScopedLiveRegion(host: HTMLElement): CngxScopedLiveRegion;
|
|
266
|
+
|
|
162
267
|
/**
|
|
163
268
|
* Reactive autofocus for dynamically inserted elements.
|
|
164
269
|
*
|
|
@@ -187,7 +292,6 @@ declare class CngxLiveAnnouncer implements OnDestroy {
|
|
|
187
292
|
* ```
|
|
188
293
|
*
|
|
189
294
|
* @category common/a11y
|
|
190
|
-
* @docsKind primary
|
|
191
295
|
* @wcag AA
|
|
192
296
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/autofocus.directive.ts
|
|
193
297
|
* @since 0.1.0
|
|
@@ -238,7 +342,9 @@ declare const CNGX_FOCUSABLE_SELECTOR = "a[href], button:not(:disabled), input:n
|
|
|
238
342
|
* `document.activeElement` at initialization time and restores it when the
|
|
239
343
|
* host element is destroyed.
|
|
240
344
|
*
|
|
241
|
-
* Fallback chain: stored element → provided fallback → nearest focusable ancestor
|
|
345
|
+
* Fallback chain: stored element → provided fallback → nearest focusable ancestor.
|
|
346
|
+
* When none resolves, focus is left where the browser put it - `<body>` is
|
|
347
|
+
* deliberately never a restore target.
|
|
242
348
|
*
|
|
243
349
|
* ### Panel that restores focus on close
|
|
244
350
|
* ```html
|
|
@@ -259,7 +365,6 @@ declare const CNGX_FOCUSABLE_SELECTOR = "a[href], button:not(:disabled), input:n
|
|
|
259
365
|
* ```
|
|
260
366
|
*
|
|
261
367
|
* @category common/a11y
|
|
262
|
-
* @docsKind primary
|
|
263
368
|
* @wcag AA
|
|
264
369
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-restore.directive.ts
|
|
265
370
|
* @since 0.1.0
|
|
@@ -300,6 +405,21 @@ declare class CngxFocusRestore {
|
|
|
300
405
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxFocusRestore, "[cngxFocusRestore]", ["cngxFocusRestore"], { "restoreOnDestroy": { "alias": "restoreOnDestroy"; "required": false; "isSignal": true; }; "fallback": { "alias": "fallback"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
301
406
|
}
|
|
302
407
|
|
|
408
|
+
/**
|
|
409
|
+
* @internal Lets a directive that composes `CngxFocusTrap` as a host
|
|
410
|
+
* directive drive it from its own state instead of the inputs. Provided by
|
|
411
|
+
* the composer on the same element (`useExisting`); the trap resolves it
|
|
412
|
+
* lazily with `self: true`, because the composer constructs after its host
|
|
413
|
+
* directives.
|
|
414
|
+
*/
|
|
415
|
+
interface CngxFocusTrapDriver {
|
|
416
|
+
/** Whether the trap is active; wins over `[enabled]`. */
|
|
417
|
+
readonly focusTrapEnabled: Signal<boolean>;
|
|
418
|
+
/** Whether activation auto-focuses; wins over `[autoFocus]`. */
|
|
419
|
+
readonly focusTrapAutoFocus: boolean;
|
|
420
|
+
}
|
|
421
|
+
/** @internal See {@link CngxFocusTrapDriver}. */
|
|
422
|
+
declare const CNGX_FOCUS_TRAP_DRIVER: InjectionToken<CngxFocusTrapDriver>;
|
|
303
423
|
/**
|
|
304
424
|
* Traps keyboard focus within the host element using the CDK `FocusTrap`.
|
|
305
425
|
*
|
|
@@ -311,6 +431,11 @@ declare class CngxFocusRestore {
|
|
|
311
431
|
* The CDK's imperative `create()` / `destroy()` / `enabled` setter lifecycle
|
|
312
432
|
* is handled internally via `effect()` and `DestroyRef`.
|
|
313
433
|
*
|
|
434
|
+
* **Nesting:** traps do not coordinate with each other. When traps nest
|
|
435
|
+
* (dialog over drawer), enable only the innermost one and drive each
|
|
436
|
+
* `enabled` from your layering state - two simultaneously enabled traps
|
|
437
|
+
* fight over Tab. `CngxDialogStack` already does this for stacked dialogs.
|
|
438
|
+
*
|
|
314
439
|
* ### Modal dialog
|
|
315
440
|
* ```html
|
|
316
441
|
* <div cngxFocusTrap [enabled]="isOpen()" [autoFocus]="true"
|
|
@@ -343,14 +468,35 @@ declare class CngxFocusTrap {
|
|
|
343
468
|
readonly enabled: _angular_core.InputSignal<boolean>;
|
|
344
469
|
/** Whether to auto-focus the first tabbable element when the trap activates. */
|
|
345
470
|
readonly autoFocus: _angular_core.InputSignal<boolean>;
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
private
|
|
471
|
+
private readonly injector;
|
|
472
|
+
private resolvedDriver;
|
|
473
|
+
private driver;
|
|
474
|
+
/**
|
|
475
|
+
* The enabled state the trap actually follows: a composer's driver
|
|
476
|
+
* (see {@link CngxFocusTrapDriver}) wins over the `[enabled]` input.
|
|
477
|
+
*/
|
|
478
|
+
private readonly effectiveEnabled;
|
|
479
|
+
/**
|
|
480
|
+
* Readable alias of the effective enabled state for `exportAs` consumers
|
|
481
|
+
* (`trap.isActive()` reads better than re-binding the input).
|
|
482
|
+
*/
|
|
483
|
+
readonly isActive: Signal<boolean>;
|
|
484
|
+
private readonly host;
|
|
485
|
+
private readonly factory;
|
|
486
|
+
private trap;
|
|
349
487
|
constructor();
|
|
350
488
|
/** Programmatically focus the first tabbable element within the trap. */
|
|
351
489
|
focusFirst(): void;
|
|
352
490
|
/** Programmatically focus the last tabbable element within the trap. */
|
|
353
491
|
focusLast(): void;
|
|
492
|
+
/**
|
|
493
|
+
* @internal Focus the first tabbable element right now, in the caller's
|
|
494
|
+
* stack. `focusFirst()` waits for the next render, which is too late for a
|
|
495
|
+
* composer that must move focus inside the user gesture that opened it.
|
|
496
|
+
* Returns `false` when nothing inside is tabbable.
|
|
497
|
+
*/
|
|
498
|
+
focusFirstNow(): boolean;
|
|
499
|
+
private ensureTrap;
|
|
354
500
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxFocusTrap, never>;
|
|
355
501
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxFocusTrap, "[cngxFocusTrap]", ["cngxFocusTrap"], { "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
356
502
|
}
|
|
@@ -369,7 +515,6 @@ declare class CngxFocusTrap {
|
|
|
369
515
|
* ```
|
|
370
516
|
*
|
|
371
517
|
* @category common/a11y
|
|
372
|
-
* @docsKind primary
|
|
373
518
|
* @wcag AA
|
|
374
519
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/focus/focus-visible.directive.ts
|
|
375
520
|
* @since 0.1.0
|
|
@@ -378,11 +523,16 @@ declare class CngxFocusTrap {
|
|
|
378
523
|
* <example-url>http://localhost:4200/#/common/a11y/focus-visible/keyboard-vs-pointer</example-url>
|
|
379
524
|
*/
|
|
380
525
|
declare class CngxFocusVisible {
|
|
526
|
+
private readonly doc;
|
|
381
527
|
private readonly focusVisibleState;
|
|
382
528
|
/** `true` when focus was initiated via keyboard (not pointer). */
|
|
383
529
|
readonly focusVisible: _angular_core.Signal<boolean>;
|
|
384
|
-
|
|
385
|
-
|
|
530
|
+
private pointerActive;
|
|
531
|
+
private pointerClearTimer;
|
|
532
|
+
private readonly schedulePointerClear;
|
|
533
|
+
constructor();
|
|
534
|
+
/** @internal Arms the pointer flag for the imminent focusin. */
|
|
535
|
+
protected handlePointerDown(): void;
|
|
386
536
|
/** @internal Sets focus-visible state; clears pointer flag. */
|
|
387
537
|
protected handleFocus(): void;
|
|
388
538
|
/** @internal Clears focus-visible state on blur. */
|
|
@@ -407,7 +557,6 @@ declare class CngxFocusVisible {
|
|
|
407
557
|
* ```
|
|
408
558
|
*
|
|
409
559
|
* @category common/a11y
|
|
410
|
-
* @docsKind primary
|
|
411
560
|
* @wcag AA
|
|
412
561
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/roving/roving-tabindex.directive.ts
|
|
413
562
|
* @since 0.1.0
|
|
@@ -558,7 +707,8 @@ declare class CngxRovingTabindex {
|
|
|
558
707
|
private focusVirtualItem;
|
|
559
708
|
/**
|
|
560
709
|
* Finds the next index in virtual mode. No disabled-item skipping - can't check
|
|
561
|
-
* disabled state of items not in the DOM
|
|
710
|
+
* disabled state of items not in the DOM (the resolver treats every index as
|
|
711
|
+
* enabled when no `isDisabledAt` is supplied).
|
|
562
712
|
*/
|
|
563
713
|
private findNextVirtual;
|
|
564
714
|
private enabledItems;
|
|
@@ -708,18 +858,35 @@ declare class CngxActiveDescendant {
|
|
|
708
858
|
* Ignored when `virtualCount` is unset.
|
|
709
859
|
*/
|
|
710
860
|
readonly windowStart: _angular_core.InputSignal<number>;
|
|
861
|
+
/**
|
|
862
|
+
* Equality used to find the previously active value again after the item
|
|
863
|
+
* list changes. Defaults to `Object.is`; pass the same comparator as the
|
|
864
|
+
* surrounding listbox / select when options are re-fetched as new objects
|
|
865
|
+
* with equal identity, or the highlight drops on every refresh. The
|
|
866
|
+
* parameters are typed `never` so a comparator over any value type binds
|
|
867
|
+
* while the directive itself stays non-generic.
|
|
868
|
+
*/
|
|
869
|
+
readonly compareWith: _angular_core.InputSignal<(a: never, b: never) => boolean>;
|
|
711
870
|
/** Emitted when `activateCurrent()` is called with an active item. */
|
|
712
871
|
readonly activated: _angular_core.OutputEmitterRef<unknown>;
|
|
713
872
|
/** Emitted whenever the highlighted item changes. */
|
|
714
873
|
readonly highlighted: _angular_core.OutputEmitterRef<ActiveDescendantItem | null>;
|
|
874
|
+
/**
|
|
875
|
+
* Emitted when a typeahead query finds no match in the rendered window.
|
|
876
|
+
* Carries the resolved query term (lowercased; a repeated single letter
|
|
877
|
+
* collapses to that letter per the APG cycle rule). The rendered window
|
|
878
|
+
* is AD's whole search space - hosts whose real item space is larger
|
|
879
|
+
* (collapsed tree branches, virtualized rows outside the window) listen
|
|
880
|
+
* here to resolve the miss themselves.
|
|
881
|
+
*/
|
|
882
|
+
readonly typeaheadMissed: _angular_core.OutputEmitterRef<string>;
|
|
715
883
|
private readonly hostEl;
|
|
884
|
+
private readonly locale;
|
|
716
885
|
private readonly registered;
|
|
717
886
|
/** Document writing direction - flips the horizontal-arrow steps under `rtl` (APG). */
|
|
718
887
|
private readonly direction;
|
|
719
888
|
/** Guards host attribute writes until after first render. */
|
|
720
889
|
private readonly initialized;
|
|
721
|
-
/** -1 means "no active item". Range is [0, resolvedItems().length). */
|
|
722
|
-
private readonly activeIndexState;
|
|
723
890
|
/** Index of an item that should be highlighted but is not in the DOM. */
|
|
724
891
|
private readonly pendingHighlightState;
|
|
725
892
|
readonly pendingHighlight: _angular_core.Signal<number | null>;
|
|
@@ -728,6 +895,17 @@ declare class CngxActiveDescendant {
|
|
|
728
895
|
* handles are projected into `ActiveDescendantItem` shape.
|
|
729
896
|
*/
|
|
730
897
|
readonly resolvedItems: _angular_core.Signal<ActiveDescendantItem[]>;
|
|
898
|
+
/**
|
|
899
|
+
* -1 means "no active item". Range is `[0, totalCount())`.
|
|
900
|
+
*
|
|
901
|
+
* Navigation writes the index; a change of the item space re-derives it.
|
|
902
|
+
* The highlight follows its value, not its index: after the item list
|
|
903
|
+
* changes, the previously active value is looked up again with
|
|
904
|
+
* `compareWith`. Gone from a plain list means no highlight; in a virtual
|
|
905
|
+
* window a value that merely scrolled out keeps its absolute index. The result is clamped to the new
|
|
906
|
+
* item space, so the next arrow press never starts from a ghost index.
|
|
907
|
+
*/
|
|
908
|
+
private readonly activeIndexState;
|
|
731
909
|
/** Current active index. `-1` when no item is highlighted. */
|
|
732
910
|
readonly activeIndex: _angular_core.Signal<number>;
|
|
733
911
|
/**
|
|
@@ -788,7 +966,7 @@ declare class CngxActiveDescendant {
|
|
|
788
966
|
* First/last navigable absolute index. Spans the full virtual range - End
|
|
789
967
|
* targets `totalCount - 1` even when that item is not rendered (it surfaces
|
|
790
968
|
* as `pendingHighlight`); unrendered items count as enabled because their
|
|
791
|
-
* disabled state is unknowable.
|
|
969
|
+
* disabled state is unknowable (`isDisabledAt` resolves them to `false`).
|
|
792
970
|
*/
|
|
793
971
|
private findBoundary;
|
|
794
972
|
private totalCount;
|
|
@@ -800,7 +978,7 @@ declare class CngxActiveDescendant {
|
|
|
800
978
|
private isRendered;
|
|
801
979
|
private scrollActiveIntoView;
|
|
802
980
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxActiveDescendant, never>;
|
|
803
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxActiveDescendant, "[cngxActiveDescendant]", ["cngxActiveDescendant"], { "items": { "alias": "items"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "typeaheadDebounce": { "alias": "typeaheadDebounce"; "required": false; "isSignal": true; }; "autoHighlightFirst": { "alias": "autoHighlightFirst"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "virtualCount": { "alias": "virtualCount"; "required": false; "isSignal": true; }; "windowStart": { "alias": "windowStart"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "highlighted": "highlighted"; }, ["registered"], never, true, never>;
|
|
981
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxActiveDescendant, "[cngxActiveDescendant]", ["cngxActiveDescendant"], { "items": { "alias": "items"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; "typeahead": { "alias": "typeahead"; "required": false; "isSignal": true; }; "typeaheadDebounce": { "alias": "typeaheadDebounce"; "required": false; "isSignal": true; }; "autoHighlightFirst": { "alias": "autoHighlightFirst"; "required": false; "isSignal": true; }; "skipDisabled": { "alias": "skipDisabled"; "required": false; "isSignal": true; }; "virtualCount": { "alias": "virtualCount"; "required": false; "isSignal": true; }; "windowStart": { "alias": "windowStart"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; }, { "activated": "activated"; "highlighted": "highlighted"; "typeaheadMissed": "typeaheadMissed"; }, ["registered"], never, true, never>;
|
|
804
982
|
}
|
|
805
983
|
|
|
806
984
|
/**
|
|
@@ -829,7 +1007,6 @@ declare class CngxActiveDescendant {
|
|
|
829
1007
|
* ```
|
|
830
1008
|
*
|
|
831
1009
|
* @category common/a11y
|
|
832
|
-
* @docsKind primary
|
|
833
1010
|
* @wcag AA
|
|
834
1011
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/a11y/motion/reduced-motion.directive.ts
|
|
835
1012
|
* @since 0.1.0
|
|
@@ -844,5 +1021,5 @@ declare class CngxReducedMotion {
|
|
|
844
1021
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxReducedMotion, "[cngxReducedMotion]", ["cngxReducedMotion"], {}, {}, never, never, true, never>;
|
|
845
1022
|
}
|
|
846
1023
|
|
|
847
|
-
export { CNGX_AD_ITEM, CNGX_FOCUSABLE_SELECTOR, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveAnnouncer, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex };
|
|
848
|
-
export type { ActiveDescendantItem, CngxAdItemHandle };
|
|
1024
|
+
export { CNGX_AD_ITEM, CNGX_FOCUSABLE_SELECTOR, CNGX_FOCUS_TRAP_DRIVER, CngxActiveDescendant, CngxAriaExpanded, CngxAutofocus, CngxFocusRestore, CngxFocusTrap, CngxFocusVisible, CngxLiveAnnouncer, CngxLiveRegion, CngxReducedMotion, CngxRovingItem, CngxRovingTabindex, injectScopedLiveRegion };
|
|
1025
|
+
export type { ActiveDescendantItem, AriaLivePoliteness, CngxAdItemHandle, CngxFocusTrapDriver, CngxPendingAnnouncement, CngxScopedLiveRegion };
|