const t=window.EdelElements.h;import{a as e}from"./chunk-69f58b19.js";class a{constructor(){this.autofocus=!1}handleChange(t){this.value=t.target.value,this.valueChange.emit(this.value)}hostData(){return{class:"input"}}handleBlur(t){this.afterEdit.emit(this.value)}componentDidLoad(){this.updateAutoFocus(),this.updateInGroupDidChange(),this.updateCss()}updateCss(){this.disabled?this.hostElement.classList.add("input--off"):this.hostElement.classList.remove("input--off")}updateAutoFocus(){this.autofocus&&this.hostElement.getElementsByTagName("textarea").item(0).focus()}render(){return t("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)}updateInGroupDidChange(){e(this.inGroup,this.hostElement)}static get is(){return"edel-input-textarea"}static get properties(){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}}}static get events(){return[{name:"valueChange",method:"valueChange",bubbles:!0,cancelable:!0,composed:!0},{name:"afterEdit",method:"afterEdit",bubbles:!0,cancelable:!0,composed:!0}]}}export{a as EdelInputTextarea};