import { ChangeDetectionStrategy , Component , Input , HostBinding , EventEmitter , HostListener , SimpleChanges , OnChanges , } from '@angular/core' ; @ Component ( { changeDetection : ChangeDetectionStrategy . OnPush , selector : 'textarea[kirby-textarea]' , styleUrls : [ './textarea.component.scss' ] , templateUrl : './textarea.component.html' , } ) export class TextareaComponent implements OnChanges { kirbyChange = new EventEmitter < string > ( ) ; @ Input ( ) value : string ; /**
     * Removes padding, width, rounded borders and drop-shadow when set to `true`.
     */ @ HostBinding ( 'class.borderless' ) @ Input ( ) borderless : boolean ; @ HostBinding ( 'class.error' ) @ Input ( ) hasError : boolean ; @ HostBinding ( 'attr.autocomplete' ) @ Input ( ) autocomplete : 'on' | 'off' = 'off' ; @ HostBinding ( 'attr.autocorrect' ) @ Input ( ) autocorrect : 'on' | 'off' = 'off' ; @ HostBinding ( 'attr.maxlength' ) @ Input ( ) maxlength : number ; @ HostListener ( 'keyup' , [ '$event.target.value' ] ) _onKeyUp ( value ) { this . kirbyChange . emit ( value ) ; } @ HostListener ( 'paste' , [ '$event.target' ] ) @ HostListener ( 'cut' , [ '$event.target' ] ) _onCutPaste ( target ) { setTimeout ( ( ) => this . kirbyChange . emit ( target . value ) ) ; } ngOnChanges ( changes ) { if ( changes . value ) { this . kirbyChange . emit ( changes . value . currentValue ) ; } } }