blob: 4387667fd1d4638dae1f48359f81eca84eb23945 [file] [log] [blame]
{"version":3,"file":"cdk-scrolling.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/cdk/scrolling/fixed-size-virtual-scroll.ts","../../src/cdk/scrolling/scroll-dispatcher.ts","../../src/cdk/scrolling/virtual-scroll-viewport.ts","../../src/cdk/scrolling/virtual-for-of.ts","../../src/cdk/scrolling/viewport-ruler.ts","../../src/cdk/scrolling/virtual-scroll-strategy.ts","../../src/cdk/scrolling/scrollable.ts","../../src/cdk/scrolling/scrolling-module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\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 {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 {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 {\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 {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 {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","/**\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 {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"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","_fixedSizeVirtualScrollStrategyFactory","fixedSizeDir","_scrollStrategy","SCROLL_DISPATCHER_PROVIDER_FACTORY","parentDispatcher","ngZone","platform","ScrollDispatcher","rangesEqual","r1","r2","start","end","getSize","orientation","node","el","getBoundingClientRect","rect","width","height","VIEWPORT_RULER_PROVIDER_FACTORY","parentRuler","ViewportRuler","setPrototypeOf","__proto__","Array","p","hasOwnProperty","VIRTUAL_SCROLL_STRATEGY","InjectionToken","FixedSizeVirtualScrollStrategy","itemSize","minBufferPx","maxBufferPx","_scrolledIndexChange","Subject","scrolledIndexChange","pipe","distinctUntilChanged","_viewport","_itemSize","_minBufferPx","_maxBufferPx","attach","viewport","_updateTotalContentSize","_updateRenderedRange","detach","complete","updateItemAndBufferSize","Error","onContentScrolled","onDataLengthChanged","onContentRendered","onRenderedOffsetChanged","scrollToIndex","index","behavior","scrollToOffset","setTotalContentSize","getDataLength","scrollOffset","measureScrollOffset","firstVisibleIndex","renderedRange","getRenderedRange","newRange","viewportSize","getViewportSize","dataLength","startBuffer","expandStart","Math","ceil","max","min","endBuffer","expandEnd","floor","setRenderedRange","setRenderedContentOffset","next","CdkFixedSizeVirtualScroll","defineProperty","value","coerceNumberProperty","ngOnChanges","type","Directive","args","selector","providers","provide","useFactory","deps","forwardRef","Input","_ngZone","_platform","_scrolled","_globalSubscription","_scrolledCount","scrollContainers","Map","register","scrollable","_this","has","set","elementScrolled","subscribe","deregister","scrollableReference","get","unsubscribe","delete","scrolled","auditTimeInMs","isBrowser","Observable","observer","_addGlobalListener","subscription","auditTime","_removeGlobalListener","observableOf","ngOnDestroy","forEach","_","container","ancestorScrolled","elementRef","ancestors","getAncestorScrollContainers","filter","target","indexOf","scrollingContainers","_subscription","_scrollableContainsElement","push","element","nativeElement","scrollableElement","getElementRef","parentElement","runOutsideAngular","fromEvent","window","document","Injectable","providedIn","NgZone","Platform","SCROLL_DISPATCHER_PROVIDER","Optional","SkipSelf","CdkScrollable","scrollDispatcher","dir","_destroyed","_elementScrolled","takeUntil","ngOnInit","scrollTo","options","isRtl","left","right","bottom","top","scrollHeight","clientHeight","getRtlScrollAxisType","RtlScrollAxisType","NORMAL","scrollWidth","clientWidth","INVERTED","NEGATED","_applyScrollToOptions","supportsScrollBehavior","scrollTop","scrollLeft","from","ElementRef","Directionality","decorators","SCROLL_SCHEDULER","requestAnimationFrame","animationFrameScheduler","asapScheduler","CdkVirtualScrollViewport","_super","_changeDetectorRef","call","_detachedSubject","_renderedRangeSubject","Promise","resolve","then","run","renderedRangeStream","asObservable","_totalContentSizeTransform","_totalContentSize","_renderedRange","_dataLength","_viewportSize","_renderedContentOffset","_renderedContentOffsetNeedsRewrite","_isChangeDetectionPending","_runAfterChangeDetection","tslib_1.__extends","_measureViewportSize","startWith","_markChangeDetectionNeeded","forOf","_forOf","dataStream","data","newLength","length","_doChangeDetection","size","axis","range","getOffsetToRenderedContentStart","offset","to","isHorizontal","axisDirection","transform","Number","_renderedContentTransform","measureRenderedContentSize","contentEl","_contentWrapper","offsetWidth","offsetHeight","measureRangeSize","checkViewportSize","viewportEl","runAfter","markForCheck","style","runAfterChangeDetection","_i","runAfterChangeDetection_1","fn","Component","template","styles","host","class","[class.cdk-virtual-scroll-orientation-horizontal]","[class.cdk-virtual-scroll-orientation-vertical]","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","useExisting","undefined","Inject","propDecorators","ViewChild","static","CdkVirtualForOf","_viewContainerRef","_template","_differs","viewChange","_dataSourceChanges","cdkVirtualForTemplateCacheSize","pairwise","switchMap","_a","prev","cur","_changeDataSource","shareReplay","_differ","_templateCache","_needsUpdate","_data","_onRenderedDataChange","_cdkVirtualForOf","ds","isDataSource","ArrayDataSource","slice","_cdkVirtualForTrackBy","item","renderedStartIndex","rangeLen","totalSize","i","view","j","rootNodes","ngDoCheck","changes","diff","_renderedItems","_applyChanges","_updateContext","destroy","find","cdkVirtualForTrackBy","oldDs","newDs","disconnect","connect","count","context","_updateComputedContextProperties","detectChanges","forEachOperation","record","adjustedPreviousIndex","currentIndex","previousIndex","_insertViewForNewItem","$implicit","_cacheView","_detachView","move","forEachIdentityChange","remove","_insertViewFromCache","_createEmbeddedViewAt","first","last","even","odd","createEmbeddedView","cdkVirtualForOf","cachedView","pop","insert","ViewContainerRef","TemplateRef","IterableDiffers","cdkVirtualForTemplate","ScrollingModule","NgModule","imports","BidiModule","PlatformModule","exports","declarations","ScrollDispatchModule","_change","merge","_invalidateCache","change","_updateViewportSize","output","getViewportRect","scrollPosition","getViewportScrollPosition","documentElement","documentRect","body","scrollY","scrollX","throttleTime","innerWidth","innerHeight","VIEWPORT_RULER_PROVIDER"],"mappings":";;;;;;;qsBAuBA,SAAgBA,GAAUC,EAAGC,GAEz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