license import { MDCComponent } from '@material/base/component' ; import { MDCProgressIndicator } from '@material/progress-indicator/component' ; import { MDCCircularProgressAdapter } from './adapter' ; import { MDCCircularProgressFoundation } from './foundation' ; export class MDCCircularProgress extends MDCComponent < MDCCircularProgressFoundation > implements MDCProgressIndicator { private determinateCircle ! : HTMLElement ; override initialize ( ) { this . determinateCircle = this . root . querySelector < HTMLElement > ( MDCCircularProgressFoundation . strings . DETERMINATE_CIRCLE_SELECTOR ) ! ; } static override attachTo ( root ) { return new MDCCircularProgress ( root ) ; } param isDeterminate set determinate ( value ) { this . foundation . setDeterminate ( value ) ; } param value set progress ( value ) { this . foundation . setProgress ( value ) ; } /**
     * Whether the progress indicator is hidden.
     */ get isClosed ( ) { return this . foundation . isClosed ( ) ; } /**
     * Shows the progress indicator.
     */ open ( ) { this . foundation . open ( ) ; } /**
     * Hides the progress indicator.
     */ close ( ) { this . foundation . close ( ) ; } override getDefaultFoundation ( ) { const adapter = { addClass : ( className ) => { this . root . classList . add ( className ) ; } , getDeterminateCircleAttribute : ( attributeName ) => this . determinateCircle . getAttribute ( attributeName ) , hasClass : ( className ) => this . root . classList . contains ( className ) , removeClass : ( className ) => { this . root . classList . remove ( className ) ; } , removeAttribute : ( attributeName ) => { this . root . removeAttribute ( attributeName ) ; } , setAttribute : ( attributeName , value ) => { this . root . setAttribute ( attributeName , value ) ; } , setDeterminateCircleAttribute : ( attributeName , value ) => { this . determinateCircle . setAttribute ( attributeName , value ) ; } , } ; return new MDCCircularProgressFoundation ( adapter ) ; } }