@fox-js/navigation 4.0.1-10 → 4.0.1-11

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.
package/dist/index.cjs.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";/*!
2
- * @fox-js/navigation v4.0.1-9 Tue Feb 27 2024 11:12:56 GMT+0800 (中国标准时间)
3
- */const s=require("vue"),L=require("@fox-js/fox"),W=s.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!1}},setup(t){return(e,o)=>{const n=s.resolveComponent("fox-router-view");return s.openBlock(),s.createBlock(n,{class:"fox-card-navigator","view-class":"fox-card-navigator__item","view-active-class":"fox-card-navigator__item-active","view-inactive-class":"fox-card-navigator__item-inactive","transition-name":"fox-card-navigator__trans",transition:e.transition,multi:!0,name:e.routerViewName},null,8,["transition","name"])}}}),N=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"})),k=s.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!0}},setup(t){return(e,o)=>{const n=s.resolveComponent("fox-router-view");return s.openBlock(),s.createBlock(n,{transition:!1,multi:!1,name:e.routerViewName},{default:s.withCtx(({Component:r})=>[s.createVNode(s.Transition,{name:"fox-default-navigator__trans"},{default:s.withCtx(()=>[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(r)))]),_:2},1024)]),_:1},8,["name"])}}}),F=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"})),S=10;function U(t,e){return t>e&&t>S?"horizontal":e>t&&e>S?"vertical":""}function V(){const t={startX:0,startY:0,startTime:0,duration:0,moveX:0,moveY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0,direction:""},e=()=>t.direction==="vertical",o=()=>t.direction==="horizontal",n=()=>{t.deltaX=0,t.deltaY=0,t.offsetX=0,t.offsetY=0,t.direction="",t.startTime=0};return{move:p=>{if(p.touches){const l=p.touches[0];t.deltaX=l.clientX-t.startX,t.deltaY=l.clientY-t.startY,t.moveX=l.clientX,t.moveY=l.clientY}else t.deltaX=p.clientX-t.startX,t.deltaY=p.clientY-t.startY,t.moveX=p.clientX,t.moveY=p.clientY;t.offsetX=Math.abs(t.deltaX),t.offsetY=Math.abs(t.deltaY),t.duration=Date.now()-t.startTime,t.direction||(t.direction=U(t.offsetX,t.offsetY))},start:p=>{if(n(),p.touches){const l=p.touches[0];t.startX=l.clientX,t.startY=l.clientY}else t.startX=p.clientX,t.startY=p.clientY;t.startTime=Date.now()},reset:n,isVertical:e,isHorizontal:o,state:t}}function j(t){return t===window}const q=t=>{const e=s.unref(t);if(j(e)){const o=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:o,bottom:n,width:o,height:n}}return e&&e.getBoundingClientRect?e.getBoundingClientRect():{top:0,left:0,right:0,bottom:0,width:0,height:0}},H=15,G=300,J=200;function K(t){t.stopPropagation()}function Q(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&K(t)}function Z(t,e,o=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*o}function P(t,e=0,o,n=J){o==="end"?t.style.transition=`transform ${n}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}const C=new WeakMap;function tt(t,e,o,n,r=500,f,p=1e3){const l={active:!0,startDistance:0,scrollDistance:0,scrollTime:0,moving:!1,transitionEndTrigger:null},_=t.previousSibling,m=V(),g=(a,v,y,x)=>{let D=v+l.startDistance;if(y==="end"){const c=q(a);let T=c.width*e;D<T?D=0:D=c.width;let w=!1;x&&x>0&&(w=!0,l.transitionEndTrigger=()=>{l.moving=!1,f&&a.classList.remove(f),D>0&&typeof n=="function"&&n()}),P(a,D,"end",x),_&&P(_,0,"",0),!w&&D>0&&typeof n=="function"&&(l.moving=!1,n())}else D<0&&(D=0),P(a,D,"",0)},i=()=>{t.style.transform="",t.style.transition="",l.transitionEndTrigger?(l.transitionEndTrigger(),l.transitionEndTrigger=null,_&&setTimeout(()=>{_&&(_.style.transform="",_.style.transition="")},r)):_&&(_.style.transform="",_.style.transition="")},u=/^matrix\((.+)\)$/,h=a=>{if(m.start(a),l.scrollDistance=0,l.moving){const v=t,{transform:y}=window.getComputedStyle(v);if(y){const x=u.exec(y);if(x){const c=x[1].split(/,\s*/);l.scrollDistance=+c[4]}}}f&&t.classList.add(f),l.startDistance=l.scrollDistance,l.transitionEndTrigger=null,l.moving=!0},b=a=>{l.moving=!0,m.move(a),!m.isVertical()&&(Q(a,!0),g(t,m.state.deltaX,"",0))},d=()=>{if(m.isVertical()){g(t,0,"end",p);return}const a=m.state.deltaX;if(a===0){f&&t.classList.remove(f),l.moving=!1;return}const v=m.state.duration;if(v<G&&Math.abs(a)>H){const x=Z(a,v,o);g(t,x,"end",p)}else g(t,a,"end",p)};t.addEventListener("transitionend",i),t.addEventListener("touchstart",h),t.addEventListener("touchmove",b),t.addEventListener("touchend",d),t.addEventListener("touchcancel",d),C.set(t,{state:l,transitionend:i,touchstart:h,touchmove:b,touchend:d,touchcancel:d})}function et(t){const e=C.get(t);e&&(C.delete(t),t.addEventListener("transitionend",e.transitionend),t.addEventListener("touchstart",e.touchstart),t.addEventListener("touchmove",e.touchmove),t.addEventListener("touchend",e.touchend),t.addEventListener("touchcancel",e.touchcancel))}const nt=s.defineComponent({__name:"index",props:{dragRemove:{type:Boolean,default:!0},removeViewPage:{},removeMoveRatio:{default:.5},momentumReduceRatio:{default:1},removeViewPageDuration:{default:500},routerViewName:{},viewTag:{type:[Function,String],default:"div"},transition:{type:[Function,Boolean],default:!0},viewClass:{default:"fox-root-navigator__item"}},setup(t){const e=t;let o=null,n=null;function r(i){return(i.params&&i.params.animationType)??"slide"}const f=(i,u,h,b)=>{if(h.opsType===L.OperationType.Append||u){const d=r(h);if(d==="pop"&&u)return;const a=u?"show":"enter";if(a==="enter"&&(o=h),a==="show"&&n&&r(n)==="pop")return;const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-active`;i.classList.add(v),i.classList.add(y)}},p=(i,u,h,b)=>{if(h.opsType===L.OperationType.Append||u){const d=r(h);if(d==="pop"&&u)return;const a=u?"show":"enter";if(a==="show"&&n&&r(n)==="pop")return;const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-to`;i.classList.remove(v),i.classList.add(y)}},l=(i,u,h,b)=>{if(h.opsType===L.OperationType.Append||u){const d=r(h);if(d!=="pop"||!u){const a=u?"show":"enter",v=`fox-root-navigator__${d}-${a}-active`,y=`fox-root-navigator__${d}-${a}-to`;i.classList.remove(v),i.classList.remove(y)}}e.dragRemove&&!u&&h.opsType===L.OperationType.Append&&tt(i,e.removeMoveRatio,e.momentumReduceRatio,e.removeViewPage,e.removeViewPageDuration,"fox-root-navigator__item-moving",1e3)},_=(i,u,h,b)=>{if(h.opsType===L.OperationType.Append||u){const d=r(h);if(d==="pop"&&u)return;const a=u?"hide":"leave";if(a==="leave"&&(n=h),a==="hide"&&o&&r(o)==="pop")return;const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-active`;i.classList.add(v),i.classList.add(y)}},m=(i,u,h,b)=>{if(h.opsType===L.OperationType.Append||u){const d=r(h);if(d==="pop"&&u)return;const a=u?"hide":"leave";if(a==="hide"&&o&&r(o)==="pop")return;const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-to`;i.classList.remove(v),i.classList.add(y)}},g=(i,u,h,b)=>{if(h.opsType===L.OperationType.Append||u){const d=r(h);if(d!=="pop"||!u){const a=u?"hide":"leave",v=`fox-root-navigator__${d}-${a}-active`,y=`fox-root-navigator__${d}-${a}-to`;i.classList.remove(v),i.classList.remove(y)}}e.dragRemove&&!u&&et(i)};return(i,u)=>{const h=s.resolveComponent("fox-router-view");return s.openBlock(),s.createBlock(h,{class:"fox-root-navigator","view-class":i.viewClass,"before-enter":f,enter:p,"after-enter":l,"before-leave":_,leave:m,"after-leave":g,multi:!0,name:i.routerViewName,"view-tag":i.viewTag,transition:i.transition},null,8,["view-class","name","view-tag","transition"])}}}),ot=Object.freeze(Object.defineProperty({__proto__:null,default:nt},Symbol.toStringTag,{value:"Module"})),it={class:"fox-swiper-navigator"},st=s.defineComponent({__name:"swiper",props:{width:{},scrollDistance:{},scrollDuration:{},direction:{}},setup(t){const e=t,o=s.computed(()=>{const n={transform:`translate3d(${e.scrollDistance}px, 0, 0)`,width:`${e.width}`};return e.scrollDuration>0&&(n["transition-duration"]=`${e.scrollDuration}ms`),n});return(n,r)=>(s.openBlock(),s.createElementBlock("div",it,[s.createElementVNode("div",{class:"fox-swiper-navigator__inner",style:s.normalizeStyle(o.value)},[s.renderSlot(n.$slots,"default")],4)]))}});let at=0;function rt(){return++at}const ct=15,lt=300,ut=200;function dt(t){t.stopPropagation()}function ft(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&dt(t)}function ht(t,e,o=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*o}function X(t,e=0,o,n=ut){o==="end"?t.style.transition=`transform ${n}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}class pt{width=0;columnWidth=0;max=0;min=0;el=null;swipeDuration=360;transitionEndTrigger=null;moving=!1;startDistance=0;scrollDistance=0;getStartDistance;openPage;isPageOpened;pageOpened;moveRatio=.5;momentumReduceRatio=1;transitionend=null;touchstart=null;touchmove=null;touchend=null;touchcancel=null;constructor(e,o,n,r,f,p){this.getStartDistance=e,this.openPage=o,this.isPageOpened=n,this.pageOpened=r,this.moveRatio=f,this.momentumReduceRatio=p}open(){const e=this.el,o=V(),n=(r,f,p,l)=>{let _=f+this.startDistance;const m=this.columnWidth*this.moveRatio;if(p==="end"){if(f==0){this.moving=!1;return}Math.abs(f)>m?f>0?_=this.startDistance+this.columnWidth:_=this.startDistance-this.columnWidth:_=this.startDistance;let g=-_;g<0?g=0:g>this.width-this.columnWidth&&(g=this.width-this.columnWidth);const i=Math.floor(g/this.columnWidth);this.isPageOpened(i)||this.openPage(i),_=-i*this.columnWidth,l&&l>0&&(this.transitionEndTrigger=()=>{this.moving=!1,this.pageOpened(i)}),X(r,_,"end",l),this.scrollDistance=_}else{if(Math.abs(f)>m){let i=0;if(f>0?i=Math.abs(this.startDistance+this.columnWidth):i=Math.abs(this.startDistance-this.columnWidth),i>=0&&i<this.width){const u=Math.floor(i/this.columnWidth);this.isPageOpened(u)||this.openPage(u)}}let g=-_;g<this.min?g=this.min:g>this.max&&(g=this.max),X(r,-g,"",0)}};this.transitionend=()=>{e.style.transition="",this.transitionEndTrigger&&(this.transitionEndTrigger(),this.transitionEndTrigger=null)},this.touchstart=r=>{this.moving||(o.start(r),this.startDistance=this.getStartDistance(),this.transitionEndTrigger=null,this.moving=!0)},this.touchmove=r=>{o.move(r),!o.isVertical()&&(ft(r,!0),n(e,o.state.deltaX,"",0))},this.touchend=()=>{if(o.isVertical()){n(e,0,"end",this.swipeDuration);return}const r=o.state.deltaX;if(r==0)return;const f=o.state.duration;if(f<lt&&Math.abs(r)>ct){const l=ht(r,f,this.momentumReduceRatio);n(e,l,"end",this.swipeDuration)}else n(e,r,"end",this.swipeDuration)},e.addEventListener("transitionend",this.transitionend),e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchmove",this.touchmove),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchend)}close(){const e=this.el;this.transitionend&&e.addEventListener("transitionend",this.transitionend),this.touchstart&&e.addEventListener("touchstart",this.touchstart),this.touchmove&&e.addEventListener("touchmove",this.touchmove),this.touchend&&e.addEventListener("touchend",this.touchend),this.touchcancel&&e.addEventListener("touchcancel",this.touchcancel),this.el=null}}function mt(t,e,o,n,r,f){return new pt(t,e,o,n,r,f)}function gt(t){const e=s.unref(t),o=window.getComputedStyle(e,null),n=parseFloat(o.getPropertyValue("padding-left")),r=parseFloat(o.getPropertyValue("padding-right")),f=parseFloat(o.getPropertyValue("padding-top")),p=parseFloat(o.getPropertyValue("padding-bottom"));return{width:e.clientWidth-n-r,height:e.clientHeight-f-p}}const vt=s.defineComponent({__name:"index",props:{activePath:{},routes:{},height:{default:-1},width:{default:-1},draggable:{type:Boolean,default:!0},openViewPage:{},routerViewName:{},moveRatio:{default:.5},momentumReduceRatio:{default:1},direction:{default:"horizontal"},transition:{type:[Function,Boolean],default:!0},swipeDuration:{default:360},scrollDuration:{},customClass:{},customStyle:{}},emits:["update:activePath"],setup(t,{emit:e}){const o=t,n=s.reactive({scrollDistance:0,index:-1,openedIndexList:[],width:o.width,height:o.height}),r=e,f=()=>n.scrollDistance,p=c=>{if(n.openedIndexList.indexOf(c)===-1){n.openedIndexList.push(c);const T=o.routes[c];try{o.openViewPage(T,c)}catch(w){console.error(w)}}},l=c=>n.openedIndexList.indexOf(c)!==-1,_=c=>{n.index=c,n.width>0?n.scrollDistance=-n.index*n.width:n.scrollDistance=0;const T=o.routes[c];r("update:activePath",T.path)};let m=null;o.draggable&&(m=mt(f,p,l,_,o.moveRatio,o.momentumReduceRatio));let g=null;s.onMounted(()=>{const c=a(),T=()=>{const w=gt(c);i(o.activePath,o.routes,w.width,w.height,o.swipeDuration,o.direction)};if(window.ResizeObserver&&(g=new window.ResizeObserver(T),g.observe(c)),T(),m){const w=y();m.el=w,m.open()}}),s.onBeforeUnmount(()=>{g&&(g.disconnect(),g=null),m&&m.close()}),s.watch([()=>o.activePath,()=>o.routes,()=>o.width,()=>o.height,()=>o.swipeDuration,()=>o.direction],([c,T,w,$,M,R])=>{const O=w<=0?n.width:w,E=$<=0?n.height:$;i(c,T,O,E,M,R)});const i=(c,T,w,$,M,R="horizontal")=>{const O=c;if(n.index=T.findIndex(E=>E.path===O),R==="horizontal"){const E=w;if(E>0){n.width=w;const B=E*o.routes.length,z=-E/3,Y=E*(T.length-1)+E/3;m&&(m.columnWidth=E,m.width=B,m.min=z,m.max=Y),n.index!==-1&&(n.openedIndexList.push(n.index),n.scrollDistance=-E*n.index)}}m&&(m.swipeDuration=M)},u=`fox-swiper-navigator-${rt()}`,h=s.computed(()=>{const c=[u];return o.customClass&&c.push(o.customClass),c}),b=s.computed(()=>{const c={},T=n.width>0?n.width:o.width;T>0&&(c.width=`${T}px`);const w=n.height>0?n.height:o.height;return w>0&&(c.height=`${w}px`),o.customStyle&&Object.assign(c,o.customStyle),c});let d=null;function a(){return d||(d=document.querySelector(`.${u}`),d)}let v=null;function y(){return v||(v=document.querySelector(`.${u}>.fox-swiper-navigator__inner`),v)}const x=s.computed(()=>n.width>0?`${n.width*o.routes.length}px`:"100%"),D=(c,T)=>{const w=o.routes.findIndex($=>{const M=c.path??c.name??"";return $.path==M});return n.width<=0?{}:{style:{left:`${w*n.width}px`,width:`${n.width}px`}}};return(c,T)=>{const w=s.resolveComponent("fox-router-view");return s.openBlock(),s.createBlock(w,{class:s.normalizeClass(h.value),style:s.normalizeStyle(b.value),"view-class":"fox-swiper-navigator__item",tag:st,"view-tag-props":D,multi:!0,name:c.routerViewName,transition:c.transition,"scroll-distance":n.scrollDistance,"scroll-duration":c.scrollDuration,direction:c.direction,width:x.value},null,8,["class","style","name","transition","scroll-distance","scroll-duration","direction","width"])}}}),_t=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"}));let wt="fox-";const yt=[],I=Object.assign({"/src/components/card-navigator/index.vue":N,"/src/components/default-navigator/index.vue":F,"/src/components/root-navigator/index.vue":ot,"/src/components/swiper-navigator/index.vue":_t}),A=[];for(const t in I){let e=/src\/components\/(.*)\/index.vue/.exec(t)[1];yt.indexOf(e)===-1&&A.push({name:e,component:I[t].default})}const Tt={install(t){A.forEach(e=>{t.component(`${wt}${e.name}`,e.component)})}};module.exports=Tt;
2
+ * @fox-js/navigation v4.0.1-10 Tue Mar 12 2024 21:40:43 GMT+0800 (中国标准时间)
3
+ */const a=require("vue"),L=require("@fox-js/fox"),W=a.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!1}},setup(t){return(e,n)=>{const o=a.resolveComponent("fox-router-view");return a.openBlock(),a.createBlock(o,{class:"fox-card-navigator","view-class":"fox-card-navigator__item","view-active-class":"fox-card-navigator__item-active","view-inactive-class":"fox-card-navigator__item-inactive","transition-name":"fox-card-navigator__trans",transition:e.transition,multi:!0,name:e.routerViewName},null,8,["transition","name"])}}}),N=Object.freeze(Object.defineProperty({__proto__:null,default:W},Symbol.toStringTag,{value:"Module"})),k=a.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!0}},setup(t){return(e,n)=>{const o=a.resolveComponent("fox-router-view");return a.openBlock(),a.createBlock(o,{transition:!1,multi:!1,name:e.routerViewName},{default:a.withCtx(({Component:r})=>[a.createVNode(a.Transition,{name:"fox-default-navigator__trans"},{default:a.withCtx(()=>[(a.openBlock(),a.createBlock(a.resolveDynamicComponent(r)))]),_:2},1024)]),_:1},8,["name"])}}}),F=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"})),S=10;function U(t,e){return t>e&&t>S?"horizontal":e>t&&e>S?"vertical":""}function I(){const t={startX:0,startY:0,startTime:0,duration:0,moveX:0,moveY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0,direction:""},e=()=>t.direction==="vertical",n=()=>t.direction==="horizontal",o=()=>{t.deltaX=0,t.deltaY=0,t.offsetX=0,t.offsetY=0,t.direction="",t.startTime=0};return{move:p=>{if(p.touches){const l=p.touches[0];t.deltaX=l.clientX-t.startX,t.deltaY=l.clientY-t.startY,t.moveX=l.clientX,t.moveY=l.clientY}else t.deltaX=p.clientX-t.startX,t.deltaY=p.clientY-t.startY,t.moveX=p.clientX,t.moveY=p.clientY;t.offsetX=Math.abs(t.deltaX),t.offsetY=Math.abs(t.deltaY),t.duration=Date.now()-t.startTime,t.direction||(t.direction=U(t.offsetX,t.offsetY))},start:p=>{if(o(),p.touches){const l=p.touches[0];t.startX=l.clientX,t.startY=l.clientY}else t.startX=p.clientX,t.startY=p.clientY;t.startTime=Date.now()},reset:o,isVertical:e,isHorizontal:n,state:t}}function j(t){return t===window}const q=t=>{const e=a.unref(t);if(j(e)){const n=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}return e&&e.getBoundingClientRect?e.getBoundingClientRect():{top:0,left:0,right:0,bottom:0,width:0,height:0}},H=15,G=300,J=200;function K(t){t.stopPropagation()}function Q(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&K(t)}function Z(t,e,n=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*n}function P(t,e=0,n,o=J){n==="end"?t.style.transition=`transform ${o}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}const C=new WeakMap;function tt(t,e,n,o,r=500,f,p=1e3){const l={active:!0,startDistance:0,scrollDistance:0,scrollTime:0,moving:!1,transitionEndTrigger:null},_=t.previousSibling,m=I(),g=(s,v,y,x)=>{let D=v+l.startDistance;if(y==="end"){const c=q(s);let T=c.width*e;D<T?D=0:D=c.width;let w=!1;x&&x>0&&(w=!0,l.transitionEndTrigger=()=>{l.moving=!1,f&&s.classList.remove(f),D>0&&typeof o=="function"&&o()}),P(s,D,"end",x),_&&P(_,0,"",0),!w&&D>0&&typeof o=="function"&&(l.moving=!1,o())}else D<0&&(D=0),P(s,D,"",0)},i=()=>{t.style.transform="",t.style.transition="",l.transitionEndTrigger?(l.transitionEndTrigger(),l.transitionEndTrigger=null,_&&setTimeout(()=>{_&&(_.style.transform="",_.style.transition="")},r)):_&&(_.style.transform="",_.style.transition="")},d=/^matrix\((.+)\)$/,h=s=>{if(m.start(s),l.scrollDistance=0,l.moving){const v=t,{transform:y}=window.getComputedStyle(v);if(y){const x=d.exec(y);if(x){const c=x[1].split(/,\s*/);l.scrollDistance=+c[4]}}}f&&t.classList.add(f),l.startDistance=l.scrollDistance,l.transitionEndTrigger=null,l.moving=!0},b=s=>{l.moving=!0,m.move(s),!m.isVertical()&&(Q(s,!0),g(t,m.state.deltaX,"",0))},u=()=>{if(m.isVertical()){g(t,0,"end",p);return}const s=m.state.deltaX;if(s===0){f&&t.classList.remove(f),l.moving=!1;return}const v=m.state.duration;if(v<G&&Math.abs(s)>H){const x=Z(s,v,n);g(t,x,"end",p)}else g(t,s,"end",p)};t.addEventListener("transitionend",i),t.addEventListener("touchstart",h),t.addEventListener("touchmove",b),t.addEventListener("touchend",u),t.addEventListener("touchcancel",u),C.set(t,{state:l,transitionend:i,touchstart:h,touchmove:b,touchend:u,touchcancel:u})}function et(t){const e=C.get(t);e&&(C.delete(t),t.addEventListener("transitionend",e.transitionend),t.addEventListener("touchstart",e.touchstart),t.addEventListener("touchmove",e.touchmove),t.addEventListener("touchend",e.touchend),t.addEventListener("touchcancel",e.touchcancel))}const nt=a.defineComponent({__name:"index",props:{dragRemove:{type:Boolean,default:!0},removeViewPage:{},removeMoveRatio:{default:.5},momentumReduceRatio:{default:1},removeViewPageDuration:{default:500},routerViewName:{},viewTag:{type:[Function,String],default:"div"},transition:{type:[Function,Boolean],default:!0},viewClass:{type:[Function,String],default:"fox-root-navigator__item"}},setup(t){const e=t;let n=null,o=null;function r(i){return(i.params&&i.params.animationType)??"slide"}const f=(i,d,h,b)=>{if(h.opsType===L.OperationType.Append||d){const u=r(h),s=d?"show":"enter";if(s==="show"&&(u==="pop"||o!=="leave"||(n?r(n):"")==="pop"))return;s==="enter"&&(n=h,o="enter");const v=`fox-root-navigator__${u}-${s}-from`,y=`fox-root-navigator__${u}-${s}-active`;i.classList.add(v),i.classList.add(y)}},p=(i,d,h,b)=>{if(h.opsType===L.OperationType.Append||d){const u=r(h),s=d?"show":"enter";if(s==="show"&&(u==="pop"||o!=="leave"||(n?r(n):"")==="pop"))return;const v=`fox-root-navigator__${u}-${s}-from`,y=`fox-root-navigator__${u}-${s}-to`;i.classList.remove(v),i.classList.add(y)}},l=(i,d,h,b)=>{if(h.opsType===L.OperationType.Append||d){const u=r(h),s=d?"show":"enter";if(s==="enter"&&(n=null,o=null),u!=="pop"){const v=`fox-root-navigator__${u}-${s}-active`,y=`fox-root-navigator__${u}-${s}-to`;i.classList.remove(v),i.classList.remove(y)}}e.dragRemove&&!d&&h.opsType===L.OperationType.Append&&tt(i,e.removeMoveRatio,e.momentumReduceRatio,e.removeViewPage,e.removeViewPageDuration,"fox-root-navigator__item-moving",1e3)},_=(i,d,h,b)=>{if(h.opsType===L.OperationType.Append||d){const u=r(h),s=d?"hide":"leave";if(s==="hide"&&(u==="pop"||o!=="enter"||(n?r(n):"")==="pop"))return;s==="leave"&&(n=h,o="leave");const v=`fox-root-navigator__${u}-${s}-from`,y=`fox-root-navigator__${u}-${s}-active`;i.classList.add(v),i.classList.add(y)}},m=(i,d,h,b)=>{if(h.opsType===L.OperationType.Append||d){const u=r(h),s=d?"hide":"leave";if(s==="hide"&&(u==="pop"||o!=="enter"||(n?r(n):"")==="pop"))return;const v=`fox-root-navigator__${u}-${s}-from`,y=`fox-root-navigator__${u}-${s}-to`;i.classList.remove(v),i.classList.add(y)}},g=(i,d,h,b)=>{if(h.opsType===L.OperationType.Append||d){const u=r(h),s=d?"hide":"leave";if(s==="leave"&&(n=null,o=null),u!=="pop"){const v=`fox-root-navigator__${u}-${s}-active`,y=`fox-root-navigator__${u}-${s}-to`;i.classList.remove(v),i.classList.remove(y)}}e.dragRemove&&!d&&et(i)};return(i,d)=>{const h=a.resolveComponent("fox-router-view");return a.openBlock(),a.createBlock(h,{class:"fox-root-navigator","view-class":i.viewClass,"before-enter":f,enter:p,"after-enter":l,"before-leave":_,leave:m,"after-leave":g,multi:!0,name:i.routerViewName,"view-tag":i.viewTag,transition:i.transition},null,8,["view-class","name","view-tag","transition"])}}}),ot=Object.freeze(Object.defineProperty({__proto__:null,default:nt},Symbol.toStringTag,{value:"Module"})),it={class:"fox-swiper-navigator"},st=a.defineComponent({__name:"swiper",props:{width:{},scrollDistance:{},scrollDuration:{},direction:{}},setup(t){const e=t,n=a.computed(()=>{const o={transform:`translate3d(${e.scrollDistance}px, 0, 0)`,width:`${e.width}`};return e.scrollDuration>0&&(o["transition-duration"]=`${e.scrollDuration}ms`),o});return(o,r)=>(a.openBlock(),a.createElementBlock("div",it,[a.createElementVNode("div",{class:"fox-swiper-navigator__inner",style:a.normalizeStyle(n.value)},[a.renderSlot(o.$slots,"default")],4)]))}});let at=0;function rt(){return++at}const ct=15,lt=300,ut=200;function dt(t){t.stopPropagation()}function ft(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&dt(t)}function ht(t,e,n=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*n}function X(t,e=0,n,o=ut){n==="end"?t.style.transition=`transform ${o}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}class pt{width=0;columnWidth=0;max=0;min=0;el=null;swipeDuration=360;transitionEndTrigger=null;moving=!1;startDistance=0;scrollDistance=0;getStartDistance;openPage;isPageOpened;pageOpened;moveRatio=.5;momentumReduceRatio=1;transitionend=null;touchstart=null;touchmove=null;touchend=null;touchcancel=null;constructor(e,n,o,r,f,p){this.getStartDistance=e,this.openPage=n,this.isPageOpened=o,this.pageOpened=r,this.moveRatio=f,this.momentumReduceRatio=p}open(){const e=this.el,n=I(),o=(r,f,p,l)=>{let _=f+this.startDistance;const m=this.columnWidth*this.moveRatio;if(p==="end"){if(f==0){this.moving=!1;return}Math.abs(f)>m?f>0?_=this.startDistance+this.columnWidth:_=this.startDistance-this.columnWidth:_=this.startDistance;let g=-_;g<0?g=0:g>this.width-this.columnWidth&&(g=this.width-this.columnWidth);const i=Math.floor(g/this.columnWidth);this.isPageOpened(i)||this.openPage(i),_=-i*this.columnWidth,l&&l>0&&(this.transitionEndTrigger=()=>{this.moving=!1,this.pageOpened(i)}),X(r,_,"end",l),this.scrollDistance=_}else{if(Math.abs(f)>m){let i=0;if(f>0?i=Math.abs(this.startDistance+this.columnWidth):i=Math.abs(this.startDistance-this.columnWidth),i>=0&&i<this.width){const d=Math.floor(i/this.columnWidth);this.isPageOpened(d)||this.openPage(d)}}let g=-_;g<this.min?g=this.min:g>this.max&&(g=this.max),X(r,-g,"",0)}};this.transitionend=()=>{e.style.transition="",this.transitionEndTrigger&&(this.transitionEndTrigger(),this.transitionEndTrigger=null)},this.touchstart=r=>{this.moving||(n.start(r),this.startDistance=this.getStartDistance(),this.transitionEndTrigger=null,this.moving=!0)},this.touchmove=r=>{n.move(r),!n.isVertical()&&(ft(r,!0),o(e,n.state.deltaX,"",0))},this.touchend=()=>{if(n.isVertical()){o(e,0,"end",this.swipeDuration);return}const r=n.state.deltaX;if(r==0)return;const f=n.state.duration;if(f<lt&&Math.abs(r)>ct){const l=ht(r,f,this.momentumReduceRatio);o(e,l,"end",this.swipeDuration)}else o(e,r,"end",this.swipeDuration)},e.addEventListener("transitionend",this.transitionend),e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchmove",this.touchmove),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchend)}close(){const e=this.el;this.transitionend&&e.addEventListener("transitionend",this.transitionend),this.touchstart&&e.addEventListener("touchstart",this.touchstart),this.touchmove&&e.addEventListener("touchmove",this.touchmove),this.touchend&&e.addEventListener("touchend",this.touchend),this.touchcancel&&e.addEventListener("touchcancel",this.touchcancel),this.el=null}}function mt(t,e,n,o,r,f){return new pt(t,e,n,o,r,f)}function gt(t){const e=a.unref(t),n=window.getComputedStyle(e,null),o=parseFloat(n.getPropertyValue("padding-left")),r=parseFloat(n.getPropertyValue("padding-right")),f=parseFloat(n.getPropertyValue("padding-top")),p=parseFloat(n.getPropertyValue("padding-bottom"));return{width:e.clientWidth-o-r,height:e.clientHeight-f-p}}const vt=a.defineComponent({__name:"index",props:{activePath:{},routes:{},height:{default:-1},width:{default:-1},draggable:{type:Boolean,default:!0},openViewPage:{},routerViewName:{},moveRatio:{default:.5},momentumReduceRatio:{default:1},direction:{default:"horizontal"},transition:{type:[Function,Boolean],default:!0},swipeDuration:{default:360},scrollDuration:{},customClass:{},customStyle:{}},emits:["update:activePath"],setup(t,{emit:e}){const n=t,o=a.reactive({scrollDistance:0,index:-1,openedIndexList:[],width:n.width,height:n.height}),r=e,f=()=>o.scrollDistance,p=c=>{if(o.openedIndexList.indexOf(c)===-1){o.openedIndexList.push(c);const T=n.routes[c];try{n.openViewPage(T,c)}catch(w){console.error(w)}}},l=c=>o.openedIndexList.indexOf(c)!==-1,_=c=>{o.index=c,o.width>0?o.scrollDistance=-o.index*o.width:o.scrollDistance=0;const T=n.routes[c];r("update:activePath",T.path)};let m=null;n.draggable&&(m=mt(f,p,l,_,n.moveRatio,n.momentumReduceRatio));let g=null;a.onMounted(()=>{const c=s(),T=()=>{const w=gt(c);i(n.activePath,n.routes,w.width,w.height,n.swipeDuration,n.direction)};if(window.ResizeObserver&&(g=new window.ResizeObserver(T),g.observe(c)),T(),m){const w=y();m.el=w,m.open()}}),a.onBeforeUnmount(()=>{g&&(g.disconnect(),g=null),m&&m.close()}),a.watch([()=>n.activePath,()=>n.routes,()=>n.width,()=>n.height,()=>n.swipeDuration,()=>n.direction],([c,T,w,$,M,R])=>{const O=w<=0?o.width:w,E=$<=0?o.height:$;i(c,T,O,E,M,R)});const i=(c,T,w,$,M,R="horizontal")=>{const O=c;if(o.index=T.findIndex(E=>E.path===O),R==="horizontal"){const E=w;if(E>0){o.width=w;const B=E*n.routes.length,z=-E/3,Y=E*(T.length-1)+E/3;m&&(m.columnWidth=E,m.width=B,m.min=z,m.max=Y),o.index!==-1&&(o.openedIndexList.push(o.index),o.scrollDistance=-E*o.index)}}m&&(m.swipeDuration=M)},d=`fox-swiper-navigator-${rt()}`,h=a.computed(()=>{const c=[d];return n.customClass&&c.push(n.customClass),c}),b=a.computed(()=>{const c={},T=o.width>0?o.width:n.width;T>0&&(c.width=`${T}px`);const w=o.height>0?o.height:n.height;return w>0&&(c.height=`${w}px`),n.customStyle&&Object.assign(c,n.customStyle),c});let u=null;function s(){return u||(u=document.querySelector(`.${d}`),u)}let v=null;function y(){return v||(v=document.querySelector(`.${d}>.fox-swiper-navigator__inner`),v)}const x=a.computed(()=>o.width>0?`${o.width*n.routes.length}px`:"100%"),D=(c,T)=>{const w=n.routes.findIndex($=>{const M=c.path??c.name??"";return $.path==M});return o.width<=0?{}:{style:{left:`${w*o.width}px`,width:`${o.width}px`}}};return(c,T)=>{const w=a.resolveComponent("fox-router-view");return a.openBlock(),a.createBlock(w,{class:a.normalizeClass(h.value),style:a.normalizeStyle(b.value),"view-class":"fox-swiper-navigator__item",tag:st,"view-tag-props":D,multi:!0,name:c.routerViewName,transition:c.transition,"scroll-distance":o.scrollDistance,"scroll-duration":c.scrollDuration,direction:c.direction,width:x.value},null,8,["class","style","name","transition","scroll-distance","scroll-duration","direction","width"])}}}),_t=Object.freeze(Object.defineProperty({__proto__:null,default:vt},Symbol.toStringTag,{value:"Module"}));let wt="fox-";const yt=[],A=Object.assign({"/src/components/card-navigator/index.vue":N,"/src/components/default-navigator/index.vue":F,"/src/components/root-navigator/index.vue":ot,"/src/components/swiper-navigator/index.vue":_t}),V=[];for(const t in A){let e=/src\/components\/(.*)\/index.vue/.exec(t)[1];yt.indexOf(e)===-1&&V.push({name:e,component:A[t].default})}const Tt={install(t){V.forEach(e=>{t.component(`${wt}${e.name}`,e.component)})}};module.exports=Tt;
package/dist/index.esm.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as P, resolveComponent as S, openBlock as L, createBlock as R, withCtx as C, createVNode as H, Transition as G, resolveDynamicComponent as J, unref as N, computed as O, createElementBlock as K, createElementVNode as Q, normalizeStyle as B, renderSlot as Z, reactive as tt, onMounted as et, onBeforeUnmount as nt, watch as ot, normalizeClass as it } from "vue";
2
2
  import { OperationType as b } from "@fox-js/fox";
3
3
  /*!
4
- * @fox-js/navigation v4.0.1-9 Tue Feb 27 2024 11:12:56 GMT+0800 (中国标准时间)
4
+ * @fox-js/navigation v4.0.1-10 Tue Mar 12 2024 21:40:43 GMT+0800 (中国标准时间)
5
5
  */
6
6
  const st = /* @__PURE__ */ P({
7
7
  __name: "index",
@@ -10,9 +10,9 @@ const st = /* @__PURE__ */ P({
10
10
  transition: { type: [Function, Boolean], default: !1 }
11
11
  },
12
12
  setup(t) {
13
- return (e, o) => {
14
- const n = S("fox-router-view");
15
- return L(), R(n, {
13
+ return (e, n) => {
14
+ const o = S("fox-router-view");
15
+ return L(), R(o, {
16
16
  class: "fox-card-navigator",
17
17
  "view-class": "fox-card-navigator__item",
18
18
  "view-active-class": "fox-card-navigator__item-active",
@@ -34,9 +34,9 @@ const st = /* @__PURE__ */ P({
34
34
  transition: { type: [Function, Boolean], default: !0 }
35
35
  },
36
36
  setup(t) {
37
- return (e, o) => {
38
- const n = S("fox-router-view");
39
- return L(), R(n, {
37
+ return (e, n) => {
38
+ const o = S("fox-router-view");
39
+ return L(), R(o, {
40
40
  transition: !1,
41
41
  multi: !1,
42
42
  name: e.routerViewName
@@ -73,7 +73,7 @@ function F() {
73
73
  offsetX: 0,
74
74
  offsetY: 0,
75
75
  direction: ""
76
- }, e = () => t.direction === "vertical", o = () => t.direction === "horizontal", n = () => {
76
+ }, e = () => t.direction === "vertical", n = () => t.direction === "horizontal", o = () => {
77
77
  t.deltaX = 0, t.deltaY = 0, t.offsetX = 0, t.offsetY = 0, t.direction = "", t.startTime = 0;
78
78
  };
79
79
  return {
@@ -86,16 +86,16 @@ function F() {
86
86
  t.offsetX = Math.abs(t.deltaX), t.offsetY = Math.abs(t.deltaY), t.duration = Date.now() - t.startTime, t.direction || (t.direction = lt(t.offsetX, t.offsetY));
87
87
  },
88
88
  start: (h) => {
89
- if (n(), h.touches) {
89
+ if (o(), h.touches) {
90
90
  const c = h.touches[0];
91
91
  t.startX = c.clientX, t.startY = c.clientY;
92
92
  } else
93
93
  t.startX = h.clientX, t.startY = h.clientY;
94
94
  t.startTime = Date.now();
95
95
  },
96
- reset: n,
96
+ reset: o,
97
97
  isVertical: e,
98
- isHorizontal: o,
98
+ isHorizontal: n,
99
99
  state: t
100
100
  };
101
101
  }
@@ -105,14 +105,14 @@ function ut(t) {
105
105
  const dt = (t) => {
106
106
  const e = N(t);
107
107
  if (ut(e)) {
108
- const o = e.innerWidth, n = e.innerHeight;
108
+ const n = e.innerWidth, o = e.innerHeight;
109
109
  return {
110
110
  top: 0,
111
111
  left: 0,
112
- right: o,
113
- bottom: n,
114
- width: o,
115
- height: n
112
+ right: n,
113
+ bottom: o,
114
+ width: n,
115
+ height: o
116
116
  };
117
117
  }
118
118
  return e && e.getBoundingClientRect ? e.getBoundingClientRect() : {
@@ -130,14 +130,14 @@ function pt(t) {
130
130
  function gt(t, e) {
131
131
  (typeof t.cancelable != "boolean" || t.cancelable) && t.preventDefault(), e && pt(t);
132
132
  }
133
- function vt(t, e, o = 1) {
134
- return t = Math.abs(t / e) / 3e-3 * (t < 0 ? -1 : 1), t * o;
133
+ function vt(t, e, n = 1) {
134
+ return t = Math.abs(t / e) / 3e-3 * (t < 0 ? -1 : 1), t * n;
135
135
  }
136
- function V(t, e = 0, o, n = mt) {
137
- o === "end" ? t.style.transition = `transform ${n}ms cubic-bezier(0.17, 0.89, 0.45, 1)` : t.style.transition = "transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)", t.style.transform = `translate3d(${e}px, 0, 0)`;
136
+ function I(t, e = 0, n, o = mt) {
137
+ n === "end" ? t.style.transition = `transform ${o}ms cubic-bezier(0.17, 0.89, 0.45, 1)` : t.style.transition = "transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)", t.style.transform = `translate3d(${e}px, 0, 0)`;
138
138
  }
139
- const A = /* @__PURE__ */ new WeakMap();
140
- function _t(t, e, o, n, a = 500, d, h = 1e3) {
139
+ const V = /* @__PURE__ */ new WeakMap();
140
+ function _t(t, e, n, o, a = 500, d, h = 1e3) {
141
141
  const c = {
142
142
  active: !0,
143
143
  startDistance: 0,
@@ -153,19 +153,19 @@ function _t(t, e, o, n, a = 500, d, h = 1e3) {
153
153
  T < y ? T = 0 : T = r.width;
154
154
  let _ = !1;
155
155
  x && x > 0 && (_ = !0, c.transitionEndTrigger = () => {
156
- c.moving = !1, d && s.classList.remove(d), T > 0 && typeof n == "function" && n();
157
- }), V(s, T, "end", x), v && V(v, 0, "", 0), !_ && T > 0 && typeof n == "function" && (c.moving = !1, n());
156
+ c.moving = !1, d && s.classList.remove(d), T > 0 && typeof o == "function" && o();
157
+ }), I(s, T, "end", x), v && I(v, 0, "", 0), !_ && T > 0 && typeof o == "function" && (c.moving = !1, o());
158
158
  } else
159
- T < 0 && (T = 0), V(s, T, "", 0);
159
+ T < 0 && (T = 0), I(s, T, "", 0);
160
160
  }, i = () => {
161
161
  t.style.transform = "", t.style.transition = "", c.transitionEndTrigger ? (c.transitionEndTrigger(), c.transitionEndTrigger = null, v && setTimeout(() => {
162
162
  v && (v.style.transform = "", v.style.transition = "");
163
163
  }, a)) : v && (v.style.transform = "", v.style.transition = "");
164
- }, l = /^matrix\((.+)\)$/, f = (s) => {
164
+ }, u = /^matrix\((.+)\)$/, f = (s) => {
165
165
  if (m.start(s), c.scrollDistance = 0, c.moving) {
166
166
  const g = t, { transform: w } = window.getComputedStyle(g);
167
167
  if (w) {
168
- const x = l.exec(w);
168
+ const x = u.exec(w);
169
169
  if (x) {
170
170
  const r = x[1].split(/,\s*/);
171
171
  c.scrollDistance = +r[4];
@@ -175,7 +175,7 @@ function _t(t, e, o, n, a = 500, d, h = 1e3) {
175
175
  d && t.classList.add(d), c.startDistance = c.scrollDistance, c.transitionEndTrigger = null, c.moving = !0;
176
176
  }, E = (s) => {
177
177
  c.moving = !0, m.move(s), !m.isVertical() && (gt(s, !0), p(t, m.state.deltaX, "", 0));
178
- }, u = () => {
178
+ }, l = () => {
179
179
  if (m.isVertical()) {
180
180
  p(t, 0, "end", h);
181
181
  return;
@@ -187,23 +187,23 @@ function _t(t, e, o, n, a = 500, d, h = 1e3) {
187
187
  }
188
188
  const g = m.state.duration;
189
189
  if (g < ht && Math.abs(s) > ft) {
190
- const x = vt(s, g, o);
190
+ const x = vt(s, g, n);
191
191
  p(t, x, "end", h);
192
192
  } else
193
193
  p(t, s, "end", h);
194
194
  };
195
- t.addEventListener("transitionend", i), t.addEventListener("touchstart", f), t.addEventListener("touchmove", E), t.addEventListener("touchend", u), t.addEventListener("touchcancel", u), A.set(t, {
195
+ t.addEventListener("transitionend", i), t.addEventListener("touchstart", f), t.addEventListener("touchmove", E), t.addEventListener("touchend", l), t.addEventListener("touchcancel", l), V.set(t, {
196
196
  state: c,
197
197
  transitionend: i,
198
198
  touchstart: f,
199
199
  touchmove: E,
200
- touchend: u,
201
- touchcancel: u
200
+ touchend: l,
201
+ touchcancel: l
202
202
  });
203
203
  }
204
204
  function wt(t) {
205
- const e = A.get(t);
206
- e && (A.delete(t), t.addEventListener("transitionend", e.transitionend), t.addEventListener("touchstart", e.touchstart), t.addEventListener("touchmove", e.touchmove), t.addEventListener("touchend", e.touchend), t.addEventListener("touchcancel", e.touchcancel));
205
+ const e = V.get(t);
206
+ e && (V.delete(t), t.addEventListener("transitionend", e.transitionend), t.addEventListener("touchstart", e.touchstart), t.addEventListener("touchmove", e.touchmove), t.addEventListener("touchend", e.touchend), t.addEventListener("touchcancel", e.touchcancel));
207
207
  }
208
208
  const yt = /* @__PURE__ */ P({
209
209
  __name: "index",
@@ -216,45 +216,40 @@ const yt = /* @__PURE__ */ P({
216
216
  routerViewName: {},
217
217
  viewTag: { type: [Function, String], default: "div" },
218
218
  transition: { type: [Function, Boolean], default: !0 },
219
- viewClass: { default: "fox-root-navigator__item" }
219
+ viewClass: { type: [Function, String], default: "fox-root-navigator__item" }
220
220
  },
221
221
  setup(t) {
222
222
  const e = t;
223
- let o = null, n = null;
223
+ let n = null, o = null;
224
224
  function a(i) {
225
225
  return (i.params && i.params.animationType) ?? "slide";
226
226
  }
227
- const d = (i, l, f, E) => {
228
- if (f.opsType === b.Append || l) {
229
- const u = a(f);
230
- if (u === "pop" && l)
227
+ const d = (i, u, f, E) => {
228
+ if (f.opsType === b.Append || u) {
229
+ const l = a(f), s = u ? "show" : "enter";
230
+ if (s === "show" && (l === "pop" || o !== "leave" || (n ? a(n) : "") === "pop"))
231
231
  return;
232
- const s = l ? "show" : "enter";
233
- if (s === "enter" && (o = f), s === "show" && n && a(n) === "pop")
234
- return;
235
- const g = `fox-root-navigator__${u}-${s}-from`, w = `fox-root-navigator__${u}-${s}-active`;
232
+ s === "enter" && (n = f, o = "enter");
233
+ const g = `fox-root-navigator__${l}-${s}-from`, w = `fox-root-navigator__${l}-${s}-active`;
236
234
  i.classList.add(g), i.classList.add(w);
237
235
  }
238
- }, h = (i, l, f, E) => {
239
- if (f.opsType === b.Append || l) {
240
- const u = a(f);
241
- if (u === "pop" && l)
242
- return;
243
- const s = l ? "show" : "enter";
244
- if (s === "show" && n && a(n) === "pop")
236
+ }, h = (i, u, f, E) => {
237
+ if (f.opsType === b.Append || u) {
238
+ const l = a(f), s = u ? "show" : "enter";
239
+ if (s === "show" && (l === "pop" || o !== "leave" || (n ? a(n) : "") === "pop"))
245
240
  return;
246
- const g = `fox-root-navigator__${u}-${s}-from`, w = `fox-root-navigator__${u}-${s}-to`;
241
+ const g = `fox-root-navigator__${l}-${s}-from`, w = `fox-root-navigator__${l}-${s}-to`;
247
242
  i.classList.remove(g), i.classList.add(w);
248
243
  }
249
- }, c = (i, l, f, E) => {
250
- if (f.opsType === b.Append || l) {
251
- const u = a(f);
252
- if (u !== "pop" || !l) {
253
- const s = l ? "show" : "enter", g = `fox-root-navigator__${u}-${s}-active`, w = `fox-root-navigator__${u}-${s}-to`;
244
+ }, c = (i, u, f, E) => {
245
+ if (f.opsType === b.Append || u) {
246
+ const l = a(f), s = u ? "show" : "enter";
247
+ if (s === "enter" && (n = null, o = null), l !== "pop") {
248
+ const g = `fox-root-navigator__${l}-${s}-active`, w = `fox-root-navigator__${l}-${s}-to`;
254
249
  i.classList.remove(g), i.classList.remove(w);
255
250
  }
256
251
  }
257
- e.dragRemove && !l && f.opsType === b.Append && _t(
252
+ e.dragRemove && !u && f.opsType === b.Append && _t(
258
253
  i,
259
254
  e.removeMoveRatio,
260
255
  e.momentumReduceRatio,
@@ -263,39 +258,34 @@ const yt = /* @__PURE__ */ P({
263
258
  "fox-root-navigator__item-moving",
264
259
  1e3
265
260
  );
266
- }, v = (i, l, f, E) => {
267
- if (f.opsType === b.Append || l) {
268
- const u = a(f);
269
- if (u === "pop" && l)
261
+ }, v = (i, u, f, E) => {
262
+ if (f.opsType === b.Append || u) {
263
+ const l = a(f), s = u ? "hide" : "leave";
264
+ if (s === "hide" && (l === "pop" || o !== "enter" || (n ? a(n) : "") === "pop"))
270
265
  return;
271
- const s = l ? "hide" : "leave";
272
- if (s === "leave" && (n = f), s === "hide" && o && a(o) === "pop")
273
- return;
274
- const g = `fox-root-navigator__${u}-${s}-from`, w = `fox-root-navigator__${u}-${s}-active`;
266
+ s === "leave" && (n = f, o = "leave");
267
+ const g = `fox-root-navigator__${l}-${s}-from`, w = `fox-root-navigator__${l}-${s}-active`;
275
268
  i.classList.add(g), i.classList.add(w);
276
269
  }
277
- }, m = (i, l, f, E) => {
278
- if (f.opsType === b.Append || l) {
279
- const u = a(f);
280
- if (u === "pop" && l)
281
- return;
282
- const s = l ? "hide" : "leave";
283
- if (s === "hide" && o && a(o) === "pop")
270
+ }, m = (i, u, f, E) => {
271
+ if (f.opsType === b.Append || u) {
272
+ const l = a(f), s = u ? "hide" : "leave";
273
+ if (s === "hide" && (l === "pop" || o !== "enter" || (n ? a(n) : "") === "pop"))
284
274
  return;
285
- const g = `fox-root-navigator__${u}-${s}-from`, w = `fox-root-navigator__${u}-${s}-to`;
275
+ const g = `fox-root-navigator__${l}-${s}-from`, w = `fox-root-navigator__${l}-${s}-to`;
286
276
  i.classList.remove(g), i.classList.add(w);
287
277
  }
288
- }, p = (i, l, f, E) => {
289
- if (f.opsType === b.Append || l) {
290
- const u = a(f);
291
- if (u !== "pop" || !l) {
292
- const s = l ? "hide" : "leave", g = `fox-root-navigator__${u}-${s}-active`, w = `fox-root-navigator__${u}-${s}-to`;
278
+ }, p = (i, u, f, E) => {
279
+ if (f.opsType === b.Append || u) {
280
+ const l = a(f), s = u ? "hide" : "leave";
281
+ if (s === "leave" && (n = null, o = null), l !== "pop") {
282
+ const g = `fox-root-navigator__${l}-${s}-active`, w = `fox-root-navigator__${l}-${s}-to`;
293
283
  i.classList.remove(g), i.classList.remove(w);
294
284
  }
295
285
  }
296
- e.dragRemove && !l && wt(i);
286
+ e.dragRemove && !u && wt(i);
297
287
  };
298
- return (i, l) => {
288
+ return (i, u) => {
299
289
  const f = S("fox-router-view");
300
290
  return L(), R(f, {
301
291
  class: "fox-root-navigator",
@@ -325,19 +315,19 @@ const yt = /* @__PURE__ */ P({
325
315
  direction: {}
326
316
  },
327
317
  setup(t) {
328
- const e = t, o = O(() => {
329
- const n = {
318
+ const e = t, n = O(() => {
319
+ const o = {
330
320
  transform: `translate3d(${e.scrollDistance}px, 0, 0)`,
331
321
  width: `${e.width}`
332
322
  };
333
- return e.scrollDuration > 0 && (n["transition-duration"] = `${e.scrollDuration}ms`), n;
323
+ return e.scrollDuration > 0 && (o["transition-duration"] = `${e.scrollDuration}ms`), o;
334
324
  });
335
- return (n, a) => (L(), K("div", Tt, [
325
+ return (o, a) => (L(), K("div", Tt, [
336
326
  Q("div", {
337
327
  class: "fox-swiper-navigator__inner",
338
- style: B(o.value)
328
+ style: B(n.value)
339
329
  }, [
340
- Z(n.$slots, "default")
330
+ Z(o.$slots, "default")
341
331
  ], 4)
342
332
  ]));
343
333
  }
@@ -353,11 +343,11 @@ function Rt(t) {
353
343
  function Pt(t, e) {
354
344
  (typeof t.cancelable != "boolean" || t.cancelable) && t.preventDefault(), e && Rt(t);
355
345
  }
356
- function Ot(t, e, o = 1) {
357
- return t = Math.abs(t / e) / 3e-3 * (t < 0 ? -1 : 1), t * o;
346
+ function Ot(t, e, n = 1) {
347
+ return t = Math.abs(t / e) / 3e-3 * (t < 0 ? -1 : 1), t * n;
358
348
  }
359
- function z(t, e = 0, o, n = Mt) {
360
- o === "end" ? t.style.transition = `transform ${n}ms cubic-bezier(0.17, 0.89, 0.45, 1)` : t.style.transition = "transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)", t.style.transform = `translate3d(${e}px, 0, 0)`;
349
+ function z(t, e = 0, n, o = Mt) {
350
+ n === "end" ? t.style.transition = `transform ${o}ms cubic-bezier(0.17, 0.89, 0.45, 1)` : t.style.transition = "transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)", t.style.transform = `translate3d(${e}px, 0, 0)`;
361
351
  }
362
352
  class St {
363
353
  /**
@@ -454,14 +444,14 @@ class St {
454
444
  * @param momentumReduceRatio
455
445
  *
456
446
  */
457
- constructor(e, o, n, a, d, h) {
458
- this.getStartDistance = e, this.openPage = o, this.isPageOpened = n, this.pageOpened = a, this.moveRatio = d, this.momentumReduceRatio = h;
447
+ constructor(e, n, o, a, d, h) {
448
+ this.getStartDistance = e, this.openPage = n, this.isPageOpened = o, this.pageOpened = a, this.moveRatio = d, this.momentumReduceRatio = h;
459
449
  }
460
450
  /**
461
451
  * 打开drag支持
462
452
  */
463
453
  open() {
464
- const e = this.el, o = F(), n = (a, d, h, c) => {
454
+ const e = this.el, n = F(), o = (a, d, h, c) => {
465
455
  let v = d + this.startDistance;
466
456
  const m = this.columnWidth * this.moveRatio;
467
457
  if (h === "end") {
@@ -480,8 +470,8 @@ class St {
480
470
  if (Math.abs(d) > m) {
481
471
  let i = 0;
482
472
  if (d > 0 ? i = Math.abs(this.startDistance + this.columnWidth) : i = Math.abs(this.startDistance - this.columnWidth), i >= 0 && i < this.width) {
483
- const l = Math.floor(i / this.columnWidth);
484
- this.isPageOpened(l) || this.openPage(l);
473
+ const u = Math.floor(i / this.columnWidth);
474
+ this.isPageOpened(u) || this.openPage(u);
485
475
  }
486
476
  }
487
477
  let p = -v;
@@ -491,23 +481,23 @@ class St {
491
481
  this.transitionend = () => {
492
482
  e.style.transition = "", this.transitionEndTrigger && (this.transitionEndTrigger(), this.transitionEndTrigger = null);
493
483
  }, this.touchstart = (a) => {
494
- this.moving || (o.start(a), this.startDistance = this.getStartDistance(), this.transitionEndTrigger = null, this.moving = !0);
484
+ this.moving || (n.start(a), this.startDistance = this.getStartDistance(), this.transitionEndTrigger = null, this.moving = !0);
495
485
  }, this.touchmove = (a) => {
496
- o.move(a), !o.isVertical() && (Pt(a, !0), n(e, o.state.deltaX, "", 0));
486
+ n.move(a), !n.isVertical() && (Pt(a, !0), o(e, n.state.deltaX, "", 0));
497
487
  }, this.touchend = () => {
498
- if (o.isVertical()) {
499
- n(e, 0, "end", this.swipeDuration);
488
+ if (n.isVertical()) {
489
+ o(e, 0, "end", this.swipeDuration);
500
490
  return;
501
491
  }
502
- const a = o.state.deltaX;
492
+ const a = n.state.deltaX;
503
493
  if (a == 0)
504
494
  return;
505
- const d = o.state.duration;
495
+ const d = n.state.duration;
506
496
  if (d < $t && Math.abs(a) > Lt) {
507
497
  const c = Ot(a, d, this.momentumReduceRatio);
508
- n(e, c, "end", this.swipeDuration);
498
+ o(e, c, "end", this.swipeDuration);
509
499
  } else
510
- n(e, a, "end", this.swipeDuration);
500
+ o(e, a, "end", this.swipeDuration);
511
501
  }, e.addEventListener("transitionend", this.transitionend), e.addEventListener("touchstart", this.touchstart), e.addEventListener("touchmove", this.touchmove), e.addEventListener("touchend", this.touchend), e.addEventListener("touchcancel", this.touchend);
512
502
  }
513
503
  /**
@@ -518,17 +508,17 @@ class St {
518
508
  this.transitionend && e.addEventListener("transitionend", this.transitionend), this.touchstart && e.addEventListener("touchstart", this.touchstart), this.touchmove && e.addEventListener("touchmove", this.touchmove), this.touchend && e.addEventListener("touchend", this.touchend), this.touchcancel && e.addEventListener("touchcancel", this.touchcancel), this.el = null;
519
509
  }
520
510
  }
521
- function Xt(t, e, o, n, a, d) {
522
- return new St(t, e, o, n, a, d);
511
+ function Xt(t, e, n, o, a, d) {
512
+ return new St(t, e, n, o, a, d);
523
513
  }
524
- function It(t) {
525
- const e = N(t), o = window.getComputedStyle(e, null), n = parseFloat(o.getPropertyValue("padding-left")), a = parseFloat(o.getPropertyValue("padding-right")), d = parseFloat(o.getPropertyValue("padding-top")), h = parseFloat(o.getPropertyValue("padding-bottom"));
514
+ function At(t) {
515
+ const e = N(t), n = window.getComputedStyle(e, null), o = parseFloat(n.getPropertyValue("padding-left")), a = parseFloat(n.getPropertyValue("padding-right")), d = parseFloat(n.getPropertyValue("padding-top")), h = parseFloat(n.getPropertyValue("padding-bottom"));
526
516
  return {
527
- width: e.clientWidth - n - a,
517
+ width: e.clientWidth - o - a,
528
518
  height: e.clientHeight - d - h
529
519
  };
530
520
  }
531
- const Vt = /* @__PURE__ */ P({
521
+ const It = /* @__PURE__ */ P({
532
522
  __name: "index",
533
523
  props: {
534
524
  activePath: {},
@@ -549,41 +539,41 @@ const Vt = /* @__PURE__ */ P({
549
539
  },
550
540
  emits: ["update:activePath"],
551
541
  setup(t, { emit: e }) {
552
- const o = t, n = tt({
542
+ const n = t, o = tt({
553
543
  scrollDistance: 0,
554
544
  index: -1,
555
545
  openedIndexList: [],
556
- width: o.width,
557
- height: o.height
558
- }), a = e, d = () => n.scrollDistance, h = (r) => {
559
- if (n.openedIndexList.indexOf(r) === -1) {
560
- n.openedIndexList.push(r);
561
- const y = o.routes[r];
546
+ width: n.width,
547
+ height: n.height
548
+ }), a = e, d = () => o.scrollDistance, h = (r) => {
549
+ if (o.openedIndexList.indexOf(r) === -1) {
550
+ o.openedIndexList.push(r);
551
+ const y = n.routes[r];
562
552
  try {
563
- o.openViewPage(y, r);
553
+ n.openViewPage(y, r);
564
554
  } catch (_) {
565
555
  console.error(_);
566
556
  }
567
557
  }
568
- }, c = (r) => n.openedIndexList.indexOf(r) !== -1, v = (r) => {
569
- n.index = r, n.width > 0 ? n.scrollDistance = -n.index * n.width : n.scrollDistance = 0;
570
- const y = o.routes[r];
558
+ }, c = (r) => o.openedIndexList.indexOf(r) !== -1, v = (r) => {
559
+ o.index = r, o.width > 0 ? o.scrollDistance = -o.index * o.width : o.scrollDistance = 0;
560
+ const y = n.routes[r];
571
561
  a("update:activePath", y.path);
572
562
  };
573
563
  let m = null;
574
- o.draggable && (m = Xt(
564
+ n.draggable && (m = Xt(
575
565
  d,
576
566
  h,
577
567
  c,
578
568
  v,
579
- o.moveRatio,
580
- o.momentumReduceRatio
569
+ n.moveRatio,
570
+ n.momentumReduceRatio
581
571
  ));
582
572
  let p = null;
583
573
  et(() => {
584
574
  const r = s(), y = () => {
585
- const _ = It(r);
586
- i(o.activePath, o.routes, _.width, _.height, o.swipeDuration, o.direction);
575
+ const _ = At(r);
576
+ i(n.activePath, n.routes, _.width, _.height, n.swipeDuration, n.direction);
587
577
  };
588
578
  if (window.ResizeObserver && (p = new window.ResizeObserver(y), p.observe(r)), y(), m) {
589
579
  const _ = w();
@@ -593,55 +583,55 @@ const Vt = /* @__PURE__ */ P({
593
583
  p && (p.disconnect(), p = null), m && m.close();
594
584
  }), ot(
595
585
  [
596
- () => o.activePath,
597
- () => o.routes,
598
- () => o.width,
599
- () => o.height,
600
- () => o.swipeDuration,
601
- () => o.direction
586
+ () => n.activePath,
587
+ () => n.routes,
588
+ () => n.width,
589
+ () => n.height,
590
+ () => n.swipeDuration,
591
+ () => n.direction
602
592
  ],
603
593
  ([r, y, _, $, M, X]) => {
604
- const I = _ <= 0 ? n.width : _, D = $ <= 0 ? n.height : $;
605
- i(r, y, I, D, M, X);
594
+ const A = _ <= 0 ? o.width : _, D = $ <= 0 ? o.height : $;
595
+ i(r, y, A, D, M, X);
606
596
  }
607
597
  );
608
598
  const i = (r, y, _, $, M, X = "horizontal") => {
609
- const I = r;
610
- if (n.index = y.findIndex((D) => D.path === I), X === "horizontal") {
599
+ const A = r;
600
+ if (o.index = y.findIndex((D) => D.path === A), X === "horizontal") {
611
601
  const D = _;
612
602
  if (D > 0) {
613
- n.width = _;
614
- const j = D * o.routes.length, k = -D / 3, q = D * (y.length - 1) + D / 3;
615
- m && (m.columnWidth = D, m.width = j, m.min = k, m.max = q), n.index !== -1 && (n.openedIndexList.push(n.index), n.scrollDistance = -D * n.index);
603
+ o.width = _;
604
+ const j = D * n.routes.length, k = -D / 3, q = D * (y.length - 1) + D / 3;
605
+ m && (m.columnWidth = D, m.width = j, m.min = k, m.max = q), o.index !== -1 && (o.openedIndexList.push(o.index), o.scrollDistance = -D * o.index);
616
606
  }
617
607
  }
618
608
  m && (m.swipeDuration = M);
619
- }, l = `fox-swiper-navigator-${bt()}`, f = O(() => {
620
- const r = [l];
621
- return o.customClass && r.push(o.customClass), r;
609
+ }, u = `fox-swiper-navigator-${bt()}`, f = O(() => {
610
+ const r = [u];
611
+ return n.customClass && r.push(n.customClass), r;
622
612
  }), E = O(() => {
623
- const r = {}, y = n.width > 0 ? n.width : o.width;
613
+ const r = {}, y = o.width > 0 ? o.width : n.width;
624
614
  y > 0 && (r.width = `${y}px`);
625
- const _ = n.height > 0 ? n.height : o.height;
626
- return _ > 0 && (r.height = `${_}px`), o.customStyle && Object.assign(r, o.customStyle), r;
615
+ const _ = o.height > 0 ? o.height : n.height;
616
+ return _ > 0 && (r.height = `${_}px`), n.customStyle && Object.assign(r, n.customStyle), r;
627
617
  });
628
- let u = null;
618
+ let l = null;
629
619
  function s() {
630
- return u || (u = document.querySelector(`.${l}`), u);
620
+ return l || (l = document.querySelector(`.${u}`), l);
631
621
  }
632
622
  let g = null;
633
623
  function w() {
634
- return g || (g = document.querySelector(`.${l}>.fox-swiper-navigator__inner`), g);
624
+ return g || (g = document.querySelector(`.${u}>.fox-swiper-navigator__inner`), g);
635
625
  }
636
- const x = O(() => n.width > 0 ? `${n.width * o.routes.length}px` : "100%"), T = (r, y) => {
637
- const _ = o.routes.findIndex(($) => {
626
+ const x = O(() => o.width > 0 ? `${o.width * n.routes.length}px` : "100%"), T = (r, y) => {
627
+ const _ = n.routes.findIndex(($) => {
638
628
  const M = r.path ?? r.name ?? "";
639
629
  return $.path == M;
640
630
  });
641
- return n.width <= 0 ? {} : {
631
+ return o.width <= 0 ? {} : {
642
632
  style: {
643
- left: `${_ * n.width}px`,
644
- width: `${n.width}px`
633
+ left: `${_ * o.width}px`,
634
+ width: `${o.width}px`
645
635
  }
646
636
  };
647
637
  };
@@ -656,19 +646,19 @@ const Vt = /* @__PURE__ */ P({
656
646
  multi: !0,
657
647
  name: r.routerViewName,
658
648
  transition: r.transition,
659
- "scroll-distance": n.scrollDistance,
649
+ "scroll-distance": o.scrollDistance,
660
650
  "scroll-duration": r.scrollDuration,
661
651
  direction: r.direction,
662
652
  width: x.value
663
653
  }, null, 8, ["class", "style", "name", "transition", "scroll-distance", "scroll-duration", "direction", "width"]);
664
654
  };
665
655
  }
666
- }), At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
656
+ }), Vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
667
657
  __proto__: null,
668
- default: Vt
658
+ default: It
669
659
  }, Symbol.toStringTag, { value: "Module" }));
670
660
  let Ct = "fox-";
671
- const Yt = [], W = /* @__PURE__ */ Object.assign({ "/src/components/card-navigator/index.vue": at, "/src/components/default-navigator/index.vue": ct, "/src/components/root-navigator/index.vue": xt, "/src/components/swiper-navigator/index.vue": At }), U = [];
661
+ const Yt = [], W = /* @__PURE__ */ Object.assign({ "/src/components/card-navigator/index.vue": at, "/src/components/default-navigator/index.vue": ct, "/src/components/root-navigator/index.vue": xt, "/src/components/swiper-navigator/index.vue": Vt }), U = [];
672
662
  for (const t in W) {
673
663
  let e = /src\/components\/(.*)\/index.vue/.exec(t)[1];
674
664
  Yt.indexOf(e) === -1 && U.push({
package/dist/index.umd.js CHANGED
@@ -1,3 +1,3 @@
1
1
  (function(i,E){typeof exports=="object"&&typeof module<"u"?module.exports=E(require("vue"),require("@fox-js/fox")):typeof define=="function"&&define.amd?define(["vue","@fox-js/fox"],E):(i=typeof globalThis<"u"?globalThis:i||self,i.FoxNavigation=E(i.Vue,i.Fox))})(this,function(i,E){"use strict";/*!
2
- * @fox-js/navigation v4.0.1-9 Tue Feb 27 2024 11:12:56 GMT+0800 (中国标准时间)
3
- */const B=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!1}},setup(t){return(e,o)=>{const n=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(n,{class:"fox-card-navigator","view-class":"fox-card-navigator__item","view-active-class":"fox-card-navigator__item-active","view-inactive-class":"fox-card-navigator__item-inactive","transition-name":"fox-card-navigator__trans",transition:e.transition,multi:!0,name:e.routerViewName},null,8,["transition","name"])}}})},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!0}},setup(t){return(e,o)=>{const n=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(n,{transition:!1,multi:!1,name:e.routerViewName},{default:i.withCtx(({Component:r})=>[i.createVNode(i.Transition,{name:"fox-default-navigator__trans"},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r)))]),_:2},1024)]),_:1},8,["name"])}}})},Symbol.toStringTag,{value:"Module"})),S=10;function Y(t,e){return t>e&&t>S?"horizontal":e>t&&e>S?"vertical":""}function V(){const t={startX:0,startY:0,startTime:0,duration:0,moveX:0,moveY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0,direction:""},e=()=>t.direction==="vertical",o=()=>t.direction==="horizontal",n=()=>{t.deltaX=0,t.deltaY=0,t.offsetX=0,t.offsetY=0,t.direction="",t.startTime=0};return{move:p=>{if(p.touches){const l=p.touches[0];t.deltaX=l.clientX-t.startX,t.deltaY=l.clientY-t.startY,t.moveX=l.clientX,t.moveY=l.clientY}else t.deltaX=p.clientX-t.startX,t.deltaY=p.clientY-t.startY,t.moveX=p.clientX,t.moveY=p.clientY;t.offsetX=Math.abs(t.deltaX),t.offsetY=Math.abs(t.deltaY),t.duration=Date.now()-t.startTime,t.direction||(t.direction=Y(t.offsetX,t.offsetY))},start:p=>{if(n(),p.touches){const l=p.touches[0];t.startX=l.clientX,t.startY=l.clientY}else t.startX=p.clientX,t.startY=p.clientY;t.startTime=Date.now()},reset:n,isVertical:e,isHorizontal:o,state:t}}function W(t){return t===window}const N=t=>{const e=i.unref(t);if(W(e)){const o=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:o,bottom:n,width:o,height:n}}return e&&e.getBoundingClientRect?e.getBoundingClientRect():{top:0,left:0,right:0,bottom:0,width:0,height:0}},k=15,F=300,j=200;function U(t){t.stopPropagation()}function q(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&U(t)}function H(t,e,o=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*o}function R(t,e=0,o,n=j){o==="end"?t.style.transition=`transform ${n}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}const O=new WeakMap;function G(t,e,o,n,r=500,f,p=1e3){const l={active:!0,startDistance:0,scrollDistance:0,scrollTime:0,moving:!1,transitionEndTrigger:null},_=t.previousSibling,m=V(),g=(a,v,y,x)=>{let D=v+l.startDistance;if(y==="end"){const c=N(a);let T=c.width*e;D<T?D=0:D=c.width;let w=!1;x&&x>0&&(w=!0,l.transitionEndTrigger=()=>{l.moving=!1,f&&a.classList.remove(f),D>0&&typeof n=="function"&&n()}),R(a,D,"end",x),_&&R(_,0,"",0),!w&&D>0&&typeof n=="function"&&(l.moving=!1,n())}else D<0&&(D=0),R(a,D,"",0)},s=()=>{t.style.transform="",t.style.transition="",l.transitionEndTrigger?(l.transitionEndTrigger(),l.transitionEndTrigger=null,_&&setTimeout(()=>{_&&(_.style.transform="",_.style.transition="")},r)):_&&(_.style.transform="",_.style.transition="")},d=/^matrix\((.+)\)$/,h=a=>{if(m.start(a),l.scrollDistance=0,l.moving){const v=t,{transform:y}=window.getComputedStyle(v);if(y){const x=d.exec(y);if(x){const c=x[1].split(/,\s*/);l.scrollDistance=+c[4]}}}f&&t.classList.add(f),l.startDistance=l.scrollDistance,l.transitionEndTrigger=null,l.moving=!0},$=a=>{l.moving=!0,m.move(a),!m.isVertical()&&(q(a,!0),g(t,m.state.deltaX,"",0))},u=()=>{if(m.isVertical()){g(t,0,"end",p);return}const a=m.state.deltaX;if(a===0){f&&t.classList.remove(f),l.moving=!1;return}const v=m.state.duration;if(v<F&&Math.abs(a)>k){const x=H(a,v,o);g(t,x,"end",p)}else g(t,a,"end",p)};t.addEventListener("transitionend",s),t.addEventListener("touchstart",h),t.addEventListener("touchmove",$),t.addEventListener("touchend",u),t.addEventListener("touchcancel",u),O.set(t,{state:l,transitionend:s,touchstart:h,touchmove:$,touchend:u,touchcancel:u})}function J(t){const e=O.get(t);e&&(O.delete(t),t.addEventListener("transitionend",e.transitionend),t.addEventListener("touchstart",e.touchstart),t.addEventListener("touchmove",e.touchmove),t.addEventListener("touchend",e.touchend),t.addEventListener("touchcancel",e.touchcancel))}const K=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{dragRemove:{type:Boolean,default:!0},removeViewPage:{},removeMoveRatio:{default:.5},momentumReduceRatio:{default:1},removeViewPageDuration:{default:500},routerViewName:{},viewTag:{type:[Function,String],default:"div"},transition:{type:[Function,Boolean],default:!0},viewClass:{default:"fox-root-navigator__item"}},setup(t){const e=t;let o=null,n=null;function r(s){return(s.params&&s.params.animationType)??"slide"}const f=(s,d,h,$)=>{if(h.opsType===E.OperationType.Append||d){const u=r(h);if(u==="pop"&&d)return;const a=d?"show":"enter";if(a==="enter"&&(o=h),a==="show"&&n&&r(n)==="pop")return;const v=`fox-root-navigator__${u}-${a}-from`,y=`fox-root-navigator__${u}-${a}-active`;s.classList.add(v),s.classList.add(y)}},p=(s,d,h,$)=>{if(h.opsType===E.OperationType.Append||d){const u=r(h);if(u==="pop"&&d)return;const a=d?"show":"enter";if(a==="show"&&n&&r(n)==="pop")return;const v=`fox-root-navigator__${u}-${a}-from`,y=`fox-root-navigator__${u}-${a}-to`;s.classList.remove(v),s.classList.add(y)}},l=(s,d,h,$)=>{if(h.opsType===E.OperationType.Append||d){const u=r(h);if(u!=="pop"||!d){const a=d?"show":"enter",v=`fox-root-navigator__${u}-${a}-active`,y=`fox-root-navigator__${u}-${a}-to`;s.classList.remove(v),s.classList.remove(y)}}e.dragRemove&&!d&&h.opsType===E.OperationType.Append&&G(s,e.removeMoveRatio,e.momentumReduceRatio,e.removeViewPage,e.removeViewPageDuration,"fox-root-navigator__item-moving",1e3)},_=(s,d,h,$)=>{if(h.opsType===E.OperationType.Append||d){const u=r(h);if(u==="pop"&&d)return;const a=d?"hide":"leave";if(a==="leave"&&(n=h),a==="hide"&&o&&r(o)==="pop")return;const v=`fox-root-navigator__${u}-${a}-from`,y=`fox-root-navigator__${u}-${a}-active`;s.classList.add(v),s.classList.add(y)}},m=(s,d,h,$)=>{if(h.opsType===E.OperationType.Append||d){const u=r(h);if(u==="pop"&&d)return;const a=d?"hide":"leave";if(a==="hide"&&o&&r(o)==="pop")return;const v=`fox-root-navigator__${u}-${a}-from`,y=`fox-root-navigator__${u}-${a}-to`;s.classList.remove(v),s.classList.add(y)}},g=(s,d,h,$)=>{if(h.opsType===E.OperationType.Append||d){const u=r(h);if(u!=="pop"||!d){const a=d?"hide":"leave",v=`fox-root-navigator__${u}-${a}-active`,y=`fox-root-navigator__${u}-${a}-to`;s.classList.remove(v),s.classList.remove(y)}}e.dragRemove&&!d&&J(s)};return(s,d)=>{const h=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(h,{class:"fox-root-navigator","view-class":s.viewClass,"before-enter":f,enter:p,"after-enter":l,"before-leave":_,leave:m,"after-leave":g,multi:!0,name:s.routerViewName,"view-tag":s.viewTag,transition:s.transition},null,8,["view-class","name","view-tag","transition"])}}})},Symbol.toStringTag,{value:"Module"})),Q={class:"fox-swiper-navigator"},Z=i.defineComponent({__name:"swiper",props:{width:{},scrollDistance:{},scrollDuration:{},direction:{}},setup(t){const e=t,o=i.computed(()=>{const n={transform:`translate3d(${e.scrollDistance}px, 0, 0)`,width:`${e.width}`};return e.scrollDuration>0&&(n["transition-duration"]=`${e.scrollDuration}ms`),n});return(n,r)=>(i.openBlock(),i.createElementBlock("div",Q,[i.createElementVNode("div",{class:"fox-swiper-navigator__inner",style:i.normalizeStyle(o.value)},[i.renderSlot(n.$slots,"default")],4)]))}});let tt=0;function et(){return++tt}const nt=15,ot=300,it=200;function st(t){t.stopPropagation()}function at(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&st(t)}function rt(t,e,o=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*o}function X(t,e=0,o,n=it){o==="end"?t.style.transition=`transform ${n}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}class ct{width=0;columnWidth=0;max=0;min=0;el=null;swipeDuration=360;transitionEndTrigger=null;moving=!1;startDistance=0;scrollDistance=0;getStartDistance;openPage;isPageOpened;pageOpened;moveRatio=.5;momentumReduceRatio=1;transitionend=null;touchstart=null;touchmove=null;touchend=null;touchcancel=null;constructor(e,o,n,r,f,p){this.getStartDistance=e,this.openPage=o,this.isPageOpened=n,this.pageOpened=r,this.moveRatio=f,this.momentumReduceRatio=p}open(){const e=this.el,o=V(),n=(r,f,p,l)=>{let _=f+this.startDistance;const m=this.columnWidth*this.moveRatio;if(p==="end"){if(f==0){this.moving=!1;return}Math.abs(f)>m?f>0?_=this.startDistance+this.columnWidth:_=this.startDistance-this.columnWidth:_=this.startDistance;let g=-_;g<0?g=0:g>this.width-this.columnWidth&&(g=this.width-this.columnWidth);const s=Math.floor(g/this.columnWidth);this.isPageOpened(s)||this.openPage(s),_=-s*this.columnWidth,l&&l>0&&(this.transitionEndTrigger=()=>{this.moving=!1,this.pageOpened(s)}),X(r,_,"end",l),this.scrollDistance=_}else{if(Math.abs(f)>m){let s=0;if(f>0?s=Math.abs(this.startDistance+this.columnWidth):s=Math.abs(this.startDistance-this.columnWidth),s>=0&&s<this.width){const d=Math.floor(s/this.columnWidth);this.isPageOpened(d)||this.openPage(d)}}let g=-_;g<this.min?g=this.min:g>this.max&&(g=this.max),X(r,-g,"",0)}};this.transitionend=()=>{e.style.transition="",this.transitionEndTrigger&&(this.transitionEndTrigger(),this.transitionEndTrigger=null)},this.touchstart=r=>{this.moving||(o.start(r),this.startDistance=this.getStartDistance(),this.transitionEndTrigger=null,this.moving=!0)},this.touchmove=r=>{o.move(r),!o.isVertical()&&(at(r,!0),n(e,o.state.deltaX,"",0))},this.touchend=()=>{if(o.isVertical()){n(e,0,"end",this.swipeDuration);return}const r=o.state.deltaX;if(r==0)return;const f=o.state.duration;if(f<ot&&Math.abs(r)>nt){const l=rt(r,f,this.momentumReduceRatio);n(e,l,"end",this.swipeDuration)}else n(e,r,"end",this.swipeDuration)},e.addEventListener("transitionend",this.transitionend),e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchmove",this.touchmove),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchend)}close(){const e=this.el;this.transitionend&&e.addEventListener("transitionend",this.transitionend),this.touchstart&&e.addEventListener("touchstart",this.touchstart),this.touchmove&&e.addEventListener("touchmove",this.touchmove),this.touchend&&e.addEventListener("touchend",this.touchend),this.touchcancel&&e.addEventListener("touchcancel",this.touchcancel),this.el=null}}function lt(t,e,o,n,r,f){return new ct(t,e,o,n,r,f)}function dt(t){const e=i.unref(t),o=window.getComputedStyle(e,null),n=parseFloat(o.getPropertyValue("padding-left")),r=parseFloat(o.getPropertyValue("padding-right")),f=parseFloat(o.getPropertyValue("padding-top")),p=parseFloat(o.getPropertyValue("padding-bottom"));return{width:e.clientWidth-n-r,height:e.clientHeight-f-p}}const ut=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{activePath:{},routes:{},height:{default:-1},width:{default:-1},draggable:{type:Boolean,default:!0},openViewPage:{},routerViewName:{},moveRatio:{default:.5},momentumReduceRatio:{default:1},direction:{default:"horizontal"},transition:{type:[Function,Boolean],default:!0},swipeDuration:{default:360},scrollDuration:{},customClass:{},customStyle:{}},emits:["update:activePath"],setup(t,{emit:e}){const o=t,n=i.reactive({scrollDistance:0,index:-1,openedIndexList:[],width:o.width,height:o.height}),r=e,f=()=>n.scrollDistance,p=c=>{if(n.openedIndexList.indexOf(c)===-1){n.openedIndexList.push(c);const T=o.routes[c];try{o.openViewPage(T,c)}catch(w){console.error(w)}}},l=c=>n.openedIndexList.indexOf(c)!==-1,_=c=>{n.index=c,n.width>0?n.scrollDistance=-n.index*n.width:n.scrollDistance=0;const T=o.routes[c];r("update:activePath",T.path)};let m=null;o.draggable&&(m=lt(f,p,l,_,o.moveRatio,o.momentumReduceRatio));let g=null;i.onMounted(()=>{const c=a(),T=()=>{const w=dt(c);s(o.activePath,o.routes,w.width,w.height,o.swipeDuration,o.direction)};if(window.ResizeObserver&&(g=new window.ResizeObserver(T),g.observe(c)),T(),m){const w=y();m.el=w,m.open()}}),i.onBeforeUnmount(()=>{g&&(g.disconnect(),g=null),m&&m.close()}),i.watch([()=>o.activePath,()=>o.routes,()=>o.width,()=>o.height,()=>o.swipeDuration,()=>o.direction],([c,T,w,b,M,P])=>{const C=w<=0?n.width:w,L=b<=0?n.height:b;s(c,T,C,L,M,P)});const s=(c,T,w,b,M,P="horizontal")=>{const C=c;if(n.index=T.findIndex(L=>L.path===C),P==="horizontal"){const L=w;if(L>0){n.width=w;const pt=L*o.routes.length,mt=-L/3,gt=L*(T.length-1)+L/3;m&&(m.columnWidth=L,m.width=pt,m.min=mt,m.max=gt),n.index!==-1&&(n.openedIndexList.push(n.index),n.scrollDistance=-L*n.index)}}m&&(m.swipeDuration=M)},d=`fox-swiper-navigator-${et()}`,h=i.computed(()=>{const c=[d];return o.customClass&&c.push(o.customClass),c}),$=i.computed(()=>{const c={},T=n.width>0?n.width:o.width;T>0&&(c.width=`${T}px`);const w=n.height>0?n.height:o.height;return w>0&&(c.height=`${w}px`),o.customStyle&&Object.assign(c,o.customStyle),c});let u=null;function a(){return u||(u=document.querySelector(`.${d}`),u)}let v=null;function y(){return v||(v=document.querySelector(`.${d}>.fox-swiper-navigator__inner`),v)}const x=i.computed(()=>n.width>0?`${n.width*o.routes.length}px`:"100%"),D=(c,T)=>{const w=o.routes.findIndex(b=>{const M=c.path??c.name??"";return b.path==M});return n.width<=0?{}:{style:{left:`${w*n.width}px`,width:`${n.width}px`}}};return(c,T)=>{const w=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(w,{class:i.normalizeClass(h.value),style:i.normalizeStyle($.value),"view-class":"fox-swiper-navigator__item",tag:Z,"view-tag-props":D,multi:!0,name:c.routerViewName,transition:c.transition,"scroll-distance":n.scrollDistance,"scroll-duration":c.scrollDuration,direction:c.direction,width:x.value},null,8,["class","style","name","transition","scroll-distance","scroll-duration","direction","width"])}}})},Symbol.toStringTag,{value:"Module"}));let ft="fox-";const ht=[],I=Object.assign({"/src/components/card-navigator/index.vue":B,"/src/components/default-navigator/index.vue":z,"/src/components/root-navigator/index.vue":K,"/src/components/swiper-navigator/index.vue":ut}),A=[];for(const t in I){let e=/src\/components\/(.*)\/index.vue/.exec(t)[1];ht.indexOf(e)===-1&&A.push({name:e,component:I[t].default})}return{install(t){A.forEach(e=>{t.component(`${ft}${e.name}`,e.component)})}}});
2
+ * @fox-js/navigation v4.0.1-10 Tue Mar 12 2024 21:40:43 GMT+0800 (中国标准时间)
3
+ */const B=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!1}},setup(t){return(e,n)=>{const o=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(o,{class:"fox-card-navigator","view-class":"fox-card-navigator__item","view-active-class":"fox-card-navigator__item-active","view-inactive-class":"fox-card-navigator__item-inactive","transition-name":"fox-card-navigator__trans",transition:e.transition,multi:!0,name:e.routerViewName},null,8,["transition","name"])}}})},Symbol.toStringTag,{value:"Module"})),z=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{routerViewName:{},transition:{type:[Function,Boolean],default:!0}},setup(t){return(e,n)=>{const o=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(o,{transition:!1,multi:!1,name:e.routerViewName},{default:i.withCtx(({Component:r})=>[i.createVNode(i.Transition,{name:"fox-default-navigator__trans"},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(r)))]),_:2},1024)]),_:1},8,["name"])}}})},Symbol.toStringTag,{value:"Module"})),S=10;function Y(t,e){return t>e&&t>S?"horizontal":e>t&&e>S?"vertical":""}function V(){const t={startX:0,startY:0,startTime:0,duration:0,moveX:0,moveY:0,deltaX:0,deltaY:0,offsetX:0,offsetY:0,direction:""},e=()=>t.direction==="vertical",n=()=>t.direction==="horizontal",o=()=>{t.deltaX=0,t.deltaY=0,t.offsetX=0,t.offsetY=0,t.direction="",t.startTime=0};return{move:h=>{if(h.touches){const l=h.touches[0];t.deltaX=l.clientX-t.startX,t.deltaY=l.clientY-t.startY,t.moveX=l.clientX,t.moveY=l.clientY}else t.deltaX=h.clientX-t.startX,t.deltaY=h.clientY-t.startY,t.moveX=h.clientX,t.moveY=h.clientY;t.offsetX=Math.abs(t.deltaX),t.offsetY=Math.abs(t.deltaY),t.duration=Date.now()-t.startTime,t.direction||(t.direction=Y(t.offsetX,t.offsetY))},start:h=>{if(o(),h.touches){const l=h.touches[0];t.startX=l.clientX,t.startY=l.clientY}else t.startX=h.clientX,t.startY=h.clientY;t.startTime=Date.now()},reset:o,isVertical:e,isHorizontal:n,state:t}}function W(t){return t===window}const N=t=>{const e=i.unref(t);if(W(e)){const n=e.innerWidth,o=e.innerHeight;return{top:0,left:0,right:n,bottom:o,width:n,height:o}}return e&&e.getBoundingClientRect?e.getBoundingClientRect():{top:0,left:0,right:0,bottom:0,width:0,height:0}},F=15,k=300,j=200;function U(t){t.stopPropagation()}function q(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&U(t)}function H(t,e,n=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*n}function R(t,e=0,n,o=j){n==="end"?t.style.transition=`transform ${o}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}const O=new WeakMap;function G(t,e,n,o,r=500,f,h=1e3){const l={active:!0,startDistance:0,scrollDistance:0,scrollTime:0,moving:!1,transitionEndTrigger:null},_=t.previousSibling,m=V(),g=(a,v,y,x)=>{let D=v+l.startDistance;if(y==="end"){const c=N(a);let T=c.width*e;D<T?D=0:D=c.width;let w=!1;x&&x>0&&(w=!0,l.transitionEndTrigger=()=>{l.moving=!1,f&&a.classList.remove(f),D>0&&typeof o=="function"&&o()}),R(a,D,"end",x),_&&R(_,0,"",0),!w&&D>0&&typeof o=="function"&&(l.moving=!1,o())}else D<0&&(D=0),R(a,D,"",0)},s=()=>{t.style.transform="",t.style.transition="",l.transitionEndTrigger?(l.transitionEndTrigger(),l.transitionEndTrigger=null,_&&setTimeout(()=>{_&&(_.style.transform="",_.style.transition="")},r)):_&&(_.style.transform="",_.style.transition="")},u=/^matrix\((.+)\)$/,p=a=>{if(m.start(a),l.scrollDistance=0,l.moving){const v=t,{transform:y}=window.getComputedStyle(v);if(y){const x=u.exec(y);if(x){const c=x[1].split(/,\s*/);l.scrollDistance=+c[4]}}}f&&t.classList.add(f),l.startDistance=l.scrollDistance,l.transitionEndTrigger=null,l.moving=!0},b=a=>{l.moving=!0,m.move(a),!m.isVertical()&&(q(a,!0),g(t,m.state.deltaX,"",0))},d=()=>{if(m.isVertical()){g(t,0,"end",h);return}const a=m.state.deltaX;if(a===0){f&&t.classList.remove(f),l.moving=!1;return}const v=m.state.duration;if(v<k&&Math.abs(a)>F){const x=H(a,v,n);g(t,x,"end",h)}else g(t,a,"end",h)};t.addEventListener("transitionend",s),t.addEventListener("touchstart",p),t.addEventListener("touchmove",b),t.addEventListener("touchend",d),t.addEventListener("touchcancel",d),O.set(t,{state:l,transitionend:s,touchstart:p,touchmove:b,touchend:d,touchcancel:d})}function J(t){const e=O.get(t);e&&(O.delete(t),t.addEventListener("transitionend",e.transitionend),t.addEventListener("touchstart",e.touchstart),t.addEventListener("touchmove",e.touchmove),t.addEventListener("touchend",e.touchend),t.addEventListener("touchcancel",e.touchcancel))}const K=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{dragRemove:{type:Boolean,default:!0},removeViewPage:{},removeMoveRatio:{default:.5},momentumReduceRatio:{default:1},removeViewPageDuration:{default:500},routerViewName:{},viewTag:{type:[Function,String],default:"div"},transition:{type:[Function,Boolean],default:!0},viewClass:{type:[Function,String],default:"fox-root-navigator__item"}},setup(t){const e=t;let n=null,o=null;function r(s){return(s.params&&s.params.animationType)??"slide"}const f=(s,u,p,b)=>{if(p.opsType===E.OperationType.Append||u){const d=r(p),a=u?"show":"enter";if(a==="show"&&(d==="pop"||o!=="leave"||(n?r(n):"")==="pop"))return;a==="enter"&&(n=p,o="enter");const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-active`;s.classList.add(v),s.classList.add(y)}},h=(s,u,p,b)=>{if(p.opsType===E.OperationType.Append||u){const d=r(p),a=u?"show":"enter";if(a==="show"&&(d==="pop"||o!=="leave"||(n?r(n):"")==="pop"))return;const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-to`;s.classList.remove(v),s.classList.add(y)}},l=(s,u,p,b)=>{if(p.opsType===E.OperationType.Append||u){const d=r(p),a=u?"show":"enter";if(a==="enter"&&(n=null,o=null),d!=="pop"){const v=`fox-root-navigator__${d}-${a}-active`,y=`fox-root-navigator__${d}-${a}-to`;s.classList.remove(v),s.classList.remove(y)}}e.dragRemove&&!u&&p.opsType===E.OperationType.Append&&G(s,e.removeMoveRatio,e.momentumReduceRatio,e.removeViewPage,e.removeViewPageDuration,"fox-root-navigator__item-moving",1e3)},_=(s,u,p,b)=>{if(p.opsType===E.OperationType.Append||u){const d=r(p),a=u?"hide":"leave";if(a==="hide"&&(d==="pop"||o!=="enter"||(n?r(n):"")==="pop"))return;a==="leave"&&(n=p,o="leave");const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-active`;s.classList.add(v),s.classList.add(y)}},m=(s,u,p,b)=>{if(p.opsType===E.OperationType.Append||u){const d=r(p),a=u?"hide":"leave";if(a==="hide"&&(d==="pop"||o!=="enter"||(n?r(n):"")==="pop"))return;const v=`fox-root-navigator__${d}-${a}-from`,y=`fox-root-navigator__${d}-${a}-to`;s.classList.remove(v),s.classList.add(y)}},g=(s,u,p,b)=>{if(p.opsType===E.OperationType.Append||u){const d=r(p),a=u?"hide":"leave";if(a==="leave"&&(n=null,o=null),d!=="pop"){const v=`fox-root-navigator__${d}-${a}-active`,y=`fox-root-navigator__${d}-${a}-to`;s.classList.remove(v),s.classList.remove(y)}}e.dragRemove&&!u&&J(s)};return(s,u)=>{const p=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(p,{class:"fox-root-navigator","view-class":s.viewClass,"before-enter":f,enter:h,"after-enter":l,"before-leave":_,leave:m,"after-leave":g,multi:!0,name:s.routerViewName,"view-tag":s.viewTag,transition:s.transition},null,8,["view-class","name","view-tag","transition"])}}})},Symbol.toStringTag,{value:"Module"})),Q={class:"fox-swiper-navigator"},Z=i.defineComponent({__name:"swiper",props:{width:{},scrollDistance:{},scrollDuration:{},direction:{}},setup(t){const e=t,n=i.computed(()=>{const o={transform:`translate3d(${e.scrollDistance}px, 0, 0)`,width:`${e.width}`};return e.scrollDuration>0&&(o["transition-duration"]=`${e.scrollDuration}ms`),o});return(o,r)=>(i.openBlock(),i.createElementBlock("div",Q,[i.createElementVNode("div",{class:"fox-swiper-navigator__inner",style:i.normalizeStyle(n.value)},[i.renderSlot(o.$slots,"default")],4)]))}});let tt=0;function et(){return++tt}const nt=15,ot=300,it=200;function st(t){t.stopPropagation()}function at(t,e){(typeof t.cancelable!="boolean"||t.cancelable)&&t.preventDefault(),e&&st(t)}function rt(t,e,n=1){return t=Math.abs(t/e)/.003*(t<0?-1:1),t*n}function X(t,e=0,n,o=it){n==="end"?t.style.transition=`transform ${o}ms cubic-bezier(0.17, 0.89, 0.45, 1)`:t.style.transition="transform 0ms cubic-bezier(0.17, 0.89, 0.45, 1)",t.style.transform=`translate3d(${e}px, 0, 0)`}class ct{width=0;columnWidth=0;max=0;min=0;el=null;swipeDuration=360;transitionEndTrigger=null;moving=!1;startDistance=0;scrollDistance=0;getStartDistance;openPage;isPageOpened;pageOpened;moveRatio=.5;momentumReduceRatio=1;transitionend=null;touchstart=null;touchmove=null;touchend=null;touchcancel=null;constructor(e,n,o,r,f,h){this.getStartDistance=e,this.openPage=n,this.isPageOpened=o,this.pageOpened=r,this.moveRatio=f,this.momentumReduceRatio=h}open(){const e=this.el,n=V(),o=(r,f,h,l)=>{let _=f+this.startDistance;const m=this.columnWidth*this.moveRatio;if(h==="end"){if(f==0){this.moving=!1;return}Math.abs(f)>m?f>0?_=this.startDistance+this.columnWidth:_=this.startDistance-this.columnWidth:_=this.startDistance;let g=-_;g<0?g=0:g>this.width-this.columnWidth&&(g=this.width-this.columnWidth);const s=Math.floor(g/this.columnWidth);this.isPageOpened(s)||this.openPage(s),_=-s*this.columnWidth,l&&l>0&&(this.transitionEndTrigger=()=>{this.moving=!1,this.pageOpened(s)}),X(r,_,"end",l),this.scrollDistance=_}else{if(Math.abs(f)>m){let s=0;if(f>0?s=Math.abs(this.startDistance+this.columnWidth):s=Math.abs(this.startDistance-this.columnWidth),s>=0&&s<this.width){const u=Math.floor(s/this.columnWidth);this.isPageOpened(u)||this.openPage(u)}}let g=-_;g<this.min?g=this.min:g>this.max&&(g=this.max),X(r,-g,"",0)}};this.transitionend=()=>{e.style.transition="",this.transitionEndTrigger&&(this.transitionEndTrigger(),this.transitionEndTrigger=null)},this.touchstart=r=>{this.moving||(n.start(r),this.startDistance=this.getStartDistance(),this.transitionEndTrigger=null,this.moving=!0)},this.touchmove=r=>{n.move(r),!n.isVertical()&&(at(r,!0),o(e,n.state.deltaX,"",0))},this.touchend=()=>{if(n.isVertical()){o(e,0,"end",this.swipeDuration);return}const r=n.state.deltaX;if(r==0)return;const f=n.state.duration;if(f<ot&&Math.abs(r)>nt){const l=rt(r,f,this.momentumReduceRatio);o(e,l,"end",this.swipeDuration)}else o(e,r,"end",this.swipeDuration)},e.addEventListener("transitionend",this.transitionend),e.addEventListener("touchstart",this.touchstart),e.addEventListener("touchmove",this.touchmove),e.addEventListener("touchend",this.touchend),e.addEventListener("touchcancel",this.touchend)}close(){const e=this.el;this.transitionend&&e.addEventListener("transitionend",this.transitionend),this.touchstart&&e.addEventListener("touchstart",this.touchstart),this.touchmove&&e.addEventListener("touchmove",this.touchmove),this.touchend&&e.addEventListener("touchend",this.touchend),this.touchcancel&&e.addEventListener("touchcancel",this.touchcancel),this.el=null}}function lt(t,e,n,o,r,f){return new ct(t,e,n,o,r,f)}function dt(t){const e=i.unref(t),n=window.getComputedStyle(e,null),o=parseFloat(n.getPropertyValue("padding-left")),r=parseFloat(n.getPropertyValue("padding-right")),f=parseFloat(n.getPropertyValue("padding-top")),h=parseFloat(n.getPropertyValue("padding-bottom"));return{width:e.clientWidth-o-r,height:e.clientHeight-f-h}}const ut=Object.freeze(Object.defineProperty({__proto__:null,default:i.defineComponent({__name:"index",props:{activePath:{},routes:{},height:{default:-1},width:{default:-1},draggable:{type:Boolean,default:!0},openViewPage:{},routerViewName:{},moveRatio:{default:.5},momentumReduceRatio:{default:1},direction:{default:"horizontal"},transition:{type:[Function,Boolean],default:!0},swipeDuration:{default:360},scrollDuration:{},customClass:{},customStyle:{}},emits:["update:activePath"],setup(t,{emit:e}){const n=t,o=i.reactive({scrollDistance:0,index:-1,openedIndexList:[],width:n.width,height:n.height}),r=e,f=()=>o.scrollDistance,h=c=>{if(o.openedIndexList.indexOf(c)===-1){o.openedIndexList.push(c);const T=n.routes[c];try{n.openViewPage(T,c)}catch(w){console.error(w)}}},l=c=>o.openedIndexList.indexOf(c)!==-1,_=c=>{o.index=c,o.width>0?o.scrollDistance=-o.index*o.width:o.scrollDistance=0;const T=n.routes[c];r("update:activePath",T.path)};let m=null;n.draggable&&(m=lt(f,h,l,_,n.moveRatio,n.momentumReduceRatio));let g=null;i.onMounted(()=>{const c=a(),T=()=>{const w=dt(c);s(n.activePath,n.routes,w.width,w.height,n.swipeDuration,n.direction)};if(window.ResizeObserver&&(g=new window.ResizeObserver(T),g.observe(c)),T(),m){const w=y();m.el=w,m.open()}}),i.onBeforeUnmount(()=>{g&&(g.disconnect(),g=null),m&&m.close()}),i.watch([()=>n.activePath,()=>n.routes,()=>n.width,()=>n.height,()=>n.swipeDuration,()=>n.direction],([c,T,w,L,M,P])=>{const C=w<=0?o.width:w,$=L<=0?o.height:L;s(c,T,C,$,M,P)});const s=(c,T,w,L,M,P="horizontal")=>{const C=c;if(o.index=T.findIndex($=>$.path===C),P==="horizontal"){const $=w;if($>0){o.width=w;const ht=$*n.routes.length,mt=-$/3,gt=$*(T.length-1)+$/3;m&&(m.columnWidth=$,m.width=ht,m.min=mt,m.max=gt),o.index!==-1&&(o.openedIndexList.push(o.index),o.scrollDistance=-$*o.index)}}m&&(m.swipeDuration=M)},u=`fox-swiper-navigator-${et()}`,p=i.computed(()=>{const c=[u];return n.customClass&&c.push(n.customClass),c}),b=i.computed(()=>{const c={},T=o.width>0?o.width:n.width;T>0&&(c.width=`${T}px`);const w=o.height>0?o.height:n.height;return w>0&&(c.height=`${w}px`),n.customStyle&&Object.assign(c,n.customStyle),c});let d=null;function a(){return d||(d=document.querySelector(`.${u}`),d)}let v=null;function y(){return v||(v=document.querySelector(`.${u}>.fox-swiper-navigator__inner`),v)}const x=i.computed(()=>o.width>0?`${o.width*n.routes.length}px`:"100%"),D=(c,T)=>{const w=n.routes.findIndex(L=>{const M=c.path??c.name??"";return L.path==M});return o.width<=0?{}:{style:{left:`${w*o.width}px`,width:`${o.width}px`}}};return(c,T)=>{const w=i.resolveComponent("fox-router-view");return i.openBlock(),i.createBlock(w,{class:i.normalizeClass(p.value),style:i.normalizeStyle(b.value),"view-class":"fox-swiper-navigator__item",tag:Z,"view-tag-props":D,multi:!0,name:c.routerViewName,transition:c.transition,"scroll-distance":o.scrollDistance,"scroll-duration":c.scrollDuration,direction:c.direction,width:x.value},null,8,["class","style","name","transition","scroll-distance","scroll-duration","direction","width"])}}})},Symbol.toStringTag,{value:"Module"}));let ft="fox-";const pt=[],A=Object.assign({"/src/components/card-navigator/index.vue":B,"/src/components/default-navigator/index.vue":z,"/src/components/root-navigator/index.vue":K,"/src/components/swiper-navigator/index.vue":ut}),I=[];for(const t in A){let e=/src\/components\/(.*)\/index.vue/.exec(t)[1];pt.indexOf(e)===-1&&I.push({name:e,component:A[t].default})}return{install(t){I.forEach(e=>{t.component(`${ft}${e.name}`,e.component)})}}});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .fox-card-navigator{position:relative;overflow:hidden;width:100%}.fox-card-navigator__item{position:relative;width:100%}.fox-card-navigator__item-active{z-index:1}.fox-card-navigator__item-inactive{display:none;z-index:0}.fox-card-navigator__trans-enter-from,.fox-card-navigator__trans-show-from{-webkit-transform:translate3d(50%,0%,0);transform:translate3d(50%,0,0)}.fox-card-navigator__trans-enter-to,.fox-card-navigator__trans-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-card-navigator__trans-hide-active{position:absolute;display:block;-webkit-transition:opacity .36s cubic-bezier(.17,.89,.45,1);transition:opacity .36s cubic-bezier(.17,.89,.45,1)}.fox-card-navigator__trans-leave-to,.fox-card-navigator__trans-hide-to{opacity:0}.fox-default-navigator__trans-enter,.fox-default-navigator__trans-show{-webkit-transform:translate3d(50%,0%,0);transform:translate3d(50%,0,0)}.fox-default-navigator__trans-enter-to,.fox-default-navigator__trans-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-default-navigator__trans-hide-active{position:absolute;display:block;-webkit-transition:opacity .36s cubic-bezier(.17,.89,.45,1);transition:opacity .36s cubic-bezier(.17,.89,.45,1)}.fox-default-navigator__trans-leave-to,.fox-default-navigator__trans-hide-to{opacity:0}.fox-root-navigator{position:relative;overflow:hidden;width:100%}.fox-root-navigator__item{position:fixed;left:0;top:0;width:100%;z-index:120;-webkit-box-sizing:border-box;box-sizing:border-box}.fox-root-navigator__item-moving{-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);box-shadow:0 4px 8px #0003,0 6px 20px #00000030}.fox-root-navigator__slide-enter-from{-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-root-navigator__slide-enter-active{-webkit-transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1),-webkit-transform .3s cubic-bezier(.17,.89,.45,1)}.fox-root-navigator__slide-enter-to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-root-navigator__slide-leave-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-root-navigator__slide-show-from{-webkit-transform:translate3d(-50%,0%,0);transform:translate3d(-50%,0,0)}.fox-root-navigator__slide-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-root-navigator__slide-hide-from{-webkit-transform:translate3d(0%,0%,0);transform:translateZ(0)}.fox-root-navigator__slide-hide-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.fox-root-navigator__pop-enter-from{-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-root-navigator__pop-enter-active{-webkit-transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1),-webkit-transform .3s cubic-bezier(.17,.89,.45,1)}.fox-root-navigator__pop-enter-to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-root-navigator__pop-leave-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-swiper-navigator{position:relative;overflow:hidden;width:100%}.fox-swiper-navigator__item{position:absolute;top:0;bottom:0}.fox-swiper-navigator__inner{position:absolute;top:0;bottom:0;-webkit-transition:-webkit-transform 0ms ease;transition:-webkit-transform 0ms ease;transition:transform 0ms ease;transition:transform 0ms ease,-webkit-transform 0ms ease}.fox-swiper-navigator__slide-enter-from{-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-swiper-navigator__slide-enter-active{-webkit-transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1),-webkit-transform .3s cubic-bezier(.17,.89,.45,1)}.fox-swiper-navigator__slide-enter-to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-swiper-navigator__slide-leave-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-swiper-navigator__slide-show-from{-webkit-transform:translate3d(-50%,0%,0);transform:translate3d(-50%,0,0)}.fox-swiper-navigator__slide-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-swiper-navigator__slide-hide-from{-webkit-transform:translate3d(0%,0%,0);transform:translateZ(0)}.fox-swiper-navigator__slide-hide-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.fox-swiper-navigator__pop-enter-from{-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-swiper-navigator__pop-enter-active{-webkit-transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1),-webkit-transform .3s cubic-bezier(.17,.89,.45,1)}.fox-swiper-navigator__pop-enter-to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-swiper-navigator__pop-leave-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-swiper-navigator .fox-header-bar,.fox-swiper-navigator .fox-footer-bar{position:absolute!important}
1
+ .fox-card-navigator{position:relative;overflow:hidden;width:100%}.fox-card-navigator__item{position:relative;width:100%}.fox-card-navigator__item-active{z-index:1}.fox-card-navigator__item-inactive{display:none;z-index:0}.fox-card-navigator__trans-enter-from,.fox-card-navigator__trans-show-from{-webkit-transform:translate3d(50%,0%,0);transform:translate3d(50%,0,0)}.fox-card-navigator__trans-enter-to,.fox-card-navigator__trans-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-card-navigator__trans-hide-active{position:absolute;display:block;-webkit-transition:opacity .36s cubic-bezier(.17,.89,.45,1);transition:opacity .36s cubic-bezier(.17,.89,.45,1)}.fox-card-navigator__trans-leave-to,.fox-card-navigator__trans-hide-to{opacity:0}.fox-default-navigator__trans-enter,.fox-default-navigator__trans-show{-webkit-transform:translate3d(50%,0%,0);transform:translate3d(50%,0,0)}.fox-default-navigator__trans-enter-to,.fox-default-navigator__trans-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-default-navigator__trans-hide-active{position:absolute;display:block;-webkit-transition:opacity .36s cubic-bezier(.17,.89,.45,1);transition:opacity .36s cubic-bezier(.17,.89,.45,1)}.fox-default-navigator__trans-leave-to,.fox-default-navigator__trans-hide-to{opacity:0}.fox-root-navigator{position:relative;overflow:hidden;width:100%}.fox-root-navigator__item{position:fixed;left:0;top:0;width:100%;z-index:120;-webkit-box-sizing:border-box;box-sizing:border-box}.fox-root-navigator__item-moving{-webkit-box-shadow:0 4px 8px 0 rgba(0,0,0,.2),0 6px 20px 0 rgba(0,0,0,.19);box-shadow:0 4px 8px #0003,0 6px 20px #00000030}.fox-root-navigator__slide-enter-from{-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-root-navigator__slide-enter-to{-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-root-navigator__slide-leave-to{-webkit-transition:-webkit-transform .5s ease-out;transition:-webkit-transform .5s ease-out;transition:transform .5s ease-out;transition:transform .5s ease-out,-webkit-transform .5s ease-out;-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-root-navigator__slide-show-from{-webkit-transform:translate3d(-50%,0%,0);transform:translate3d(-50%,0,0)}.fox-root-navigator__slide-show-to{-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-root-navigator__slide-hide-to{-webkit-transition:-webkit-transform .5s ease-out;transition:-webkit-transform .5s ease-out;transition:transform .5s ease-out;transition:transform .5s ease-out,-webkit-transform .5s ease-out;-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.fox-root-navigator__pop-enter-from{-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-root-navigator__pop-enter-to{-webkit-transition:-webkit-transform .3s ease-out;transition:-webkit-transform .3s ease-out;transition:transform .3s ease-out;transition:transform .3s ease-out,-webkit-transform .3s ease-out;-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-root-navigator__pop-leave-to{-webkit-transition:-webkit-transform .36s ease-out;transition:-webkit-transform .36s ease-out;transition:transform .36s ease-out;transition:transform .36s ease-out,-webkit-transform .36s ease-out;-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-swiper-navigator{position:relative;overflow:hidden;width:100%}.fox-swiper-navigator__item{position:absolute;top:0;bottom:0}.fox-swiper-navigator__inner{position:absolute;top:0;bottom:0;-webkit-transition:-webkit-transform 0ms ease;transition:-webkit-transform 0ms ease;transition:transform 0ms ease;transition:transform 0ms ease,-webkit-transform 0ms ease}.fox-swiper-navigator__slide-enter-from{-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-swiper-navigator__slide-enter-to{-webkit-transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1),-webkit-transform .3s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-swiper-navigator__slide-leave-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(103%,0,0);transform:translate3d(103%,0,0)}.fox-swiper-navigator__slide-show-from{-webkit-transform:translate3d(-50%,0%,0);transform:translate3d(-50%,0,0)}.fox-swiper-navigator__slide-show-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0%,0,0);transform:translateZ(0)}.fox-swiper-navigator__slide-hide-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(-50%,0,0);transform:translate3d(-50%,0,0)}.fox-swiper-navigator__pop-enter-from{-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-swiper-navigator__pop-enter-active{-webkit-transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1);transition:transform .3s cubic-bezier(.17,.89,.45,1),-webkit-transform .3s cubic-bezier(.17,.89,.45,1)}.fox-swiper-navigator__pop-enter-to{-webkit-transform:translate3d(0,0,0);transform:translateZ(0)}.fox-swiper-navigator__pop-leave-to{-webkit-transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:-webkit-transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1);transition:transform .36s cubic-bezier(.17,.89,.45,1),-webkit-transform .36s cubic-bezier(.17,.89,.45,1);-webkit-transform:translate3d(0,103%,0);transform:translate3d(0,103%,0)}.fox-swiper-navigator .fox-header-bar,.fox-swiper-navigator .fox-footer-bar{position:absolute!important}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fox-js/navigation",
3
3
  "type": "module",
4
- "version": "4.0.1-10",
4
+ "version": "4.0.1-11",
5
5
  "description": "fox navigation",
6
6
  "author": "jiangcheng",
7
7
  "keywords": [