@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.
Files changed (272) hide show
  1. package/a11y/_index.scss +11 -0
  2. package/a11y/a11y-module.d.ts +2 -3
  3. package/a11y/aria-describer/aria-describer.d.ts +33 -6
  4. package/a11y/live-announcer/live-announcer.d.ts +5 -1
  5. package/a11y-prebuilt.css +1 -1
  6. package/drag-drop/drag-events.d.ts +8 -0
  7. package/drag-drop/drag-ref.d.ts +11 -1
  8. package/drag-drop/drop-list-ref.d.ts +5 -1
  9. package/drag-drop/parent-position-tracker.d.ts +11 -3
  10. package/esm2020/a11y/a11y-module.mjs +6 -7
  11. package/esm2020/a11y/aria-describer/aria-describer.mjs +75 -52
  12. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +13 -11
  13. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
  14. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
  15. package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
  16. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +7 -12
  17. package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
  18. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
  19. package/esm2020/a11y/live-announcer/live-announcer.mjs +26 -18
  20. package/esm2020/accordion/accordion-item.mjs +4 -4
  21. package/esm2020/accordion/accordion-module.mjs +5 -5
  22. package/esm2020/accordion/accordion.mjs +4 -4
  23. package/esm2020/bidi/bidi-module.mjs +5 -5
  24. package/esm2020/bidi/dir.mjs +4 -4
  25. package/esm2020/bidi/directionality.mjs +4 -4
  26. package/esm2020/clipboard/clipboard-module.mjs +5 -5
  27. package/esm2020/clipboard/clipboard.mjs +4 -4
  28. package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
  29. package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
  30. package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
  31. package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
  32. package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
  33. package/esm2020/drag-drop/directives/drag.mjs +26 -24
  34. package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
  35. package/esm2020/drag-drop/directives/drop-list.mjs +14 -13
  36. package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
  37. package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
  38. package/esm2020/drag-drop/drag-drop.mjs +4 -4
  39. package/esm2020/drag-drop/drag-events.mjs +1 -1
  40. package/esm2020/drag-drop/drag-ref.mjs +48 -24
  41. package/esm2020/drag-drop/drop-list-ref.mjs +7 -3
  42. package/esm2020/drag-drop/parent-position-tracker.mjs +13 -5
  43. package/esm2020/layout/breakpoints-observer.mjs +4 -4
  44. package/esm2020/layout/layout-module.mjs +5 -5
  45. package/esm2020/layout/media-matcher.mjs +4 -4
  46. package/esm2020/observers/observe-content.mjs +14 -14
  47. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
  48. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +26 -8
  49. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +33 -12
  50. package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
  51. package/esm2020/overlay/overlay-container.mjs +4 -4
  52. package/esm2020/overlay/overlay-directives.mjs +7 -7
  53. package/esm2020/overlay/overlay-module.mjs +5 -5
  54. package/esm2020/overlay/overlay-ref.mjs +24 -18
  55. package/esm2020/overlay/overlay.mjs +14 -8
  56. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +21 -3
  57. package/esm2020/overlay/position/global-position-strategy.mjs +64 -30
  58. package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
  59. package/esm2020/overlay/public-api.mjs +2 -2
  60. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
  61. package/esm2020/platform/platform-module.mjs +5 -5
  62. package/esm2020/platform/platform.mjs +4 -4
  63. package/esm2020/portal/dom-portal-outlet.mjs +29 -5
  64. package/esm2020/portal/portal-directives.mjs +20 -18
  65. package/esm2020/portal/portal.mjs +12 -3
  66. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
  67. package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
  68. package/esm2020/scrolling/scrollable.mjs +4 -4
  69. package/esm2020/scrolling/scrolling-module.mjs +10 -11
  70. package/esm2020/scrolling/viewport-ruler.mjs +4 -4
  71. package/esm2020/scrolling/virtual-for-of.mjs +7 -5
  72. package/esm2020/scrolling/virtual-scroll-viewport.mjs +8 -6
  73. package/esm2020/stepper/step-header.mjs +4 -4
  74. package/esm2020/stepper/step-label.mjs +4 -4
  75. package/esm2020/stepper/stepper-button.mjs +7 -7
  76. package/esm2020/stepper/stepper-module.mjs +5 -5
  77. package/esm2020/stepper/stepper.mjs +9 -22
  78. package/esm2020/table/cell.mjs +22 -22
  79. package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
  80. package/esm2020/table/row.mjs +28 -28
  81. package/esm2020/table/table-module.mjs +5 -5
  82. package/esm2020/table/table.mjs +21 -21
  83. package/esm2020/table/text-column.mjs +4 -4
  84. package/esm2020/testing/component-harness.mjs +7 -1
  85. package/esm2020/testing/harness-environment.mjs +12 -1
  86. package/esm2020/testing/public-api.mjs +2 -1
  87. package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +8 -3
  88. package/esm2020/testing/test-element-errors.mjs +15 -0
  89. package/esm2020/testing/test-element.mjs +1 -1
  90. package/esm2020/testing/testbed/fake-events/type-in-element.mjs +13 -4
  91. package/esm2020/testing/testbed/unit-test-element.mjs +21 -5
  92. package/esm2020/text-field/autofill.mjs +7 -7
  93. package/esm2020/text-field/autosize.mjs +4 -4
  94. package/esm2020/text-field/text-field-module.mjs +5 -7
  95. package/esm2020/tree/nested-node.mjs +4 -4
  96. package/esm2020/tree/node.mjs +4 -4
  97. package/esm2020/tree/outlet.mjs +4 -4
  98. package/esm2020/tree/padding.mjs +4 -4
  99. package/esm2020/tree/toggle.mjs +4 -4
  100. package/esm2020/tree/tree-module.mjs +5 -5
  101. package/esm2020/tree/tree.mjs +7 -7
  102. package/esm2020/version.mjs +1 -1
  103. package/fesm2015/a11y.mjs +146 -118
  104. package/fesm2015/a11y.mjs.map +1 -1
  105. package/fesm2015/accordion.mjs +10 -10
  106. package/fesm2015/accordion.mjs.map +1 -1
  107. package/fesm2015/bidi.mjs +10 -10
  108. package/fesm2015/bidi.mjs.map +1 -1
  109. package/fesm2015/cdk.mjs +1 -1
  110. package/fesm2015/cdk.mjs.map +1 -1
  111. package/fesm2015/clipboard.mjs +10 -10
  112. package/fesm2015/clipboard.mjs.map +1 -1
  113. package/fesm2015/coercion.mjs.map +1 -1
  114. package/fesm2015/collections.mjs +3 -3
  115. package/fesm2015/collections.mjs.map +1 -1
  116. package/fesm2015/drag-drop.mjs +126 -86
  117. package/fesm2015/drag-drop.mjs.map +1 -1
  118. package/fesm2015/keycodes.mjs.map +1 -1
  119. package/fesm2015/layout.mjs +10 -10
  120. package/fesm2015/layout.mjs.map +1 -1
  121. package/fesm2015/observers.mjs +13 -13
  122. package/fesm2015/observers.mjs.map +1 -1
  123. package/fesm2015/overlay.mjs +202 -99
  124. package/fesm2015/overlay.mjs.map +1 -1
  125. package/fesm2015/platform.mjs +7 -7
  126. package/fesm2015/platform.mjs.map +1 -1
  127. package/fesm2015/portal.mjs +58 -24
  128. package/fesm2015/portal.mjs.map +1 -1
  129. package/fesm2015/scrolling.mjs +35 -31
  130. package/fesm2015/scrolling.mjs.map +1 -1
  131. package/fesm2015/stepper.mjs +24 -37
  132. package/fesm2015/stepper.mjs.map +1 -1
  133. package/fesm2015/table.mjs +78 -78
  134. package/fesm2015/table.mjs.map +1 -1
  135. package/fesm2015/testing/selenium-webdriver.mjs +7 -2
  136. package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
  137. package/fesm2015/testing/testbed.mjs +32 -8
  138. package/fesm2015/testing/testbed.mjs.map +1 -1
  139. package/fesm2015/testing.mjs +39 -1
  140. package/fesm2015/testing.mjs.map +1 -1
  141. package/fesm2015/text-field.mjs +14 -15
  142. package/fesm2015/text-field.mjs.map +1 -1
  143. package/fesm2015/tree.mjs +25 -25
  144. package/fesm2015/tree.mjs.map +1 -1
  145. package/fesm2020/a11y.mjs +142 -116
  146. package/fesm2020/a11y.mjs.map +1 -1
  147. package/fesm2020/accordion.mjs +10 -10
  148. package/fesm2020/accordion.mjs.map +1 -1
  149. package/fesm2020/bidi.mjs +10 -10
  150. package/fesm2020/bidi.mjs.map +1 -1
  151. package/fesm2020/cdk.mjs +1 -1
  152. package/fesm2020/cdk.mjs.map +1 -1
  153. package/fesm2020/clipboard.mjs +10 -10
  154. package/fesm2020/clipboard.mjs.map +1 -1
  155. package/fesm2020/coercion.mjs.map +1 -1
  156. package/fesm2020/collections.mjs +3 -3
  157. package/fesm2020/collections.mjs.map +1 -1
  158. package/fesm2020/drag-drop.mjs +125 -86
  159. package/fesm2020/drag-drop.mjs.map +1 -1
  160. package/fesm2020/keycodes.mjs.map +1 -1
  161. package/fesm2020/layout.mjs +10 -10
  162. package/fesm2020/layout.mjs.map +1 -1
  163. package/fesm2020/observers.mjs +13 -13
  164. package/fesm2020/observers.mjs.map +1 -1
  165. package/fesm2020/overlay.mjs +202 -99
  166. package/fesm2020/overlay.mjs.map +1 -1
  167. package/fesm2020/platform.mjs +7 -7
  168. package/fesm2020/platform.mjs.map +1 -1
  169. package/fesm2020/portal.mjs +58 -24
  170. package/fesm2020/portal.mjs.map +1 -1
  171. package/fesm2020/scrolling.mjs +35 -31
  172. package/fesm2020/scrolling.mjs.map +1 -1
  173. package/fesm2020/stepper.mjs +24 -37
  174. package/fesm2020/stepper.mjs.map +1 -1
  175. package/fesm2020/table.mjs +78 -78
  176. package/fesm2020/table.mjs.map +1 -1
  177. package/fesm2020/testing/selenium-webdriver.mjs +7 -2
  178. package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
  179. package/fesm2020/testing/testbed.mjs +32 -8
  180. package/fesm2020/testing/testbed.mjs.map +1 -1
  181. package/fesm2020/testing.mjs +33 -1
  182. package/fesm2020/testing.mjs.map +1 -1
  183. package/fesm2020/text-field.mjs +14 -15
  184. package/fesm2020/text-field.mjs.map +1 -1
  185. package/fesm2020/tree.mjs +25 -25
  186. package/fesm2020/tree.mjs.map +1 -1
  187. package/overlay/_index.scss +11 -1
  188. package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +7 -2
  189. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +8 -2
  190. package/overlay/overlay-ref.d.ts +4 -1
  191. package/overlay/overlay.d.ts +3 -2
  192. package/overlay/position/flexible-connected-position-strategy.d.ts +2 -0
  193. package/overlay/position/global-position-strategy.d.ts +14 -3
  194. package/overlay/public-api.d.ts +1 -1
  195. package/overlay-prebuilt.css +1 -1
  196. package/package.json +3 -11
  197. package/portal/dom-portal-outlet.d.ts +17 -6
  198. package/portal/portal.d.ts +12 -2
  199. package/schematics/collection.json +2 -1
  200. package/schematics/index.js +6 -2
  201. package/schematics/index.mjs +6 -2
  202. package/schematics/migration.json +5 -0
  203. package/schematics/ng-add/index.js +1 -1
  204. package/schematics/ng-add/index.mjs +1 -1
  205. package/schematics/ng-generate/drag-drop/index.js +5 -14
  206. package/schematics/ng-generate/drag-drop/index.mjs +5 -14
  207. package/schematics/ng-generate/drag-drop/schema.json +1 -1
  208. package/schematics/ng-update/data/constructor-checks.js +7 -1
  209. package/schematics/ng-update/data/constructor-checks.mjs +7 -1
  210. package/schematics/ng-update/data/index.js +6 -2
  211. package/schematics/ng-update/data/index.mjs +6 -2
  212. package/schematics/ng-update/devkit-migration-rule.js +5 -14
  213. package/schematics/ng-update/devkit-migration-rule.mjs +5 -14
  214. package/schematics/ng-update/devkit-migration.js +1 -1
  215. package/schematics/ng-update/devkit-migration.mjs +1 -1
  216. package/schematics/ng-update/html-parsing/elements.js +2 -3
  217. package/schematics/ng-update/html-parsing/elements.mjs +2 -3
  218. package/schematics/ng-update/index.d.ts +2 -0
  219. package/schematics/ng-update/index.js +7 -2
  220. package/schematics/ng-update/index.mjs +7 -2
  221. package/schematics/ng-update/migrations/symbol-removal.js +2 -3
  222. package/schematics/ng-update/migrations/symbol-removal.mjs +2 -3
  223. package/schematics/ng-update/public-api.js +6 -2
  224. package/schematics/ng-update/public-api.mjs +6 -2
  225. package/schematics/tsconfig.json +2 -10
  226. package/schematics/update-tool/public-api.js +6 -2
  227. package/schematics/update-tool/public-api.mjs +6 -2
  228. package/schematics/update-tool/target-version.d.ts +2 -1
  229. package/schematics/update-tool/target-version.js +2 -1
  230. package/schematics/update-tool/target-version.mjs +2 -1
  231. package/schematics/utils/ast.js +11 -22
  232. package/schematics/utils/ast.mjs +11 -22
  233. package/schematics/utils/build-component.js +10 -15
  234. package/schematics/utils/build-component.mjs +10 -15
  235. package/schematics/utils/get-project.d.ts +1 -1
  236. package/schematics/utils/get-project.js +7 -2
  237. package/schematics/utils/get-project.mjs +7 -2
  238. package/schematics/utils/html-manipulation.js +3 -1
  239. package/schematics/utils/html-manipulation.mjs +3 -1
  240. package/schematics/utils/index.js +6 -2
  241. package/schematics/utils/index.mjs +6 -2
  242. package/schematics/utils/project-index-file.js +2 -2
  243. package/schematics/utils/project-index-file.mjs +2 -2
  244. package/schematics/utils/project-targets.js +3 -4
  245. package/schematics/utils/project-targets.mjs +3 -4
  246. package/schematics/utils/project-tsconfig-paths.js +16 -28
  247. package/schematics/utils/project-tsconfig-paths.mjs +16 -28
  248. package/scrolling/scrolling-module.d.ts +1 -2
  249. package/stepper/stepper.d.ts +3 -12
  250. package/table/table.d.ts +2 -6
  251. package/table/text-column.d.ts +1 -1
  252. package/testing/component-harness.d.ts +18 -0
  253. package/testing/harness-environment.d.ts +2 -0
  254. package/testing/public-api.d.ts +1 -0
  255. package/testing/{protractor/index.d.ts → test-element-errors.d.ts} +5 -1
  256. package/testing/test-element.d.ts +4 -2
  257. package/testing/testbed/fake-events/type-in-element.d.ts +2 -2
  258. package/testing/testbed/unit-test-element.d.ts +4 -1
  259. package/text-field/text-field-module.d.ts +1 -2
  260. package/text-field-prebuilt.css +1 -1
  261. package/esm2020/testing/protractor/index.mjs +0 -9
  262. package/esm2020/testing/protractor/protractor-element.mjs +0 -234
  263. package/esm2020/testing/protractor/protractor-harness-environment.mjs +0 -72
  264. package/esm2020/testing/protractor/public-api.mjs +0 -10
  265. package/fesm2015/testing/protractor.mjs +0 -355
  266. package/fesm2015/testing/protractor.mjs.map +0 -1
  267. package/fesm2020/testing/protractor.mjs +0 -322
  268. package/fesm2020/testing/protractor.mjs.map +0 -1
  269. package/testing/protractor/package.json +0 -9
  270. package/testing/protractor/protractor-element.d.ts +0 -90
  271. package/testing/protractor/protractor-harness-environment.d.ts +0 -50
  272. package/testing/protractor/public-api.d.ts +0 -9
package/fesm2015/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
- /** ID used for the body container where all messages are appended. */
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
- /** ID prefix used for each created message element. */
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
- /** Attribute given to each host element that is described by a message element. */
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
- messageRegistry.set(key, { messageElement: message, referenceCount: 0 });
113
+ this._messageRegistry.set(key, { messageElement: message, referenceCount: 0 });
94
114
  }
95
- else if (!messageRegistry.has(key)) {
115
+ else if (!this._messageRegistry.has(key)) {
96
116
  this._createMessageElement(message, role);
97
117
  }
98
118
  if (!this._isElementDescribedByMessage(hostElement, key)) {
@@ -100,6 +120,7 @@ class AriaDescriber {
100
120
  }
101
121
  }
102
122
  removeDescription(hostElement, message, role) {
123
+ var _a;
103
124
  if (!message || !this._isElementNode(hostElement)) {
104
125
  return;
105
126
  }
@@ -110,26 +131,27 @@ class AriaDescriber {
110
131
  // If the message is a string, it means that it's one that we created for the
111
132
  // consumer so we can remove it safely, otherwise we should leave it in place.
112
133
  if (typeof message === 'string') {
113
- const registeredMessage = messageRegistry.get(key);
134
+ const registeredMessage = this._messageRegistry.get(key);
114
135
  if (registeredMessage && registeredMessage.referenceCount === 0) {
115
136
  this._deleteMessageElement(key);
116
137
  }
117
138
  }
118
- if (messagesContainer && messagesContainer.childNodes.length === 0) {
119
- this._deleteMessagesContainer();
139
+ if (((_a = this._messagesContainer) === null || _a === void 0 ? void 0 : _a.childNodes.length) === 0) {
140
+ this._messagesContainer.remove();
141
+ this._messagesContainer = null;
120
142
  }
121
143
  }
122
144
  /** Unregisters all created message elements and removes the message container. */
123
145
  ngOnDestroy() {
124
- const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}]`);
146
+ var _a;
147
+ const describedElements = this._document.querySelectorAll(`[${CDK_DESCRIBEDBY_HOST_ATTRIBUTE}="${this._id}"]`);
125
148
  for (let i = 0; i < describedElements.length; i++) {
126
149
  this._removeCdkDescribedByReferenceIds(describedElements[i]);
127
150
  describedElements[i].removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
128
151
  }
129
- if (messagesContainer) {
130
- this._deleteMessagesContainer();
131
- }
132
- messageRegistry.clear();
152
+ (_a = this._messagesContainer) === null || _a === void 0 ? void 0 : _a.remove();
153
+ this._messagesContainer = null;
154
+ this._messageRegistry.clear();
133
155
  }
134
156
  /**
135
157
  * Creates a new element in the visually hidden message container element with the message
@@ -143,44 +165,45 @@ class AriaDescriber {
143
165
  messageElement.setAttribute('role', role);
144
166
  }
145
167
  this._createMessagesContainer();
146
- messagesContainer.appendChild(messageElement);
147
- messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 });
168
+ this._messagesContainer.appendChild(messageElement);
169
+ this._messageRegistry.set(getKey(message, role), { messageElement, referenceCount: 0 });
148
170
  }
149
171
  /** Deletes the message element from the global messages container. */
150
172
  _deleteMessageElement(key) {
151
- var _a;
152
- const registeredMessage = messageRegistry.get(key);
153
- (_a = registeredMessage === null || registeredMessage === void 0 ? void 0 : registeredMessage.messageElement) === null || _a === void 0 ? void 0 : _a.remove();
154
- messageRegistry.delete(key);
173
+ var _a, _b;
174
+ (_b = (_a = this._messageRegistry.get(key)) === null || _a === void 0 ? void 0 : _a.messageElement) === null || _b === void 0 ? void 0 : _b.remove();
175
+ this._messageRegistry.delete(key);
155
176
  }
156
177
  /** Creates the global container for all aria-describedby messages. */
157
178
  _createMessagesContainer() {
158
- if (!messagesContainer) {
159
- const preExistingContainer = this._document.getElementById(MESSAGES_CONTAINER_ID);
179
+ if (this._messagesContainer) {
180
+ return;
181
+ }
182
+ const containerClassName = 'cdk-describedby-message-container';
183
+ const serverContainers = this._document.querySelectorAll(`.${containerClassName}[platform="server"]`);
184
+ for (let i = 0; i < serverContainers.length; i++) {
160
185
  // When going from the server to the client, we may end up in a situation where there's
161
186
  // already a container on the page, but we don't have a reference to it. Clear the
162
187
  // old container so we don't get duplicates. Doing this, instead of emptying the previous
163
188
  // container, should be slightly faster.
164
- preExistingContainer === null || preExistingContainer === void 0 ? void 0 : preExistingContainer.remove();
165
- messagesContainer = this._document.createElement('div');
166
- messagesContainer.id = MESSAGES_CONTAINER_ID;
167
- // We add `visibility: hidden` in order to prevent text in this container from
168
- // being searchable by the browser's Ctrl + F functionality.
169
- // Screen-readers will still read the description for elements with aria-describedby even
170
- // when the description element is not visible.
171
- messagesContainer.style.visibility = 'hidden';
172
- // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that
173
- // the description element doesn't impact page layout.
174
- messagesContainer.classList.add('cdk-visually-hidden');
175
- this._document.body.appendChild(messagesContainer);
176
- }
177
- }
178
- /** Deletes the global messages container. */
179
- _deleteMessagesContainer() {
180
- if (messagesContainer) {
181
- messagesContainer.remove();
182
- messagesContainer = null;
183
- }
189
+ serverContainers[i].remove();
190
+ }
191
+ const messagesContainer = this._document.createElement('div');
192
+ // We add `visibility: hidden` in order to prevent text in this container from
193
+ // being searchable by the browser's Ctrl + F functionality.
194
+ // Screen-readers will still read the description for elements with aria-describedby even
195
+ // when the description element is not visible.
196
+ messagesContainer.style.visibility = 'hidden';
197
+ // Even though we use `visibility: hidden`, we still apply `cdk-visually-hidden` so that
198
+ // the description element doesn't impact page layout.
199
+ messagesContainer.classList.add(containerClassName);
200
+ messagesContainer.classList.add('cdk-visually-hidden');
201
+ // @breaking-change 14.0.0 Remove null check for `_platform`.
202
+ if (this._platform && !this._platform.isBrowser) {
203
+ messagesContainer.setAttribute('platform', 'server');
204
+ }
205
+ this._document.body.appendChild(messagesContainer);
206
+ this._messagesContainer = messagesContainer;
184
207
  }
185
208
  /** Removes all cdk-describedby messages that are hosted through the element. */
186
209
  _removeCdkDescribedByReferenceIds(element) {
@@ -193,11 +216,11 @@ class AriaDescriber {
193
216
  * message's reference count.
194
217
  */
195
218
  _addMessageReference(element, key) {
196
- const registeredMessage = messageRegistry.get(key);
219
+ const registeredMessage = this._messageRegistry.get(key);
197
220
  // Add the aria-describedby reference and set the
198
221
  // describedby_host attribute to mark the element.
199
222
  addAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
200
- element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, '');
223
+ element.setAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE, this._id);
201
224
  registeredMessage.referenceCount++;
202
225
  }
203
226
  /**
@@ -205,7 +228,7 @@ class AriaDescriber {
205
228
  * and decrements the registered message's reference count.
206
229
  */
207
230
  _removeMessageReference(element, key) {
208
- const registeredMessage = messageRegistry.get(key);
231
+ const registeredMessage = this._messageRegistry.get(key);
209
232
  registeredMessage.referenceCount--;
210
233
  removeAriaReferencedId(element, 'aria-describedby', registeredMessage.messageElement.id);
211
234
  element.removeAttribute(CDK_DESCRIBEDBY_HOST_ATTRIBUTE);
@@ -213,7 +236,7 @@ class AriaDescriber {
213
236
  /** Returns true if the element has been described by the provided message ID. */
214
237
  _isElementDescribedByMessage(element, key) {
215
238
  const referenceIds = getAriaReferenceIds(element, 'aria-describedby');
216
- const registeredMessage = messageRegistry.get(key);
239
+ const registeredMessage = this._messageRegistry.get(key);
217
240
  const messageId = registeredMessage && registeredMessage.messageElement.id;
218
241
  return !!messageId && referenceIds.indexOf(messageId) != -1;
219
242
  }
@@ -239,16 +262,16 @@ class AriaDescriber {
239
262
  return element.nodeType === this._document.ELEMENT_NODE;
240
263
  }
241
264
  }
242
- AriaDescriber.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: AriaDescriber, deps: [{ token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
243
- AriaDescriber.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: AriaDescriber, providedIn: 'root' });
244
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: AriaDescriber, decorators: [{
265
+ 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 });
266
+ AriaDescriber.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: AriaDescriber, providedIn: 'root' });
267
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: AriaDescriber, decorators: [{
245
268
  type: Injectable,
246
269
  args: [{ providedIn: 'root' }]
247
270
  }], ctorParameters: function () {
248
271
  return [{ type: undefined, decorators: [{
249
272
  type: Inject,
250
273
  args: [DOCUMENT]
251
- }] }];
274
+ }] }, { type: i1.Platform }];
252
275
  } });
253
276
  /** Gets a key that can be used to look messages up in the registry. */
254
277
  function getKey(message, role) {
@@ -752,9 +775,9 @@ class InteractivityChecker {
752
775
  ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element)));
753
776
  }
754
777
  }
755
- InteractivityChecker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: InteractivityChecker, deps: [{ token: i1.Platform }], target: i0.ɵɵFactoryTarget.Injectable });
756
- InteractivityChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: InteractivityChecker, providedIn: 'root' });
757
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: InteractivityChecker, decorators: [{
778
+ 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 });
779
+ InteractivityChecker.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InteractivityChecker, providedIn: 'root' });
780
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InteractivityChecker, decorators: [{
758
781
  type: Injectable,
759
782
  args: [{ providedIn: 'root' }]
760
783
  }], ctorParameters: function () { return [{ type: i1.Platform }]; } });
@@ -1153,9 +1176,9 @@ class FocusTrapFactory {
1153
1176
  return new FocusTrap(element, this._checker, this._ngZone, this._document, deferCaptureElements);
1154
1177
  }
1155
1178
  }
1156
- FocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusTrapFactory, deps: [{ token: InteractivityChecker }, { token: i0.NgZone }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
1157
- FocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusTrapFactory, providedIn: 'root' });
1158
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusTrapFactory, decorators: [{
1179
+ 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 });
1180
+ FocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapFactory, providedIn: 'root' });
1181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapFactory, decorators: [{
1159
1182
  type: Injectable,
1160
1183
  args: [{ providedIn: 'root' }]
1161
1184
  }], ctorParameters: function () {
@@ -1229,9 +1252,9 @@ class CdkTrapFocus {
1229
1252
  this.focusTrap.focusInitialElementWhenReady();
1230
1253
  }
1231
1254
  }
1232
- CdkTrapFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: CdkTrapFocus, deps: [{ token: i0.ElementRef }, { token: FocusTrapFactory }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
1233
- CdkTrapFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.0-rc.1", type: CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: { enabled: ["cdkTrapFocus", "enabled"], autoCapture: ["cdkTrapFocusAutoCapture", "autoCapture"] }, exportAs: ["cdkTrapFocus"], usesOnChanges: true, ngImport: i0 });
1234
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: CdkTrapFocus, decorators: [{
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: [{
1235
1258
  type: Directive,
1236
1259
  args: [{
1237
1260
  selector: '[cdkTrapFocus]',
@@ -1416,9 +1439,9 @@ class FocusTrapManager {
1416
1439
  }
1417
1440
  }
1418
1441
  }
1419
- FocusTrapManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusTrapManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1420
- FocusTrapManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusTrapManager, providedIn: 'root' });
1421
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusTrapManager, decorators: [{
1442
+ FocusTrapManager.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1443
+ FocusTrapManager.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapManager, providedIn: 'root' });
1444
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusTrapManager, decorators: [{
1422
1445
  type: Injectable,
1423
1446
  args: [{ providedIn: 'root' }]
1424
1447
  }] });
@@ -1451,9 +1474,9 @@ class ConfigurableFocusTrapFactory {
1451
1474
  return new ConfigurableFocusTrap(element, this._checker, this._ngZone, this._document, this._focusTrapManager, this._inertStrategy, configObject);
1452
1475
  }
1453
1476
  }
1454
- ConfigurableFocusTrapFactory.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", 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 });
1455
- ConfigurableFocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: ConfigurableFocusTrapFactory, providedIn: 'root' });
1456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: ConfigurableFocusTrapFactory, decorators: [{
1477
+ 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 });
1478
+ ConfigurableFocusTrapFactory.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ConfigurableFocusTrapFactory, providedIn: 'root' });
1479
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: ConfigurableFocusTrapFactory, decorators: [{
1457
1480
  type: Injectable,
1458
1481
  args: [{ providedIn: 'root' }]
1459
1482
  }], ctorParameters: function () {
@@ -1649,9 +1672,9 @@ class InputModalityDetector {
1649
1672
  }
1650
1673
  }
1651
1674
  }
1652
- InputModalityDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: InputModalityDetector, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT }, { token: INPUT_MODALITY_DETECTOR_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
1653
- InputModalityDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: InputModalityDetector, providedIn: 'root' });
1654
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: InputModalityDetector, decorators: [{
1675
+ 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 });
1676
+ InputModalityDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InputModalityDetector, providedIn: 'root' });
1677
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: InputModalityDetector, decorators: [{
1655
1678
  type: Injectable,
1656
1679
  args: [{ providedIn: 'root' }]
1657
1680
  }], ctorParameters: function () {
@@ -1721,16 +1744,19 @@ class LiveAnnouncer {
1721
1744
  // second time without clearing and then using a non-zero delay.
1722
1745
  // (using JAWS 17 at time of this writing).
1723
1746
  return this._ngZone.runOutsideAngular(() => {
1724
- return new Promise(resolve => {
1725
- clearTimeout(this._previousTimeout);
1726
- this._previousTimeout = setTimeout(() => {
1727
- this._liveElement.textContent = message;
1728
- resolve();
1729
- if (typeof duration === 'number') {
1730
- this._previousTimeout = setTimeout(() => this.clear(), duration);
1731
- }
1732
- }, 100);
1733
- });
1747
+ if (!this._currentPromise) {
1748
+ this._currentPromise = new Promise(resolve => (this._currentResolve = resolve));
1749
+ }
1750
+ clearTimeout(this._previousTimeout);
1751
+ this._previousTimeout = setTimeout(() => {
1752
+ this._liveElement.textContent = message;
1753
+ if (typeof duration === 'number') {
1754
+ this._previousTimeout = setTimeout(() => this.clear(), duration);
1755
+ }
1756
+ this._currentResolve();
1757
+ this._currentPromise = this._currentResolve = undefined;
1758
+ }, 100);
1759
+ return this._currentPromise;
1734
1760
  });
1735
1761
  }
1736
1762
  /**
@@ -1744,10 +1770,12 @@ class LiveAnnouncer {
1744
1770
  }
1745
1771
  }
1746
1772
  ngOnDestroy() {
1747
- var _a;
1773
+ var _a, _b;
1748
1774
  clearTimeout(this._previousTimeout);
1749
1775
  (_a = this._liveElement) === null || _a === void 0 ? void 0 : _a.remove();
1750
1776
  this._liveElement = null;
1777
+ (_b = this._currentResolve) === null || _b === void 0 ? void 0 : _b.call(this);
1778
+ this._currentPromise = this._currentResolve = undefined;
1751
1779
  }
1752
1780
  _createLiveElement() {
1753
1781
  const elementClass = 'cdk-live-announcer-element';
@@ -1765,9 +1793,9 @@ class LiveAnnouncer {
1765
1793
  return liveEl;
1766
1794
  }
1767
1795
  }
1768
- LiveAnnouncer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", 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 });
1769
- LiveAnnouncer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: LiveAnnouncer, providedIn: 'root' });
1770
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: LiveAnnouncer, decorators: [{
1796
+ 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 });
1797
+ LiveAnnouncer.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: LiveAnnouncer, providedIn: 'root' });
1798
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: LiveAnnouncer, decorators: [{
1771
1799
  type: Injectable,
1772
1800
  args: [{ providedIn: 'root' }]
1773
1801
  }], ctorParameters: function () {
@@ -1818,7 +1846,7 @@ class CdkAriaLive {
1818
1846
  // The `MutationObserver` fires also for attribute
1819
1847
  // changes which we don't want to announce.
1820
1848
  if (elementText !== this._previousAnnouncedText) {
1821
- this._liveAnnouncer.announce(elementText, this._politeness);
1849
+ this._liveAnnouncer.announce(elementText, this._politeness, this.duration);
1822
1850
  this._previousAnnouncedText = elementText;
1823
1851
  }
1824
1852
  });
@@ -1831,9 +1859,9 @@ class CdkAriaLive {
1831
1859
  }
1832
1860
  }
1833
1861
  }
1834
- CdkAriaLive.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: CdkAriaLive, deps: [{ token: i0.ElementRef }, { token: LiveAnnouncer }, { token: i1$1.ContentObserver }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1835
- CdkAriaLive.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.0-rc.1", type: CdkAriaLive, selector: "[cdkAriaLive]", inputs: { politeness: ["cdkAriaLive", "politeness"] }, exportAs: ["cdkAriaLive"], ngImport: i0 });
1836
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: CdkAriaLive, decorators: [{
1862
+ 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 });
1863
+ 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 });
1864
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkAriaLive, decorators: [{
1837
1865
  type: Directive,
1838
1866
  args: [{
1839
1867
  selector: '[cdkAriaLive]',
@@ -1842,6 +1870,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
1842
1870
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: LiveAnnouncer }, { type: i1$1.ContentObserver }, { type: i0.NgZone }]; }, propDecorators: { politeness: [{
1843
1871
  type: Input,
1844
1872
  args: ['cdkAriaLive']
1873
+ }], duration: [{
1874
+ type: Input,
1875
+ args: ['cdkAriaLiveDuration']
1845
1876
  }] } });
1846
1877
 
1847
1878
  /**
@@ -2100,10 +2131,12 @@ class FocusMonitor {
2100
2131
  return;
2101
2132
  }
2102
2133
  this._setClasses(element);
2103
- this._emitOrigin(elementInfo.subject, null);
2134
+ this._emitOrigin(elementInfo, null);
2104
2135
  }
2105
- _emitOrigin(subject, origin) {
2106
- this._ngZone.run(() => subject.next(origin));
2136
+ _emitOrigin(info, origin) {
2137
+ if (info.subject.observers.length) {
2138
+ this._ngZone.run(() => info.subject.next(origin));
2139
+ }
2107
2140
  }
2108
2141
  _registerGlobalListeners(elementInfo) {
2109
2142
  if (!this._platform.isBrowser) {
@@ -2161,7 +2194,7 @@ class FocusMonitor {
2161
2194
  /** Updates all the state on an element once its focus origin has changed. */
2162
2195
  _originChanged(element, origin, elementInfo) {
2163
2196
  this._setClasses(element, origin);
2164
- this._emitOrigin(elementInfo.subject, origin);
2197
+ this._emitOrigin(elementInfo, origin);
2165
2198
  this._lastFocusOrigin = origin;
2166
2199
  }
2167
2200
  /**
@@ -2179,9 +2212,9 @@ class FocusMonitor {
2179
2212
  return results;
2180
2213
  }
2181
2214
  }
2182
- FocusMonitor.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", 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 });
2183
- FocusMonitor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusMonitor, providedIn: 'root' });
2184
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: FocusMonitor, decorators: [{
2215
+ 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 });
2216
+ FocusMonitor.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusMonitor, providedIn: 'root' });
2217
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: FocusMonitor, decorators: [{
2185
2218
  type: Injectable,
2186
2219
  args: [{ providedIn: 'root' }]
2187
2220
  }], ctorParameters: function () {
@@ -2225,9 +2258,9 @@ class CdkMonitorFocus {
2225
2258
  }
2226
2259
  }
2227
2260
  }
2228
- CdkMonitorFocus.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: CdkMonitorFocus, deps: [{ token: i0.ElementRef }, { token: FocusMonitor }], target: i0.ɵɵFactoryTarget.Directive });
2229
- CdkMonitorFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.0-rc.1", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: { cdkFocusChange: "cdkFocusChange" }, ngImport: i0 });
2230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: CdkMonitorFocus, decorators: [{
2261
+ 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 });
2262
+ CdkMonitorFocus.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "14.0.0-next.13", type: CdkMonitorFocus, selector: "[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]", outputs: { cdkFocusChange: "cdkFocusChange" }, ngImport: i0 });
2263
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: CdkMonitorFocus, decorators: [{
2231
2264
  type: Directive,
2232
2265
  args: [{
2233
2266
  selector: '[cdkMonitorElementFocus], [cdkMonitorSubtreeFocus]',
@@ -2292,26 +2325,21 @@ class HighContrastModeDetector {
2292
2325
  _applyBodyHighContrastModeCssClasses() {
2293
2326
  if (!this._hasCheckedHighContrastMode && this._platform.isBrowser && this._document.body) {
2294
2327
  const bodyClasses = this._document.body.classList;
2295
- // IE11 doesn't support `classList` operations with multiple arguments
2296
- bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);
2297
- bodyClasses.remove(BLACK_ON_WHITE_CSS_CLASS);
2298
- bodyClasses.remove(WHITE_ON_BLACK_CSS_CLASS);
2328
+ bodyClasses.remove(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
2299
2329
  this._hasCheckedHighContrastMode = true;
2300
2330
  const mode = this.getHighContrastMode();
2301
2331
  if (mode === 1 /* BLACK_ON_WHITE */) {
2302
- bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);
2303
- bodyClasses.add(BLACK_ON_WHITE_CSS_CLASS);
2332
+ bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, BLACK_ON_WHITE_CSS_CLASS);
2304
2333
  }
2305
2334
  else if (mode === 2 /* WHITE_ON_BLACK */) {
2306
- bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS);
2307
- bodyClasses.add(WHITE_ON_BLACK_CSS_CLASS);
2335
+ bodyClasses.add(HIGH_CONTRAST_MODE_ACTIVE_CSS_CLASS, WHITE_ON_BLACK_CSS_CLASS);
2308
2336
  }
2309
2337
  }
2310
2338
  }
2311
2339
  }
2312
- HighContrastModeDetector.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: HighContrastModeDetector, deps: [{ token: i1.Platform }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Injectable });
2313
- HighContrastModeDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: HighContrastModeDetector, providedIn: 'root' });
2314
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: HighContrastModeDetector, decorators: [{
2340
+ 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 });
2341
+ HighContrastModeDetector.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: HighContrastModeDetector, providedIn: 'root' });
2342
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: HighContrastModeDetector, decorators: [{
2315
2343
  type: Injectable,
2316
2344
  args: [{ providedIn: 'root' }]
2317
2345
  }], ctorParameters: function () {
@@ -2333,13 +2361,13 @@ class A11yModule {
2333
2361
  highContrastModeDetector._applyBodyHighContrastModeCssClasses();
2334
2362
  }
2335
2363
  }
2336
- A11yModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, deps: [{ token: HighContrastModeDetector }], target: i0.ɵɵFactoryTarget.NgModule });
2337
- A11yModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus], imports: [PlatformModule, ObserversModule], exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus] });
2338
- A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, imports: [[PlatformModule, ObserversModule]] });
2339
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: A11yModule, decorators: [{
2364
+ 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 });
2365
+ 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] });
2366
+ A11yModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, imports: [[ObserversModule]] });
2367
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-next.13", ngImport: i0, type: A11yModule, decorators: [{
2340
2368
  type: NgModule,
2341
2369
  args: [{
2342
- imports: [PlatformModule, ObserversModule],
2370
+ imports: [ObserversModule],
2343
2371
  declarations: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
2344
2372
  exports: [CdkAriaLive, CdkTrapFocus, CdkMonitorFocus],
2345
2373
  }]