@squirrel-cloud/ui-vue 0.2.2 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function(k,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],i):(k=typeof globalThis<"u"?globalThis:k||self,i(k.SquirrelCloudUIVue={},k.Vue))})(this,(function(k,i){"use strict";const qt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},Nt={},Ft={class:"sq-icon is-loading","data-icon":"loading"};function It(t,e){return i.openBlock(),i.createElementBlock("span",Ft,e[0]||(e[0]=[i.createElementVNode("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[i.createElementVNode("circle",{cx:"24",cy:"24",r:"20"})],-1)]))}const Wt=qt(Nt,[["render",It]]),Ht=["disabled"],jt=i.defineComponent({__name:"SqButton",props:{type:{},round:{type:Boolean},text:{type:Boolean},icon:{},loading:{type:Boolean},disabled:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=i.computed(()=>{const r=[];return e.size!=="md"&&r.push(`sq-button--${e.size}`),e.type&&r.push(`is-${e.type}`),e.round&&r.push("is-round"),e.text&&r.push("is-text"),r}),o=i.computed(()=>e.loading?Wt:e.icon),s=i.computed(()=>e.loading||e.disabled);return(r,l)=>(i.openBlock(),i.createElementBlock("button",{class:i.normalizeClass(["sq-button",n.value]),disabled:s.value},[i.createVNode(i.unref(rt),{size:e.size},{default:i.withCtx(()=>[o.value?(i.openBlock(),i.createBlock(i.resolveDynamicComponent(o.value),{key:0})):i.createCommentVNode("",!0),i.renderSlot(r.$slots,"default")]),_:3},8,["size"])],10,Ht))}}),Xt={class:"sq-card"},Ut={key:0,class:"sq-card-header"},Yt=["textContent"],Kt={key:1,class:"sq-card-footer"},Gt=i.defineComponent({__name:"SqCard",props:{title:{},decorative:{type:Boolean,default:!1}},setup(t){const e=i.useSlots(),n=t;return(o,s)=>(i.openBlock(),i.createElementBlock("div",Xt,[n.title||i.unref(e).title?(i.openBlock(),i.createElementBlock("div",Ut,[i.createElementVNode("h2",{class:i.normalizeClass({"has-decorative":n.decorative}),textContent:i.toDisplayString(n.title)},null,10,Yt),i.renderSlot(o.$slots,"title")])):i.createCommentVNode("",!0),i.renderSlot(o.$slots,"default"),i.unref(e).footer?(i.openBlock(),i.createElementBlock("div",Kt,[i.renderSlot(o.$slots,"footer")])):i.createCommentVNode("",!0)]))}}),Jt={key:0,class:"sq-input-prefix"},Qt=["disabled","readonly"],Zt={key:1,class:"sq-input-suffix"},te=i.defineComponent({__name:"SqInput",props:i.mergeModels({status:{},round:{type:Boolean},showStatusIcon:{type:Boolean},prefixIcon:{},suffixIcon:{},disabled:{type:Boolean},readonly:{type:Boolean},size:{default:"md"}},{value:{type:String,default:""},valueModifiers:{}}),emits:i.mergeModels(["focus","blur","input","change"],["update:value"]),setup(t,{expose:e,emit:n}){const o=i.useSlots(),s=n,r=t,l=i.useModel(t,"value"),c=i.useTemplateRef("inputRef"),f=i.computed(()=>{const m=[];return r.size!=="md"&&m.push(`sq-input--${r.size}`),r.status&&m.push(`is-${r.status}`),r.round&&m.push("is-round"),r.disabled&&m.push("is-disabled"),m}),a=i.computed(()=>o.prefix||r.prefixIcon),u=i.computed(()=>{const m=r.showStatusIcon&&r.status;return o.suffix||m||r.suffixIcon}),d=i.computed(()=>r.suffixIcon);function h(){var m;(m=c.value)==null||m.focus()}function p(){var m;(m=c.value)==null||m.blur()}return e({focus:h,blur:p}),(m,g)=>(i.openBlock(),i.createElementBlock("section",{class:i.normalizeClass(["sq-input",f.value])},[a.value?(i.openBlock(),i.createElementBlock("span",Jt,[i.renderSlot(m.$slots,"prefix",{},()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r.prefixIcon)))])])):i.createCommentVNode("",!0),i.withDirectives(i.createElementVNode("input",{"onUpdate:modelValue":g[0]||(g[0]=y=>l.value=y),class:"sq-input-inner",disabled:r.disabled,readonly:r.readonly,ref_key:"inputRef",ref:c,onFocus:g[1]||(g[1]=y=>s("focus",y)),onBlur:g[2]||(g[2]=y=>s("blur",y)),onInput:g[3]||(g[3]=y=>s("input",y)),onChange:g[4]||(g[4]=y=>s("change",y))},null,40,Qt),[[i.vModelText,l.value]]),u.value?(i.openBlock(),i.createElementBlock("span",Zt,[i.renderSlot(m.$slots,"suffix",{},()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(d.value)))])])):i.createCommentVNode("",!0)],2))}}),lt=Math.min,I=Math.max,J=Math.round,Q=Math.floor,O=t=>({x:t,y:t}),ee={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"};function ct(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function oe(t){return t==="x"?"y":"x"}function yt(t){return t==="y"?"height":"width"}const ie=new Set(["top","bottom"]);function V(t){return ie.has(W(t))?"y":"x"}function wt(t){return oe(V(t))}function se(t,e,n){n===void 0&&(n=!1);const o=Z(t),s=wt(t),r=yt(s);let l=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=tt(l)),[l,tt(l)]}function re(t){const e=tt(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>ne[e])}const xt=["left","right"],bt=["right","left"],le=["top","bottom"],ce=["bottom","top"];function ae(t,e,n){switch(t){case"top":case"bottom":return n?e?bt:xt:e?xt:bt;case"left":case"right":return e?le:ce;default:return[]}}function fe(t,e,n,o){const s=Z(t);let r=ae(W(t),n==="start",o);return s&&(r=r.map(l=>l+"-"+s),e&&(r=r.concat(r.map(at)))),r}function tt(t){return t.replace(/left|right|bottom|top/g,e=>ee[e])}function ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function de(t){return typeof t!="number"?ue(t):{top:t,right:t,bottom:t,left:t}}function et(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function St(t,e,n){let{reference:o,floating:s}=t;const r=V(e),l=wt(e),c=yt(l),f=W(e),a=r==="y",u=o.x+o.width/2-s.width/2,d=o.y+o.height/2-s.height/2,h=o[c]/2-s[c]/2;let p;switch(f){case"top":p={x:u,y:o.y-s.height};break;case"bottom":p={x:u,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:d};break;case"left":p={x:o.x-s.width,y:d};break;default:p={x:o.x,y:o.y}}switch(Z(e)){case"start":p[l]-=h*(n&&a?-1:1);break;case"end":p[l]+=h*(n&&a?-1:1);break}return p}const pe=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:r=[],platform:l}=n,c=r.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:s}),{x:u,y:d}=St(a,o,f),h=o,p={},m=0;for(let g=0;g<c.length;g++){const{name:y,fn:w}=c[g],{x,y:S,data:R,reset:C}=await w({x:u,y:d,initialPlacement:o,placement:h,strategy:s,middlewareData:p,rects:a,platform:l,elements:{reference:t,floating:e}});u=x??u,d=S??d,p={...p,[y]:{...p[y],...R}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(a=C.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:s}):C.rects),{x:u,y:d}=St(a,h,f)),g=-1)}return{x:u,y:d,placement:h,strategy:s,middlewareData:p}};async function me(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:r,rects:l,elements:c,strategy:f}=t,{boundary:a="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:p=0}=ct(e,t),m=de(p),y=c[h?d==="floating"?"reference":"floating":d],w=et(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:u,strategy:f})),x=d==="floating"?{x:o,y:s,width:l.floating.width,height:l.floating.height}:l.reference,S=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),R=await(r.isElement==null?void 0:r.isElement(S))?await(r.getScale==null?void 0:r.getScale(S))||{x:1,y:1}:{x:1,y:1},C=et(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:S,strategy:f}):x);return{top:(w.top-C.top+m.top)/R.y,bottom:(C.bottom-w.bottom+m.bottom)/R.y,left:(w.left-C.left+m.left)/R.x,right:(C.right-w.right+m.right)/R.x}}const he=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:r,rects:l,initialPlacement:c,platform:f,elements:a}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=ct(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=W(s),x=V(c),S=W(c)===c,R=await(f.isRTL==null?void 0:f.isRTL(a.floating)),C=h||(S||!g?[tt(c)]:re(c)),P=m!=="none";!h&&P&&C.push(...fe(c,g,m,R));const b=[c,...C],v=await me(e,y),q=[];let X=((o=r.flip)==null?void 0:o.overflows)||[];if(u&&q.push(v[w]),d){const N=se(s,l,R);q.push(v[N[0]],v[N[1]])}if(X=[...X,{placement:s,overflows:q}],!q.every(N=>N<=0)){var Dt,Mt;const N=(((Dt=r.flip)==null?void 0:Dt.index)||0)+1,gt=b[N];if(gt&&(!(d==="alignment"?x!==V(gt):!1)||X.every(L=>V(L.placement)===x?L.overflows[0]>0:!0)))return{data:{index:N,overflows:X},reset:{placement:gt}};let G=(Mt=X.filter(F=>F.overflows[0]<=0).sort((F,L)=>F.overflows[1]-L.overflows[1])[0])==null?void 0:Mt.placement;if(!G)switch(p){case"bestFit":{var Pt;const F=(Pt=X.filter(L=>{if(P){const z=V(L.placement);return z===x||z==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(z=>z>0).reduce((z,tn)=>z+tn,0)]).sort((L,z)=>L[1]-z[1])[0])==null?void 0:Pt[0];F&&(G=F);break}case"initialPlacement":G=c;break}if(s!==G)return{reset:{placement:G}}}return{}}}},ge=new Set(["left","top"]);async function ye(t,e){const{placement:n,platform:o,elements:s}=t,r=await(o.isRTL==null?void 0:o.isRTL(s.floating)),l=W(n),c=Z(n),f=V(n)==="y",a=ge.has(l)?-1:1,u=r&&f?-1:1,d=ct(e,t);let{mainAxis:h,crossAxis:p,alignmentAxis:m}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof m=="number"&&(p=c==="end"?m*-1:m),f?{x:p*u,y:h*a}:{x:h*a,y:p*u}}const we=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:r,placement:l,middlewareData:c}=e,f=await ye(e,t);return l===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+f.x,y:r+f.y,data:{...f,placement:l}}}}};function nt(){return typeof window<"u"}function D(t){return ft(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function A(t){var e;return(e=(ft(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ft(t){return nt()?t instanceof Node||t instanceof B(t).Node:!1}function E(t){return nt()?t instanceof Element||t instanceof B(t).Element:!1}function _(t){return nt()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Ct(t){return!nt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const xe=new Set(["inline","contents"]);function U(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=T(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!xe.has(s)}const be=new Set(["table","td","th"]);function Se(t){return be.has(D(t))}const Ce=[":popover-open",":modal"];function ot(t){return Ce.some(e=>{try{return t.matches(e)}catch{return!1}})}const Re=["transform","translate","scale","rotate","perspective"],ke=["transform","translate","scale","rotate","perspective","filter"],Be=["paint","layout","strict","content"];function ut(t){const e=dt(),n=E(t)?T(t):t;return Re.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||ke.some(o=>(n.willChange||"").includes(o))||Be.some(o=>(n.contain||"").includes(o))}function ve(t){let e=$(t);for(;_(e)&&!H(e);){if(ut(e))return e;if(ot(e))return null;e=$(e)}return null}function dt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ee=new Set(["html","body","#document"]);function H(t){return Ee.has(D(t))}function T(t){return B(t).getComputedStyle(t)}function it(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(D(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ct(t)&&t.host||A(t);return Ct(e)?e.host:e}function Rt(t){const e=$(t);return H(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&U(e)?e:Rt(e)}function Y(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=Rt(t),r=s===((o=t.ownerDocument)==null?void 0:o.body),l=B(s);if(r){const c=pt(l);return e.concat(l,l.visualViewport||[],U(s)?s:[],c&&n?Y(c):[])}return e.concat(s,Y(s,[],n))}function pt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function kt(t){const e=T(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=_(t),r=s?t.offsetWidth:n,l=s?t.offsetHeight:o,c=J(n)!==r||J(o)!==l;return c&&(n=r,o=l),{width:n,height:o,$:c}}function mt(t){return E(t)?t:t.contextElement}function j(t){const e=mt(t);if(!_(e))return O(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:r}=kt(e);let l=(r?J(n.width):n.width)/o,c=(r?J(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Te=O(0);function Bt(t){const e=B(t);return!dt()||!e.visualViewport?Te:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Le(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),r=mt(t);let l=O(1);e&&(o?E(o)&&(l=j(o)):l=j(t));const c=Le(r,n,o)?Bt(r):O(0);let f=(s.left+c.x)/l.x,a=(s.top+c.y)/l.y,u=s.width/l.x,d=s.height/l.y;if(r){const h=B(r),p=o&&E(o)?B(o):o;let m=h,g=pt(m);for(;g&&o&&p!==m;){const y=j(g),w=g.getBoundingClientRect(),x=T(g),S=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,R=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;f*=y.x,a*=y.y,u*=y.x,d*=y.y,f+=S,a+=R,m=B(g),g=pt(m)}}return et({width:u,height:d,x:f,y:a})}function st(t,e){const n=it(t).scrollLeft;return e?e.left+n:M(A(t)).left+n}function vt(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-st(t,n),s=n.top+e.scrollTop;return{x:o,y:s}}function Oe(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const r=s==="fixed",l=A(o),c=e?ot(e.floating):!1;if(o===l||c&&r)return n;let f={scrollLeft:0,scrollTop:0},a=O(1);const u=O(0),d=_(o);if((d||!d&&!r)&&((D(o)!=="body"||U(l))&&(f=it(o)),_(o))){const p=M(o);a=j(o),u.x=p.x+o.clientLeft,u.y=p.y+o.clientTop}const h=l&&!d&&!r?vt(l,f):O(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-f.scrollLeft*a.x+u.x+h.x,y:n.y*a.y-f.scrollTop*a.y+u.y+h.y}}function Ae(t){return Array.from(t.getClientRects())}function _e(t){const e=A(t),n=it(t),o=t.ownerDocument.body,s=I(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=I(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+st(t);const c=-n.scrollTop;return T(o).direction==="rtl"&&(l+=I(e.clientWidth,o.clientWidth)-s),{width:s,height:r,x:l,y:c}}const Et=25;function $e(t,e){const n=B(t),o=A(t),s=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,f=0;if(s){r=s.width,l=s.height;const u=dt();(!u||u&&e==="fixed")&&(c=s.offsetLeft,f=s.offsetTop)}const a=st(o);if(a<=0){const u=o.ownerDocument,d=u.body,h=getComputedStyle(d),p=u.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-d.clientWidth-p);m<=Et&&(r-=m)}else a<=Et&&(r+=a);return{width:r,height:l,x:c,y:f}}const ze=new Set(["absolute","fixed"]);function Ve(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,r=_(t)?j(t):O(1),l=t.clientWidth*r.x,c=t.clientHeight*r.y,f=s*r.x,a=o*r.y;return{width:l,height:c,x:f,y:a}}function Tt(t,e,n){let o;if(e==="viewport")o=$e(t,n);else if(e==="document")o=_e(A(t));else if(E(e))o=Ve(e,n);else{const s=Bt(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return et(o)}function Lt(t,e){const n=$(t);return n===e||!E(n)||H(n)?!1:T(n).position==="fixed"||Lt(n,e)}function De(t,e){const n=e.get(t);if(n)return n;let o=Y(t,[],!1).filter(c=>E(c)&&D(c)!=="body"),s=null;const r=T(t).position==="fixed";let l=r?$(t):t;for(;E(l)&&!H(l);){const c=T(l),f=ut(l);!f&&c.position==="fixed"&&(s=null),(r?!f&&!s:!f&&c.position==="static"&&!!s&&ze.has(s.position)||U(l)&&!f&&Lt(t,l))?o=o.filter(u=>u!==l):s=c,l=$(l)}return e.set(t,o),o}function Me(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const l=[...n==="clippingAncestors"?ot(e)?[]:De(e,this._c):[].concat(n),o],c=l[0],f=l.reduce((a,u)=>{const d=Tt(e,u,s);return a.top=I(d.top,a.top),a.right=lt(d.right,a.right),a.bottom=lt(d.bottom,a.bottom),a.left=I(d.left,a.left),a},Tt(e,c,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Pe(t){const{width:e,height:n}=kt(t);return{width:e,height:n}}function qe(t,e,n){const o=_(e),s=A(e),r=n==="fixed",l=M(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=O(0);function a(){f.x=st(s)}if(o||!o&&!r)if((D(e)!=="body"||U(s))&&(c=it(e)),o){const p=M(e,!0,r,e);f.x=p.x+e.clientLeft,f.y=p.y+e.clientTop}else s&&a();r&&!o&&s&&a();const u=s&&!o&&!r?vt(s,c):O(0),d=l.left+c.scrollLeft-f.x-u.x,h=l.top+c.scrollTop-f.y-u.y;return{x:d,y:h,width:l.width,height:l.height}}function ht(t){return T(t).position==="static"}function Ot(t,e){if(!_(t)||T(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return A(t)===n&&(n=n.ownerDocument.body),n}function At(t,e){const n=B(t);if(ot(t))return n;if(!_(t)){let s=$(t);for(;s&&!H(s);){if(E(s)&&!ht(s))return s;s=$(s)}return n}let o=Ot(t,e);for(;o&&Se(o)&&ht(o);)o=Ot(o,e);return o&&H(o)&&ht(o)&&!ut(o)?n:o||ve(t)||n}const Ne=async function(t){const e=this.getOffsetParent||At,n=this.getDimensions,o=await n(t.floating);return{reference:qe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Fe(t){return T(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:Oe,getDocumentElement:A,getClippingRect:Me,getOffsetParent:At,getElementRects:Ne,getClientRects:Ae,getDimensions:Pe,getScale:j,isElement:E,isRTL:Fe};function _t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function We(t,e){let n=null,o;const s=A(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),r();const a=t.getBoundingClientRect(),{left:u,top:d,width:h,height:p}=a;if(c||e(),!h||!p)return;const m=Q(d),g=Q(s.clientWidth-(u+h)),y=Q(s.clientHeight-(d+p)),w=Q(u),S={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:I(0,lt(1,f))||1};let R=!0;function C(P){const b=P[0].intersectionRatio;if(b!==f){if(!R)return l();b?l(!1,b):o=setTimeout(()=>{l(!1,1e-7)},1e3)}b===1&&!_t(a,t.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(C,{...S,root:s.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(t)}return l(!0),r}function He(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,a=mt(t),u=s||r?[...a?Y(a):[],...Y(e)]:[];u.forEach(w=>{s&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const d=a&&c?We(a,n):null;let h=-1,p=null;l&&(p=new ResizeObserver(w=>{let[x]=w;x&&x.target===a&&p&&(p.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=p)==null||S.observe(e)})),n()}),a&&!f&&p.observe(a),p.observe(e));let m,g=f?M(t):null;f&&y();function y(){const w=M(t);g&&!_t(g,w)&&n(),g=w,m=requestAnimationFrame(y)}return n(),()=>{var w;u.forEach(x=>{s&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),d==null||d(),(w=p)==null||w.disconnect(),p=null,f&&cancelAnimationFrame(m)}}const je=we,Xe=he,Ue=(t,e,n)=>{const o=new Map,s={platform:Ie,...n},r={...s.platform,_c:o};return pe(t,e,{...s,platform:r})};function Ye(t){return t!=null&&typeof t=="object"&&"$el"in t}function $t(t){if(Ye(t)){const e=t.$el;return ft(e)&&D(e)==="#comment"?null:e}return t}function K(t){return typeof t=="function"?t():i.unref(t)}function zt(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=zt(t);return Math.round(e*n)/n}function Ke(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,s=i.computed(()=>{var b;return(b=K(n.open))!=null?b:!0}),r=i.computed(()=>K(n.middleware)),l=i.computed(()=>{var b;return(b=K(n.placement))!=null?b:"bottom"}),c=i.computed(()=>{var b;return(b=K(n.strategy))!=null?b:"absolute"}),f=i.computed(()=>{var b;return(b=K(n.transform))!=null?b:!0}),a=i.computed(()=>$t(t.value)),u=i.computed(()=>$t(e.value)),d=i.ref(0),h=i.ref(0),p=i.ref(c.value),m=i.ref(l.value),g=i.shallowRef({}),y=i.ref(!1),w=i.computed(()=>{const b={position:p.value,left:"0",top:"0"};if(!u.value)return b;const v=Vt(u.value,d.value),q=Vt(u.value,h.value);return f.value?{...b,transform:"translate("+v+"px, "+q+"px)",...zt(u.value)>=1.5&&{willChange:"transform"}}:{position:p.value,left:v+"px",top:q+"px"}});let x;function S(){if(a.value==null||u.value==null)return;const b=s.value;Ue(a.value,u.value,{middleware:r.value,placement:l.value,strategy:c.value}).then(v=>{d.value=v.x,h.value=v.y,p.value=v.strategy,m.value=v.placement,g.value=v.middlewareData,y.value=b!==!1})}function R(){typeof x=="function"&&(x(),x=void 0)}function C(){if(R(),o===void 0){S();return}if(a.value!=null&&u.value!=null){x=o(a.value,u.value,S);return}}function P(){s.value||(y.value=!1)}return i.watch([r,l,c,s],S,{flush:"sync"}),i.watch([a,u],C,{flush:"sync"}),i.watch(s,P,{flush:"sync"}),i.getCurrentScope()&&i.onScopeDispose(R),{x:i.shallowReadonly(d),y:i.shallowReadonly(h),strategy:i.shallowReadonly(p),placement:i.shallowReadonly(m),middlewareData:i.shallowReadonly(g),isPositioned:i.shallowReadonly(y),floatingStyles:w,update:S}}const Ge=i.defineComponent({__name:"SqPopover",props:i.mergeModels({placement:{default:"top"},offset:{default:10},teleported:{type:Boolean},trigger:{default:"hover"},showAfter:{default:0},hideAfter:{default:300},disabled:{type:Boolean},popoverClass:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:["update:visible"],setup(t){let e;const n=t,o=i.useTemplateRef("triggerRef"),s=i.useTemplateRef("popverRef"),r=i.useModel(t,"visible"),{floatingStyles:l}=Ke(o,s,{placement:n.placement,whileElementsMounted:He,transform:!1,middleware:[je(n.offset),Xe()]});i.onBeforeUnmount(()=>{h(),document.removeEventListener("click",d)});function c(){n.trigger!=="hover"||n.disabled||(h(),e=setTimeout(()=>{u()},n.showAfter))}function f(){n.trigger==="hover"&&(h(),e=setTimeout(()=>{d()},n.hideAfter))}function a(){n.trigger==="click"&&(r.value?d():n.disabled||u())}function u(){r.value=!0,document.addEventListener("click",d)}function d(){r.value=!1,document.removeEventListener("click",d)}function h(){e&&(clearTimeout(e),e=void 0)}return(p,m)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",{class:"sq-popover-trigger",ref_key:"triggerRef",ref:o,onMouseenter:c,onMouseleave:f,onClick:i.withModifiers(a,["stop"])},[i.renderSlot(p.$slots,"reference")],544),(i.openBlock(),i.createBlock(i.Teleport,{to:"body",disabled:!n.teleported},[i.createVNode(i.Transition,{name:"sq-fade"},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{class:i.normalizeClass(["sq-popover",p.popoverClass]),ref_key:"popverRef",ref:s,style:i.normalizeStyle(i.unref(l)),onClick:m[0]||(m[0]=i.withModifiers(()=>{},["stop"]))},[i.renderSlot(p.$slots,"default")],6),[[i.vShow,r.value]])]),_:3})],8,["disabled"]))],64))}}),Je=i.defineComponent({__name:"SqProgress",props:{value:{},min:{default:0},max:{default:100},color:{},type:{default:"primary"}},setup(t){const e=t,n=i.computed(()=>e.color?[]:[`is-${e.type}`]),o=i.computed(()=>{const r=e.max-e.min;return(e.value-e.min)*100/r}),s=i.computed(()=>{const r={};if(r["--progress-value"]=`${o.value}%`,e.color){const c=typeof e.color=="string"?e.color:e.color(o.value);r["--progress-color"]=c}return r});return(r,l)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["sq-progress",n.value]),style:i.normalizeStyle(s.value)},null,6))}}),Qe=i.defineComponent({__name:"SqTag",props:{type:{},theme:{default:"materialize"},round:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=i.computed(()=>{const s=[];return e.size!=="md"&&s.push(`sq-tag--${e.size}`),e.theme!=="materialize"&&e.type&&s.push(`is-${e.theme}`),e.type&&s.push(`is-${e.type}`),e.round&&s.push("is-round"),s}),o=i.computed(()=>e.size==="lg"?"md":"sm");return(s,r)=>(i.openBlock(),i.createBlock(i.unref(rt),{class:i.normalizeClass(["sq-tag",n.value]),size:o.value},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},8,["class","size"]))}}),Ze=i.defineComponent({__name:"SqCheckTag",props:{checked:{type:Boolean,default:!1},type:{default:"primary"},round:{type:Boolean},size:{default:"md"}},emits:["change"],setup(t,{emit:e}){const n=e,o=t,s=i.computed(()=>{const l=[];return o.size!=="md"&&l.push(`sq-tag--${o.size}`),o.type&&l.push(`is-${o.type}`),o.round&&l.push("is-round"),o.checked&&l.push("is-checked"),l}),r=i.computed(()=>o.size==="lg"?"md":"sm");return(l,c)=>(i.openBlock(),i.createBlock(i.unref(rt),{class:i.normalizeClass(["sq-check-tag",s.value]),size:r.value,onClick:c[0]||(c[0]=f=>n("change",!o.checked))},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["class","size"]))}}),rt=i.defineComponent({__name:"SqText",props:{rowNum:{default:1},ellipsis:{type:Boolean,default:!1},size:{default:"md"}},setup(t){const e=t,n=i.computed(()=>{const s=[];return e.size!=="md"&&s.push(`s-text--${e.size}`),e.ellipsis&&s.push(e.rowNum>1?"multi-line":"single-line"),s}),o=i.computed(()=>e.ellipsis?`--row-num: ${e.rowNum}`:"");return(s,r)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass(["sq-text",n.value]),style:i.normalizeStyle(o.value)},[i.renderSlot(s.$slots,"default")],6))}});k.SqButton=jt,k.SqCard=Gt,k.SqCheckTag=Ze,k.SqInput=te,k.SqPopover=Ge,k.SqProgress=Je,k.SqTag=Qe,k.SqText=rt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
1
+ (function(k,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],s):(k=typeof globalThis<"u"?globalThis:k||self,s(k.SquirrelCloudUIVue={},k.Vue))})(this,(function(k,s){"use strict";const qt=(t,e)=>{const n=t.__vccOpts||t;for(const[o,i]of e)n[o]=i;return n},Nt={},Ft={class:"sq-icon is-loading","data-icon":"loading"};function It(t,e){return s.openBlock(),s.createElementBlock("span",Ft,e[0]||(e[0]=[s.createElementVNode("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[s.createElementVNode("circle",{cx:"24",cy:"24",r:"20"})],-1)]))}const Wt=qt(Nt,[["render",It]]),Ht=["disabled"],jt=s.defineComponent({__name:"SqButton",props:{type:{},round:{type:Boolean},text:{type:Boolean},icon:{},loading:{type:Boolean},disabled:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=s.computed(()=>{const r=[];return e.size!=="md"&&r.push(`sq-button--${e.size}`),e.type&&r.push(`is-${e.type}`),e.round&&r.push("is-round"),e.text&&r.push("is-text"),r}),o=s.computed(()=>e.loading?Wt:e.icon),i=s.computed(()=>e.loading||e.disabled);return(r,l)=>(s.openBlock(),s.createElementBlock("button",{class:s.normalizeClass(["sq-button",n.value]),disabled:i.value},[s.createVNode(s.unref(rt),{size:e.size},{default:s.withCtx(()=>[o.value?(s.openBlock(),s.createBlock(s.resolveDynamicComponent(o.value),{key:0})):s.createCommentVNode("",!0),s.renderSlot(r.$slots,"default")]),_:3},8,["size"])],10,Ht))}}),Xt={class:"sq-card"},Ut={key:0,class:"sq-card-header"},Yt=["textContent"],Kt={key:1,class:"sq-card-footer"},Gt=s.defineComponent({__name:"SqCard",props:{title:{},decorative:{type:Boolean,default:!1}},setup(t){const e=s.useSlots(),n=t;return(o,i)=>(s.openBlock(),s.createElementBlock("div",Xt,[n.title||s.unref(e).title?(s.openBlock(),s.createElementBlock("div",Ut,[s.createElementVNode("h2",{class:s.normalizeClass({"has-decorative":n.decorative}),textContent:s.toDisplayString(n.title)},null,10,Yt),s.renderSlot(o.$slots,"title")])):s.createCommentVNode("",!0),s.renderSlot(o.$slots,"default"),s.unref(e).footer?(s.openBlock(),s.createElementBlock("div",Kt,[s.renderSlot(o.$slots,"footer")])):s.createCommentVNode("",!0)]))}}),Jt={key:0,class:"sq-input-prefix"},Qt=["disabled","readonly"],Zt={key:1,class:"sq-input-suffix"},te=s.defineComponent({__name:"SqInput",props:s.mergeModels({status:{},round:{type:Boolean},showStatusIcon:{type:Boolean},prefixIcon:{},suffixIcon:{},disabled:{type:Boolean},readonly:{type:Boolean},size:{default:"md"}},{value:{type:String,default:""},valueModifiers:{}}),emits:s.mergeModels(["focus","blur","input","change"],["update:value"]),setup(t,{expose:e,emit:n}){const o=s.useSlots(),i=n,r=t,l=s.useModel(t,"value"),c=s.useTemplateRef("inputRef"),f=s.computed(()=>{const m=[];return r.size!=="md"&&m.push(`sq-input--${r.size}`),r.status&&m.push(`is-${r.status}`),r.round&&m.push("is-round"),r.disabled&&m.push("is-disabled"),m}),a=s.computed(()=>o.prefix||r.prefixIcon),d=s.computed(()=>{const m=r.showStatusIcon&&r.status;return o.suffix||m||r.suffixIcon}),p=s.computed(()=>r.suffixIcon);function h(){var m;(m=c.value)==null||m.focus()}function u(){var m;(m=c.value)==null||m.blur()}return e({focus:h,blur:u}),(m,g)=>(s.openBlock(),s.createElementBlock("section",{class:s.normalizeClass(["sq-input",f.value])},[a.value?(s.openBlock(),s.createElementBlock("span",Jt,[s.renderSlot(m.$slots,"prefix",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r.prefixIcon)))])])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":g[0]||(g[0]=y=>l.value=y),class:"sq-input-inner",disabled:r.disabled,readonly:r.readonly,ref_key:"inputRef",ref:c,onFocus:g[1]||(g[1]=y=>i("focus",y)),onBlur:g[2]||(g[2]=y=>i("blur",y)),onInput:g[3]||(g[3]=y=>i("input",y)),onChange:g[4]||(g[4]=y=>i("change",y))},null,40,Qt),[[s.vModelText,l.value]]),d.value?(s.openBlock(),s.createElementBlock("span",Zt,[s.renderSlot(m.$slots,"suffix",{},()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(p.value)))])])):s.createCommentVNode("",!0)],2))}}),lt=Math.min,I=Math.max,J=Math.round,Q=Math.floor,A=t=>({x:t,y:t}),ee={left:"right",right:"left",bottom:"top",top:"bottom"},ne={start:"end",end:"start"};function ct(t,e){return typeof t=="function"?t(e):t}function W(t){return t.split("-")[0]}function Z(t){return t.split("-")[1]}function oe(t){return t==="x"?"y":"x"}function yt(t){return t==="y"?"height":"width"}const se=new Set(["top","bottom"]);function V(t){return se.has(W(t))?"y":"x"}function wt(t){return oe(V(t))}function ie(t,e,n){n===void 0&&(n=!1);const o=Z(t),i=wt(t),r=yt(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=tt(l)),[l,tt(l)]}function re(t){const e=tt(t);return[at(t),e,at(e)]}function at(t){return t.replace(/start|end/g,e=>ne[e])}const xt=["left","right"],bt=["right","left"],le=["top","bottom"],ce=["bottom","top"];function ae(t,e,n){switch(t){case"top":case"bottom":return n?e?bt:xt:e?xt:bt;case"left":case"right":return e?le:ce;default:return[]}}function fe(t,e,n,o){const i=Z(t);let r=ae(W(t),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),e&&(r=r.concat(r.map(at)))),r}function tt(t){return t.replace(/left|right|bottom|top/g,e=>ee[e])}function ue(t){return{top:0,right:0,bottom:0,left:0,...t}}function de(t){return typeof t!="number"?ue(t):{top:t,right:t,bottom:t,left:t}}function et(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function St(t,e,n){let{reference:o,floating:i}=t;const r=V(e),l=wt(e),c=yt(l),f=W(e),a=r==="y",d=o.x+o.width/2-i.width/2,p=o.y+o.height/2-i.height/2,h=o[c]/2-i[c]/2;let u;switch(f){case"top":u={x:d,y:o.y-i.height};break;case"bottom":u={x:d,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:p};break;case"left":u={x:o.x-i.width,y:p};break;default:u={x:o.x,y:o.y}}switch(Z(e)){case"start":u[l]-=h*(n&&a?-1:1);break;case"end":u[l]+=h*(n&&a?-1:1);break}return u}const pe=async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,c=r.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(e));let a=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:p}=St(a,o,f),h=o,u={},m=0;for(let g=0;g<c.length;g++){const{name:y,fn:w}=c[g],{x,y:S,data:R,reset:C}=await w({x:d,y:p,initialPlacement:o,placement:h,strategy:i,middlewareData:u,rects:a,platform:l,elements:{reference:t,floating:e}});d=x??d,p=S??p,u={...u,[y]:{...u[y],...R}},C&&m<=50&&(m++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(a=C.rects===!0?await l.getElementRects({reference:t,floating:e,strategy:i}):C.rects),{x:d,y:p}=St(a,h,f)),g=-1)}return{x:d,y:p,placement:h,strategy:i,middlewareData:u}};async function me(t,e){var n;e===void 0&&(e={});const{x:o,y:i,platform:r,rects:l,elements:c,strategy:f}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:u=0}=ct(e,t),m=de(u),y=c[h?p==="floating"?"reference":"floating":p],w=et(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:f})),x=p==="floating"?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,S=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),R=await(r.isElement==null?void 0:r.isElement(S))?await(r.getScale==null?void 0:r.getScale(S))||{x:1,y:1}:{x:1,y:1},C=et(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:x,offsetParent:S,strategy:f}):x);return{top:(w.top-C.top+m.top)/R.y,bottom:(C.bottom-w.bottom+m.bottom)/R.y,left:(w.left-C.left+m.left)/R.x,right:(C.right-w.right+m.right)/R.x}}const he=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:c,platform:f,elements:a}=e,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:g=!0,...y}=ct(t,e);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const w=W(i),x=V(c),S=W(c)===c,R=await(f.isRTL==null?void 0:f.isRTL(a.floating)),C=h||(S||!g?[tt(c)]:re(c)),P=m!=="none";!h&&P&&C.push(...fe(c,g,m,R));const b=[c,...C],E=await me(e,y),q=[];let X=((o=r.flip)==null?void 0:o.overflows)||[];if(d&&q.push(E[w]),p){const N=ie(i,l,R);q.push(E[N[0]],E[N[1]])}if(X=[...X,{placement:i,overflows:q}],!q.every(N=>N<=0)){var Dt,Mt;const N=(((Dt=r.flip)==null?void 0:Dt.index)||0)+1,gt=b[N];if(gt&&(!(p==="alignment"?x!==V(gt):!1)||X.every(O=>V(O.placement)===x?O.overflows[0]>0:!0)))return{data:{index:N,overflows:X},reset:{placement:gt}};let G=(Mt=X.filter(F=>F.overflows[0]<=0).sort((F,O)=>F.overflows[1]-O.overflows[1])[0])==null?void 0:Mt.placement;if(!G)switch(u){case"bestFit":{var Pt;const F=(Pt=X.filter(O=>{if(P){const z=V(O.placement);return z===x||z==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(z=>z>0).reduce((z,tn)=>z+tn,0)]).sort((O,z)=>O[1]-z[1])[0])==null?void 0:Pt[0];F&&(G=F);break}case"initialPlacement":G=c;break}if(i!==G)return{reset:{placement:G}}}return{}}}},ge=new Set(["left","top"]);async function ye(t,e){const{placement:n,platform:o,elements:i}=t,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=W(n),c=Z(n),f=V(n)==="y",a=ge.has(l)?-1:1,d=r&&f?-1:1,p=ct(e,t);let{mainAxis:h,crossAxis:u,alignmentAxis:m}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return c&&typeof m=="number"&&(u=c==="end"?m*-1:m),f?{x:u*d,y:h*a}:{x:h*a,y:u*d}}const we=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:c}=e,f=await ye(e,t);return l===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}};function nt(){return typeof window<"u"}function D(t){return ft(t)?(t.nodeName||"").toLowerCase():"#document"}function B(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function T(t){var e;return(e=(ft(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function ft(t){return nt()?t instanceof Node||t instanceof B(t).Node:!1}function v(t){return nt()?t instanceof Element||t instanceof B(t).Element:!1}function _(t){return nt()?t instanceof HTMLElement||t instanceof B(t).HTMLElement:!1}function Ct(t){return!nt()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof B(t).ShadowRoot}const xe=new Set(["inline","contents"]);function U(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=L(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!xe.has(i)}const be=new Set(["table","td","th"]);function Se(t){return be.has(D(t))}const Ce=[":popover-open",":modal"];function ot(t){return Ce.some(e=>{try{return t.matches(e)}catch{return!1}})}const Re=["transform","translate","scale","rotate","perspective"],ke=["transform","translate","scale","rotate","perspective","filter"],Be=["paint","layout","strict","content"];function ut(t){const e=dt(),n=v(t)?L(t):t;return Re.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||ke.some(o=>(n.willChange||"").includes(o))||Be.some(o=>(n.contain||"").includes(o))}function Ee(t){let e=$(t);for(;_(e)&&!H(e);){if(ut(e))return e;if(ot(e))return null;e=$(e)}return null}function dt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const ve=new Set(["html","body","#document"]);function H(t){return ve.has(D(t))}function L(t){return B(t).getComputedStyle(t)}function st(t){return v(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function $(t){if(D(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ct(t)&&t.host||T(t);return Ct(e)?e.host:e}function Rt(t){const e=$(t);return H(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&U(e)?e:Rt(e)}function Y(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Rt(t),r=i===((o=t.ownerDocument)==null?void 0:o.body),l=B(i);if(r){const c=pt(l);return e.concat(l,l.visualViewport||[],U(i)?i:[],c&&n?Y(c):[])}return e.concat(i,Y(i,[],n))}function pt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function kt(t){const e=L(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=_(t),r=i?t.offsetWidth:n,l=i?t.offsetHeight:o,c=J(n)!==r||J(o)!==l;return c&&(n=r,o=l),{width:n,height:o,$:c}}function mt(t){return v(t)?t:t.contextElement}function j(t){const e=mt(t);if(!_(e))return A(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=kt(e);let l=(r?J(n.width):n.width)/o,c=(r?J(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const Le=A(0);function Bt(t){const e=B(t);return!dt()||!e.visualViewport?Le:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Oe(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==B(t)?!1:e}function M(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),r=mt(t);let l=A(1);e&&(o?v(o)&&(l=j(o)):l=j(t));const c=Oe(r,n,o)?Bt(r):A(0);let f=(i.left+c.x)/l.x,a=(i.top+c.y)/l.y,d=i.width/l.x,p=i.height/l.y;if(r){const h=B(r),u=o&&v(o)?B(o):o;let m=h,g=pt(m);for(;g&&o&&u!==m;){const y=j(g),w=g.getBoundingClientRect(),x=L(g),S=w.left+(g.clientLeft+parseFloat(x.paddingLeft))*y.x,R=w.top+(g.clientTop+parseFloat(x.paddingTop))*y.y;f*=y.x,a*=y.y,d*=y.x,p*=y.y,f+=S,a+=R,m=B(g),g=pt(m)}}return et({width:d,height:p,x:f,y:a})}function it(t,e){const n=st(t).scrollLeft;return e?e.left+n:M(T(t)).left+n}function Et(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-it(t,n),i=n.top+e.scrollTop;return{x:o,y:i}}function Ae(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r=i==="fixed",l=T(o),c=e?ot(e.floating):!1;if(o===l||c&&r)return n;let f={scrollLeft:0,scrollTop:0},a=A(1);const d=A(0),p=_(o);if((p||!p&&!r)&&((D(o)!=="body"||U(l))&&(f=st(o)),_(o))){const u=M(o);a=j(o),d.x=u.x+o.clientLeft,d.y=u.y+o.clientTop}const h=l&&!p&&!r?Et(l,f):A(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-f.scrollLeft*a.x+d.x+h.x,y:n.y*a.y-f.scrollTop*a.y+d.y+h.y}}function Te(t){return Array.from(t.getClientRects())}function _e(t){const e=T(t),n=st(t),o=t.ownerDocument.body,i=I(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=I(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+it(t);const c=-n.scrollTop;return L(o).direction==="rtl"&&(l+=I(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:c}}const vt=25;function $e(t,e){const n=B(t),o=T(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,c=0,f=0;if(i){r=i.width,l=i.height;const d=dt();(!d||d&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const a=it(o);if(a<=0){const d=o.ownerDocument,p=d.body,h=getComputedStyle(p),u=d.compatMode==="CSS1Compat"&&parseFloat(h.marginLeft)+parseFloat(h.marginRight)||0,m=Math.abs(o.clientWidth-p.clientWidth-u);m<=vt&&(r-=m)}else a<=vt&&(r+=a);return{width:r,height:l,x:c,y:f}}const ze=new Set(["absolute","fixed"]);function Ve(t,e){const n=M(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=_(t)?j(t):A(1),l=t.clientWidth*r.x,c=t.clientHeight*r.y,f=i*r.x,a=o*r.y;return{width:l,height:c,x:f,y:a}}function Lt(t,e,n){let o;if(e==="viewport")o=$e(t,n);else if(e==="document")o=_e(T(t));else if(v(e))o=Ve(e,n);else{const i=Bt(t);o={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return et(o)}function Ot(t,e){const n=$(t);return n===e||!v(n)||H(n)?!1:L(n).position==="fixed"||Ot(n,e)}function De(t,e){const n=e.get(t);if(n)return n;let o=Y(t,[],!1).filter(c=>v(c)&&D(c)!=="body"),i=null;const r=L(t).position==="fixed";let l=r?$(t):t;for(;v(l)&&!H(l);){const c=L(l),f=ut(l);!f&&c.position==="fixed"&&(i=null),(r?!f&&!i:!f&&c.position==="static"&&!!i&&ze.has(i.position)||U(l)&&!f&&Ot(t,l))?o=o.filter(d=>d!==l):i=c,l=$(l)}return e.set(t,o),o}function Me(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const l=[...n==="clippingAncestors"?ot(e)?[]:De(e,this._c):[].concat(n),o],c=l[0],f=l.reduce((a,d)=>{const p=Lt(e,d,i);return a.top=I(p.top,a.top),a.right=lt(p.right,a.right),a.bottom=lt(p.bottom,a.bottom),a.left=I(p.left,a.left),a},Lt(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Pe(t){const{width:e,height:n}=kt(t);return{width:e,height:n}}function qe(t,e,n){const o=_(e),i=T(e),r=n==="fixed",l=M(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=A(0);function a(){f.x=it(i)}if(o||!o&&!r)if((D(e)!=="body"||U(i))&&(c=st(e)),o){const u=M(e,!0,r,e);f.x=u.x+e.clientLeft,f.y=u.y+e.clientTop}else i&&a();r&&!o&&i&&a();const d=i&&!o&&!r?Et(i,c):A(0),p=l.left+c.scrollLeft-f.x-d.x,h=l.top+c.scrollTop-f.y-d.y;return{x:p,y:h,width:l.width,height:l.height}}function ht(t){return L(t).position==="static"}function At(t,e){if(!_(t)||L(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return T(t)===n&&(n=n.ownerDocument.body),n}function Tt(t,e){const n=B(t);if(ot(t))return n;if(!_(t)){let i=$(t);for(;i&&!H(i);){if(v(i)&&!ht(i))return i;i=$(i)}return n}let o=At(t,e);for(;o&&Se(o)&&ht(o);)o=At(o,e);return o&&H(o)&&ht(o)&&!ut(o)?n:o||Ee(t)||n}const Ne=async function(t){const e=this.getOffsetParent||Tt,n=this.getDimensions,o=await n(t.floating);return{reference:qe(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Fe(t){return L(t).direction==="rtl"}const Ie={convertOffsetParentRelativeRectToViewportRelativeRect:Ae,getDocumentElement:T,getClippingRect:Me,getOffsetParent:Tt,getElementRects:Ne,getClientRects:Te,getDimensions:Pe,getScale:j,isElement:v,isRTL:Fe};function _t(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function We(t,e){let n=null,o;const i=T(t);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),r();const a=t.getBoundingClientRect(),{left:d,top:p,width:h,height:u}=a;if(c||e(),!h||!u)return;const m=Q(p),g=Q(i.clientWidth-(d+h)),y=Q(i.clientHeight-(p+u)),w=Q(d),S={rootMargin:-m+"px "+-g+"px "+-y+"px "+-w+"px",threshold:I(0,lt(1,f))||1};let R=!0;function C(P){const b=P[0].intersectionRatio;if(b!==f){if(!R)return l();b?l(!1,b):o=setTimeout(()=>{l(!1,1e-7)},1e3)}b===1&&!_t(a,t.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(C,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,S)}n.observe(t)}return l(!0),r}function He(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,a=mt(t),d=i||r?[...a?Y(a):[],...Y(e)]:[];d.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),r&&w.addEventListener("resize",n)});const p=a&&c?We(a,n):null;let h=-1,u=null;l&&(u=new ResizeObserver(w=>{let[x]=w;x&&x.target===a&&u&&(u.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=u)==null||S.observe(e)})),n()}),a&&!f&&u.observe(a),u.observe(e));let m,g=f?M(t):null;f&&y();function y(){const w=M(t);g&&!_t(g,w)&&n(),g=w,m=requestAnimationFrame(y)}return n(),()=>{var w;d.forEach(x=>{i&&x.removeEventListener("scroll",n),r&&x.removeEventListener("resize",n)}),p==null||p(),(w=u)==null||w.disconnect(),u=null,f&&cancelAnimationFrame(m)}}const je=we,Xe=he,Ue=(t,e,n)=>{const o=new Map,i={platform:Ie,...n},r={...i.platform,_c:o};return pe(t,e,{...i,platform:r})};function Ye(t){return t!=null&&typeof t=="object"&&"$el"in t}function $t(t){if(Ye(t)){const e=t.$el;return ft(e)&&D(e)==="#comment"?null:e}return t}function K(t){return typeof t=="function"?t():s.unref(t)}function zt(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Vt(t,e){const n=zt(t);return Math.round(e*n)/n}function Ke(t,e,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=s.computed(()=>{var b;return(b=K(n.open))!=null?b:!0}),r=s.computed(()=>K(n.middleware)),l=s.computed(()=>{var b;return(b=K(n.placement))!=null?b:"bottom"}),c=s.computed(()=>{var b;return(b=K(n.strategy))!=null?b:"absolute"}),f=s.computed(()=>{var b;return(b=K(n.transform))!=null?b:!0}),a=s.computed(()=>$t(t.value)),d=s.computed(()=>$t(e.value)),p=s.ref(0),h=s.ref(0),u=s.ref(c.value),m=s.ref(l.value),g=s.shallowRef({}),y=s.ref(!1),w=s.computed(()=>{const b={position:u.value,left:"0",top:"0"};if(!d.value)return b;const E=Vt(d.value,p.value),q=Vt(d.value,h.value);return f.value?{...b,transform:"translate("+E+"px, "+q+"px)",...zt(d.value)>=1.5&&{willChange:"transform"}}:{position:u.value,left:E+"px",top:q+"px"}});let x;function S(){if(a.value==null||d.value==null)return;const b=i.value;Ue(a.value,d.value,{middleware:r.value,placement:l.value,strategy:c.value}).then(E=>{p.value=E.x,h.value=E.y,u.value=E.strategy,m.value=E.placement,g.value=E.middlewareData,y.value=b!==!1})}function R(){typeof x=="function"&&(x(),x=void 0)}function C(){if(R(),o===void 0){S();return}if(a.value!=null&&d.value!=null){x=o(a.value,d.value,S);return}}function P(){i.value||(y.value=!1)}return s.watch([r,l,c,i],S,{flush:"sync"}),s.watch([a,d],C,{flush:"sync"}),s.watch(i,P,{flush:"sync"}),s.getCurrentScope()&&s.onScopeDispose(R),{x:s.shallowReadonly(p),y:s.shallowReadonly(h),strategy:s.shallowReadonly(u),placement:s.shallowReadonly(m),middlewareData:s.shallowReadonly(g),isPositioned:s.shallowReadonly(y),floatingStyles:w,update:S}}const Ge=s.defineComponent({__name:"SqPopover",props:s.mergeModels({placement:{default:"top"},offset:{default:10},teleported:{type:Boolean,default:!0},trigger:{default:"hover"},showAfter:{default:0},hideAfter:{default:300},disabled:{type:Boolean},popoverClass:{}},{visible:{type:Boolean,default:!1},visibleModifiers:{}}),emits:["update:visible"],setup(t){let e;const n=t,o=s.shallowRef(null),i=s.shallowRef(null),r=s.useModel(t,"visible"),{floatingStyles:l}=Ke(o,i,{placement:n.placement,whileElementsMounted:He,transform:!1,middleware:[je(n.offset),Xe()]});s.onBeforeUnmount(()=>{h(),document.removeEventListener("click",p)});function c(){n.trigger!=="hover"||n.disabled||(h(),e=setTimeout(()=>{d(!1)},n.showAfter))}function f(){n.trigger==="hover"&&(h(),e=setTimeout(()=>{p()},n.hideAfter))}function a(){n.trigger==="click"&&(r.value?p():n.disabled||d())}function d(u=!0){r.value=!0,u&&document.addEventListener("click",p)}function p(){r.value=!1,document.removeEventListener("click",p)}function h(){e&&(clearTimeout(e),e=void 0)}return(u,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("span",{class:s.normalizeClass(["sq-popover-trigger",u.$attrs.class]),style:s.normalizeStyle(u.$attrs.style),ref_key:"triggerRef",ref:o,onMouseenter:c,onMouseleave:f,onClick:s.withModifiers(a,["stop"])},[s.renderSlot(u.$slots,"reference")],38),(s.openBlock(),s.createBlock(s.Teleport,{to:"body",disabled:!n.teleported},[s.createVNode(s.Transition,{name:"sq-fade"},{default:s.withCtx(()=>[s.withDirectives(s.createElementVNode("div",{class:s.normalizeClass(["sq-popover",u.popoverClass]),ref_key:"popverRef",ref:i,style:s.normalizeStyle(s.unref(l)),onClick:m[0]||(m[0]=s.withModifiers(()=>{},["stop"]))},[s.renderSlot(u.$slots,"default")],6),[[s.vShow,r.value]])]),_:3})],8,["disabled"]))],64))}}),Je=s.defineComponent({__name:"SqProgress",props:{value:{},min:{default:0},max:{default:100},color:{},type:{default:"primary"}},setup(t){const e=t,n=s.computed(()=>e.color?[]:[`is-${e.type}`]),o=s.computed(()=>{const r=e.max-e.min;return(e.value-e.min)*100/r}),i=s.computed(()=>{const r={};if(r["--progress-value"]=`${o.value}%`,e.color){const c=typeof e.color=="string"?e.color:e.color(o.value);r["--progress-color"]=c}return r});return(r,l)=>(s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["sq-progress",n.value]),style:s.normalizeStyle(i.value)},null,6))}}),Qe=s.defineComponent({__name:"SqTag",props:{type:{},theme:{default:"materialize"},round:{type:Boolean},size:{default:"md"}},setup(t){const e=t,n=s.computed(()=>{const i=[];return e.size!=="md"&&i.push(`sq-tag--${e.size}`),e.theme!=="materialize"&&e.type&&i.push(`is-${e.theme}`),e.type&&i.push(`is-${e.type}`),e.round&&i.push("is-round"),i}),o=s.computed(()=>e.size==="lg"?"md":"sm");return(i,r)=>(s.openBlock(),s.createBlock(s.unref(rt),{class:s.normalizeClass(["sq-tag",n.value]),size:o.value},{default:s.withCtx(()=>[s.renderSlot(i.$slots,"default")]),_:3},8,["class","size"]))}}),Ze=s.defineComponent({__name:"SqCheckTag",props:{checked:{type:Boolean,default:!1},type:{default:"primary"},round:{type:Boolean},size:{default:"md"}},emits:["change"],setup(t,{emit:e}){const n=e,o=t,i=s.computed(()=>{const l=[];return o.size!=="md"&&l.push(`sq-tag--${o.size}`),o.type&&l.push(`is-${o.type}`),o.round&&l.push("is-round"),o.checked&&l.push("is-checked"),l}),r=s.computed(()=>o.size==="lg"?"md":"sm");return(l,c)=>(s.openBlock(),s.createBlock(s.unref(rt),{class:s.normalizeClass(["sq-check-tag",i.value]),size:r.value,onClick:c[0]||(c[0]=f=>n("change",!o.checked))},{default:s.withCtx(()=>[s.renderSlot(l.$slots,"default")]),_:3},8,["class","size"]))}}),rt=s.defineComponent({__name:"SqText",props:{rowNum:{default:1},ellipsis:{type:Boolean,default:!1},size:{default:"md"}},setup(t){const e=t,n=s.computed(()=>{const i=[];return e.size!=="md"&&i.push(`s-text--${e.size}`),e.ellipsis&&i.push(e.rowNum>1?"multi-line":"single-line"),i}),o=s.computed(()=>e.ellipsis?`--row-num: ${e.rowNum}`:"");return(i,r)=>(s.openBlock(),s.createElementBlock("span",{class:s.normalizeClass(["sq-text",n.value]),style:s.normalizeStyle(o.value)},[s.renderSlot(i.$slots,"default")],6))}});k.SqButton=jt,k.SqCard=Gt,k.SqCheckTag=Ze,k.SqInput=te,k.SqPopover=Ge,k.SqProgress=Je,k.SqTag=Qe,k.SqText=rt,Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@squirrel-cloud/ui-vue",
3
3
  "description": "松鼠的坚果屋前端VUE框架",
4
4
  "license": "GPL-3.0",
5
- "version": "0.2.2",
5
+ "version": "0.2.4",
6
6
  "private": false,
7
7
  "type": "module",
8
8
  "files": [