vue-stack-tabs 0.1.0 → 0.1.1

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.
@@ -6369,17 +6369,15 @@ const Eu = () => {
6369
6369
  legacy: !1,
6370
6370
  locale: "zh-CN",
6371
6371
  fallbackLocale: "en-US"
6372
- }), Tu = {
6373
- install(e) {
6374
- du("0.1.0"), e.component("VueStackTabs", ru).use(pu);
6375
- }
6372
+ }), Tu = (e) => {
6373
+ du("0.1.1"), e.component("VueStackTabs", ru).use(pu);
6376
6374
  };
6377
6375
  export {
6378
6376
  ml as EventType,
6379
6377
  vu as IFrame,
6380
6378
  vn as Stack,
6381
6379
  it as TabScrollMode,
6382
- Tu as default,
6380
+ Tu as install,
6383
6381
  eu as useStackTab,
6384
6382
  Eu as useTabLoading,
6385
6383
  _u as useTabRouter
@@ -43,4 +43,4 @@ caused by: ${Te.fullStack(n)}`:t.stack}static info(t){yn(t);const n={},a=Te.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
- `,r="data:image/svg+xml;base64,"+lc(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(${r});background-size: 580px 100px;background-repeat: norepeat; color: transparent;`)},Ya=()=>{const{attrs:e}=c.getCurrentInstance(),{pageShown:t,getTab:n,markDeletableCache:a,removeComponent:o,getComponent:s}=yt(),r=ve.useRoute(),l=ve.useRouter();let i="",u="";return i=e.tId,u=r.query.__tab,{forward:d=>{t.value=!1;const N=ke({__tab:u},d.query);l.push({path:d.path,query:N})},backward:(d,N)=>{t.value=!1;const A=n(i);if(!A)return;const I=A.pages;let S=0;if(typeof d=="number")S=Math.abs(d);else{let E=1,b=!1;const k=I.list(),v=Rn(d);N=ke(v.query,N);for(let O=I.size()-2;O>=0;O--){if(k[O].path===v.path){b=!0;break}E+=1}b&&(S=E)}if(S===0||I.size()<=S)return;for(let E=0;E<S;E++){const b=I.pop();o(b.id),a(b.id)}const m=I==null?void 0:I.peek(),g=s(m.id);if(g!=null){const E=g.components.DynamicComponent;E.props=ke(N,E.props)}l.push({path:m.path,query:m.query})}}},cc=c.defineComponent({__name:"iframe",setup(e){return Ya(),(t,n)=>(c.openBlock(),c.createElementBlock("div"))}});var Xa={exports:{}};(function(e,t){(function(a,o){e.exports=o(c)})(Pl,n=>(()=>{var a={878:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.default=(u,p)=>{const h=u.__vccOpts||u;for(const[d,N]of p)h[d]=N;return h}},976:l=>{l.exports=n}},o={};function s(l){var i=o[l];if(i!==void 0)return i.exports;var u=o[l]={exports:{}};return a[l](u,u.exports,s),u.exports}s.d=(l,i)=>{for(var u in i)s.o(i,u)&&!s.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:i[u]})},s.o=(l,i)=>Object.prototype.hasOwnProperty.call(l,i),s.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var r={};return(()=>{s.r(r),s.d(r,{Component:()=>Me,LoadingPlugin:()=>mt,default:()=>De,useLoading:()=>ze});var l=s(976);function i(U){var Q;typeof U.remove<"u"?U.remove():(Q=U.parentNode)==null||Q.removeChild(U)}function u(U,Q,ue){let fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const _=(0,l.h)(U,Q,fe),f=document.createElement("div");return f.classList.add("vld-container"),ue.appendChild(f),(0,l.render)(_,f),_.component}function p(){return typeof window<"u"}const h=p()?window.HTMLElement:Object,d=["aria-busy"],N={class:"vl-icon"};function A(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createBlock)(l.Transition,{name:U.transition},{default:(0,l.withCtx)(()=>[(0,l.withDirectives)((0,l.createElementVNode)("div",{tabindex:"0",class:(0,l.normalizeClass)(["vl-overlay vl-active",{"vl-full-page":U.isFullPage}]),"aria-busy":U.isActive,"aria-label":"Loading",style:(0,l.normalizeStyle)({zIndex:U.zIndex})},[(0,l.createElementVNode)("div",{class:"vl-background",onClick:Q[0]||(Q[0]=(0,l.withModifiers)(function(){return U.cancel&&U.cancel(...arguments)},["prevent"])),style:(0,l.normalizeStyle)(U.bgStyle)},null,4),(0,l.createElementVNode)("div",N,[(0,l.renderSlot)(U.$slots,"before"),(0,l.renderSlot)(U.$slots,"default",{},()=>[((0,l.openBlock)(),(0,l.createBlock)((0,l.resolveDynamicComponent)(U.loader),{color:U.color,width:U.width,height:U.height},null,8,["color","width","height"]))]),(0,l.renderSlot)(U.$slots,"after")])],14,d),[[l.vShow,U.isActive]])]),_:3},8,["name"])}const I={mounted(){this.enforceFocus&&document.addEventListener("focusin",this.focusIn)},methods:{focusIn(U){if(!this.isActive||U.target===this.$el||this.$el.contains(U.target))return;let Q=this.container?this.container:this.isFullPage?null:this.$el.parentElement;(this.isFullPage||Q&&Q.contains(U.target))&&(U.preventDefault(),this.$el.focus())}},beforeUnmount(){document.removeEventListener("focusin",this.focusIn)}},S=["width","height","stroke"],g=[(0,l.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)];function E(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createElementBlock)("svg",{viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:U.width,height:U.height,stroke:U.color},g,8,S)}const b=(0,l.defineComponent)({name:"spinner",props:{color:{type:String,default:"#000"},height:{type:Number,default:64},width:{type:Number,default:64}}});var k=s(878);const O=(0,k.default)(b,[["render",E]]),T=["fill","width","height"],P=[(0,l.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)];function x(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createElementBlock)("svg",{viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:U.color,width:U.width,height:U.height},P,8,T)}const y=(0,l.defineComponent)({name:"dots",props:{color:{type:String,default:"#000"},height:{type:Number,default:240},width:{type:Number,default:60}}}),J=(0,k.default)(y,[["render",x]]),K=["height","width","fill"],ce=[(0,l.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)];function Ce(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",height:U.height,width:U.width,fill:U.color},ce,8,K)}const Ne=(0,l.defineComponent)({name:"bars",props:{color:{type:String,default:"#000"},height:{type:Number,default:40},width:{type:Number,default:40}}}),Xe={Spinner:O,Dots:J,Bars:(0,k.default)(Ne,[["render",Ce]])},tt=(0,l.defineComponent)({name:"VueLoading",mixins:[I],props:{active:Boolean,programmatic:Boolean,container:[Object,Function,h],isFullPage:{type:Boolean,default:!0},enforceFocus:{type:Boolean,default:!0},lockScroll:Boolean,transition:{type:String,default:"fade"},canCancel:Boolean,onCancel:{type:Function,default:()=>{}},color:String,backgroundColor:String,opacity:Number,width:Number,height:Number,zIndex:Number,loader:{type:String,default:"spinner"}},components:Xe,emits:["hide","update:active"],data(){return{isActive:this.active}},mounted(){document.addEventListener("keyup",this.keyPress)},methods:{cancel(){!this.canCancel||!this.isActive||(this.hide(),this.onCancel.apply(null,arguments))},hide(){this.$emit("hide"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout(()=>{const U=this.$el.parentElement;(0,l.render)(null,U),i(U)},150))},disableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.add("vl-shown")},enableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.remove("vl-shown")},keyPress(U){U.keyCode===27&&this.cancel()}},watch:{active(U){this.isActive=U},isActive:{handler(U){U?this.disableScroll():this.enableScroll()},immediate:!0}},computed:{bgStyle(){return{background:this.backgroundColor,opacity:this.opacity}}},beforeUnmount(){document.removeEventListener("keyup",this.keyPress)}}),Me=(0,k.default)(tt,[["render",A]]);function ze(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{show(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q;const f={...U,...ue,...{programmatic:!0,lockScroll:!0,isFullPage:!1,active:!0}};let L=f.container;f.container||(L=document.body,f.isFullPage=!0);const F={...Q,...fe};return{hide:u(Me,f,L,F).ctx.hide}}}}const mt=function(U){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const fe=ze(Q,ue);U.config.globalProperties.$loading=fe,U.provide("$loading",fe)},De=Me})(),r})())})(Xa);var uc=Xa.exports;const fc=()=>{const e=uc.useLoading(),{attrs:t}=c.getCurrentInstance();let n=null;c.onUnmounted(()=>{o()});const a=()=>{const s=document.querySelector(`#${t.tId}`);n===null&&(n=e.show({canCancel:!1,isFullPage:!1,height:85,width:85,loader:"spinner",color:"#007bff",container:s}))},o=()=>{n!==null&&(n.hide(),n=null)};return{openTabLoading:a,closeTabLoading:o}},dc=il({legacy:!1,locale:"zh-CN",fallbackLocale:"en-US"}),mc={install(e){ic("0.1.0"),e.component("VueStackTabs",tc).use(dc)}};ee.EventType=sa,ee.IFrame=cc,ee.Stack=Ut,ee.TabScrollMode=He,ee.default=mc,ee.useStackTab=Wa,ee.useTabLoading=fc,ee.useTabRouter=Ya,Object.defineProperties(ee,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
46
+ `,r="data:image/svg+xml;base64,"+lc(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(${r});background-size: 580px 100px;background-repeat: norepeat; color: transparent;`)},Ya=()=>{const{attrs:e}=c.getCurrentInstance(),{pageShown:t,getTab:n,markDeletableCache:a,removeComponent:o,getComponent:s}=yt(),r=ve.useRoute(),l=ve.useRouter();let i="",u="";return i=e.tId,u=r.query.__tab,{forward:d=>{t.value=!1;const N=ke({__tab:u},d.query);l.push({path:d.path,query:N})},backward:(d,N)=>{t.value=!1;const A=n(i);if(!A)return;const I=A.pages;let S=0;if(typeof d=="number")S=Math.abs(d);else{let E=1,b=!1;const k=I.list(),v=Rn(d);N=ke(v.query,N);for(let O=I.size()-2;O>=0;O--){if(k[O].path===v.path){b=!0;break}E+=1}b&&(S=E)}if(S===0||I.size()<=S)return;for(let E=0;E<S;E++){const b=I.pop();o(b.id),a(b.id)}const m=I==null?void 0:I.peek(),g=s(m.id);if(g!=null){const E=g.components.DynamicComponent;E.props=ke(N,E.props)}l.push({path:m.path,query:m.query})}}},cc=c.defineComponent({__name:"iframe",setup(e){return Ya(),(t,n)=>(c.openBlock(),c.createElementBlock("div"))}});var Xa={exports:{}};(function(e,t){(function(a,o){e.exports=o(c)})(Pl,n=>(()=>{var a={878:(l,i)=>{Object.defineProperty(i,"__esModule",{value:!0}),i.default=(u,p)=>{const h=u.__vccOpts||u;for(const[d,N]of p)h[d]=N;return h}},976:l=>{l.exports=n}},o={};function s(l){var i=o[l];if(i!==void 0)return i.exports;var u=o[l]={exports:{}};return a[l](u,u.exports,s),u.exports}s.d=(l,i)=>{for(var u in i)s.o(i,u)&&!s.o(l,u)&&Object.defineProperty(l,u,{enumerable:!0,get:i[u]})},s.o=(l,i)=>Object.prototype.hasOwnProperty.call(l,i),s.r=l=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(l,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(l,"__esModule",{value:!0})};var r={};return(()=>{s.r(r),s.d(r,{Component:()=>Me,LoadingPlugin:()=>mt,default:()=>De,useLoading:()=>ze});var l=s(976);function i(U){var Q;typeof U.remove<"u"?U.remove():(Q=U.parentNode)==null||Q.removeChild(U)}function u(U,Q,ue){let fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const _=(0,l.h)(U,Q,fe),f=document.createElement("div");return f.classList.add("vld-container"),ue.appendChild(f),(0,l.render)(_,f),_.component}function p(){return typeof window<"u"}const h=p()?window.HTMLElement:Object,d=["aria-busy"],N={class:"vl-icon"};function A(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createBlock)(l.Transition,{name:U.transition},{default:(0,l.withCtx)(()=>[(0,l.withDirectives)((0,l.createElementVNode)("div",{tabindex:"0",class:(0,l.normalizeClass)(["vl-overlay vl-active",{"vl-full-page":U.isFullPage}]),"aria-busy":U.isActive,"aria-label":"Loading",style:(0,l.normalizeStyle)({zIndex:U.zIndex})},[(0,l.createElementVNode)("div",{class:"vl-background",onClick:Q[0]||(Q[0]=(0,l.withModifiers)(function(){return U.cancel&&U.cancel(...arguments)},["prevent"])),style:(0,l.normalizeStyle)(U.bgStyle)},null,4),(0,l.createElementVNode)("div",N,[(0,l.renderSlot)(U.$slots,"before"),(0,l.renderSlot)(U.$slots,"default",{},()=>[((0,l.openBlock)(),(0,l.createBlock)((0,l.resolveDynamicComponent)(U.loader),{color:U.color,width:U.width,height:U.height},null,8,["color","width","height"]))]),(0,l.renderSlot)(U.$slots,"after")])],14,d),[[l.vShow,U.isActive]])]),_:3},8,["name"])}const I={mounted(){this.enforceFocus&&document.addEventListener("focusin",this.focusIn)},methods:{focusIn(U){if(!this.isActive||U.target===this.$el||this.$el.contains(U.target))return;let Q=this.container?this.container:this.isFullPage?null:this.$el.parentElement;(this.isFullPage||Q&&Q.contains(U.target))&&(U.preventDefault(),this.$el.focus())}},beforeUnmount(){document.removeEventListener("focusin",this.focusIn)}},S=["width","height","stroke"],g=[(0,l.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)];function E(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createElementBlock)("svg",{viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",width:U.width,height:U.height,stroke:U.color},g,8,S)}const b=(0,l.defineComponent)({name:"spinner",props:{color:{type:String,default:"#000"},height:{type:Number,default:64},width:{type:Number,default:64}}});var k=s(878);const O=(0,k.default)(b,[["render",E]]),T=["fill","width","height"],P=[(0,l.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)];function x(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createElementBlock)("svg",{viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:U.color,width:U.width,height:U.height},P,8,T)}const y=(0,l.defineComponent)({name:"dots",props:{color:{type:String,default:"#000"},height:{type:Number,default:240},width:{type:Number,default:60}}}),J=(0,k.default)(y,[["render",x]]),K=["height","width","fill"],ce=[(0,l.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)];function Ce(U,Q,ue,fe,_,f){return(0,l.openBlock)(),(0,l.createElementBlock)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",height:U.height,width:U.width,fill:U.color},ce,8,K)}const Ne=(0,l.defineComponent)({name:"bars",props:{color:{type:String,default:"#000"},height:{type:Number,default:40},width:{type:Number,default:40}}}),Xe={Spinner:O,Dots:J,Bars:(0,k.default)(Ne,[["render",Ce]])},tt=(0,l.defineComponent)({name:"VueLoading",mixins:[I],props:{active:Boolean,programmatic:Boolean,container:[Object,Function,h],isFullPage:{type:Boolean,default:!0},enforceFocus:{type:Boolean,default:!0},lockScroll:Boolean,transition:{type:String,default:"fade"},canCancel:Boolean,onCancel:{type:Function,default:()=>{}},color:String,backgroundColor:String,opacity:Number,width:Number,height:Number,zIndex:Number,loader:{type:String,default:"spinner"}},components:Xe,emits:["hide","update:active"],data(){return{isActive:this.active}},mounted(){document.addEventListener("keyup",this.keyPress)},methods:{cancel(){!this.canCancel||!this.isActive||(this.hide(),this.onCancel.apply(null,arguments))},hide(){this.$emit("hide"),this.$emit("update:active",!1),this.programmatic&&(this.isActive=!1,setTimeout(()=>{const U=this.$el.parentElement;(0,l.render)(null,U),i(U)},150))},disableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.add("vl-shown")},enableScroll(){this.isFullPage&&this.lockScroll&&document.body.classList.remove("vl-shown")},keyPress(U){U.keyCode===27&&this.cancel()}},watch:{active(U){this.isActive=U},isActive:{handler(U){U?this.disableScroll():this.enableScroll()},immediate:!0}},computed:{bgStyle(){return{background:this.backgroundColor,opacity:this.opacity}}},beforeUnmount(){document.removeEventListener("keyup",this.keyPress)}}),Me=(0,k.default)(tt,[["render",A]]);function ze(){let U=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return{show(){let ue=arguments.length>0&&arguments[0]!==void 0?arguments[0]:U,fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Q;const f={...U,...ue,...{programmatic:!0,lockScroll:!0,isFullPage:!1,active:!0}};let L=f.container;f.container||(L=document.body,f.isFullPage=!0);const F={...Q,...fe};return{hide:u(Me,f,L,F).ctx.hide}}}}const mt=function(U){let Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const fe=ze(Q,ue);U.config.globalProperties.$loading=fe,U.provide("$loading",fe)},De=Me})(),r})())})(Xa);var uc=Xa.exports;const fc=()=>{const e=uc.useLoading(),{attrs:t}=c.getCurrentInstance();let n=null;c.onUnmounted(()=>{o()});const a=()=>{const s=document.querySelector(`#${t.tId}`);n===null&&(n=e.show({canCancel:!1,isFullPage:!1,height:85,width:85,loader:"spinner",color:"#007bff",container:s}))},o=()=>{n!==null&&(n.hide(),n=null)};return{openTabLoading:a,closeTabLoading:o}},dc=il({legacy:!1,locale:"zh-CN",fallbackLocale:"en-US"}),mc=e=>{ic("0.1.1"),e.component("VueStackTabs",tc).use(dc)};ee.EventType=sa,ee.IFrame=cc,ee.Stack=Ut,ee.TabScrollMode=He,ee.install=mc,ee.useStackTab=Wa,ee.useTabLoading=fc,ee.useTabRouter=Ya,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-stack-tabs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Vue.js component for router tab.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -9,7 +9,8 @@
9
9
  "dist",
10
10
  "types"
11
11
  ],
12
- "main": "dist/vue-stack-tabs.es.js",
12
+ "main": "dist/vue-stack-tabs.umd.js",
13
+ "module": "dist/vue-stack-tabs.es.js",
13
14
  "types": "types/index.d.ts",
14
15
  "repository": {
15
16
  "type": "git",
@@ -38,7 +39,11 @@
38
39
  "lz-string": "^1.5.0",
39
40
  "ulidx": "^2.3.0",
40
41
  "uuid": "^9.0.1",
41
- "vue-i18n": "^9.9.1"
42
+ "vue-i18n": "^9.9.1",
43
+ "vue-stack-tabs": "^0.1.0",
44
+ "vue": "^3.4.19",
45
+ "vue-loading-overlay": "^6.0.4",
46
+ "vue-router": "^4.2.5"
42
47
  },
43
48
  "devDependencies": {
44
49
  "@mdit/plugin-tasklist": "^0.8.0",
@@ -61,7 +66,6 @@
61
66
  "markdown-it": "^14.0.0",
62
67
  "normalize.css": "^8.0.1",
63
68
  "npm-run-all2": "^6.1.2",
64
- "pinia": "^2.1.7",
65
69
  "prettier": "^3.2.5",
66
70
  "sass": "^1.71.1",
67
71
  "sass-loader": "^14.1.1",
@@ -72,9 +76,6 @@
72
76
  "vite-plugin-dts": "^3.7.3",
73
77
  "vite-plugin-package-version": "^1.1.0",
74
78
  "vitepress": "1.0.0-rc.44",
75
- "vue": "^3.4.19",
76
- "vue-loading-overlay": "^6.0.4",
77
- "vue-router": "^4.2.5",
78
79
  "vue-tsc": "^1.8.27"
79
80
  },
80
81
  "scripts": {
@@ -40,16 +40,8 @@
40
40
 
41
41
  <script lang="tsx" setup>
42
42
  import 'vue-loading-overlay/dist/css/index.css'
43
- import {
44
- type DefineComponent,
45
- onBeforeMount,
46
- onUnmounted,
47
- provide,
48
- ref,
49
- type VNode,
50
- watch
51
- } from 'vue'
52
- import type { TransitionProps } from 'vue'
43
+ import { onBeforeMount, onUnmounted, provide, ref, watch } from 'vue'
44
+ import type { TransitionProps, DefineComponent, VNode } from 'vue'
53
45
  import { type RouteLocationNormalizedLoaded, useRouter } from 'vue-router'
54
46
  import { getMaxZIndex } from '@/lib/utils/TabScrollHelper'
55
47
  import { type ITabData, TabScrollMode } from '@/lib/model/TabModel'
package/src/lib/index.ts CHANGED
@@ -1,10 +1,7 @@
1
1
  import type { App } from 'vue'
2
2
  import { createI18n } from 'vue-i18n'
3
3
  import StackTab from './StackTabs.vue'
4
- // import VueEmttier from './hooks/useMitt'
5
4
  import tabVersion from './banner'
6
- // import './assets/style/index.scss'
7
- // import 'vue-loading-overlay/dist/css/index.css'
8
5
  import IFrame from './iframe.vue'
9
6
  import useTabLoading from './hooks/useTabLoading'
10
7
  import useTabRouter from './hooks/useTabRouter'
@@ -15,11 +12,10 @@ const i18n = createI18n({
15
12
  locale: 'zh-CN',
16
13
  fallbackLocale: 'en-US'
17
14
  })
18
- export { IFrame, useTabLoading, useTabRouter, useStackTab }
19
- export * from './model/TabModel'
20
- export default {
21
- install(app: App): void {
22
- tabVersion(import.meta.env.PACKAGE_VERSION)
23
- app.component('VueStackTabs', StackTab).use(i18n)
24
- }
15
+ const install = (app: App): void => {
16
+ tabVersion(import.meta.env.PACKAGE_VERSION)
17
+ app.component('VueStackTabs', StackTab).use(i18n)
25
18
  }
19
+
20
+ export * from './model/TabModel'
21
+ export { IFrame, useTabLoading, useTabRouter, useStackTab, install }
package/types/index.d.ts CHANGED
@@ -2,9 +2,6 @@ import IFrame from './iframe.vue';
2
2
  import useTabLoading from './hooks/useTabLoading';
3
3
  import useTabRouter from './hooks/useTabRouter';
4
4
  import useStackTab from './hooks/useStackTab';
5
- export { IFrame, useTabLoading, useTabRouter, useStackTab };
5
+ declare const install: (app: App) => void;
6
6
  export * from './model/TabModel';
7
- declare const _default: {
8
- install(app: App): void;
9
- };
10
- export default _default;
7
+ export { IFrame, useTabLoading, useTabRouter, useStackTab, install };