license import { MDCComponent } from '@material/base/component' ; import { MDCTextFieldHelperTextAdapter } from './adapter' ; import { MDCTextFieldHelperTextFoundation } from './foundation' ; export type MDCTextFieldHelperTextFactory = ( el : Element , foundation ? : MDCTextFieldHelperTextFoundation ) => MDCTextFieldHelperText ; export class MDCTextFieldHelperText extends MDCComponent < MDCTextFieldHelperTextFoundation > { static override attachTo ( root ) { return new MDCTextFieldHelperText ( root ) ; } get foundationForTextField ( ) : MDCTextFieldHelperTextFoundation { return this . foundation ; } 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 ) , getAttr : ( attr ) => this . root . getAttribute ( attr ) , setAttr : ( attr , value ) => this . root . setAttribute ( attr , value ) , removeAttr : ( attr ) => this . root . removeAttribute ( attr ) , setContent : ( content ) => { this . root . textContent = content ; } , } ; return new MDCTextFieldHelperTextFoundation ( adapter ) ; } }