lcny-vue3-antd-admin/dist/assets/index.c83208a8.js

2 lines
7.9 KiB
JavaScript

var pe=Object.defineProperty,ve=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var oe=(t,e,n)=>e in t?pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,P=(t,e)=>{for(var n in e||(e={}))me.call(e,n)&&oe(t,n,e[n]);if(le)for(var n of le(e))be.call(e,n)&&oe(t,n,e[n]);return t},T=(t,e)=>ve(t,ye(e));import{p as a,V as M,Z as Se,r as N,F as Ce,dC as ge,g3 as xe,g4 as he,_ as w,ai as z,a as q,a3 as Pe,bp as we,au as ae,Q as ue,af as $e,$ as _e,bD as re,f as k,av as se,aI as De,cl as je,as as Oe,b as Ie,dP as Ee,k as p,aB as ke,dc as Le,g5 as Me,cB as Ne,az as Q,bc as Re,ax as Be,de as Ae,L as ze}from"./index.6f10b46a.js";import{g as Fe}from"./get.de375d54.js";function A(t){return t!=null}var Ue=function(e){var n=e.itemPrefixCls,l=e.component,r=e.span,o=e.labelStyle,c=e.contentStyle,y=e.bordered,i=e.label,d=e.content,u=e.colon,$=l;if(y){var x;return a($,{class:[(x={},M(x,"".concat(n,"-item-label"),A(i)),M(x,"".concat(n,"-item-content"),A(d)),x)],colSpan:r},{default:function(){return[A(i)&&a("span",{style:o},[i]),A(d)&&a("span",{style:c},[d])]}})}return a($,{class:["".concat(n,"-item")],colSpan:r},{default:function(){return[a("div",{class:"".concat(n,"-item-container")},[i&&a("span",{class:["".concat(n,"-item-label"),M({},"".concat(n,"-item-no-colon"),!u)],style:o},[i]),d&&a("span",{class:"".concat(n,"-item-content"),style:c},[d])])]}})},Z=Ue,Ve=function(e){var n=function(x,m,b){var E=m.colon,R=m.prefixCls,s=m.bordered,S=b.component,v=b.type,h=b.showLabel,D=b.showContent,j=b.labelStyle,_=b.contentStyle;return x.map(function(C,O){var I,g,f=C.props||{},B=f.prefixCls,F=B===void 0?R:B,G=f.span,H=G===void 0?1:G,J=f.labelStyle,K=J===void 0?f["label-style"]:J,X=f.contentStyle,Y=X===void 0?f["content-style"]:X,ee=f.label,te=ee===void 0?(I=C.children)===null||I===void 0||(g=I.label)===null||g===void 0?void 0:g.call(I):ee,ne=ge(C),U=xe(C),V=he(C),W=C.key;return typeof S=="string"?a(Z,{key:"".concat(v,"-").concat(String(W)||O),class:U,style:V,labelStyle:w(w({},j),K),contentStyle:w(w({},_),Y),span:H,colon:E,component:S,itemPrefixCls:F,bordered:s,label:h?te:null,content:D?ne:null},null):[a(Z,{key:"label-".concat(String(W)||O),class:U,style:w(w(w({},j),V),K),span:1,colon:E,component:S[0],itemPrefixCls:F,bordered:s,label:te},null),a(Z,{key:"content-".concat(String(W)||O),class:U,style:w(w(w({},_),V),Y),span:H*2-1,component:S[1],itemPrefixCls:F,bordered:s,content:ne},null)]})},l=e.prefixCls,r=e.vertical,o=e.row,c=e.index,y=e.bordered,i=Se(fe,{labelStyle:N({}),contentStyle:N({})}),d=i.labelStyle,u=i.contentStyle;return r?a(Ce,null,[a("tr",{key:"label-".concat(c),class:"".concat(l,"-row")},[n(o,e,{component:"th",type:"label",showLabel:!0,labelStyle:d.value,contentStyle:u.value})]),a("tr",{key:"content-".concat(c),class:"".concat(l,"-row")},[n(o,e,{component:"td",type:"content",showContent:!0,labelStyle:d.value,contentStyle:u.value})])]):a("tr",{key:c,class:"".concat(l,"-row")},[n(o,e,{component:y?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0,labelStyle:d.value,contentStyle:u.value})])},We=Ve;z.any;var Te=function(){return{prefixCls:String,label:z.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}}},Qe=q({compatConfig:{MODE:3},name:"ADescriptionsItem",props:Te(),slots:["label"],setup:function(e,n){var l=n.slots;return function(){var r;return(r=l.default)===null||r===void 0?void 0:r.call(l)}}}),de={xxxl:3,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function Ze(t,e){if(typeof t=="number")return t;if(ue(t)==="object")for(var n=0;n<se.length;n++){var l=se[n];if(e[l]&&t[l]!==void 0)return t[l]||de[l]}return 3}function ce(t,e,n){var l=t;return(e===void 0||e>n)&&(l=je(t,{span:n}),Oe(e===void 0,"Descriptions","Sum of column `span` in a line not match `column` of Descriptions.")),l}function qe(t,e){var n=De(t),l=[],r=[],o=e;return n.forEach(function(c,y){var i,d=(i=c.props)===null||i===void 0?void 0:i.span,u=d||1;if(y===n.length-1){r.push(ce(c,d,o)),l.push(r);return}u<o?(o-=u,r.push(c)):(r.push(ce(c,u,o)),l.push(r),o=e,r=[])}),l}var Ge=function(){return{prefixCls:String,bordered:{type:Boolean,default:void 0},size:{type:String,default:"default"},title:z.any,extra:z.any,column:{type:[Number,Object],default:function(){return de}},layout:String,colon:{type:Boolean,default:void 0},labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0}}},fe=Symbol("descriptionsContext"),L=q({compatConfig:{MODE:3},name:"ADescriptions",props:Ge(),slots:["title","extra"],Item:Qe,setup:function(e,n){var l=n.slots,r=Pe("descriptions",e),o=r.prefixCls,c=r.direction,y,i=N({});we(function(){y=ae.subscribe(function(u){ue(e.column)==="object"&&(i.value=u)})}),$e(function(){ae.unsubscribe(y)}),_e(fe,{labelStyle:re(e,"labelStyle"),contentStyle:re(e,"contentStyle")});var d=k(function(){return Ze(e.column,i.value)});return function(){var u,$,x,m,b=e.size,E=e.bordered,R=E===void 0?!1:E,s=e.layout,S=s===void 0?"horizontal":s,v=e.colon,h=v===void 0?!0:v,D=e.title,j=D===void 0?(u=l.title)===null||u===void 0?void 0:u.call(l):D,_=e.extra,C=_===void 0?($=l.extra)===null||$===void 0?void 0:$.call(l):_,O=(x=l.default)===null||x===void 0?void 0:x.call(l),I=qe(O,d.value);return a("div",{class:[o.value,(m={},M(m,"".concat(o.value,"-").concat(b),b!=="default"),M(m,"".concat(o.value,"-bordered"),!!R),M(m,"".concat(o.value,"-rtl"),c.value==="rtl"),m)]},[(j||C)&&a("div",{class:"".concat(o.value,"-header")},[j&&a("div",{class:"".concat(o.value,"-title")},[j]),C&&a("div",{class:"".concat(o.value,"-extra")},[C])]),a("div",{class:"".concat(o.value,"-view")},[a("table",null,[a("tbody",null,[I.map(function(g,f){return a(We,{key:f,index:f,colon:h,prefixCls:o.value,vertical:S==="vertical",bordered:R,row:g},null)})])])])])}}});L.install=function(t){return t.component(L.name,L),t.component(L.Item.name,L.Item),t};var ie=L;function He(t){return typeof t=="function"||Object.prototype.toString.call(t)==="[object Object]"&&!Ne(t)}const Je={useCollapse:{type:Boolean,default:!0},title:{type:String,default:""},size:{type:String,validator:t=>["small","default","middle",void 0].includes(t),default:"small"},bordered:{type:Boolean,default:!0},column:{type:[Number,Object],default:()=>({xxl:4,xl:3,lg:3,md:3,sm:2,xs:1})},collapseOptions:{type:Object,default:null},schema:{type:Array,default:()=>[]},data:{type:Object}};var Ke=q({name:"Description",props:Je,emits:["register"],setup(t,{slots:e,emit:n}){const l=N(null),{prefixCls:r}=Ie("description"),o=Ee(),c=k(()=>P(P({},t),p(l))),y=k(()=>T(P({},p(c)),{title:void 0})),i=k(()=>!!p(c).title),d=k(()=>P({canExpand:!1},p(y).collapseOptions)),u=k(()=>P(P({},p(o)),p(y)));function $(s){l.value=P(P({},p(l)),s)}function x({label:s,labelMinWidth:S,labelStyle:v}){if(!v&&!S)return s;const h=T(P({},v),{minWidth:`${S}px `});return a("div",{style:h},[s])}function m(){const{schema:s,data:S}=p(y);return p(s).map(v=>{const{render:h,field:D,span:j,show:_,contentMinWidth:C}=v;if(_&&Q(_)&&!_(S))return null;const O=()=>{var B;const g=(B=p(y))==null?void 0:B.data;if(!g)return null;const f=Fe(g,D);return f&&!Re(g).hasOwnProperty(D)?Q(h)?h("",g):"":Q(h)?h(f,g):f!=null?f:""},I=C;return a(ie.Item,{label:x(v),key:D,span:j},{default:()=>{if(!C)return O();const g={minWidth:`${I}px`};return a("div",{style:g},[O()])}})}).filter(v=>!!v)}const b=()=>{let s;return a(ie,ke({class:`${r}`},p(u)),He(s=m())?s:{default:()=>[s]})},E=()=>{const s=t.useCollapse?b():a("div",null,[b()]);if(!t.useCollapse)return s;const{canExpand:S,helpMessage:v}=p(d),{title:h}=p(c);return a(Me,{title:h,canExpan:S,helpMessage:v},{default:()=>s,action:()=>Le(e,"action")})};return n("register",{setDescProps:$}),()=>p(i)?E():b()}});function tt(t){if(!Be())throw new Error("useDescription() can only be used inside setup() or functional components!");const e=N(null),n=N(!1);function l(o){p(n)&&Ae()||(e.value=o,t&&o.setDescProps(t),n.value=!0)}return[l,{setDescProps:o=>{var c;(c=p(e))==null||c.setDescProps(o)}}]}const nt=ze(Ke);export{nt as D,tt as u};