license import { MDCComponent } from '@material/base/component' ; import { MDCTextFieldIconAdapter } from './adapter' ; import { MDCTextFieldIconFoundation } from './foundation' ; export type MDCTextFieldIconFactory = ( el : Element , foundation ? : MDCTextFieldIconFoundation ) => MDCTextFieldIcon ; export class MDCTextFieldIcon extends MDCComponent < MDCTextFieldIconFoundation > { static override attachTo ( root ) { return new MDCTextFieldIcon ( root ) ; } get foundationForTextField ( ) : MDCTextFieldIconFoundation { return this . foundation ; } override getDefaultFoundation ( ) { const adapter = { 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 ; } , registerInteractionHandler : ( evtType , handler ) => this . listen ( evtType , handler ) , deregisterInteractionHandler : ( evtType , handler ) => this . unlisten ( evtType , handler ) , notifyIconAction : ( ) => this . emit ( MDCTextFieldIconFoundation . strings . ICON_EVENT , { } , true ) , } ; return new MDCTextFieldIconFoundation ( adapter ) ; } }