vue-stack-tabs 0.1.5 → 0.1.6
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.
|
@@ -6221,7 +6221,7 @@ const gu = ["width", "height", "stroke"], bu = /* @__PURE__ */ Kn('<g fill="none
|
|
|
6221
6221
|
fallbackLocale: "en-US"
|
|
6222
6222
|
}), Vu = {
|
|
6223
6223
|
install(e) {
|
|
6224
|
-
_u("0.1.
|
|
6224
|
+
_u("0.1.6"), e.component("VueStackTabs", su).use(Mu);
|
|
6225
6225
|
}
|
|
6226
6226
|
};
|
|
6227
6227
|
export {
|
|
@@ -43,4 +43,4 @@ caused by: ${pe.fullStack(n)}`:t.stack}static info(t){yn(t);const n={},a=pe.caus
|
|
|
43
43
|
</g>
|
|
44
44
|
<text transform="translate(943.45 229.96)" style="fill: #00d797; font-family: ArialMT, Arial; font-size: 24px;"><tspan x="0" y="0">version: ${e}</tspan></text>
|
|
45
45
|
</svg>
|
|
46
|
-
`,o="data:image/svg+xml;base64,"+sc(a),l="font-size: 1px; padding: "+Math.floor(100/4)+"px "+Math.floor(580/2)+"px; line-height: "+Math.floor(100/2)+"px;";window.console.log("%c+",l+`background-image: url(${o});background-size: 580px 100px;background-repeat: norepeat; color: transparent;`)},Ya=()=>{const{attrs:e}=i.getCurrentInstance(),{pageShown:t,getTab:n,markDeletableCache:a,removeComponent:s,getComponent:r}=bt(),o=_e.useRoute(),l=_e.useRouter();let c="",u="";return c=e.tId,u=o.query.__tab,{forward:d=>{t.value=!1;const T=Ne({__tab:u},d.query);l.push({path:d.path,query:T})},backward:(d,T)=>{t.value=!1;const A=n(c);if(!A)return;const k=A.pages;let S=0;if(typeof d=="number")S=Math.abs(d);else{let N=1,b=!1;const I=k.list(),E=Pn(d);T=Ne(E.query,T);for(let y=k.size()-2;y>=0;y--){if(I[y].path===E.path){b=!0;break}N+=1}b&&(S=N)}if(S===0||k.size()<=S)return;for(let N=0;N<S;N++){const b=k.pop();s(b.id),a(b.id)}const m=k==null?void 0:k.peek(),g=r(m.id);if(g!=null){const N=g.components.DynamicComponent;N.props=Ne(T,N.props)}l.push({path:m.path,query:m.query})}}},ic=i.defineComponent({__name:"iframe",setup(e){return Ya(),(t,n)=>(i.openBlock(),i.createElementBlock("div"))}}),lc=e=>{var t;typeof e.remove<"u"?e.remove():(t=e.parentNode)==null||t.removeChild(e)};function cc(e,t,n,a={}){const s=i.h(e,t,a),r=document.createElement("div");return r.classList.add("vld-container"),n.appendChild(r),i.render(s,r),s.component}const uc=["width","height","stroke"],fc=[i.createStaticVNode('<g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".25" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.8s" repeatCount="indefinite"></animateTransform></path></g></g>',1)],dc=i.defineComponent({__name:"spinner",props:{color:{default:"#000"},height:{default:64},width:{default:64}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("svg",{viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,stroke:t.color},fc,8,uc))}}),mc=["fill","width","height"],_c=[i.createStaticVNode('<circle cx="15" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle>',3)],hc=i.defineComponent({__name:"dots",props:{color:{default:"#000"},height:{default:240},width:{default:60}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("svg",{viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:t.color,width:t.width,height:t.height},_c,8,mc))}}),pc=["height","width","fill"],gc=[i.createStaticVNode('<rect x="0" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="10" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="20" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3)],bc={spinner:dc,dots:hc,bars:i.defineComponent({__name:"bars",props:{color:{default:"#000"},height:{default:40},width:{default:40}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",height:t.height,width:t.width,fill:t.color},gc,8,pc))}})},Ec=["aria-busy"],Tc={class:"vl-icon"},Nc=i.defineComponent({__name:"Component",props:{active:{type:Boolean},programmatic:{type:Boolean},container:{},isFullPage:{type:Boolean,default:!0},enforceFocus:{type:Boolean,default:!0},lockScroll:{type:Boolean},transition:{default:"fade"},canCancel:{type:Boolean},onCancel:{type:Function,default:()=>{}},color:{},backgroundColor:{},opacity:{},width:{},height:{},zIndex:{},loader:{default:"spinner"}},emits:["hide","update:active"],setup(e,{emit:t}){const n=e,a=i.ref(),s=i.ref(n.active),r=t,o=()=>{!n.canCancel||!s.value||(l(),n.onCancel.apply(null,null))},l=()=>{r("hide"),r("update:active",!1),n.programmatic&&(s.value=!1,setTimeout(()=>{const T=a.value.parentElement;i.render(null,T),lc(T)},150))},c=()=>{n.isFullPage&&n.lockScroll&&document.body.classList.add("vl-shown")},u=()=>{n.isFullPage&&n.lockScroll&&document.body.classList.remove("vl-shown")},p=T=>{T.code==="Escape"&&o()},h=T=>{if(!s.value||T.target===a.value||a.value.contains(T.target))return;const A=n.container?n.container:n.isFullPage?null:a.value.parentElement;(n.isFullPage||A&&A.contains(T.target))&&(T.preventDefault(),a.value.focus())},d=i.computed(()=>({background:n.backgroundColor,opacity:n.opacity}));return i.watch(()=>n.active,T=>{s.value=T}),i.watch(()=>s,T=>{T?c():u()}),i.onMounted(()=>{n.enforceFocus&&document.addEventListener("focusin",h),document.addEventListener("keyup",p)}),i.onBeforeUnmount(()=>{document.removeEventListener("keyup",p),document.removeEventListener("focusin",h)}),(T,A)=>(i.openBlock(),i.createBlock(i.Transition,{name:T.transition},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{tabindex:"0",class:i.normalizeClass(["vl-overlay vl-active",{"vl-full-page":T.isFullPage}]),"aria-busy":s.value,"aria-label":"Loading",style:i.normalizeStyle({zIndex:T.zIndex}),ref_key:"overlay",ref:a},[i.createElementVNode("div",{class:"vl-background",onClick:i.withModifiers(o,["prevent"]),style:i.normalizeStyle(d.value)},null,4),i.createElementVNode("div",Tc,[i.renderSlot(T.$slots,"before"),i.renderSlot(T.$slots,"default",{},()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(bc)[T.loader]),{color:T.color,width:T.width,height:T.height},null,8,["color","width","height"]))]),i.renderSlot(T.$slots,"after")])],14,Ec),[[i.vShow,s.value]])]),_:3},8,["name"]))}}),vc=(e={},t={})=>({show(n=e,a=t){const r={...e,...n,...{programmatic:!0,lockScroll:!0,isFullPage:!1,active:!0}};let o=r.container;r.container||(o=document.body,r.isFullPage=!0);const l={...t,...a};return{hide:cc(Nc,r,o,l).ctx.hide}}}),Oc=()=>{const e=vc(),{attrs:t}=i.getCurrentInstance();let n=null;i.onUnmounted(()=>{s()});const a=()=>{const r=document.querySelector(`#${t.tId}`);n===null&&(n=e.show({canCancel:!1,isFullPage:!1,height:85,width:85,loader:"spinner",color:"#007bff",container:r}))},s=()=>{n!==null&&(n.hide(),n=null)};return{openTabLoading:a,closeTabLoading:s}},yc=ii({legacy:!1,locale:"zh-CN",fallbackLocale:"en-US"}),Lc={install(e){oc("0.1.
|
|
46
|
+
`,o="data:image/svg+xml;base64,"+sc(a),l="font-size: 1px; padding: "+Math.floor(100/4)+"px "+Math.floor(580/2)+"px; line-height: "+Math.floor(100/2)+"px;";window.console.log("%c+",l+`background-image: url(${o});background-size: 580px 100px;background-repeat: norepeat; color: transparent;`)},Ya=()=>{const{attrs:e}=i.getCurrentInstance(),{pageShown:t,getTab:n,markDeletableCache:a,removeComponent:s,getComponent:r}=bt(),o=_e.useRoute(),l=_e.useRouter();let c="",u="";return c=e.tId,u=o.query.__tab,{forward:d=>{t.value=!1;const T=Ne({__tab:u},d.query);l.push({path:d.path,query:T})},backward:(d,T)=>{t.value=!1;const A=n(c);if(!A)return;const k=A.pages;let S=0;if(typeof d=="number")S=Math.abs(d);else{let N=1,b=!1;const I=k.list(),E=Pn(d);T=Ne(E.query,T);for(let y=k.size()-2;y>=0;y--){if(I[y].path===E.path){b=!0;break}N+=1}b&&(S=N)}if(S===0||k.size()<=S)return;for(let N=0;N<S;N++){const b=k.pop();s(b.id),a(b.id)}const m=k==null?void 0:k.peek(),g=r(m.id);if(g!=null){const N=g.components.DynamicComponent;N.props=Ne(T,N.props)}l.push({path:m.path,query:m.query})}}},ic=i.defineComponent({__name:"iframe",setup(e){return Ya(),(t,n)=>(i.openBlock(),i.createElementBlock("div"))}}),lc=e=>{var t;typeof e.remove<"u"?e.remove():(t=e.parentNode)==null||t.removeChild(e)};function cc(e,t,n,a={}){const s=i.h(e,t,a),r=document.createElement("div");return r.classList.add("vld-container"),n.appendChild(r),i.render(s,r),s.component}const uc=["width","height","stroke"],fc=[i.createStaticVNode('<g fill="none" fill-rule="evenodd"><g transform="translate(1 1)" stroke-width="2"><circle stroke-opacity=".25" cx="18" cy="18" r="18"></circle><path d="M36 18c0-9.94-8.06-18-18-18"><animateTransform attributeName="transform" type="rotate" from="0 18 18" to="360 18 18" dur="0.8s" repeatCount="indefinite"></animateTransform></path></g></g>',1)],dc=i.defineComponent({__name:"spinner",props:{color:{default:"#000"},height:{default:64},width:{default:64}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("svg",{viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:t.width,height:t.height,stroke:t.color},fc,8,uc))}}),mc=["fill","width","height"],_c=[i.createStaticVNode('<circle cx="15" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="60" cy="15" r="9" fill-opacity="0.3"><animate attributeName="r" from="9" to="9" begin="0s" dur="0.8s" values="9;15;9" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="0.5" to="0.5" begin="0s" dur="0.8s" values=".5;1;.5" calcMode="linear" repeatCount="indefinite"></animate></circle><circle cx="105" cy="15" r="15"><animate attributeName="r" from="15" to="15" begin="0s" dur="0.8s" values="15;9;15" calcMode="linear" repeatCount="indefinite"></animate><animate attributeName="fill-opacity" from="1" to="1" begin="0s" dur="0.8s" values="1;.5;1" calcMode="linear" repeatCount="indefinite"></animate></circle>',3)],hc=i.defineComponent({__name:"dots",props:{color:{default:"#000"},height:{default:240},width:{default:60}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("svg",{viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:t.color,width:t.width,height:t.height},_c,8,mc))}}),pc=["height","width","fill"],gc=[i.createStaticVNode('<rect x="0" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="10" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.15s" dur="0.6s" repeatCount="indefinite"></animate></rect><rect x="20" y="13" width="4" height="5"><animate attributeName="height" attributeType="XML" values="5;21;5" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate><animate attributeName="y" attributeType="XML" values="13; 5; 13" begin="0.3s" dur="0.6s" repeatCount="indefinite"></animate></rect>',3)],bc={spinner:dc,dots:hc,bars:i.defineComponent({__name:"bars",props:{color:{default:"#000"},height:{default:40},width:{default:40}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",height:t.height,width:t.width,fill:t.color},gc,8,pc))}})},Ec=["aria-busy"],Tc={class:"vl-icon"},Nc=i.defineComponent({__name:"Component",props:{active:{type:Boolean},programmatic:{type:Boolean},container:{},isFullPage:{type:Boolean,default:!0},enforceFocus:{type:Boolean,default:!0},lockScroll:{type:Boolean},transition:{default:"fade"},canCancel:{type:Boolean},onCancel:{type:Function,default:()=>{}},color:{},backgroundColor:{},opacity:{},width:{},height:{},zIndex:{},loader:{default:"spinner"}},emits:["hide","update:active"],setup(e,{emit:t}){const n=e,a=i.ref(),s=i.ref(n.active),r=t,o=()=>{!n.canCancel||!s.value||(l(),n.onCancel.apply(null,null))},l=()=>{r("hide"),r("update:active",!1),n.programmatic&&(s.value=!1,setTimeout(()=>{const T=a.value.parentElement;i.render(null,T),lc(T)},150))},c=()=>{n.isFullPage&&n.lockScroll&&document.body.classList.add("vl-shown")},u=()=>{n.isFullPage&&n.lockScroll&&document.body.classList.remove("vl-shown")},p=T=>{T.code==="Escape"&&o()},h=T=>{if(!s.value||T.target===a.value||a.value.contains(T.target))return;const A=n.container?n.container:n.isFullPage?null:a.value.parentElement;(n.isFullPage||A&&A.contains(T.target))&&(T.preventDefault(),a.value.focus())},d=i.computed(()=>({background:n.backgroundColor,opacity:n.opacity}));return i.watch(()=>n.active,T=>{s.value=T}),i.watch(()=>s,T=>{T?c():u()}),i.onMounted(()=>{n.enforceFocus&&document.addEventListener("focusin",h),document.addEventListener("keyup",p)}),i.onBeforeUnmount(()=>{document.removeEventListener("keyup",p),document.removeEventListener("focusin",h)}),(T,A)=>(i.openBlock(),i.createBlock(i.Transition,{name:T.transition},{default:i.withCtx(()=>[i.withDirectives(i.createElementVNode("div",{tabindex:"0",class:i.normalizeClass(["vl-overlay vl-active",{"vl-full-page":T.isFullPage}]),"aria-busy":s.value,"aria-label":"Loading",style:i.normalizeStyle({zIndex:T.zIndex}),ref_key:"overlay",ref:a},[i.createElementVNode("div",{class:"vl-background",onClick:i.withModifiers(o,["prevent"]),style:i.normalizeStyle(d.value)},null,4),i.createElementVNode("div",Tc,[i.renderSlot(T.$slots,"before"),i.renderSlot(T.$slots,"default",{},()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(i.unref(bc)[T.loader]),{color:T.color,width:T.width,height:T.height},null,8,["color","width","height"]))]),i.renderSlot(T.$slots,"after")])],14,Ec),[[i.vShow,s.value]])]),_:3},8,["name"]))}}),vc=(e={},t={})=>({show(n=e,a=t){const r={...e,...n,...{programmatic:!0,lockScroll:!0,isFullPage:!1,active:!0}};let o=r.container;r.container||(o=document.body,r.isFullPage=!0);const l={...t,...a};return{hide:cc(Nc,r,o,l).ctx.hide}}}),Oc=()=>{const e=vc(),{attrs:t}=i.getCurrentInstance();let n=null;i.onUnmounted(()=>{s()});const a=()=>{const r=document.querySelector(`#${t.tId}`);n===null&&(n=e.show({canCancel:!1,isFullPage:!1,height:85,width:85,loader:"spinner",color:"#007bff",container:r}))},s=()=>{n!==null&&(n.hide(),n=null)};return{openTabLoading:a,closeTabLoading:s}},yc=ii({legacy:!1,locale:"zh-CN",fallbackLocale:"en-US"}),Lc={install(e){oc("0.1.6"),e.component("VueStackTabs",Ql).use(yc)}};J.EventType=aa,J.IFrame=ic,J.Stack=Ut,J.TabScrollMode=De,J.default=Lc,J.useStackTab=Wa,J.useTabLoading=Oc,J.useTabRouter=Ya,Object.defineProperties(J,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/package.json
CHANGED
package/src/lib/StackTabs.vue
CHANGED
|
@@ -39,7 +39,6 @@
|
|
|
39
39
|
</template>
|
|
40
40
|
|
|
41
41
|
<script lang="tsx" setup>
|
|
42
|
-
import 'vue-loading-overlay/dist/css/index.css'
|
|
43
42
|
import { onBeforeMount, onUnmounted, provide, ref, watch } from 'vue'
|
|
44
43
|
import type { TransitionProps, DefineComponent, VNode } from 'vue'
|
|
45
44
|
import { type RouteLocationNormalizedLoaded, useRouter } from 'vue-router'
|