@angular/cdk 17.0.2 → 17.1.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 (113) hide show
  1. package/a11y/index.d.ts +10 -10
  2. package/accordion/index.d.ts +3 -3
  3. package/bidi/index.d.ts +2 -2
  4. package/clipboard/index.d.ts +2 -2
  5. package/collections/index.d.ts +1 -1
  6. package/esm2022/a11y/a11y-module.mjs +3 -4
  7. package/esm2022/a11y/focus-monitor/focus-monitor.mjs +21 -5
  8. package/esm2022/a11y/focus-trap/focus-trap.mjs +3 -2
  9. package/esm2022/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +14 -7
  10. package/esm2022/a11y/live-announcer/live-announcer.mjs +3 -2
  11. package/esm2022/a11y/public-api.mjs +2 -2
  12. package/esm2022/accordion/accordion-item.mjs +3 -2
  13. package/esm2022/accordion/accordion-module.mjs +3 -3
  14. package/esm2022/accordion/accordion.mjs +3 -2
  15. package/esm2022/bidi/bidi-module.mjs +3 -3
  16. package/esm2022/bidi/dir.mjs +3 -2
  17. package/esm2022/clipboard/clipboard-module.mjs +3 -3
  18. package/esm2022/clipboard/copy-to-clipboard.mjs +3 -2
  19. package/esm2022/clipboard/pending-copy.mjs +1 -1
  20. package/esm2022/collections/dispose-view-repeater-strategy.mjs +5 -4
  21. package/esm2022/collections/recycle-view-repeater-strategy.mjs +5 -4
  22. package/esm2022/collections/view-repeater.mjs +13 -1
  23. package/esm2022/dialog/dialog-container.mjs +5 -6
  24. package/esm2022/dialog/dialog-module.mjs +2 -2
  25. package/esm2022/drag-drop/drag-drop-registry.mjs +1 -1
  26. package/esm2022/drag-drop/drop-list-ref.mjs +37 -23
  27. package/esm2022/layout/breakpoints-observer.mjs +1 -1
  28. package/esm2022/menu/menu-bar.mjs +5 -5
  29. package/esm2022/menu/menu-base.mjs +3 -2
  30. package/esm2022/menu/menu-item-selectable.mjs +3 -2
  31. package/esm2022/menu/menu-item.mjs +5 -5
  32. package/esm2022/menu/menu-stack.mjs +8 -1
  33. package/esm2022/menu/menu-trigger-base.mjs +3 -2
  34. package/esm2022/menu/menu.mjs +6 -6
  35. package/esm2022/observers/observe-content.mjs +5 -4
  36. package/esm2022/overlay/overlay-container.mjs +1 -1
  37. package/esm2022/overlay/overlay-directives.mjs +9 -3
  38. package/esm2022/overlay/scroll/block-scroll-strategy.mjs +1 -1
  39. package/esm2022/platform/features/scrolling.mjs +23 -4
  40. package/esm2022/portal/portal-directives.mjs +11 -7
  41. package/esm2022/portal/portal-injector.mjs +1 -1
  42. package/esm2022/scrolling/scrollable.mjs +7 -7
  43. package/esm2022/stepper/step-header.mjs +3 -2
  44. package/esm2022/stepper/step-label.mjs +3 -2
  45. package/esm2022/stepper/stepper-button.mjs +5 -3
  46. package/esm2022/stepper/stepper-module.mjs +7 -6
  47. package/esm2022/stepper/stepper.mjs +5 -3
  48. package/esm2022/table/cell.mjs +24 -11
  49. package/esm2022/table/row.mjs +23 -10
  50. package/esm2022/table/table-module.mjs +4 -5
  51. package/esm2022/table/table.mjs +28 -15
  52. package/esm2022/table/text-column.mjs +6 -5
  53. package/esm2022/text-field/autofill.mjs +3 -2
  54. package/esm2022/text-field/autosize.mjs +3 -2
  55. package/esm2022/text-field/text-field-module.mjs +3 -3
  56. package/esm2022/tree/nested-node.mjs +3 -3
  57. package/esm2022/tree/node.mjs +3 -2
  58. package/esm2022/tree/outlet.mjs +3 -2
  59. package/esm2022/tree/padding.mjs +7 -7
  60. package/esm2022/tree/toggle.mjs +7 -13
  61. package/esm2022/tree/tree-module.mjs +3 -3
  62. package/esm2022/tree/tree.mjs +8 -7
  63. package/esm2022/version.mjs +1 -1
  64. package/fesm2022/a11y.mjs +40 -16
  65. package/fesm2022/a11y.mjs.map +1 -1
  66. package/fesm2022/accordion.mjs +6 -4
  67. package/fesm2022/accordion.mjs.map +1 -1
  68. package/fesm2022/bidi.mjs +4 -3
  69. package/fesm2022/bidi.mjs.map +1 -1
  70. package/fesm2022/cdk.mjs +1 -1
  71. package/fesm2022/cdk.mjs.map +1 -1
  72. package/fesm2022/clipboard.mjs +4 -3
  73. package/fesm2022/clipboard.mjs.map +1 -1
  74. package/fesm2022/collections.mjs +26 -14
  75. package/fesm2022/collections.mjs.map +1 -1
  76. package/fesm2022/dialog.mjs +5 -6
  77. package/fesm2022/dialog.mjs.map +1 -1
  78. package/fesm2022/drag-drop.mjs +36 -22
  79. package/fesm2022/drag-drop.mjs.map +1 -1
  80. package/fesm2022/layout.mjs.map +1 -1
  81. package/fesm2022/menu.mjs +24 -14
  82. package/fesm2022/menu.mjs.map +1 -1
  83. package/fesm2022/observers.mjs +4 -3
  84. package/fesm2022/observers.mjs.map +1 -1
  85. package/fesm2022/overlay.mjs +8 -2
  86. package/fesm2022/overlay.mjs.map +1 -1
  87. package/fesm2022/platform.mjs +23 -4
  88. package/fesm2022/platform.mjs.map +1 -1
  89. package/fesm2022/portal.mjs +10 -6
  90. package/fesm2022/portal.mjs.map +1 -1
  91. package/fesm2022/scrolling.mjs +6 -6
  92. package/fesm2022/scrolling.mjs.map +1 -1
  93. package/fesm2022/stepper.mjs +18 -11
  94. package/fesm2022/stepper.mjs.map +1 -1
  95. package/fesm2022/table.mjs +79 -39
  96. package/fesm2022/table.mjs.map +1 -1
  97. package/fesm2022/text-field.mjs +6 -4
  98. package/fesm2022/text-field.mjs.map +1 -1
  99. package/fesm2022/tree.mjs +25 -25
  100. package/fesm2022/tree.mjs.map +1 -1
  101. package/menu/index.d.ts +4 -4
  102. package/observers/index.d.ts +2 -2
  103. package/package.json +3 -3
  104. package/platform/index.d.ts +1 -1
  105. package/portal/index.d.ts +5 -5
  106. package/schematics/ng-add/index.js +1 -1
  107. package/schematics/ng-add/index.mjs +1 -1
  108. package/schematics/update-tool/target-version.js +1 -2
  109. package/schematics/update-tool/target-version.mjs +1 -2
  110. package/stepper/index.d.ts +12 -12
  111. package/table/index.d.ts +28 -28
  112. package/text-field/index.d.ts +3 -3
  113. package/tree/index.d.ts +13 -15
@@ -1813,6 +1813,20 @@ const DROP_PROXIMITY_THRESHOLD = 0.05;
1813
1813
  * viewport. The value comes from trying it out manually until it feels right.
1814
1814
  */
1815
1815
  const SCROLL_PROXIMITY_THRESHOLD = 0.05;
1816
+ /** Vertical direction in which we can auto-scroll. */
1817
+ var AutoScrollVerticalDirection;
1818
+ (function (AutoScrollVerticalDirection) {
1819
+ AutoScrollVerticalDirection[AutoScrollVerticalDirection["NONE"] = 0] = "NONE";
1820
+ AutoScrollVerticalDirection[AutoScrollVerticalDirection["UP"] = 1] = "UP";
1821
+ AutoScrollVerticalDirection[AutoScrollVerticalDirection["DOWN"] = 2] = "DOWN";
1822
+ })(AutoScrollVerticalDirection || (AutoScrollVerticalDirection = {}));
1823
+ /** Horizontal direction in which we can auto-scroll. */
1824
+ var AutoScrollHorizontalDirection;
1825
+ (function (AutoScrollHorizontalDirection) {
1826
+ AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["NONE"] = 0] = "NONE";
1827
+ AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["LEFT"] = 1] = "LEFT";
1828
+ AutoScrollHorizontalDirection[AutoScrollHorizontalDirection["RIGHT"] = 2] = "RIGHT";
1829
+ })(AutoScrollHorizontalDirection || (AutoScrollHorizontalDirection = {}));
1816
1830
  /**
1817
1831
  * Reference to a drop list. Used to manipulate or dispose of the container.
1818
1832
  */
@@ -1869,9 +1883,9 @@ class DropListRef {
1869
1883
  /** Subscription to the window being scrolled. */
1870
1884
  this._viewportScrollSubscription = Subscription.EMPTY;
1871
1885
  /** Vertical direction in which the list is currently scrolling. */
1872
- this._verticalScrollDirection = 0 /* AutoScrollVerticalDirection.NONE */;
1886
+ this._verticalScrollDirection = AutoScrollVerticalDirection.NONE;
1873
1887
  /** Horizontal direction in which the list is currently scrolling. */
1874
- this._horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
1888
+ this._horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;
1875
1889
  /** Used to signal to the current auto-scroll sequence when to stop. */
1876
1890
  this._stopScrollTimers = new Subject();
1877
1891
  /** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */
@@ -1884,16 +1898,16 @@ class DropListRef {
1884
1898
  .subscribe(() => {
1885
1899
  const node = this._scrollNode;
1886
1900
  const scrollStep = this.autoScrollStep;
1887
- if (this._verticalScrollDirection === 1 /* AutoScrollVerticalDirection.UP */) {
1901
+ if (this._verticalScrollDirection === AutoScrollVerticalDirection.UP) {
1888
1902
  node.scrollBy(0, -scrollStep);
1889
1903
  }
1890
- else if (this._verticalScrollDirection === 2 /* AutoScrollVerticalDirection.DOWN */) {
1904
+ else if (this._verticalScrollDirection === AutoScrollVerticalDirection.DOWN) {
1891
1905
  node.scrollBy(0, scrollStep);
1892
1906
  }
1893
- if (this._horizontalScrollDirection === 1 /* AutoScrollHorizontalDirection.LEFT */) {
1907
+ if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.LEFT) {
1894
1908
  node.scrollBy(-scrollStep, 0);
1895
1909
  }
1896
- else if (this._horizontalScrollDirection === 2 /* AutoScrollHorizontalDirection.RIGHT */) {
1910
+ else if (this._horizontalScrollDirection === AutoScrollHorizontalDirection.RIGHT) {
1897
1911
  node.scrollBy(scrollStep, 0);
1898
1912
  }
1899
1913
  });
@@ -2102,8 +2116,8 @@ class DropListRef {
2102
2116
  return;
2103
2117
  }
2104
2118
  let scrollNode;
2105
- let verticalScrollDirection = 0 /* AutoScrollVerticalDirection.NONE */;
2106
- let horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
2119
+ let verticalScrollDirection = AutoScrollVerticalDirection.NONE;
2120
+ let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;
2107
2121
  // Check whether we should start scrolling any of the parent containers.
2108
2122
  this._parentPositions.positions.forEach((position, element) => {
2109
2123
  // We have special handling for the `document` below. Also this would be
@@ -2313,12 +2327,12 @@ function getVerticalScrollDirection(clientRect, pointerY) {
2313
2327
  const { top, bottom, height } = clientRect;
2314
2328
  const yThreshold = height * SCROLL_PROXIMITY_THRESHOLD;
2315
2329
  if (pointerY >= top - yThreshold && pointerY <= top + yThreshold) {
2316
- return 1 /* AutoScrollVerticalDirection.UP */;
2330
+ return AutoScrollVerticalDirection.UP;
2317
2331
  }
2318
2332
  else if (pointerY >= bottom - yThreshold && pointerY <= bottom + yThreshold) {
2319
- return 2 /* AutoScrollVerticalDirection.DOWN */;
2333
+ return AutoScrollVerticalDirection.DOWN;
2320
2334
  }
2321
- return 0 /* AutoScrollVerticalDirection.NONE */;
2335
+ return AutoScrollVerticalDirection.NONE;
2322
2336
  }
2323
2337
  /**
2324
2338
  * Gets whether the horizontal auto-scroll direction of a node.
@@ -2329,12 +2343,12 @@ function getHorizontalScrollDirection(clientRect, pointerX) {
2329
2343
  const { left, right, width } = clientRect;
2330
2344
  const xThreshold = width * SCROLL_PROXIMITY_THRESHOLD;
2331
2345
  if (pointerX >= left - xThreshold && pointerX <= left + xThreshold) {
2332
- return 1 /* AutoScrollHorizontalDirection.LEFT */;
2346
+ return AutoScrollHorizontalDirection.LEFT;
2333
2347
  }
2334
2348
  else if (pointerX >= right - xThreshold && pointerX <= right + xThreshold) {
2335
- return 2 /* AutoScrollHorizontalDirection.RIGHT */;
2349
+ return AutoScrollHorizontalDirection.RIGHT;
2336
2350
  }
2337
- return 0 /* AutoScrollHorizontalDirection.NONE */;
2351
+ return AutoScrollHorizontalDirection.NONE;
2338
2352
  }
2339
2353
  /**
2340
2354
  * Gets the directions in which an element node should be scrolled,
@@ -2347,32 +2361,32 @@ function getHorizontalScrollDirection(clientRect, pointerX) {
2347
2361
  function getElementScrollDirections(element, clientRect, pointerX, pointerY) {
2348
2362
  const computedVertical = getVerticalScrollDirection(clientRect, pointerY);
2349
2363
  const computedHorizontal = getHorizontalScrollDirection(clientRect, pointerX);
2350
- let verticalScrollDirection = 0 /* AutoScrollVerticalDirection.NONE */;
2351
- let horizontalScrollDirection = 0 /* AutoScrollHorizontalDirection.NONE */;
2364
+ let verticalScrollDirection = AutoScrollVerticalDirection.NONE;
2365
+ let horizontalScrollDirection = AutoScrollHorizontalDirection.NONE;
2352
2366
  // Note that we here we do some extra checks for whether the element is actually scrollable in
2353
2367
  // a certain direction and we only assign the scroll direction if it is. We do this so that we
2354
2368
  // can allow other elements to be scrolled, if the current element can't be scrolled anymore.
2355
2369
  // This allows us to handle cases where the scroll regions of two scrollable elements overlap.
2356
2370
  if (computedVertical) {
2357
2371
  const scrollTop = element.scrollTop;
2358
- if (computedVertical === 1 /* AutoScrollVerticalDirection.UP */) {
2372
+ if (computedVertical === AutoScrollVerticalDirection.UP) {
2359
2373
  if (scrollTop > 0) {
2360
- verticalScrollDirection = 1 /* AutoScrollVerticalDirection.UP */;
2374
+ verticalScrollDirection = AutoScrollVerticalDirection.UP;
2361
2375
  }
2362
2376
  }
2363
2377
  else if (element.scrollHeight - scrollTop > element.clientHeight) {
2364
- verticalScrollDirection = 2 /* AutoScrollVerticalDirection.DOWN */;
2378
+ verticalScrollDirection = AutoScrollVerticalDirection.DOWN;
2365
2379
  }
2366
2380
  }
2367
2381
  if (computedHorizontal) {
2368
2382
  const scrollLeft = element.scrollLeft;
2369
- if (computedHorizontal === 1 /* AutoScrollHorizontalDirection.LEFT */) {
2383
+ if (computedHorizontal === AutoScrollHorizontalDirection.LEFT) {
2370
2384
  if (scrollLeft > 0) {
2371
- horizontalScrollDirection = 1 /* AutoScrollHorizontalDirection.LEFT */;
2385
+ horizontalScrollDirection = AutoScrollHorizontalDirection.LEFT;
2372
2386
  }
2373
2387
  }
2374
2388
  else if (element.scrollWidth - scrollLeft > element.clientWidth) {
2375
- horizontalScrollDirection = 2 /* AutoScrollHorizontalDirection.RIGHT */;
2389
+ horizontalScrollDirection = AutoScrollHorizontalDirection.RIGHT;
2376
2390
  }
2377
2391
  }
2378
2392
  return [verticalScrollDirection, horizontalScrollDirection];