index-44447dae.js 5.3 KB

12
  1. import{n as a,l as w,I as ae,c as F,a2 as re,d2 as ce,d6 as se,d7 as ie,p,P as N,d as te,u as ue,cb as de,d8 as X,A as ne,bf as ve,L as fe,bj as Y,f as ye,d9 as Z,y as pe,cP as be,z as me}from"./index-a8341fa1.js";function k(l){return l!=null}var Se=function(e){var n=e.itemPrefixCls,t=e.component,r=e.span,o=e.labelStyle,u=e.contentStyle,m=e.bordered,c=e.label,i=e.content,s=e.colon,S=t;if(m){var v;return a(S,{class:[(v={},w(v,"".concat(n,"-item-label"),k(c)),w(v,"".concat(n,"-item-content"),k(i)),v)],colSpan:r},{default:function(){return[k(c)&&a("span",{style:o},[c]),k(i)&&a("span",{style:u},[i])]}})}return a(S,{class:["".concat(n,"-item")],colSpan:r},{default:function(){return[a("div",{class:"".concat(n,"-item-container")},[c&&a("span",{class:["".concat(n,"-item-label"),w({},"".concat(n,"-item-no-colon"),!s)],style:o},[c]),i&&a("span",{class:"".concat(n,"-item-content"),style:u},[i])])]}})};const B=Se;var Ce=function(e){var n=function(v,d,b){var P=d.colon,D=d.prefixCls,C=d.bordered,x=b.component,O=b.type,R=b.showLabel,L=b.showContent,h=b.labelStyle,$=b.contentStyle;return v.map(function(f,j){var g,I,y=f.props||{},U=y.prefixCls,A=U===void 0?D:U,T=y.span,V=T===void 0?1:T,q=y.labelStyle,G=q===void 0?y["label-style"]:q,H=y.contentStyle,J=H===void 0?y["content-style"]:H,K=y.label,Q=K===void 0?(g=f.children)===null||g===void 0||(I=g.label)===null||I===void 0?void 0:I.call(g):K,W=ce(f),E=se(f),z=ie(f),M=f.key;return typeof x=="string"?a(B,{key:"".concat(O,"-").concat(String(M)||j),class:E,style:z,labelStyle:p(p({},h),G),contentStyle:p(p({},$),J),span:V,colon:P,component:x,itemPrefixCls:A,bordered:C,label:R?Q:null,content:L?W:null},null):[a(B,{key:"label-".concat(String(M)||j),class:E,style:p(p(p({},h),z),G),span:1,colon:P,component:x[0],itemPrefixCls:A,bordered:C,label:Q},null),a(B,{key:"content-".concat(String(M)||j),class:E,style:p(p(p({},$),z),J),span:V*2-1,component:x[1],itemPrefixCls:A,bordered:C,content:W},null)]})},t=e.prefixCls,r=e.vertical,o=e.row,u=e.index,m=e.bordered,c=ae(oe,{labelStyle:F({}),contentStyle:F({})}),i=c.labelStyle,s=c.contentStyle;return r?a(re,null,[a("tr",{key:"label-".concat(u),class:"".concat(t,"-row")},[n(o,e,{component:"th",type:"label",showLabel:!0,labelStyle:i.value,contentStyle:s.value})]),a("tr",{key:"content-".concat(u),class:"".concat(t,"-row")},[n(o,e,{component:"td",type:"content",showContent:!0,labelStyle:i.value,contentStyle:s.value})])]):a("tr",{key:u,class:"".concat(t,"-row")},[n(o,e,{component:m?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0,labelStyle:i.value,contentStyle:s.value})])};const xe=Ce;N.any;var he=function(){return{prefixCls:String,label:N.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}}},ge=te({compatConfig:{MODE:3},name:"ADescriptionsItem",props:he(),slots:["label"],setup:function(e,n){var t=n.slots;return function(){var r;return(r=t.default)===null||r===void 0?void 0:r.call(t)}}}),le={xxxl:3,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function _e(l,e){if(typeof l=="number")return l;if(ne(l)==="object")for(var n=0;n<Z.length;n++){var t=Z[n];if(e[t]&&l[t]!==void 0)return l[t]||le[t]}return 3}function ee(l,e,n){var t=l;return(e===void 0||e>n)&&(t=be(l,{span:n}),me(e===void 0,"Descriptions","Sum of column `span` in a line not match `column` of Descriptions.")),t}function we(l,e){var n=pe(l),t=[],r=[],o=e;return n.forEach(function(u,m){var c,i=(c=u.props)===null||c===void 0?void 0:c.span,s=i||1;if(m===n.length-1){r.push(ee(u,i,o)),t.push(r);return}s<o?(o-=s,r.push(u)):(r.push(ee(u,s,o)),t.push(r),o=e,r=[])}),t}var Pe=function(){return{prefixCls:String,bordered:{type:Boolean,default:void 0},size:{type:String,default:"default"},title:N.any,extra:N.any,column:{type:[Number,Object],default:function(){return le}},layout:String,colon:{type:Boolean,default:void 0},labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0}}},oe=Symbol("descriptionsContext"),_=te({compatConfig:{MODE:3},name:"ADescriptions",props:Pe(),slots:["title","extra"],Item:ge,setup:function(e,n){var t=n.slots,r=ue("descriptions",e),o=r.prefixCls,u=r.direction,m,c=F({});de(function(){m=X.subscribe(function(s){ne(e.column)==="object"&&(c.value=s)})}),ve(function(){X.unsubscribe(m)}),fe(oe,{labelStyle:Y(e,"labelStyle"),contentStyle:Y(e,"contentStyle")});var i=ye(function(){return _e(e.column,c.value)});return function(){var s,S,v,d,b=e.size,P=e.bordered,D=P===void 0?!1:P,C=e.layout,x=C===void 0?"horizontal":C,O=e.colon,R=O===void 0?!0:O,L=e.title,h=L===void 0?(s=t.title)===null||s===void 0?void 0:s.call(t):L,$=e.extra,f=$===void 0?(S=t.extra)===null||S===void 0?void 0:S.call(t):$,j=(v=t.default)===null||v===void 0?void 0:v.call(t),g=we(j,i.value);return a("div",{class:[o.value,(d={},w(d,"".concat(o.value,"-").concat(b),b!=="default"),w(d,"".concat(o.value,"-bordered"),!!D),w(d,"".concat(o.value,"-rtl"),u.value==="rtl"),d)]},[(h||f)&&a("div",{class:"".concat(o.value,"-header")},[h&&a("div",{class:"".concat(o.value,"-title")},[h]),f&&a("div",{class:"".concat(o.value,"-extra")},[f])]),a("div",{class:"".concat(o.value,"-view")},[a("table",null,[a("tbody",null,[g.map(function(I,y){return a(xe,{key:y,index:y,colon:R,prefixCls:o.value,vertical:x==="vertical",bordered:D,row:I},null)})])])])])}}});_.install=function(l){return l.component(_.name,_),l.component(_.Item.name,_.Item),l};const je=_;export{ge as D,je as _};
  2. //# sourceMappingURL=index-44447dae.js.map