blob: 40c24e975b8bb64aeef8a228f7d6dfff3ad3fb24 [file] [log] [blame]
{"version":3,"file":"scrolling.js","sources":["../../../src/cdk/scrolling/viewport-ruler.ts","../../../src/cdk/scrolling/scrolling-module.ts","../../../src/cdk/scrolling/virtual-for-of.ts","../../../src/cdk/scrolling/virtual-scroll-viewport.ts","../../../src/cdk/scrolling/scrollable.ts","../../../src/cdk/scrolling/scroll-dispatcher.ts","../../../src/cdk/scrolling/fixed-size-virtual-scroll.ts","../../../src/cdk/scrolling/virtual-scroll-strategy.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 {Platform} from '@angular/cdk/platform';\nimport {Injectable, NgZone, OnDestroy, Optional, SkipSelf} from '@angular/core';\nimport {merge, of as observableOf, fromEvent, Observable, Subscription} from 'rxjs';\nimport {auditTime} from 'rxjs/operators';\n\n/** Time in ms to throttle the resize events by default. */\nexport const DEFAULT_RESIZE_TIME = 20;\n\n/** Object that holds the scroll position of the viewport in each direction. */\nexport interface ViewportScrollPosition {\n top: number;\n left: number;\n}\n\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * @docs-private\n */\n@Injectable({providedIn: 'root'})\nexport class ViewportRuler implements OnDestroy {\n /** Cached viewport dimensions. */\n private _viewportSize: {width: number; height: number};\n\n /** Stream of viewport change events. */\n private _change: Observable<Event>;\n\n /** Subscription to streams that invalidate the cached viewport dimensions. */\n private _invalidateCache: Subscription;\n\n constructor(private _platform: Platform, ngZone: NgZone) {\n ngZone.runOutsideAngular(() => {\n this._change = _platform.isBrowser ?\n merge(fromEvent(window, 'resize'), fromEvent(window, 'orientationchange')) :\n observableOf();\n\n // Note that we need to do the subscription inside `runOutsideAngular`\n // since subscribing is what causes the event listener to be added.\n this._invalidateCache = this.change().subscribe(() => this._updateViewportSize());\n });\n }\n\n ngOnDestroy() {\n this._invalidateCache.unsubscribe();\n }\n\n /** Returns the viewport's width and height. */\n getViewportSize(): Readonly<{width: number, height: number}> {\n if (!this._viewportSize) {\n this._updateViewportSize();\n }\n\n const output = {width: this._viewportSize.width, height: this._viewportSize.height};\n\n // If we're not on a browser, don't cache the size since it'll be mocked out anyway.\n if (!this._platform.isBrowser) {\n this._viewportSize = null!;\n }\n\n return output;\n }\n\n /** Gets a ClientRect for the viewport's bounds. */\n getViewportRect(): ClientRect {\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const scrollPosition = this.getViewportScrollPosition();\n const {width, height} = this.getViewportSize();\n\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n };\n }\n\n /** Gets the (top, left) scroll position of the viewport. */\n getViewportScrollPosition(): ViewportScrollPosition {\n // While we can get a reference to the fake document\n // during SSR, it doesn't have getBoundingClientRect.\n if (!this._platform.isBrowser) {\n return {top: 0, left: 0};\n }\n\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const documentElement = document.documentElement!;\n const documentRect = documentElement.getBoundingClientRect();\n\n const top = -documentRect.top || document.body.scrollTop || window.scrollY ||\n documentElement.scrollTop || 0;\n\n const left = -documentRect.left || document.body.scrollLeft || window.scrollX ||\n documentElement.scrollLeft || 0;\n\n return {top, left};\n }\n\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * @param throttleTime Time in milliseconds to throttle the stream.\n */\n change(throttleTime: number = DEFAULT_RESIZE_TIME): Observable<Event> {\n return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;\n }\n\n /** Updates the cached viewport size. */\n private _updateViewportSize() {\n this._viewportSize = this._platform.isBrowser ?\n {width: window.innerWidth, height: window.innerHeight} :\n {width: 0, height: 0};\n }\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler: ViewportRuler,\n platform: Platform,\n ngZone: NgZone) {\n return parentRuler || new ViewportRuler(platform, ngZone);\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const VIEWPORT_RULER_PROVIDER = {\n // If there is already a ViewportRuler available, use that. Otherwise, provide a new one.\n provide: ViewportRuler,\n deps: [[new Optional(), new SkipSelf(), ViewportRuler], Platform, NgZone],\n useFactory: VIEWPORT_RULER_PROVIDER_FACTORY\n};\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\nimport {BidiModule} from '@angular/cdk/bidi';\nimport {PlatformModule} from '@angular/cdk/platform';\nimport {NgModule} from '@angular/core';\nimport {CdkFixedSizeVirtualScroll} from './fixed-size-virtual-scroll';\nimport {CdkScrollable} from './scrollable';\nimport {CdkVirtualForOf} from './virtual-for-of';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n@NgModule({\n imports: [BidiModule, PlatformModule],\n exports: [\n BidiModule,\n CdkFixedSizeVirtualScroll,\n CdkScrollable,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\n ],\n declarations: [\n CdkFixedSizeVirtualScroll,\n CdkScrollable,\n CdkVirtualForOf,\n CdkVirtualScrollViewport,\n ],\n})\nexport class ScrollingModule {}\n\n/**\n * @deprecated ScrollDispatchModule has been renamed to ScrollingModule.\n * @breaking-change 8.0.0 delete this alias\n */\n@NgModule({\n imports: [ScrollingModule],\n exports: [ScrollingModule],\n})\nexport class ScrollDispatchModule {}\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\nimport {\n ArrayDataSource,\n CollectionViewer,\n DataSource,\n ListRange,\n isDataSource,\n} from '@angular/cdk/collections';\nimport {\n Directive,\n DoCheck,\n EmbeddedViewRef,\n Input,\n IterableChangeRecord,\n IterableChanges,\n IterableDiffer,\n IterableDiffers,\n NgIterable,\n NgZone,\n OnDestroy,\n SkipSelf,\n TemplateRef,\n TrackByFunction,\n ViewContainerRef,\n} from '@angular/core';\nimport {Observable, Subject, of as observableOf} from 'rxjs';\nimport {pairwise, shareReplay, startWith, switchMap, takeUntil} from 'rxjs/operators';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n\n/** The context for an item rendered by `CdkVirtualForOf` */\nexport type CdkVirtualForOfContext<T> = {\n /** The item value. */\n $implicit: T;\n /** The DataSource, Observable, or NgIterable that was passed to *cdkVirtualFor. */\n cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T>;\n /** The index of the item in the DataSource. */\n index: number;\n /** The number of items in the DataSource. */\n count: number;\n /** Whether this is the first item in the DataSource. */\n first: boolean;\n /** Whether this is the last item in the DataSource. */\n last: boolean;\n /** Whether the index is even. */\n even: boolean;\n /** Whether the index is odd. */\n odd: boolean;\n};\n\n\n/** Helper to extract size from a DOM Node. */\nfunction getSize(orientation: 'horizontal' | 'vertical', node: Node): number {\n const el = node as Element;\n if (!el.getBoundingClientRect) {\n return 0;\n }\n const rect = el.getBoundingClientRect();\n return orientation == 'horizontal' ? rect.width : rect.height;\n}\n\n\n/**\n * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling\n * container.\n */\n@Directive({\n selector: '[cdkVirtualFor][cdkVirtualForOf]',\n})\nexport class CdkVirtualForOf<T> implements CollectionViewer, DoCheck, OnDestroy {\n /** Emits when the rendered view of the data changes. */\n viewChange = new Subject<ListRange>();\n\n /** Subject that emits when a new DataSource instance is given. */\n private _dataSourceChanges = new Subject<DataSource<T>>();\n\n /** The DataSource to display. */\n @Input()\n get cdkVirtualForOf(): DataSource<T> | Observable<T[]> | NgIterable<T> {\n return this._cdkVirtualForOf;\n }\n set cdkVirtualForOf(value: DataSource<T> | Observable<T[]> | NgIterable<T>) {\n this._cdkVirtualForOf = value;\n const ds = isDataSource(value) ? value :\n // Slice the value if its an NgIterable to ensure we're working with an array.\n new ArrayDataSource<T>(\n value instanceof Observable ? value : Array.prototype.slice.call(value || []));\n this._dataSourceChanges.next(ds);\n }\n _cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T>;\n\n /**\n * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and\n * the item and produces a value to be used as the item's identity when tracking changes.\n */\n @Input()\n get cdkVirtualForTrackBy(): TrackByFunction<T> | undefined {\n return this._cdkVirtualForTrackBy;\n }\n set cdkVirtualForTrackBy(fn: TrackByFunction<T> | undefined) {\n this._needsUpdate = true;\n this._cdkVirtualForTrackBy = fn ?\n (index, item) => fn(index + (this._renderedRange ? this._renderedRange.start : 0), item) :\n undefined;\n }\n private _cdkVirtualForTrackBy: TrackByFunction<T> | undefined;\n\n /** The template used to stamp out new elements. */\n @Input()\n set cdkVirtualForTemplate(value: TemplateRef<CdkVirtualForOfContext<T>>) {\n if (value) {\n this._needsUpdate = true;\n this._template = value;\n }\n }\n\n /**\n * The size of the cache used to store templates that are not being used for re-use later.\n * Setting the cache size to `0` will disable caching. Defaults to 20 templates.\n */\n @Input() cdkVirtualForTemplateCacheSize: number = 20;\n\n /** Emits whenever the data in the current DataSource changes. */\n dataStream: Observable<T[] | ReadonlyArray<T>> = this._dataSourceChanges\n .pipe(\n // Start off with null `DataSource`.\n startWith(null!),\n // Bundle up the previous and current data sources so we can work with both.\n pairwise(),\n // Use `_changeDataSource` to disconnect from the previous data source and connect to the\n // new one, passing back a stream of data changes which we run through `switchMap` to give\n // us a data stream that emits the latest data from whatever the current `DataSource` is.\n switchMap(([prev, cur]) => this._changeDataSource(prev, cur)),\n // Replay the last emitted data when someone subscribes.\n shareReplay(1));\n\n /** The differ used to calculate changes to the data. */\n private _differ: IterableDiffer<T> | null = null;\n\n /** The most recent data emitted from the DataSource. */\n private _data: T[] | ReadonlyArray<T>;\n\n /** The currently rendered items. */\n private _renderedItems: T[];\n\n /** The currently rendered range of indices. */\n private _renderedRange: ListRange;\n\n /**\n * The template cache used to hold on ot template instancess that have been stamped out, but don't\n * currently need to be rendered. These instances will be reused in the future rather than\n * stamping out brand new ones.\n */\n private _templateCache: EmbeddedViewRef<CdkVirtualForOfContext<T>>[] = [];\n\n /** Whether the rendered data should be updated during the next ngDoCheck cycle. */\n private _needsUpdate = false;\n\n private _destroyed = new Subject<void>();\n\n constructor(\n /** The view container to add items to. */\n private _viewContainerRef: ViewContainerRef,\n /** The template to use when stamping out new items. */\n private _template: TemplateRef<CdkVirtualForOfContext<T>>,\n /** The set of available differs. */\n private _differs: IterableDiffers,\n /** The virtual scrolling viewport that these items are being rendered in. */\n @SkipSelf() private _viewport: CdkVirtualScrollViewport,\n ngZone: NgZone) {\n this.dataStream.subscribe(data => {\n this._data = data;\n this._onRenderedDataChange();\n });\n this._viewport.renderedRangeStream.pipe(takeUntil(this._destroyed)).subscribe(range => {\n this._renderedRange = range;\n ngZone.run(() => this.viewChange.next(this._renderedRange));\n this._onRenderedDataChange();\n });\n this._viewport.attach(this);\n }\n\n /**\n * Measures the combined size (width for horizontal orientation, height for vertical) of all items\n * in the specified range. Throws an error if the range includes items that are not currently\n * rendered.\n */\n measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number {\n if (range.start >= range.end) {\n return 0;\n }\n if (range.start < this._renderedRange.start || range.end > this._renderedRange.end) {\n throw Error(`Error: attempted to measure an item that isn't rendered.`);\n }\n\n // The index into the list of rendered views for the first item in the range.\n const renderedStartIndex = range.start - this._renderedRange.start;\n // The length of the range we're measuring.\n const rangeLen = range.end - range.start;\n\n // Loop over all root nodes for all items in the range and sum up their size.\n let totalSize = 0;\n let i = rangeLen;\n while (i--) {\n const view = this._viewContainerRef.get(i + renderedStartIndex) as\n EmbeddedViewRef<CdkVirtualForOfContext<T>> | null;\n let j = view ? view.rootNodes.length : 0;\n while (j--) {\n totalSize += getSize(orientation, view!.rootNodes[j]);\n }\n }\n\n return totalSize;\n }\n\n ngDoCheck() {\n if (this._differ && this._needsUpdate) {\n // TODO(mmalerba): We should differentiate needs update due to scrolling and a new portion of\n // this list being rendered (can use simpler algorithm) vs needs update due to data actually\n // changing (need to do this diff).\n const changes = this._differ.diff(this._renderedItems);\n if (!changes) {\n this._updateContext();\n } else {\n this._applyChanges(changes);\n }\n this._needsUpdate = false;\n }\n }\n\n ngOnDestroy() {\n this._viewport.detach();\n\n this._dataSourceChanges.next();\n this._dataSourceChanges.complete();\n this.viewChange.complete();\n\n this._destroyed.next();\n this._destroyed.complete();\n\n for (let view of this._templateCache) {\n view.destroy();\n }\n }\n\n /** React to scroll state changes in the viewport. */\n private _onRenderedDataChange() {\n if (!this._renderedRange) {\n return;\n }\n this._renderedItems = this._data.slice(this._renderedRange.start, this._renderedRange.end);\n if (!this._differ) {\n this._differ = this._differs.find(this._renderedItems).create(this.cdkVirtualForTrackBy);\n }\n this._needsUpdate = true;\n }\n\n /** Swap out one `DataSource` for another. */\n private _changeDataSource(oldDs: DataSource<T> | null, newDs: DataSource<T> | null):\n Observable<T[] | ReadonlyArray<T>> {\n\n if (oldDs) {\n oldDs.disconnect(this);\n }\n\n this._needsUpdate = true;\n return newDs ? newDs.connect(this) : observableOf();\n }\n\n /** Update the `CdkVirtualForOfContext` for all views. */\n private _updateContext() {\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n let view = this._viewContainerRef.get(i) as EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n view.detectChanges();\n }\n }\n\n /** Apply changes to the DOM. */\n private _applyChanges(changes: IterableChanges<T>) {\n // Rearrange the views to put them in the right location.\n changes.forEachOperation((record: IterableChangeRecord<T>,\n adjustedPreviousIndex: number | null,\n currentIndex: number | null) => {\n if (record.previousIndex == null) { // Item added.\n const view = this._insertViewForNewItem(currentIndex!);\n view.context.$implicit = record.item;\n } else if (currentIndex == null) { // Item removed.\n this._cacheView(this._detachView(adjustedPreviousIndex !));\n } else { // Item moved.\n const view = this._viewContainerRef.get(adjustedPreviousIndex!) as\n EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n this._viewContainerRef.move(view, currentIndex);\n view.context.$implicit = record.item;\n }\n });\n\n // Update $implicit for any items that had an identity change.\n changes.forEachIdentityChange((record: IterableChangeRecord<T>) => {\n const view = this._viewContainerRef.get(record.currentIndex!) as\n EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n view.context.$implicit = record.item;\n });\n\n // Update the context variables on all items.\n const count = this._data.length;\n let i = this._viewContainerRef.length;\n while (i--) {\n const view = this._viewContainerRef.get(i) as EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n view.context.index = this._renderedRange.start + i;\n view.context.count = count;\n this._updateComputedContextProperties(view.context);\n }\n }\n\n /** Cache the given detached view. */\n private _cacheView(view: EmbeddedViewRef<CdkVirtualForOfContext<T>>) {\n if (this._templateCache.length < this.cdkVirtualForTemplateCacheSize) {\n this._templateCache.push(view);\n } else {\n const index = this._viewContainerRef.indexOf(view);\n\n // It's very unlikely that the index will ever be -1, but just in case,\n // destroy the view on its own, otherwise destroy it through the\n // container to ensure that all the references are removed.\n if (index === -1) {\n view.destroy();\n } else {\n this._viewContainerRef.remove(index);\n }\n }\n }\n\n /** Inserts a view for a new item, either from the cache or by creating a new one. */\n private _insertViewForNewItem(index: number): EmbeddedViewRef<CdkVirtualForOfContext<T>> {\n return this._insertViewFromCache(index) || this._createEmbeddedViewAt(index);\n }\n\n /** Update the computed properties on the `CdkVirtualForOfContext`. */\n private _updateComputedContextProperties(context: CdkVirtualForOfContext<any>) {\n context.first = context.index === 0;\n context.last = context.index === context.count - 1;\n context.even = context.index % 2 === 0;\n context.odd = !context.even;\n }\n\n /** Creates a new embedded view and moves it to the given index */\n private _createEmbeddedViewAt(index: number): EmbeddedViewRef<CdkVirtualForOfContext<T>> {\n // Note that it's important that we insert the item directly at the proper index,\n // rather than inserting it and the moving it in place, because if there's a directive\n // on the same node that injects the `ViewContainerRef`, Angular will insert another\n // comment node which can throw off the move when it's being repeated for all items.\n return this._viewContainerRef.createEmbeddedView(this._template, {\n $implicit: null!,\n cdkVirtualForOf: this._cdkVirtualForOf,\n index: -1,\n count: -1,\n first: false,\n last: false,\n odd: false,\n even: false\n }, index);\n }\n\n /** Inserts a recycled view from the cache at the given index. */\n private _insertViewFromCache(index: number): EmbeddedViewRef<CdkVirtualForOfContext<T>>|null {\n const cachedView = this._templateCache.pop();\n if (cachedView) {\n this._viewContainerRef.insert(cachedView, index);\n }\n return cachedView || null;\n }\n\n /** Detaches the embedded view at the given index. */\n private _detachView(index: number): EmbeddedViewRef<CdkVirtualForOfContext<T>> {\n return this._viewContainerRef.detach(index) as\n EmbeddedViewRef<CdkVirtualForOfContext<T>>;\n }\n}\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\nimport {Directionality} from '@angular/cdk/bidi';\nimport {ListRange} from '@angular/cdk/collections';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport {animationFrameScheduler, asapScheduler, Observable, Subject, Observer} from 'rxjs';\nimport {auditTime, startWith, takeUntil} from 'rxjs/operators';\nimport {ScrollDispatcher} from './scroll-dispatcher';\nimport {CdkScrollable, ExtendedScrollToOptions} from './scrollable';\nimport {CdkVirtualForOf} from './virtual-for-of';\nimport {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-strategy';\n\n\n/** Checks if the given ranges are equal. */\nfunction rangesEqual(r1: ListRange, r2: ListRange): boolean {\n return r1.start == r2.start && r1.end == r2.end;\n}\n\n/**\n * Scheduler to be used for scroll events. Needs to fall back to\n * something that doesn't rely on requestAnimationFrame on environments\n * that don't support it (e.g. server-side rendering).\n */\nconst SCROLL_SCHEDULER =\n typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;\n\n\n/** A viewport that virtualizes it's scrolling with the help of `CdkVirtualForOf`. */\n@Component({\n moduleId: module.id,\n selector: 'cdk-virtual-scroll-viewport',\n templateUrl: 'virtual-scroll-viewport.html',\n styleUrls: ['virtual-scroll-viewport.css'],\n host: {\n 'class': 'cdk-virtual-scroll-viewport',\n '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === \"horizontal\"',\n '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== \"horizontal\"',\n },\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{\n provide: CdkScrollable,\n useExisting: CdkVirtualScrollViewport,\n }]\n})\nexport class CdkVirtualScrollViewport extends CdkScrollable implements OnInit, OnDestroy {\n /** Emits when the viewport is detached from a CdkVirtualForOf. */\n private _detachedSubject = new Subject<void>();\n\n /** Emits when the rendered range changes. */\n private _renderedRangeSubject = new Subject<ListRange>();\n\n /** The direction the viewport scrolls. */\n @Input() orientation: 'horizontal' | 'vertical' = 'vertical';\n\n // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll\n // strategy lazily (i.e. only if the user is actually listening to the events). We do this because\n // depending on how the strategy calculates the scrolled index, it may come at a cost to\n // performance.\n /** Emits when the index of the first element visible in the viewport changes. */\n @Output() scrolledIndexChange: Observable<number> =\n new Observable((observer: Observer<number>) =>\n this._scrollStrategy.scrolledIndexChange.subscribe(index =>\n Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));\n\n /** The element that wraps the rendered content. */\n @ViewChild('contentWrapper', {static: true}) _contentWrapper: ElementRef<HTMLElement>;\n\n /** A stream that emits whenever the rendered range changes. */\n renderedRangeStream: Observable<ListRange> = this._renderedRangeSubject.asObservable();\n\n /**\n * The transform used to scale the spacer to the same size as all content, including content that\n * is not currently rendered.\n */\n _totalContentSizeTransform = '';\n\n /**\n * The total size of all content (in pixels), including content that is not currently rendered.\n */\n private _totalContentSize = 0;\n\n /**\n * The CSS transform applied to the rendered subset of items so that they appear within the bounds\n * of the visible viewport.\n */\n private _renderedContentTransform: string;\n\n /** The currently rendered range of indices. */\n private _renderedRange: ListRange = {start: 0, end: 0};\n\n /** The length of the data bound to this viewport (in number of items). */\n private _dataLength = 0;\n\n /** The size of the viewport (in pixels). */\n private _viewportSize = 0;\n\n /** the currently attached CdkVirtualForOf. */\n private _forOf: CdkVirtualForOf<any> | null;\n\n /** The last rendered content offset that was set. */\n private _renderedContentOffset = 0;\n\n /**\n * Whether the last rendered content offset was to the end of the content (and therefore needs to\n * be rewritten as an offset to the start of the content).\n */\n private _renderedContentOffsetNeedsRewrite = false;\n\n /** Whether there is a pending change detection cycle. */\n private _isChangeDetectionPending = false;\n\n /** A list of functions to run after the next change detection cycle. */\n private _runAfterChangeDetection: Function[] = [];\n\n constructor(public elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n ngZone: NgZone,\n @Optional() @Inject(VIRTUAL_SCROLL_STRATEGY)\n private _scrollStrategy: VirtualScrollStrategy,\n @Optional() dir: Directionality,\n scrollDispatcher: ScrollDispatcher) {\n super(elementRef, scrollDispatcher, ngZone, dir);\n\n if (!_scrollStrategy) {\n throw Error('Error: cdk-virtual-scroll-viewport requires the \"itemSize\" property to be set.');\n }\n }\n\n ngOnInit() {\n super.ngOnInit();\n\n // It's still too early to measure the viewport at this point. Deferring with a promise allows\n // the Viewport to be rendered with the correct size before we measure. We run this outside the\n // zone to avoid causing more change detection cycles. We handle the change detection loop\n // ourselves instead.\n this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {\n this._measureViewportSize();\n this._scrollStrategy.attach(this);\n\n this.elementScrolled()\n .pipe(\n // Start off with a fake scroll event so we properly detect our initial position.\n startWith(null!),\n // Collect multiple events into one until the next animation frame. This way if\n // there are multiple scroll events in the same frame we only need to recheck\n // our layout once.\n auditTime(0, SCROLL_SCHEDULER))\n .subscribe(() => this._scrollStrategy.onContentScrolled());\n\n this._markChangeDetectionNeeded();\n }));\n }\n\n ngOnDestroy() {\n this.detach();\n this._scrollStrategy.detach();\n\n // Complete all subjects\n this._renderedRangeSubject.complete();\n this._detachedSubject.complete();\n\n super.ngOnDestroy();\n }\n\n /** Attaches a `CdkVirtualForOf` to this viewport. */\n attach(forOf: CdkVirtualForOf<any>) {\n if (this._forOf) {\n throw Error('CdkVirtualScrollViewport is already attached.');\n }\n\n // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length\n // changes. Run outside the zone to avoid triggering change detection, since we're managing the\n // change detection loop ourselves.\n this.ngZone.runOutsideAngular(() => {\n this._forOf = forOf;\n this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe(data => {\n const newLength = data.length;\n if (newLength !== this._dataLength) {\n this._dataLength = newLength;\n this._scrollStrategy.onDataLengthChanged();\n }\n this._doChangeDetection();\n });\n });\n }\n\n /** Detaches the current `CdkVirtualForOf`. */\n detach() {\n this._forOf = null;\n this._detachedSubject.next();\n }\n\n /** Gets the length of the data bound to this viewport (in number of items). */\n getDataLength(): number {\n return this._dataLength;\n }\n\n /** Gets the size of the viewport (in pixels). */\n getViewportSize(): number {\n return this._viewportSize;\n }\n\n // TODO(mmalerba): This is technically out of sync with what's really rendered until a render\n // cycle happens. I'm being careful to only call it after the render cycle is complete and before\n // setting it to something else, but its error prone and should probably be split into\n // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.\n\n /** Get the current rendered range of items. */\n getRenderedRange(): ListRange {\n return this._renderedRange;\n }\n\n /**\n * Sets the total size of all content (in pixels), including content that is not currently\n * rendered.\n */\n setTotalContentSize(size: number) {\n if (this._totalContentSize !== size) {\n this._totalContentSize = size;\n const axis = this.orientation == 'horizontal' ? 'X' : 'Y';\n this._totalContentSizeTransform = `scale${axis}(${this._totalContentSize})`;\n this._markChangeDetectionNeeded();\n }\n }\n\n /** Sets the currently rendered range of indices. */\n setRenderedRange(range: ListRange) {\n if (!rangesEqual(this._renderedRange, range)) {\n this._renderedRangeSubject.next(this._renderedRange = range);\n this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());\n }\n }\n\n /**\n * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).\n */\n getOffsetToRenderedContentStart(): number | null {\n return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;\n }\n\n /**\n * Sets the offset from the start of the viewport to either the start or end of the rendered data\n * (in pixels).\n */\n setRenderedContentOffset(offset: number, to: 'to-start' | 'to-end' = 'to-start') {\n // For a horizontal viewport in a right-to-left language we need to translate along the x-axis\n // in the negative direction.\n const isRtl = this.dir && this.dir.value == 'rtl';\n const isHorizontal = this.orientation == 'horizontal';\n const axis = isHorizontal ? 'X' : 'Y';\n const axisDirection = isHorizontal && isRtl ? -1 : 1;\n let transform = `translate${axis}(${Number(axisDirection * offset)}px)`;\n this._renderedContentOffset = offset;\n if (to === 'to-end') {\n transform += ` translate${axis}(-100%)`;\n // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise\n // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would\n // expand upward).\n this._renderedContentOffsetNeedsRewrite = true;\n }\n if (this._renderedContentTransform != transform) {\n // We know this value is safe because we parse `offset` with `Number()` before passing it\n // into the string.\n this._renderedContentTransform = transform;\n this._markChangeDetectionNeeded(() => {\n if (this._renderedContentOffsetNeedsRewrite) {\n this._renderedContentOffset -= this.measureRenderedContentSize();\n this._renderedContentOffsetNeedsRewrite = false;\n this.setRenderedContentOffset(this._renderedContentOffset);\n } else {\n this._scrollStrategy.onRenderedOffsetChanged();\n }\n });\n }\n }\n\n /**\n * Scrolls to the given offset from the start of the viewport. Please note that this is not always\n * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left\n * direction, this would be the equivalent of setting a fictional `scrollRight` property.\n * @param offset The offset to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToOffset(offset: number, behavior: ScrollBehavior = 'auto') {\n const options: ExtendedScrollToOptions = {behavior};\n if (this.orientation === 'horizontal') {\n options.start = offset;\n } else {\n options.top = offset;\n }\n this.scrollTo(options);\n }\n\n /**\n * Scrolls to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.\n */\n scrollToIndex(index: number, behavior: ScrollBehavior = 'auto') {\n this._scrollStrategy.scrollToIndex(index, behavior);\n }\n\n /**\n * Gets the current scroll offset from the start of the viewport (in pixels).\n * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'\n * in horizontal mode.\n */\n measureScrollOffset(from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number {\n return super.measureScrollOffset(\n from ? from : this.orientation === 'horizontal' ? 'start' : 'top');\n }\n\n /** Measure the combined size of all of the rendered items. */\n measureRenderedContentSize(): number {\n const contentEl = this._contentWrapper.nativeElement;\n return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight;\n }\n\n /**\n * Measure the total combined size of the given range. Throws if the range includes items that are\n * not rendered.\n */\n measureRangeSize(range: ListRange): number {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }\n\n /** Update the viewport dimensions and re-render. */\n checkViewportSize() {\n // TODO: Cleanup later when add logic for handling content resize\n this._measureViewportSize();\n this._scrollStrategy.onDataLengthChanged();\n }\n\n /** Measure the viewport size. */\n private _measureViewportSize() {\n const viewportEl = this.elementRef.nativeElement;\n this._viewportSize = this.orientation === 'horizontal' ?\n viewportEl.clientWidth : viewportEl.clientHeight;\n }\n\n /** Queue up change detection to run. */\n private _markChangeDetectionNeeded(runAfter?: Function) {\n if (runAfter) {\n this._runAfterChangeDetection.push(runAfter);\n }\n\n // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of\n // properties sequentially we only have to run `_doChangeDetection` once at the end.\n if (!this._isChangeDetectionPending) {\n this._isChangeDetectionPending = true;\n this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {\n this._doChangeDetection();\n }));\n }\n }\n\n /** Run change detection. */\n private _doChangeDetection() {\n this._isChangeDetectionPending = false;\n\n // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection\n // from the root, since the repeated items are content projected in. Calling `detectChanges`\n // instead does not properly check the projected content.\n this.ngZone.run(() => this._changeDetectorRef.markForCheck());\n // Apply the content transform. The transform can't be set via an Angular binding because\n // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of\n // string literals, a variable that can only be 'X' or 'Y', and user input that is run through\n // the `Number` function first to coerce it to a numeric value.\n this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;\n\n const runAfterChangeDetection = this._runAfterChangeDetection;\n this._runAfterChangeDetection = [];\n for (const fn of runAfterChangeDetection) {\n fn();\n }\n }\n}\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\nimport {Directionality} from '@angular/cdk/bidi';\nimport {\n getRtlScrollAxisType,\n RtlScrollAxisType,\n supportsScrollBehavior\n} from '@angular/cdk/platform';\nimport {Directive, ElementRef, NgZone, OnDestroy, OnInit, Optional} from '@angular/core';\nimport {fromEvent, Observable, Subject, Observer} from 'rxjs';\nimport {takeUntil} from 'rxjs/operators';\nimport {ScrollDispatcher} from './scroll-dispatcher';\n\nexport type _Without<T> = {[P in keyof T]?: never};\nexport type _XOR<T, U> = (_Without<T> & U) | (_Without<U> & T);\nexport type _Top = {top?: number};\nexport type _Bottom = {bottom?: number};\nexport type _Left = {left?: number};\nexport type _Right = {right?: number};\nexport type _Start = {start?: number};\nexport type _End = {end?: number};\nexport type _XAxis = _XOR<_XOR<_Left, _Right>, _XOR<_Start, _End>>;\nexport type _YAxis = _XOR<_Top, _Bottom>;\n\n/**\n * An extended version of ScrollToOptions that allows expressing scroll offsets relative to the\n * top, bottom, left, right, start, or end of the viewport rather than just the top and left.\n * Please note: the top and bottom properties are mutually exclusive, as are the left, right,\n * start, and end properties.\n */\nexport type ExtendedScrollToOptions = _XAxis & _YAxis & ScrollOptions;\n\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\n@Directive({\n selector: '[cdk-scrollable], [cdkScrollable]'\n})\nexport class CdkScrollable implements OnInit, OnDestroy {\n private _destroyed = new Subject();\n\n private _elementScrolled: Observable<Event> = new Observable((observer: Observer<Event>) =>\n this.ngZone.runOutsideAngular(() =>\n fromEvent(this.elementRef.nativeElement, 'scroll').pipe(takeUntil(this._destroyed))\n .subscribe(observer)));\n\n constructor(protected elementRef: ElementRef<HTMLElement>,\n protected scrollDispatcher: ScrollDispatcher,\n protected ngZone: NgZone,\n @Optional() protected dir?: Directionality) {}\n\n ngOnInit() {\n this.scrollDispatcher.register(this);\n }\n\n ngOnDestroy() {\n this.scrollDispatcher.deregister(this);\n this._destroyed.next();\n this._destroyed.complete();\n }\n\n /** Returns observable that emits when a scroll event is fired on the host element. */\n elementScrolled(): Observable<Event> {\n return this._elementScrolled;\n }\n\n /** Gets the ElementRef for the viewport. */\n getElementRef(): ElementRef<HTMLElement> {\n return this.elementRef;\n }\n\n /**\n * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo\n * method, since browsers are not consistent about what scrollLeft means in RTL. For this method\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param options specified the offsets to scroll to.\n */\n scrollTo(options: ExtendedScrollToOptions): void {\n const el = this.elementRef.nativeElement;\n const isRtl = this.dir && this.dir.value == 'rtl';\n\n // Rewrite start & end offsets as right or left offsets.\n options.left = options.left == null ? (isRtl ? options.end : options.start) : options.left;\n options.right = options.right == null ? (isRtl ? options.start : options.end) : options.right;\n\n // Rewrite the bottom offset as a top offset.\n if (options.bottom != null) {\n (options as _Without<_Bottom> & _Top).top =\n el.scrollHeight - el.clientHeight - options.bottom;\n }\n\n // Rewrite the right offset as a left offset.\n if (isRtl && getRtlScrollAxisType() != RtlScrollAxisType.NORMAL) {\n if (options.left != null) {\n (options as _Without<_Left> & _Right).right =\n el.scrollWidth - el.clientWidth - options.left;\n }\n\n if (getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {\n options.left = options.right;\n } else if (getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {\n options.left = options.right ? -options.right : options.right;\n }\n } else {\n if (options.right != null) {\n (options as _Without<_Right> & _Left).left =\n el.scrollWidth - el.clientWidth - options.right;\n }\n }\n\n this._applyScrollToOptions(options);\n }\n\n private _applyScrollToOptions(options: ScrollToOptions): void {\n const el = this.elementRef.nativeElement;\n\n if (supportsScrollBehavior()) {\n el.scrollTo(options);\n } else {\n if (options.top != null) {\n el.scrollTop = options.top;\n }\n if (options.left != null) {\n el.scrollLeft = options.left;\n }\n }\n }\n\n /**\n * Measures the scroll offset relative to the specified edge of the viewport. This method can be\n * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent\n * about what scrollLeft means in RTL. The values returned by this method are normalized such that\n * left and right always refer to the left and right side of the scrolling container irrespective\n * of the layout direction. start and end refer to left and right in an LTR context and vice-versa\n * in an RTL context.\n * @param from The edge to measure from.\n */\n measureScrollOffset(from: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number {\n const LEFT = 'left';\n const RIGHT = 'right';\n const el = this.elementRef.nativeElement;\n if (from == 'top') {\n return el.scrollTop;\n }\n if (from == 'bottom') {\n return el.scrollHeight - el.clientHeight - el.scrollTop;\n }\n\n // Rewrite start & end as left or right offsets.\n const isRtl = this.dir && this.dir.value == 'rtl';\n if (from == 'start') {\n from = isRtl ? RIGHT : LEFT;\n } else if (from == 'end') {\n from = isRtl ? LEFT : RIGHT;\n }\n\n if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.INVERTED) {\n // For INVERTED, scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n } else {\n return el.scrollLeft;\n }\n } else if (isRtl && getRtlScrollAxisType() == RtlScrollAxisType.NEGATED) {\n // For NEGATED, scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and\n // 0 when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft + el.scrollWidth - el.clientWidth;\n } else {\n return -el.scrollLeft;\n }\n } else {\n // For NORMAL, as well as non-RTL contexts, scrollLeft is 0 when scrolled all the way left and\n // (scrollWidth - clientWidth) when scrolled all the way right.\n if (from == LEFT) {\n return el.scrollLeft;\n } else {\n return el.scrollWidth - el.clientWidth - el.scrollLeft;\n }\n }\n }\n}\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\nimport {Platform} from '@angular/cdk/platform';\nimport {\n ElementRef,\n Injectable,\n NgZone,\n OnDestroy,\n Optional,\n SkipSelf,\n} from '@angular/core';\nimport {fromEvent, of as observableOf, Subject, Subscription, Observable, Observer} from 'rxjs';\nimport {auditTime, filter} from 'rxjs/operators';\nimport {CdkScrollable} from './scrollable';\n\n\n/** Time in ms to throttle the scrolling events by default. */\nexport const DEFAULT_SCROLL_TIME = 20;\n\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\n@Injectable({providedIn: 'root'})\nexport class ScrollDispatcher implements OnDestroy {\n constructor(private _ngZone: NgZone, private _platform: Platform) { }\n\n /** Subject for notifying that a registered scrollable reference element has been scrolled. */\n private _scrolled = new Subject<CdkScrollable|void>();\n\n /** Keeps track of the global `scroll` and `resize` subscriptions. */\n _globalSubscription: Subscription | null = null;\n\n /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */\n private _scrolledCount = 0;\n\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n scrollContainers: Map<CdkScrollable, Subscription> = new Map();\n\n /**\n * Registers a scrollable instance with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event to its scrolled observable.\n * @param scrollable Scrollable instance to be registered.\n */\n register(scrollable: CdkScrollable): void {\n if (!this.scrollContainers.has(scrollable)) {\n this.scrollContainers.set(scrollable, scrollable.elementScrolled()\n .subscribe(() => this._scrolled.next(scrollable)));\n }\n }\n\n /**\n * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.\n * @param scrollable Scrollable instance to be deregistered.\n */\n deregister(scrollable: CdkScrollable): void {\n const scrollableReference = this.scrollContainers.get(scrollable);\n\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollContainers.delete(scrollable);\n }\n }\n\n /**\n * Returns an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n *\n * **Note:** in order to avoid hitting change detection for every scroll event,\n * all of the events emitted from this stream will be run outside the Angular zone.\n * If you need to update any data bindings as a result of a scroll event, you have\n * to run the callback using `NgZone.run`.\n */\n scrolled(auditTimeInMs: number = DEFAULT_SCROLL_TIME): Observable<CdkScrollable|void> {\n if (!this._platform.isBrowser) {\n return observableOf<void>();\n }\n\n return new Observable((observer: Observer<CdkScrollable|void>) => {\n if (!this._globalSubscription) {\n this._addGlobalListener();\n }\n\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n const subscription = auditTimeInMs > 0 ?\n this._scrolled.pipe(auditTime(auditTimeInMs)).subscribe(observer) :\n this._scrolled.subscribe(observer);\n\n this._scrolledCount++;\n\n return () => {\n subscription.unsubscribe();\n this._scrolledCount--;\n\n if (!this._scrolledCount) {\n this._removeGlobalListener();\n }\n };\n });\n }\n\n ngOnDestroy() {\n this._removeGlobalListener();\n this.scrollContainers.forEach((_, container) => this.deregister(container));\n this._scrolled.complete();\n }\n\n /**\n * Returns an observable that emits whenever any of the\n * scrollable ancestors of an element are scrolled.\n * @param elementRef Element whose ancestors to listen for.\n * @param auditTimeInMs Time to throttle the scroll events.\n */\n ancestorScrolled(elementRef: ElementRef, auditTimeInMs?: number): Observable<CdkScrollable|void> {\n const ancestors = this.getAncestorScrollContainers(elementRef);\n\n return this.scrolled(auditTimeInMs).pipe(filter(target => {\n return !target || ancestors.indexOf(target) > -1;\n }));\n }\n\n /** Returns all registered Scrollables that contain the provided element. */\n getAncestorScrollContainers(elementRef: ElementRef): CdkScrollable[] {\n const scrollingContainers: CdkScrollable[] = [];\n\n this.scrollContainers.forEach((_subscription: Subscription, scrollable: CdkScrollable) => {\n if (this._scrollableContainsElement(scrollable, elementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n\n return scrollingContainers;\n }\n\n /** Returns true if the element is contained within the provided Scrollable. */\n private _scrollableContainsElement(scrollable: CdkScrollable, elementRef: ElementRef): boolean {\n let element: HTMLElement | null = elementRef.nativeElement;\n let scrollableElement = scrollable.getElementRef().nativeElement;\n\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) { return true; }\n } while (element = element!.parentElement);\n\n return false;\n }\n\n /** Sets up the global scroll listeners. */\n private _addGlobalListener() {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n return fromEvent(window.document, 'scroll').subscribe(() => this._scrolled.next());\n });\n }\n\n /** Cleans up the global scroll listener. */\n private _removeGlobalListener() {\n if (this._globalSubscription) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n }\n}\n\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport function SCROLL_DISPATCHER_PROVIDER_FACTORY(\n parentDispatcher: ScrollDispatcher, ngZone: NgZone, platform: Platform) {\n return parentDispatcher || new ScrollDispatcher(ngZone, platform);\n}\n\n/** @docs-private @deprecated @breaking-change 8.0.0 */\nexport const SCROLL_DISPATCHER_PROVIDER = {\n // If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.\n provide: ScrollDispatcher,\n deps: [[new Optional(), new SkipSelf(), ScrollDispatcher], NgZone, Platform],\n useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY\n};\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\nimport {coerceNumberProperty} from '@angular/cdk/coercion';\nimport {Directive, forwardRef, Input, OnChanges} from '@angular/core';\nimport {Observable, Subject} from 'rxjs';\nimport {distinctUntilChanged} from 'rxjs/operators';\nimport {VIRTUAL_SCROLL_STRATEGY, VirtualScrollStrategy} from './virtual-scroll-strategy';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n\n/** Virtual scrolling strategy for lists with items of known fixed size. */\nexport class FixedSizeVirtualScrollStrategy implements VirtualScrollStrategy {\n private _scrolledIndexChange = new Subject<number>();\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n scrolledIndexChange: Observable<number> = this._scrolledIndexChange.pipe(distinctUntilChanged());\n\n /** The attached viewport. */\n private _viewport: CdkVirtualScrollViewport | null = null;\n\n /** The size of the items in the virtually scrolling list. */\n private _itemSize: number;\n\n /** The minimum amount of buffer rendered beyond the viewport (in pixels). */\n private _minBufferPx: number;\n\n /** The number of buffer items to render beyond the edge of the viewport (in pixels). */\n private _maxBufferPx: number;\n\n /**\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n constructor(itemSize: number, minBufferPx: number, maxBufferPx: number) {\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n }\n\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport: CdkVirtualScrollViewport) {\n this._viewport = viewport;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach() {\n this._scrolledIndexChange.complete();\n this._viewport = null;\n }\n\n /**\n * Update the item size and buffer size.\n * @param itemSize The size of the items in the virtually scrolling list.\n * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more\n * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.\n */\n updateItemAndBufferSize(itemSize: number, minBufferPx: number, maxBufferPx: number) {\n if (maxBufferPx < minBufferPx) {\n throw Error('CDK virtual scroll: maxBufferPx must be greater than or equal to minBufferPx');\n }\n this._itemSize = itemSize;\n this._minBufferPx = minBufferPx;\n this._maxBufferPx = maxBufferPx;\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentScrolled() {\n this._updateRenderedRange();\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onDataLengthChanged() {\n this._updateTotalContentSize();\n this._updateRenderedRange();\n }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onContentRendered() { /* no-op */ }\n\n /** @docs-private Implemented as part of VirtualScrollStrategy. */\n onRenderedOffsetChanged() { /* no-op */ }\n\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n scrollToIndex(index: number, behavior: ScrollBehavior): void {\n if (this._viewport) {\n this._viewport.scrollToOffset(index * this._itemSize, behavior);\n }\n }\n\n /** Update the viewport's total content size. */\n private _updateTotalContentSize() {\n if (!this._viewport) {\n return;\n }\n\n this._viewport.setTotalContentSize(this._viewport.getDataLength() * this._itemSize);\n }\n\n /** Update the viewport's rendered range. */\n private _updateRenderedRange() {\n if (!this._viewport) {\n return;\n }\n\n const scrollOffset = this._viewport.measureScrollOffset();\n const firstVisibleIndex = scrollOffset / this._itemSize;\n const renderedRange = this._viewport.getRenderedRange();\n const newRange = {start: renderedRange.start, end: renderedRange.end};\n const viewportSize = this._viewport.getViewportSize();\n const dataLength = this._viewport.getDataLength();\n\n const startBuffer = scrollOffset - newRange.start * this._itemSize;\n if (startBuffer < this._minBufferPx && newRange.start != 0) {\n const expandStart = Math.ceil((this._maxBufferPx - startBuffer) / this._itemSize);\n newRange.start = Math.max(0, newRange.start - expandStart);\n newRange.end = Math.min(dataLength,\n Math.ceil(firstVisibleIndex + (viewportSize + this._minBufferPx) / this._itemSize));\n } else {\n const endBuffer = newRange.end * this._itemSize - (scrollOffset + viewportSize);\n if (endBuffer < this._minBufferPx && newRange.end != dataLength) {\n const expandEnd = Math.ceil((this._maxBufferPx - endBuffer) / this._itemSize);\n if (expandEnd > 0) {\n newRange.end = Math.min(dataLength, newRange.end + expandEnd);\n newRange.start = Math.max(0,\n Math.floor(firstVisibleIndex - this._minBufferPx / this._itemSize));\n }\n }\n }\n\n this._viewport.setRenderedRange(newRange);\n this._viewport.setRenderedContentOffset(this._itemSize * newRange.start);\n this._scrolledIndexChange.next(Math.floor(firstVisibleIndex));\n }\n}\n\n\n/**\n * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created\n * `FixedSizeVirtualScrollStrategy` from the given directive.\n * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the\n * `FixedSizeVirtualScrollStrategy` from.\n */\nexport function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir: CdkFixedSizeVirtualScroll) {\n return fixedSizeDir._scrollStrategy;\n}\n\n\n/** A virtual scroll strategy that supports fixed-size items. */\n@Directive({\n selector: 'cdk-virtual-scroll-viewport[itemSize]',\n providers: [{\n provide: VIRTUAL_SCROLL_STRATEGY,\n useFactory: _fixedSizeVirtualScrollStrategyFactory,\n deps: [forwardRef(() => CdkFixedSizeVirtualScroll)],\n }],\n})\nexport class CdkFixedSizeVirtualScroll implements OnChanges {\n /** The size of the items in the list (in pixels). */\n @Input()\n get itemSize(): number { return this._itemSize; }\n set itemSize(value: number) { this._itemSize = coerceNumberProperty(value); }\n _itemSize = 20;\n\n /**\n * The minimum amount of buffer rendered beyond the viewport (in pixels).\n * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.\n */\n @Input()\n get minBufferPx(): number { return this._minBufferPx; }\n set minBufferPx(value: number) { this._minBufferPx = coerceNumberProperty(value); }\n _minBufferPx = 100;\n\n /**\n * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.\n */\n @Input()\n get maxBufferPx(): number { return this._maxBufferPx; }\n set maxBufferPx(value: number) { this._maxBufferPx = coerceNumberProperty(value); }\n _maxBufferPx = 200;\n\n /** The scroll strategy used by this directive. */\n _scrollStrategy =\n new FixedSizeVirtualScrollStrategy(this.itemSize, this.minBufferPx, this.maxBufferPx);\n\n ngOnChanges() {\n this._scrollStrategy.updateItemAndBufferSize(this.itemSize, this.minBufferPx, this.maxBufferPx);\n }\n}\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\nimport {InjectionToken} from '@angular/core';\nimport {Observable} from 'rxjs';\nimport {CdkVirtualScrollViewport} from './virtual-scroll-viewport';\n\n\n/** The injection token used to specify the virtual scrolling strategy. */\nexport const VIRTUAL_SCROLL_STRATEGY =\n new InjectionToken<VirtualScrollStrategy>('VIRTUAL_SCROLL_STRATEGY');\n\n\n/** A strategy that dictates which items should be rendered in the viewport. */\nexport interface VirtualScrollStrategy {\n /** Emits when the index of the first element visible in the viewport changes. */\n scrolledIndexChange: Observable<number>;\n\n /**\n * Attaches this scroll strategy to a viewport.\n * @param viewport The viewport to attach this strategy to.\n */\n attach(viewport: CdkVirtualScrollViewport): void;\n\n /** Detaches this scroll strategy from the currently attached viewport. */\n detach(): void;\n\n /** Called when the viewport is scrolled (debounced using requestAnimationFrame). */\n onContentScrolled(): void;\n\n /** Called when the length of the data changes. */\n onDataLengthChanged(): void;\n\n /** Called when the range of items rendered in the DOM has changed. */\n onContentRendered(): void;\n\n /** Called when the offset of the rendered items changed. */\n onRenderedOffsetChanged(): void;\n\n /**\n * Scroll to the offset for the given index.\n * @param index The index of the element to scroll to.\n * @param behavior The ScrollBehavior to use when scrolling.\n */\n scrollToIndex(index: number, behavior: ScrollBehavior): void;\n}\n"],"names":["observableOf"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AOcA,AAAA,MAAa,uBAAuB,GAChC,IAAI,cAAc,CAAwB,yBAAyB,CAAC;;;;;;;;;ADExE,AAAA,MAAa,8BAA8B,CAA3C;;;;;;IAuBE,WAAF,CAAc,QAAgB,EAAE,WAAmB,EAAE,WAAmB,EAAxE;QAtBU,IAAV,CAAA,oBAA8B,GAAG,IAAI,OAAO,EAAU,CAAC;;;;QAGrD,IAAF,CAAA,mBAAqB,GAAuB,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;;;;QAGzF,IAAV,CAAA,SAAmB,GAAoC,IAAI,CAAC;QAiBxD,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;QAChC,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;KACjC;;;;;;IAMD,MAAM,CAAC,QAAkC,EAA3C;QACI,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAC/B,IAAI,CAAC,oBAAoB,EAAE,CAAC;KAC7B;;;;;IAGD,MAAM,GAAR;QACI,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,CA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