import{r as t,c as e,h as i,H as s,g as l}from"./p-9f21f85f.js";const n=class{constructor(i){t(this,i),this.cellFormCancel=e(this,"cellFormCancel",7),this.cellFormSubmit=e(this,"cellFormSubmit",7)}async focus(){var t,e;null===(e=null===(t=this.el.querySelector("dvn-input"))||void 0===t?void 0:t.focus)||void 0===e||e.call(t)}handleKeyDown(t){"Escape"===t.key?(this.cellFormCancel.emit(),this.internalValue=this.value):"Enter"===t.key&&(this.internalValue!==this.value&&this.cellFormSubmit.emit({value:this.internalValue}),this.cellFormCancel.emit())}componentWillLoad(){this.internalValue=this.value}render(){const{disabled:t,errors:e,field:l,value:n}=this;return i(s,null,i("dvn-input",{id:l.id,type:l.inputType||"text",disabled:t||l.disabled,placeholder:l.placeholder,onChange:t=>{t.stopImmediatePropagation(),this.internalValue=t.detail},onBlur:t=>{t.stopImmediatePropagation(),this.internalValue!==this.value&&this.cellFormSubmit.emit({value:this.internalValue}),this.cellFormCancel.emit()},value:n,feedback:e&&e.length>0?"error":void 0,leaned:!0,autoComplete:l.autoComplete,overrideStyle:{width:"100%","min-width":"0"},scale:"small"}))}get el(){return l(this)}};n.style="dvn-field-input-cell-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:100%}";export{n as dvn_field_input_cell_text}