@angular/cdk 10.0.2 → 10.1.3

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 (216) hide show
  1. package/a11y/aria-describer/aria-describer.d.ts +10 -1
  2. package/a11y/index.metadata.json +1 -1
  3. package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
  4. package/a11y/key-manager/list-key-manager.d.ts +6 -0
  5. package/accordion/accordion.d.ts +7 -1
  6. package/accordion/index.d.ts +1 -0
  7. package/accordion/index.metadata.json +1 -1
  8. package/bundles/cdk-a11y.umd.js +514 -410
  9. package/bundles/cdk-a11y.umd.js.map +1 -1
  10. package/bundles/cdk-a11y.umd.min.js +35 -11
  11. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  12. package/bundles/cdk-accordion.umd.js +47 -39
  13. package/bundles/cdk-accordion.umd.js.map +1 -1
  14. package/bundles/cdk-accordion.umd.min.js +10 -2
  15. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  16. package/bundles/cdk-bidi.umd.js +25 -25
  17. package/bundles/cdk-bidi.umd.js.map +1 -1
  18. package/bundles/cdk-bidi.umd.min.js +5 -4
  19. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  20. package/bundles/cdk-clipboard.umd.js +37 -36
  21. package/bundles/cdk-clipboard.umd.js.map +1 -1
  22. package/bundles/cdk-clipboard.umd.min.js +10 -2
  23. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  24. package/bundles/cdk-coercion.umd.js.map +1 -1
  25. package/bundles/cdk-collections.umd.js +303 -237
  26. package/bundles/cdk-collections.umd.js.map +1 -1
  27. package/bundles/cdk-collections.umd.min.js +3 -9
  28. package/bundles/cdk-collections.umd.min.js.map +1 -1
  29. package/bundles/cdk-drag-drop.umd.js +1059 -927
  30. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  31. package/bundles/cdk-drag-drop.umd.min.js +72 -10
  32. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  33. package/bundles/cdk-keycodes.umd.js.map +1 -1
  34. package/bundles/cdk-layout.umd.js +18 -18
  35. package/bundles/cdk-layout.umd.js.map +1 -1
  36. package/bundles/cdk-layout.umd.min.js +6 -5
  37. package/bundles/cdk-layout.umd.min.js.map +1 -1
  38. package/bundles/cdk-observers.umd.js +34 -34
  39. package/bundles/cdk-observers.umd.js.map +1 -1
  40. package/bundles/cdk-observers.umd.min.js +2 -2
  41. package/bundles/cdk-observers.umd.min.js.map +1 -1
  42. package/bundles/cdk-overlay.umd.js +638 -416
  43. package/bundles/cdk-overlay.umd.js.map +1 -1
  44. package/bundles/cdk-overlay.umd.min.js +51 -12
  45. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  46. package/bundles/cdk-platform.umd.js +10 -10
  47. package/bundles/cdk-platform.umd.js.map +1 -1
  48. package/bundles/cdk-platform.umd.min.js +4 -11
  49. package/bundles/cdk-platform.umd.min.js.map +1 -1
  50. package/bundles/cdk-portal.umd.js +355 -300
  51. package/bundles/cdk-portal.umd.js.map +1 -1
  52. package/bundles/cdk-portal.umd.min.js +4 -5
  53. package/bundles/cdk-portal.umd.min.js.map +1 -1
  54. package/bundles/cdk-scrolling.umd.js +482 -392
  55. package/bundles/cdk-scrolling.umd.js.map +1 -1
  56. package/bundles/cdk-scrolling.umd.min.js +20 -12
  57. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  58. package/bundles/cdk-stepper.umd.js +117 -117
  59. package/bundles/cdk-stepper.umd.js.map +1 -1
  60. package/bundles/cdk-stepper.umd.min.js +11 -2
  61. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  62. package/bundles/cdk-table.umd.js +862 -607
  63. package/bundles/cdk-table.umd.js.map +1 -1
  64. package/bundles/cdk-table.umd.min.js +8 -15
  65. package/bundles/cdk-table.umd.min.js.map +1 -1
  66. package/bundles/cdk-testing-protractor.umd.js +300 -241
  67. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  68. package/bundles/cdk-testing-protractor.umd.min.js +2 -9
  69. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  70. package/bundles/cdk-testing-testbed.umd.js +337 -276
  71. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  72. package/bundles/cdk-testing-testbed.umd.min.js +7 -30
  73. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  74. package/bundles/cdk-testing.umd.js +358 -270
  75. package/bundles/cdk-testing.umd.js.map +1 -1
  76. package/bundles/cdk-testing.umd.min.js +3 -18
  77. package/bundles/cdk-testing.umd.min.js.map +1 -1
  78. package/bundles/cdk-text-field.umd.js +51 -51
  79. package/bundles/cdk-text-field.umd.js.map +1 -1
  80. package/bundles/cdk-text-field.umd.min.js +10 -2
  81. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  82. package/bundles/cdk-tree.umd.js +449 -396
  83. package/bundles/cdk-tree.umd.js.map +1 -1
  84. package/bundles/cdk-tree.umd.min.js +28 -3
  85. package/bundles/cdk-tree.umd.min.js.map +1 -1
  86. package/bundles/cdk.umd.js +1 -1
  87. package/bundles/cdk.umd.js.map +1 -1
  88. package/bundles/cdk.umd.min.js +1 -1
  89. package/bundles/cdk.umd.min.js.map +1 -1
  90. package/drag-drop/clone-node.d.ts +9 -0
  91. package/drag-drop/directives/drag-handle.d.ts +8 -2
  92. package/drag-drop/directives/drag-placeholder.d.ts +7 -1
  93. package/drag-drop/directives/drag-preview.d.ts +7 -1
  94. package/drag-drop/directives/drag.d.ts +3 -7
  95. package/drag-drop/directives/drop-list-group.d.ts +7 -1
  96. package/drag-drop/directives/drop-list.d.ts +7 -1
  97. package/drag-drop/index.d.ts +2 -2
  98. package/drag-drop/index.metadata.json +1 -1
  99. package/drag-drop/parent-position-tracker.d.ts +1 -1
  100. package/esm2015/a11y/aria-describer/aria-describer.js +21 -7
  101. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  102. package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
  103. package/esm2015/a11y/interactivity-checker/interactivity-checker.js +43 -30
  104. package/esm2015/a11y/key-manager/list-key-manager.js +27 -2
  105. package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
  106. package/esm2015/accordion/accordion-item.js +7 -7
  107. package/esm2015/accordion/accordion.js +9 -2
  108. package/esm2015/accordion/index.js +2 -1
  109. package/esm2015/clipboard/pending-copy.js +7 -6
  110. package/esm2015/drag-drop/clone-node.js +54 -0
  111. package/esm2015/drag-drop/directives/drag-handle.js +12 -5
  112. package/esm2015/drag-drop/directives/drag-placeholder.js +10 -3
  113. package/esm2015/drag-drop/directives/drag-preview.js +10 -3
  114. package/esm2015/drag-drop/directives/drag.js +19 -15
  115. package/esm2015/drag-drop/directives/drop-list-group.js +9 -2
  116. package/esm2015/drag-drop/directives/drop-list.js +19 -8
  117. package/esm2015/drag-drop/drag-ref.js +2 -29
  118. package/esm2015/drag-drop/index.js +3 -2
  119. package/esm2015/layout/breakpoints-observer.js +1 -1
  120. package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
  121. package/esm2015/overlay/dispatchers/index.js +10 -0
  122. package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
  123. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
  124. package/esm2015/overlay/index.js +5 -4
  125. package/esm2015/overlay/overlay-config.js +5 -1
  126. package/esm2015/overlay/overlay-directives.js +34 -8
  127. package/esm2015/overlay/overlay-module.js +2 -2
  128. package/esm2015/overlay/overlay-ref.js +24 -2
  129. package/esm2015/overlay/overlay-reference.js +1 -1
  130. package/esm2015/overlay/overlay.js +10 -5
  131. package/esm2015/overlay/position/connected-position-strategy.js +1 -5
  132. package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -3
  133. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  134. package/esm2015/overlay/public-api.js +2 -2
  135. package/esm2015/portal/dom-portal-outlet.js +5 -2
  136. package/esm2015/scrolling/public-api.js +2 -1
  137. package/esm2015/scrolling/scrolling-module.js +4 -1
  138. package/esm2015/scrolling/viewport-ruler.js +24 -10
  139. package/esm2015/scrolling/virtual-for-of.js +26 -12
  140. package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
  141. package/esm2015/scrolling/virtual-scroll-viewport.js +2 -2
  142. package/esm2015/table/cell.js +18 -3
  143. package/esm2015/table/coalesced-style-scheduler.js +87 -0
  144. package/esm2015/table/public-api.js +2 -1
  145. package/esm2015/table/sticky-styler.js +79 -45
  146. package/esm2015/table/table.js +33 -12
  147. package/esm2015/testing/component-harness.js +19 -1
  148. package/esm2015/testing/harness-environment.js +7 -1
  149. package/esm2015/testing/testbed/fake-events/dispatch-events.js +5 -4
  150. package/esm2015/testing/testbed/fake-events/event-objects.js +10 -7
  151. package/esm2015/testing/testbed/fake-events/type-in-element.js +4 -4
  152. package/esm2015/testing/testbed/unit-test-element.js +20 -12
  153. package/esm2015/tree/control/nested-tree-control.js +7 -3
  154. package/esm2015/tree/tree.js +9 -23
  155. package/esm2015/version.js +1 -1
  156. package/fesm2015/a11y.js +88 -38
  157. package/fesm2015/a11y.js.map +1 -1
  158. package/fesm2015/accordion.js +13 -6
  159. package/fesm2015/accordion.js.map +1 -1
  160. package/fesm2015/cdk.js +1 -1
  161. package/fesm2015/cdk.js.map +1 -1
  162. package/fesm2015/clipboard.js +6 -5
  163. package/fesm2015/clipboard.js.map +1 -1
  164. package/fesm2015/drag-drop.js +669 -600
  165. package/fesm2015/drag-drop.js.map +1 -1
  166. package/fesm2015/overlay.js +215 -40
  167. package/fesm2015/overlay.js.map +1 -1
  168. package/fesm2015/portal.js +4 -1
  169. package/fesm2015/portal.js.map +1 -1
  170. package/fesm2015/scrolling.js +60 -21
  171. package/fesm2015/scrolling.js.map +1 -1
  172. package/fesm2015/table.js +214 -61
  173. package/fesm2015/table.js.map +1 -1
  174. package/fesm2015/testing/testbed.js +35 -23
  175. package/fesm2015/testing/testbed.js.map +1 -1
  176. package/fesm2015/testing.js +25 -1
  177. package/fesm2015/testing.js.map +1 -1
  178. package/fesm2015/tree.js +13 -23
  179. package/fesm2015/tree.js.map +1 -1
  180. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
  181. package/overlay/dispatchers/index.d.ts +9 -0
  182. package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
  183. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
  184. package/overlay/index.d.ts +4 -3
  185. package/overlay/index.metadata.json +1 -1
  186. package/overlay/overlay-config.d.ts +4 -0
  187. package/overlay/overlay-directives.d.ts +5 -0
  188. package/overlay/overlay-ref.d.ts +8 -2
  189. package/overlay/overlay-reference.d.ts +1 -0
  190. package/overlay/overlay.d.ts +4 -2
  191. package/overlay/position/connected-position-strategy.d.ts +0 -2
  192. package/overlay/public-api.d.ts +1 -1
  193. package/package.json +1 -1
  194. package/schematics/ng-add/index.js +1 -1
  195. package/scrolling/index.metadata.json +1 -1
  196. package/scrolling/public-api.d.ts +1 -0
  197. package/scrolling/scrolling-module.d.ts +3 -0
  198. package/scrolling/viewport-ruler.d.ts +2 -2
  199. package/scrolling/virtual-for-of.d.ts +2 -1
  200. package/scrolling/virtual-scroll-repeater.d.ts +16 -0
  201. package/scrolling/virtual-scroll-viewport.d.ts +4 -4
  202. package/table/cell.d.ts +13 -0
  203. package/table/coalesced-style-scheduler.d.ts +41 -0
  204. package/table/index.metadata.json +1 -1
  205. package/table/public-api.d.ts +1 -0
  206. package/table/sticky-styler.d.ts +7 -1
  207. package/table/table.d.ts +9 -1
  208. package/testing/component-harness.d.ts +12 -0
  209. package/testing/harness-environment.d.ts +1 -0
  210. package/testing/testbed/fake-events/dispatch-events.d.ts +3 -2
  211. package/testing/testbed/fake-events/event-objects.d.ts +2 -2
  212. package/testing/testbed/unit-test-element.d.ts +7 -0
  213. package/tree/control/nested-tree-control.d.ts +7 -2
  214. package/tree/index.metadata.json +1 -1
  215. package/tree/tree.d.ts +2 -4
  216. package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -96
package/fesm2015/a11y.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import { DOCUMENT } from '@angular/common';
2
2
  import { ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, QueryList, isDevMode, NgZone, Directive, ElementRef, Input, InjectionToken, Optional, EventEmitter, Output, NgModule } from '@angular/core';
3
+ import { Platform, normalizePassiveListenerOptions, _getShadowRoot, PlatformModule } from '@angular/cdk/platform';
3
4
  import { Subject, Subscription, of } from 'rxjs';
4
- import { hasModifierKey, A, Z, ZERO, NINE, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB } from '@angular/cdk/keycodes';
5
+ import { hasModifierKey, A, Z, ZERO, NINE, END, HOME, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, TAB } from '@angular/cdk/keycodes';
5
6
  import { tap, debounceTime, filter, map, take } from 'rxjs/operators';
6
7
  import { coerceBooleanProperty, coerceElement } from '@angular/cdk/coercion';
7
- import { Platform, normalizePassiveListenerOptions, _getShadowRoot, PlatformModule } from '@angular/cdk/platform';
8
8
  import { ContentObserver, ObserversModule } from '@angular/cdk/observers';
9
9
 
10
10
  /**
@@ -76,7 +76,12 @@ let messagesContainer = null;
76
76
  * content.
77
77
  */
78
78
  class AriaDescriber {
79
- constructor(_document) {
79
+ constructor(_document,
80
+ /**
81
+ * @breaking-change 8.0.0 `_platform` parameter to be made required.
82
+ */
83
+ _platform) {
84
+ this._platform = _platform;
80
85
  this._document = _document;
81
86
  }
82
87
  /**
@@ -102,7 +107,7 @@ class AriaDescriber {
102
107
  }
103
108
  /** Removes the host element's aria-describedby reference to the message element. */
104
109
  removeDescription(hostElement, message) {
105
- if (!this._isElementNode(hostElement)) {
110
+ if (!message || !this._isElementNode(hostElement)) {
106
111
  return;
107
112
  }
108
113
  if (this._isElementDescribedByMessage(hostElement, message)) {
@@ -162,6 +167,8 @@ class AriaDescriber {
162
167
  /** Creates the global container for all aria-describedby messages. */
163
168
  _createMessagesContainer() {
164
169
  if (!messagesContainer) {
170
+ // @breaking-change 8.0.0 `_platform` null check can be removed once the parameter is required
171
+ const canBeAriaHidden = !this._platform || (!this._platform.EDGE && !this._platform.TRIDENT);
165
172
  const preExistingContainer = this._document.getElementById(MESSAGES_CONTAINER_ID);
166
173
  // When going from the server to the client, we may end up in a situation where there's
167
174
  // already a container on the page, but we don't have a reference to it. Clear the
@@ -172,8 +179,12 @@ class AriaDescriber {
172
179
  }
173
180
  messagesContainer = this._document.createElement('div');
174
181
  messagesContainer.id = MESSAGES_CONTAINER_ID;
175
- messagesContainer.setAttribute('aria-hidden', 'true');
176
- messagesContainer.style.display = 'none';
182
+ messagesContainer.classList.add('cdk-visually-hidden');
183
+ // IE and Edge won't read out the messages if they're in an `aria-hidden` container.
184
+ // We only disable `aria-hidden` for these platforms, because it comes with the
185
+ // disadvantage that people might hit the messages when they've navigated past
186
+ // the end of the document using the arrow keys.
187
+ messagesContainer.setAttribute('aria-hidden', canBeAriaHidden + '');
177
188
  this._document.body.appendChild(messagesContainer);
178
189
  }
179
190
  }
@@ -242,12 +253,13 @@ class AriaDescriber {
242
253
  return element.nodeType === this._document.ELEMENT_NODE;
243
254
  }
244
255
  }
245
- AriaDescriber.ɵprov = ɵɵdefineInjectable({ factory: function AriaDescriber_Factory() { return new AriaDescriber(ɵɵinject(DOCUMENT)); }, token: AriaDescriber, providedIn: "root" });
256
+ AriaDescriber.ɵprov = ɵɵdefineInjectable({ factory: function AriaDescriber_Factory() { return new AriaDescriber(ɵɵinject(DOCUMENT), ɵɵinject(Platform)); }, token: AriaDescriber, providedIn: "root" });
246
257
  AriaDescriber.decorators = [
247
258
  { type: Injectable, args: [{ providedIn: 'root' },] }
248
259
  ];
249
260
  AriaDescriber.ctorParameters = () => [
250
- { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
261
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
262
+ { type: Platform }
251
263
  ];
252
264
 
253
265
  /**
@@ -271,6 +283,7 @@ class ListKeyManager {
271
283
  this._typeaheadSubscription = Subscription.EMPTY;
272
284
  this._vertical = true;
273
285
  this._allowedModifierKeys = [];
286
+ this._homeAndEnd = false;
274
287
  /**
275
288
  * Predicate function that can be used to check whether an item should be skipped
276
289
  * by the key manager. By default, disabled items are skipped.
@@ -372,6 +385,14 @@ class ListKeyManager {
372
385
  });
373
386
  return this;
374
387
  }
388
+ /**
389
+ * Configures the key manager to focus the first and last items
390
+ * respectively when the Home key and End Key are pressed.
391
+ */
392
+ withHomeAndEnd() {
393
+ this._homeAndEnd = true;
394
+ return this;
395
+ }
375
396
  setActiveItem(item) {
376
397
  const previousActiveItem = this._activeItem;
377
398
  this.updateActiveItem(item);
@@ -425,6 +446,22 @@ class ListKeyManager {
425
446
  else {
426
447
  return;
427
448
  }
449
+ case HOME:
450
+ if (this._homeAndEnd && isModifierAllowed) {
451
+ this.setFirstItemActive();
452
+ break;
453
+ }
454
+ else {
455
+ return;
456
+ }
457
+ case END:
458
+ if (this._homeAndEnd && isModifierAllowed) {
459
+ this.setLastItemActive();
460
+ break;
461
+ }
462
+ else {
463
+ return;
464
+ }
428
465
  default:
429
466
  if (isModifierAllowed || hasModifierKey(event, 'shiftKey')) {
430
467
  // Attempt to use the `event.key` which also maps it to the user's keyboard language,
@@ -590,6 +627,17 @@ class FocusKeyManager extends ListKeyManager {
590
627
  * Use of this source code is governed by an MIT-style license that can be
591
628
  * found in the LICENSE file at https://angular.io/license
592
629
  */
630
+ /**
631
+ * Configuration for the isFocusable method.
632
+ */
633
+ class IsFocusableConfig {
634
+ constructor() {
635
+ /**
636
+ * Whether to count an element as focusable even if it is not currently visible.
637
+ */
638
+ this.ignoreVisibility = false;
639
+ }
640
+ }
593
641
  // The InteractivityChecker leans heavily on the ally.js accessibility utilities.
594
642
  // Methods like `isTabbable` are only covering specific edge-cases for the browsers which are
595
643
  // supported.
@@ -637,17 +685,12 @@ class InteractivityChecker {
637
685
  }
638
686
  const frameElement = getFrameElement(getWindow(element));
639
687
  if (frameElement) {
640
- const frameType = frameElement && frameElement.nodeName.toLowerCase();
641
688
  // Frame elements inherit their tabindex onto all child elements.
642
689
  if (getTabIndexValue(frameElement) === -1) {
643
690
  return false;
644
691
  }
645
- // Webkit and Blink consider anything inside of an <object> element as non-tabbable.
646
- if ((this._platform.BLINK || this._platform.WEBKIT) && frameType === 'object') {
647
- return false;
648
- }
649
- // Webkit and Blink disable tabbing to an element inside of an invisible frame.
650
- if ((this._platform.BLINK || this._platform.WEBKIT) && !this.isVisible(frameElement)) {
692
+ // Browsers disable tabbing to an element inside of an invisible frame.
693
+ if (!this.isVisible(frameElement)) {
651
694
  return false;
652
695
  }
653
696
  }
@@ -656,38 +699,43 @@ class InteractivityChecker {
656
699
  if (element.hasAttribute('contenteditable')) {
657
700
  return tabIndexValue !== -1;
658
701
  }
659
- if (nodeName === 'iframe') {
660
- // The frames may be tabbable depending on content, but it's not possibly to reliably
661
- // investigate the content of the frames.
702
+ if (nodeName === 'iframe' || nodeName === 'object') {
703
+ // The frame or object's content may be tabbable depending on the content, but it's
704
+ // not possibly to reliably detect the content of the frames. We always consider such
705
+ // elements as non-tabbable.
706
+ return false;
707
+ }
708
+ // In iOS, the browser only considers some specific elements as tabbable.
709
+ if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {
662
710
  return false;
663
711
  }
664
712
  if (nodeName === 'audio') {
713
+ // Audio elements without controls enabled are never tabbable, regardless
714
+ // of the tabindex attribute explicitly being set.
665
715
  if (!element.hasAttribute('controls')) {
666
- // By default an <audio> element without the controls enabled is not tabbable.
667
716
  return false;
668
717
  }
669
- else if (this._platform.BLINK) {
670
- // In Blink <audio controls> elements are always tabbable.
671
- return true;
672
- }
718
+ // Audio elements with controls are by default tabbable unless the
719
+ // tabindex attribute is set to `-1` explicitly.
720
+ return tabIndexValue !== -1;
673
721
  }
674
722
  if (nodeName === 'video') {
675
- if (!element.hasAttribute('controls') && this._platform.TRIDENT) {
676
- // In Trident a <video> element without the controls enabled is not tabbable.
723
+ // For all video elements, if the tabindex attribute is set to `-1`, the video
724
+ // is not tabbable. Note: We cannot rely on the default `HTMLElement.tabIndex`
725
+ // property as that one is set to `-1` in Chrome, Edge and Safari v13.1. The
726
+ // tabindex attribute is the source of truth here.
727
+ if (tabIndexValue === -1) {
677
728
  return false;
678
729
  }
679
- else if (this._platform.BLINK || this._platform.FIREFOX) {
680
- // In Chrome and Firefox <video controls> elements are always tabbable.
730
+ // If the tabindex is explicitly set, and not `-1` (as per check before), the
731
+ // video element is always tabbable (regardless of whether it has controls or not).
732
+ if (tabIndexValue !== null) {
681
733
  return true;
682
734
  }
683
- }
684
- if (nodeName === 'object' && (this._platform.BLINK || this._platform.WEBKIT)) {
685
- // In all Blink and WebKit based browsers <object> elements are never tabbable.
686
- return false;
687
- }
688
- // In iOS the browser only considers some specific elements as tabbable.
689
- if (this._platform.WEBKIT && this._platform.IOS && !isPotentiallyTabbableIOS(element)) {
690
- return false;
735
+ // Otherwise (when no explicit tabindex is set), a video is only tabbable if it
736
+ // has controls enabled. Firefox is special as videos are always tabbable regardless
737
+ // of whether there are controls or not.
738
+ return this._platform.FIREFOX || element.hasAttribute('controls');
691
739
  }
692
740
  return element.tabIndex >= 0;
693
741
  }
@@ -695,12 +743,14 @@ class InteractivityChecker {
695
743
  * Gets whether an element can be focused by the user.
696
744
  *
697
745
  * @param element Element to be checked.
746
+ * @param config The config object with options to customize this method's behavior
698
747
  * @returns Whether the element is focusable.
699
748
  */
700
- isFocusable(element) {
749
+ isFocusable(element, config) {
701
750
  // Perform checks in order of left to most expensive.
702
751
  // Again, naive approach that does not capture many edge cases and browser quirks.
703
- return isPotentiallyFocusable(element) && !this.isDisabled(element) && this.isVisible(element);
752
+ return isPotentiallyFocusable(element) && !this.isDisabled(element) &&
753
+ ((config === null || config === void 0 ? void 0 : config.ignoreVisibility) || this.isVisible(element));
704
754
  }
705
755
  }
706
756
  InteractivityChecker.ɵprov = ɵɵdefineInjectable({ factory: function InteractivityChecker_Factory() { return new InteractivityChecker(ɵɵinject(Platform)); }, token: InteractivityChecker, providedIn: "root" });
@@ -2162,5 +2212,5 @@ A11yModule.ctorParameters = () => [
2162
2212
  * Generated bundle index. Do not edit.
2163
2213
  */
2164
2214
 
2165
- export { A11yModule, ActiveDescendantKeyManager, AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, CDK_DESCRIBEDBY_ID_PREFIX, CdkAriaLive, CdkMonitorFocus, CdkTrapFocus, ConfigurableFocusTrap, ConfigurableFocusTrapFactory, EventListenerFocusTrapInertStrategy, FOCUS_MONITOR_DEFAULT_OPTIONS, FOCUS_TRAP_INERT_STRATEGY, FocusKeyManager, FocusMonitor, FocusTrap, FocusTrapFactory, HighContrastModeDetector, InteractivityChecker, LIVE_ANNOUNCER_DEFAULT_OPTIONS, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, ListKeyManager, LiveAnnouncer, MESSAGES_CONTAINER_ID, TOUCH_BUFFER_MS, isFakeMousedownFromScreenReader, FocusTrapManager as ɵangular_material_src_cdk_a11y_a11y_a, ConfigurableFocusTrapConfig as ɵangular_material_src_cdk_a11y_a11y_b };
2215
+ export { A11yModule, ActiveDescendantKeyManager, AriaDescriber, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, CDK_DESCRIBEDBY_ID_PREFIX, CdkAriaLive, CdkMonitorFocus, CdkTrapFocus, ConfigurableFocusTrap, ConfigurableFocusTrapFactory, EventListenerFocusTrapInertStrategy, FOCUS_MONITOR_DEFAULT_OPTIONS, FOCUS_TRAP_INERT_STRATEGY, FocusKeyManager, FocusMonitor, FocusTrap, FocusTrapFactory, HighContrastModeDetector, InteractivityChecker, IsFocusableConfig, LIVE_ANNOUNCER_DEFAULT_OPTIONS, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, ListKeyManager, LiveAnnouncer, MESSAGES_CONTAINER_ID, TOUCH_BUFFER_MS, isFakeMousedownFromScreenReader, FocusTrapManager as ɵangular_material_src_cdk_a11y_a11y_a, ConfigurableFocusTrapConfig as ɵangular_material_src_cdk_a11y_a11y_b };
2166
2216
  //# sourceMappingURL=a11y.js.map