license import { MDCComponent } from '@material/base/component' ; import { MDCLineRippleAdapter } from './adapter' ; import { MDCLineRippleFoundation } from './foundation' ; export type MDCLineRippleFactory = ( el : Element , foundation ? : MDCLineRippleFoundation ) => MDCLineRipple ; export class MDCLineRipple extends MDCComponent < MDCLineRippleFoundation > { static override attachTo ( root ) { return new MDCLineRipple ( root ) ; } /**
     * Activates the line ripple
     */ activate ( ) { this . foundation . activate ( ) ; } /**
     * Deactivates the line ripple
     */ deactivate ( ) { this . foundation . deactivate ( ) ; } /**
     * Sets the transform origin given a user's click location.
     * The `rippleCenter` is the x-coordinate of the middle of the ripple.
     */ setRippleCenter ( xCoordinate ) { this . foundation . setRippleCenter ( xCoordinate ) ; } override getDefaultFoundation ( ) { const adapter = { addClass : ( className ) => this . root . classList . add ( className ) , removeClass : ( className ) => this . root . classList . remove ( className ) , hasClass : ( className ) => this . root . classList . contains ( className ) , setStyle : ( propertyName , value ) => ( this . root as HTMLElement ) . style . setProperty ( propertyName , value ) , registerEventHandler : ( evtType , handler ) => this . listen ( evtType , handler ) , deregisterEventHandler : ( evtType , handler ) => this . unlisten ( evtType , handler ) , } ; return new MDCLineRippleFoundation ( adapter ) ; } }