@angular/cdk 13.2.0-next.0 → 13.2.0-next.1
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/LICENSE +1 -1
- package/esm2020/a11y/focus-monitor/focus-monitor.mjs +2 -2
- package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +23 -15
- package/esm2020/table/cell.mjs +2 -7
- package/esm2020/table/table.mjs +23 -6
- package/esm2020/testing/harness-environment.mjs +9 -2
- package/esm2020/testing/selenium-webdriver/selenium-web-driver-harness-environment.mjs +3 -2
- package/esm2020/testing/testbed/testbed-harness-environment.mjs +3 -2
- package/esm2020/text-field/autosize.mjs +7 -2
- package/esm2020/version.mjs +1 -1
- package/fesm2015/a11y.mjs +1 -1
- package/fesm2015/a11y.mjs.map +1 -1
- package/fesm2015/cdk.mjs +1 -1
- package/fesm2015/cdk.mjs.map +1 -1
- package/fesm2015/overlay.mjs +22 -14
- package/fesm2015/overlay.mjs.map +1 -1
- package/fesm2015/table.mjs +22 -10
- package/fesm2015/table.mjs.map +1 -1
- package/fesm2015/testing/selenium-webdriver.mjs +2 -1
- package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2015/testing/testbed.mjs +2 -1
- package/fesm2015/testing/testbed.mjs.map +1 -1
- package/fesm2015/testing.mjs +8 -1
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2015/text-field.mjs +6 -1
- package/fesm2015/text-field.mjs.map +1 -1
- package/fesm2020/a11y.mjs +1 -1
- package/fesm2020/a11y.mjs.map +1 -1
- package/fesm2020/cdk.mjs +1 -1
- package/fesm2020/cdk.mjs.map +1 -1
- package/fesm2020/overlay.mjs +22 -14
- package/fesm2020/overlay.mjs.map +1 -1
- package/fesm2020/table.mjs +22 -10
- package/fesm2020/table.mjs.map +1 -1
- package/fesm2020/testing/selenium-webdriver.mjs +2 -1
- package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
- package/fesm2020/testing/testbed.mjs +2 -1
- package/fesm2020/testing/testbed.mjs.map +1 -1
- package/fesm2020/testing.mjs +8 -1
- package/fesm2020/testing.mjs.map +1 -1
- package/fesm2020/text-field.mjs +6 -1
- package/fesm2020/text-field.mjs.map +1 -1
- package/overlay/position/flexible-connected-position-strategy.d.ts +4 -2
- package/package.json +1 -1
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-add/index.mjs +1 -1
- package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.js +5 -4
- package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.mjs +5 -4
- package/table/table.d.ts +13 -3
- package/testing/harness-environment.d.ts +3 -1
- package/testing/selenium-webdriver/selenium-web-driver-harness-environment.d.ts +2 -0
- package/testing/testbed/testbed-harness-environment.d.ts +2 -0
package/fesm2020/cdk.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { Version } from '@angular/core';
|
|
|
8
8
|
* found in the LICENSE file at https://angular.io/license
|
|
9
9
|
*/
|
|
10
10
|
/** Current version of the Angular Component Development Kit. */
|
|
11
|
-
const VERSION = new Version('13.2.0-next.
|
|
11
|
+
const VERSION = new Version('13.2.0-next.1');
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
package/fesm2020/cdk.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cdk.mjs","sources":["../../../../../../src/cdk/version.ts","../../../../../../src/cdk/public-api.ts","../../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('13.2.0-next.
|
|
1
|
+
{"version":3,"file":"cdk.mjs","sources":["../../../../../../src/cdk/version.ts","../../../../../../src/cdk/public-api.ts","../../../../../../src/cdk/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {Version} from '@angular/core';\n\n/** Current version of the Angular Component Development Kit. */\nexport const VERSION = new Version('13.2.0-next.1');\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './version';\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;;;;;;;AAUA;MACa,OAAO,GAAG,IAAI,OAAO,CAAC,mBAAmB;;ACXtD;;;;;;;;ACAA;;;;;;;;;;"}
|
package/fesm2020/overlay.mjs
CHANGED
|
@@ -1278,15 +1278,17 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1278
1278
|
this._clearPanelClasses();
|
|
1279
1279
|
this._resetOverlayElementStyles();
|
|
1280
1280
|
this._resetBoundingBoxStyles();
|
|
1281
|
-
// We need the bounding rects for the origin and the
|
|
1281
|
+
// We need the bounding rects for the origin, the overlay and the container to determine how to position
|
|
1282
1282
|
// the overlay relative to the origin.
|
|
1283
1283
|
// We use the viewport rect to determine whether a position would go off-screen.
|
|
1284
1284
|
this._viewportRect = this._getNarrowedViewportRect();
|
|
1285
1285
|
this._originRect = this._getOriginRect();
|
|
1286
1286
|
this._overlayRect = this._pane.getBoundingClientRect();
|
|
1287
|
+
this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
|
|
1287
1288
|
const originRect = this._originRect;
|
|
1288
1289
|
const overlayRect = this._overlayRect;
|
|
1289
1290
|
const viewportRect = this._viewportRect;
|
|
1291
|
+
const containerRect = this._containerRect;
|
|
1290
1292
|
// Positions where the overlay will fit with flexible dimensions.
|
|
1291
1293
|
const flexibleFits = [];
|
|
1292
1294
|
// Fallback if none of the preferred positions fit within the viewport.
|
|
@@ -1295,7 +1297,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1295
1297
|
// If a good fit is found, it will be applied immediately.
|
|
1296
1298
|
for (let pos of this._preferredPositions) {
|
|
1297
1299
|
// Get the exact (x, y) coordinate for the point-of-origin on the origin element.
|
|
1298
|
-
let originPoint = this._getOriginPoint(originRect, pos);
|
|
1300
|
+
let originPoint = this._getOriginPoint(originRect, containerRect, pos);
|
|
1299
1301
|
// From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
|
|
1300
1302
|
// overlay in this position. We use the top-left corner for calculations and later translate
|
|
1301
1303
|
// this into an appropriate (top, left, bottom, right) style.
|
|
@@ -1402,8 +1404,9 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1402
1404
|
this._originRect = this._getOriginRect();
|
|
1403
1405
|
this._overlayRect = this._pane.getBoundingClientRect();
|
|
1404
1406
|
this._viewportRect = this._getNarrowedViewportRect();
|
|
1407
|
+
this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
|
|
1405
1408
|
const lastPosition = this._lastPosition || this._preferredPositions[0];
|
|
1406
|
-
const originPoint = this._getOriginPoint(this._originRect, lastPosition);
|
|
1409
|
+
const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);
|
|
1407
1410
|
this._applyPosition(lastPosition, originPoint);
|
|
1408
1411
|
}
|
|
1409
1412
|
}
|
|
@@ -1505,7 +1508,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1505
1508
|
/**
|
|
1506
1509
|
* Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
|
|
1507
1510
|
*/
|
|
1508
|
-
_getOriginPoint(originRect, pos) {
|
|
1511
|
+
_getOriginPoint(originRect, containerRect, pos) {
|
|
1509
1512
|
let x;
|
|
1510
1513
|
if (pos.originX == 'center') {
|
|
1511
1514
|
// Note: when centering we should always use the `left`
|
|
@@ -1517,6 +1520,11 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1517
1520
|
const endX = this._isRtl() ? originRect.left : originRect.right;
|
|
1518
1521
|
x = pos.originX == 'start' ? startX : endX;
|
|
1519
1522
|
}
|
|
1523
|
+
// When zooming in Safari the container rectangle contains negative values for the position
|
|
1524
|
+
// and we need to re-add them to the calculated coordinates.
|
|
1525
|
+
if (containerRect.left < 0) {
|
|
1526
|
+
x -= containerRect.left;
|
|
1527
|
+
}
|
|
1520
1528
|
let y;
|
|
1521
1529
|
if (pos.originY == 'center') {
|
|
1522
1530
|
y = originRect.top + originRect.height / 2;
|
|
@@ -1524,6 +1532,14 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1524
1532
|
else {
|
|
1525
1533
|
y = pos.originY == 'top' ? originRect.top : originRect.bottom;
|
|
1526
1534
|
}
|
|
1535
|
+
// Normally the containerRect's top value would be zero, however when the overlay is attached to an input
|
|
1536
|
+
// (e.g. in an autocomplete), mobile browsers will shift everything in order to put the input in the middle
|
|
1537
|
+
// of the screen and to make space for the virtual keyboard. We need to account for this offset,
|
|
1538
|
+
// otherwise our positioning will be thrown off.
|
|
1539
|
+
// Additionally, when zooming in Safari this fixes the vertical position.
|
|
1540
|
+
if (containerRect.top < 0) {
|
|
1541
|
+
y -= containerRect.top;
|
|
1542
|
+
}
|
|
1527
1543
|
return { x, y };
|
|
1528
1544
|
}
|
|
1529
1545
|
/**
|
|
@@ -1590,7 +1606,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1590
1606
|
/**
|
|
1591
1607
|
* Whether the overlay can fit within the viewport when it may resize either its width or height.
|
|
1592
1608
|
* @param fit How well the overlay fits in the viewport at some position.
|
|
1593
|
-
* @param point The (x, y) coordinates of the
|
|
1609
|
+
* @param point The (x, y) coordinates of the overlay at some position.
|
|
1594
1610
|
* @param viewport The geometry of the viewport.
|
|
1595
1611
|
*/
|
|
1596
1612
|
_canFitWithFlexibleDimensions(fit, point, viewport) {
|
|
@@ -1611,7 +1627,7 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1611
1627
|
* right and bottom).
|
|
1612
1628
|
*
|
|
1613
1629
|
* @param start Starting point from which the overlay is pushed.
|
|
1614
|
-
* @param
|
|
1630
|
+
* @param rawOverlayRect Dimensions of the overlay.
|
|
1615
1631
|
* @param scrollPosition Current viewport scroll position.
|
|
1616
1632
|
* @returns The point at which to position the overlay after pushing. This is effectively a new
|
|
1617
1633
|
* originPoint.
|
|
@@ -1906,14 +1922,6 @@ class FlexibleConnectedPositionStrategy {
|
|
|
1906
1922
|
if (this._isPushed) {
|
|
1907
1923
|
overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
|
|
1908
1924
|
}
|
|
1909
|
-
let virtualKeyboardOffset = this._overlayContainer
|
|
1910
|
-
.getContainerElement()
|
|
1911
|
-
.getBoundingClientRect().top;
|
|
1912
|
-
// Normally this would be zero, however when the overlay is attached to an input (e.g. in an
|
|
1913
|
-
// autocomplete), mobile browsers will shift everything in order to put the input in the middle
|
|
1914
|
-
// of the screen and to make space for the virtual keyboard. We need to account for this offset,
|
|
1915
|
-
// otherwise our positioning will be thrown off.
|
|
1916
|
-
overlayPoint.y -= virtualKeyboardOffset;
|
|
1917
1925
|
// We want to set either `top` or `bottom` based on whether the overlay wants to appear
|
|
1918
1926
|
// above or below the origin and the direction in which the element will expand.
|
|
1919
1927
|
if (position.overlayY === 'bottom') {
|