/
githubmirror
/
components
Обзор
Документация
Войти
/
githubmirror
/
components
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/cdk/scrolling/virtual-scrollable.ts
37 строк
1 KB
Kristiyan Kostadinov
fix(multiple): remove empty constructors (#33048)
08 апр 2026, 22:21
Не верифицирован
08 апр 2026, 22:21
ce4c2c0
Код
Авторство
О чём код?
/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.dev/license */ import {Directive, InjectionToken} from '@angular/core'; import {CdkScrollable} from './scrollable'; export const VIRTUAL_SCROLLABLE = new InjectionToken<CdkVirtualScrollable>('VIRTUAL_SCROLLABLE'); /** * Extending the `CdkScrollable` to be used as scrolling container for virtual scrolling. */ @Directive() export abstract class CdkVirtualScrollable extends CdkScrollable { /** * Measure the viewport size for the provided orientation. * * @param orientation The orientation to measure the size from. */ measureViewportSize(orientation: 'horizontal' | 'vertical') { const viewportEl = this.elementRef.nativeElement; return orientation === 'horizontal' ? viewportEl.clientWidth : viewportEl.clientHeight; } /** * Measure the bounding DOMRect size including the scroll offset. * * @param from The edge to measure from. */ abstract measureBoundingClientRectWithScrollOffset( from: 'left' | 'top' | 'right' | 'bottom', ): number; }