@angular/cdk 10.0.2 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/aria-describer/aria-describer.d.ts +10 -1
- package/a11y/index.metadata.json +1 -1
- package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
- package/a11y/key-manager/list-key-manager.d.ts +6 -0
- package/accordion/accordion.d.ts +7 -1
- package/accordion/index.d.ts +1 -0
- package/accordion/index.metadata.json +1 -1
- package/bundles/cdk-a11y.umd.js +63 -11
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +11 -11
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +12 -4
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js +2 -2
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +640 -599
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +8 -16
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +199 -42
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +11 -18
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +1 -1
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +9 -1
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +7 -0
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js +1 -1
- package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.min.js +8 -8
- package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
- package/bundles/cdk-testing.umd.js +32 -0
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.min.js +5 -5
- package/bundles/cdk-testing.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +6 -2
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js +3 -3
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +1 -1
- package/bundles/cdk.umd.min.js.map +1 -1
- package/drag-drop/directives/drag-handle.d.ts +7 -1
- package/drag-drop/directives/drag-placeholder.d.ts +7 -1
- package/drag-drop/directives/drag-preview.d.ts +7 -1
- package/drag-drop/directives/drag.d.ts +3 -7
- package/drag-drop/directives/drop-list-group.d.ts +7 -1
- package/drag-drop/directives/drop-list.d.ts +7 -1
- package/drag-drop/index.d.ts +2 -2
- package/drag-drop/index.metadata.json +1 -1
- package/esm2015/a11y/aria-describer/aria-describer.js +20 -6
- package/esm2015/a11y/interactivity-checker/interactivity-checker.js +16 -3
- package/esm2015/a11y/key-manager/list-key-manager.js +27 -2
- package/esm2015/accordion/accordion-item.js +7 -7
- package/esm2015/accordion/accordion.js +9 -2
- package/esm2015/accordion/index.js +2 -1
- package/esm2015/drag-drop/directives/drag-handle.js +11 -4
- package/esm2015/drag-drop/directives/drag-placeholder.js +10 -3
- package/esm2015/drag-drop/directives/drag-preview.js +10 -3
- package/esm2015/drag-drop/directives/drag.js +19 -15
- package/esm2015/drag-drop/directives/drop-list-group.js +9 -2
- package/esm2015/drag-drop/directives/drop-list.js +11 -6
- package/esm2015/drag-drop/index.js +3 -2
- package/esm2015/layout/breakpoints-observer.js +1 -1
- package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
- package/esm2015/overlay/dispatchers/index.js +10 -0
- package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
- package/esm2015/overlay/index.js +5 -4
- package/esm2015/overlay/overlay-config.js +5 -1
- package/esm2015/overlay/overlay-directives.js +17 -7
- package/esm2015/overlay/overlay-module.js +2 -2
- package/esm2015/overlay/overlay-ref.js +24 -2
- package/esm2015/overlay/overlay-reference.js +1 -1
- package/esm2015/overlay/overlay.js +10 -5
- package/esm2015/overlay/position/overlay-position-builder.js +1 -1
- package/esm2015/overlay/public-api.js +2 -2
- package/esm2015/scrolling/public-api.js +2 -1
- package/esm2015/scrolling/virtual-for-of.js +1 -1
- package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
- package/esm2015/scrolling/virtual-scroll-viewport.js +2 -2
- package/esm2015/testing/component-harness.js +19 -1
- package/esm2015/testing/harness-environment.js +7 -1
- package/esm2015/tree/control/nested-tree-control.js +7 -3
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +60 -10
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/accordion.js +13 -6
- package/fesm2015/accordion.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/drag-drop.js +607 -570
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/overlay.js +196 -32
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/scrolling.js +9 -1
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/testing.js +25 -1
- package/fesm2015/testing.js.map +1 -1
- package/fesm2015/tree.js +6 -2
- package/fesm2015/tree.js.map +1 -1
- package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
- package/overlay/dispatchers/index.d.ts +9 -0
- package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
- package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
- package/overlay/index.d.ts +4 -3
- package/overlay/index.metadata.json +1 -1
- package/overlay/overlay-config.d.ts +4 -0
- package/overlay/overlay-directives.d.ts +4 -0
- package/overlay/overlay-ref.d.ts +8 -2
- package/overlay/overlay-reference.d.ts +1 -0
- package/overlay/overlay.d.ts +4 -2
- package/overlay/public-api.d.ts +1 -1
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/scrolling/index.metadata.json +1 -1
- package/scrolling/public-api.d.ts +1 -0
- package/scrolling/virtual-for-of.d.ts +2 -1
- package/scrolling/virtual-scroll-repeater.d.ts +16 -0
- package/scrolling/virtual-scroll-viewport.d.ts +4 -4
- package/testing/component-harness.d.ts +12 -0
- package/testing/harness-environment.d.ts +1 -0
- package/tree/control/nested-tree-control.d.ts +7 -2
- package/tree/index.metadata.json +1 -1
- 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
|
/**
|
|
@@ -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.
|
|
176
|
-
|
|
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.
|
|
@@ -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) &&
|
|
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
|