license import { ScrollDispatcher , ViewportRuler } from '@angular-mdc/web/scrolling' ; import { DOCUMENT } from '@angular/common' ; import { Inject , Injectable , NgZone } from '@angular/core' ; import { BlockScrollStrategy } from './block-scroll-strategy' ; import { CloseScrollStrategy , CloseScrollStrategyConfig } from './close-scroll-strategy' ; import { NoopScrollStrategy } from './noop-scroll-strategy' ; import { RepositionScrollStrategy , RepositionScrollStrategyConfig , } from './reposition-scroll-strategy' ; /**
 * Options for how an overlay will handle scrolling.
 *
 * Users can provide a custom value for `ScrollStrategyOptions` to replace the default
 * behaviors. This class primarily acts as a factory for ScrollStrategy instances.
 */ @ Injectable ( { providedIn : 'root' } ) export class ScrollStrategyOptions { private _document : Document ; constructor ( private _scrollDispatcher , private _viewportRuler , private _ngZone , @ Inject ( DOCUMENT ) document ) { this . _document = document ; } /** Do nothing on scroll. */ noop = ( ) => new NoopScrollStrategy ( ) ; param config close = ( config ? ) => new CloseScrollStrategy ( this . _scrollDispatcher , this . _ngZone , this . _viewportRuler , config ) ; /** Block scrolling. */ block = ( ) => new BlockScrollStrategy ( this . _viewportRuler , this . _document ) ; param config reposition = ( config ? ) => new RepositionScrollStrategy ( this . _scrollDispatcher , this . _viewportRuler , this . _ngZone , config ) ; }