ScopeSentry/static/assets/el-descriptions-item-CZQJQ4...

2 lines
4.1 KiB
JavaScript
Raw Permalink Normal View History

2024-07-20 11:29:31 +00:00
import{d as e,a7 as l,dB as t,b4 as s,a4 as a,G as n,v as r,b5 as i,W as o,X as c,a as d,o as p,c as u,f as y,F as b,S as v,i as f,e as h,a6 as m,au as g,aC as S,be as w,a3 as k,a5 as $,n as x,A as N,y as D,t as E,j as A,cU as C,ae as W,af as _}from"./index-B4Nyjh3H.js";const j=Symbol("elDescriptions");var z=e({name:"ElDescriptionsCell",props:{cell:{type:Object},tag:{type:String,default:"td"},type:{type:String}},setup:()=>({descriptions:l(j,{})}),render(){var e,l,o,c,d,p,u;const y=t(this.cell),b=((null==(e=this.cell)?void 0:e.dirs)||[]).map((e=>{const{dir:l,arg:t,modifiers:s,value:a}=e;return[l,a,t,s]})),{border:v,direction:f}=this.descriptions,h="vertical"===f,m=(null==(c=null==(o=null==(l=this.cell)?void 0:l.children)?void 0:o.label)?void 0:c.call(o))||y.label,g=null==(u=null==(p=null==(d=this.cell)?void 0:d.children)?void 0:p.default)?void 0:u.call(p),S=y.span,w=y.align?`is-${y.align}`:"",k=y.labelAlign?`is-${y.labelAlign}`:w,$=y.className,x=y.labelClassName,N={width:s(y.width),minWidth:s(y.minWidth)},D=a("descriptions");switch(this.type){case"label":return n(r(this.tag,{style:N,class:[D.e("cell"),D.e("label"),D.is("bordered-label",v),D.is("vertical-label",h),k,x],colSpan:h?S:1},m),b);case"content":return n(r(this.tag,{style:N,class:[D.e("cell"),D.e("content"),D.is("bordered-content",v),D.is("vertical-content",h),w,$],colSpan:h?S:2*S-1},g),b);default:return n(r("td",{style:N,class:[D.e("cell"),w],colSpan:S},[i(m)?void 0:r("span",{class:[D.e("label"),x]},m),r("span",{class:[D.e("content"),$]},g)]),b)}}});const I=o({row:{type:c(Array),default:()=>[]}}),B={key:1},F=e({name:"ElDescriptionsRow"});var G=m(e({...F,props:I,setup(e){const t=l(j,{});return(e,l)=>"vertical"===d(t).direction?(p(),u(b,{key:0},[y("tr",null,[(p(!0),u(b,null,v(e.row,((e,l)=>(p(),f(d(z),{key:`tr1-${l}`,cell:e,tag:"th",type:"label"},null,8,["cell"])))),128))]),y("tr",null,[(p(!0),u(b,null,v(e.row,((e,l)=>(p(),f(d(z),{key:`tr2-${l}`,cell:e,tag:"td",type:"content"},null,8,["cell"])))),128))])],64)):(p(),u("tr",B,[(p(!0),u(b,null,v(e.row,((e,l)=>(p(),u(b,{key:`tr3-${l}`},[d(t).border?(p(),u(b,{key:0},[h(d(z),{cell:e,tag:"td",type:"label"},null,8,["cell"]),h(d(z),{cell:e,tag:"td",type:"content"},null,8,["cell"])],64)):(p(),f(d(z),{key:1,cell:e,tag:"td",type:"both"},null,8,["cell"]))],64)))),128))]))}}),[["__file","descriptions-row.vue"]]);const O=o({border:{type:Boolean,default:!1},column:{type:Number,default:3},direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},size:g,title:{type:String,default:""},extra:{type:String,default:""}}),R=e({name:"ElDescriptions"});var U=m(e({...R,props:O,setup(e){const l=e,t=a("descriptions"),s=S(),n=w();k(j,l);const r=$((()=>[t.b(),t.m(s.value)])),i=(e,l,t,s=!1)=>(e.props||(e.props={}),l>t&&(e.props.span=t),s&&(e.props.span=l),e),o=()=>{if(!n.default)return[];const e=C(n.default()).filter((e=>{var l;return"ElDescriptionsItem"===(null==(l=null==e?void 0:e.type)?void 0:l.name)})),t=[];let s=[],a=l.column,r=0;return e.forEach(((n,o)=>{var c;const d=(null==(c=n.props)?void 0:c.span)||1;if(o<e.length-1&&(r+=d>a?a:d),o===e.length-1){const e=l.column-r%l.column;return s.push(i(n,e,a,!0)),void t.push(s)}d<a?(a-=d,s.push(n)):(s.push(i(n,d,a)),t.push(s),a=l.column,s=[])})),t};return(e,l)=>(p(),u("div",{class:x(d(r))},[e.title||e.extra||e.$slots.title||e.$slots.extra?(p(),u("div",{key:0,class:x(d(t).e("header"))},[y("div",{class:x(d(t).e("title"))},[N(e.$slots,"title",{},(()=>[D(E(e.title),1)]))],2),y("div",{class:x(d(t).e("extra"))},[N(e.$slots,"extra",{},(()=>[D(E(e.extra),1)]))],2)],2)):A("v-if",!0),y("div",{class:x(d(t).e("body"))},[y("table",{class:x([d(t).e("table"),d(t).is("bordered",e.border)])},[y("tbody",null,[(p(!0),u(b,null,v(o(),((e,l)=>(p(),f(G,{key:l,row:e},null,8,["row"])))),128))])],2)],2)],2))}}),[["__file","description.vue"]]);const X=e({name:"ElDescriptionsItem",props:o({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:""},classNam