| 1 |
- import{bw as q,b5 as F,ab as O,bc as G,ah as j,ai as H,af as P,al as J,aC as L,bx as M,aK as U,by as X}from"./index-CKIhG1T4.js";import{C as k,i as Q,V as K,aj as C,u as i,D as o,E as f,F as g,K as w,ad as z,T as I,$ as R,S as ll,P as tl,f as el,W as N,Q as V,Z as T,_ as Y,Y as sl}from"./spreadSheetsDesignerVue-MRUT1X_l.js";const B=Symbol("elDescriptions");var _=k({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:Q(B,{})}),render(){var x;const t=q(this.cell),s=(((x=this.cell)==null?void 0:x.dirs)||[]).map(p=>{const{dir:y,arg:v,modifiers:m,value:W}=p;return[y,W,v,m]}),{border:D,direction:u}=this.descriptions,n=u==="vertical",E=()=>{var p,y,v;return((v=(y=(p=this.cell)==null?void 0:p.children)==null?void 0:y.label)==null?void 0:v.call(y))||t.label},A=()=>{var p,y,v;return(v=(y=(p=this.cell)==null?void 0:p.children)==null?void 0:y.default)==null?void 0:v.call(y)},l=t.span,c=t.rowspan,a=t.align?`is-${t.align}`:"",r=t.labelAlign?`is-${t.labelAlign}`:a,S=t.className,b=t.labelClassName,d={width:F(t.width),minWidth:F(t.minWidth)},e=O("descriptions");switch(this.type){case"label":return K(C(this.tag,{style:d,class:[e.e("cell"),e.e("label"),e.is("bordered-label",D),e.is("vertical-label",n),r,b],colSpan:n?l:1,rowspan:n?1:c},E()),s);case"content":return K(C(this.tag,{style:d,class:[e.e("cell"),e.e("content"),e.is("bordered-content",D),e.is("vertical-content",n),a,S],colSpan:n?l:2*l-1,rowspan:n?2*c-1:c},A()),s);default:{const p=E();return K(C("td",{style:d,class:[e.e("cell"),a],colSpan:l,rowspan:c},[G(p)?void 0:C("span",{class:[e.e("label"),b]},p),C("span",{class:[e.e("content"),S]},A())]),s)}}}});const al=j({row:{type:H(Array),default:()=>[]}}),nl=k({name:"ElDescriptionsRow"});var rl=P(k({...nl,props:al,setup(x){const t=Q(B,{});return(s,D)=>i(t).direction==="vertical"?(o(),f(w,{key:0},[g("tr",null,[(o(!0),f(w,null,z(s.row,(u,n)=>(o(),I(i(_),{key:`tr1-${n}`,cell:u,tag:"th",type:"label"},null,8,["cell"]))),128))]),g("tr",null,[(o(!0),f(w,null,z(s.row,(u,n)=>(o(),I(i(_),{key:`tr2-${n}`,cell:u,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(o(),f("tr",{key:1},[(o(!0),f(w,null,z(s.row,(u,n)=>(o(),f(w,{key:`tr3-${n}`},[i(t).border?(o(),f(w,{key:0},[R(i(_),{cell:u,tag:"td",type:"label"},null,8,["cell"]),R(i(_),{cell:u,tag:"td",type:"content"},null,8,["cell"])],64)):(o(),I(i(_),{key:1,cell:u,tag:"td",type:"both"},null,8,["cell"]))],64))),128))]))}}),[["__file","descriptions-row.vue"]]);const il=j({border:Boolean,column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:J,title:{type:String,default:""},extra:{type:String,default:""}}),ol=k({name:"ElDescriptions"});var cl=P(k({...ol,props:il,setup(x){const t=x,s=O("descriptions"),D=L(),u=ll();tl(B,t);const n=el(()=>[s.b(),s.m(D.value)]),E=(l,c,a,r=!1)=>(l.props||(l.props={}),c>a&&(l.props.span=a),r&&(l.props.span=c),l),A=()=>{if(!u.default)return[];const l=M(u.default()).filter(d=>{var e;return((e=d==null?void 0:d.type)==null?void 0:e.name)==="ElDescriptionsItem"}),c=[];let a=[],r=t.column,S=0;const b=[];return l.forEach((d,e)=>{var p,y,v;const m=((p=d.props)==null?void 0:p.span)||1,W=((y=d.props)==null?void 0:y.rowspan)||1,h=c.length;if(b[h]||(b[h]=0),W>1)for(let $=1;$<W;$++)b[v=h+$]||(b[v]=0),b[h+$]++,S++;if(b[h]>0&&(r-=b[h],b[h]=0),e<l.length-1&&(S+=m>r?r:m),e===l.length-1){const $=t.column-S%t.column;return a.push(E(d,$,r,!0)),void c.push(a)}m<r?(r-=m,a.push(d)):(a.push(E(d,m,r)),c.push(a),r=t.column,a=[])}),c};return(l,c)=>(o(),f("div",{class:N(i(n))},[l.title||l.extra||l.$slots.title||l.$slots.extra?(o(),f("div",{key:0,class:N(i(s).e("header"))},[g("div",{class:N(i(s).e("title"))},[V(l.$slots,"title",{},()=>[T(Y(l.title),1)])],2),g("div",{class:N(i(s).e("extra"))},[V(l.$slots,"extra",{},()=>[T(Y(l.extra),1)])],2)],2)):sl("v-if",!0),g("div",{class:N(i(s).e("body"))},[g("table",{class:N([i(s).e("table"),i(s).is("bordered",l.border)])},[g("tbody",null,[(o(!0),f(w,null,z(A(),(a,r)=>(o(),I(rl,{key:r,row:a},null,8,["row"]))),128))])],2)],2)],2))}}),[["__file","description.vue"]]);const Z=k({name:"ElDescriptionsItem",props:j({label:{type:String,default:""},span:{type:Number,default:1},rowspan:{type:Number,default:1},width:{type:[String,Number],default:""},minWidth:{type:[String,Number],default:""},align:{type:String,default:"left"},labelAlign:{type:String,default:""},className:{type:String,default:""},labelClassName:{type:String,default:""}})}),pl=U(cl,{DescriptionsItem:Z}),ul=X(Z);export{ul as E,pl as a};
|