@angular/cdk 13.2.3 → 13.2.4

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.
@@ -5,7 +5,6 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- import { ViewportRuler } from '@angular/cdk/scrolling';
9
8
  /** Object holding the scroll position of something. */
10
9
  interface ScrollPosition {
11
10
  top: number;
@@ -14,18 +13,27 @@ interface ScrollPosition {
14
13
  /** Keeps track of the scroll position and dimensions of the parents of an element. */
15
14
  export declare class ParentPositionTracker {
16
15
  private _document;
17
- private _viewportRuler;
18
16
  /** Cached positions of the scrollable parent elements. */
19
17
  readonly positions: Map<HTMLElement | Document, {
20
18
  scrollPosition: ScrollPosition;
21
19
  clientRect?: ClientRect | undefined;
22
20
  }>;
23
- constructor(_document: Document, _viewportRuler: ViewportRuler);
21
+ constructor(_document: Document);
24
22
  /** Clears the cached positions. */
25
23
  clear(): void;
26
24
  /** Caches the positions. Should be called at the beginning of a drag sequence. */
27
25
  cache(elements: readonly HTMLElement[]): void;
28
26
  /** Handles scrolling while a drag is taking place. */
29
27
  handleScroll(event: Event): ScrollPosition | null;
28
+ /**
29
+ * Gets the scroll position of the viewport. Note that we use the scrollX and scrollY directly,
30
+ * instead of going through the `ViewportRuler`, because the first value the ruler looks at is
31
+ * the top/left offset of the `document.documentElement` which works for most cases, but breaks
32
+ * if the element is offset by something like the `BlockScrollStrategy`.
33
+ */
34
+ getViewportScrollPosition(): {
35
+ top: number;
36
+ left: number;
37
+ };
30
38
  }
31
39
  export {};