import { MdcComponent } from '@aurelia-mdc-web/base' ; import { helperTextCssClasses , MDCSelectHelperTextFoundation , MDCSelectHelperTextAdapter } from '@material/select' ; import { inject , customElement , useView , PLATFORM } from 'aurelia-framework' ; import { bindable } from 'aurelia-typed-observable-plugin' ; export const mdcHelperTextCssClasses = { ROOT : 'mdc-select-helper-text' } ; @ inject ( Element ) @ useView ( PLATFORM . moduleName ( './mdc-select-helper-text.html' ) ) @ customElement ( mdcHelperTextCssClasses . ROOT ) export class MdcSelectHelperText extends MdcComponent < MDCSelectHelperTextFoundation > { helperTextCssClasses = helperTextCssClasses ; ROOT = mdcHelperTextCssClasses . ROOT ; @ bindable . booleanAttr persistent : boolean ; @ bindable . booleanAttr validation : boolean ; @ bindable errors : string [ ] ; get foundationForTextField ( ) : MDCSelectHelperTextFoundation { return this . foundation ! ; } 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 MDCSelectHelperTextFoundation ( adapter ) ; } } hidden export interface IMdcSelectHelperTextElement extends HTMLElement { au : { controller : { viewModel : MdcSelectHelperText ; } ; } ; }