

<script>
/* eslint-disable */
// sd-skip-auto-import
import sdFormItemHelpPopover from"@/common/components/sd-form/sd-form-item-help-popover.vue";import sdTransientFieldHelper from"@/common/components/sd-form/sd-transient-field-helper.vue";import SdTableLayoutForm from"./sd-table-layout-form.vue";import runtimeUtil from"./runtime-util";import components from"./_import-components/sd-component-render-import";var _render=function e(){var t=this,r=t._self._c;return r("div",{class:{[t.$style.wrapper]:true,[t.$style.required]:t.field.required,[t.$style.hasIcon]:t.fieldPopoverDescription}},[!t.formItemData.transient?[null===t.formItemData.label?[r("sd-form-item",t._b({on:{hiddenChange:e=>this.$emit("hiddenChange",e)}},"sd-form-item",t.formItemData,false)),r("div",{class:t.$style.icons},[t.fieldPopoverDescription?r("sd-form-item-help-popover",{class:t.$style.helpIcon,attrs:{html:t.fieldPopoverDescription}}):t._e()],1)]:r(t.SdTableLayoutForm,{tag:"component",attrs:{"form-props":{columns:1},fields:[t.field]}})]:r("sd-transient-field-helper",{attrs:{field:t.field},on:{hiddenChange:e=>this.$emit("hiddenChange",e)}},["layout"===t.field.attrFD.category?r(t.formItemData.component,{tag:"component",attrs:{field:t.field}}):r(t.formItemData.component,t._b({tag:"component",attrs:{field:t.field}},"component",t.formItemData.inputProps,false))],1)],2)};var staticRenderFns=[];_render._withStripped=true;export default{name:"SdComponentRender",components:{sdFormItemHelpPopover:sdFormItemHelpPopover,sdTransientFieldHelper:sdTransientFieldHelper,...components},props:{field:{type:Object,required:true}},data(){return{}},computed:{formItemData(){const{name:e,attrFD:{cid:t,transient:r}}=this.field;const o={cid:t,transient:r,name:e,...this.field.attrFD.formItemProps,component:runtimeUtil.getRender(t),componentForDisplay:runtimeUtil.getRender(t,true)};if(this.field.attrFD.hideLabel)o.label=null;return o},fieldPopoverDescription(){if(this.field.attrFD?.popoverDescription)return this.field.attrFD?.description;else return""}},created(){this.SdTableLayoutForm=SdTableLayoutForm},methods:{},render:_render,staticRenderFns:staticRenderFns};</script>

<style module lang="scss">
@use '@/common/design' as *;
@use "@/common/components/sd-web-print.scss" as print;
.wrapper {
  position: relative;
  .icons {
    position: absolute;
    top: 50%;
    right: -2px;
    margin-top: -$font-size-base / 2;
    line-height: 1;
  }
  table:global(.sd-form-theme.sd-form-table) {
    width: 100%;
    margin: -1px 0;
  }
}

.required {
  :global(.sd-no-label:not(.sd-readonly)) {
    margin-right: 10px;
    + .icons {
      &::before {
        display: block;
        color: $label-required-color;
        content: '*';
      }
    }
  }
}

.required.has-icon {
  :global(.sd-no-label:not(.sd-readonly)) {
    + .icons {
      margin-top: -$font-size-base;
      &::before {
        width: $font-size-base;
        text-align: center;
      }
    }
  }
}

.has-icon {
  :global(.ant-form-item.sd-no-label) {
    margin-right: $font-size-base;
  }
}

@include print.wrapper {
  .has-icon {
    :global(.ant-form-item.sd-no-label) {
      margin-right: 0;
    }
  }
}
</style>
