@angular/cdk 19.1.0-next.3 → 19.1.0
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/LICENSE +1 -1
- package/a11y/index.d.ts +3 -4
- package/drag-drop/index.d.ts +0 -4
- package/fesm2022/a11y.mjs +81 -82
- package/fesm2022/a11y.mjs.map +1 -1
- package/fesm2022/accordion.mjs +10 -10
- package/fesm2022/accordion.mjs.map +1 -1
- package/fesm2022/bidi.mjs +10 -10
- package/fesm2022/bidi.mjs.map +1 -1
- package/fesm2022/cdk.mjs +1 -1
- package/fesm2022/cdk.mjs.map +1 -1
- package/fesm2022/clipboard.mjs +10 -10
- package/fesm2022/clipboard.mjs.map +1 -1
- package/fesm2022/collections.mjs +3 -3
- package/fesm2022/collections.mjs.map +1 -1
- package/fesm2022/dialog.mjs +10 -10
- package/fesm2022/dialog.mjs.map +1 -1
- package/fesm2022/drag-drop.mjs +93 -86
- package/fesm2022/drag-drop.mjs.map +1 -1
- package/fesm2022/layout.mjs +10 -10
- package/fesm2022/layout.mjs.map +1 -1
- package/fesm2022/listbox.mjs +10 -10
- package/fesm2022/listbox.mjs.map +1 -1
- package/fesm2022/menu.mjs +78 -52
- package/fesm2022/menu.mjs.map +1 -1
- package/fesm2022/observers/private.mjs +3 -3
- package/fesm2022/observers/private.mjs.map +1 -1
- package/fesm2022/observers.mjs +13 -13
- package/fesm2022/observers.mjs.map +1 -1
- package/fesm2022/overlay.mjs +58 -51
- package/fesm2022/overlay.mjs.map +1 -1
- package/fesm2022/platform.mjs +7 -7
- package/fesm2022/platform.mjs.map +1 -1
- package/fesm2022/portal.mjs +16 -16
- package/fesm2022/portal.mjs.map +1 -1
- package/fesm2022/private.mjs +6 -6
- package/fesm2022/private.mjs.map +1 -1
- package/fesm2022/scrolling.mjs +36 -35
- package/fesm2022/scrolling.mjs.map +1 -1
- package/fesm2022/stepper.mjs +22 -22
- package/fesm2022/stepper.mjs.map +1 -1
- package/fesm2022/table.mjs +226 -182
- package/fesm2022/table.mjs.map +1 -1
- package/fesm2022/text-field.mjs +33 -29
- package/fesm2022/text-field.mjs.map +1 -1
- package/fesm2022/tree.mjs +47 -29
- package/fesm2022/tree.mjs.map +1 -1
- package/menu/index.d.ts +7 -1
- package/overlay/index.d.ts +1 -2
- package/package.json +3 -3
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/table/index.d.ts +12 -1
- package/text-field/index.d.ts +0 -1
- package/tree/index.d.ts +2 -0
package/LICENSE
CHANGED
package/a11y/index.d.ts
CHANGED
|
@@ -318,8 +318,6 @@ export declare class FocusKeyManager<T> extends ListKeyManager<FocusableOption &
|
|
|
318
318
|
export declare class FocusMonitor implements OnDestroy {
|
|
319
319
|
private _ngZone;
|
|
320
320
|
private _platform;
|
|
321
|
-
private _renderer;
|
|
322
|
-
private _cleanupWindowFocus;
|
|
323
321
|
private readonly _inputModalityDetector;
|
|
324
322
|
/** The focus origin that the next focus event is a result of. */
|
|
325
323
|
private _origin;
|
|
@@ -346,7 +344,7 @@ export declare class FocusMonitor implements OnDestroy {
|
|
|
346
344
|
* handlers differently from the rest of the events, because the browser won't emit events
|
|
347
345
|
* to the document when focus moves inside of a shadow root.
|
|
348
346
|
*/
|
|
349
|
-
private
|
|
347
|
+
private _rootNodeFocusListenerCount;
|
|
350
348
|
/**
|
|
351
349
|
* The specified detection mode, used for attributing the origin of a focus
|
|
352
350
|
* event.
|
|
@@ -410,6 +408,8 @@ export declare class FocusMonitor implements OnDestroy {
|
|
|
410
408
|
ngOnDestroy(): void;
|
|
411
409
|
/** Access injected document if available or fallback to global document reference */
|
|
412
410
|
private _getDocument;
|
|
411
|
+
/** Use defaultView of injected document if available or fallback to global window reference */
|
|
412
|
+
private _getWindow;
|
|
413
413
|
private _getFocusOrigin;
|
|
414
414
|
/**
|
|
415
415
|
* Returns whether the focus event should be attributed to touch. Recall that in IMMEDIATE mode, a
|
|
@@ -788,7 +788,6 @@ export declare type InputModality = 'keyboard' | 'mouse' | 'touch' | null;
|
|
|
788
788
|
*/
|
|
789
789
|
export declare class InputModalityDetector implements OnDestroy {
|
|
790
790
|
private readonly _platform;
|
|
791
|
-
private readonly _listenerCleanups;
|
|
792
791
|
/** Emits whenever an input modality is detected. */
|
|
793
792
|
readonly modalityDetected: Observable<InputModality>;
|
|
794
793
|
/** Emits when the input modality changes. */
|
package/drag-drop/index.d.ts
CHANGED
|
@@ -582,8 +582,6 @@ export declare class DragDropRegistry<_ = unknown, __ = unknown> implements OnDe
|
|
|
582
582
|
private _ngZone;
|
|
583
583
|
private _document;
|
|
584
584
|
private _styleLoader;
|
|
585
|
-
private _renderer;
|
|
586
|
-
private _cleanupDocumentTouchmove;
|
|
587
585
|
/** Registered drop container instances. */
|
|
588
586
|
private _dropInstances;
|
|
589
587
|
/** Registered drag item instances. */
|
|
@@ -701,8 +699,6 @@ export declare class DragRef<T = any> {
|
|
|
701
699
|
private _viewportRuler;
|
|
702
700
|
private _dragDropRegistry;
|
|
703
701
|
private _renderer;
|
|
704
|
-
private _rootElementCleanups;
|
|
705
|
-
private _cleanupShadowRootSelectStart;
|
|
706
702
|
/** Element displayed next to the user's pointer while the element is dragged. */
|
|
707
703
|
private _preview;
|
|
708
704
|
/** Container into which to insert the preview. */
|
package/fesm2022/a11y.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, APP_ID, Injectable, signal, QueryList, isSignal, effect, InjectionToken, afterNextRender, NgZone, Injector, ElementRef, booleanAttribute, Directive, Input,
|
|
4
|
-
import { Platform, _getFocusedElementPierceShadowDom,
|
|
3
|
+
import { inject, APP_ID, Injectable, signal, QueryList, isSignal, effect, InjectionToken, afterNextRender, NgZone, Injector, ElementRef, booleanAttribute, Directive, Input, EventEmitter, Output, NgModule } from '@angular/core';
|
|
4
|
+
import { Platform, _getFocusedElementPierceShadowDom, normalizePassiveListenerOptions, _getEventTarget, _getShadowRoot } from '@angular/cdk/platform';
|
|
5
5
|
import { _CdkPrivateStyleLoader, _VisuallyHiddenLoader } from '@angular/cdk/private';
|
|
6
6
|
import { A, Z, ZERO, NINE, hasModifierKey, PAGE_DOWN, PAGE_UP, END, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB, ALT, CONTROL, MAC_META, META, SHIFT } from '@angular/cdk/keycodes';
|
|
7
7
|
import { Subject, Subscription, isObservable, of, BehaviorSubject } from 'rxjs';
|
|
@@ -244,10 +244,10 @@ class AriaDescriber {
|
|
|
244
244
|
_isElementNode(element) {
|
|
245
245
|
return element.nodeType === this._document.ELEMENT_NODE;
|
|
246
246
|
}
|
|
247
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
248
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
247
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: AriaDescriber, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
248
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: AriaDescriber, providedIn: 'root' });
|
|
249
249
|
}
|
|
250
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: AriaDescriber, decorators: [{
|
|
251
251
|
type: Injectable,
|
|
252
252
|
args: [{ providedIn: 'root' }]
|
|
253
253
|
}], ctorParameters: () => [] });
|
|
@@ -1276,10 +1276,10 @@ class InteractivityChecker {
|
|
|
1276
1276
|
!this.isDisabled(element) &&
|
|
1277
1277
|
(config?.ignoreVisibility || this.isVisible(element)));
|
|
1278
1278
|
}
|
|
1279
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1280
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
1279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: InteractivityChecker, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1280
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: InteractivityChecker, providedIn: 'root' });
|
|
1281
1281
|
}
|
|
1282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1282
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: InteractivityChecker, decorators: [{
|
|
1283
1283
|
type: Injectable,
|
|
1284
1284
|
args: [{ providedIn: 'root' }]
|
|
1285
1285
|
}], ctorParameters: () => [] });
|
|
@@ -1678,10 +1678,10 @@ class FocusTrapFactory {
|
|
|
1678
1678
|
create(element, deferCaptureElements = false) {
|
|
1679
1679
|
return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements, this._injector);
|
|
1680
1680
|
}
|
|
1681
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1682
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
1681
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusTrapFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1682
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusTrapFactory, providedIn: 'root' });
|
|
1683
1683
|
}
|
|
1684
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusTrapFactory, decorators: [{
|
|
1685
1685
|
type: Injectable,
|
|
1686
1686
|
args: [{ providedIn: 'root' }]
|
|
1687
1687
|
}], ctorParameters: () => [] });
|
|
@@ -1746,10 +1746,10 @@ class CdkTrapFocus {
|
|
|
1746
1746
|
this._previouslyFocusedElement = _getFocusedElementPierceShadowDom();
|
|
1747
1747
|
this.focusTrap?.focusInitialElementWhenReady();
|
|
1748
1748
|
}
|
|
1749
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1750
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.1.0-
|
|
1749
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: CdkTrapFocus, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1750
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.1.0-rc.0", type: CdkTrapFocus, isStandalone: true, selector: "[cdkTrapFocus]", inputs: { enabled: ["cdkTrapFocus", "enabled", booleanAttribute], autoCapture: ["cdkTrapFocusAutoCapture", "autoCapture", booleanAttribute] }, exportAs: ["cdkTrapFocus"], usesOnChanges: true, ngImport: i0 });
|
|
1751
1751
|
}
|
|
1752
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: CdkTrapFocus, decorators: [{
|
|
1753
1753
|
type: Directive,
|
|
1754
1754
|
args: [{
|
|
1755
1755
|
selector: '[cdkTrapFocus]',
|
|
@@ -1897,10 +1897,10 @@ class FocusTrapManager {
|
|
|
1897
1897
|
}
|
|
1898
1898
|
}
|
|
1899
1899
|
}
|
|
1900
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1901
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
1900
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusTrapManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1901
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusTrapManager, providedIn: 'root' });
|
|
1902
1902
|
}
|
|
1903
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1903
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusTrapManager, decorators: [{
|
|
1904
1904
|
type: Injectable,
|
|
1905
1905
|
args: [{ providedIn: 'root' }]
|
|
1906
1906
|
}] });
|
|
@@ -1928,10 +1928,10 @@ class ConfigurableFocusTrapFactory {
|
|
|
1928
1928
|
}
|
|
1929
1929
|
return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject, this._injector);
|
|
1930
1930
|
}
|
|
1931
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
1932
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
1931
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: ConfigurableFocusTrapFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1932
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: ConfigurableFocusTrapFactory, providedIn: 'root' });
|
|
1933
1933
|
}
|
|
1934
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
1934
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: ConfigurableFocusTrapFactory, decorators: [{
|
|
1935
1935
|
type: Injectable,
|
|
1936
1936
|
args: [{ providedIn: 'root' }]
|
|
1937
1937
|
}], ctorParameters: () => [] });
|
|
@@ -1994,10 +1994,10 @@ const TOUCH_BUFFER_MS = 650;
|
|
|
1994
1994
|
* Event listener options that enable capturing and also mark the listener as passive if the browser
|
|
1995
1995
|
* supports it.
|
|
1996
1996
|
*/
|
|
1997
|
-
const modalityEventListenerOptions = {
|
|
1997
|
+
const modalityEventListenerOptions = normalizePassiveListenerOptions({
|
|
1998
1998
|
passive: true,
|
|
1999
1999
|
capture: true,
|
|
2000
|
-
};
|
|
2000
|
+
});
|
|
2001
2001
|
/**
|
|
2002
2002
|
* Service that detects the user's input modality.
|
|
2003
2003
|
*
|
|
@@ -2014,7 +2014,6 @@ const modalityEventListenerOptions = {
|
|
|
2014
2014
|
*/
|
|
2015
2015
|
class InputModalityDetector {
|
|
2016
2016
|
_platform = inject(Platform);
|
|
2017
|
-
_listenerCleanups;
|
|
2018
2017
|
/** Emits whenever an input modality is detected. */
|
|
2019
2018
|
modalityDetected;
|
|
2020
2019
|
/** Emits when the input modality changes. */
|
|
@@ -2097,24 +2096,25 @@ class InputModalityDetector {
|
|
|
2097
2096
|
// If we're not in a browser, this service should do nothing, as there's no relevant input
|
|
2098
2097
|
// modality to detect.
|
|
2099
2098
|
if (this._platform.isBrowser) {
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
_bindEventWithOptions(renderer, document, 'mousedown', this._onMousedown, modalityEventListenerOptions),
|
|
2105
|
-
_bindEventWithOptions(renderer, document, 'touchstart', this._onTouchstart, modalityEventListenerOptions),
|
|
2106
|
-
];
|
|
2099
|
+
ngZone.runOutsideAngular(() => {
|
|
2100
|
+
document.addEventListener('keydown', this._onKeydown, modalityEventListenerOptions);
|
|
2101
|
+
document.addEventListener('mousedown', this._onMousedown, modalityEventListenerOptions);
|
|
2102
|
+
document.addEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions);
|
|
2107
2103
|
});
|
|
2108
2104
|
}
|
|
2109
2105
|
}
|
|
2110
2106
|
ngOnDestroy() {
|
|
2111
2107
|
this._modality.complete();
|
|
2112
|
-
this.
|
|
2108
|
+
if (this._platform.isBrowser) {
|
|
2109
|
+
document.removeEventListener('keydown', this._onKeydown, modalityEventListenerOptions);
|
|
2110
|
+
document.removeEventListener('mousedown', this._onMousedown, modalityEventListenerOptions);
|
|
2111
|
+
document.removeEventListener('touchstart', this._onTouchstart, modalityEventListenerOptions);
|
|
2112
|
+
}
|
|
2113
2113
|
}
|
|
2114
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2115
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
2114
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: InputModalityDetector, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2115
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: InputModalityDetector, providedIn: 'root' });
|
|
2116
2116
|
}
|
|
2117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: InputModalityDetector, decorators: [{
|
|
2118
2118
|
type: Injectable,
|
|
2119
2119
|
args: [{ providedIn: 'root' }]
|
|
2120
2120
|
}], ctorParameters: () => [] });
|
|
@@ -2249,10 +2249,10 @@ class LiveAnnouncer {
|
|
|
2249
2249
|
}
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2253
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
2252
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: LiveAnnouncer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2253
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: LiveAnnouncer, providedIn: 'root' });
|
|
2254
2254
|
}
|
|
2255
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2255
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: LiveAnnouncer, decorators: [{
|
|
2256
2256
|
type: Injectable,
|
|
2257
2257
|
args: [{ providedIn: 'root' }]
|
|
2258
2258
|
}], ctorParameters: () => [] });
|
|
@@ -2305,10 +2305,10 @@ class CdkAriaLive {
|
|
|
2305
2305
|
this._subscription.unsubscribe();
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2309
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-
|
|
2308
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: CdkAriaLive, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2309
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-rc.0", type: CdkAriaLive, isStandalone: true, selector: "[cdkAriaLive]", inputs: { politeness: ["cdkAriaLive", "politeness"], duration: ["cdkAriaLiveDuration", "duration"] }, exportAs: ["cdkAriaLive"], ngImport: i0 });
|
|
2310
2310
|
}
|
|
2311
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2311
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: CdkAriaLive, decorators: [{
|
|
2312
2312
|
type: Directive,
|
|
2313
2313
|
args: [{
|
|
2314
2314
|
selector: '[cdkAriaLive]',
|
|
@@ -2343,16 +2343,14 @@ const FOCUS_MONITOR_DEFAULT_OPTIONS = new InjectionToken('cdk-focus-monitor-defa
|
|
|
2343
2343
|
* Event listener options that enable capturing and also
|
|
2344
2344
|
* mark the listener as passive if the browser supports it.
|
|
2345
2345
|
*/
|
|
2346
|
-
const captureEventListenerOptions = {
|
|
2346
|
+
const captureEventListenerOptions = normalizePassiveListenerOptions({
|
|
2347
2347
|
passive: true,
|
|
2348
2348
|
capture: true,
|
|
2349
|
-
};
|
|
2349
|
+
});
|
|
2350
2350
|
/** Monitors mouse and keyboard events to determine the cause of focus events. */
|
|
2351
2351
|
class FocusMonitor {
|
|
2352
2352
|
_ngZone = inject(NgZone);
|
|
2353
2353
|
_platform = inject(Platform);
|
|
2354
|
-
_renderer = inject(RendererFactory2).createRenderer(null, null);
|
|
2355
|
-
_cleanupWindowFocus;
|
|
2356
2354
|
_inputModalityDetector = inject(InputModalityDetector);
|
|
2357
2355
|
/** The focus origin that the next focus event is a result of. */
|
|
2358
2356
|
_origin = null;
|
|
@@ -2379,7 +2377,7 @@ class FocusMonitor {
|
|
|
2379
2377
|
* handlers differently from the rest of the events, because the browser won't emit events
|
|
2380
2378
|
* to the document when focus moves inside of a shadow root.
|
|
2381
2379
|
*/
|
|
2382
|
-
|
|
2380
|
+
_rootNodeFocusListenerCount = new Map();
|
|
2383
2381
|
/**
|
|
2384
2382
|
* The specified detection mode, used for attributing the origin of a focus
|
|
2385
2383
|
* event.
|
|
@@ -2487,6 +2485,11 @@ class FocusMonitor {
|
|
|
2487
2485
|
_getDocument() {
|
|
2488
2486
|
return this._document || document;
|
|
2489
2487
|
}
|
|
2488
|
+
/** Use defaultView of injected document if available or fallback to global window reference */
|
|
2489
|
+
_getWindow() {
|
|
2490
|
+
const doc = this._getDocument();
|
|
2491
|
+
return doc.defaultView || window;
|
|
2492
|
+
}
|
|
2490
2493
|
_getFocusOrigin(focusEventTarget) {
|
|
2491
2494
|
if (this._origin) {
|
|
2492
2495
|
// If the origin was realized via a touch interaction, we need to perform additional checks
|
|
@@ -2623,28 +2626,21 @@ class FocusMonitor {
|
|
|
2623
2626
|
return;
|
|
2624
2627
|
}
|
|
2625
2628
|
const rootNode = elementInfo.rootNode;
|
|
2626
|
-
const
|
|
2627
|
-
if (
|
|
2628
|
-
listeners.count++;
|
|
2629
|
-
}
|
|
2630
|
-
else {
|
|
2629
|
+
const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode) || 0;
|
|
2630
|
+
if (!rootNodeFocusListeners) {
|
|
2631
2631
|
this._ngZone.runOutsideAngular(() => {
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
cleanups: [
|
|
2635
|
-
_bindEventWithOptions(this._renderer, rootNode, 'focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions),
|
|
2636
|
-
_bindEventWithOptions(this._renderer, rootNode, 'blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions),
|
|
2637
|
-
],
|
|
2638
|
-
});
|
|
2632
|
+
rootNode.addEventListener('focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
|
|
2633
|
+
rootNode.addEventListener('blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
|
|
2639
2634
|
});
|
|
2640
2635
|
}
|
|
2636
|
+
this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners + 1);
|
|
2641
2637
|
// Register global listeners when first element is monitored.
|
|
2642
2638
|
if (++this._monitoredElementCount === 1) {
|
|
2643
2639
|
// Note: we listen to events in the capture phase so we
|
|
2644
2640
|
// can detect them even if the user stops propagation.
|
|
2645
2641
|
this._ngZone.runOutsideAngular(() => {
|
|
2646
|
-
this.
|
|
2647
|
-
|
|
2642
|
+
const window = this._getWindow();
|
|
2643
|
+
window.addEventListener('focus', this._windowFocusListener);
|
|
2648
2644
|
});
|
|
2649
2645
|
// The InputModalityDetector is also just a collection of global listeners.
|
|
2650
2646
|
this._inputModalityDetector.modalityDetected
|
|
@@ -2655,19 +2651,22 @@ class FocusMonitor {
|
|
|
2655
2651
|
}
|
|
2656
2652
|
}
|
|
2657
2653
|
_removeGlobalListeners(elementInfo) {
|
|
2658
|
-
const
|
|
2659
|
-
if (
|
|
2660
|
-
|
|
2661
|
-
|
|
2654
|
+
const rootNode = elementInfo.rootNode;
|
|
2655
|
+
if (this._rootNodeFocusListenerCount.has(rootNode)) {
|
|
2656
|
+
const rootNodeFocusListeners = this._rootNodeFocusListenerCount.get(rootNode);
|
|
2657
|
+
if (rootNodeFocusListeners > 1) {
|
|
2658
|
+
this._rootNodeFocusListenerCount.set(rootNode, rootNodeFocusListeners - 1);
|
|
2662
2659
|
}
|
|
2663
2660
|
else {
|
|
2664
|
-
|
|
2665
|
-
|
|
2661
|
+
rootNode.removeEventListener('focus', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
|
|
2662
|
+
rootNode.removeEventListener('blur', this._rootNodeFocusAndBlurListener, captureEventListenerOptions);
|
|
2663
|
+
this._rootNodeFocusListenerCount.delete(rootNode);
|
|
2666
2664
|
}
|
|
2667
2665
|
}
|
|
2668
2666
|
// Unregister global listeners when last element is unmonitored.
|
|
2669
2667
|
if (!--this._monitoredElementCount) {
|
|
2670
|
-
this.
|
|
2668
|
+
const window = this._getWindow();
|
|
2669
|
+
window.removeEventListener('focus', this._windowFocusListener);
|
|
2671
2670
|
// Equivalently, stop our InputModalityDetector subscription.
|
|
2672
2671
|
this._stopInputModalityDetector.next();
|
|
2673
2672
|
// Clear timeouts for all potentially pending timeouts to prevent the leaks.
|
|
@@ -2722,10 +2721,10 @@ class FocusMonitor {
|
|
|
2722
2721
|
}
|
|
2723
2722
|
return false;
|
|
2724
2723
|
}
|
|
2725
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2726
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
2724
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusMonitor, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2725
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusMonitor, providedIn: 'root' });
|
|
2727
2726
|
}
|
|
2728
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2727
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: FocusMonitor, decorators: [{
|
|
2729
2728
|
type: Injectable,
|
|
2730
2729
|
args: [{ providedIn: 'root' }]
|
|
2731
2730
|
}], ctorParameters: () => [] });
|
|
@@ -2763,10 +2762,10 @@ class CdkMonitorFocus {
|
|
|
2763
2762
|
this._monitorSubscription.unsubscribe();
|
|
2764
2763
|
}
|
|
2765
2764
|
}
|
|
2766
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2767
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-
|
|
2765
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: CdkMonitorFocus, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2766
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.0-rc.0", type: CdkMonitorFocus, isStandalone: true, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: { cdkFocusChange: "cdkFocusChange" }, exportAs: ["cdkMonitorFocus"], ngImport: i0 });
|
|
2768
2767
|
}
|
|
2769
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2768
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: CdkMonitorFocus, decorators: [{
|
|
2770
2769
|
type: Directive,
|
|
2771
2770
|
args: [{
|
|
2772
2771
|
selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',
|
|
@@ -2874,10 +2873,10 @@ class HighContrastModeDetector {
|
|
|
2874
2873
|
}
|
|
2875
2874
|
}
|
|
2876
2875
|
}
|
|
2877
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2878
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
2876
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HighContrastModeDetector, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2877
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HighContrastModeDetector, providedIn: 'root' });
|
|
2879
2878
|
}
|
|
2880
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: HighContrastModeDetector, decorators: [{
|
|
2881
2880
|
type: Injectable,
|
|
2882
2881
|
args: [{ providedIn: 'root' }]
|
|
2883
2882
|
}], ctorParameters: () => [] });
|
|
@@ -2886,11 +2885,11 @@ class A11yModule {
|
|
|
2886
2885
|
constructor() {
|
|
2887
2886
|
inject(HighContrastModeDetector)._applyBodyHighContrastModeCssClasses();
|
|
2888
2887
|
}
|
|
2889
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2890
|
-
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-
|
|
2891
|
-
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-
|
|
2888
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: A11yModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2889
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.0-rc.0", ngImport: i0, type: A11yModule, imports: [ObserversModule, CdkAriaLive, CdkTrapFocus, CdkMonitorFocus], exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus] });
|
|
2890
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: A11yModule, imports: [ObserversModule] });
|
|
2892
2891
|
}
|
|
2893
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2892
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: A11yModule, decorators: [{
|
|
2894
2893
|
type: NgModule,
|
|
2895
2894
|
args: [{
|
|
2896
2895
|
imports: [ObserversModule, CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
|
|
@@ -2922,10 +2921,10 @@ class _IdGenerator {
|
|
|
2922
2921
|
}
|
|
2923
2922
|
return `${prefix}${counters[prefix]++}`;
|
|
2924
2923
|
}
|
|
2925
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-
|
|
2926
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-
|
|
2924
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: _IdGenerator, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2925
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: _IdGenerator, providedIn: 'root' });
|
|
2927
2926
|
}
|
|
2928
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-
|
|
2927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.0-rc.0", ngImport: i0, type: _IdGenerator, decorators: [{
|
|
2929
2928
|
type: Injectable,
|
|
2930
2929
|
args: [{ providedIn: 'root' }]
|
|
2931
2930
|
}] });
|