@angular/cdk 12.1.1 → 12.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a11y/index.metadata.json +1 -1
- package/a11y/input-modality/input-modality-detector.d.ts +0 -2
- package/bundles/cdk-a11y.umd.js +11 -16
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-drag-drop.umd.js +51 -38
- package/bundles/cdk-drag-drop.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +1 -2
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.js +7 -0
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +3 -3
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-table.umd.js +25 -9
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-testing-protractor.umd.js.map +1 -1
- package/bundles/cdk-testing-selenium-webdriver.umd.js.map +1 -1
- package/bundles/cdk-testing-testbed.umd.js +4 -2
- package/bundles/cdk-testing-testbed.umd.js.map +1 -1
- package/bundles/cdk-testing.umd.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/drag-drop/drag-styling.d.ts +5 -10
- package/drag-drop/index.metadata.json +1 -1
- package/drag-drop/parent-position-tracker.d.ts +0 -2
- package/esm2015/a11y/fake-event-detection.js +7 -6
- package/esm2015/a11y/focus-monitor/focus-monitor.js +5 -5
- package/esm2015/a11y/input-modality/input-modality-detector.js +5 -11
- package/esm2015/drag-drop/drag-ref.js +25 -17
- package/esm2015/drag-drop/drag-styling.js +26 -16
- package/esm2015/drag-drop/parent-position-tracker.js +3 -6
- package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +3 -4
- package/esm2015/platform/features/shadow-dom.js +7 -1
- package/esm2015/scrolling/viewport-ruler.js +4 -4
- package/esm2015/table/cell.js +16 -4
- package/esm2015/table/table.js +2 -2
- package/esm2015/testing/protractor/protractor-element.js +1 -1
- package/esm2015/testing/selenium-webdriver/selenium-web-driver-element.js +1 -1
- package/esm2015/testing/test-element.js +1 -1
- package/esm2015/testing/testbed/fake-events/event-objects.js +5 -3
- package/esm2015/testing/testbed/unit-test-element.js +1 -1
- package/esm2015/version.js +1 -1
- package/fesm2015/a11y.js +12 -17
- package/fesm2015/a11y.js.map +1 -1
- package/fesm2015/cdk.js +1 -1
- package/fesm2015/cdk.js.map +1 -1
- package/fesm2015/drag-drop.js +49 -35
- package/fesm2015/drag-drop.js.map +1 -1
- package/fesm2015/overlay.js +2 -3
- package/fesm2015/overlay.js.map +1 -1
- package/fesm2015/platform.js +7 -1
- package/fesm2015/platform.js.map +1 -1
- package/fesm2015/scrolling.js +3 -3
- package/fesm2015/scrolling.js.map +1 -1
- package/fesm2015/table.js +15 -3
- package/fesm2015/table.js.map +1 -1
- package/fesm2015/testing/protractor.js.map +1 -1
- package/fesm2015/testing/selenium-webdriver.js.map +1 -1
- package/fesm2015/testing/testbed.js +4 -2
- package/fesm2015/testing/testbed.js.map +1 -1
- package/fesm2015/testing.js.map +1 -1
- package/package.json +1 -1
- package/platform/features/shadow-dom.d.ts +2 -0
- package/platform/index.metadata.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-update/devkit-migration-rule.js +1 -1
- package/schematics/ng-update/devkit-migration-rule.mjs +1 -1
- package/schematics/ng-update/html-parsing/elements.js +3 -2
- package/schematics/ng-update/html-parsing/elements.mjs +3 -2
- package/schematics/ng-update/typescript/base-types.js +2 -2
- package/schematics/ng-update/typescript/base-types.mjs +2 -2
- package/schematics/tsconfig.json +1 -0
- package/schematics/update-tool/migration.d.ts +2 -2
- package/schematics/update-tool/migration.js +1 -1
- package/schematics/update-tool/migration.mjs +1 -1
- package/schematics/utils/build-component.js +7 -8
- package/schematics/utils/build-component.mjs +7 -8
- package/table/index.metadata.json +1 -1
- package/testing/protractor/protractor-element.d.ts +1 -1
- package/testing/selenium-webdriver/selenium-web-driver-element.d.ts +1 -1
- package/testing/test-element.d.ts +1 -1
- package/testing/testbed/unit-test-element.d.ts +1 -1
package/fesm2015/a11y.js
CHANGED
|
@@ -7,7 +7,7 @@ import { hasModifierKey, A, Z, ZERO, NINE, END, HOME, LEFT_ARROW, RIGHT_ARROW, U
|
|
|
7
7
|
import { tap, debounceTime, filter, map, take, skip, distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
|
8
8
|
import { coerceBooleanProperty, coerceElement } from '@angular/cdk/coercion';
|
|
9
9
|
import * as i1 from '@angular/cdk/platform';
|
|
10
|
-
import { Platform, _getFocusedElementPierceShadowDom, normalizePassiveListenerOptions, _getShadowRoot, PlatformModule } from '@angular/cdk/platform';
|
|
10
|
+
import { Platform, _getFocusedElementPierceShadowDom, normalizePassiveListenerOptions, _getEventTarget, _getShadowRoot, PlatformModule } from '@angular/cdk/platform';
|
|
11
11
|
import { ContentObserver, ObserversModule } from '@angular/cdk/observers';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1504,11 +1504,12 @@ ConfigurableFocusTrapFactory.ctorParameters = () => [
|
|
|
1504
1504
|
*/
|
|
1505
1505
|
/** Gets whether an event could be a faked `mousedown` event dispatched by a screen reader. */
|
|
1506
1506
|
function isFakeMousedownFromScreenReader(event) {
|
|
1507
|
-
//
|
|
1508
|
-
//
|
|
1509
|
-
//
|
|
1510
|
-
//
|
|
1511
|
-
|
|
1507
|
+
// Some screen readers will dispatch a fake `mousedown` event when pressing enter or space on
|
|
1508
|
+
// a clickable element. We can distinguish these events when both `offsetX` and `offsetY` are
|
|
1509
|
+
// zero. Note that there's an edge case where the user could click the 0x0 spot of the screen
|
|
1510
|
+
// themselves, but that is unlikely to contain interaction elements. Historially we used to check
|
|
1511
|
+
// `event.buttons === 0`, however that no longer works on recent versions of NVDA.
|
|
1512
|
+
return event.offsetX === 0 && event.offsetY === 0;
|
|
1512
1513
|
}
|
|
1513
1514
|
/** Gets whether an event could be a faked `touchstart` event dispatched by a screen reader. */
|
|
1514
1515
|
function isFakeTouchstartFromScreenReader(event) {
|
|
@@ -1610,7 +1611,7 @@ class InputModalityDetector {
|
|
|
1610
1611
|
return;
|
|
1611
1612
|
}
|
|
1612
1613
|
this._modality.next('keyboard');
|
|
1613
|
-
this._mostRecentTarget =
|
|
1614
|
+
this._mostRecentTarget = _getEventTarget(event);
|
|
1614
1615
|
};
|
|
1615
1616
|
/**
|
|
1616
1617
|
* Handles mousedown events. Must be an arrow function in order to preserve the context when it
|
|
@@ -1626,7 +1627,7 @@ class InputModalityDetector {
|
|
|
1626
1627
|
// Fake mousedown events are fired by some screen readers when controls are activated by the
|
|
1627
1628
|
// screen reader. Attribute them to keyboard input modality.
|
|
1628
1629
|
this._modality.next(isFakeMousedownFromScreenReader(event) ? 'keyboard' : 'mouse');
|
|
1629
|
-
this._mostRecentTarget =
|
|
1630
|
+
this._mostRecentTarget = _getEventTarget(event);
|
|
1630
1631
|
};
|
|
1631
1632
|
/**
|
|
1632
1633
|
* Handles touchstart events. Must be an arrow function in order to preserve the context when it
|
|
@@ -1643,7 +1644,7 @@ class InputModalityDetector {
|
|
|
1643
1644
|
// triggered via mouse vs touch.
|
|
1644
1645
|
this._lastTouchMs = Date.now();
|
|
1645
1646
|
this._modality.next('touch');
|
|
1646
|
-
this._mostRecentTarget =
|
|
1647
|
+
this._mostRecentTarget = _getEventTarget(event);
|
|
1647
1648
|
};
|
|
1648
1649
|
this._options = Object.assign(Object.assign({}, INPUT_MODALITY_DETECTOR_DEFAULT_OPTIONS), options);
|
|
1649
1650
|
// Skip the first emission as it's null.
|
|
@@ -1684,12 +1685,6 @@ InputModalityDetector.ctorParameters = () => [
|
|
|
1684
1685
|
{ type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
|
|
1685
1686
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [INPUT_MODALITY_DETECTOR_OPTIONS,] }] }
|
|
1686
1687
|
];
|
|
1687
|
-
/** Gets the target of an event, accounting for Shadow DOM. */
|
|
1688
|
-
function getTarget(event) {
|
|
1689
|
-
// If an event is bound outside the Shadow DOM, the `event.target` will
|
|
1690
|
-
// point to the shadow root so we have to use `composedPath` instead.
|
|
1691
|
-
return (event.composedPath ? event.composedPath()[0] : event.target);
|
|
1692
|
-
}
|
|
1693
1688
|
|
|
1694
1689
|
/**
|
|
1695
1690
|
* @license
|
|
@@ -1931,7 +1926,7 @@ class FocusMonitor {
|
|
|
1931
1926
|
* Needs to be an arrow function in order to preserve the context when it gets bound.
|
|
1932
1927
|
*/
|
|
1933
1928
|
this._rootNodeFocusAndBlurListener = (event) => {
|
|
1934
|
-
const target =
|
|
1929
|
+
const target = _getEventTarget(event);
|
|
1935
1930
|
const handler = event.type === 'focus' ? this._onFocus : this._onBlur;
|
|
1936
1931
|
// We need to walk up the ancestor chain in order to support `checkChildren`.
|
|
1937
1932
|
for (let element = target; element; element = element.parentElement) {
|
|
@@ -2112,7 +2107,7 @@ class FocusMonitor {
|
|
|
2112
2107
|
// If we are not counting child-element-focus as focused, make sure that the event target is the
|
|
2113
2108
|
// monitored element itself.
|
|
2114
2109
|
const elementInfo = this._elementInfo.get(element);
|
|
2115
|
-
const focusEventTarget =
|
|
2110
|
+
const focusEventTarget = _getEventTarget(event);
|
|
2116
2111
|
if (!elementInfo || (!elementInfo.checkChildren && element !== focusEventTarget)) {
|
|
2117
2112
|
return;
|
|
2118
2113
|
}
|