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