@angular/cdk 14.0.0-next.0 → 14.0.0-next.11
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/_index.scss +11 -0
- package/a11y/a11y-module.d.ts +2 -3
- package/a11y/aria-describer/aria-describer.d.ts +33 -6
- package/a11y/live-announcer/live-announcer.d.ts +5 -1
- package/a11y-prebuilt.css +1 -1
- package/drag-drop/drag-events.d.ts +8 -0
- package/drag-drop/drag-ref.d.ts +11 -1
- package/drag-drop/drop-list-ref.d.ts +5 -1
- package/drag-drop/parent-position-tracker.d.ts +11 -3
- package/esm2020/a11y/a11y-module.mjs +6 -7
- package/esm2020/a11y/aria-describer/aria-describer.mjs +75 -52
- package/esm2020/a11y/focus-monitor/focus-monitor.mjs +13 -11
- package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
- package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
- package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +7 -12
- package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
- package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
- package/esm2020/a11y/live-announcer/live-announcer.mjs +26 -18
- package/esm2020/accordion/accordion-item.mjs +4 -4
- package/esm2020/accordion/accordion-module.mjs +5 -5
- package/esm2020/accordion/accordion.mjs +4 -4
- package/esm2020/bidi/bidi-module.mjs +5 -5
- package/esm2020/bidi/dir.mjs +4 -4
- package/esm2020/bidi/directionality.mjs +4 -4
- package/esm2020/clipboard/clipboard-module.mjs +5 -5
- package/esm2020/clipboard/clipboard.mjs +4 -4
- package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
- package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
- package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
- package/esm2020/drag-drop/directives/drag.mjs +26 -24
- package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
- package/esm2020/drag-drop/directives/drop-list.mjs +14 -13
- package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
- package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
- package/esm2020/drag-drop/drag-drop.mjs +4 -4
- package/esm2020/drag-drop/drag-events.mjs +1 -1
- package/esm2020/drag-drop/drag-ref.mjs +48 -24
- package/esm2020/drag-drop/drop-list-ref.mjs +7 -3
- package/esm2020/drag-drop/parent-position-tracker.mjs +13 -5
- package/esm2020/layout/breakpoints-observer.mjs +4 -4
- package/esm2020/layout/layout-module.mjs +5 -5
- package/esm2020/layout/media-matcher.mjs +4 -4
- package/esm2020/observers/observe-content.mjs +14 -14
- package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
- package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +26 -8
- package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +33 -12
- package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-container.mjs +4 -4
- package/esm2020/overlay/overlay-directives.mjs +7 -7
- package/esm2020/overlay/overlay-module.mjs +5 -5
- package/esm2020/overlay/overlay-ref.mjs +24 -18
- package/esm2020/overlay/overlay.mjs +14 -8
- package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +21 -3
- package/esm2020/overlay/position/global-position-strategy.mjs +64 -30
- package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
- package/esm2020/overlay/public-api.mjs +2 -2
- package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
- package/esm2020/platform/platform-module.mjs +5 -5
- package/esm2020/platform/platform.mjs +4 -4
- package/esm2020/portal/dom-portal-outlet.mjs +29 -5
- package/esm2020/portal/portal-directives.mjs +20 -18
- package/esm2020/portal/portal.mjs +12 -3
- package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
- package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
- package/esm2020/scrolling/scrollable.mjs +4 -4
- package/esm2020/scrolling/scrolling-module.mjs +10 -11
- package/esm2020/scrolling/viewport-ruler.mjs +4 -4
- package/esm2020/scrolling/virtual-for-of.mjs +7 -5
- package/esm2020/scrolling/virtual-scroll-viewport.mjs +8 -6
- package/esm2020/stepper/step-header.mjs +4 -4
- package/esm2020/stepper/step-label.mjs +4 -4
- package/esm2020/stepper/stepper-button.mjs +7 -7
- package/esm2020/stepper/stepper-module.mjs +5 -5
- package/esm2020/stepper/stepper.mjs +9 -22
- package/esm2020/table/cell.mjs +22 -22
- package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
- package/esm2020/table/row.mjs +28 -28
- package/esm2020/table/table-module.mjs +5 -5
- package/esm2020/table/table.mjs +21 -21
- package/esm2020/table/text-column.mjs +4 -4
- package/esm2020/testing/component-harness.mjs +7 -1
- package/esm2020/testing/harness-environment.mjs +12 -1
- package/esm2020/testing/public-api.mjs +2 -1
- package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +8 -3
- package/esm2020/testing/test-element-errors.mjs +15 -0
- package/esm2020/testing/test-element.mjs +1 -1
- package/esm2020/testing/testbed/fake-events/type-in-element.mjs +13 -4
- package/esm2020/testing/testbed/unit-test-element.mjs +21 -5
- package/esm2020/text-field/autofill.mjs +7 -7
- package/esm2020/text-field/autosize.mjs +4 -4
- package/esm2020/text-field/text-field-module.mjs +5 -7
- package/esm2020/tree/nested-node.mjs +4 -4
- package/esm2020/tree/node.mjs +4 -4
- package/esm2020/tree/outlet.mjs +4 -4
- package/esm2020/tree/padding.mjs +4 -4
- package/esm2020/tree/toggle.mjs +4 -4
- package/esm2020/tree/tree-module.mjs +5 -5
- package/esm2020/tree/tree.mjs +7 -7
- package/esm2020/version.mjs +1 -1
- package/fesm2015/a11y.mjs +146 -118
- package/fesm2015/a11y.mjs.map +1 -1
- package/fesm2015/accordion.mjs +10 -10
- package/fesm2015/accordion.mjs.map +1 -1
- package/fesm2015/bidi.mjs +10 -10
- package/fesm2015/bidi.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/clipboard.mjs +10 -10
- package/fesm2015/clipboard.mjs.map +1 -1
- package/fesm2015/coercion.mjs.map +1 -1
- package/fesm2015/collections.mjs +3 -3
- package/fesm2015/collections.mjs.map +1 -1
- package/fesm2015/drag-drop.mjs +126 -86
- package/fesm2015/drag-drop.mjs.map +1 -1
- package/fesm2015/keycodes.mjs.map +1 -1
- package/fesm2015/layout.mjs +10 -10
- package/fesm2015/layout.mjs.map +1 -1
- package/fesm2015/observers.mjs +13 -13
- package/fesm2015/observers.mjs.map +1 -1
- package/fesm2015/overlay.mjs +202 -99
- package/fesm2015/overlay.mjs.map +1 -1
- package/fesm2015/platform.mjs +7 -7
- package/fesm2015/platform.mjs.map +1 -1
- package/fesm2015/portal.mjs +58 -24
- package/fesm2015/portal.mjs.map +1 -1
- package/fesm2015/scrolling.mjs +35 -31
- package/fesm2015/scrolling.mjs.map +1 -1
- package/fesm2015/stepper.mjs +24 -37
- package/fesm2015/stepper.mjs.map +1 -1
- package/fesm2015/table.mjs +78 -78
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2015/testing/selenium-webdriver.mjs +7 -2
- package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2015/testing/testbed.mjs +32 -8
- package/fesm2015/testing/testbed.mjs.map +1 -1
- package/fesm2015/testing.mjs +39 -1
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/text-field.mjs +14 -15
- package/fesm2015/text-field.mjs.map +1 -1
- package/fesm2015/tree.mjs +25 -25
- package/fesm2015/tree.mjs.map +1 -1
- package/fesm2020/a11y.mjs +142 -116
- package/fesm2020/a11y.mjs.map +1 -1
- package/fesm2020/accordion.mjs +10 -10
- package/fesm2020/accordion.mjs.map +1 -1
- package/fesm2020/bidi.mjs +10 -10
- package/fesm2020/bidi.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/clipboard.mjs +10 -10
- package/fesm2020/clipboard.mjs.map +1 -1
- package/fesm2020/coercion.mjs.map +1 -1
- package/fesm2020/collections.mjs +3 -3
- package/fesm2020/collections.mjs.map +1 -1
- package/fesm2020/drag-drop.mjs +125 -86
- package/fesm2020/drag-drop.mjs.map +1 -1
- package/fesm2020/keycodes.mjs.map +1 -1
- package/fesm2020/layout.mjs +10 -10
- package/fesm2020/layout.mjs.map +1 -1
- package/fesm2020/observers.mjs +13 -13
- package/fesm2020/observers.mjs.map +1 -1
- package/fesm2020/overlay.mjs +202 -99
- package/fesm2020/overlay.mjs.map +1 -1
- package/fesm2020/platform.mjs +7 -7
- package/fesm2020/platform.mjs.map +1 -1
- package/fesm2020/portal.mjs +58 -24
- package/fesm2020/portal.mjs.map +1 -1
- package/fesm2020/scrolling.mjs +35 -31
- package/fesm2020/scrolling.mjs.map +1 -1
- package/fesm2020/stepper.mjs +24 -37
- package/fesm2020/stepper.mjs.map +1 -1
- package/fesm2020/table.mjs +78 -78
- package/fesm2020/table.mjs.map +1 -1
- package/fesm2020/testing/selenium-webdriver.mjs +7 -2
- package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2020/testing/testbed.mjs +32 -8
- package/fesm2020/testing/testbed.mjs.map +1 -1
- package/fesm2020/testing.mjs +33 -1
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/text-field.mjs +14 -15
- package/fesm2020/text-field.mjs.map +1 -1
- package/fesm2020/tree.mjs +25 -25
- package/fesm2020/tree.mjs.map +1 -1
- package/overlay/_index.scss +11 -1
- package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +7 -2
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +8 -2
- package/overlay/overlay-ref.d.ts +4 -1
- package/overlay/overlay.d.ts +3 -2
- package/overlay/position/flexible-connected-position-strategy.d.ts +2 -0
- package/overlay/position/global-position-strategy.d.ts +14 -3
- package/overlay/public-api.d.ts +1 -1
- package/overlay-prebuilt.css +1 -1
- package/package.json +3 -11
- package/portal/dom-portal-outlet.d.ts +17 -6
- package/portal/portal.d.ts +12 -2
- package/schematics/collection.json +2 -1
- package/schematics/index.js +6 -2
- package/schematics/index.mjs +6 -2
- package/schematics/migration.json +5 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-generate/drag-drop/index.js +5 -14
- package/schematics/ng-generate/drag-drop/index.mjs +5 -14
- package/schematics/ng-generate/drag-drop/schema.json +1 -1
- package/schematics/ng-update/data/constructor-checks.js +7 -1
- package/schematics/ng-update/data/constructor-checks.mjs +7 -1
- package/schematics/ng-update/data/index.js +6 -2
- package/schematics/ng-update/data/index.mjs +6 -2
- package/schematics/ng-update/devkit-migration-rule.js +5 -14
- package/schematics/ng-update/devkit-migration-rule.mjs +5 -14
- package/schematics/ng-update/devkit-migration.js +1 -1
- package/schematics/ng-update/devkit-migration.mjs +1 -1
- package/schematics/ng-update/html-parsing/elements.js +2 -3
- package/schematics/ng-update/html-parsing/elements.mjs +2 -3
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +7 -2
- package/schematics/ng-update/index.mjs +7 -2
- package/schematics/ng-update/migrations/symbol-removal.js +2 -3
- package/schematics/ng-update/migrations/symbol-removal.mjs +2 -3
- package/schematics/ng-update/public-api.js +6 -2
- package/schematics/ng-update/public-api.mjs +6 -2
- package/schematics/tsconfig.json +2 -10
- package/schematics/update-tool/public-api.js +6 -2
- package/schematics/update-tool/public-api.mjs +6 -2
- package/schematics/update-tool/target-version.d.ts +2 -1
- package/schematics/update-tool/target-version.js +2 -1
- package/schematics/update-tool/target-version.mjs +2 -1
- package/schematics/utils/ast.js +11 -22
- package/schematics/utils/ast.mjs +11 -22
- package/schematics/utils/build-component.js +10 -15
- package/schematics/utils/build-component.mjs +10 -15
- package/schematics/utils/get-project.d.ts +1 -1
- package/schematics/utils/get-project.js +7 -2
- package/schematics/utils/get-project.mjs +7 -2
- package/schematics/utils/html-manipulation.js +3 -1
- package/schematics/utils/html-manipulation.mjs +3 -1
- package/schematics/utils/index.js +6 -2
- package/schematics/utils/index.mjs +6 -2
- package/schematics/utils/project-index-file.js +2 -2
- package/schematics/utils/project-index-file.mjs +2 -2
- package/schematics/utils/project-targets.js +3 -4
- package/schematics/utils/project-targets.mjs +3 -4
- package/schematics/utils/project-tsconfig-paths.js +16 -28
- package/schematics/utils/project-tsconfig-paths.mjs +16 -28
- package/scrolling/scrolling-module.d.ts +1 -2
- package/stepper/stepper.d.ts +3 -12
- package/table/table.d.ts +2 -6
- package/table/text-column.d.ts +1 -1
- package/testing/component-harness.d.ts +18 -0
- package/testing/harness-environment.d.ts +2 -0
- package/testing/public-api.d.ts +1 -0
- package/testing/{protractor/index.d.ts → test-element-errors.d.ts} +5 -1
- package/testing/test-element.d.ts +4 -2
- package/testing/testbed/fake-events/type-in-element.d.ts +2 -2
- package/testing/testbed/unit-test-element.d.ts +4 -1
- package/text-field/text-field-module.d.ts +1 -2
- package/text-field-prebuilt.css +1 -1
- package/esm2020/testing/protractor/index.mjs +0 -9
- package/esm2020/testing/protractor/protractor-element.mjs +0 -234
- package/esm2020/testing/protractor/protractor-harness-environment.mjs +0 -72
- package/esm2020/testing/protractor/public-api.mjs +0 -10
- package/fesm2015/testing/protractor.mjs +0 -355
- package/fesm2015/testing/protractor.mjs.map +0 -1
- package/fesm2020/testing/protractor.mjs +0 -322
- package/fesm2020/testing/protractor.mjs.map +0 -1
- package/testing/protractor/package.json +0 -9
- package/testing/protractor/protractor-element.d.ts +0 -90
- package/testing/protractor/protractor-harness-environment.d.ts +0 -50
- package/testing/protractor/public-api.d.ts +0 -9
package/fesm2020/a11y.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
3
|
import { Injectable, Inject, QueryList, Directive, Input, InjectionToken, Optional, EventEmitter, Output, NgModule } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/cdk/platform';
|
|
5
|
+
import { _getFocusedElementPierceShadowDom, normalizePassiveListenerOptions, _getEventTarget, _getShadowRoot } from '@angular/cdk/platform';
|
|
4
6
|
import { Subject, Subscription, BehaviorSubject, of } from 'rxjs';
|
|
5
7
|
import { hasModifierKey, A, Z, ZERO, NINE, END, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB, ALT, CONTROL, MAC_META, META, SHIFT } from '@angular/cdk/keycodes';
|
|
6
8
|
import { tap, debounceTime, filter, map, take, skip, distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
|
7
9
|
import { coerceBooleanProperty, coerceElement } from '@angular/cdk/coercion';
|
|
8
|
-
import * as i1 from '@angular/cdk/platform';
|
|
9
|
-
import { _getFocusedElementPierceShadowDom, normalizePassiveListenerOptions, _getEventTarget, _getShadowRoot, PlatformModule } from '@angular/cdk/platform';
|
|
10
10
|
import * as i1$1 from '@angular/cdk/observers';
|
|
11
11
|
import { ObserversModule } from '@angular/cdk/observers';
|
|
12
12
|
|
|
@@ -61,25 +61,45 @@ function getAriaReferenceIds(el, attr) {
|
|
|
61
61
|
* Use of this source code is governed by an MIT-style license that can be
|
|
62
62
|
* found in the LICENSE file at https://angular.io/license
|
|
63
63
|
*/
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* ID used for the body container where all messages are appended.
|
|
66
|
+
* @deprecated No longer being used. To be removed.
|
|
67
|
+
* @breaking-change 14.0.0
|
|
68
|
+
*/
|
|
65
69
|
const MESSAGES_CONTAINER_ID = 'cdk-describedby-message-container';
|
|
66
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* ID prefix used for each created message element.
|
|
72
|
+
* @deprecated To be turned into a private variable.
|
|
73
|
+
* @breaking-change 14.0.0
|
|
74
|
+
*/
|
|
67
75
|
const CDK_DESCRIBEDBY_ID_PREFIX = 'cdk-describedby-message';
|
|
68
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* Attribute given to each host element that is described by a message element.
|
|
78
|
+
* @deprecated To be turned into a private variable.
|
|
79
|
+
* @breaking-change 14.0.0
|
|
80
|
+
*/
|
|
69
81
|
const CDK_DESCRIBEDBY_HOST_ATTRIBUTE = 'cdk-describedby-host';
|
|
70
82
|
/** Global incremental identifier for each registered message element. */
|
|
71
83
|
let nextId = 0;
|
|
72
|
-
/** Global map of all registered message elements that have been placed into the document. */
|
|
73
|
-
const messageRegistry = new Map();
|
|
74
|
-
/** Container for all registered messages. */
|
|
75
|
-
let messagesContainer = null;
|
|
76
84
|
/**
|
|
77
85
|
* Utility that creates visually hidden elements with a message content. Useful for elements that
|
|
78
86
|
* want to use aria-describedby to further describe themselves without adding additional visual
|
|
79
87
|
* content.
|
|
80
88
|
*/
|
|
81
89
|
class AriaDescriber {
|
|
82
|
-
constructor(_document
|
|
90
|
+
constructor(_document,
|
|
91
|
+
/**
|
|
92
|
+
* @deprecated To be turned into a required parameter.
|
|
93
|
+
* @breaking-change 14.0.0
|
|
94
|
+
*/
|
|
95
|
+
_platform) {
|
|
96
|
+
this._platform = _platform;
|
|
97
|
+
/** Map of all registered message elements that have been placed into the document. */
|
|
98
|
+
this._messageRegistry = new Map();
|
|
99
|
+
/** Container for all registered messages. */
|
|
100
|
+
this._messagesContainer = null;
|
|
101
|
+
/** Unique ID for the service. */
|
|
102
|
+
this._id = `${nextId++}`;
|
|
83
103
|
this._document = _document;
|
|
84
104
|
}
|
|
85
105
|
describe(hostElement, message, role) {
|
|
@@ -90,9 +110,9 @@ class AriaDescriber {
|
|
|
90
110
|
if (typeof message !== 'string') {
|
|
91
111
|
// We need to ensure that the element has an ID.
|
|
92
112
|
setMessageId(message);
|
|
93
|
-
|
|
113
|
+
this._messageRegistry.set(key, { messageElement: message, referenceCount: 0 });
|
|
94
114
|
}
|
|
95
|
-
else if (!
|
|
115
|
+
else if (!this._messageRegistry.has(key)) {
|
|
96
116
|
this._createMessageElement(message, role);
|
|
97
117
|
}
|
|
98
118
|
if (!this._isElementDescribedByMessage(hostElement, key)) {
|
|
@@ -110,26 +130,26 @@ class AriaDescriber {
|
|
|
110
130
|
// If the message is a string, it means that it's one that we created for the
|
|
111
131
|
// consumer so we can remove it safely, otherwise we should leave it in place.
|
|
112
132
|
if (typeof message === 'string') {
|
|
113
|
-
const registeredMessage =
|
|
133
|
+
const registeredMessage = this._messageRegistry.get(key);
|
|
114
134
|
if (registeredMessage && registeredMessage.referenceCount === 0) {
|
|
115
135
|
this._deleteMessageElement(key);
|
|
116
136
|
}
|
|
117
137
|
}
|
|
118
|
-
if (
|
|
119
|
-
this.
|
|
138
|
+
if (this._messagesContainer?.childNodes.length === 0) {
|
|
139
|
+
this._messagesContainer.remove();
|
|
140
|
+
this._messagesContainer = null;
|
|
120
141
|
}
|
|
121
142
|
}
|
|
122
143
|
/** Unregisters all created message elements and removes the message container. */
|
|
123
144
|
ngOnDestroy() {
|
|
124
|
-
const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}]`);
|
|
145
|
+
const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}="${this._id}"]`);
|
|
125
146
|
for (let i = 0; i < describedElements.length; i++) {
|
|
126
147
|
this._removeCdkDescribedByReferenceIds(describedElements[i]);
|
|
127
148
|
describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
|
|
128
149
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
messageRegistry.clear();
|
|
150
|
+
this._messagesContainer?.remove();
|
|
151
|
+
this._messagesContainer = null;
|
|
152
|
+
this._messageRegistry.clear();
|
|
133
153
|
}
|
|
134
154
|
/**
|
|
135
155
|
* Creates a new element in the visually hidden message container element with the message
|
|
@@ -143,43 +163,44 @@ class AriaDescriber {
|
|
|
143
163
|
messageElement.setAttribute('role', role);
|
|
144
164
|
}
|
|
145
165
|
this._createMessagesContainer();
|
|
146
|
-
|
|
147
|
-
|
|
166
|
+
this._messagesContainer.appendChild(messageElement);
|
|
167
|
+
this._messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 });
|
|
148
168
|
}
|
|
149
169
|
/** Deletes the message element from the global messages container. */
|
|
150
170
|
_deleteMessageElement(key) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
messageRegistry.delete(key);
|
|
171
|
+
this._messageRegistry.get(key)?.messageElement?.remove();
|
|
172
|
+
this._messageRegistry.delete(key);
|
|
154
173
|
}
|
|
155
174
|
/** Creates the global container for all aria-describedby messages. */
|
|
156
175
|
_createMessagesContainer() {
|
|
157
|
-
if (
|
|
158
|
-
|
|
176
|
+
if (this._messagesContainer) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const containerClassName = 'cdk-describedby-message-container';
|
|
180
|
+
const serverContainers = this._document.querySelectorAll(`.${containerClassName}[platform="server"]`);
|
|
181
|
+
for (let i = 0; i < serverContainers.length; i++) {
|
|
159
182
|
// When going from the server to the client, we may end up in a situation where there's
|
|
160
183
|
// already a container on the page, but we don't have a reference to it. Clear the
|
|
161
184
|
// old container so we don't get duplicates. Doing this, instead of emptying the previous
|
|
162
185
|
// container, should be slightly faster.
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
messagesContainer = null;
|
|
182
|
-
}
|
|
186
|
+
serverContainers[i].remove();
|
|
187
|
+
}
|
|
188
|
+
const messagesContainer = this._document.createElement('div');
|
|
189
|
+
// We add `visibility: hidden` in order to prevent text in this container from
|
|
190
|
+
// being searchable by the browser's Ctrl + F functionality.
|
|
191
|
+
// Screen-readers will still read the description for elements with aria-describedby even
|
|
192
|
+
// when the description element is not visible.
|
|
193
|
+
messagesContainer.style.visibility = 'hidden';
|
|
194
|
+
// Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that
|
|
195
|
+
// the description element doesn't impact page layout.
|
|
196
|
+
messagesContainer.classList.add(containerClassName);
|
|
197
|
+
messagesContainer.classList.add('cdk-visually-hidden');
|
|
198
|
+
// @breaking-change 14.0.0 Remove null check for `_platform`.
|
|
199
|
+
if (this._platform && !this._platform.isBrowser) {
|
|
200
|
+
messagesContainer.setAttribute('platform', 'server');
|
|
201
|
+
}
|
|
202
|
+
this._document.body.appendChild(messagesContainer);
|
|
203
|
+
this._messagesContainer = messagesContainer;
|
|
183
204
|
}
|
|
184
205
|
/** Removes all cdk-describedby messages that are hosted through the element. */
|
|
185
206
|
_removeCdkDescribedByReferenceIds(element) {
|
|
@@ -192,11 +213,11 @@ class AriaDescriber {
|
|
|
192
213
|
* message's reference count.
|
|
193
214
|
*/
|
|
194
215
|
_addMessageReference(element, key) {
|
|
195
|
-
const registeredMessage =
|
|
216
|
+
const registeredMessage = this._messageRegistry.get(key);
|
|
196
217
|
// Add the aria-describedby reference and set the
|
|
197
218
|
// describedby_host attribute to mark the element.
|
|
198
219
|
addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
|
|
199
|
-
element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE,
|
|
220
|
+
element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id);
|
|
200
221
|
registeredMessage.referenceCount++;
|
|
201
222
|
}
|
|
202
223
|
/**
|
|
@@ -204,7 +225,7 @@ class AriaDescriber {
|
|
|
204
225
|
* and decrements the registered message's reference count.
|
|
205
226
|
*/
|
|
206
227
|
_removeMessageReference(element, key) {
|
|
207
|
-
const registeredMessage =
|
|
228
|
+
const registeredMessage = this._messageRegistry.get(key);
|
|
208
229
|
registeredMessage.referenceCount--;
|
|
209
230
|
removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
|
|
210
231
|
element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
|
|
@@ -212,7 +233,7 @@ class AriaDescriber {
|
|
|
212
233
|
/** Returns true if the element has been described by the provided message ID. */
|
|
213
234
|
_isElementDescribedByMessage(element, key) {
|
|
214
235
|
const referenceIds = getAriaReferenceIds(element, 'aria-describedby');
|
|
215
|
-
const registeredMessage =
|
|
236
|
+
const registeredMessage = this._messageRegistry.get(key);
|
|
216
237
|
const messageId = registeredMessage && registeredMessage.messageElement.id;
|
|
217
238
|
return !!messageId && referenceIds.indexOf(messageId) != -1;
|
|
218
239
|
}
|
|
@@ -238,15 +259,15 @@ class AriaDescriber {
|
|
|
238
259
|
return element.nodeType === this._document.ELEMENT_NODE;
|
|
239
260
|
}
|
|
240
261
|
}
|
|
241
|
-
AriaDescriber.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
242
|
-
AriaDescriber.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
243
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
262
|
+
AriaDescriber.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: AriaDescriber, deps: [{ token: DOCUMENT }, { token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
263
|
+
AriaDescriber.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: AriaDescriber, providedIn: 'root' });
|
|
264
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: AriaDescriber, decorators: [{
|
|
244
265
|
type: Injectable,
|
|
245
266
|
args: [{ providedIn: 'root' }]
|
|
246
267
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
247
268
|
type: Inject,
|
|
248
269
|
args: [DOCUMENT]
|
|
249
|
-
}] }]; } });
|
|
270
|
+
}] }, { type: i1.Platform }]; } });
|
|
250
271
|
/** Gets a key that can be used to look messages up in the registry. */
|
|
251
272
|
function getKey(message, role) {
|
|
252
273
|
return typeof message === 'string' ? `${role || ''}/${message}` : message;
|
|
@@ -756,9 +777,9 @@ class InteractivityChecker {
|
|
|
756
777
|
(config?.ignoreVisibility || this.isVisible(element)));
|
|
757
778
|
}
|
|
758
779
|
}
|
|
759
|
-
InteractivityChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
760
|
-
InteractivityChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
761
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
780
|
+
InteractivityChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InteractivityChecker, deps: [{ token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
781
|
+
InteractivityChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InteractivityChecker, providedIn: 'root' });
|
|
782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InteractivityChecker, decorators: [{
|
|
762
783
|
type: Injectable,
|
|
763
784
|
args: [{ providedIn: 'root' }]
|
|
764
785
|
}], ctorParameters: function () { return [{ type: i1.Platform }]; } });
|
|
@@ -1157,9 +1178,9 @@ class FocusTrapFactory {
|
|
|
1157
1178
|
return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements);
|
|
1158
1179
|
}
|
|
1159
1180
|
}
|
|
1160
|
-
FocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1161
|
-
FocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1162
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1181
|
+
FocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapFactory, deps: [{ token: InteractivityChecker }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1182
|
+
FocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapFactory, providedIn: 'root' });
|
|
1183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapFactory, decorators: [{
|
|
1163
1184
|
type: Injectable,
|
|
1164
1185
|
args: [{ providedIn: 'root' }]
|
|
1165
1186
|
}], ctorParameters: function () { return [{ type: InteractivityChecker }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
@@ -1231,9 +1252,9 @@ class CdkTrapFocus {
|
|
|
1231
1252
|
this.focusTrap.focusInitialElementWhenReady();
|
|
1232
1253
|
}
|
|
1233
1254
|
}
|
|
1234
|
-
CdkTrapFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1235
|
-
CdkTrapFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1236
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1255
|
+
CdkTrapFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkTrapFocus, deps: [{ token: i0.ElementRef }, { token: FocusTrapFactory }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1256
|
+
CdkTrapFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.13", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: { enabled: ["cdkTrapFocus", "enabled"], autoCapture: ["cdkTrapFocusAutoCapture", "autoCapture"] }, exportAs: ["cdkTrapFocus"], usesOnChanges: true, ngImport: i0 });
|
|
1257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkTrapFocus, decorators: [{
|
|
1237
1258
|
type: Directive,
|
|
1238
1259
|
args: [{
|
|
1239
1260
|
selector: '[cdkTrapFocus]',
|
|
@@ -1423,9 +1444,9 @@ class FocusTrapManager {
|
|
|
1423
1444
|
}
|
|
1424
1445
|
}
|
|
1425
1446
|
}
|
|
1426
|
-
FocusTrapManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1427
|
-
FocusTrapManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1428
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1447
|
+
FocusTrapManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1448
|
+
FocusTrapManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapManager, providedIn: 'root' });
|
|
1449
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapManager, decorators: [{
|
|
1429
1450
|
type: Injectable,
|
|
1430
1451
|
args: [{ providedIn: 'root' }]
|
|
1431
1452
|
}] });
|
|
@@ -1458,9 +1479,9 @@ class ConfigurableFocusTrapFactory {
|
|
|
1458
1479
|
return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject);
|
|
1459
1480
|
}
|
|
1460
1481
|
}
|
|
1461
|
-
ConfigurableFocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1462
|
-
ConfigurableFocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1463
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1482
|
+
ConfigurableFocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ConfigurableFocusTrapFactory, deps: [{ token: InteractivityChecker }, { token: i0.NgZone }, { token: FocusTrapManager }, { token: DOCUMENT }, { token: FOCUS_TRAP_INERT_STRATEGY, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1483
|
+
ConfigurableFocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ConfigurableFocusTrapFactory, providedIn: 'root' });
|
|
1484
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ConfigurableFocusTrapFactory, decorators: [{
|
|
1464
1485
|
type: Injectable,
|
|
1465
1486
|
args: [{ providedIn: 'root' }]
|
|
1466
1487
|
}], ctorParameters: function () { return [{ type: InteractivityChecker }, { type: i0.NgZone }, { type: FocusTrapManager }, { type: undefined, decorators: [{
|
|
@@ -1656,9 +1677,9 @@ class InputModalityDetector {
|
|
|
1656
1677
|
}
|
|
1657
1678
|
}
|
|
1658
1679
|
}
|
|
1659
|
-
InputModalityDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1660
|
-
InputModalityDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1661
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1680
|
+
InputModalityDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InputModalityDetector, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT }, { token: INPUT_MODALITY_DETECTOR_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1681
|
+
InputModalityDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InputModalityDetector, providedIn: 'root' });
|
|
1682
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InputModalityDetector, decorators: [{
|
|
1662
1683
|
type: Injectable,
|
|
1663
1684
|
args: [{ providedIn: 'root' }]
|
|
1664
1685
|
}], ctorParameters: function () { return [{ type: i1.Platform }, { type: i0.NgZone }, { type: Document, decorators: [{
|
|
@@ -1733,16 +1754,19 @@ class LiveAnnouncer {
|
|
|
1733
1754
|
// second time without clearing and then using a non-zero delay.
|
|
1734
1755
|
// (using JAWS 17 at time of this writing).
|
|
1735
1756
|
return this._ngZone.runOutsideAngular(() => {
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1757
|
+
if (!this._currentPromise) {
|
|
1758
|
+
this._currentPromise = new Promise(resolve => (this._currentResolve = resolve));
|
|
1759
|
+
}
|
|
1760
|
+
clearTimeout(this._previousTimeout);
|
|
1761
|
+
this._previousTimeout = setTimeout(() => {
|
|
1762
|
+
this._liveElement.textContent = message;
|
|
1763
|
+
if (typeof duration === 'number') {
|
|
1764
|
+
this._previousTimeout = setTimeout(() => this.clear(), duration);
|
|
1765
|
+
}
|
|
1766
|
+
this._currentResolve();
|
|
1767
|
+
this._currentPromise = this._currentResolve = undefined;
|
|
1768
|
+
}, 100);
|
|
1769
|
+
return this._currentPromise;
|
|
1746
1770
|
});
|
|
1747
1771
|
}
|
|
1748
1772
|
/**
|
|
@@ -1759,6 +1783,8 @@ class LiveAnnouncer {
|
|
|
1759
1783
|
clearTimeout(this._previousTimeout);
|
|
1760
1784
|
this._liveElement?.remove();
|
|
1761
1785
|
this._liveElement = null;
|
|
1786
|
+
this._currentResolve?.();
|
|
1787
|
+
this._currentPromise = this._currentResolve = undefined;
|
|
1762
1788
|
}
|
|
1763
1789
|
_createLiveElement() {
|
|
1764
1790
|
const elementClass = 'cdk-live-announcer-element';
|
|
@@ -1776,9 +1802,9 @@ class LiveAnnouncer {
|
|
|
1776
1802
|
return liveEl;
|
|
1777
1803
|
}
|
|
1778
1804
|
}
|
|
1779
|
-
LiveAnnouncer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1780
|
-
LiveAnnouncer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
1781
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1805
|
+
LiveAnnouncer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: LiveAnnouncer, deps: [{ token: LIVE_ANNOUNCER_ELEMENT_TOKEN, optional: true }, { token: i0.NgZone }, { token: DOCUMENT }, { token: LIVE_ANNOUNCER_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1806
|
+
LiveAnnouncer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: LiveAnnouncer, providedIn: 'root' });
|
|
1807
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: LiveAnnouncer, decorators: [{
|
|
1782
1808
|
type: Injectable,
|
|
1783
1809
|
args: [{ providedIn: 'root' }]
|
|
1784
1810
|
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
@@ -1827,7 +1853,7 @@ class CdkAriaLive {
|
|
|
1827
1853
|
// The `MutationObserver` fires also for attribute
|
|
1828
1854
|
// changes which we don't want to announce.
|
|
1829
1855
|
if (elementText !== this._previousAnnouncedText) {
|
|
1830
|
-
this._liveAnnouncer.announce(elementText, this._politeness);
|
|
1856
|
+
this._liveAnnouncer.announce(elementText, this._politeness, this.duration);
|
|
1831
1857
|
this._previousAnnouncedText = elementText;
|
|
1832
1858
|
}
|
|
1833
1859
|
});
|
|
@@ -1840,9 +1866,9 @@ class CdkAriaLive {
|
|
|
1840
1866
|
}
|
|
1841
1867
|
}
|
|
1842
1868
|
}
|
|
1843
|
-
CdkAriaLive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1844
|
-
CdkAriaLive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
1845
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1869
|
+
CdkAriaLive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkAriaLive, deps: [{ token: i0.ElementRef }, { token: LiveAnnouncer }, { token: i1$1.ContentObserver }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1870
|
+
CdkAriaLive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.13", type: CdkAriaLive, selector: "[cdkAriaLive]", inputs: { politeness: ["cdkAriaLive", "politeness"], duration: ["cdkAriaLiveDuration", "duration"] }, exportAs: ["cdkAriaLive"], ngImport: i0 });
|
|
1871
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkAriaLive, decorators: [{
|
|
1846
1872
|
type: Directive,
|
|
1847
1873
|
args: [{
|
|
1848
1874
|
selector: '[cdkAriaLive]',
|
|
@@ -1851,6 +1877,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
|
|
|
1851
1877
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: LiveAnnouncer }, { type: i1$1.ContentObserver }, { type: i0.NgZone }]; }, propDecorators: { politeness: [{
|
|
1852
1878
|
type: Input,
|
|
1853
1879
|
args: ['cdkAriaLive']
|
|
1880
|
+
}], duration: [{
|
|
1881
|
+
type: Input,
|
|
1882
|
+
args: ['cdkAriaLiveDuration']
|
|
1854
1883
|
}] } });
|
|
1855
1884
|
|
|
1856
1885
|
/**
|
|
@@ -2109,10 +2138,12 @@ class FocusMonitor {
|
|
|
2109
2138
|
return;
|
|
2110
2139
|
}
|
|
2111
2140
|
this._setClasses(element);
|
|
2112
|
-
this._emitOrigin(elementInfo
|
|
2141
|
+
this._emitOrigin(elementInfo, null);
|
|
2113
2142
|
}
|
|
2114
|
-
_emitOrigin(
|
|
2115
|
-
|
|
2143
|
+
_emitOrigin(info, origin) {
|
|
2144
|
+
if (info.subject.observers.length) {
|
|
2145
|
+
this._ngZone.run(() => info.subject.next(origin));
|
|
2146
|
+
}
|
|
2116
2147
|
}
|
|
2117
2148
|
_registerGlobalListeners(elementInfo) {
|
|
2118
2149
|
if (!this._platform.isBrowser) {
|
|
@@ -2170,7 +2201,7 @@ class FocusMonitor {
|
|
|
2170
2201
|
/** Updates all the state on an element once its focus origin has changed. */
|
|
2171
2202
|
_originChanged(element, origin, elementInfo) {
|
|
2172
2203
|
this._setClasses(element, origin);
|
|
2173
|
-
this._emitOrigin(elementInfo
|
|
2204
|
+
this._emitOrigin(elementInfo, origin);
|
|
2174
2205
|
this._lastFocusOrigin = origin;
|
|
2175
2206
|
}
|
|
2176
2207
|
/**
|
|
@@ -2188,9 +2219,9 @@ class FocusMonitor {
|
|
|
2188
2219
|
return results;
|
|
2189
2220
|
}
|
|
2190
2221
|
}
|
|
2191
|
-
FocusMonitor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2192
|
-
FocusMonitor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2193
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2222
|
+
FocusMonitor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusMonitor, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: InputModalityDetector }, { token: DOCUMENT, optional: true }, { token: FOCUS_MONITOR_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2223
|
+
FocusMonitor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusMonitor, providedIn: 'root' });
|
|
2224
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusMonitor, decorators: [{
|
|
2194
2225
|
type: Injectable,
|
|
2195
2226
|
args: [{ providedIn: 'root' }]
|
|
2196
2227
|
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.Platform }, { type: InputModalityDetector }, { type: undefined, decorators: [{
|
|
@@ -2232,9 +2263,9 @@ class CdkMonitorFocus {
|
|
|
2232
2263
|
}
|
|
2233
2264
|
}
|
|
2234
2265
|
}
|
|
2235
|
-
CdkMonitorFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2236
|
-
CdkMonitorFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "
|
|
2237
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2266
|
+
CdkMonitorFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkMonitorFocus, deps: [{ token: i0.ElementRef }, { token: FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2267
|
+
CdkMonitorFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.13", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: { cdkFocusChange: "cdkFocusChange" }, ngImport: i0 });
|
|
2268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkMonitorFocus, decorators: [{
|
|
2238
2269
|
type: Directive,
|
|
2239
2270
|
args: [{
|
|
2240
2271
|
selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',
|
|
@@ -2306,26 +2337,21 @@ class HighContrastModeDetector {
|
|
|
2306
2337
|
_applyBodyHighContrastModeCssClasses() {
|
|
2307
2338
|
if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {
|
|
2308
2339
|
const bodyClasses = this._document.body.classList;
|
|
2309
|
-
|
|
2310
|
-
bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);
|
|
2311
|
-
bodyClasses.remove(BLACK_ON_WHITE_CSS_CLASS);
|
|
2312
|
-
bodyClasses.remove(WHITE_ON_BLACK_CSS_CLASS);
|
|
2340
|
+
bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
|
|
2313
2341
|
this._hasCheckedHighContrastMode = true;
|
|
2314
2342
|
const mode = this.getHighContrastMode();
|
|
2315
2343
|
if (mode === 1 /* BLACK_ON_WHITE */) {
|
|
2316
|
-
bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);
|
|
2317
|
-
bodyClasses.add(BLACK_ON_WHITE_CSS_CLASS);
|
|
2344
|
+
bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS);
|
|
2318
2345
|
}
|
|
2319
2346
|
else if (mode === 2 /* WHITE_ON_BLACK */) {
|
|
2320
|
-
bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);
|
|
2321
|
-
bodyClasses.add(WHITE_ON_BLACK_CSS_CLASS);
|
|
2347
|
+
bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
|
|
2322
2348
|
}
|
|
2323
2349
|
}
|
|
2324
2350
|
}
|
|
2325
2351
|
}
|
|
2326
|
-
HighContrastModeDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2327
|
-
HighContrastModeDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
2328
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2352
|
+
HighContrastModeDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: HighContrastModeDetector, deps: [{ token: i1.Platform }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2353
|
+
HighContrastModeDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: HighContrastModeDetector, providedIn: 'root' });
|
|
2354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: HighContrastModeDetector, decorators: [{
|
|
2329
2355
|
type: Injectable,
|
|
2330
2356
|
args: [{ providedIn: 'root' }]
|
|
2331
2357
|
}], ctorParameters: function () { return [{ type: i1.Platform }, { type: undefined, decorators: [{
|
|
@@ -2345,13 +2371,13 @@ class A11yModule {
|
|
|
2345
2371
|
highContrastModeDetector._applyBodyHighContrastModeCssClasses();
|
|
2346
2372
|
}
|
|
2347
2373
|
}
|
|
2348
|
-
A11yModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2349
|
-
A11yModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "
|
|
2350
|
-
A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
2351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2374
|
+
A11yModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, deps: [{ token: HighContrastModeDetector }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2375
|
+
A11yModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus], imports: [ObserversModule], exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus] });
|
|
2376
|
+
A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, imports: [[ObserversModule]] });
|
|
2377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, decorators: [{
|
|
2352
2378
|
type: NgModule,
|
|
2353
2379
|
args: [{
|
|
2354
|
-
imports: [
|
|
2380
|
+
imports: [ObserversModule],
|
|
2355
2381
|
declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
|
|
2356
2382
|
exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
|
|
2357
2383
|
}]
|