import{h}from"../edel-elements.core.js";import{a as applyInputgroupStyle}from"./chunk-69f58b19.js";var EdelInputTextareaComponent=function(){function t(){this.autofocus=!1}return t.prototype.handleChange=function(t){this.value=t.target.value,this.valueChange.emit(this.value)},t.prototype.hostData=function(){return{class:"input"}},t.prototype.handleBlur=function(t){this.afterEdit.emit(this.value)},t.prototype.componentDidLoad=function(){this.updateAutoFocus(),this.updateInGroupDidChange(),this.updateCss()},t.prototype.updateCss=function(){this.disabled?this.hostElement.classList.add("input--off"):this.hostElement.classList.remove("input--off")},t.prototype.updateAutoFocus=function(){this.autofocus&&this.hostElement.getElementsByTagName("textarea").item(0).focus()},t.prototype.render=function(){return h("textarea",{style:this.height?{height:this.height+"px"}:{},placeholder:this.placeholder,onInput:this.handleChange.bind(this),onBlur:this.handleBlur.bind(this),autofocus:this.autofocus},this.value)},t.prototype.updateInGroupDidChange=function(){applyInputgroupStyle(this.inGroup,this.hostElement)},Object.defineProperty(t,"is",{get:function(){return"edel-input-textarea"},enumerable:!0,configurable:!0}),Object.defineProperty(t,"properties",{get:function(){return{autofocus:{type:Boolean,attr:"autofocus",watchCallbacks:["updateAutoFocus"]},disabled:{type:Boolean,attr:"disabled",watchCallbacks:["updateCss"]},height:{type:Number,attr:"height"},hostElement:{elementRef:!0},inGroup:{type:Boolean,attr:"in-group",watchCallbacks:["updateInGroupDidChange"]},placeholder:{type:String,attr:"placeholder"},value:{type:String,attr:"value",mutable:!0}}},enumerable:!0,configurable:!0}),Object.defineProperty(t,"events",{get:function(){return[{name:"valueChange",method:"valueChange",bubbles:!0,cancelable:!0,composed:!0},{name:"afterEdit",method:"afterEdit",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),t}();export{EdelInputTextareaComponent as EdelInputTextarea};