@angular/cdk 11.0.2 → 11.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.
Files changed (141) hide show
  1. package/LICENSE +1 -1
  2. package/a11y/aria-describer/aria-describer.d.ts +9 -14
  3. package/a11y/focus-monitor/focus-monitor.d.ts +6 -0
  4. package/a11y/index.metadata.json +1 -1
  5. package/bundles/cdk-a11y.umd.js +83 -66
  6. package/bundles/cdk-a11y.umd.js.map +1 -1
  7. package/bundles/cdk-a11y.umd.min.js +13 -21
  8. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  9. package/bundles/cdk-accordion.umd.js.map +1 -1
  10. package/bundles/cdk-bidi.umd.js.map +1 -1
  11. package/bundles/cdk-coercion.umd.js +9 -1
  12. package/bundles/cdk-coercion.umd.js.map +1 -1
  13. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  14. package/bundles/cdk-collections.umd.js +9 -1
  15. package/bundles/cdk-collections.umd.js.map +1 -1
  16. package/bundles/cdk-collections.umd.min.js +1 -1
  17. package/bundles/cdk-collections.umd.min.js.map +1 -1
  18. package/bundles/cdk-drag-drop.umd.js +96 -50
  19. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  20. package/bundles/cdk-drag-drop.umd.min.js +8 -8
  21. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  22. package/bundles/cdk-overlay.umd.js +48 -10
  23. package/bundles/cdk-overlay.umd.js.map +1 -1
  24. package/bundles/cdk-overlay.umd.min.js +18 -25
  25. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  26. package/bundles/cdk-platform.umd.js +1 -0
  27. package/bundles/cdk-platform.umd.js.map +1 -1
  28. package/bundles/cdk-platform.umd.min.js +1 -1
  29. package/bundles/cdk-platform.umd.min.js.map +1 -1
  30. package/bundles/cdk-portal.umd.js +9 -1
  31. package/bundles/cdk-portal.umd.js.map +1 -1
  32. package/bundles/cdk-portal.umd.min.js +2 -2
  33. package/bundles/cdk-portal.umd.min.js.map +1 -1
  34. package/bundles/cdk-scrolling.umd.js +25 -11
  35. package/bundles/cdk-scrolling.umd.js.map +1 -1
  36. package/bundles/cdk-scrolling.umd.min.js +4 -4
  37. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  38. package/bundles/cdk-table.umd.js +99 -30
  39. package/bundles/cdk-table.umd.js.map +1 -1
  40. package/bundles/cdk-table.umd.min.js +7 -7
  41. package/bundles/cdk-table.umd.min.js.map +1 -1
  42. package/bundles/cdk-testing-protractor.umd.js +59 -13
  43. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  44. package/bundles/cdk-testing-protractor.umd.min.js +2 -2
  45. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  46. package/bundles/cdk-testing-testbed.umd.js +40 -15
  47. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  48. package/bundles/cdk-testing-testbed.umd.min.js +7 -7
  49. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  50. package/bundles/cdk-testing.umd.js +11 -10
  51. package/bundles/cdk-testing.umd.js.map +1 -1
  52. package/bundles/cdk-testing.umd.min.js +2 -2
  53. package/bundles/cdk-testing.umd.min.js.map +1 -1
  54. package/bundles/cdk-tree.umd.js +9 -1
  55. package/bundles/cdk-tree.umd.js.map +1 -1
  56. package/bundles/cdk-tree.umd.min.js +5 -5
  57. package/bundles/cdk-tree.umd.min.js.map +1 -1
  58. package/bundles/cdk.umd.js +1 -1
  59. package/bundles/cdk.umd.js.map +1 -1
  60. package/bundles/cdk.umd.min.js +1 -1
  61. package/bundles/cdk.umd.min.js.map +1 -1
  62. package/drag-drop/directives/drag.d.ts +1 -1
  63. package/drag-drop/directives/drop-list.d.ts +4 -1
  64. package/drag-drop/drag-drop-registry.d.ts +8 -1
  65. package/drag-drop/drag-ref.d.ts +2 -0
  66. package/drag-drop/drop-list-ref.d.ts +7 -1
  67. package/drag-drop/index.metadata.json +1 -1
  68. package/esm2015/a11y/aria-describer/aria-describer.js +50 -55
  69. package/esm2015/a11y/focus-monitor/focus-monitor.js +18 -3
  70. package/esm2015/drag-drop/directives/drag.js +6 -4
  71. package/esm2015/drag-drop/directives/drop-list.js +4 -2
  72. package/esm2015/drag-drop/drag-drop-registry.js +25 -12
  73. package/esm2015/drag-drop/drag-ref.js +10 -8
  74. package/esm2015/drag-drop/drop-list-ref.js +46 -28
  75. package/esm2015/overlay/position/flexible-connected-position-strategy.js +25 -3
  76. package/esm2015/overlay/scroll/block-scroll-strategy.js +13 -4
  77. package/esm2015/platform/features/scrolling.js +2 -1
  78. package/esm2015/scrolling/fixed-size-virtual-scroll.js +3 -2
  79. package/esm2015/scrolling/scroll-dispatcher.js +9 -8
  80. package/esm2015/scrolling/virtual-for-of.js +8 -4
  81. package/esm2015/scrolling/virtual-scroll-viewport.js +1 -1
  82. package/esm2015/table/public-api.js +2 -1
  83. package/esm2015/table/sticky-position-listener.js +11 -0
  84. package/esm2015/table/sticky-styler.js +60 -14
  85. package/esm2015/table/table.js +9 -4
  86. package/esm2015/testing/change-detection.js +1 -8
  87. package/esm2015/testing/harness-environment.js +3 -3
  88. package/esm2015/testing/protractor/protractor-element.js +29 -13
  89. package/esm2015/testing/test-element.js +1 -1
  90. package/esm2015/testing/testbed/fake-events/dispatch-events.js +3 -3
  91. package/esm2015/testing/testbed/fake-events/event-objects.js +6 -6
  92. package/esm2015/testing/testbed/unit-test-element.js +21 -9
  93. package/esm2015/tree/nested-node.js +1 -1
  94. package/esm2015/tree/padding.js +1 -1
  95. package/esm2015/tree/toggle.js +1 -1
  96. package/esm2015/tree/tree.js +1 -1
  97. package/esm2015/version.js +1 -1
  98. package/fesm2015/a11y.js +67 -55
  99. package/fesm2015/a11y.js.map +1 -1
  100. package/fesm2015/accordion.js.map +1 -1
  101. package/fesm2015/bidi.js.map +1 -1
  102. package/fesm2015/cdk.js +1 -1
  103. package/fesm2015/cdk.js.map +1 -1
  104. package/fesm2015/drag-drop.js +85 -48
  105. package/fesm2015/drag-drop.js.map +1 -1
  106. package/fesm2015/overlay.js +36 -6
  107. package/fesm2015/overlay.js.map +1 -1
  108. package/fesm2015/platform.js +1 -0
  109. package/fesm2015/platform.js.map +1 -1
  110. package/fesm2015/scrolling.js +17 -12
  111. package/fesm2015/scrolling.js.map +1 -1
  112. package/fesm2015/table.js +77 -17
  113. package/fesm2015/table.js.map +1 -1
  114. package/fesm2015/testing/protractor.js +27 -11
  115. package/fesm2015/testing/protractor.js.map +1 -1
  116. package/fesm2015/testing/testbed.js +25 -13
  117. package/fesm2015/testing/testbed.js.map +1 -1
  118. package/fesm2015/testing.js +2 -9
  119. package/fesm2015/testing.js.map +1 -1
  120. package/fesm2015/tree.js.map +1 -1
  121. package/overlay/index.metadata.json +1 -1
  122. package/package.json +1 -1
  123. package/schematics/ng-add/index.js +1 -1
  124. package/scrolling/index.metadata.json +1 -1
  125. package/scrolling/scroll-dispatcher.d.ts +3 -3
  126. package/table/index.metadata.json +1 -1
  127. package/table/public-api.d.ts +1 -0
  128. package/table/sticky-position-listener.d.ts +28 -0
  129. package/table/sticky-styler.d.ts +7 -2
  130. package/table/table.d.ts +4 -2
  131. package/testing/change-detection.d.ts +44 -1
  132. package/testing/protractor/protractor-element.d.ts +12 -4
  133. package/testing/test-element.d.ts +11 -5
  134. package/testing/testbed/fake-events/dispatch-events.d.ts +1 -1
  135. package/testing/testbed/fake-events/event-objects.d.ts +1 -1
  136. package/testing/testbed/unit-test-element.d.ts +12 -4
  137. package/tree/index.metadata.json +1 -1
  138. package/tree/nested-node.d.ts +3 -3
  139. package/tree/padding.d.ts +2 -2
  140. package/tree/toggle.d.ts +4 -4
  141. package/tree/tree.d.ts +5 -5
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/scrolling'), require('@angular/common'), require('@angular/core'), require('@angular/cdk/coercion'), require('@angular/cdk/bidi'), require('@angular/cdk/portal'), require('@angular/cdk/platform'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/keycodes')) :
3
- typeof define === 'function' && define.amd ? define('@angular/cdk/overlay', ['exports', '@angular/cdk/scrolling', '@angular/common', '@angular/core', '@angular/cdk/coercion', '@angular/cdk/bidi', '@angular/cdk/portal', '@angular/cdk/platform', 'rxjs', 'rxjs/operators', '@angular/cdk/keycodes'], factory) :
4
- (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.overlay = {}), global.ng.cdk.scrolling, global.ng.common, global.ng.core, global.ng.cdk.coercion, global.ng.cdk.bidi, global.ng.cdk.portal, global.ng.cdk.platform, global.rxjs, global.rxjs.operators, global.ng.cdk.keycodes));
5
- }(this, (function (exports, i1, i1$1, i0, coercion, bidi, portal, i2, rxjs, operators, keycodes) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/scrolling'), require('@angular/common'), require('@angular/core'), require('@angular/cdk/coercion'), require('@angular/cdk/platform'), require('@angular/cdk/bidi'), require('@angular/cdk/portal'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/keycodes')) :
3
+ typeof define === 'function' && define.amd ? define('@angular/cdk/overlay', ['exports', '@angular/cdk/scrolling', '@angular/common', '@angular/core', '@angular/cdk/coercion', '@angular/cdk/platform', '@angular/cdk/bidi', '@angular/cdk/portal', 'rxjs', 'rxjs/operators', '@angular/cdk/keycodes'], factory) :
4
+ (global = global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.overlay = {}), global.ng.cdk.scrolling, global.ng.common, global.ng.core, global.ng.cdk.coercion, global.ng.cdk.platform, global.ng.cdk.bidi, global.ng.cdk.portal, global.rxjs, global.rxjs.operators, global.ng.cdk.keycodes));
5
+ }(this, (function (exports, i1, i1$1, i0, coercion, i2, bidi, portal, rxjs, operators, keycodes) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -28,6 +28,8 @@
28
28
  return extendStatics(d, b);
29
29
  };
30
30
  function __extends(d, b) {
31
+ if (typeof b !== "function" && b !== null)
32
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
33
  extendStatics(d, b);
32
34
  function __() { this.constructor = d; }
33
35
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -213,11 +215,13 @@
213
215
  }
214
216
  return ar;
215
217
  }
218
+ /** @deprecated */
216
219
  function __spread() {
217
220
  for (var ar = [], i = 0; i < arguments.length; i++)
218
221
  ar = ar.concat(__read(arguments[i]));
219
222
  return ar;
220
223
  }
224
+ /** @deprecated */
221
225
  function __spreadArrays() {
222
226
  for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
227
  s += arguments[i].length;
@@ -226,7 +230,11 @@
226
230
  r[k] = a[j];
227
231
  return r;
228
232
  }
229
- ;
233
+ function __spreadArray(to, from) {
234
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
+ to[j] = from[i];
236
+ return to;
237
+ }
230
238
  function __await(v) {
231
239
  return this instanceof __await ? (this.v = v, this) : new __await(v);
232
240
  }
@@ -312,6 +320,7 @@
312
320
  * Use of this source code is governed by an MIT-style license that can be
313
321
  * found in the LICENSE file at https://angular.io/license
314
322
  */
323
+ var scrollBehaviorSupported = i2.supportsScrollBehavior();
315
324
  /**
316
325
  * Strategy that will prevent the user from scrolling while the overlay is visible.
317
326
  */
@@ -355,10 +364,17 @@
355
364
  html.classList.remove('cdk-global-scrollblock');
356
365
  // Disable user-defined smooth scrolling temporarily while we restore the scroll position.
357
366
  // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior
358
- htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';
367
+ // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,
368
+ // because it can throw off feature detections in `supportsScrollBehavior` which
369
+ // checks for `'scrollBehavior' in documentElement.style`.
370
+ if (scrollBehaviorSupported) {
371
+ htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';
372
+ }
359
373
  window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
360
- htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
361
- bodyStyle.scrollBehavior = previousBodyScrollBehavior;
374
+ if (scrollBehaviorSupported) {
375
+ htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
376
+ bodyStyle.scrollBehavior = previousBodyScrollBehavior;
377
+ }
362
378
  }
363
379
  };
364
380
  BlockScrollStrategy.prototype._canBeEnabled = function () {
@@ -1886,7 +1902,10 @@
1886
1902
  };
1887
1903
  };
1888
1904
  /** Gets how well an overlay at the given point will fit within the viewport. */
1889
- FlexibleConnectedPositionStrategy.prototype._getOverlayFit = function (point, overlay, viewport, position) {
1905
+ FlexibleConnectedPositionStrategy.prototype._getOverlayFit = function (point, rawOverlayRect, viewport, position) {
1906
+ // Round the overlay rect when comparing against the
1907
+ // viewport, because the viewport is always rounded.
1908
+ var overlay = getRoundedBoundingClientRect(rawOverlayRect);
1890
1909
  var x = point.x, y = point.y;
1891
1910
  var offsetX = this._getOffset(position, 'x');
1892
1911
  var offsetY = this._getOffset(position, 'y');
@@ -1944,7 +1963,7 @@
1944
1963
  * @returns The point at which to position the overlay after pushing. This is effectively a new
1945
1964
  * originPoint.
1946
1965
  */
1947
- FlexibleConnectedPositionStrategy.prototype._pushOverlayOnScreen = function (start, overlay, scrollPosition) {
1966
+ FlexibleConnectedPositionStrategy.prototype._pushOverlayOnScreen = function (start, rawOverlayRect, scrollPosition) {
1948
1967
  // If the position is locked and we've pushed the overlay already, reuse the previous push
1949
1968
  // amount, rather than pushing it again. If we were to continue pushing, the element would
1950
1969
  // remain in the viewport, which goes against the expectations when position locking is enabled.
@@ -1954,6 +1973,9 @@
1954
1973
  y: start.y + this._previousPushAmount.y
1955
1974
  };
1956
1975
  }
1976
+ // Round the overlay rect when comparing against the
1977
+ // viewport, because the viewport is always rounded.
1978
+ var overlay = getRoundedBoundingClientRect(rawOverlayRect);
1957
1979
  var viewport = this._viewportRect;
1958
1980
  // Determine how much the overlay goes outside the viewport on each
1959
1981
  // side, which we'll use to decide which direction to push it.
@@ -2432,6 +2454,22 @@
2432
2454
  }
2433
2455
  return input || null;
2434
2456
  }
2457
+ /**
2458
+ * Gets a version of an element's bounding `ClientRect` where all the values are rounded down to
2459
+ * the nearest pixel. This allows us to account for the cases where there may be sub-pixel
2460
+ * deviations in the `ClientRect` returned by the browser (e.g. when zoomed in with a percentage
2461
+ * size, see #21350).
2462
+ */
2463
+ function getRoundedBoundingClientRect(clientRect) {
2464
+ return {
2465
+ top: Math.floor(clientRect.top),
2466
+ right: Math.floor(clientRect.right),
2467
+ bottom: Math.floor(clientRect.bottom),
2468
+ left: Math.floor(clientRect.left),
2469
+ width: Math.floor(clientRect.width),
2470
+ height: Math.floor(clientRect.height)
2471
+ };
2472
+ }
2435
2473
 
2436
2474
  /**
2437
2475
  * @license