import { RendererComponent } from './Renderer' ; import { ControlProps , ControlState } from '@jsonforms/core' ; template P template S export class Control < P extends ControlProps , S extends ControlState > extends RendererComponent < P , S > { constructor ( props ) { super ( props ) ; this . state = { value : props . data ? props . data : '' , isFocused : false } as S ; } param value handleChange = ( value ) => { this . setState ( { value } ) ; this . updateData ( value ) ; } ; /**
     * Set the focused state to true.
     */ onFocus = ( ) => { this . setState ( { isFocused : true } ) ; } ; /**
     * Set the focused state to false.
     */ onBlur = ( ) => { this . setState ( { isFocused : false } ) ; } ; private updateData = ( value ) => { this . props . handleChange ( this . props . path , value ) ; } ; }