mirror of
https://gitee.com/niucloud-team/niucloud-admin.git
synced 2025-12-16 04:22:47 +00:00
2 lines
4.1 KiB
JavaScript
2 lines
4.1 KiB
JavaScript
import{g as U,f as H}from"./vnode-5920e7a9.js";import{e as A,b as K,o as J,p as L}from"./index-e37943c3.js";import{d as w,I as W,b as j,U as D,u as n,e as l,f as m,g,F as h,z,v as C,y as B,_ as F,K as O,J as q,c as G,n as S,h as P,A as V,B as R,H as M,l as Q,T as X}from"./base-d77b0726.js";const I="elDescriptions";var E=w({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String},type:{type:String}},setup(){return{descriptions:W(I,{})}},render(){var v,i,t,N,s,d;const r=U(this.cell),{border:$,direction:e}=this.descriptions,c=e==="vertical",u=((t=(i=(v=this.cell)==null?void 0:v.children)==null?void 0:i.label)==null?void 0:t.call(i))||r.label,a=(d=(s=(N=this.cell)==null?void 0:N.children)==null?void 0:s.default)==null?void 0:d.call(s),p=r.span,_=r.align?`is-${r.align}`:"",f=r.labelAlign?`is-${r.labelAlign}`:_,b=r.className,k=r.labelClassName,y={width:A(r.width),minWidth:A(r.minWidth)},o=j("descriptions");switch(this.type){case"label":return D(this.tag,{style:y,class:[o.e("cell"),o.e("label"),o.is("bordered-label",$),o.is("vertical-label",c),f,k],colSpan:c?p:1},u);case"content":return D(this.tag,{style:y,class:[o.e("cell"),o.e("content"),o.is("bordered-content",$),o.is("vertical-content",c),_,b],colSpan:c?p:p*2-1},a);default:return D("td",{style:y,class:[o.e("cell"),_],colSpan:p},[D("span",{class:[o.e("label"),k]},u),D("span",{class:[o.e("content"),b]},a)])}}});const Y=K({row:{type:Array,default:()=>[]}}),Z={key:1},x=w({name:"ElDescriptionsRow"}),ee=w({...x,props:Y,setup(v){const i=W(I,{});return(t,N)=>n(i).direction==="vertical"?(l(),m(h,{key:0},[g("tr",null,[(l(!0),m(h,null,z(t.row,(s,d)=>(l(),C(n(E),{key:`tr1-${d}`,cell:s,tag:"th",type:"label"},null,8,["cell"]))),128))]),g("tr",null,[(l(!0),m(h,null,z(t.row,(s,d)=>(l(),C(n(E),{key:`tr2-${d}`,cell:s,tag:"td",type:"content"},null,8,["cell"]))),128))])],64)):(l(),m("tr",Z,[(l(!0),m(h,null,z(t.row,(s,d)=>(l(),m(h,{key:`tr3-${d}`},[n(i).border?(l(),m(h,{key:0},[B(n(E),{cell:s,tag:"td",type:"label"},null,8,["cell"]),B(n(E),{cell:s,tag:"td",type:"content"},null,8,["cell"])],64)):(l(),C(n(E),{key:1,cell:s,tag:"td",type:"both"},null,8,["cell"]))],64))),128))]))}});var te=F(ee,[["__file","/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/descriptions-row.vue"]]);const se=K({border:{type:Boolean,default:!1},column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:J,title:{type:String,default:""},extra:{type:String,default:""}}),le=w({name:"ElDescriptions"}),ne=w({...le,props:se,setup(v){const i=v,t=j("descriptions"),N=L(),s=O();q(I,i);const d=G(()=>[t.b(),t.m(N.value)]),r=(e,c,u,a=!1)=>(e.props||(e.props={}),c>u&&(e.props.span=u),a&&(e.props.span=c),e),$=()=>{var e;const c=H((e=s.default)==null?void 0:e.call(s)).filter(f=>{var b;return((b=f==null?void 0:f.type)==null?void 0:b.name)==="ElDescriptionsItem"}),u=[];let a=[],p=i.column,_=0;return c.forEach((f,b)=>{var k;const y=((k=f.props)==null?void 0:k.span)||1;if(b<c.length-1&&(_+=y>p?p:y),b===c.length-1){const o=i.column-_%i.column;a.push(r(f,o,p,!0)),u.push(a);return}y<p?(p-=y,a.push(f)):(a.push(r(f,y,p)),u.push(a),p=i.column,a=[])}),u};return(e,c)=>(l(),m("div",{class:S(n(d))},[e.title||e.extra||e.$slots.title||e.$slots.extra?(l(),m("div",{key:0,class:S(n(t).e("header"))},[g("div",{class:S(n(t).e("title"))},[P(e.$slots,"title",{},()=>[V(R(e.title),1)])],2),g("div",{class:S(n(t).e("extra"))},[P(e.$slots,"extra",{},()=>[V(R(e.extra),1)])],2)],2)):M("v-if",!0),g("div",{class:S(n(t).e("body"))},[g("table",{class:S([n(t).e("table"),n(t).is("bordered",e.border)])},[g("tbody",null,[(l(!0),m(h,null,z($(),(u,a)=>(l(),C(te,{key:a,row:u},null,8,["row"]))),128))])],2)],2)],2))}});var re=F(ne,[["__file","/home/runner/work/element-plus/element-plus/packages/components/descriptions/src/description.vue"]]),T=w({name:"ElDescriptionsItem",props:{label:{type:String,default:""},span:{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:""}}});const ce=Q(re,{DescriptionsItem:T}),pe=X(T);export{ce as E,pe as a};
|