Files
machartaa_admin_dist/dist/assets/index-82c1c0dc.js
T

2 lines
5.4 KiB
JavaScript

import{e as a,ag as _,av as ae,i as F,F as re,b7 as ce,bE as se,bd as ie,al as p,ac as E,d as te,a9 as ue,b4 as de,af as ne,y as ve,aw as fe,aD as W,j as ye,ak as pe,aY as be}from"./index-90ac1a44.js";import{R as X,r as Z}from"./styleChecker-1445806f.js";import{c as me}from"./vnode-b0455438.js";function R(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={},_(v,"".concat(n,"-item-label"),R(c)),_(v,"".concat(n,"-item-content"),R(i)),v)],colSpan:r},{default:function(){return[R(c)&&a("span",{style:o},[c]),R(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"),_({},"".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 $=d.colon,I=d.prefixCls,C=d.bordered,x=b.component,O=b.type,L=b.showLabel,k=b.showContent,g=b.labelStyle,P=b.contentStyle;return v.map(function(f,j){var h,D,y=f.props||{},U=y.prefixCls,N=U===void 0?I:U,T=y.span,V=T===void 0?1:T,Y=y.labelStyle,q=Y===void 0?y["label-style"]:Y,G=y.contentStyle,H=G===void 0?y["content-style"]:G,J=y.label,K=J===void 0?(h=f.children)===null||h===void 0||(D=h.label)===null||D===void 0?void 0:D.call(h):J,Q=ce(f),A=se(f),M=ie(f),z=f.key;return typeof x=="string"?a(B,{key:"".concat(O,"-").concat(String(z)||j),class:A,style:M,labelStyle:p(p({},g),q),contentStyle:p(p({},P),H),span:V,colon:$,component:x,itemPrefixCls:N,bordered:C,label:L?K:null,content:k?Q:null},null):[a(B,{key:"label-".concat(String(z)||j),class:A,style:p(p(p({},g),M),q),span:1,colon:$,component:x[0],itemPrefixCls:N,bordered:C,label:K},null),a(B,{key:"content-".concat(String(z)||j),class:A,style:p(p(p({},P),M),H),span:V*2-1,component:x[1],itemPrefixCls:N,bordered:C,content:Q},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;E.any;var ge=function(){return{prefixCls:String,label:E.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}}},he=te({compatConfig:{MODE:3},name:"ADescriptionsItem",props:ge(),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 we(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=me(l,{span:n}),be(e===void 0,"Descriptions","Sum of column `span` in a line not match `column` of Descriptions.")),t}function _e(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 $e=function(){return{prefixCls:String,bordered:{type:Boolean,default:void 0},size:{type:String,default:"default"},title:E.any,extra:E.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"),w=te({compatConfig:{MODE:3},name:"ADescriptions",props:$e(),slots:["title","extra"],Item:he,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:W(e,"labelStyle"),contentStyle:W(e,"contentStyle")});var i=ye(function(){return we(e.column,c.value)});return function(){var s,S,v,d,b=e.size,$=e.bordered,I=$===void 0?!1:$,C=e.layout,x=C===void 0?"horizontal":C,O=e.colon,L=O===void 0?!0:O,k=e.title,g=k===void 0?(s=t.title)===null||s===void 0?void 0:s.call(t):k,P=e.extra,f=P===void 0?(S=t.extra)===null||S===void 0?void 0:S.call(t):P,j=(v=t.default)===null||v===void 0?void 0:v.call(t),h=_e(j,i.value);return a("div",{class:[o.value,(d={},_(d,"".concat(o.value,"-").concat(b),b!=="default"),_(d,"".concat(o.value,"-bordered"),!!I),_(d,"".concat(o.value,"-rtl"),u.value==="rtl"),d)]},[(g||f)&&a("div",{class:"".concat(o.value,"-header")},[g&&a("div",{class:"".concat(o.value,"-title")},[g]),f&&a("div",{class:"".concat(o.value,"-extra")},[f])]),a("div",{class:"".concat(o.value,"-view")},[a("table",null,[a("tbody",null,[h.map(function(D,y){return a(xe,{key:y,index:y,colon:L,prefixCls:o.value,vertical:x==="vertical",bordered:I,row:D},null)})])])])])}}});w.install=function(l){return l.component(w.name,w),l.component(w.Item.name,w.Item),l};const Ie=w;export{he as D,Ie as _};