@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.
Files changed (52) hide show
  1. package/LICENSE +1 -1
  2. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +2 -2
  3. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +23 -15
  4. package/esm2020/table/cell.mjs +2 -7
  5. package/esm2020/table/table.mjs +23 -6
  6. package/esm2020/testing/harness-environment.mjs +9 -2
  7. package/esm2020/testing/selenium-webdriver/selenium-web-driver-harness-environment.mjs +3 -2
  8. package/esm2020/testing/testbed/testbed-harness-environment.mjs +3 -2
  9. package/esm2020/text-field/autosize.mjs +7 -2
  10. package/esm2020/version.mjs +1 -1
  11. package/fesm2015/a11y.mjs +1 -1
  12. package/fesm2015/a11y.mjs.map +1 -1
  13. package/fesm2015/cdk.mjs +1 -1
  14. package/fesm2015/cdk.mjs.map +1 -1
  15. package/fesm2015/overlay.mjs +22 -14
  16. package/fesm2015/overlay.mjs.map +1 -1
  17. package/fesm2015/table.mjs +22 -10
  18. package/fesm2015/table.mjs.map +1 -1
  19. package/fesm2015/testing/selenium-webdriver.mjs +2 -1
  20. package/fesm2015/testing/selenium-webdriver.mjs.map +1 -1
  21. package/fesm2015/testing/testbed.mjs +2 -1
  22. package/fesm2015/testing/testbed.mjs.map +1 -1
  23. package/fesm2015/testing.mjs +8 -1
  24. package/fesm2015/testing.mjs.map +1 -1
  25. package/fesm2015/text-field.mjs +6 -1
  26. package/fesm2015/text-field.mjs.map +1 -1
  27. package/fesm2020/a11y.mjs +1 -1
  28. package/fesm2020/a11y.mjs.map +1 -1
  29. package/fesm2020/cdk.mjs +1 -1
  30. package/fesm2020/cdk.mjs.map +1 -1
  31. package/fesm2020/overlay.mjs +22 -14
  32. package/fesm2020/overlay.mjs.map +1 -1
  33. package/fesm2020/table.mjs +22 -10
  34. package/fesm2020/table.mjs.map +1 -1
  35. package/fesm2020/testing/selenium-webdriver.mjs +2 -1
  36. package/fesm2020/testing/selenium-webdriver.mjs.map +1 -1
  37. package/fesm2020/testing/testbed.mjs +2 -1
  38. package/fesm2020/testing/testbed.mjs.map +1 -1
  39. package/fesm2020/testing.mjs +8 -1
  40. package/fesm2020/testing.mjs.map +1 -1
  41. package/fesm2020/text-field.mjs +6 -1
  42. package/fesm2020/text-field.mjs.map +1 -1
  43. package/overlay/position/flexible-connected-position-strategy.d.ts +4 -2
  44. package/package.json +1 -1
  45. package/schematics/ng-add/index.js +1 -1
  46. package/schematics/ng-add/index.mjs +1 -1
  47. package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.js +5 -4
  48. package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.mjs +5 -4
  49. package/table/table.d.ts +13 -3
  50. package/testing/harness-environment.d.ts +3 -1
  51. package/testing/selenium-webdriver/selenium-web-driver-harness-environment.d.ts +2 -0
  52. package/testing/testbed/testbed-harness-environment.d.ts +2 -0
package/fesm2015/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.0');
11
+ const VERSION = new Version('13.2.0-next.1');
12
12
 
13
13
  /**
14
14
  * @license
@@ -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.0');\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;;;;;;;;;;"}
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;;;;;;;;;;"}
@@ -1058,15 +1058,17 @@ class FlexibleConnectedPositionStrategy {
1058
1058
  this._clearPanelClasses();
1059
1059
  this._resetOverlayElementStyles();
1060
1060
  this._resetBoundingBoxStyles();
1061
- // We need the bounding rects for the origin and the overlay to determine how to position
1061
+ // We need the bounding rects for the origin, the overlay and the container to determine how to position
1062
1062
  // the overlay relative to the origin.
1063
1063
  // We use the viewport rect to determine whether a position would go off-screen.
1064
1064
  this._viewportRect = this._getNarrowedViewportRect();
1065
1065
  this._originRect = this._getOriginRect();
1066
1066
  this._overlayRect = this._pane.getBoundingClientRect();
1067
+ this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
1067
1068
  const originRect = this._originRect;
1068
1069
  const overlayRect = this._overlayRect;
1069
1070
  const viewportRect = this._viewportRect;
1071
+ const containerRect = this._containerRect;
1070
1072
  // Positions where the overlay will fit with flexible dimensions.
1071
1073
  const flexibleFits = [];
1072
1074
  // Fallback if none of the preferred positions fit within the viewport.
@@ -1075,7 +1077,7 @@ class FlexibleConnectedPositionStrategy {
1075
1077
  // If a good fit is found, it will be applied immediately.
1076
1078
  for (let pos of this._preferredPositions) {
1077
1079
  // Get the exact (x, y) coordinate for the point-of-origin on the origin element.
1078
- let originPoint = this._getOriginPoint(originRect, pos);
1080
+ let originPoint = this._getOriginPoint(originRect, containerRect, pos);
1079
1081
  // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
1080
1082
  // overlay in this position. We use the top-left corner for calculations and later translate
1081
1083
  // this into an appropriate (top, left, bottom, right) style.
@@ -1182,8 +1184,9 @@ class FlexibleConnectedPositionStrategy {
1182
1184
  this._originRect = this._getOriginRect();
1183
1185
  this._overlayRect = this._pane.getBoundingClientRect();
1184
1186
  this._viewportRect = this._getNarrowedViewportRect();
1187
+ this._containerRect = this._overlayContainer.getContainerElement().getBoundingClientRect();
1185
1188
  const lastPosition = this._lastPosition || this._preferredPositions[0];
1186
- const originPoint = this._getOriginPoint(this._originRect, lastPosition);
1189
+ const originPoint = this._getOriginPoint(this._originRect, this._containerRect, lastPosition);
1187
1190
  this._applyPosition(lastPosition, originPoint);
1188
1191
  }
1189
1192
  }
@@ -1285,7 +1288,7 @@ class FlexibleConnectedPositionStrategy {
1285
1288
  /**
1286
1289
  * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
1287
1290
  */
1288
- _getOriginPoint(originRect, pos) {
1291
+ _getOriginPoint(originRect, containerRect, pos) {
1289
1292
  let x;
1290
1293
  if (pos.originX == 'center') {
1291
1294
  // Note: when centering we should always use the `left`
@@ -1297,6 +1300,11 @@ class FlexibleConnectedPositionStrategy {
1297
1300
  const endX = this._isRtl() ? originRect.left : originRect.right;
1298
1301
  x = pos.originX == 'start' ? startX : endX;
1299
1302
  }
1303
+ // When zooming in Safari the container rectangle contains negative values for the position
1304
+ // and we need to re-add them to the calculated coordinates.
1305
+ if (containerRect.left < 0) {
1306
+ x -= containerRect.left;
1307
+ }
1300
1308
  let y;
1301
1309
  if (pos.originY == 'center') {
1302
1310
  y = originRect.top + originRect.height / 2;
@@ -1304,6 +1312,14 @@ class FlexibleConnectedPositionStrategy {
1304
1312
  else {
1305
1313
  y = pos.originY == 'top' ? originRect.top : originRect.bottom;
1306
1314
  }
1315
+ // Normally the containerRect's top value would be zero, however when the overlay is attached to an input
1316
+ // (e.g. in an autocomplete), mobile browsers will shift everything in order to put the input in the middle
1317
+ // of the screen and to make space for the virtual keyboard. We need to account for this offset,
1318
+ // otherwise our positioning will be thrown off.
1319
+ // Additionally, when zooming in Safari this fixes the vertical position.
1320
+ if (containerRect.top < 0) {
1321
+ y -= containerRect.top;
1322
+ }
1307
1323
  return { x, y };
1308
1324
  }
1309
1325
  /**
@@ -1370,7 +1386,7 @@ class FlexibleConnectedPositionStrategy {
1370
1386
  /**
1371
1387
  * Whether the overlay can fit within the viewport when it may resize either its width or height.
1372
1388
  * @param fit How well the overlay fits in the viewport at some position.
1373
- * @param point The (x, y) coordinates of the overlat at some position.
1389
+ * @param point The (x, y) coordinates of the overlay at some position.
1374
1390
  * @param viewport The geometry of the viewport.
1375
1391
  */
1376
1392
  _canFitWithFlexibleDimensions(fit, point, viewport) {
@@ -1391,7 +1407,7 @@ class FlexibleConnectedPositionStrategy {
1391
1407
  * right and bottom).
1392
1408
  *
1393
1409
  * @param start Starting point from which the overlay is pushed.
1394
- * @param overlay Dimensions of the overlay.
1410
+ * @param rawOverlayRect Dimensions of the overlay.
1395
1411
  * @param scrollPosition Current viewport scroll position.
1396
1412
  * @returns The point at which to position the overlay after pushing. This is effectively a new
1397
1413
  * originPoint.
@@ -1686,14 +1702,6 @@ class FlexibleConnectedPositionStrategy {
1686
1702
  if (this._isPushed) {
1687
1703
  overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
1688
1704
  }
1689
- let virtualKeyboardOffset = this._overlayContainer
1690
- .getContainerElement()
1691
- .getBoundingClientRect().top;
1692
- // Normally this would be zero, however when the overlay is attached to an input (e.g. in an
1693
- // autocomplete), mobile browsers will shift everything in order to put the input in the middle
1694
- // of the screen and to make space for the virtual keyboard. We need to account for this offset,
1695
- // otherwise our positioning will be thrown off.
1696
- overlayPoint.y -= virtualKeyboardOffset;
1697
1705
  // We want to set either `top` or `bottom` based on whether the overlay wants to appear
1698
1706
  // above or below the origin and the direction in which the element will expand.
1699
1707
  if (position.overlayY === 'bottom') {