import{a7 as h}from"./vendor-ant-design-vue.3e0197c8.js";import{c as A,b9 as B,b4 as I,ba as V,a9 as C}from"./index.b8342cb4.js";import{m as k}from"./vendor-lodash-es.ed8922d2.js";import{f as z,r as L,e as i,u as e,c as a,aZ as R,i as Z}from"./vendor-@vue.d54eea3a.js";function q(n){return typeof n=="function"||Object.prototype.toString.call(n)==="[object Object]"&&!Z(n)}const F={useCollapse:{type:Boolean,default:!0},title:{type:String,default:""},size:{type:String,validator:n=>["small","default","middle",void 0].includes(n),default:"small"},bordered:{type:Boolean,default:!0},column:{type:[Number,Object],default:()=>({xxl:4,xl:3,lg:3,md:3,sm:2,xs:1})},collapseOptions:{type:Object,default:null},schema:{type:Array,default:()=>[]},data:{type:Object}};var T=z({name:"Description",props:F,emits:["register"],setup(n,{slots:O,emit:j}){const p=L(null),{prefixCls:v}=A("description"),D=B(),d=i(()=>({...n,...e(p)})),c=i(()=>({...e(d),title:void 0})),_=i(()=>!!e(d).title),P=i(()=>({canExpand:!1,...e(c).collapseOptions})),S=i(()=>({...e(D),...e(c)}));function E(t){p.value={...e(p),...t}}function M({label:t,labelMinWidth:r,labelStyle:s}){if(!s&&!r)return t;const o={...s,minWidth:`${r}px `};return a("div",{style:o},[t])}function N(){const{schema:t,data:r}=e(c);return e(t).map(s=>{const{render:o,field:g,span:$,show:m,contentMinWidth:y}=s;if(m&&C(m)&&!m(r))return null;const b=()=>{var x;const l=(x=e(c))==null?void 0:x.data;if(!l)return null;const u=k(l,g);return C(o)?o(u,l):u!=null?u:""},w=y;return a(h.Item,{label:M(s),key:g,span:$},{default:()=>{if(!y)return b();const l={minWidth:`${w}px`};return a("div",{style:l},[b()])}})}).filter(s=>!!s)}const f=()=>{let t;return a(h,R({class:`${v}`},e(S)),q(t=N())?t:{default:()=>[t]})},W=()=>{const t=n.useCollapse?f():a("div",null,[f()]);if(!n.useCollapse)return t;const{canExpand:r,helpMessage:s}=e(P),{title:o}=e(d);return a(V,{title:o,canExpan:r,helpMessage:s},{default:()=>t,action:()=>I(O,"action")})};return j("register",{setDescProps:E}),()=>e(_)?W():f()}});export{T as _};
