

<script>
/* eslint-disable */
// sd-skip-auto-import
import components from"./_import-components/sd-text-editor-import";var _render=function e(){var t=this,r=t._self._c;return r("div",{class:t.$style.wrapper},[r("sd-cell-text",{class:{[t.$style.hide]:t.edit},attrs:{value:t.value}}),t.edit?r("textarea",{ref:"input",class:t.$style.textarea,domProps:{value:t.value},on:{input:e=>t.$emit("input",e.target.value),blur:function(e){t.edit=false}}}):t._e()],1)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdTextEditor",components:components,props:{value:{type:String,default:void 0}},data(){return{edit:false}},methods:{doEdit(){this.edit=true;this.$nextTick((()=>this.$refs.input.focus()))}},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;

.wrapper {
  position: relative;
  line-height: 1.5;
  .textarea {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 0;
    overflow: hidden;
    text-align: inherit;
    resize: none;
    background-color: transparent;
    border: none;
    outline: none;
    &::selection {
      color: $text-color-inverse;
      background: $text-selection-bg;
    }
  }
  .hide {
    visibility: hidden;
  }
  > div:empty {
    min-height: $line-height-base * $font-size-base;
  }
}
</style>
