Files
aiot-platform-ui/apps/web-antd/dist/js/index-BNS265yo.js
lzh 19d36d1ffb
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-09 13:05:46 +08:00

2 lines
2.1 KiB
JavaScript

import{I as V,P as O,t as j,y as k,J,L as M,h as W,_ as m,N as q,j as G,O as h}from"./bootstrap-CRjSNGHY.js";import{m as H,aa as i,b9 as B,w as K,j as p,I as Q}from"../jse/index-index-CMeVxoEG.js";const U={small:8,middle:16,large:24},X=()=>({prefixCls:String,size:{type:[String,Number,Array]},direction:O.oneOf(j("horizontal","vertical")).def("horizontal"),align:O.oneOf(j("start","end","center","baseline")),wrap:V()});function Y(e){return typeof e=="string"?U[e]:e||0}const d=H({compatConfig:{MODE:3},name:"ASpace",inheritAttrs:!1,props:X(),slots:Object,setup(e,F){let{slots:o,attrs:f}=F;const{prefixCls:l,space:g,direction:x}=k("space",e),[P,D]=J(l),z=M(),n=i(()=>{var a,t,s;return(s=(a=e.size)!==null&&a!==void 0?a:(t=g==null?void 0:g.value)===null||t===void 0?void 0:t.size)!==null&&s!==void 0?s:"small"}),y=B(),r=B();K(n,()=>{[y.value,r.value]=(Array.isArray(n.value)?n.value:[n.value,n.value]).map(a=>Y(a))},{immediate:!0});const b=i(()=>e.align===void 0&&e.direction==="horizontal"?"center":e.align),E=i(()=>W(l.value,D.value,`${l.value}-${e.direction}`,{[`${l.value}-rtl`]:x.value==="rtl",[`${l.value}-align-${b.value}`]:b.value})),L=i(()=>x.value==="rtl"?"marginLeft":"marginRight"),R=i(()=>{const a={};return z.value&&(a.columnGap=`${y.value}px`,a.rowGap=`${r.value}px`),m(m({},a),e.wrap&&{flexWrap:"wrap",marginBottom:`${-r.value}px`})});return()=>{var a,t;const{wrap:s,direction:T="horizontal"}=e,C=(a=o.default)===null||a===void 0?void 0:a.call(o),w=q(C),_=w.length;if(_===0)return null;const c=(t=o.split)===null||t===void 0?void 0:t.call(o),A=`${l.value}-item`,I=y.value,S=_-1;return p("div",G(G({},f),{},{class:[E.value,f.class],style:[R.value,f.style]}),[w.map((N,u)=>{let $=C.indexOf(N);$===-1&&($=`$$space-${u}`);let v={};return z.value||(T==="vertical"?u<S&&(v={marginBottom:`${I/(c?2:1)}px`}):v=m(m({},u<S&&{[L.value]:`${I/(c?2:1)}px`}),s&&{paddingBottom:`${r.value}px`})),P(p(Q,{key:$},[p("div",{class:A,style:v},[N]),u<S&&c&&p("span",{class:`${A}-split`,style:v},[c])]))})])}}});d.Compact=h;d.install=function(e){return e.component(d.name,d),e.component(h.name,h),e};export{h as Compact,d as default,X as spaceProps};