import{i as m,B as b}from"./index-434d719f.js";import{h as s,j as f,q as t,t as i}from"./vue-a39e6937.js";import{_ as y}from"./index-ba596ae9.js";const _=s({name:"formItem",props:{label:{type:String},type:{type:String,required:!0,validator:e=>m.includes(e)},modelValue:{required:!0},inputAttr:{type:Object,default:()=>{}},attr:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},prop:{type:String,default:""},placeholder:{type:String,default:""}},emits:["update:modelValue"],setup(e,{emit:n}){const r=a=>{n("update:modelValue",a)},l=f(()=>e.attr&&e.attr["block-help"]?e.attr["block-help"]:""),d=()=>{let a=t(b,{type:e.type,attr:{placeholder:e.placeholder,...e.inputAttr},data:e.data,modelValue:e.modelValue,"onUpdate:modelValue":r});return l.value?[a,t("div",{class:"block-help"},l.value)]:a},o=["string","password","number","textarea","datetime","year","date","time","select","selects","remoteSelect","city","icon","color"],u=["radio","checkbox","switch","array","image","images","file","files","editor"];if(o.includes(e.type))return()=>t(i("el-form-item"),{prop:e.prop,...e.attr,label:e.label},{default:d});if(u.includes(e.type)){let a=e.data&&e.data.title?e.data.title:e.label;const c=()=>[t("div",{class:"ba-form-item-label"},[t("div",null,a),t("div",{class:"ba-form-item-label-tip"},e.data&&e.data.tip?e.data.tip:"")])];return()=>t(i("el-form-item"),{class:"ba-input-item-"+e.type,prop:e.prop,...e.attr,label:e.label},{label:c,default:d})}}});const S=y(_,[["__scopeId","data-v-3bd03b21"]]);export{S as F};
