UNPKG

69.9 kBJavaScriptView Raw
1/**
2 * @license
3 * Copyright Google LLC All Rights Reserved.
4 *
5 * Use of this source code is governed by an MIT-style license that can be
6 * found in the LICENSE file at https://angular.io/license
7 */
8import { Directionality } from '@angular/cdk/bidi';
9import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, inject, Inject, Input, NgZone, Optional, Output, ViewChild, ViewEncapsulation, } from '@angular/core';
10import { Platform } from '@angular/cdk/platform';
11import { animationFrameScheduler, asapScheduler, Observable, Subject, Subscription, } from 'rxjs';
12import { auditTime, startWith, takeUntil } from 'rxjs/operators';
13import { ScrollDispatcher } from './scroll-dispatcher';
14import { CdkScrollable } from './scrollable';
15import { VIRTUAL_SCROLL_STRATEGY } from './virtual-scroll-strategy';
16import { ViewportRuler } from './viewport-ruler';
17import { coerceBooleanProperty } from '@angular/cdk/coercion';
18import { CdkVirtualScrollable, VIRTUAL_SCROLLABLE } from './virtual-scrollable';
19import * as i0 from "@angular/core";
20import * as i1 from "@angular/cdk/bidi";
21import * as i2 from "./scroll-dispatcher";
22import * as i3 from "./viewport-ruler";
23import * as i4 from "./virtual-scrollable";
24/** Checks if the given ranges are equal. */
25function rangesEqual(r1, r2) {
26 return r1.start == r2.start && r1.end == r2.end;
27}
28/**
29 * Scheduler to be used for scroll events. Needs to fall back to
30 * something that doesn't rely on requestAnimationFrame on environments
31 * that don't support it (e.g. server-side rendering).
32 */
33const SCROLL_SCHEDULER = typeof requestAnimationFrame !== 'undefined' ? animationFrameScheduler : asapScheduler;
34/** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */
35class CdkVirtualScrollViewport extends CdkVirtualScrollable {
36 /** The direction the viewport scrolls. */
37 get orientation() {
38 return this._orientation;
39 }
40 set orientation(orientation) {
41 if (this._orientation !== orientation) {
42 this._orientation = orientation;
43 this._calculateSpacerSize();
44 }
45 }
46 /**
47 * Whether rendered items should persist in the DOM after scrolling out of view. By default, items
48 * will be removed.
49 */
50 get appendOnly() {
51 return this._appendOnly;
52 }
53 set appendOnly(value) {
54 this._appendOnly = coerceBooleanProperty(value);
55 }
56 constructor(elementRef, _changeDetectorRef, ngZone, _scrollStrategy, dir, scrollDispatcher, viewportRuler, scrollable) {
57 super(elementRef, scrollDispatcher, ngZone, dir);
58 this.elementRef = elementRef;
59 this._changeDetectorRef = _changeDetectorRef;
60 this._scrollStrategy = _scrollStrategy;
61 this.scrollable = scrollable;
62 this._platform = inject(Platform);
63 /** Emits when the viewport is detached from a CdkVirtualForOf. */
64 this._detachedSubject = new Subject();
65 /** Emits when the rendered range changes. */
66 this._renderedRangeSubject = new Subject();
67 this._orientation = 'vertical';
68 this._appendOnly = false;
69 // Note: we don't use the typical EventEmitter here because we need to subscribe to the scroll
70 // strategy lazily (i.e. only if the user is actually listening to the events). We do this because
71 // depending on how the strategy calculates the scrolled index, it may come at a cost to
72 // performance.
73 /** Emits when the index of the first element visible in the viewport changes. */
74 this.scrolledIndexChange = new Observable((observer) => this._scrollStrategy.scrolledIndexChange.subscribe(index => Promise.resolve().then(() => this.ngZone.run(() => observer.next(index)))));
75 /** A stream that emits whenever the rendered range changes. */
76 this.renderedRangeStream = this._renderedRangeSubject;
77 /**
78 * The total size of all content (in pixels), including content that is not currently rendered.
79 */
80 this._totalContentSize = 0;
81 /** A string representing the `style.width` property value to be used for the spacer element. */
82 this._totalContentWidth = '';
83 /** A string representing the `style.height` property value to be used for the spacer element. */
84 this._totalContentHeight = '';
85 /** The currently rendered range of indices. */
86 this._renderedRange = { start: 0, end: 0 };
87 /** The length of the data bound to this viewport (in number of items). */
88 this._dataLength = 0;
89 /** The size of the viewport (in pixels). */
90 this._viewportSize = 0;
91 /** The last rendered content offset that was set. */
92 this._renderedContentOffset = 0;
93 /**
94 * Whether the last rendered content offset was to the end of the content (and therefore needs to
95 * be rewritten as an offset to the start of the content).
96 */
97 this._renderedContentOffsetNeedsRewrite = false;
98 /** Whether there is a pending change detection cycle. */
99 this._isChangeDetectionPending = false;
100 /** A list of functions to run after the next change detection cycle. */
101 this._runAfterChangeDetection = [];
102 /** Subscription to changes in the viewport size. */
103 this._viewportChanges = Subscription.EMPTY;
104 if (!_scrollStrategy && (typeof ngDevMode === 'undefined' || ngDevMode)) {
105 throw Error('Error: cdk-virtual-scroll-viewport requires the "itemSize" property to be set.');
106 }
107 this._viewportChanges = viewportRuler.change().subscribe(() => {
108 this.checkViewportSize();
109 });
110 if (!this.scrollable) {
111 // No scrollable is provided, so the virtual-scroll-viewport needs to become a scrollable
112 this.elementRef.nativeElement.classList.add('cdk-virtual-scrollable');
113 this.scrollable = this;
114 }
115 }
116 ngOnInit() {
117 // Scrolling depends on the element dimensions which we can't get during SSR.
118 if (!this._platform.isBrowser) {
119 return;
120 }
121 if (this.scrollable === this) {
122 super.ngOnInit();
123 }
124 // It's still too early to measure the viewport at this point. Deferring with a promise allows
125 // the Viewport to be rendered with the correct size before we measure. We run this outside the
126 // zone to avoid causing more change detection cycles. We handle the change detection loop
127 // ourselves instead.
128 this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
129 this._measureViewportSize();
130 this._scrollStrategy.attach(this);
131 this.scrollable
132 .elementScrolled()
133 .pipe(
134 // Start off with a fake scroll event so we properly detect our initial position.
135 startWith(null),
136 // Collect multiple events into one until the next animation frame. This way if
137 // there are multiple scroll events in the same frame we only need to recheck
138 // our layout once.
139 auditTime(0, SCROLL_SCHEDULER))
140 .subscribe(() => this._scrollStrategy.onContentScrolled());
141 this._markChangeDetectionNeeded();
142 }));
143 }
144 ngOnDestroy() {
145 this.detach();
146 this._scrollStrategy.detach();
147 // Complete all subjects
148 this._renderedRangeSubject.complete();
149 this._detachedSubject.complete();
150 this._viewportChanges.unsubscribe();
151 super.ngOnDestroy();
152 }
153 /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */
154 attach(forOf) {
155 if (this._forOf && (typeof ngDevMode === 'undefined' || ngDevMode)) {
156 throw Error('CdkVirtualScrollViewport is already attached.');
157 }
158 // Subscribe to the data stream of the CdkVirtualForOf to keep track of when the data length
159 // changes. Run outside the zone to avoid triggering change detection, since we're managing the
160 // change detection loop ourselves.
161 this.ngZone.runOutsideAngular(() => {
162 this._forOf = forOf;
163 this._forOf.dataStream.pipe(takeUntil(this._detachedSubject)).subscribe(data => {
164 const newLength = data.length;
165 if (newLength !== this._dataLength) {
166 this._dataLength = newLength;
167 this._scrollStrategy.onDataLengthChanged();
168 }
169 this._doChangeDetection();
170 });
171 });
172 }
173 /** Detaches the current `CdkVirtualForOf`. */
174 detach() {
175 this._forOf = null;
176 this._detachedSubject.next();
177 }
178 /** Gets the length of the data bound to this viewport (in number of items). */
179 getDataLength() {
180 return this._dataLength;
181 }
182 /** Gets the size of the viewport (in pixels). */
183 getViewportSize() {
184 return this._viewportSize;
185 }
186 // TODO(mmalerba): This is technically out of sync with what's really rendered until a render
187 // cycle happens. I'm being careful to only call it after the render cycle is complete and before
188 // setting it to something else, but its error prone and should probably be split into
189 // `pendingRange` and `renderedRange`, the latter reflecting whats actually in the DOM.
190 /** Get the current rendered range of items. */
191 getRenderedRange() {
192 return this._renderedRange;
193 }
194 measureBoundingClientRectWithScrollOffset(from) {
195 return this.getElementRef().nativeElement.getBoundingClientRect()[from];
196 }
197 /**
198 * Sets the total size of all content (in pixels), including content that is not currently
199 * rendered.
200 */
201 setTotalContentSize(size) {
202 if (this._totalContentSize !== size) {
203 this._totalContentSize = size;
204 this._calculateSpacerSize();
205 this._markChangeDetectionNeeded();
206 }
207 }
208 /** Sets the currently rendered range of indices. */
209 setRenderedRange(range) {
210 if (!rangesEqual(this._renderedRange, range)) {
211 if (this.appendOnly) {
212 range = { start: 0, end: Math.max(this._renderedRange.end, range.end) };
213 }
214 this._renderedRangeSubject.next((this._renderedRange = range));
215 this._markChangeDetectionNeeded(() => this._scrollStrategy.onContentRendered());
216 }
217 }
218 /**
219 * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).
220 */
221 getOffsetToRenderedContentStart() {
222 return this._renderedContentOffsetNeedsRewrite ? null : this._renderedContentOffset;
223 }
224 /**
225 * Sets the offset from the start of the viewport to either the start or end of the rendered data
226 * (in pixels).
227 */
228 setRenderedContentOffset(offset, to = 'to-start') {
229 // In appendOnly, we always start from the top
230 offset = this.appendOnly && to === 'to-start' ? 0 : offset;
231 // For a horizontal viewport in a right-to-left language we need to translate along the x-axis
232 // in the negative direction.
233 const isRtl = this.dir && this.dir.value == 'rtl';
234 const isHorizontal = this.orientation == 'horizontal';
235 const axis = isHorizontal ? 'X' : 'Y';
236 const axisDirection = isHorizontal && isRtl ? -1 : 1;
237 let transform = `translate${axis}(${Number(axisDirection * offset)}px)`;
238 this._renderedContentOffset = offset;
239 if (to === 'to-end') {
240 transform += ` translate${axis}(-100%)`;
241 // The viewport should rewrite this as a `to-start` offset on the next render cycle. Otherwise
242 // elements will appear to expand in the wrong direction (e.g. `mat-expansion-panel` would
243 // expand upward).
244 this._renderedContentOffsetNeedsRewrite = true;
245 }
246 if (this._renderedContentTransform != transform) {
247 // We know this value is safe because we parse `offset` with `Number()` before passing it
248 // into the string.
249 this._renderedContentTransform = transform;
250 this._markChangeDetectionNeeded(() => {
251 if (this._renderedContentOffsetNeedsRewrite) {
252 this._renderedContentOffset -= this.measureRenderedContentSize();
253 this._renderedContentOffsetNeedsRewrite = false;
254 this.setRenderedContentOffset(this._renderedContentOffset);
255 }
256 else {
257 this._scrollStrategy.onRenderedOffsetChanged();
258 }
259 });
260 }
261 }
262 /**
263 * Scrolls to the given offset from the start of the viewport. Please note that this is not always
264 * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left
265 * direction, this would be the equivalent of setting a fictional `scrollRight` property.
266 * @param offset The offset to scroll to.
267 * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
268 */
269 scrollToOffset(offset, behavior = 'auto') {
270 const options = { behavior };
271 if (this.orientation === 'horizontal') {
272 options.start = offset;
273 }
274 else {
275 options.top = offset;
276 }
277 this.scrollable.scrollTo(options);
278 }
279 /**
280 * Scrolls to the offset for the given index.
281 * @param index The index of the element to scroll to.
282 * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
283 */
284 scrollToIndex(index, behavior = 'auto') {
285 this._scrollStrategy.scrollToIndex(index, behavior);
286 }
287 /**
288 * Gets the current scroll offset from the start of the scrollable (in pixels).
289 * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'
290 * in horizontal mode.
291 */
292 measureScrollOffset(from) {
293 // This is to break the call cycle
294 let measureScrollOffset;
295 if (this.scrollable == this) {
296 measureScrollOffset = (_from) => super.measureScrollOffset(_from);
297 }
298 else {
299 measureScrollOffset = (_from) => this.scrollable.measureScrollOffset(_from);
300 }
301 return Math.max(0, measureScrollOffset(from ?? (this.orientation === 'horizontal' ? 'start' : 'top')) -
302 this.measureViewportOffset());
303 }
304 /**
305 * Measures the offset of the viewport from the scrolling container
306 * @param from The edge to measure from.
307 */
308 measureViewportOffset(from) {
309 let fromRect;
310 const LEFT = 'left';
311 const RIGHT = 'right';
312 const isRtl = this.dir?.value == 'rtl';
313 if (from == 'start') {
314 fromRect = isRtl ? RIGHT : LEFT;
315 }
316 else if (from == 'end') {
317 fromRect = isRtl ? LEFT : RIGHT;
318 }
319 else if (from) {
320 fromRect = from;
321 }
322 else {
323 fromRect = this.orientation === 'horizontal' ? 'left' : 'top';
324 }
325 const scrollerClientRect = this.scrollable.measureBoundingClientRectWithScrollOffset(fromRect);
326 const viewportClientRect = this.elementRef.nativeElement.getBoundingClientRect()[fromRect];
327 return viewportClientRect - scrollerClientRect;
328 }
329 /** Measure the combined size of all of the rendered items. */
330 measureRenderedContentSize() {
331 const contentEl = this._contentWrapper.nativeElement;
332 return this.orientation === 'horizontal' ? contentEl.offsetWidth : contentEl.offsetHeight;
333 }
334 /**
335 * Measure the total combined size of the given range. Throws if the range includes items that are
336 * not rendered.
337 */
338 measureRangeSize(range) {
339 if (!this._forOf) {
340 return 0;
341 }
342 return this._forOf.measureRangeSize(range, this.orientation);
343 }
344 /** Update the viewport dimensions and re-render. */
345 checkViewportSize() {
346 // TODO: Cleanup later when add logic for handling content resize
347 this._measureViewportSize();
348 this._scrollStrategy.onDataLengthChanged();
349 }
350 /** Measure the viewport size. */
351 _measureViewportSize() {
352 this._viewportSize = this.scrollable.measureViewportSize(this.orientation);
353 }
354 /** Queue up change detection to run. */
355 _markChangeDetectionNeeded(runAfter) {
356 if (runAfter) {
357 this._runAfterChangeDetection.push(runAfter);
358 }
359 // Use a Promise to batch together calls to `_doChangeDetection`. This way if we set a bunch of
360 // properties sequentially we only have to run `_doChangeDetection` once at the end.
361 if (!this._isChangeDetectionPending) {
362 this._isChangeDetectionPending = true;
363 this.ngZone.runOutsideAngular(() => Promise.resolve().then(() => {
364 this._doChangeDetection();
365 }));
366 }
367 }
368 /** Run change detection. */
369 _doChangeDetection() {
370 this._isChangeDetectionPending = false;
371 // Apply the content transform. The transform can't be set via an Angular binding because
372 // bypassSecurityTrustStyle is banned in Google. However the value is safe, it's composed of
373 // string literals, a variable that can only be 'X' or 'Y', and user input that is run through
374 // the `Number` function first to coerce it to a numeric value.
375 this._contentWrapper.nativeElement.style.transform = this._renderedContentTransform;
376 // Apply changes to Angular bindings. Note: We must call `markForCheck` to run change detection
377 // from the root, since the repeated items are content projected in. Calling `detectChanges`
378 // instead does not properly check the projected content.
379 this.ngZone.run(() => this._changeDetectorRef.markForCheck());
380 const runAfterChangeDetection = this._runAfterChangeDetection;
381 this._runAfterChangeDetection = [];
382 for (const fn of runAfterChangeDetection) {
383 fn();
384 }
385 }
386 /** Calculates the `style.width` and `style.height` for the spacer element. */
387 _calculateSpacerSize() {
388 this._totalContentHeight =
389 this.orientation === 'horizontal' ? '' : `${this._totalContentSize}px`;
390 this._totalContentWidth =
391 this.orientation === 'horizontal' ? `${this._totalContentSize}px` : '';
392 }
393 static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: CdkVirtualScrollViewport, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: VIRTUAL_SCROLL_STRATEGY, optional: true }, { token: i1.Directionality, optional: true }, { token: i2.ScrollDispatcher }, { token: i3.ViewportRuler }, { token: VIRTUAL_SCROLLABLE, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
394 static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: CdkVirtualScrollViewport, isStandalone: true, selector: "cdk-virtual-scroll-viewport", inputs: { orientation: "orientation", appendOnly: "appendOnly" }, outputs: { scrolledIndexChange: "scrolledIndexChange" }, host: { properties: { "class.cdk-virtual-scroll-orientation-horizontal": "orientation === \"horizontal\"", "class.cdk-virtual-scroll-orientation-vertical": "orientation !== \"horizontal\"" }, classAttribute: "cdk-virtual-scroll-viewport" }, providers: [
395 {
396 provide: CdkScrollable,
397 useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
398 deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport],
399 },
400 ], viewQueries: [{ propertyName: "_contentWrapper", first: true, predicate: ["contentWrapper"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
401}
402export { CdkVirtualScrollViewport };
403i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: CdkVirtualScrollViewport, decorators: [{
404 type: Component,
405 args: [{ selector: 'cdk-virtual-scroll-viewport', host: {
406 'class': 'cdk-virtual-scroll-viewport',
407 '[class.cdk-virtual-scroll-orientation-horizontal]': 'orientation === "horizontal"',
408 '[class.cdk-virtual-scroll-orientation-vertical]': 'orientation !== "horizontal"',
409 }, encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, providers: [
410 {
411 provide: CdkScrollable,
412 useFactory: (virtualScrollable, viewport) => virtualScrollable || viewport,
413 deps: [[new Optional(), new Inject(VIRTUAL_SCROLLABLE)], CdkVirtualScrollViewport],
414 },
415 ], template: "<!--\n Wrap the rendered content in an element that will be used to offset it based on the scroll\n position.\n-->\n<div #contentWrapper class=\"cdk-virtual-scroll-content-wrapper\">\n <ng-content></ng-content>\n</div>\n<!--\n Spacer used to force the scrolling container to the correct size for the *total* number of items\n so that the scrollbar captures the size of the entire data set.\n-->\n<div class=\"cdk-virtual-scroll-spacer\"\n [style.width]=\"_totalContentWidth\" [style.height]=\"_totalContentHeight\"></div>\n", styles: ["cdk-virtual-scroll-viewport{display:block;position:relative;transform:translateZ(0)}.cdk-virtual-scrollable{overflow:auto;will-change:scroll-position;contain:strict;-webkit-overflow-scrolling:touch}.cdk-virtual-scroll-content-wrapper{position:absolute;top:0;left:0;contain:content}[dir=rtl] .cdk-virtual-scroll-content-wrapper{right:0;left:auto}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper{min-height:100%}.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-horizontal .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-left:0;padding-right:0;margin-left:0;margin-right:0;border-left-width:0;border-right-width:0;outline:none}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper{min-width:100%}.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>dl:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ol:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>table:not([cdkVirtualFor]),.cdk-virtual-scroll-orientation-vertical .cdk-virtual-scroll-content-wrapper>ul:not([cdkVirtualFor]){padding-top:0;padding-bottom:0;margin-top:0;margin-bottom:0;border-top-width:0;border-bottom-width:0;outline:none}.cdk-virtual-scroll-spacer{height:1px;transform-origin:0 0;flex:0 0 auto}[dir=rtl] .cdk-virtual-scroll-spacer{transform-origin:100% 0}"] }]
416 }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
417 type: Optional
418 }, {
419 type: Inject,
420 args: [VIRTUAL_SCROLL_STRATEGY]
421 }] }, { type: i1.Directionality, decorators: [{
422 type: Optional
423 }] }, { type: i2.ScrollDispatcher }, { type: i3.ViewportRuler }, { type: i4.CdkVirtualScrollable, decorators: [{
424 type: Optional
425 }, {
426 type: Inject,
427 args: [VIRTUAL_SCROLLABLE]
428 }] }]; }, propDecorators: { orientation: [{
429 type: Input
430 }], appendOnly: [{
431 type: Input
432 }], scrolledIndexChange: [{
433 type: Output
434 }], _contentWrapper: [{
435 type: ViewChild,
436 args: ['contentWrapper', { static: true }]
437 }] } });
438//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmlydHVhbC1zY3JvbGwtdmlld3BvcnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvY2RrL3Njcm9sbGluZy92aXJ0dWFsLXNjcm9sbC12aWV3cG9ydC50cyIsIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9jZGsvc2Nyb2xsaW5nL3ZpcnR1YWwtc2Nyb2xsLXZpZXdwb3J0Lmh0bWwiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFDLGNBQWMsRUFBQyxNQUFNLG1CQUFtQixDQUFDO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