UNPKG

primeng

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primeng.svg)](https://badge.fury.io/js/primeng) [![Discord](https://img.shields.io/discord/557940238991753

2 lines 2.93 kB
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/forms"),require("@angular/common")):"function"==typeof define&&define.amd?define("primeng/inputtextarea",["exports","@angular/core","@angular/forms","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.inputtextarea={}),e.ng.core,e.ng.forms,e.ng.common)}(this,(function(e,t,n,i){"use strict";var o=function(){function e(e,n,i,o){this.el=e,this.ngModel=n,this.control=i,this.cd=o,this.onResize=new t.EventEmitter}return e.prototype.ngOnInit=function(){var e=this;this.ngModel&&(this.ngModelSubscription=this.ngModel.valueChanges.subscribe((function(){e.updateState()}))),this.control&&(this.ngControlSubscription=this.control.valueChanges.subscribe((function(){e.updateState()})))},e.prototype.ngAfterViewInit=function(){this.autoResize&&this.resize(),this.updateFilledState(),this.cd.detectChanges()},e.prototype.onInput=function(e){this.updateState()},e.prototype.updateFilledState=function(){this.filled=this.el.nativeElement.value&&this.el.nativeElement.value.length},e.prototype.onFocus=function(e){this.autoResize&&this.resize(e)},e.prototype.onBlur=function(e){this.autoResize&&this.resize(e)},e.prototype.resize=function(e){this.el.nativeElement.style.height="auto",this.el.nativeElement.style.height=this.el.nativeElement.scrollHeight+"px",parseFloat(this.el.nativeElement.style.height)>=parseFloat(this.el.nativeElement.style.maxHeight)?(this.el.nativeElement.style.overflowY="scroll",this.el.nativeElement.style.height=this.el.nativeElement.style.maxHeight):this.el.nativeElement.style.overflow="hidden",this.onResize.emit(e||{})},e.prototype.updateState=function(){this.updateFilledState(),this.autoResize&&this.resize()},e.prototype.ngOnDestroy=function(){this.ngModelSubscription&&this.ngModelSubscription.unsubscribe(),this.ngControlSubscription&&this.ngControlSubscription.unsubscribe()},e}();o.decorators=[{type:t.Directive,args:[{selector:"[pInputTextarea]",host:{"[class.p-inputtextarea]":"true","[class.p-inputtext]":"true","[class.p-component]":"true","[class.p-filled]":"filled","[class.p-inputtextarea-resizable]":"autoResize"}}]}],o.ctorParameters=function(){return[{type:t.ElementRef},{type:n.NgModel,decorators:[{type:t.Optional}]},{type:n.NgControl,decorators:[{type:t.Optional}]},{type:t.ChangeDetectorRef}]},o.propDecorators={autoResize:[{type:t.Input}],onResize:[{type:t.Output}],onInput:[{type:t.HostListener,args:["input",["$event"]]}],onFocus:[{type:t.HostListener,args:["focus",["$event"]]}],onBlur:[{type:t.HostListener,args:["blur",["$event"]]}]};var s=function(){};s.decorators=[{type:t.NgModule,args:[{imports:[i.CommonModule],exports:[o],declarations:[o]}]}],e.InputTextarea=o,e.InputTextareaModule=s,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=primeng-inputtextarea.umd.min.js.map