license import { MDCFoundation } from '@material/base/foundation' ; import { MDCFormFieldAdapter } from './adapter' ; import { cssClasses , strings } from './constants' ; export class MDCFormFieldFoundation extends MDCFoundation < MDCFormFieldAdapter > { static override get cssClasses ( ) { return cssClasses ; } static override get strings ( ) { return strings ; } static override get defaultAdapter ( ) : MDCFormFieldAdapter { return { activateInputRipple : ( ) => undefined , deactivateInputRipple : ( ) => undefined , deregisterInteractionHandler : ( ) => undefined , registerInteractionHandler : ( ) => undefined , } ; } private readonly click : ( ) => void ; constructor ( adapter ? ) { super ( { ... MDCFormFieldFoundation . defaultAdapter , ... adapter } ) ; this . click = ( ) => { this . handleClick ( ) ; } ; } override init ( ) { this . adapter . registerInteractionHandler ( 'click' , this . click ) ; } override destroy ( ) { this . adapter . deregisterInteractionHandler ( 'click' , this . click ) ; } private handleClick ( ) { this . adapter . activateInputRipple ( ) ; requestAnimationFrame ( ( ) => { this . adapter . deactivateInputRipple ( ) ; } ) ; } } export default MDCFormFieldFoundation ;