UNPKG

primevue

Version:

PrimeVue is an open source UI library for Vue featuring a rich set of 80+ components, a theme designer, various theme alternatives such as Material, Bootstrap, Tailwind, premium templates and professional support. In addition, it integrates with PrimeBloc

2 lines (1 loc) 1.44 kB
"use strict";var e=require("primevue/basecomponent"),t=require("primevue/textarea/style"),s=require("vue");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a={name:"Textarea",extends:{name:"BaseTextarea",extends:l(e).default,props:{modelValue:null,autoResize:Boolean},style:l(t).default,provide:function(){return{$parentInstance:this}}},emits:["update:modelValue"],mounted:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},updated:function(){this.$el.offsetParent&&this.autoResize&&this.resize()},methods:{resize:function(){this.$el.style.height="auto",this.$el.style.height=this.$el.scrollHeight+"px",parseFloat(this.$el.style.height)>=parseFloat(this.$el.style.maxHeight)?(this.$el.style.overflowY="scroll",this.$el.style.height=this.$el.style.maxHeight):this.$el.style.overflow="hidden"},onInput:function(e){this.autoResize&&this.resize(),this.$emit("update:modelValue",e.target.value)}},computed:{filled:function(){return null!=this.modelValue&&this.modelValue.toString().length>0},ptmParams:function(){return{context:{disabled:this.$attrs.disabled||""===this.$attrs.disabled}}}}},i=["value"];a.render=function(e,t,l,a,n,o){return s.openBlock(),s.createElementBlock("textarea",s.mergeProps({class:e.cx("root"),value:e.modelValue,onInput:t[0]||(t[0]=function(){return o.onInput&&o.onInput.apply(o,arguments)})},e.ptm("root",o.ptmParams),{"data-pc-name":"textarea"}),null,16,i)},module.exports=a;