@angular/cdk 14.0.1 → 14.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 (201) hide show
  1. package/a11y/index.d.ts +3 -1
  2. package/collections/index.d.ts +3 -1
  3. package/drag-drop/index.d.ts +12 -58
  4. package/esm2020/a11y/a11y-module.mjs +5 -5
  5. package/esm2020/a11y/aria-describer/aria-describer.mjs +4 -4
  6. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +7 -7
  7. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +4 -4
  8. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +4 -4
  9. package/esm2020/a11y/focus-trap/focus-trap.mjs +7 -7
  10. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +17 -5
  11. package/esm2020/a11y/input-modality/input-modality-detector.mjs +4 -4
  12. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +4 -4
  13. package/esm2020/a11y/live-announcer/live-announcer.mjs +7 -7
  14. package/esm2020/accordion/accordion-item.mjs +4 -4
  15. package/esm2020/accordion/accordion-module.mjs +5 -5
  16. package/esm2020/accordion/accordion.mjs +4 -4
  17. package/esm2020/bidi/bidi-module.mjs +5 -5
  18. package/esm2020/bidi/dir.mjs +4 -4
  19. package/esm2020/bidi/directionality.mjs +4 -4
  20. package/esm2020/clipboard/clipboard-module.mjs +5 -5
  21. package/esm2020/clipboard/clipboard.mjs +4 -4
  22. package/esm2020/clipboard/copy-to-clipboard.mjs +4 -4
  23. package/esm2020/collections/selection-model.mjs +24 -3
  24. package/esm2020/collections/unique-selection-dispatcher.mjs +4 -4
  25. package/esm2020/dialog/dialog-container.mjs +4 -4
  26. package/esm2020/dialog/dialog-module.mjs +5 -5
  27. package/esm2020/dialog/dialog.mjs +4 -4
  28. package/esm2020/drag-drop/directives/drag-handle.mjs +4 -4
  29. package/esm2020/drag-drop/directives/drag-placeholder.mjs +4 -4
  30. package/esm2020/drag-drop/directives/drag-preview.mjs +4 -4
  31. package/esm2020/drag-drop/directives/drag.mjs +4 -4
  32. package/esm2020/drag-drop/directives/drop-list-group.mjs +4 -4
  33. package/esm2020/drag-drop/directives/drop-list.mjs +4 -4
  34. package/esm2020/drag-drop/dom/client-rect.mjs +64 -0
  35. package/esm2020/drag-drop/dom/clone-node.mjs +65 -0
  36. package/esm2020/drag-drop/dom/parent-position-tracker.mjs +76 -0
  37. package/esm2020/drag-drop/dom/styling.mjs +69 -0
  38. package/esm2020/drag-drop/dom/transition-duration.mjs +36 -0
  39. package/esm2020/drag-drop/drag-drop-module.mjs +5 -5
  40. package/esm2020/drag-drop/drag-drop-registry.mjs +4 -4
  41. package/esm2020/drag-drop/drag-drop.mjs +4 -4
  42. package/esm2020/drag-drop/drag-ref.mjs +36 -22
  43. package/esm2020/drag-drop/drop-list-ref.mjs +36 -295
  44. package/esm2020/drag-drop/sorting/drop-list-sort-strategy.mjs +9 -0
  45. package/esm2020/drag-drop/sorting/single-axis-sort-strategy.mjs +341 -0
  46. package/esm2020/layout/breakpoints-observer.mjs +4 -4
  47. package/esm2020/layout/layout-module.mjs +5 -5
  48. package/esm2020/layout/media-matcher.mjs +4 -4
  49. package/esm2020/menu/context-menu-trigger.mjs +7 -7
  50. package/esm2020/menu/menu-aim.mjs +7 -7
  51. package/esm2020/menu/menu-bar.mjs +4 -4
  52. package/esm2020/menu/menu-base.mjs +4 -4
  53. package/esm2020/menu/menu-group.mjs +4 -4
  54. package/esm2020/menu/menu-item-checkbox.mjs +4 -4
  55. package/esm2020/menu/menu-item-radio.mjs +4 -4
  56. package/esm2020/menu/menu-item-selectable.mjs +4 -4
  57. package/esm2020/menu/menu-item.mjs +4 -4
  58. package/esm2020/menu/menu-module.mjs +5 -5
  59. package/esm2020/menu/menu-stack.mjs +4 -4
  60. package/esm2020/menu/menu-trigger-base.mjs +4 -4
  61. package/esm2020/menu/menu-trigger.mjs +4 -4
  62. package/esm2020/menu/menu.mjs +4 -4
  63. package/esm2020/observers/observe-content.mjs +14 -14
  64. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +4 -4
  65. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +4 -4
  66. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +4 -4
  67. package/esm2020/overlay/fullscreen-overlay-container.mjs +4 -4
  68. package/esm2020/overlay/overlay-container.mjs +4 -4
  69. package/esm2020/overlay/overlay-directives.mjs +7 -7
  70. package/esm2020/overlay/overlay-module.mjs +5 -5
  71. package/esm2020/overlay/overlay.mjs +4 -4
  72. package/esm2020/overlay/position/overlay-position-builder.mjs +4 -4
  73. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +4 -4
  74. package/esm2020/platform/platform-module.mjs +5 -5
  75. package/esm2020/platform/platform.mjs +4 -4
  76. package/esm2020/portal/portal-directives.mjs +17 -17
  77. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +4 -4
  78. package/esm2020/scrolling/public-api.mjs +4 -1
  79. package/esm2020/scrolling/scroll-dispatcher.mjs +4 -4
  80. package/esm2020/scrolling/scrollable.mjs +4 -4
  81. package/esm2020/scrolling/scrolling-module.mjs +27 -11
  82. package/esm2020/scrolling/viewport-ruler.mjs +4 -4
  83. package/esm2020/scrolling/virtual-for-of.mjs +4 -4
  84. package/esm2020/scrolling/virtual-scroll-viewport.mjs +72 -21
  85. package/esm2020/scrolling/virtual-scrollable-element.mjs +41 -0
  86. package/esm2020/scrolling/virtual-scrollable-window.mjs +40 -0
  87. package/esm2020/scrolling/virtual-scrollable.mjs +40 -0
  88. package/esm2020/stepper/step-header.mjs +4 -4
  89. package/esm2020/stepper/step-label.mjs +4 -4
  90. package/esm2020/stepper/stepper-button.mjs +7 -7
  91. package/esm2020/stepper/stepper-module.mjs +5 -5
  92. package/esm2020/stepper/stepper.mjs +7 -7
  93. package/esm2020/table/cell.mjs +22 -22
  94. package/esm2020/table/coalesced-style-scheduler.mjs +4 -4
  95. package/esm2020/table/row.mjs +28 -28
  96. package/esm2020/table/table-module.mjs +5 -5
  97. package/esm2020/table/table.mjs +19 -19
  98. package/esm2020/table/text-column.mjs +4 -4
  99. package/esm2020/testing/testbed/fake-events/dispatch-events.mjs +5 -5
  100. package/esm2020/testing/testbed/fake-events/event-objects.mjs +17 -6
  101. package/esm2020/testing/testbed/unit-test-element.mjs +17 -12
  102. package/esm2020/text-field/autofill.mjs +7 -7
  103. package/esm2020/text-field/autosize.mjs +4 -4
  104. package/esm2020/text-field/text-field-module.mjs +5 -5
  105. package/esm2020/tree/nested-node.mjs +4 -4
  106. package/esm2020/tree/node.mjs +4 -4
  107. package/esm2020/tree/outlet.mjs +4 -4
  108. package/esm2020/tree/padding.mjs +4 -4
  109. package/esm2020/tree/toggle.mjs +4 -4
  110. package/esm2020/tree/tree-module.mjs +5 -5
  111. package/esm2020/tree/tree.mjs +7 -7
  112. package/esm2020/version.mjs +1 -1
  113. package/fesm2015/a11y.mjs +59 -40
  114. package/fesm2015/a11y.mjs.map +1 -1
  115. package/fesm2015/accordion.mjs +10 -10
  116. package/fesm2015/accordion.mjs.map +1 -1
  117. package/fesm2015/bidi.mjs +10 -10
  118. package/fesm2015/bidi.mjs.map +1 -1
  119. package/fesm2015/cdk.mjs +1 -1
  120. package/fesm2015/cdk.mjs.map +1 -1
  121. package/fesm2015/clipboard.mjs +10 -10
  122. package/fesm2015/clipboard.mjs.map +1 -1
  123. package/fesm2015/collections.mjs +26 -5
  124. package/fesm2015/collections.mjs.map +1 -1
  125. package/fesm2015/dialog.mjs +10 -10
  126. package/fesm2015/dialog.mjs.map +1 -1
  127. package/fesm2015/drag-drop.mjs +552 -459
  128. package/fesm2015/drag-drop.mjs.map +1 -1
  129. package/fesm2015/layout.mjs +10 -10
  130. package/fesm2015/layout.mjs.map +1 -1
  131. package/fesm2015/menu.mjs +49 -49
  132. package/fesm2015/menu.mjs.map +1 -1
  133. package/fesm2015/observers.mjs +13 -13
  134. package/fesm2015/observers.mjs.map +1 -1
  135. package/fesm2015/overlay.mjs +34 -34
  136. package/fesm2015/overlay.mjs.map +1 -1
  137. package/fesm2015/platform.mjs +7 -7
  138. package/fesm2015/platform.mjs.map +1 -1
  139. package/fesm2015/portal.mjs +16 -16
  140. package/fesm2015/portal.mjs.map +1 -1
  141. package/fesm2015/scrolling.mjs +194 -47
  142. package/fesm2015/scrolling.mjs.map +1 -1
  143. package/fesm2015/stepper.mjs +22 -22
  144. package/fesm2015/stepper.mjs.map +1 -1
  145. package/fesm2015/table.mjs +76 -76
  146. package/fesm2015/table.mjs.map +1 -1
  147. package/fesm2015/testing/testbed.mjs +36 -20
  148. package/fesm2015/testing/testbed.mjs.map +1 -1
  149. package/fesm2015/text-field.mjs +13 -13
  150. package/fesm2015/text-field.mjs.map +1 -1
  151. package/fesm2015/tree.mjs +25 -25
  152. package/fesm2015/tree.mjs.map +1 -1
  153. package/fesm2020/a11y.mjs +52 -40
  154. package/fesm2020/a11y.mjs.map +1 -1
  155. package/fesm2020/accordion.mjs +10 -10
  156. package/fesm2020/accordion.mjs.map +1 -1
  157. package/fesm2020/bidi.mjs +10 -10
  158. package/fesm2020/bidi.mjs.map +1 -1
  159. package/fesm2020/cdk.mjs +1 -1
  160. package/fesm2020/cdk.mjs.map +1 -1
  161. package/fesm2020/clipboard.mjs +10 -10
  162. package/fesm2020/clipboard.mjs.map +1 -1
  163. package/fesm2020/collections.mjs +26 -5
  164. package/fesm2020/collections.mjs.map +1 -1
  165. package/fesm2020/dialog.mjs +10 -10
  166. package/fesm2020/dialog.mjs.map +1 -1
  167. package/fesm2020/drag-drop.mjs +552 -459
  168. package/fesm2020/drag-drop.mjs.map +1 -1
  169. package/fesm2020/layout.mjs +10 -10
  170. package/fesm2020/layout.mjs.map +1 -1
  171. package/fesm2020/menu.mjs +49 -49
  172. package/fesm2020/menu.mjs.map +1 -1
  173. package/fesm2020/observers.mjs +13 -13
  174. package/fesm2020/observers.mjs.map +1 -1
  175. package/fesm2020/overlay.mjs +34 -34
  176. package/fesm2020/overlay.mjs.map +1 -1
  177. package/fesm2020/platform.mjs +7 -7
  178. package/fesm2020/platform.mjs.map +1 -1
  179. package/fesm2020/portal.mjs +16 -16
  180. package/fesm2020/portal.mjs.map +1 -1
  181. package/fesm2020/scrolling.mjs +208 -47
  182. package/fesm2020/scrolling.mjs.map +1 -1
  183. package/fesm2020/stepper.mjs +22 -22
  184. package/fesm2020/stepper.mjs.map +1 -1
  185. package/fesm2020/table.mjs +76 -76
  186. package/fesm2020/table.mjs.map +1 -1
  187. package/fesm2020/testing/testbed.mjs +36 -20
  188. package/fesm2020/testing/testbed.mjs.map +1 -1
  189. package/fesm2020/text-field.mjs +13 -13
  190. package/fesm2020/text-field.mjs.map +1 -1
  191. package/fesm2020/tree.mjs +25 -25
  192. package/fesm2020/tree.mjs.map +1 -1
  193. package/package.json +1 -1
  194. package/schematics/ng-add/index.js +1 -1
  195. package/schematics/ng-add/index.mjs +1 -1
  196. package/scrolling/index.d.ts +71 -8
  197. package/esm2020/drag-drop/client-rect.mjs +0 -64
  198. package/esm2020/drag-drop/clone-node.mjs +0 -65
  199. package/esm2020/drag-drop/drag-styling.mjs +0 -69
  200. package/esm2020/drag-drop/parent-position-tracker.mjs +0 -76
  201. package/esm2020/drag-drop/transition-duration.mjs +0 -36
@@ -1,6 +1,6 @@
1
1
  import { coerceNumberProperty, coerceElement, coerceBooleanProperty } from '@angular/cdk/coercion';
2
2
  import * as i0 from '@angular/core';
3
- import { InjectionToken, forwardRef, Directive, Input, Injectable, Optional, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, ViewChild, SkipSelf, NgModule } from '@angular/core';
3
+ import { InjectionToken, forwardRef, Directive, Input, Injectable, Optional, Inject, Component, ViewEncapsulation, ChangeDetectionStrategy, Output, ViewChild, SkipSelf, ElementRef, NgModule } from '@angular/core';
4
4
  import { Subject, of, Observable, fromEvent, animationFrameScheduler, asapScheduler, Subscription, isObservable } from 'rxjs';
5
5
  import { distinctUntilChanged, auditTime, filter, takeUntil, startWith, pairwise, switchMap, shareReplay } from 'rxjs/operators';
6
6
  import * as i1 from '@angular/cdk/platform';
@@ -204,15 +204,15 @@ class CdkFixedSizeVirtualScroll {
204
204
  this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);
205
205
  }
206
206
  }
207
- CdkFixedSizeVirtualScroll.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkFixedSizeVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive });
208
- CdkFixedSizeVirtualScroll.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: { itemSize: "itemSize", minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx" }, providers: [
207
+ CdkFixedSizeVirtualScroll.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkFixedSizeVirtualScroll, deps: [], target: i0.ɵɵFactoryTarget.Directive });
208
+ CdkFixedSizeVirtualScroll.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: { itemSize: "itemSize", minBufferPx: "minBufferPx", maxBufferPx: "maxBufferPx" }, providers: [
209
209
  {
210
210
  provide: VIRTUAL_SCROLL_STRATEGY,
211
211
  useFactory: _fixedSizeVirtualScrollStrategyFactory,
212
212
  deps: [forwardRef(() => CdkFixedSizeVirtualScroll)],
213
213
  },
214
214
  ], usesOnChanges: true, ngImport: i0 });
215
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkFixedSizeVirtualScroll, decorators: [{
215
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkFixedSizeVirtualScroll, decorators: [{
216
216
  type: Directive,
217
217
  args: [{
218
218
  selector: 'cdk-virtual-scroll-viewport[itemSize]',
@@ -375,9 +375,9 @@ class ScrollDispatcher {
375
375
  }
376
376
  }
377
377
  }
378
- ScrollDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollDispatcher, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
379
- ScrollDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollDispatcher, providedIn: 'root' });
380
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollDispatcher, decorators: [{
378
+ ScrollDispatcher.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ScrollDispatcher, deps: [{ token: i0.NgZone }, { token: i1.Platform }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
379
+ ScrollDispatcher.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ScrollDispatcher, providedIn: 'root' });
380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ScrollDispatcher, decorators: [{
381
381
  type: Injectable,
382
382
  args: [{ providedIn: 'root' }]
383
383
  }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.Platform }, { type: undefined, decorators: [{
@@ -543,9 +543,9 @@ class CdkScrollable {
543
543
  }
544
544
  }
545
545
  }
546
- CdkScrollable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkScrollable, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
547
- CdkScrollable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]", ngImport: i0 });
548
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkScrollable, decorators: [{
546
+ CdkScrollable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkScrollable, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
547
+ CdkScrollable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CdkScrollable, selector: "[cdk-scrollable], [cdkScrollable]", ngImport: i0 });
548
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkScrollable, decorators: [{
549
549
  type: Directive,
550
550
  args: [{
551
551
  selector: '[cdk-scrollable], [cdkScrollable]',
@@ -681,9 +681,9 @@ class ViewportRuler {
681
681
  : { width: 0, height: 0 };
682
682
  }
683
683
  }
684
- ViewportRuler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ViewportRuler, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
685
- ViewportRuler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ViewportRuler, providedIn: 'root' });
686
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ViewportRuler, decorators: [{
684
+ ViewportRuler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ViewportRuler, deps: [{ token: i1.Platform }, { token: i0.NgZone }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
685
+ ViewportRuler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ViewportRuler, providedIn: 'root' });
686
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ViewportRuler, decorators: [{
687
687
  type: Injectable,
688
688
  args: [{ providedIn: 'root' }]
689
689
  }], ctorParameters: function () { return [{ type: i1.Platform }, { type: i0.NgZone }, { type: undefined, decorators: [{
@@ -693,6 +693,39 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
693
693
  args: [DOCUMENT]
694
694
  }] }]; } });
695
695
 
696
+ /**
697
+ * @license
698
+ * Copyright Google LLC All Rights Reserved.
699
+ *
700
+ * Use of this source code is governed by an MIT-style license that can be
701
+ * found in the LICENSE file at https://angular.io/license
702
+ */
703
+ const VIRTUAL_SCROLLABLE = new InjectionToken('VIRTUAL_SCROLLABLE');
704
+ /**
705
+ * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling.
706
+ */
707
+ class CdkVirtualScrollable extends CdkScrollable {
708
+ constructor(elementRef, scrollDispatcher, ngZone, dir) {
709
+ super(elementRef, scrollDispatcher, ngZone, dir);
710
+ }
711
+ /**
712
+ * Measure the viewport size for the provided orientation.
713
+ *
714
+ * @param orientation The orientation to measure the size from.
715
+ */
716
+ measureViewportSize(orientation) {
717
+ const viewportEl = this.elementRef.nativeElement;
718
+ return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight;
719
+ }
720
+ }
721
+ CdkVirtualScrollable.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollable, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
722
+ CdkVirtualScrollable.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CdkVirtualScrollable, usesInheritance: true, ngImport: i0 });
723
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollable, decorators: [{
724
+ type: Directive
725
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{
726
+ type: Optional
727
+ }] }]; } });
728
+
696
729
  /**
697
730
  * @license
698
731
  * Copyright Google LLC All Rights Reserved.
@@ -711,12 +744,13 @@ function rangesEqual(r1, r2) {
711
744
  */
712
745
  const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
713
746
  /** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */
714
- class CdkVirtualScrollViewport extends CdkScrollable {
715
- constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler) {
747
+ class CdkVirtualScrollViewport extends CdkVirtualScrollable {
748
+ constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler, scrollable) {
716
749
  super(elementRef, scrollDispatcher, ngZone, dir);
717
750
  this.elementRef = elementRef;
718
751
  this._changeDetectorRef = _changeDetectorRef;
719
752
  this._scrollStrategy = _scrollStrategy;
753
+ this.scrollable = scrollable;
720
754
  /** Emits when the viewport is detached from a CdkVirtualForOf. */
721
755
  this._detachedSubject = new Subject();
722
756
  /** Emits when the rendered range changes. */
@@ -764,6 +798,11 @@ class CdkVirtualScrollViewport extends CdkScrollable {
764
798
  this._viewportChanges = viewportRuler.change().subscribe(() => {
765
799
  this.checkViewportSize();
766
800
  });
801
+ if (!this.scrollable) {
802
+ // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable
803
+ this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable');
804
+ this.scrollable = this;
805
+ }
767
806
  }
768
807
  /** The direction the viewport scrolls. */
769
808
  get orientation() {
@@ -786,7 +825,9 @@ class CdkVirtualScrollViewport extends CdkScrollable {
786
825
  this._appendOnly = coerceBooleanProperty(value);
787
826
  }
788
827
  ngOnInit() {
789
- super.ngOnInit();
828
+ if (this.scrollable === this) {
829
+ super.ngOnInit();
830
+ }
790
831
  // It's still too early to measure the viewport at this point. Deferring with a promise allows
791
832
  // the Viewport to be rendered with the correct size before we measure. We run this outside the
792
833
  // zone to avoid causing more change detection cycles. We handle the change detection loop
@@ -794,7 +835,8 @@ class CdkVirtualScrollViewport extends CdkScrollable {
794
835
  this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
795
836
  this._measureViewportSize();
796
837
  this._scrollStrategy.attach(this);
797
- this.elementScrolled()
838
+ this.scrollable
839
+ .elementScrolled()
798
840
  .pipe(
799
841
  // Start off with a fake scroll event so we properly detect our initial position.
800
842
  startWith(null),
@@ -856,6 +898,9 @@ class CdkVirtualScrollViewport extends CdkScrollable {
856
898
  getRenderedRange() {
857
899
  return this._renderedRange;
858
900
  }
901
+ measureBoundingClientRectWithScrollOffset(from) {
902
+ return this.getElementRef().nativeElement.getBoundingClientRect()[from];
903
+ }
859
904
  /**
860
905
  * Sets the total size of all content (in pixels), including content that is not currently
861
906
  * rendered.
@@ -936,7 +981,7 @@ class CdkVirtualScrollViewport extends CdkScrollable {
936
981
  else {
937
982
  options.top = offset;
938
983
  }
939
- this.scrollTo(options);
984
+ this.scrollable.scrollTo(options);
940
985
  }
941
986
  /**
942
987
  * Scrolls to the offset for the given index.
@@ -947,14 +992,46 @@ class CdkVirtualScrollViewport extends CdkScrollable {
947
992
  this._scrollStrategy.scrollToIndex(index, behavior);
948
993
  }
949
994
  /**
950
- * Gets the current scroll offset from the start of the viewport (in pixels).
995
+ * Gets the current scroll offset from the start of the scrollable (in pixels).
951
996
  * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'
952
997
  * in horizontal mode.
953
998
  */
954
999
  measureScrollOffset(from) {
955
- return from
956
- ? super.measureScrollOffset(from)
957
- : super.measureScrollOffset(this.orientation === 'horizontal' ? 'start' : 'top');
1000
+ // This is to break the call cycle
1001
+ let measureScrollOffset;
1002
+ if (this.scrollable == this) {
1003
+ measureScrollOffset = (_from) => super.measureScrollOffset(_from);
1004
+ }
1005
+ else {
1006
+ measureScrollOffset = (_from) => this.scrollable.measureScrollOffset(_from);
1007
+ }
1008
+ return Math.max(0, measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) -
1009
+ this.measureViewportOffset());
1010
+ }
1011
+ /**
1012
+ * Measures the offset of the viewport from the scrolling container
1013
+ * @param from The edge to measure from.
1014
+ */
1015
+ measureViewportOffset(from) {
1016
+ let fromRect;
1017
+ const LEFT = 'left';
1018
+ const RIGHT = 'right';
1019
+ const isRtl = this.dir?.value == 'rtl';
1020
+ if (from == 'start') {
1021
+ fromRect = isRtl ? RIGHT : LEFT;
1022
+ }
1023
+ else if (from == 'end') {
1024
+ fromRect = isRtl ? LEFT : RIGHT;
1025
+ }
1026
+ else if (from) {
1027
+ fromRect = from;
1028
+ }
1029
+ else {
1030
+ fromRect = this.orientation === 'horizontal' ? 'left' : 'top';
1031
+ }
1032
+ const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);
1033
+ const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];
1034
+ return viewportClientRect - scrollerClientRect;
958
1035
  }
959
1036
  /** Measure the combined size of all of the rendered items. */
960
1037
  measureRenderedContentSize() {
@@ -979,9 +1056,7 @@ class CdkVirtualScrollViewport extends CdkScrollable {
979
1056
  }
980
1057
  /** Measure the viewport size. */
981
1058
  _measureViewportSize() {
982
- const viewportEl = this.elementRef.nativeElement;
983
- this._viewportSize =
984
- this.orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight;
1059
+ this._viewportSize = this.scrollable.measureViewportSize(this.orientation);
985
1060
  }
986
1061
  /** Queue up change detection to run. */
987
1062
  _markChangeDetectionNeeded(runAfter) {
@@ -1023,14 +1098,15 @@ class CdkVirtualScrollViewport extends CdkScrollable {
1023
1098
  this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';
1024
1099
  }
1025
1100
  }
1026
- CdkVirtualScrollViewport.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkVirtualScrollViewport, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: VIRTUAL_SCROLL_STRATEGY, optional: true }, { token: i2.Directionality, optional: true }, { token: ScrollDispatcher }, { token: ViewportRuler }], target: i0.ɵɵFactoryTarget.Component });
1027
- CdkVirtualScrollViewport.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: { orientation: "orientation", appendOnly: "appendOnly" }, outputs: { scrolledIndexChange: "scrolledIndexChange" }, host: { properties: { "class.cdk-virtual-scroll-orientation-horizontal": "orientation === \"horizontal\"", "class.cdk-virtual-scroll-orientation-vertical": "orientation !== \"horizontal\"" }, classAttribute: "cdk-virtual-scroll-viewport" }, providers: [
1101
+ CdkVirtualScrollViewport.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollViewport, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: VIRTUAL_SCROLL_STRATEGY, optional: true }, { token: i2.Directionality, optional: true }, { token: ScrollDispatcher }, { token: ViewportRuler }, { token: VIRTUAL_SCROLLABLE, optional: true }], target: i0.ɵɵFactoryTarget.Component });
1102
+ CdkVirtualScrollViewport.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: { orientation: "orientation", appendOnly: "appendOnly" }, outputs: { scrolledIndexChange: "scrolledIndexChange" }, host: { properties: { "class.cdk-virtual-scroll-orientation-horizontal": "orientation === \"horizontal\"", "class.cdk-virtual-scroll-orientation-vertical": "orientation !== \"horizontal\"" }, classAttribute: "cdk-virtual-scroll-viewport" }, providers: [
1028
1103
  {
1029
1104
  provide: CdkScrollable,
1030
- useExisting: CdkVirtualScrollViewport,
1105
+ useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
1106
+ deps: [CdkVirtualScrollable, CdkVirtualScrollViewport],
1031
1107
  },
1032
- ], viewQueries: [{ propertyName: "_contentWrapper", first: true, predicate: ["contentWrapper"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0}[dir=rtl] .cdk-virtual-scroll-spacer{right:0;left:auto;transform-origin:100% 0}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1033
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkVirtualScrollViewport, decorators: [{
1108
+ ], viewQueries: [{ propertyName: "_contentWrapper", first: true, predicate: ["contentWrapper"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
1109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollViewport, decorators: [{
1034
1110
  type: Component,
1035
1111
  args: [{ selector: 'cdk-virtual-scroll-viewport', host: {
1036
1112
  'class': 'cdk-virtual-scroll-viewport',
@@ -1039,9 +1115,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1039
1115
  }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
1040
1116
  {
1041
1117
  provide: CdkScrollable,
1042
- useExisting: CdkVirtualScrollViewport,
1118
+ useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
1119
+ deps: [CdkVirtualScrollable, CdkVirtualScrollViewport],
1043
1120
  },
1044
- ], template: "<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;overflow:auto;contain:strict;transform:translateZ(0);will-change:scroll-position;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{position:absolute;top:0;left:0;height:1px;width:1px;transform-origin:0 0}[dir=rtl] .cdk-virtual-scroll-spacer{right:0;left:auto;transform-origin:100% 0}"] }]
1121
+ ], template: "<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"] }]
1045
1122
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
1046
1123
  type: Optional
1047
1124
  }, {
@@ -1049,7 +1126,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1049
1126
  args: [VIRTUAL_SCROLL_STRATEGY]
1050
1127
  }] }, { type: i2.Directionality, decorators: [{
1051
1128
  type: Optional
1052
- }] }, { type: ScrollDispatcher }, { type: ViewportRuler }]; }, propDecorators: { orientation: [{
1129
+ }] }, { type: ScrollDispatcher }, { type: ViewportRuler }, { type: CdkVirtualScrollable, decorators: [{
1130
+ type: Optional
1131
+ }, {
1132
+ type: Inject,
1133
+ args: [VIRTUAL_SCROLLABLE]
1134
+ }] }]; }, propDecorators: { orientation: [{
1053
1135
  type: Input
1054
1136
  }], appendOnly: [{
1055
1137
  type: Input
@@ -1326,9 +1408,9 @@ class CdkVirtualForOf {
1326
1408
  };
1327
1409
  }
1328
1410
  }
1329
- CdkVirtualForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkVirtualForOf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.IterableDiffers }, { token: _VIEW_REPEATER_STRATEGY }, { token: CdkVirtualScrollViewport, skipSelf: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1330
- CdkVirtualForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.0-rc.1", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: { cdkVirtualForOf: "cdkVirtualForOf", cdkVirtualForTrackBy: "cdkVirtualForTrackBy", cdkVirtualForTemplate: "cdkVirtualForTemplate", cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize" }, providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 });
1331
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkVirtualForOf, decorators: [{
1411
+ CdkVirtualForOf.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualForOf, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }, { token: i0.IterableDiffers }, { token: _VIEW_REPEATER_STRATEGY }, { token: CdkVirtualScrollViewport, skipSelf: true }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1412
+ CdkVirtualForOf.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: { cdkVirtualForOf: "cdkVirtualForOf", cdkVirtualForTrackBy: "cdkVirtualForTrackBy", cdkVirtualForTemplate: "cdkVirtualForTemplate", cdkVirtualForTemplateCacheSize: "cdkVirtualForTemplateCacheSize" }, providers: [{ provide: _VIEW_REPEATER_STRATEGY, useClass: _RecycleViewRepeaterStrategy }], ngImport: i0 });
1413
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualForOf, decorators: [{
1332
1414
  type: Directive,
1333
1415
  args: [{
1334
1416
  selector: '[cdkVirtualFor][cdkVirtualForOf]',
@@ -1349,6 +1431,71 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1349
1431
  type: Input
1350
1432
  }] } });
1351
1433
 
1434
+ /**
1435
+ * @license
1436
+ * Copyright Google LLC All Rights Reserved.
1437
+ *
1438
+ * Use of this source code is governed by an MIT-style license that can be
1439
+ * found in the LICENSE file at https://angular.io/license
1440
+ */
1441
+ /**
1442
+ * Provides a virtual scrollable for the element it is attached to.
1443
+ */
1444
+ class CdkVirtualScrollableElement extends CdkVirtualScrollable {
1445
+ constructor(elementRef, scrollDispatcher, ngZone, dir) {
1446
+ super(elementRef, scrollDispatcher, ngZone, dir);
1447
+ }
1448
+ measureBoundingClientRectWithScrollOffset(from) {
1449
+ return (this.getElementRef().nativeElement.getBoundingClientRect()[from] -
1450
+ this.measureScrollOffset(from));
1451
+ }
1452
+ }
1453
+ CdkVirtualScrollableElement.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollableElement, deps: [{ token: i0.ElementRef }, { token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1454
+ CdkVirtualScrollableElement.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CdkVirtualScrollableElement, selector: "[cdkVirtualScrollingElement]", host: { classAttribute: "cdk-virtual-scrollable" }, providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableElement }], usesInheritance: true, ngImport: i0 });
1455
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollableElement, decorators: [{
1456
+ type: Directive,
1457
+ args: [{
1458
+ selector: '[cdkVirtualScrollingElement]',
1459
+ providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableElement }],
1460
+ host: {
1461
+ 'class': 'cdk-virtual-scrollable',
1462
+ },
1463
+ }]
1464
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{
1465
+ type: Optional
1466
+ }] }]; } });
1467
+
1468
+ /**
1469
+ * @license
1470
+ * Copyright Google LLC All Rights Reserved.
1471
+ *
1472
+ * Use of this source code is governed by an MIT-style license that can be
1473
+ * found in the LICENSE file at https://angular.io/license
1474
+ */
1475
+ /**
1476
+ * Provides as virtual scrollable for the global / window scrollbar.
1477
+ */
1478
+ class CdkVirtualScrollableWindow extends CdkVirtualScrollable {
1479
+ constructor(scrollDispatcher, ngZone, dir) {
1480
+ super(new ElementRef(document.documentElement), scrollDispatcher, ngZone, dir);
1481
+ this._elementScrolled = new Observable((observer) => this.ngZone.runOutsideAngular(() => fromEvent(document, 'scroll').pipe(takeUntil(this._destroyed)).subscribe(observer)));
1482
+ }
1483
+ measureBoundingClientRectWithScrollOffset(from) {
1484
+ return this.getElementRef().nativeElement.getBoundingClientRect()[from];
1485
+ }
1486
+ }
1487
+ CdkVirtualScrollableWindow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollableWindow, deps: [{ token: ScrollDispatcher }, { token: i0.NgZone }, { token: i2.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
1488
+ CdkVirtualScrollableWindow.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: CdkVirtualScrollableWindow, selector: "cdk-virtual-scroll-viewport[scrollWindow]", providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow }], usesInheritance: true, ngImport: i0 });
1489
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkVirtualScrollableWindow, decorators: [{
1490
+ type: Directive,
1491
+ args: [{
1492
+ selector: 'cdk-virtual-scroll-viewport[scrollWindow]',
1493
+ providers: [{ provide: VIRTUAL_SCROLLABLE, useExisting: CdkVirtualScrollableWindow }],
1494
+ }]
1495
+ }], ctorParameters: function () { return [{ type: ScrollDispatcher }, { type: i0.NgZone }, { type: i2.Directionality, decorators: [{
1496
+ type: Optional
1497
+ }] }]; } });
1498
+
1352
1499
  /**
1353
1500
  * @license
1354
1501
  * Copyright Google LLC All Rights Reserved.
@@ -1358,10 +1505,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1358
1505
  */
1359
1506
  class CdkScrollableModule {
1360
1507
  }
1361
- CdkScrollableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkScrollableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1362
- CdkScrollableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkScrollableModule, declarations: [CdkScrollable], exports: [CdkScrollable] });
1363
- CdkScrollableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkScrollableModule });
1364
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: CdkScrollableModule, decorators: [{
1508
+ CdkScrollableModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkScrollableModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1509
+ CdkScrollableModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: CdkScrollableModule, declarations: [CdkScrollable], exports: [CdkScrollable] });
1510
+ CdkScrollableModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkScrollableModule });
1511
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: CdkScrollableModule, decorators: [{
1365
1512
  type: NgModule,
1366
1513
  args: [{
1367
1514
  exports: [CdkScrollable],
@@ -1373,12 +1520,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1373
1520
  */
1374
1521
  class ScrollingModule {
1375
1522
  }
1376
- ScrollingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1377
- ScrollingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollingModule, declarations: [CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport], imports: [BidiModule, CdkScrollableModule], exports: [BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll,
1523
+ ScrollingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ScrollingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1524
+ ScrollingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: ScrollingModule, declarations: [CdkFixedSizeVirtualScroll,
1378
1525
  CdkVirtualForOf,
1379
- CdkVirtualScrollViewport] });
1380
- ScrollingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollingModule, imports: [BidiModule, CdkScrollableModule, BidiModule, CdkScrollableModule] });
1381
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ngImport: i0, type: ScrollingModule, decorators: [{
1526
+ CdkVirtualScrollViewport,
1527
+ CdkVirtualScrollableWindow,
1528
+ CdkVirtualScrollableElement], imports: [BidiModule, CdkScrollableModule], exports: [BidiModule, CdkScrollableModule, CdkFixedSizeVirtualScroll,
1529
+ CdkVirtualForOf,
1530
+ CdkVirtualScrollViewport,
1531
+ CdkVirtualScrollableWindow,
1532
+ CdkVirtualScrollableElement] });
1533
+ ScrollingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ScrollingModule, imports: [BidiModule, CdkScrollableModule, BidiModule, CdkScrollableModule] });
1534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: ScrollingModule, decorators: [{
1382
1535
  type: NgModule,
1383
1536
  args: [{
1384
1537
  imports: [BidiModule, CdkScrollableModule],
@@ -1388,8 +1541,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1388
1541
  CdkFixedSizeVirtualScroll,
1389
1542
  CdkVirtualForOf,
1390
1543
  CdkVirtualScrollViewport,
1544
+ CdkVirtualScrollableWindow,
1545
+ CdkVirtualScrollableElement,
1546
+ ],
1547
+ declarations: [
1548
+ CdkFixedSizeVirtualScroll,
1549
+ CdkVirtualForOf,
1550
+ CdkVirtualScrollViewport,
1551
+ CdkVirtualScrollableWindow,
1552
+ CdkVirtualScrollableElement,
1391
1553
  ],
1392
- declarations: [CdkFixedSizeVirtualScroll, CdkVirtualForOf, CdkVirtualScrollViewport],
1393
1554
  }]
1394
1555
  }] });
1395
1556
 
@@ -1421,5 +1582,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.0-rc.1", ng
1421
1582
  * Generated bundle index. Do not edit.
1422
1583
  */
1423
1584
 
1424
- export { CdkFixedSizeVirtualScroll, CdkScrollable, CdkScrollableModule, CdkVirtualForOf, CdkVirtualScrollViewport, DEFAULT_RESIZE_TIME, DEFAULT_SCROLL_TIME, FixedSizeVirtualScrollStrategy, ScrollDispatcher, ScrollingModule, VIRTUAL_SCROLL_STRATEGY, ViewportRuler, _fixedSizeVirtualScrollStrategyFactory };
1585
+ export { CdkFixedSizeVirtualScroll, CdkScrollable, CdkScrollableModule, CdkVirtualForOf, CdkVirtualScrollViewport, CdkVirtualScrollable, CdkVirtualScrollableElement, CdkVirtualScrollableWindow, DEFAULT_RESIZE_TIME, DEFAULT_SCROLL_TIME, FixedSizeVirtualScrollStrategy, ScrollDispatcher, ScrollingModule, VIRTUAL_SCROLLABLE, VIRTUAL_SCROLL_STRATEGY, ViewportRuler, _fixedSizeVirtualScrollStrategyFactory };
1425
1586
  //# sourceMappingURL=scrolling.mjs.map