up
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
import{Mt as e,U as t,bt as n,g as r,kt as i,mt as a,p as o,st as s}from"./client-Bz0sY7Lm.js";import{a as c,i as l}from"./es-C-wSTr3U.js";import{a as u}from"./Button-DwmXaCmd.js";import{t as d}from"./flatten-WgHPAFED.js";import{t as f}from"./get-slot-6kXJmSMP.js";import{h as p}from"./index-BR5amvMQ.js";function m(){return p}var h={name:`Space`,self:m},g;function _(){if(!u)return!0;if(g===void 0){let e=document.createElement(`div`);e.style.display=`flex`,e.style.flexDirection=`column`,e.style.rowGap=`1px`,e.appendChild(document.createElement(`div`)),e.appendChild(document.createElement(`div`)),document.body.appendChild(e);let t=e.scrollHeight===1;return document.body.removeChild(e),g=t}return g}var v=i({name:`Space`,props:Object.assign(Object.assign({},o.props),{align:String,justify:{type:String,default:`start`},inline:Boolean,vertical:Boolean,reverse:Boolean,size:[String,Number,Array],wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),setup(e){let{mergedClsPrefixRef:i,mergedRtlRef:a,mergedComponentPropsRef:u}=t(e),d=n(()=>e.size||u?.value?.Space?.size||`medium`),f=o(`Space`,`-space`,void 0,h,e,i),p=r(`Space`,a,i);return{useGap:_(),rtlEnabled:p,mergedClsPrefix:i,margin:n(()=>{let e=d.value;if(Array.isArray(e))return{horizontal:e[0],vertical:e[1]};if(typeof e==`number`)return{horizontal:e,vertical:e};let{self:{[s(`gap`,e)]:t}}=f.value,{row:n,col:r}=c(t);return{horizontal:l(r),vertical:l(n)}})}},render(){let{vertical:t,reverse:n,align:r,inline:i,justify:o,itemClass:s,itemStyle:c,margin:l,wrap:u,mergedClsPrefix:p,rtlEnabled:m,useGap:h,wrapItem:g,internalUseGap:_}=this,v=d(f(this),!1);if(!v.length)return null;let y=`${l.horizontal}px`,b=`${l.horizontal/2}px`,x=`${l.vertical}px`,S=`${l.vertical/2}px`,C=v.length-1,w=o.startsWith(`space-`);return e(`div`,{role:`none`,class:[`${p}-space`,m&&`${p}-space--rtl`],style:{display:i?`inline-flex`:`flex`,flexDirection:t&&!n?`column`:t&&n?`column-reverse`:!t&&n?`row-reverse`:`row`,justifyContent:[`start`,`end`].includes(o)?`flex-${o}`:o,flexWrap:!u||t?`nowrap`:`wrap`,marginTop:h||t?``:`-${S}`,marginBottom:h||t?``:`-${S}`,alignItems:r,gap:h?`${l.vertical}px ${l.horizontal}px`:``}},!g&&(h||_)?v:v.map((n,r)=>n.type===a?n:e(`div`,{role:`none`,class:s,style:[c,{maxWidth:`100%`},h?``:t?{marginBottom:r===C?``:x}:m?{marginLeft:w?o===`space-between`&&r===C?``:b:r===C?``:y,marginRight:w?o===`space-between`&&r===0?``:b:``,paddingTop:S,paddingBottom:S}:{marginRight:w?o===`space-between`&&r===C?``:b:r===C?``:y,marginLeft:w?o===`space-between`&&r===0?``:b:``,paddingTop:S,paddingBottom:S}]},n)))}});export{v as t};
|
||||
Reference in New Issue
Block a user