var I=Object.defineProperty;var _=Object.getOwnPropertySymbols;var J=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var L=(s,n,i)=>n in s?I(s,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[n]=i,a=(s,n)=>{for(var i in n||(n={}))J.call(n,i)&&L(s,i,n[i]);if(_)for(var i of _(n))Q.call(n,i)&&L(s,i,n[i]);return s};(function(s,n){typeof exports=="object"&&typeof module!="undefined"?n(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],n):(s=typeof globalThis!="undefined"?globalThis:s||self,n(s.index={},s.Vue))})(this,function(s,n){"use strict";const i={align:{type:String,default:"top"},gutter:{type:[Number,Object,Array],default:0},justify:{type:String,default:"start"},wrap:{type:Boolean,default:!1}},b=Number,B={flex:[String,Number],order:b},w={offset:b,pull:b,push:b,span:b},d=[Number,Object],x={xs:d,sm:d,md:d,lg:d,xl:d,xxl:d},O=a(a(a({},B),w),x),A=["xxl","xl","lg","md","sm","xs"],C={xs:"screen and (max-width: 575px)",sm:"screen and (min-width: 576px)",md:"screen and (min-width: 768px)",lg:"screen and (min-width: 992px)",xl:"screen and (min-width: 1200px)",xxl:"screen and (min-width: 1600px)"},f=new Map;let j=-1;const y={},R={};function z(){f.forEach(e=>{e(a({},y))})}function U(){Object.keys(C).forEach(e=>{const c=window.matchMedia(C[e]);c.matches&&(y[e]=!0,z());const r=u=>{y[e]=u.matches,z()};c.addEventListener("change",r),R[e]={res:c,listener:r}})}function V(e){return f.size||U(),j+=1,f.set(j,e),e(a({},y)),j}function D(){Object.keys(C).forEach(e=>{const c=R[e];c.res.removeEventListener("change",c.listener)}),f.clear()}function G(e){f.delete(e),f.size===0&&D()}function h(e,c,r){let u=e;return c&&(u+=`__${c}`),r&&(u+=`--${r}`),u}function N(e,c=!1){const r=c?`.devui-${e}`:`devui-${e}`;return{b:()=>h(r),e:t=>t?h(r,t):"",m:t=>t?h(r,"",t):"",em:(t,o)=>t&&o?h(r,t,o):""}}var W="",v=n.defineComponent({name:"DRow",props:i,emits:[],setup(e,{slots:c}){const r=n.ref({}),u=N("row"),l=n.computed(()=>({[u.em("align",e.align)]:!0,[u.em("justify",e.justify)]:!0,[u.e("wrap")]:e.wrap}));let p;n.onMounted(()=>{p=V(t=>{r.value=t})}),n.onUnmounted(()=>{G(p)});const g=n.computed(()=>{if(!e.gutter)return{};let t=[0,0];Array.isArray(e.gutter)?t=e.gutter:typeof e.gutter=="number"?t=[e.gutter,0]:A.some(T=>{const $=e.gutter[T];return r.value[T]&&$?(typeof $=="number"?t=[$,0]:t=$,!0):!1});const o=`${(t[0]||0)/2}px`,M=`${(t[0]||0)/2}px`,S=`${(t[1]||0)/2}px`,H=`${(t[1]||0)/2}px`;return{paddingLeft:o,paddingRight:M,paddingTop:S,paddingBottom:H}});return n.provide("gutterStyle",g),()=>{var t;return n.createVNode("div",{class:[u.b(),l.value]},[(t=c.default)==null?void 0:t.call(c)])}}});const m=N("col");function K(e){return n.computed(()=>({[m.em("span",e.span?String(e.span):"")]:!0,[m.em("offset",e.offset?String(e.offset):"")]:!0,[m.em("pull",e.pull?String(e.pull):"")]:!0,[m.em("push",e.push?String(e.push):"")]:!0}))}function P(e){return` ${e.trim()}${e&&" "}`}function q(e){const c=Object.keys(e).filter(r=>r in x);return n.computed(()=>c.reduce((r,u)=>{const l=typeof e[u];if(l==="number")r=`${P(r)}${m.em(u,`span-${e[u]}`)}`;else if(l==="object"){const g=Object.keys(e[u]).filter(t=>t in w).reduce((t,o)=>{const S=e[u][o];return typeof S!="number"?"":(t=`${P(t)}${m.em(u,`${o}-${S}`)}`,t)},"");r=`${P(r)}${g}`}return r},""))}var X="",E=n.defineComponent({name:"DCol",props:O,setup(e,{slots:c}){const r=N("col"),u=o=>typeof o=="number"?`${o} ${o} auto`:/^\d+(\.\d+)?(px|rem|em|%)$/.test(o)?`0 0 ${o}`:o,l=K(e),p=q(e),g=n.computed(()=>({flex:u(e.flex),order:e.order})),t=n.inject("gutterStyle");return()=>{var o;return n.createVNode("div",{class:[r.b(),l.value,p.value],style:a(a({},g.value),t==null?void 0:t.value)},[(o=c.default)==null?void 0:o.call(c)])}}}),F={title:"Grid \u6805\u683C",category:"\u5E03\u5C40",status:"100%",install(e){e.component(v.name,v),e.component(E.name,E)}};s.Col=E,s.Row=v,s.colProps=O,s.colPropsBaseClass=w,s.colPropsBaseStyle=B,s.default=F,s.rowProps=i,s.screenSizes=x,Object.defineProperty(s,"__esModule",{value:!0}),s[Symbol.toStringTag]="Module"});
