@angular/cdk 8.0.0-beta.2 → 8.0.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/README.md +2 -2
- package/_overlay.scss +4 -4
- package/bundles/cdk-a11y.umd.js +227 -79
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +1 -1
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-accordion.umd.js +20 -8
- package/bundles/cdk-accordion.umd.js.map +1 -1
- package/bundles/cdk-accordion.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +5 -5
- package/bundles/cdk-bidi.umd.min.js +1 -1
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +5 -5
- package/bundles/cdk-collections.umd.js +38 -15
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +1 -1
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +571 -180
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.min.js +2 -2
- package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js +7 -3
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +83 -30
- package/bundles/cdk-layout.umd.js.map +1 -1
- package/bundles/cdk-layout.umd.min.js +1 -1
- package/bundles/cdk-layout.umd.min.js.map +1 -1
- package/bundles/cdk-observers.umd.js +30 -11
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +1 -1
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +229 -108
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +17 -10
- package/bundles/cdk-platform.umd.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-portal.umd.js +32 -13
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +184 -62
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +1 -1
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +30 -12
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +384 -74
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +1 -1
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk-text-field.umd.js +61 -21
- package/bundles/cdk-text-field.umd.js.map +1 -1
- package/bundles/cdk-text-field.umd.min.js +1 -1
- package/bundles/cdk-text-field.umd.min.js.map +1 -1
- package/bundles/cdk-tree.umd.js +85 -29
- package/bundles/cdk-tree.umd.js.map +1 -1
- package/bundles/cdk-tree.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +2 -2
- 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/typings/directives/drag.d.ts +11 -2
- package/drag-drop/typings/drag-events.d.ts +17 -0
- package/drag-drop/typings/drag-ref.d.ts +9 -5
- package/drag-drop/typings/drop-list-ref.d.ts +9 -3
- package/drag-drop/typings/index.metadata.json +1 -1
- package/esm2015/a11y.js +229 -81
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/accordion.js +22 -10
- package/esm2015/accordion.js.map +1 -1
- package/esm2015/bidi.js +8 -8
- package/esm2015/cdk.js +4 -4
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +7 -7
- package/esm2015/collections.js +41 -18
- package/esm2015/collections.js.map +1 -1
- package/esm2015/drag-drop.js +540 -181
- package/esm2015/drag-drop.js.map +1 -1
- package/esm2015/keycodes.js +9 -5
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +89 -36
- package/esm2015/layout.js.map +1 -1
- package/esm2015/observers.js +33 -14
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +232 -110
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +20 -13
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +34 -15
- package/esm2015/portal.js.map +1 -1
- package/esm2015/scrolling.js +180 -58
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +32 -14
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +369 -69
- package/esm2015/table.js.map +1 -1
- package/esm2015/text-field.js +64 -24
- package/esm2015/text-field.js.map +1 -1
- package/esm2015/tree.js +86 -30
- package/esm2015/tree.js.map +1 -1
- package/esm5/a11y.es5.js +230 -82
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/accordion.es5.js +22 -10
- package/esm5/accordion.es5.js.map +1 -1
- package/esm5/bidi.es5.js +8 -8
- package/esm5/cdk.es5.js +4 -4
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +7 -7
- package/esm5/collections.es5.js +42 -19
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/drag-drop.es5.js +574 -183
- package/esm5/drag-drop.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +9 -5
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +86 -33
- package/esm5/layout.es5.js.map +1 -1
- package/esm5/observers.es5.js +33 -14
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +232 -111
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +20 -13
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +34 -15
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +187 -65
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +32 -14
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +386 -72
- package/esm5/table.es5.js.map +1 -1
- package/esm5/text-field.es5.js +64 -24
- package/esm5/text-field.es5.js.map +1 -1
- package/esm5/tree.es5.js +87 -31
- package/esm5/tree.es5.js.map +1 -1
- package/layout/typings/breakpoints-observer.d.ts +3 -3
- package/layout/typings/index.metadata.json +1 -1
- package/layout/typings/media-matcher.d.ts +2 -2
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/position/flexible-connected-position-strategy.d.ts +1 -3
- package/package.json +8 -8
- package/portal/typings/portal.d.ts +2 -2
- package/schematics/ng-update/data/attribute-selectors.js +1 -1
- package/schematics/ng-update/data/attribute-selectors.js.map +1 -1
- package/schematics/ng-update/data/class-names.js +3 -3
- package/schematics/ng-update/data/class-names.js.map +1 -1
- package/schematics/ng-update/data/constructor-checks.js +1 -1
- package/schematics/ng-update/data/constructor-checks.js.map +1 -1
- package/schematics/ng-update/data/input-names.js +1 -1
- package/schematics/ng-update/data/input-names.js.map +1 -1
- package/schematics/ng-update/data/method-call-checks.js +1 -1
- package/schematics/ng-update/data/method-call-checks.js.map +1 -1
- package/schematics/ng-update/data/property-names.js +4 -4
- package/schematics/ng-update/data/property-names.js.map +1 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js +1 -1
- package/schematics/ng-update/upgrade-rules/signature-check/constructorSignatureCheckRule.js.map +1 -1
- package/schematics/tsconfig.tsbuildinfo +5811 -0
- package/schematics/utils/ast.d.ts +1 -1
- package/schematics/utils/build-component.js +1 -1
- package/schematics/utils/build-component.js.map +1 -1
- package/schematics/utils/get-project.d.ts +1 -1
- package/schematics/utils/project-main-file.d.ts +1 -1
- package/schematics/utils/project-style-file.d.ts +1 -1
- package/schematics/utils/project-targets.d.ts +1 -1
- package/schematics/utils/schematic-options.d.ts +1 -1
- package/table/typings/cell.d.ts +3 -2
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/public-api.d.ts +1 -0
- package/table/typings/row.d.ts +5 -4
- package/table/typings/sticky-styler.d.ts +5 -5
- package/table/typings/table-errors.d.ts +10 -0
- package/table/typings/text-column.d.ts +80 -0
- package/typings/drag-drop/directives/drag.d.ts +11 -2
- package/typings/drag-drop/drag-events.d.ts +17 -0
- package/typings/drag-drop/drag-ref.d.ts +9 -5
- package/typings/drag-drop/drop-list-ref.d.ts +9 -3
- package/typings/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/drag-drop/directives/drag.d.ts +11 -2
- package/typings/esm5/drag-drop/drag-events.d.ts +17 -0
- package/typings/esm5/drag-drop/drag-ref.d.ts +9 -5
- package/typings/esm5/drag-drop/drop-list-ref.d.ts +9 -3
- package/typings/esm5/drag-drop/index.metadata.json +1 -1
- package/typings/esm5/index.metadata.json +1 -1
- package/typings/esm5/layout/breakpoints-observer.d.ts +3 -3
- package/typings/esm5/layout/index.metadata.json +1 -1
- package/typings/esm5/layout/media-matcher.d.ts +2 -2
- package/typings/esm5/overlay/index.metadata.json +1 -1
- package/typings/esm5/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
- package/typings/esm5/portal/portal.d.ts +2 -2
- package/typings/esm5/table/cell.d.ts +3 -2
- package/typings/esm5/table/index.metadata.json +1 -1
- package/typings/esm5/table/public-api.d.ts +1 -0
- package/typings/esm5/table/row.d.ts +5 -4
- package/typings/esm5/table/sticky-styler.d.ts +5 -5
- package/typings/esm5/table/table-errors.d.ts +10 -0
- package/typings/esm5/table/text-column.d.ts +80 -0
- package/typings/index.metadata.json +1 -1
- package/typings/layout/breakpoints-observer.d.ts +3 -3
- package/typings/layout/index.metadata.json +1 -1
- package/typings/layout/media-matcher.d.ts +2 -2
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/position/flexible-connected-position-strategy.d.ts +1 -3
- package/typings/portal/portal.d.ts +2 -2
- package/typings/schematics/utils/ast.d.ts +1 -1
- package/typings/schematics/utils/get-project.d.ts +1 -1
- package/typings/schematics/utils/project-main-file.d.ts +1 -1
- package/typings/schematics/utils/project-style-file.d.ts +1 -1
- package/typings/schematics/utils/project-targets.d.ts +1 -1
- package/typings/schematics/utils/schematic-options.d.ts +1 -1
- package/typings/table/cell.d.ts +3 -2
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/public-api.d.ts +1 -0
- package/typings/table/row.d.ts +5 -4
- package/typings/table/sticky-styler.d.ts +5 -5
- package/typings/table/table-errors.d.ts +10 -0
- package/typings/table/text-column.d.ts +80 -0
package/esm2015/a11y.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
9
|
-
import { Inject, Injectable, Optional, SkipSelf, QueryList, Directive, ElementRef, Input, NgZone, isDevMode, InjectionToken, EventEmitter, Output, NgModule,
|
|
9
|
+
import { Inject, Injectable, Optional, SkipSelf, QueryList, Directive, ElementRef, Input, NgZone, isDevMode, InjectionToken, EventEmitter, Output, NgModule, ɵɵdefineInjectable, ɵɵinject } from '@angular/core';
|
|
10
10
|
import { Subject, Subscription, of } from 'rxjs';
|
|
11
11
|
import { UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW, TAB, A, Z, ZERO, NINE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
12
12
|
import { debounceTime, filter, map, tap, take } from 'rxjs/operators';
|
|
@@ -16,7 +16,7 @@ import { ContentObserver, ObserversModule } from '@angular/cdk/observers';
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @fileoverview added by tsickle
|
|
19
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
19
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
/**
|
|
@@ -35,7 +35,11 @@ const ID_DELIMINATOR = ' ';
|
|
|
35
35
|
function addAriaReferencedId(el, attr, id) {
|
|
36
36
|
/** @type {?} */
|
|
37
37
|
const ids = getAriaReferenceIds(el, attr);
|
|
38
|
-
if (ids.some(
|
|
38
|
+
if (ids.some((/**
|
|
39
|
+
* @param {?} existingId
|
|
40
|
+
* @return {?}
|
|
41
|
+
*/
|
|
42
|
+
existingId => existingId.trim() == id.trim()))) {
|
|
39
43
|
return;
|
|
40
44
|
}
|
|
41
45
|
ids.push(id.trim());
|
|
@@ -53,7 +57,11 @@ function removeAriaReferencedId(el, attr, id) {
|
|
|
53
57
|
/** @type {?} */
|
|
54
58
|
const ids = getAriaReferenceIds(el, attr);
|
|
55
59
|
/** @type {?} */
|
|
56
|
-
const filteredIds = ids.filter(
|
|
60
|
+
const filteredIds = ids.filter((/**
|
|
61
|
+
* @param {?} val
|
|
62
|
+
* @return {?}
|
|
63
|
+
*/
|
|
64
|
+
val => val != id.trim()));
|
|
57
65
|
el.setAttribute(attr, filteredIds.join(ID_DELIMINATOR));
|
|
58
66
|
}
|
|
59
67
|
/**
|
|
@@ -70,7 +78,7 @@ function getAriaReferenceIds(el, attr) {
|
|
|
70
78
|
|
|
71
79
|
/**
|
|
72
80
|
* @fileoverview added by tsickle
|
|
73
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
81
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
74
82
|
*/
|
|
75
83
|
/**
|
|
76
84
|
* ID used for the body container where all messages are appended.
|
|
@@ -248,7 +256,11 @@ class AriaDescriber {
|
|
|
248
256
|
// Remove all aria-describedby reference IDs that are prefixed by CDK_DESCRIBEDBY_ID_PREFIX
|
|
249
257
|
/** @type {?} */
|
|
250
258
|
const originalReferenceIds = getAriaReferenceIds(element, 'aria-describedby')
|
|
251
|
-
.filter(
|
|
259
|
+
.filter((/**
|
|
260
|
+
* @param {?} id
|
|
261
|
+
* @return {?}
|
|
262
|
+
*/
|
|
263
|
+
id => id.indexOf(CDK_DESCRIBEDBY_ID_PREFIX) != 0));
|
|
252
264
|
element.setAttribute('aria-describedby', originalReferenceIds.join(' '));
|
|
253
265
|
}
|
|
254
266
|
/**
|
|
@@ -335,7 +347,7 @@ AriaDescriber.decorators = [
|
|
|
335
347
|
AriaDescriber.ctorParameters = () => [
|
|
336
348
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
337
349
|
];
|
|
338
|
-
/** @nocollapse */ AriaDescriber.ngInjectableDef =
|
|
350
|
+
/** @nocollapse */ AriaDescriber.ngInjectableDef = ɵɵdefineInjectable({ factory: function AriaDescriber_Factory() { return new AriaDescriber(ɵɵinject(DOCUMENT)); }, token: AriaDescriber, providedIn: "root" });
|
|
339
351
|
/**
|
|
340
352
|
* \@docs-private \@deprecated \@breaking-change 8.0.0
|
|
341
353
|
* @param {?} parentDispatcher
|
|
@@ -361,7 +373,7 @@ const ARIA_DESCRIBER_PROVIDER = {
|
|
|
361
373
|
|
|
362
374
|
/**
|
|
363
375
|
* @fileoverview added by tsickle
|
|
364
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
376
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
365
377
|
*/
|
|
366
378
|
/**
|
|
367
379
|
* This class manages keyboard events for selectable lists. If you pass it a query list
|
|
@@ -385,7 +397,11 @@ class ListKeyManager {
|
|
|
385
397
|
* Predicate function that can be used to check whether an item should be skipped
|
|
386
398
|
* by the key manager. By default, disabled items are skipped.
|
|
387
399
|
*/
|
|
388
|
-
this._skipPredicateFn = (
|
|
400
|
+
this._skipPredicateFn = (/**
|
|
401
|
+
* @param {?} item
|
|
402
|
+
* @return {?}
|
|
403
|
+
*/
|
|
404
|
+
(item) => item.disabled);
|
|
389
405
|
// Buffer for the letters that the user has pressed when the typeahead option is turned on.
|
|
390
406
|
this._pressedLetters = [];
|
|
391
407
|
/**
|
|
@@ -401,7 +417,11 @@ class ListKeyManager {
|
|
|
401
417
|
// not have access to a QueryList of the items they want to manage (e.g. when the
|
|
402
418
|
// items aren't being collected via `ViewChildren` or `ContentChildren`).
|
|
403
419
|
if (_items instanceof QueryList) {
|
|
404
|
-
_items.changes.subscribe((
|
|
420
|
+
_items.changes.subscribe((/**
|
|
421
|
+
* @param {?} newItems
|
|
422
|
+
* @return {?}
|
|
423
|
+
*/
|
|
424
|
+
(newItems) => {
|
|
405
425
|
if (this._activeItem) {
|
|
406
426
|
/** @type {?} */
|
|
407
427
|
const itemArray = newItems.toArray();
|
|
@@ -411,7 +431,7 @@ class ListKeyManager {
|
|
|
411
431
|
this._activeItemIndex = newIndex;
|
|
412
432
|
}
|
|
413
433
|
}
|
|
414
|
-
});
|
|
434
|
+
}));
|
|
415
435
|
}
|
|
416
436
|
}
|
|
417
437
|
/**
|
|
@@ -481,14 +501,32 @@ class ListKeyManager {
|
|
|
481
501
|
* @return {THIS}
|
|
482
502
|
*/
|
|
483
503
|
withTypeAhead(debounceInterval = 200) {
|
|
484
|
-
if ((/** @type {?} */ (this))._items.length && (/** @type {?} */ (this))._items.some(
|
|
504
|
+
if ((/** @type {?} */ (this))._items.length && (/** @type {?} */ (this))._items.some((/**
|
|
505
|
+
* @param {?} item
|
|
506
|
+
* @return {?}
|
|
507
|
+
*/
|
|
508
|
+
item => typeof item.getLabel !== 'function'))) {
|
|
485
509
|
throw Error('ListKeyManager items in typeahead mode must implement the `getLabel` method.');
|
|
486
510
|
}
|
|
487
511
|
(/** @type {?} */ (this))._typeaheadSubscription.unsubscribe();
|
|
488
512
|
// Debounce the presses of non-navigational keys, collect the ones that correspond to letters
|
|
489
513
|
// and convert those letters back into a string. Afterwards find the first item that starts
|
|
490
514
|
// with that string and select it.
|
|
491
|
-
(/** @type {?} */ (this))._typeaheadSubscription = (/** @type {?} */ (this))._letterKeyStream.pipe(tap(
|
|
515
|
+
(/** @type {?} */ (this))._typeaheadSubscription = (/** @type {?} */ (this))._letterKeyStream.pipe(tap((/**
|
|
516
|
+
* @param {?} keyCode
|
|
517
|
+
* @return {?}
|
|
518
|
+
*/
|
|
519
|
+
keyCode => (/** @type {?} */ (this))._pressedLetters.push(keyCode))), debounceTime(debounceInterval), filter((/**
|
|
520
|
+
* @return {?}
|
|
521
|
+
*/
|
|
522
|
+
() => (/** @type {?} */ (this))._pressedLetters.length > 0)), map((/**
|
|
523
|
+
* @return {?}
|
|
524
|
+
*/
|
|
525
|
+
() => (/** @type {?} */ (this))._pressedLetters.join('')))).subscribe((/**
|
|
526
|
+
* @param {?} inputString
|
|
527
|
+
* @return {?}
|
|
528
|
+
*/
|
|
529
|
+
inputString => {
|
|
492
530
|
/** @type {?} */
|
|
493
531
|
const items = (/** @type {?} */ (this))._getItemsArray();
|
|
494
532
|
// Start at 1 because we want to start searching at the item immediately
|
|
@@ -505,7 +543,7 @@ class ListKeyManager {
|
|
|
505
543
|
}
|
|
506
544
|
}
|
|
507
545
|
(/** @type {?} */ (this))._pressedLetters = [];
|
|
508
|
-
});
|
|
546
|
+
}));
|
|
509
547
|
return (/** @type {?} */ (this));
|
|
510
548
|
}
|
|
511
549
|
/**
|
|
@@ -531,9 +569,13 @@ class ListKeyManager {
|
|
|
531
569
|
/** @type {?} */
|
|
532
570
|
const modifiers = ['altKey', 'ctrlKey', 'metaKey', 'shiftKey'];
|
|
533
571
|
/** @type {?} */
|
|
534
|
-
const isModifierAllowed = modifiers.every(
|
|
572
|
+
const isModifierAllowed = modifiers.every((/**
|
|
573
|
+
* @param {?} modifier
|
|
574
|
+
* @return {?}
|
|
575
|
+
*/
|
|
576
|
+
modifier => {
|
|
535
577
|
return !event[modifier] || this._allowedModifierKeys.indexOf(modifier) > -1;
|
|
536
|
-
});
|
|
578
|
+
}));
|
|
537
579
|
switch (keyCode) {
|
|
538
580
|
case TAB:
|
|
539
581
|
this.tabOut.next();
|
|
@@ -735,7 +777,7 @@ class ListKeyManager {
|
|
|
735
777
|
|
|
736
778
|
/**
|
|
737
779
|
* @fileoverview added by tsickle
|
|
738
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
780
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
739
781
|
*/
|
|
740
782
|
/**
|
|
741
783
|
* @template T
|
|
@@ -758,7 +800,7 @@ class ActiveDescendantKeyManager extends ListKeyManager {
|
|
|
758
800
|
|
|
759
801
|
/**
|
|
760
802
|
* @fileoverview added by tsickle
|
|
761
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
803
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
762
804
|
*/
|
|
763
805
|
/**
|
|
764
806
|
* @template T
|
|
@@ -793,7 +835,7 @@ class FocusKeyManager extends ListKeyManager {
|
|
|
793
835
|
|
|
794
836
|
/**
|
|
795
837
|
* @fileoverview added by tsickle
|
|
796
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
838
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
797
839
|
*/
|
|
798
840
|
// The InteractivityChecker leans heavily on the ally.js accessibility utilities.
|
|
799
841
|
// Methods like `isTabbable` are only covering specific edge-cases for the browsers which are
|
|
@@ -923,7 +965,7 @@ InteractivityChecker.decorators = [
|
|
|
923
965
|
InteractivityChecker.ctorParameters = () => [
|
|
924
966
|
{ type: Platform }
|
|
925
967
|
];
|
|
926
|
-
/** @nocollapse */ InteractivityChecker.ngInjectableDef =
|
|
968
|
+
/** @nocollapse */ InteractivityChecker.ngInjectableDef = ɵɵdefineInjectable({ factory: function InteractivityChecker_Factory() { return new InteractivityChecker(ɵɵinject(Platform)); }, token: InteractivityChecker, providedIn: "root" });
|
|
927
969
|
/**
|
|
928
970
|
* Returns the frame element from a window object. Since browsers like MS Edge throw errors if
|
|
929
971
|
* the frameElement property is being accessed from a different host address, this property
|
|
@@ -1070,7 +1112,7 @@ function getWindow(node) {
|
|
|
1070
1112
|
|
|
1071
1113
|
/**
|
|
1072
1114
|
* @fileoverview added by tsickle
|
|
1073
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1115
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1074
1116
|
*/
|
|
1075
1117
|
/**
|
|
1076
1118
|
* Class that allows for trapping focus within a DOM element.
|
|
@@ -1094,8 +1136,14 @@ class FocusTrap {
|
|
|
1094
1136
|
this._document = _document;
|
|
1095
1137
|
this._hasAttached = false;
|
|
1096
1138
|
// Event listeners for the anchors. Need to be regular functions so that we can unbind them later.
|
|
1097
|
-
this.startAnchorListener = (
|
|
1098
|
-
|
|
1139
|
+
this.startAnchorListener = (/**
|
|
1140
|
+
* @return {?}
|
|
1141
|
+
*/
|
|
1142
|
+
() => this.focusLastTabbableElement());
|
|
1143
|
+
this.endAnchorListener = (/**
|
|
1144
|
+
* @return {?}
|
|
1145
|
+
*/
|
|
1146
|
+
() => this.focusFirstTabbableElement());
|
|
1099
1147
|
this._enabled = true;
|
|
1100
1148
|
if (!deferAnchors) {
|
|
1101
1149
|
this.attachAnchors();
|
|
@@ -1151,7 +1199,10 @@ class FocusTrap {
|
|
|
1151
1199
|
if (this._hasAttached) {
|
|
1152
1200
|
return true;
|
|
1153
1201
|
}
|
|
1154
|
-
this._ngZone.runOutsideAngular((
|
|
1202
|
+
this._ngZone.runOutsideAngular((/**
|
|
1203
|
+
* @return {?}
|
|
1204
|
+
*/
|
|
1205
|
+
() => {
|
|
1155
1206
|
if (!this._startAnchor) {
|
|
1156
1207
|
this._startAnchor = this._createAnchor();
|
|
1157
1208
|
(/** @type {?} */ (this._startAnchor)).addEventListener('focus', this.startAnchorListener);
|
|
@@ -1160,7 +1211,7 @@ class FocusTrap {
|
|
|
1160
1211
|
this._endAnchor = this._createAnchor();
|
|
1161
1212
|
(/** @type {?} */ (this._endAnchor)).addEventListener('focus', this.endAnchorListener);
|
|
1162
1213
|
}
|
|
1163
|
-
});
|
|
1214
|
+
}));
|
|
1164
1215
|
if (this._element.parentNode) {
|
|
1165
1216
|
this._element.parentNode.insertBefore((/** @type {?} */ (this._startAnchor)), this._element);
|
|
1166
1217
|
this._element.parentNode.insertBefore((/** @type {?} */ (this._endAnchor)), this._element.nextSibling);
|
|
@@ -1175,9 +1226,16 @@ class FocusTrap {
|
|
|
1175
1226
|
* on whether focus was moved successfuly.
|
|
1176
1227
|
*/
|
|
1177
1228
|
focusInitialElementWhenReady() {
|
|
1178
|
-
return new Promise(
|
|
1179
|
-
|
|
1180
|
-
|
|
1229
|
+
return new Promise((/**
|
|
1230
|
+
* @param {?} resolve
|
|
1231
|
+
* @return {?}
|
|
1232
|
+
*/
|
|
1233
|
+
resolve => {
|
|
1234
|
+
this._executeOnStable((/**
|
|
1235
|
+
* @return {?}
|
|
1236
|
+
*/
|
|
1237
|
+
() => resolve(this.focusInitialElement())));
|
|
1238
|
+
}));
|
|
1181
1239
|
}
|
|
1182
1240
|
/**
|
|
1183
1241
|
* Waits for the zone to stabilize, then focuses
|
|
@@ -1186,9 +1244,16 @@ class FocusTrap {
|
|
|
1186
1244
|
* on whether focus was moved successfuly.
|
|
1187
1245
|
*/
|
|
1188
1246
|
focusFirstTabbableElementWhenReady() {
|
|
1189
|
-
return new Promise(
|
|
1190
|
-
|
|
1191
|
-
|
|
1247
|
+
return new Promise((/**
|
|
1248
|
+
* @param {?} resolve
|
|
1249
|
+
* @return {?}
|
|
1250
|
+
*/
|
|
1251
|
+
resolve => {
|
|
1252
|
+
this._executeOnStable((/**
|
|
1253
|
+
* @return {?}
|
|
1254
|
+
*/
|
|
1255
|
+
() => resolve(this.focusFirstTabbableElement())));
|
|
1256
|
+
}));
|
|
1192
1257
|
}
|
|
1193
1258
|
/**
|
|
1194
1259
|
* Waits for the zone to stabilize, then focuses
|
|
@@ -1197,9 +1262,16 @@ class FocusTrap {
|
|
|
1197
1262
|
* on whether focus was moved successfuly.
|
|
1198
1263
|
*/
|
|
1199
1264
|
focusLastTabbableElementWhenReady() {
|
|
1200
|
-
return new Promise(
|
|
1201
|
-
|
|
1202
|
-
|
|
1265
|
+
return new Promise((/**
|
|
1266
|
+
* @param {?} resolve
|
|
1267
|
+
* @return {?}
|
|
1268
|
+
*/
|
|
1269
|
+
resolve => {
|
|
1270
|
+
this._executeOnStable((/**
|
|
1271
|
+
* @return {?}
|
|
1272
|
+
*/
|
|
1273
|
+
() => resolve(this.focusLastTabbableElement())));
|
|
1274
|
+
}));
|
|
1203
1275
|
}
|
|
1204
1276
|
/**
|
|
1205
1277
|
* Get the specified boundary element of the trapped region.
|
|
@@ -1413,7 +1485,7 @@ FocusTrapFactory.ctorParameters = () => [
|
|
|
1413
1485
|
{ type: NgZone },
|
|
1414
1486
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
1415
1487
|
];
|
|
1416
|
-
/** @nocollapse */ FocusTrapFactory.ngInjectableDef =
|
|
1488
|
+
/** @nocollapse */ FocusTrapFactory.ngInjectableDef = ɵɵdefineInjectable({ factory: function FocusTrapFactory_Factory() { return new FocusTrapFactory(ɵɵinject(InteractivityChecker), ɵɵinject(NgZone), ɵɵinject(DOCUMENT)); }, token: FocusTrapFactory, providedIn: "root" });
|
|
1417
1489
|
/**
|
|
1418
1490
|
* Directive for trapping focus within a region.
|
|
1419
1491
|
*/
|
|
@@ -1504,7 +1576,7 @@ CdkTrapFocus.propDecorators = {
|
|
|
1504
1576
|
|
|
1505
1577
|
/**
|
|
1506
1578
|
* @fileoverview added by tsickle
|
|
1507
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1579
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1508
1580
|
*/
|
|
1509
1581
|
/** @type {?} */
|
|
1510
1582
|
const LIVE_ANNOUNCER_ELEMENT_TOKEN = new InjectionToken('liveAnnouncerElement', {
|
|
@@ -1526,7 +1598,7 @@ const LIVE_ANNOUNCER_DEFAULT_OPTIONS = new InjectionToken('LIVE_ANNOUNCER_DEFAUL
|
|
|
1526
1598
|
|
|
1527
1599
|
/**
|
|
1528
1600
|
* @fileoverview added by tsickle
|
|
1529
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1601
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1530
1602
|
*/
|
|
1531
1603
|
class LiveAnnouncer {
|
|
1532
1604
|
/**
|
|
@@ -1578,18 +1650,31 @@ class LiveAnnouncer {
|
|
|
1578
1650
|
// - With Chrome and IE11 with NVDA or JAWS, a repeated (identical) message won't be read a
|
|
1579
1651
|
// second time without clearing and then using a non-zero delay.
|
|
1580
1652
|
// (using JAWS 17 at time of this writing).
|
|
1581
|
-
return this._ngZone.runOutsideAngular((
|
|
1582
|
-
|
|
1653
|
+
return this._ngZone.runOutsideAngular((/**
|
|
1654
|
+
* @return {?}
|
|
1655
|
+
*/
|
|
1656
|
+
() => {
|
|
1657
|
+
return new Promise((/**
|
|
1658
|
+
* @param {?} resolve
|
|
1659
|
+
* @return {?}
|
|
1660
|
+
*/
|
|
1661
|
+
resolve => {
|
|
1583
1662
|
clearTimeout(this._previousTimeout);
|
|
1584
|
-
this._previousTimeout = setTimeout((
|
|
1663
|
+
this._previousTimeout = setTimeout((/**
|
|
1664
|
+
* @return {?}
|
|
1665
|
+
*/
|
|
1666
|
+
() => {
|
|
1585
1667
|
this._liveElement.textContent = message;
|
|
1586
1668
|
resolve();
|
|
1587
1669
|
if (typeof duration === 'number') {
|
|
1588
|
-
this._previousTimeout = setTimeout((
|
|
1670
|
+
this._previousTimeout = setTimeout((/**
|
|
1671
|
+
* @return {?}
|
|
1672
|
+
*/
|
|
1673
|
+
() => this.clear()), duration);
|
|
1589
1674
|
}
|
|
1590
|
-
}, 100);
|
|
1591
|
-
});
|
|
1592
|
-
});
|
|
1675
|
+
}), 100);
|
|
1676
|
+
}));
|
|
1677
|
+
}));
|
|
1593
1678
|
}
|
|
1594
1679
|
/**
|
|
1595
1680
|
* Clears the current text from the announcer element. Can be used to prevent
|
|
@@ -1645,7 +1730,7 @@ LiveAnnouncer.ctorParameters = () => [
|
|
|
1645
1730
|
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
1646
1731
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LIVE_ANNOUNCER_DEFAULT_OPTIONS,] }] }
|
|
1647
1732
|
];
|
|
1648
|
-
/** @nocollapse */ LiveAnnouncer.ngInjectableDef =
|
|
1733
|
+
/** @nocollapse */ LiveAnnouncer.ngInjectableDef = ɵɵdefineInjectable({ factory: function LiveAnnouncer_Factory() { return new LiveAnnouncer(ɵɵinject(LIVE_ANNOUNCER_ELEMENT_TOKEN, 8), ɵɵinject(NgZone), ɵɵinject(DOCUMENT), ɵɵinject(LIVE_ANNOUNCER_DEFAULT_OPTIONS, 8)); }, token: LiveAnnouncer, providedIn: "root" });
|
|
1649
1734
|
/**
|
|
1650
1735
|
* A directive that works similarly to aria-live, but uses the LiveAnnouncer to ensure compatibility
|
|
1651
1736
|
* with a wider range of browsers and screen readers.
|
|
@@ -1682,10 +1767,16 @@ class CdkAriaLive {
|
|
|
1682
1767
|
}
|
|
1683
1768
|
}
|
|
1684
1769
|
else if (!this._subscription) {
|
|
1685
|
-
this._subscription = this._ngZone.runOutsideAngular((
|
|
1770
|
+
this._subscription = this._ngZone.runOutsideAngular((/**
|
|
1771
|
+
* @return {?}
|
|
1772
|
+
*/
|
|
1773
|
+
() => {
|
|
1686
1774
|
return this._contentObserver
|
|
1687
1775
|
.observe(this._elementRef)
|
|
1688
|
-
.subscribe((
|
|
1776
|
+
.subscribe((/**
|
|
1777
|
+
* @return {?}
|
|
1778
|
+
*/
|
|
1779
|
+
() => {
|
|
1689
1780
|
// Note that we use textContent here, rather than innerText, in order to avoid a reflow.
|
|
1690
1781
|
/** @type {?} */
|
|
1691
1782
|
const elementText = this._elementRef.nativeElement.textContent;
|
|
@@ -1695,8 +1786,8 @@ class CdkAriaLive {
|
|
|
1695
1786
|
this._liveAnnouncer.announce(elementText, this._politeness);
|
|
1696
1787
|
this._previousAnnouncedText = elementText;
|
|
1697
1788
|
}
|
|
1698
|
-
});
|
|
1699
|
-
});
|
|
1789
|
+
}));
|
|
1790
|
+
}));
|
|
1700
1791
|
}
|
|
1701
1792
|
}
|
|
1702
1793
|
/**
|
|
@@ -1753,7 +1844,7 @@ const LIVE_ANNOUNCER_PROVIDER = {
|
|
|
1753
1844
|
|
|
1754
1845
|
/**
|
|
1755
1846
|
* @fileoverview added by tsickle
|
|
1756
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1847
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
1757
1848
|
*/
|
|
1758
1849
|
// This is the value used by AngularJS Material. Through trial and error (on iPhone 6S) they found
|
|
1759
1850
|
// that a value of around 650ms seems appropriate.
|
|
@@ -1761,7 +1852,7 @@ const LIVE_ANNOUNCER_PROVIDER = {
|
|
|
1761
1852
|
const TOUCH_BUFFER_MS = 650;
|
|
1762
1853
|
/**
|
|
1763
1854
|
* Event listener options that enable capturing and also
|
|
1764
|
-
* mark the
|
|
1855
|
+
* mark the listener as passive if the browser supports it.
|
|
1765
1856
|
* @type {?}
|
|
1766
1857
|
*/
|
|
1767
1858
|
const captureEventListenerOptions = normalizePassiveListenerOptions({
|
|
@@ -1799,27 +1890,37 @@ class FocusMonitor {
|
|
|
1799
1890
|
* Event listener for `keydown` events on the document.
|
|
1800
1891
|
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1801
1892
|
*/
|
|
1802
|
-
this._documentKeydownListener = (
|
|
1893
|
+
this._documentKeydownListener = (/**
|
|
1894
|
+
* @return {?}
|
|
1895
|
+
*/
|
|
1896
|
+
() => {
|
|
1803
1897
|
// On keydown record the origin and clear any touch event that may be in progress.
|
|
1804
1898
|
this._lastTouchTarget = null;
|
|
1805
1899
|
this._setOriginForCurrentEventQueue('keyboard');
|
|
1806
|
-
};
|
|
1900
|
+
});
|
|
1807
1901
|
/**
|
|
1808
1902
|
* Event listener for `mousedown` events on the document.
|
|
1809
1903
|
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1810
1904
|
*/
|
|
1811
|
-
this._documentMousedownListener = (
|
|
1905
|
+
this._documentMousedownListener = (/**
|
|
1906
|
+
* @return {?}
|
|
1907
|
+
*/
|
|
1908
|
+
() => {
|
|
1812
1909
|
// On mousedown record the origin only if there is not touch
|
|
1813
1910
|
// target, since a mousedown can happen as a result of a touch event.
|
|
1814
1911
|
if (!this._lastTouchTarget) {
|
|
1815
1912
|
this._setOriginForCurrentEventQueue('mouse');
|
|
1816
1913
|
}
|
|
1817
|
-
};
|
|
1914
|
+
});
|
|
1818
1915
|
/**
|
|
1819
1916
|
* Event listener for `touchstart` events on the document.
|
|
1820
1917
|
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1821
1918
|
*/
|
|
1822
|
-
this._documentTouchstartListener = (
|
|
1919
|
+
this._documentTouchstartListener = (/**
|
|
1920
|
+
* @param {?} event
|
|
1921
|
+
* @return {?}
|
|
1922
|
+
*/
|
|
1923
|
+
(event) => {
|
|
1823
1924
|
// When the touchstart event fires the focus event is not yet in the event queue. This means
|
|
1824
1925
|
// we can't rely on the trick used above (setting timeout of 1ms). Instead we wait 650ms to
|
|
1825
1926
|
// see if a focus happens.
|
|
@@ -1827,18 +1928,27 @@ class FocusMonitor {
|
|
|
1827
1928
|
clearTimeout(this._touchTimeoutId);
|
|
1828
1929
|
}
|
|
1829
1930
|
this._lastTouchTarget = event.target;
|
|
1830
|
-
this._touchTimeoutId = setTimeout((
|
|
1831
|
-
|
|
1931
|
+
this._touchTimeoutId = setTimeout((/**
|
|
1932
|
+
* @return {?}
|
|
1933
|
+
*/
|
|
1934
|
+
() => this._lastTouchTarget = null), TOUCH_BUFFER_MS);
|
|
1935
|
+
});
|
|
1832
1936
|
/**
|
|
1833
1937
|
* Event listener for `focus` events on the window.
|
|
1834
1938
|
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1835
1939
|
*/
|
|
1836
|
-
this._windowFocusListener = (
|
|
1940
|
+
this._windowFocusListener = (/**
|
|
1941
|
+
* @return {?}
|
|
1942
|
+
*/
|
|
1943
|
+
() => {
|
|
1837
1944
|
// Make a note of when the window regains focus, so we can
|
|
1838
1945
|
// restore the origin info for the focused element.
|
|
1839
1946
|
this._windowFocused = true;
|
|
1840
|
-
this._windowFocusTimeoutId = setTimeout((
|
|
1841
|
-
|
|
1947
|
+
this._windowFocusTimeoutId = setTimeout((/**
|
|
1948
|
+
* @return {?}
|
|
1949
|
+
*/
|
|
1950
|
+
() => this._windowFocused = false));
|
|
1951
|
+
});
|
|
1842
1952
|
}
|
|
1843
1953
|
/**
|
|
1844
1954
|
* @param {?} element
|
|
@@ -1862,7 +1972,10 @@ class FocusMonitor {
|
|
|
1862
1972
|
// Create monitored element info.
|
|
1863
1973
|
/** @type {?} */
|
|
1864
1974
|
let info = {
|
|
1865
|
-
unlisten: (
|
|
1975
|
+
unlisten: (/**
|
|
1976
|
+
* @return {?}
|
|
1977
|
+
*/
|
|
1978
|
+
() => { }),
|
|
1866
1979
|
checkChildren: checkChildren,
|
|
1867
1980
|
subject: new Subject()
|
|
1868
1981
|
};
|
|
@@ -1870,18 +1983,32 @@ class FocusMonitor {
|
|
|
1870
1983
|
this._incrementMonitoredElementCount();
|
|
1871
1984
|
// Start listening. We need to listen in capture phase since focus events don't bubble.
|
|
1872
1985
|
/** @type {?} */
|
|
1873
|
-
let focusListener = (
|
|
1986
|
+
let focusListener = (/**
|
|
1987
|
+
* @param {?} event
|
|
1988
|
+
* @return {?}
|
|
1989
|
+
*/
|
|
1990
|
+
(event) => this._onFocus(event, nativeElement));
|
|
1874
1991
|
/** @type {?} */
|
|
1875
|
-
let blurListener = (
|
|
1876
|
-
|
|
1992
|
+
let blurListener = (/**
|
|
1993
|
+
* @param {?} event
|
|
1994
|
+
* @return {?}
|
|
1995
|
+
*/
|
|
1996
|
+
(event) => this._onBlur(event, nativeElement));
|
|
1997
|
+
this._ngZone.runOutsideAngular((/**
|
|
1998
|
+
* @return {?}
|
|
1999
|
+
*/
|
|
2000
|
+
() => {
|
|
1877
2001
|
nativeElement.addEventListener('focus', focusListener, true);
|
|
1878
2002
|
nativeElement.addEventListener('blur', blurListener, true);
|
|
1879
|
-
});
|
|
2003
|
+
}));
|
|
1880
2004
|
// Create an unlisten function for later.
|
|
1881
|
-
info.unlisten = (
|
|
2005
|
+
info.unlisten = (/**
|
|
2006
|
+
* @return {?}
|
|
2007
|
+
*/
|
|
2008
|
+
() => {
|
|
1882
2009
|
nativeElement.removeEventListener('focus', focusListener, true);
|
|
1883
2010
|
nativeElement.removeEventListener('blur', blurListener, true);
|
|
1884
|
-
};
|
|
2011
|
+
});
|
|
1885
2012
|
return info.subject.asObservable();
|
|
1886
2013
|
}
|
|
1887
2014
|
/**
|
|
@@ -1921,7 +2048,12 @@ class FocusMonitor {
|
|
|
1921
2048
|
* @return {?}
|
|
1922
2049
|
*/
|
|
1923
2050
|
ngOnDestroy() {
|
|
1924
|
-
this._elementInfo.forEach((
|
|
2051
|
+
this._elementInfo.forEach((/**
|
|
2052
|
+
* @param {?} _info
|
|
2053
|
+
* @param {?} element
|
|
2054
|
+
* @return {?}
|
|
2055
|
+
*/
|
|
2056
|
+
(_info, element) => this.stopMonitoring(element)));
|
|
1925
2057
|
}
|
|
1926
2058
|
/**
|
|
1927
2059
|
* @private
|
|
@@ -1963,13 +2095,19 @@ class FocusMonitor {
|
|
|
1963
2095
|
* @return {?}
|
|
1964
2096
|
*/
|
|
1965
2097
|
_setOriginForCurrentEventQueue(origin) {
|
|
1966
|
-
this._ngZone.runOutsideAngular((
|
|
2098
|
+
this._ngZone.runOutsideAngular((/**
|
|
2099
|
+
* @return {?}
|
|
2100
|
+
*/
|
|
2101
|
+
() => {
|
|
1967
2102
|
this._origin = origin;
|
|
1968
2103
|
// Sometimes the focus origin won't be valid in Firefox because Firefox seems to focus *one*
|
|
1969
2104
|
// tick after the interaction event fired. To ensure the focus origin is always correct,
|
|
1970
2105
|
// the focus origin will be determined at the beginning of the next tick.
|
|
1971
|
-
this._originTimeoutId = setTimeout((
|
|
1972
|
-
|
|
2106
|
+
this._originTimeoutId = setTimeout((/**
|
|
2107
|
+
* @return {?}
|
|
2108
|
+
*/
|
|
2109
|
+
() => this._origin = null), 1);
|
|
2110
|
+
}));
|
|
1973
2111
|
}
|
|
1974
2112
|
/**
|
|
1975
2113
|
* Checks whether the given focus event was caused by a touchstart event.
|
|
@@ -2071,7 +2209,10 @@ class FocusMonitor {
|
|
|
2071
2209
|
* @return {?}
|
|
2072
2210
|
*/
|
|
2073
2211
|
_emitOrigin(subject, origin) {
|
|
2074
|
-
this._ngZone.run((
|
|
2212
|
+
this._ngZone.run((/**
|
|
2213
|
+
* @return {?}
|
|
2214
|
+
*/
|
|
2215
|
+
() => subject.next(origin)));
|
|
2075
2216
|
}
|
|
2076
2217
|
/**
|
|
2077
2218
|
* @private
|
|
@@ -2082,12 +2223,15 @@ class FocusMonitor {
|
|
|
2082
2223
|
if (++this._monitoredElementCount == 1 && this._platform.isBrowser) {
|
|
2083
2224
|
// Note: we listen to events in the capture phase so we
|
|
2084
2225
|
// can detect them even if the user stops propagation.
|
|
2085
|
-
this._ngZone.runOutsideAngular((
|
|
2226
|
+
this._ngZone.runOutsideAngular((/**
|
|
2227
|
+
* @return {?}
|
|
2228
|
+
*/
|
|
2229
|
+
() => {
|
|
2086
2230
|
document.addEventListener('keydown', this._documentKeydownListener, captureEventListenerOptions);
|
|
2087
2231
|
document.addEventListener('mousedown', this._documentMousedownListener, captureEventListenerOptions);
|
|
2088
2232
|
document.addEventListener('touchstart', this._documentTouchstartListener, captureEventListenerOptions);
|
|
2089
2233
|
window.addEventListener('focus', this._windowFocusListener);
|
|
2090
|
-
});
|
|
2234
|
+
}));
|
|
2091
2235
|
}
|
|
2092
2236
|
}
|
|
2093
2237
|
/**
|
|
@@ -2116,7 +2260,7 @@ FocusMonitor.ctorParameters = () => [
|
|
|
2116
2260
|
{ type: NgZone },
|
|
2117
2261
|
{ type: Platform }
|
|
2118
2262
|
];
|
|
2119
|
-
/** @nocollapse */ FocusMonitor.ngInjectableDef =
|
|
2263
|
+
/** @nocollapse */ FocusMonitor.ngInjectableDef = ɵɵdefineInjectable({ factory: function FocusMonitor_Factory() { return new FocusMonitor(ɵɵinject(NgZone), ɵɵinject(Platform)); }, token: FocusMonitor, providedIn: "root" });
|
|
2120
2264
|
/**
|
|
2121
2265
|
* Directive that determines how a particular element was focused (via keyboard, mouse, touch, or
|
|
2122
2266
|
* programmatically) and adds corresponding classes to the element.
|
|
@@ -2136,7 +2280,11 @@ class CdkMonitorFocus {
|
|
|
2136
2280
|
this._focusMonitor = _focusMonitor;
|
|
2137
2281
|
this.cdkFocusChange = new EventEmitter();
|
|
2138
2282
|
this._monitorSubscription = this._focusMonitor.monitor(this._elementRef, this._elementRef.nativeElement.hasAttribute('cdkMonitorSubtreeFocus'))
|
|
2139
|
-
.subscribe(
|
|
2283
|
+
.subscribe((/**
|
|
2284
|
+
* @param {?} origin
|
|
2285
|
+
* @return {?}
|
|
2286
|
+
*/
|
|
2287
|
+
origin => this.cdkFocusChange.emit(origin)));
|
|
2140
2288
|
}
|
|
2141
2289
|
/**
|
|
2142
2290
|
* @return {?}
|
|
@@ -2182,7 +2330,7 @@ const FOCUS_MONITOR_PROVIDER = {
|
|
|
2182
2330
|
|
|
2183
2331
|
/**
|
|
2184
2332
|
* @fileoverview added by tsickle
|
|
2185
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2333
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2186
2334
|
*/
|
|
2187
2335
|
|
|
2188
2336
|
/**
|
|
@@ -2200,7 +2348,7 @@ function isFakeMousedownFromScreenReader(event) {
|
|
|
2200
2348
|
|
|
2201
2349
|
/**
|
|
2202
2350
|
* @fileoverview added by tsickle
|
|
2203
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2351
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2204
2352
|
*/
|
|
2205
2353
|
class A11yModule {
|
|
2206
2354
|
}
|
|
@@ -2214,12 +2362,12 @@ A11yModule.decorators = [
|
|
|
2214
2362
|
|
|
2215
2363
|
/**
|
|
2216
2364
|
* @fileoverview added by tsickle
|
|
2217
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2365
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2218
2366
|
*/
|
|
2219
2367
|
|
|
2220
2368
|
/**
|
|
2221
2369
|
* @fileoverview added by tsickle
|
|
2222
|
-
* @suppress {checkTypes,extraRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2370
|
+
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
2223
2371
|
*/
|
|
2224
2372
|
|
|
2225
2373
|
export { ARIA_DESCRIBER_PROVIDER_FACTORY, MESSAGES_CONTAINER_ID, CDK_DESCRIBEDBY_ID_PREFIX, CDK_DESCRIBEDBY_HOST_ATTRIBUTE, AriaDescriber, ARIA_DESCRIBER_PROVIDER, ActiveDescendantKeyManager, FocusKeyManager, ListKeyManager, FocusTrap, FocusTrapFactory, CdkTrapFocus, InteractivityChecker, LIVE_ANNOUNCER_PROVIDER_FACTORY, LiveAnnouncer, CdkAriaLive, LIVE_ANNOUNCER_PROVIDER, LIVE_ANNOUNCER_ELEMENT_TOKEN_FACTORY, LIVE_ANNOUNCER_ELEMENT_TOKEN, LIVE_ANNOUNCER_DEFAULT_OPTIONS, FOCUS_MONITOR_PROVIDER_FACTORY, TOUCH_BUFFER_MS, FocusMonitor, CdkMonitorFocus, FOCUS_MONITOR_PROVIDER, isFakeMousedownFromScreenReader, A11yModule };
|