import { Component , OnInit , ViewEncapsulation } from '@angular/core' ; import { AutoSizeType } from 'ng-zorro-antd/input' ; import { ControlUIWidget } from '../../widget' ; import { SFTextareaWidgetSchema } from './schema' ; @ Component ( { selector : 'sf-textarea' , templateUrl : './textarea.widget.html' , preserveWhitespaces : false , encapsulation : ViewEncapsulation . None } ) export class TextareaWidget extends ControlUIWidget < SFTextareaWidgetSchema > implements OnInit { autosize : boolean | AutoSizeType = true ; ngOnInit ( ) { const { autosize } = this . ui ; if ( autosize != null ) { this . autosize = autosize ; } } change ( val ) { this . setValue ( val ) ; if ( this . ui . change ) this . ui . change ( val ) ; } focus ( e ) { if ( this . ui . focus ) this . ui . focus ( e ) ; } blur ( e ) { if ( this . ui . blur ) this . ui . blur ( e ) ; } }