ss-component-new 1.3.492 → 1.3.494
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/ss-component.cjs +14 -1
- package/dist/ss-component.js +964 -54
- package/package.json +1 -1
package/dist/ss-component.cjs
CHANGED
|
@@ -1 +1,14 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue");require("./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-J7Knzs4U.cjs");const Ce=require("./index-BpPyaNFa.cjs"),Te=require("./index-CMUsYepp.cjs");require("./index-BuZHI6xx.cjs");require("./request-Dl8yi2iS.cjs");;/* empty css */const ie=require("./ss-component2.cjs"),ae=require("./index-DKh4EyHV.cjs"),se=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./main-sCnkGFZB.cjs")));se.install=e=>{e.component("ssComponent",se)};const re=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-1io6qGUF.cjs")).then(e=>e.index$1));re.install=e=>{e.component("ssTab",re)};const oe=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Dz5sgTgm.cjs")).then(e=>e.index));oe.install=e=>{e.component("ssMenu",oe)};const ue=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BXZ5rAo2.cjs")));ue.install=e=>{e.component("ssMenuComponent",ue)};const fe=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CNQWedk2.cjs")));fe.install=e=>{e.component("ssCanvas",fe)};const ce=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BVaHwt5f.cjs")));ce.install=e=>{e.component("ssFold",ce)};const ve=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CWEUTGiD.cjs")).then(e=>e.index));ve.install=e=>{e.component("ssAvatar",ve)};const de=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeModel-CQSHt2TL.cjs")));de.install=e=>{e.component("ssThree",de)};const he=t.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeViewerHost-C4bcTMG5.cjs")).then(e=>e.threeViewerHost));he.install=e=>{e.component("threeViewerHost",he)};function ge(e,E){let S=0;return function(...f){const h=Date.now();h-S>=e&&(S=h,E.apply(this,f))}}function ke(){return"xxxxxxxxxxxxaxxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(E){const S=Math.random()*16|0;return(E==="x"?S:S&3|8).toString(16)})}const G=()=>ke().replaceAll("-","");function pe(e){const E=new Set,S=new Set;return e.forEach(f=>{E.has(f.id)?S.add(f):E.add(f.id)}),S.size>0&&e.forEach(f=>{f.id=G()}),e}function ee(e){return e.map((E,S)=>({id:G(),index:S,data:E}))}var ye=t.defineComponent({name:"VerticalScroll",emits:["offset","count"],inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!0},list:{type:Array,required:!0},hover:{type:Boolean,default:!1},singleWaitTime:{type:Number,default:1e3},wheel:{type:Boolean,default:!1},singleLine:{type:Boolean,default:!1},step:{type:Number,default:.5},visibleCount:{type:Number},ease:{type:String,default:"cubic-bezier(0.03, 0.76, 1, 0.16)"},direction:{type:String,default:"up"},delay:{type:Number,default:0}},setup(e,{expose:E,emit:S}){const f=t.ref(null),h=t.ref(null),v=t.ref([]),o=t.ref(0),H=t.ref(!1),B=t.ref(e.direction),y=t.computed(()=>e.hover?!H.value&&e.modelValue:e.modelValue),C=t.ref([]),r=ee(e.list),s=t.ref(e.visibleCount===void 0?0:e.visibleCount);let c=0,I=0,q=0,w=[],U=0,x=0,u=-1,g=0,T=null,z=!1,F=0,A=0,V=!1;const _=()=>{cancelAnimationFrame(T),T=null},J=()=>{const l=u+x;if(l>=r.length){const a=l-r.length,d=["splice",[0,x],[u],[0,a]];v.value=d,a>r.length?u=r.length:u=a}else{const a=["splice",[0,x],[u,l]];v.value=a,u=l}},M=()=>{const l=Array.from(f.value.children);w=(B.value==="up"?l.slice(0,x):l.slice(b.value.length-x,b.value.length)).map(d=>d.offsetHeight),U=w.reduce((d,n)=>d+n,0)},L=(l,a)=>{if(_(),!V)return;const d=()=>{const n=w[0];let i=!1;F>=n&&(i=!0),i&&(w.shift(),F=0,I+=1),I===c&&(q+=1,S("count",q),I=0),e.singleLine&&i?(z=!0,setTimeout(()=>{z=!1,l||L(!1,e.step)},e.singleWaitTime)):l||L(!1,e.step)};(y.value&&!z||l)&&(T=requestAnimationFrame(()=>{A+=a,F+=a,B.value==="up"?o.value+=a:o.value-=a,A>U?(S("offset",x,r),J(),t.nextTick(()=>{o.value=B.value==="up"?0:P()-g,A=0,M(),d()})):d()}))},R=()=>{H.value=!0},j=()=>{H.value=!1,e.hover&&L(!1,e.step)},D=ge(30,l=>{L(!0,10)}),Y=l=>{e.hover&&e.wheel&&(D(l),l.preventDefault(),l.stopPropagation())},b=t.computed(()=>{let l=[];return v.value.length===0?l=r.slice(0,s.value):v.value[0]==="splice"?(l=B.value==="up"?b.value:b.value.reverse(),l.splice(...v.value[1]),v.value.slice(2).forEach(a=>{l.push(...r.slice(...a))})):v.value.slice(1).forEach(a=>{l.push(...r.slice(...a))}),B.value!=="up"&&l.reverse(),pe(l)}),O=()=>{if(u=s.value+x,u>=r.length){const l=u-r.length,a=["slice",[0,u],[0,l]];return l>r.length?u=r.length:u=l,a}else return["slice",[0,u]]},P=()=>Array.from(f.value.children).map(l=>l.offsetHeight).reduce((l,a)=>l+a,0),$=l=>{e.visibleCount===void 0?(C.value=ee([e.list[0]]),t.nextTick(()=>{s.value=Math.ceil(g/h.value.offsetHeight)+2,C.value=r.slice(0,s.value),t.nextTick(()=>{l()})})):(C.value=r.slice(0,s.value),t.nextTick(()=>{l()}))};t.onMounted(()=>{f.value&&(f.value.parentElement.addEventListener("mouseenter",R),f.value.parentElement.addEventListener("mouseleave",j),f.value.parentElement.addEventListener("wheel",Y),g=f.value.parentElement.offsetHeight,e.list.length>0&&$(()=>{h.value.offsetHeight>g?(x=X(),v.value=O(),t.nextTick(()=>{o.value=B.value==="up"?0:P()-g,M(),V=!0,setTimeout(()=>{L(!1,e.step)},e.delay)})):W(),C.value=[]})),c=r.length});const W=()=>{I=0,q=0,V=!1,x=0,v.value=[],t.nextTick(()=>{o.value=B.value==="up"?0:P()-g,A=0,F=0})},X=()=>{let l=r.length-s.value;return l=Math.max(1,l),l=Math.min(5,l),l};return E({add:(l,a,d)=>{if(a&&a.length>0){l>r.length&&(l=r.length),l<0&&(l=0);const n=[];a.length===1&&b.value.forEach((m,k)=>{m.index===l&&n.push(k)});const i=[];a.forEach(m=>{i.push({id:G(),data:m})}),r.splice(l,0,...i),r.forEach((m,k)=>{m.index=k});const p=X();if(V)l<u&&(u+=1,u>r.length&&(u=0)),a.length===1&&n.length>0&&n.forEach(m=>{b.value[m]=i[0]}),p!==x&&(x=p);else{const m=()=>{h.value.offsetHeight>g?(x=p,v.value=O(),t.nextTick(()=>{o.value=B.value==="up"?0:P()-g,A=0,F=0,M(),V=!0,L(!1,e.step)})):(e.visibleCount===void 0&&(s.value=0),W()),C.value=[]};s.value===0&&e.visibleCount===void 0?$(()=>{m()}):(C.value=r.slice(0,s.value),t.nextTick(()=>{m()}))}}d&&typeof d=="function"&&d(r),c=r.length},remove:(l,a=1,d)=>{l>=0&&l<r.length&&(r.splice(l,a),V?(C.value=r.slice(0,s.value),t.nextTick(()=>{if(h.value.offsetHeight>g){const i=X();i!==x&&(x=i),v.value=O()}else W();C.value=[]})):W()),d&&typeof d=="function"&&d(r),c=r.length},update:(l,a,d)=>{if(l>=0&&l<r.length){const n=[];b.value.forEach((p,m)=>{p.index===l&&n.push(m)});const i={id:G(),index:l,data:a};r[l]=i,n.length>0&&n.forEach(p=>{b.value[p]=i})}d&&typeof d=="function"&&d(r)},reset:()=>{t.nextTick(()=>{C.value=r.slice(0,s.value),t.nextTick(()=>{h.value.offsetHeight>g?v.value[0]==="splice"?(J(),t.nextTick(()=>{M()})):(v.value=O(),t.nextTick(()=>{M()})):W()})})}}),t.watch(()=>e.modelValue,l=>{l&&L(!1,e.step)}),t.onUnmounted(()=>{cancelAnimationFrame(T),f.value&&(f.value.parentElement.removeEventListener("mouseenter",R),f.value.parentElement.removeEventListener("mouseleave",j),f.value.parentElement.removeEventListener("wheel",Y))}),{realWrapperRef:f,visibleItems:b,offset:o,testList:C,realWrapperHiddenRef:h}}});const be={style:{position:"absolute !important",top:"-999999px !important"},ref:"realWrapperHiddenRef"};function Be(e,E,S,f,h,v){return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{class:"vue3-seamless-vertical-wrapper",ref:"realWrapperRef",style:t.normalizeStyle({transition:`transform ${e.ease}`,transform:`translateY(-${e.offset}px)`})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visibleItems,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],4),t.createElementVNode("div",be,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.testList,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],512)],64)}function xe(e,E){E===void 0&&(E={});var S=E.insertAt;if(!(!e||typeof document>"u")){var f=document.head||document.getElementsByTagName("head")[0],h=document.createElement("style");h.type="text/css",S==="top"&&f.firstChild?f.insertBefore(h,f.firstChild):f.appendChild(h),h.styleSheet?h.styleSheet.cssText=e:h.appendChild(document.createTextNode(e))}}var Ve=`
|
|
2
|
+
.vue3-seamless-vertical-wrapper[data-v-70134dc7] {\r
|
|
3
|
+
width: 100%;
|
|
4
|
+
}\r
|
|
5
|
+
`;xe(Ve);ye.render=Be;ye.__scopeId="data-v-70134dc7";ye.__file="packages/VerticalScroll.vue";var Ee=t.defineComponent({name:"HorizontalScroll",emits:["offset","count"],inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!0},list:{type:Array,required:!0},hover:{type:Boolean,default:!1},singleWaitTime:{type:Number,default:1e3},wheel:{type:Boolean,default:!1},singleLine:{type:Boolean,default:!1},step:{type:Number,default:.5},visibleCount:{type:Number},ease:{type:String,default:"cubic-bezier(0.03, 0.76, 1, 0.16)"},direction:{type:String,default:"left"},delay:{type:Number,default:0}},setup(e,{emit:E,expose:S}){const f=t.ref(null),h=t.ref(null),v=t.ref([]),o=t.ref(0),H=t.ref(!1),B=t.ref(e.direction),y=t.computed(()=>e.hover?!H.value&&e.modelValue:e.modelValue),C=t.ref([]),r=t.ref(e.visibleCount===void 0?0:e.visibleCount),s=ee(e.list);let c=0,I=0,q=0,w=[],U=0,x=0,u=-1,g=0,T=null,z=!1,F=0,A=0,V=!1;const _=()=>{cancelAnimationFrame(T),T=null},J=()=>{const l=u+x;if(l>=s.length){const a=l-s.length,d=["splice",[0,x],[u],[0,a]];v.value=d,a>s.length?u=s.length:u=a}else{const a=["splice",[0,x],[u,l]];v.value=a,u=l}},M=()=>{const l=Array.from(f.value.children);w=(B.value==="left"?l.slice(0,x):l.slice(b.value.length-x,b.value.length)).map(d=>d.offsetWidth),U=w.reduce((d,n)=>d+n,0)},L=(l,a)=>{if(_(),!V)return;const d=()=>{const n=w[0];let i=!1;F>=n&&(i=!0),i&&(w.shift(),F=0,I+=1),I===c&&(q+=1,E("count",q),I=0),e.singleLine&&i?(z=!0,setTimeout(()=>{z=!1,l||L(!1,e.step)},e.singleWaitTime)):l||L(!1,e.step)};(y.value&&!z||l)&&(T=requestAnimationFrame(()=>{A+=a,F+=a,e?o.value+=a:o.value-=a,A>U?(E("offset",x,s),J(),t.nextTick(()=>{o.value=B.value==="left"?0:P()-g,A=0,M(),d()})):d()}))},R=()=>{H.value=!0},j=()=>{H.value=!1,e.hover&&L(!1,e.step)},D=ge(30,l=>{L(!0,10)}),Y=l=>{e.hover&&e.wheel&&(D(l),l.preventDefault(),l.stopPropagation())},b=t.computed(()=>{let l=[];return v.value.length===0?l=s.slice(0,r.value):v.value[0]==="splice"?(l=B.value==="left"?b.value:b.value.reverse(),l.splice(...v.value[1]),v.value.slice(2).forEach(a=>{l.push(...s.slice(...a))})):v.value.slice(1).forEach(a=>{l.push(...s.slice(...a))}),B.value!=="left"&&l.reverse(),pe(l)}),O=()=>{if(u=r.value+x,u>=s.length){const l=u-s.length,a=["slice",[0,u],[0,l]];return l>s.length?u=s.length:u=l,a}else return["slice",[0,u]]},P=()=>Array.from(f.value.children).map(l=>l.offsetWidth).reduce((l,a)=>l+a,0),$=l=>{e.visibleCount===void 0?(C.value=ee([e.list[0]]),t.nextTick(()=>{r.value=Math.ceil(g/h.value.offsetWidth)+2,C.value=s.slice(0,r.value),t.nextTick(()=>{l()})})):(C.value=s.slice(0,r.value),t.nextTick(()=>{l()}))};t.onMounted(()=>{f.value&&(f.value.parentElement.addEventListener("mouseenter",R),f.value.parentElement.addEventListener("mouseleave",j),f.value.parentElement.addEventListener("wheel",Y),g=f.value.parentElement.offsetWidth,e.list.length>0&&$(()=>{h.value.offsetWidth>g?(x=X(),v.value=O(),t.nextTick(()=>{o.value=B.value==="left"?0:P()-g,M(),V=!0,setTimeout(()=>{L(!1,e.step)},e.delay)})):W(),C.value=[]})),c=s.length});const W=()=>{I=0,q=0,V=!1,x=0,v.value=[],t.nextTick(()=>{o.value=B.value==="left"?0:P()-g,A=0,F=0})},X=()=>{let l=s.length-r.value;return l=Math.max(1,l),l=Math.min(5,l),l};return S({add:(l,a,d)=>{if(a&&a.length>0){l>s.length&&(l=s.length),l<0&&(l=0);const n=[];a.length===1&&b.value.forEach((m,k)=>{m.index===l&&n.push(k)});const i=[];a.forEach(m=>{i.push({id:G(),data:m})}),s.splice(l,0,...i),s.forEach((m,k)=>{m.index=k});const p=X();if(V)l<u&&(u+=1,u>s.length&&(u=0)),a.length===1&&n.forEach(m=>{b.value[m]=i[0]}),p!==x&&(x=p);else{const m=()=>{h.value.offsetWidth>g?(x=p,v.value=O(),t.nextTick(()=>{o.value=B.value==="left"?0:P()-g,A=0,F=0,M(),V=!0,L(!1,e.step)})):(e.visibleCount===void 0&&(r.value=0),W()),C.value=[]};r.value===0&&e.visibleCount===void 0?$(()=>{m()}):(C.value=s.slice(0,r.value),t.nextTick(()=>{m()}))}}d&&typeof d=="function"&&d(s),c=s.length},remove:(l,a=1,d)=>{l>=0&&l<s.length&&(s.splice(l,a),V?(C.value=s.slice(0,r.value),t.nextTick(()=>{if(h.value.offsetWidth>g){const i=X();i!==x&&(x=i),v.value=O()}else W();C.value=[]})):W()),d&&typeof d=="function"&&d(s),c=s.length},update:(l,a,d)=>{if(l>=0&&l<s.length){const n=[];b.value.forEach((p,m)=>{p.index===l&&n.push(m)});const i={id:G(),index:l,data:a};s[l]=i,n.length>0&&n.forEach(p=>{b[p]=i})}d&&typeof d=="function"&&d(s)},reset:()=>{t.nextTick(()=>{C.value=s.slice(0,r.value),t.nextTick(()=>{h.value.offsetWidth>g?v.value[0]==="splice"?(J(),t.nextTick(()=>{M()})):(v.value=O(),t.nextTick(()=>{M()})):W()})})}}),t.watch(()=>e.modelValue,l=>{l&&L(!1,e.step)}),t.onUnmounted(()=>{cancelAnimationFrame(T),f.value&&(f.value.parentElement.removeEventListener("mouseenter",R),f.value.parentElement.removeEventListener("mouseleave",j),f.value.parentElement.removeEventListener("wheel",Y))}),{visibleItems:b,offset:o,testList:C,realWrapperRef:f,realWrapperHiddenRef:h}}});function Le(e,E,S,f,h,v){return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",t.mergeProps({class:"vue3-seamless-horizontal-wrapper",ref:"realWrapperRef",style:{transition:`transform ${e.ease}`,transform:`translateX(-${e.offset}px)`}},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visibleItems,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index,style:"color: brown;"})),128))],16),t.createElementVNode("div",t.mergeProps({style:{position:"absolute !important",top:"-999999px !important"},ref:"realWrapperHiddenRef"},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.testList,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],16)],64)}var Ae=`
|
|
6
|
+
.vue3-seamless-horizontal-wrapper[data-v-530d6df5] {
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
`;xe(Ae);Ee.render=Le;Ee.__scopeId="data-v-530d6df5";Ee.__file="packages/HorizontalScroll.vue";var le=t.defineComponent({name:"Vue3SeamlessScroll",emits:["offset","count"],inheritAttrs:!1,props:{modelValue:{type:Boolean,default:!0},list:{type:Array,required:!0},hover:{type:Boolean,default:!1},singleWaitTime:{type:Number,default:1e3},wheel:{type:Boolean,default:!1},singleLine:{type:Boolean,default:!1},step:{type:Number,default:.5},visibleCount:{type:Number},ease:{type:String,default:"cubic-bezier(0.03, 0.76, 1, 0.16)"},direction:{type:String,default:"up"},delay:{type:Number,default:0}},setup(e,{expose:E,emit:S}){const f=t.ref(null),h=t.ref(null),v=t.ref(null),o=t.ref([]),H=t.ref(0),B=t.ref(!1),y=t.ref(e.direction),C=t.computed(()=>e.hover?!B.value&&e.modelValue:e.modelValue),r=t.ref([]),s=t.ref(e.visibleCount===void 0?0:e.visibleCount),c=ee(e.list);let I=0,q=0,w=0,U=[],x=0,u=0,g=-1,T=0,z=null,F=!1,A=0,V=0,_=!1;const J=t.computed(()=>y.value==="up"||y.value==="down"?`translateY(-${H.value}px)`:`translateX(-${H.value}px)`),M=()=>{cancelAnimationFrame(z),z=null},L=()=>{const n=g+u;if(n>=c.length){const i=n-c.length,p=["splice",[0,u],[g],[0,i]];o.value=p,i>c.length?g=c.length:g=i}else{const i=["splice",[0,u],[g,n]];o.value=i,g=n}},R=()=>{const n=Array.from(h.value.children);U=(y.value==="up"||y.value==="left"?n.slice(0,u):n.slice($.value.length-u,$.value.length)).map(p=>y.value==="left"||y.value==="right"?p.offsetWidth:p.offsetHeight),x=U.reduce((p,m)=>p+m,0)},j=()=>{y.value==="up"||y.value==="left"?H.value=0:H.value=X()-T},D=(n,i)=>{if(M(),!_)return;const p=()=>{const m=U[0];let k=!1;A>=m&&(k=!0),k&&(U.shift(),A=0,q+=1),q===I&&(w+=1,S("count",w),q=0),e.singleLine&&k?(F=!0,setTimeout(()=>{F=!1,n||D(!1,e.step)},e.singleWaitTime)):n||D(!1,e.step)};(C.value&&!F||n)&&(z=requestAnimationFrame(()=>{V+=i,A+=i,y.value==="up"||y.value==="left"?H.value+=i:H.value-=i,V>x?(S("offset",u,c),L(),t.nextTick(()=>{j(),V=0,R(),p()})):p()}))},Y=()=>{B.value=!0},b=()=>{B.value=!1,e.hover&&D(!1,e.step)},O=ge(30,n=>{D(!0,10)}),P=n=>{e.hover&&e.wheel&&(O(n),n.preventDefault(),n.stopPropagation())},$=t.computed(()=>{let n=[];return o.value.length===0?n=c.slice(0,s.value):o.value[0]==="splice"?(n=y.value==="up"||y.value==="left"?$.value:$.value.reverse(),n.splice(...o.value[1]),o.value.slice(2).forEach(i=>{n.push(...c.slice(...i))})):o.value.slice(1).forEach(i=>{n.push(...c.slice(...i))}),y.value==="up"||y.value==="left"||n.reverse(),pe(n)}),W=()=>{if(g=s.value+u,g>=c.length){const n=g-c.length,i=["slice",[0,g],[0,n]];return n>c.length?g=c.length:g=n,i}else return["slice",[0,g]]},X=()=>Array.from(h.value.children).map(i=>y.value==="left"||y.value==="right"?i.offsetWidth:i.offsetHeight).reduce((i,p)=>i+p,0),ne=n=>{e.visibleCount===void 0?(r.value=ee([e.list[0]]),t.nextTick(()=>{y.value==="left"||y.value==="right"?s.value=Math.ceil(T/v.value.offsetWidth)+2:s.value=Math.ceil(T/v.value.offsetHeight)+2,r.value=c.slice(0,s.value),t.nextTick(()=>{n()})})):(r.value=c.slice(0,s.value),t.nextTick(()=>{n()}))};t.onMounted(()=>{h.value&&(h.value.parentElement.addEventListener("mouseenter",Y),h.value.parentElement.addEventListener("mouseleave",b),h.value.parentElement.addEventListener("wheel",P),T=h.value.parentElement.offsetHeight,(y.value==="left"||y.value==="right")&&(T=h.value.parentElement.offsetWidth),ne(()=>{let n=v.value.offsetHeight>T;(y.value==="left"||y.value==="right")&&(n=v.value.offsetWidth>T),n?(u=te(),o.value=W(),t.nextTick(()=>{j(),R(),_=!0,setTimeout(()=>{D(!1,e.step)},e.delay)})):K(),r.value=[]})),I=c.length});const K=()=>{q=0,w=0,_=!1,u=0,o.value=[],t.nextTick(()=>{j(),V=0,A=0})},te=()=>{let n=c.length-s.value;return n=Math.max(1,n),n=Math.min(5,n),n};return E({add:(n,i,p)=>{if(i&&i.length>0){n>c.length&&(n=c.length),n<0&&(n=0);const m=[];i.length===1&&$.value.forEach((N,Z)=>{N.index===n&&m.push(Z)});const k=[];i.forEach(N=>{k.push({id:G(),data:N})}),c.splice(n,0,...k),c.forEach((N,Z)=>{N.index=Z});const Q=te();if(_)n<g&&(g+=1,g>c.length&&(g=0)),i.length===1&&m.length>0&&m.forEach(N=>{$[N]=k[0]}),Q!==u&&(u=Q);else{const N=()=>{let Z=v.value.offsetHeight>T;(y.value==="left"||y.value==="right")&&(Z=v.value.offsetWidth>T),Z?(u=Q,o.value=W(),t.nextTick(()=>{j(),V=0,A=0,R(),_=!0,D(!1,e.step)})):(e.visibleCount===void 0&&(s.value=0),K()),r.value=[]};s.value===0&&e.visibleCount===void 0?ne(()=>{N()}):(r.value=c.slice(0,s.value),t.nextTick(()=>{N()}))}}p&&typeof p=="function"&&p(c),I=c.length},remove:(n,i=1,p)=>{n>=0&&n<c.length&&(c.splice(n,i),_?(r.value=c.slice(0,s.value),t.nextTick(()=>{let m=v.value.offsetHeight>T;if((y.value==="left"||y.value==="right")&&(m=v.value.offsetWidth>T),m){const k=te();k!==u&&(u=k),o.value=W()}else K();r.value=[]})):K()),p&&typeof p=="function"&&p(c),I=c.length},update:(n,i,p)=>{if(n>=0&&n<c.length){const m=[];$.value.forEach((Q,N)=>{Q.index===n&&m.push(N)});const k={id:G(),index:n,data:i};c[n]=k,m.length>0&&m.forEach(Q=>{$[Q]=k})}p&&typeof p=="function"&&p(c)},reset:()=>{t.nextTick(()=>{r.value=c.slice(0,s.value),t.nextTick(()=>{let n=v.value.offsetHeight>T;(y.value==="left"||y.value==="right")&&(n=v.value.offsetWidth>T),n?o.value[0]==="splice"?(L(),t.nextTick(()=>{R()})):(o.value=W(),t.nextTick(()=>{R()})):K()})})}}),t.watch(()=>e.modelValue,n=>{n&&D(!1,e.step)}),t.onUnmounted(()=>{cancelAnimationFrame(z),h.value&&(h.value.parentElement.removeEventListener("mouseenter",Y),h.value.parentElement.removeEventListener("mouseleave",b),h.value.parentElement.removeEventListener("wheel",P))}),{realBoxRef:f,realWrapperRef:h,visibleItems:$,offset:H,testList:r,realWrapperHiddenRef:v,transform:J}}});function We(e,E,S,f,h,v){return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",t.mergeProps({class:"vue3-seamless-wrapper",ref:"realWrapperRef",style:{transition:`transform ${e.ease}`,transform:e.transform}},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.visibleItems,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],16),t.createElementVNode("div",t.mergeProps({style:{position:"absolute !important",left:"-999999px !important"},ref:"realWrapperHiddenRef"},e.$attrs),[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(e.testList,o=>t.renderSlot(e.$slots,"default",{key:o.id,data:o.data,index:o.index})),128))],16)],64)}var He=`
|
|
10
|
+
.vue3-seamless-wrapper[data-v-b156a416] {\r
|
|
11
|
+
width: 100%;\r
|
|
12
|
+
height: 100%;
|
|
13
|
+
}\r
|
|
14
|
+
`;xe(He);le.render=We;le.__scopeId="data-v-b156a416";le.__file="packages/Vue3SeamlessScroll.vue";const Fe=function(e,E={}){e.component(E.name||le.name,le)};function $e(e){e.use(Fe)}const me=Te.useMenuState(),Ie=[se,re,oe,ue,fe,ce,ve,de,he],we=e=>{Ie.forEach(E=>{e.use(E)}),e.use(ie),e.use($e,{name:"vue3-seamless-scroll"}),e.config.globalProperties.$router=ie},Me=e=>{switch(e){case"browser":return ae.browserThemeConfig;case"client":return ae.clientThemeConfig;case"three":return ae.threeThemeConfig}},qe=e=>{const E=document.documentElement;e==null||e.forEach(S=>{E.style.setProperty(S.name,S.value)})},ze=e=>{me.setPlatform(e);const E=Me(e);qe(E)},Pe={getPlatform:me.getPlatform,setPlatform:me.setPlatform,initPlatform:ze};exports.SvgIcon=Ce.SvgIcon;exports.router=ie;exports.default=we;exports.platformApi=Pe;
|
package/dist/ss-component.js
CHANGED
|
@@ -1,74 +1,984 @@
|
|
|
1
|
-
import { defineAsyncComponent as
|
|
1
|
+
import { defineAsyncComponent as Q, defineComponent as We, ref as b, computed as ae, onMounted as Ve, watch as He, onUnmounted as Le, nextTick as g, createElementBlock as G, openBlock as J, Fragment as K, createElementVNode as ie, normalizeStyle as ze, renderList as ue, renderSlot as oe, mergeProps as de } from "vue";
|
|
2
2
|
import "./index.vue_vue_type_style_index_0_scoped_07c75c98_lang-DFyt9sBY.js";
|
|
3
|
-
import { S as
|
|
4
|
-
import { u as
|
|
3
|
+
import { S as vt } from "./index-BHtNKL1L.js";
|
|
4
|
+
import { u as Me } from "./index-CwJwXVns.js";
|
|
5
5
|
import "./index-CI4RP047.js";
|
|
6
6
|
import "./request-XJsZ4h2T.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import
|
|
9
|
-
import { t as
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
import Te from "./ss-component2.js";
|
|
9
|
+
import { t as Ne, c as Re, b as ke } from "./index-ChNfRlIP.js";
|
|
10
|
+
const he = Q(() => import("./main-DWisOrSP.js"));
|
|
11
|
+
he.install = (e) => {
|
|
12
|
+
e.component("ssComponent", he);
|
|
13
13
|
};
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const me = Q(() => import("./index-CX4TTz13.js").then((e) => e.q));
|
|
15
|
+
me.install = (e) => {
|
|
16
|
+
e.component("ssTab", me);
|
|
17
17
|
};
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
const pe = Q(() => import("./index-B80uGb97.js").then((e) => e.i));
|
|
19
|
+
pe.install = (e) => {
|
|
20
|
+
e.component("ssMenu", pe);
|
|
21
21
|
};
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const ge = Q(() => import("./index-ClG8FDQH.js"));
|
|
23
|
+
ge.install = (e) => {
|
|
24
|
+
e.component("ssMenuComponent", ge);
|
|
25
25
|
};
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const ye = Q(() => import("./index-C8ORIDjr.js"));
|
|
27
|
+
ye.install = (e) => {
|
|
28
|
+
e.component("ssCanvas", ye);
|
|
29
29
|
};
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const Ee = Q(() => import("./index-rlStojTL.js"));
|
|
31
|
+
Ee.install = (e) => {
|
|
32
|
+
e.component("ssFold", Ee);
|
|
33
33
|
};
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const Se = Q(() => import("./index-BDGxsSv8.js").then((e) => e.i));
|
|
35
|
+
Se.install = (e) => {
|
|
36
|
+
e.component("ssAvatar", Se);
|
|
37
37
|
};
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
const Ce = Q(() => import("./threeModel-Dv9sgokW.js"));
|
|
39
|
+
Ce.install = (e) => {
|
|
40
|
+
e.component("ssThree", Ce);
|
|
41
41
|
};
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
const be = Q(() => import("./threeViewerHost-CK0krO72.js").then((e) => e.t));
|
|
43
|
+
be.install = (e) => {
|
|
44
|
+
e.component("threeViewerHost", be);
|
|
45
45
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
function Ie(e, S) {
|
|
47
|
+
let C = 0;
|
|
48
|
+
return function(...r) {
|
|
49
|
+
const d = Date.now();
|
|
50
|
+
d - C >= e && (C = d, S.apply(this, r));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function Pe() {
|
|
54
|
+
return "xxxxxxxxxxxxaxxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function(S) {
|
|
55
|
+
const C = Math.random() * 16 | 0;
|
|
56
|
+
return (S === "x" ? C : C & 3 | 8).toString(16);
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
const ee = () => Pe().replaceAll("-", "");
|
|
60
|
+
function $e(e) {
|
|
61
|
+
const S = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set();
|
|
62
|
+
return e.forEach((r) => {
|
|
63
|
+
S.has(r.id) ? C.add(r) : S.add(r.id);
|
|
64
|
+
}), C.size > 0 && e.forEach((r) => {
|
|
65
|
+
r.id = ee();
|
|
66
|
+
}), e;
|
|
67
|
+
}
|
|
68
|
+
function re(e) {
|
|
69
|
+
return e.map((S, C) => ({
|
|
70
|
+
id: ee(),
|
|
71
|
+
index: C,
|
|
72
|
+
data: S
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
var we = We({
|
|
76
|
+
name: "VerticalScroll",
|
|
77
|
+
emits: ["offset", "count"],
|
|
78
|
+
inheritAttrs: !1,
|
|
79
|
+
props: {
|
|
80
|
+
// 是否开启自动滚动
|
|
81
|
+
modelValue: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: !0
|
|
84
|
+
},
|
|
85
|
+
list: {
|
|
86
|
+
type: Array,
|
|
87
|
+
required: !0
|
|
88
|
+
},
|
|
89
|
+
// 是否开启鼠标悬停
|
|
90
|
+
hover: {
|
|
91
|
+
type: Boolean,
|
|
92
|
+
default: !1
|
|
93
|
+
},
|
|
94
|
+
// 单步停止等待时间 (默认值 1000ms)
|
|
95
|
+
singleWaitTime: {
|
|
96
|
+
type: Number,
|
|
97
|
+
default: 1e3
|
|
98
|
+
},
|
|
99
|
+
// 开启鼠标悬停时支持滚轮滚动
|
|
100
|
+
wheel: {
|
|
101
|
+
type: Boolean,
|
|
102
|
+
default: !1
|
|
103
|
+
},
|
|
104
|
+
// 启用单行滚动
|
|
105
|
+
singleLine: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: !1
|
|
108
|
+
},
|
|
109
|
+
step: {
|
|
110
|
+
type: Number,
|
|
111
|
+
default: 0.5
|
|
112
|
+
},
|
|
113
|
+
visibleCount: {
|
|
114
|
+
type: Number
|
|
115
|
+
},
|
|
116
|
+
ease: {
|
|
117
|
+
type: String,
|
|
118
|
+
default: "cubic-bezier(0.03, 0.76, 1, 0.16)"
|
|
119
|
+
},
|
|
120
|
+
direction: {
|
|
121
|
+
type: String,
|
|
122
|
+
default: "up"
|
|
123
|
+
},
|
|
124
|
+
delay: {
|
|
125
|
+
type: Number,
|
|
126
|
+
default: 0
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
setup(e, { expose: S, emit: C }) {
|
|
130
|
+
const r = b(null), d = b(null), c = b([]), u = b(0), F = b(!1), L = b(e.direction), y = ae(() => e.hover ? !F.value && e.modelValue : e.modelValue), x = b([]), i = re(e.list), s = b(e.visibleCount === void 0 ? 0 : e.visibleCount);
|
|
131
|
+
let f = 0, z = 0, R = 0, M = [], X = 0, E = 0, o = -1, m = 0, W = null, k = !1, B = 0, w = 0, I = !1;
|
|
132
|
+
const Y = () => {
|
|
133
|
+
cancelAnimationFrame(W), W = null;
|
|
134
|
+
}, te = () => {
|
|
135
|
+
const t = o + E;
|
|
136
|
+
if (t >= i.length) {
|
|
137
|
+
const n = t - i.length, v = [
|
|
138
|
+
"splice",
|
|
139
|
+
[0, E],
|
|
140
|
+
[o],
|
|
141
|
+
[0, n]
|
|
142
|
+
];
|
|
143
|
+
c.value = v, n > i.length ? o = i.length : o = n;
|
|
144
|
+
} else {
|
|
145
|
+
const n = ["splice", [0, E], [o, t]];
|
|
146
|
+
c.value = n, o = t;
|
|
147
|
+
}
|
|
148
|
+
}, N = () => {
|
|
149
|
+
const t = Array.from(r.value.children);
|
|
150
|
+
M = (L.value === "up" ? t.slice(0, E) : t.slice(H.value.length - E, H.value.length)).map((v) => v.offsetHeight), X = M.reduce((v, l) => v + l, 0);
|
|
151
|
+
}, $ = (t, n) => {
|
|
152
|
+
if (Y(), !I)
|
|
153
|
+
return;
|
|
154
|
+
const v = () => {
|
|
155
|
+
const l = M[0];
|
|
156
|
+
let a = !1;
|
|
157
|
+
B >= l && (a = !0), a && (M.shift(), B = 0, z += 1), z === f && (R += 1, C("count", R), z = 0), e.singleLine && a ? (k = !0, setTimeout(() => {
|
|
158
|
+
k = !1, t || $(!1, e.step);
|
|
159
|
+
}, e.singleWaitTime)) : t || $(!1, e.step);
|
|
160
|
+
};
|
|
161
|
+
(y.value && !k || t) && (W = requestAnimationFrame(() => {
|
|
162
|
+
w += n, B += n, L.value === "up" ? u.value += n : u.value -= n, w > X ? (C("offset", E, i), te(), g(() => {
|
|
163
|
+
u.value = L.value === "up" ? 0 : P() - m, w = 0, N(), v();
|
|
164
|
+
})) : v();
|
|
165
|
+
}));
|
|
166
|
+
}, D = () => {
|
|
167
|
+
F.value = !0;
|
|
168
|
+
}, j = () => {
|
|
169
|
+
F.value = !1, e.hover && $(!1, e.step);
|
|
170
|
+
}, O = Ie(30, (t) => {
|
|
171
|
+
$(!0, 10);
|
|
172
|
+
}), Z = (t) => {
|
|
173
|
+
e.hover && e.wheel && (O(t), t.preventDefault(), t.stopPropagation());
|
|
174
|
+
}, H = ae(() => {
|
|
175
|
+
let t = [];
|
|
176
|
+
return c.value.length === 0 ? t = i.slice(0, s.value) : c.value[0] === "splice" ? (t = L.value === "up" ? H.value : H.value.reverse(), t.splice(...c.value[1]), c.value.slice(2).forEach((n) => {
|
|
177
|
+
t.push(...i.slice(...n));
|
|
178
|
+
})) : c.value.slice(1).forEach((n) => {
|
|
179
|
+
t.push(...i.slice(...n));
|
|
180
|
+
}), L.value !== "up" && t.reverse(), $e(t);
|
|
181
|
+
}), U = () => {
|
|
182
|
+
if (o = s.value + E, o >= i.length) {
|
|
183
|
+
const t = o - i.length, n = ["slice", [0, o], [0, t]];
|
|
184
|
+
return t > i.length ? o = i.length : o = t, n;
|
|
185
|
+
} else
|
|
186
|
+
return ["slice", [0, o]];
|
|
187
|
+
}, P = () => Array.from(r.value.children).map((t) => t.offsetHeight).reduce((t, n) => t + n, 0), T = (t) => {
|
|
188
|
+
e.visibleCount === void 0 ? (x.value = re([e.list[0]]), g(() => {
|
|
189
|
+
s.value = Math.ceil(m / d.value.offsetHeight) + 2, x.value = i.slice(0, s.value), g(() => {
|
|
190
|
+
t();
|
|
191
|
+
});
|
|
192
|
+
})) : (x.value = i.slice(0, s.value), g(() => {
|
|
193
|
+
t();
|
|
194
|
+
}));
|
|
195
|
+
};
|
|
196
|
+
Ve(() => {
|
|
197
|
+
r.value && (r.value.parentElement.addEventListener("mouseenter", D), r.value.parentElement.addEventListener("mouseleave", j), r.value.parentElement.addEventListener("wheel", Z), m = r.value.parentElement.offsetHeight, e.list.length > 0 && T(() => {
|
|
198
|
+
d.value.offsetHeight > m ? (E = _(), c.value = U(), g(() => {
|
|
199
|
+
u.value = L.value === "up" ? 0 : P() - m, N(), I = !0, setTimeout(() => {
|
|
200
|
+
$(!1, e.step);
|
|
201
|
+
}, e.delay);
|
|
202
|
+
})) : A(), x.value = [];
|
|
203
|
+
})), f = i.length;
|
|
204
|
+
});
|
|
205
|
+
const A = () => {
|
|
206
|
+
z = 0, R = 0, I = !1, E = 0, c.value = [], g(() => {
|
|
207
|
+
u.value = L.value === "up" ? 0 : P() - m, w = 0, B = 0;
|
|
208
|
+
});
|
|
209
|
+
}, _ = () => {
|
|
210
|
+
let t = i.length - s.value;
|
|
211
|
+
return t = Math.max(1, t), t = Math.min(5, t), t;
|
|
212
|
+
};
|
|
213
|
+
return S({ add: (t, n, v) => {
|
|
214
|
+
if (n && n.length > 0) {
|
|
215
|
+
t > i.length && (t = i.length), t < 0 && (t = 0);
|
|
216
|
+
const l = [];
|
|
217
|
+
n.length === 1 && H.value.forEach((h, V) => {
|
|
218
|
+
h.index === t && l.push(V);
|
|
219
|
+
});
|
|
220
|
+
const a = [];
|
|
221
|
+
n.forEach((h) => {
|
|
222
|
+
a.push({
|
|
223
|
+
id: ee(),
|
|
224
|
+
data: h
|
|
225
|
+
});
|
|
226
|
+
}), i.splice(t, 0, ...a), i.forEach((h, V) => {
|
|
227
|
+
h.index = V;
|
|
228
|
+
});
|
|
229
|
+
const p = _();
|
|
230
|
+
if (I)
|
|
231
|
+
t < o && (o += 1, o > i.length && (o = 0)), n.length === 1 && l.length > 0 && l.forEach((h) => {
|
|
232
|
+
H.value[h] = a[0];
|
|
233
|
+
}), p !== E && (E = p);
|
|
234
|
+
else {
|
|
235
|
+
const h = () => {
|
|
236
|
+
d.value.offsetHeight > m ? (E = p, c.value = U(), g(() => {
|
|
237
|
+
u.value = L.value === "up" ? 0 : P() - m, w = 0, B = 0, N(), I = !0, $(!1, e.step);
|
|
238
|
+
})) : (e.visibleCount === void 0 && (s.value = 0), A()), x.value = [];
|
|
239
|
+
};
|
|
240
|
+
s.value === 0 && e.visibleCount === void 0 ? T(() => {
|
|
241
|
+
h();
|
|
242
|
+
}) : (x.value = i.slice(0, s.value), g(() => {
|
|
243
|
+
h();
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
v && typeof v == "function" && v(i), f = i.length;
|
|
248
|
+
}, remove: (t, n = 1, v) => {
|
|
249
|
+
t >= 0 && t < i.length && (i.splice(t, n), I ? (x.value = i.slice(0, s.value), g(() => {
|
|
250
|
+
if (d.value.offsetHeight > m) {
|
|
251
|
+
const a = _();
|
|
252
|
+
a !== E && (E = a), c.value = U();
|
|
253
|
+
} else
|
|
254
|
+
A();
|
|
255
|
+
x.value = [];
|
|
256
|
+
})) : A()), v && typeof v == "function" && v(i), f = i.length;
|
|
257
|
+
}, update: (t, n, v) => {
|
|
258
|
+
if (t >= 0 && t < i.length) {
|
|
259
|
+
const l = [];
|
|
260
|
+
H.value.forEach((p, h) => {
|
|
261
|
+
p.index === t && l.push(h);
|
|
262
|
+
});
|
|
263
|
+
const a = {
|
|
264
|
+
id: ee(),
|
|
265
|
+
index: t,
|
|
266
|
+
data: n
|
|
267
|
+
};
|
|
268
|
+
i[t] = a, l.length > 0 && l.forEach((p) => {
|
|
269
|
+
H.value[p] = a;
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
v && typeof v == "function" && v(i);
|
|
273
|
+
}, reset: () => {
|
|
274
|
+
g(() => {
|
|
275
|
+
x.value = i.slice(0, s.value), g(() => {
|
|
276
|
+
d.value.offsetHeight > m ? c.value[0] === "splice" ? (te(), g(() => {
|
|
277
|
+
N();
|
|
278
|
+
})) : (c.value = U(), g(() => {
|
|
279
|
+
N();
|
|
280
|
+
})) : A();
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
} }), He(() => e.modelValue, (t) => {
|
|
284
|
+
t && $(!1, e.step);
|
|
285
|
+
}), Le(() => {
|
|
286
|
+
cancelAnimationFrame(W), r.value && (r.value.parentElement.removeEventListener("mouseenter", D), r.value.parentElement.removeEventListener("mouseleave", j), r.value.parentElement.removeEventListener("wheel", Z));
|
|
287
|
+
}), {
|
|
288
|
+
realWrapperRef: r,
|
|
289
|
+
visibleItems: H,
|
|
290
|
+
offset: u,
|
|
291
|
+
testList: x,
|
|
292
|
+
realWrapperHiddenRef: d
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
const qe = {
|
|
297
|
+
style: { position: "absolute !important", top: "-999999px !important" },
|
|
298
|
+
ref: "realWrapperHiddenRef"
|
|
299
|
+
};
|
|
300
|
+
function De(e, S, C, r, d, c) {
|
|
301
|
+
return J(), G(
|
|
302
|
+
K,
|
|
303
|
+
null,
|
|
304
|
+
[
|
|
305
|
+
ie(
|
|
306
|
+
"div",
|
|
307
|
+
{
|
|
308
|
+
class: "vue3-seamless-vertical-wrapper",
|
|
309
|
+
ref: "realWrapperRef",
|
|
310
|
+
style: ze({ transition: `transform ${e.ease}`, transform: `translateY(-${e.offset}px)` })
|
|
311
|
+
},
|
|
312
|
+
[
|
|
313
|
+
(J(!0), G(
|
|
314
|
+
K,
|
|
315
|
+
null,
|
|
316
|
+
ue(e.visibleItems, (u) => oe(e.$slots, "default", {
|
|
317
|
+
key: u.id,
|
|
318
|
+
data: u.data,
|
|
319
|
+
index: u.index
|
|
320
|
+
})),
|
|
321
|
+
128
|
|
322
|
+
/* KEYED_FRAGMENT */
|
|
323
|
+
))
|
|
324
|
+
],
|
|
325
|
+
4
|
|
326
|
+
/* STYLE */
|
|
327
|
+
),
|
|
328
|
+
ie(
|
|
329
|
+
"div",
|
|
330
|
+
qe,
|
|
331
|
+
[
|
|
332
|
+
(J(!0), G(
|
|
333
|
+
K,
|
|
334
|
+
null,
|
|
335
|
+
ue(e.testList, (u) => oe(e.$slots, "default", {
|
|
336
|
+
key: u.id,
|
|
337
|
+
data: u.data,
|
|
338
|
+
index: u.index
|
|
339
|
+
})),
|
|
340
|
+
128
|
|
341
|
+
/* KEYED_FRAGMENT */
|
|
342
|
+
))
|
|
343
|
+
],
|
|
344
|
+
512
|
|
345
|
+
/* NEED_PATCH */
|
|
346
|
+
)
|
|
347
|
+
],
|
|
348
|
+
64
|
|
349
|
+
/* STABLE_FRAGMENT */
|
|
350
|
+
);
|
|
351
|
+
}
|
|
352
|
+
function Ae(e, S) {
|
|
353
|
+
S === void 0 && (S = {});
|
|
354
|
+
var C = S.insertAt;
|
|
355
|
+
if (!(!e || typeof document > "u")) {
|
|
356
|
+
var r = document.head || document.getElementsByTagName("head")[0], d = document.createElement("style");
|
|
357
|
+
d.type = "text/css", C === "top" && r.firstChild ? r.insertBefore(d, r.firstChild) : r.appendChild(d), d.styleSheet ? d.styleSheet.cssText = e : d.appendChild(document.createTextNode(e));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
var Oe = `
|
|
361
|
+
.vue3-seamless-vertical-wrapper[data-v-70134dc7] {\r
|
|
362
|
+
width: 100%;
|
|
363
|
+
}\r
|
|
364
|
+
`;
|
|
365
|
+
Ae(Oe);
|
|
366
|
+
we.render = De;
|
|
367
|
+
we.__scopeId = "data-v-70134dc7";
|
|
368
|
+
we.__file = "packages/VerticalScroll.vue";
|
|
369
|
+
var Fe = We({
|
|
370
|
+
name: "HorizontalScroll",
|
|
371
|
+
emits: ["offset", "count"],
|
|
372
|
+
inheritAttrs: !1,
|
|
373
|
+
props: {
|
|
374
|
+
// 是否开启自动滚动
|
|
375
|
+
modelValue: {
|
|
376
|
+
type: Boolean,
|
|
377
|
+
default: !0
|
|
378
|
+
},
|
|
379
|
+
list: {
|
|
380
|
+
type: Array,
|
|
381
|
+
required: !0
|
|
382
|
+
},
|
|
383
|
+
// 是否开启鼠标悬停
|
|
384
|
+
hover: {
|
|
385
|
+
type: Boolean,
|
|
386
|
+
default: !1
|
|
387
|
+
},
|
|
388
|
+
// 单步停止等待时间 (默认值 1000ms)
|
|
389
|
+
singleWaitTime: {
|
|
390
|
+
type: Number,
|
|
391
|
+
default: 1e3
|
|
392
|
+
},
|
|
393
|
+
// 开启鼠标悬停时支持滚轮滚动
|
|
394
|
+
wheel: {
|
|
395
|
+
type: Boolean,
|
|
396
|
+
default: !1
|
|
397
|
+
},
|
|
398
|
+
// 启用单行滚动
|
|
399
|
+
singleLine: {
|
|
400
|
+
type: Boolean,
|
|
401
|
+
default: !1
|
|
402
|
+
},
|
|
403
|
+
step: {
|
|
404
|
+
type: Number,
|
|
405
|
+
default: 0.5
|
|
406
|
+
},
|
|
407
|
+
visibleCount: {
|
|
408
|
+
type: Number
|
|
409
|
+
},
|
|
410
|
+
ease: {
|
|
411
|
+
type: String,
|
|
412
|
+
default: "cubic-bezier(0.03, 0.76, 1, 0.16)"
|
|
413
|
+
},
|
|
414
|
+
direction: {
|
|
415
|
+
type: String,
|
|
416
|
+
default: "left"
|
|
417
|
+
},
|
|
418
|
+
delay: {
|
|
419
|
+
type: Number,
|
|
420
|
+
default: 0
|
|
421
|
+
}
|
|
422
|
+
},
|
|
423
|
+
setup(e, { emit: S, expose: C }) {
|
|
424
|
+
const r = b(null), d = b(null), c = b([]), u = b(0), F = b(!1), L = b(e.direction), y = ae(() => e.hover ? !F.value && e.modelValue : e.modelValue), x = b([]), i = b(e.visibleCount === void 0 ? 0 : e.visibleCount), s = re(e.list);
|
|
425
|
+
let f = 0, z = 0, R = 0, M = [], X = 0, E = 0, o = -1, m = 0, W = null, k = !1, B = 0, w = 0, I = !1;
|
|
426
|
+
const Y = () => {
|
|
427
|
+
cancelAnimationFrame(W), W = null;
|
|
428
|
+
}, te = () => {
|
|
429
|
+
const t = o + E;
|
|
430
|
+
if (t >= s.length) {
|
|
431
|
+
const n = t - s.length, v = [
|
|
432
|
+
"splice",
|
|
433
|
+
[0, E],
|
|
434
|
+
[o],
|
|
435
|
+
[0, n]
|
|
436
|
+
];
|
|
437
|
+
c.value = v, n > s.length ? o = s.length : o = n;
|
|
438
|
+
} else {
|
|
439
|
+
const n = ["splice", [0, E], [o, t]];
|
|
440
|
+
c.value = n, o = t;
|
|
441
|
+
}
|
|
442
|
+
}, N = () => {
|
|
443
|
+
const t = Array.from(r.value.children);
|
|
444
|
+
M = (L.value === "left" ? t.slice(0, E) : t.slice(H.value.length - E, H.value.length)).map((v) => v.offsetWidth), X = M.reduce((v, l) => v + l, 0);
|
|
445
|
+
}, $ = (t, n) => {
|
|
446
|
+
if (Y(), !I)
|
|
447
|
+
return;
|
|
448
|
+
const v = () => {
|
|
449
|
+
const l = M[0];
|
|
450
|
+
let a = !1;
|
|
451
|
+
B >= l && (a = !0), a && (M.shift(), B = 0, z += 1), z === f && (R += 1, S("count", R), z = 0), e.singleLine && a ? (k = !0, setTimeout(() => {
|
|
452
|
+
k = !1, t || $(!1, e.step);
|
|
453
|
+
}, e.singleWaitTime)) : t || $(!1, e.step);
|
|
454
|
+
};
|
|
455
|
+
(y.value && !k || t) && (W = requestAnimationFrame(() => {
|
|
456
|
+
w += n, B += n, e ? u.value += n : u.value -= n, w > X ? (S("offset", E, s), te(), g(() => {
|
|
457
|
+
u.value = L.value === "left" ? 0 : P() - m, w = 0, N(), v();
|
|
458
|
+
})) : v();
|
|
459
|
+
}));
|
|
460
|
+
}, D = () => {
|
|
461
|
+
F.value = !0;
|
|
462
|
+
}, j = () => {
|
|
463
|
+
F.value = !1, e.hover && $(!1, e.step);
|
|
464
|
+
}, O = Ie(30, (t) => {
|
|
465
|
+
$(!0, 10);
|
|
466
|
+
}), Z = (t) => {
|
|
467
|
+
e.hover && e.wheel && (O(t), t.preventDefault(), t.stopPropagation());
|
|
468
|
+
}, H = ae(() => {
|
|
469
|
+
let t = [];
|
|
470
|
+
return c.value.length === 0 ? t = s.slice(0, i.value) : c.value[0] === "splice" ? (t = L.value === "left" ? H.value : H.value.reverse(), t.splice(...c.value[1]), c.value.slice(2).forEach((n) => {
|
|
471
|
+
t.push(...s.slice(...n));
|
|
472
|
+
})) : c.value.slice(1).forEach((n) => {
|
|
473
|
+
t.push(...s.slice(...n));
|
|
474
|
+
}), L.value !== "left" && t.reverse(), $e(t);
|
|
475
|
+
}), U = () => {
|
|
476
|
+
if (o = i.value + E, o >= s.length) {
|
|
477
|
+
const t = o - s.length, n = ["slice", [0, o], [0, t]];
|
|
478
|
+
return t > s.length ? o = s.length : o = t, n;
|
|
479
|
+
} else
|
|
480
|
+
return ["slice", [0, o]];
|
|
481
|
+
}, P = () => Array.from(r.value.children).map((t) => t.offsetWidth).reduce((t, n) => t + n, 0), T = (t) => {
|
|
482
|
+
e.visibleCount === void 0 ? (x.value = re([e.list[0]]), g(() => {
|
|
483
|
+
i.value = Math.ceil(m / d.value.offsetWidth) + 2, x.value = s.slice(0, i.value), g(() => {
|
|
484
|
+
t();
|
|
485
|
+
});
|
|
486
|
+
})) : (x.value = s.slice(0, i.value), g(() => {
|
|
487
|
+
t();
|
|
488
|
+
}));
|
|
489
|
+
};
|
|
490
|
+
Ve(() => {
|
|
491
|
+
r.value && (r.value.parentElement.addEventListener("mouseenter", D), r.value.parentElement.addEventListener("mouseleave", j), r.value.parentElement.addEventListener("wheel", Z), m = r.value.parentElement.offsetWidth, e.list.length > 0 && T(() => {
|
|
492
|
+
d.value.offsetWidth > m ? (E = _(), c.value = U(), g(() => {
|
|
493
|
+
u.value = L.value === "left" ? 0 : P() - m, N(), I = !0, setTimeout(() => {
|
|
494
|
+
$(!1, e.step);
|
|
495
|
+
}, e.delay);
|
|
496
|
+
})) : A(), x.value = [];
|
|
497
|
+
})), f = s.length;
|
|
498
|
+
});
|
|
499
|
+
const A = () => {
|
|
500
|
+
z = 0, R = 0, I = !1, E = 0, c.value = [], g(() => {
|
|
501
|
+
u.value = L.value === "left" ? 0 : P() - m, w = 0, B = 0;
|
|
502
|
+
});
|
|
503
|
+
}, _ = () => {
|
|
504
|
+
let t = s.length - i.value;
|
|
505
|
+
return t = Math.max(1, t), t = Math.min(5, t), t;
|
|
506
|
+
};
|
|
507
|
+
return C({ add: (t, n, v) => {
|
|
508
|
+
if (n && n.length > 0) {
|
|
509
|
+
t > s.length && (t = s.length), t < 0 && (t = 0);
|
|
510
|
+
const l = [];
|
|
511
|
+
n.length === 1 && H.value.forEach((h, V) => {
|
|
512
|
+
h.index === t && l.push(V);
|
|
513
|
+
});
|
|
514
|
+
const a = [];
|
|
515
|
+
n.forEach((h) => {
|
|
516
|
+
a.push({
|
|
517
|
+
id: ee(),
|
|
518
|
+
data: h
|
|
519
|
+
});
|
|
520
|
+
}), s.splice(t, 0, ...a), s.forEach((h, V) => {
|
|
521
|
+
h.index = V;
|
|
522
|
+
});
|
|
523
|
+
const p = _();
|
|
524
|
+
if (I)
|
|
525
|
+
t < o && (o += 1, o > s.length && (o = 0)), n.length === 1 && l.forEach((h) => {
|
|
526
|
+
H.value[h] = a[0];
|
|
527
|
+
}), p !== E && (E = p);
|
|
528
|
+
else {
|
|
529
|
+
const h = () => {
|
|
530
|
+
d.value.offsetWidth > m ? (E = p, c.value = U(), g(() => {
|
|
531
|
+
u.value = L.value === "left" ? 0 : P() - m, w = 0, B = 0, N(), I = !0, $(!1, e.step);
|
|
532
|
+
})) : (e.visibleCount === void 0 && (i.value = 0), A()), x.value = [];
|
|
533
|
+
};
|
|
534
|
+
i.value === 0 && e.visibleCount === void 0 ? T(() => {
|
|
535
|
+
h();
|
|
536
|
+
}) : (x.value = s.slice(0, i.value), g(() => {
|
|
537
|
+
h();
|
|
538
|
+
}));
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
v && typeof v == "function" && v(s), f = s.length;
|
|
542
|
+
}, remove: (t, n = 1, v) => {
|
|
543
|
+
t >= 0 && t < s.length && (s.splice(t, n), I ? (x.value = s.slice(0, i.value), g(() => {
|
|
544
|
+
if (d.value.offsetWidth > m) {
|
|
545
|
+
const a = _();
|
|
546
|
+
a !== E && (E = a), c.value = U();
|
|
547
|
+
} else
|
|
548
|
+
A();
|
|
549
|
+
x.value = [];
|
|
550
|
+
})) : A()), v && typeof v == "function" && v(s), f = s.length;
|
|
551
|
+
}, update: (t, n, v) => {
|
|
552
|
+
if (t >= 0 && t < s.length) {
|
|
553
|
+
const l = [];
|
|
554
|
+
H.value.forEach((p, h) => {
|
|
555
|
+
p.index === t && l.push(h);
|
|
556
|
+
});
|
|
557
|
+
const a = {
|
|
558
|
+
id: ee(),
|
|
559
|
+
index: t,
|
|
560
|
+
data: n
|
|
561
|
+
};
|
|
562
|
+
s[t] = a, l.length > 0 && l.forEach((p) => {
|
|
563
|
+
H[p] = a;
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
v && typeof v == "function" && v(s);
|
|
567
|
+
}, reset: () => {
|
|
568
|
+
g(() => {
|
|
569
|
+
x.value = s.slice(0, i.value), g(() => {
|
|
570
|
+
d.value.offsetWidth > m ? c.value[0] === "splice" ? (te(), g(() => {
|
|
571
|
+
N();
|
|
572
|
+
})) : (c.value = U(), g(() => {
|
|
573
|
+
N();
|
|
574
|
+
})) : A();
|
|
575
|
+
});
|
|
576
|
+
});
|
|
577
|
+
} }), He(() => e.modelValue, (t) => {
|
|
578
|
+
t && $(!1, e.step);
|
|
579
|
+
}), Le(() => {
|
|
580
|
+
cancelAnimationFrame(W), r.value && (r.value.parentElement.removeEventListener("mouseenter", D), r.value.parentElement.removeEventListener("mouseleave", j), r.value.parentElement.removeEventListener("wheel", Z));
|
|
581
|
+
}), {
|
|
582
|
+
visibleItems: H,
|
|
583
|
+
offset: u,
|
|
584
|
+
testList: x,
|
|
585
|
+
realWrapperRef: r,
|
|
586
|
+
realWrapperHiddenRef: d
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
});
|
|
590
|
+
function Ue(e, S, C, r, d, c) {
|
|
591
|
+
return J(), G(
|
|
592
|
+
K,
|
|
593
|
+
null,
|
|
594
|
+
[
|
|
595
|
+
ie(
|
|
596
|
+
"div",
|
|
597
|
+
de({
|
|
598
|
+
class: "vue3-seamless-horizontal-wrapper",
|
|
599
|
+
ref: "realWrapperRef",
|
|
600
|
+
style: { transition: `transform ${e.ease}`, transform: `translateX(-${e.offset}px)` }
|
|
601
|
+
}, e.$attrs),
|
|
602
|
+
[
|
|
603
|
+
(J(!0), G(
|
|
604
|
+
K,
|
|
605
|
+
null,
|
|
606
|
+
ue(e.visibleItems, (u) => oe(e.$slots, "default", {
|
|
607
|
+
key: u.id,
|
|
608
|
+
data: u.data,
|
|
609
|
+
index: u.index,
|
|
610
|
+
style: "color: brown;"
|
|
611
|
+
})),
|
|
612
|
+
128
|
|
613
|
+
/* KEYED_FRAGMENT */
|
|
614
|
+
))
|
|
615
|
+
],
|
|
616
|
+
16
|
|
617
|
+
/* FULL_PROPS */
|
|
618
|
+
),
|
|
619
|
+
ie(
|
|
620
|
+
"div",
|
|
621
|
+
de({
|
|
622
|
+
style: { position: "absolute !important", top: "-999999px !important" },
|
|
623
|
+
ref: "realWrapperHiddenRef"
|
|
624
|
+
}, e.$attrs),
|
|
625
|
+
[
|
|
626
|
+
(J(!0), G(
|
|
627
|
+
K,
|
|
628
|
+
null,
|
|
629
|
+
ue(e.testList, (u) => oe(e.$slots, "default", {
|
|
630
|
+
key: u.id,
|
|
631
|
+
data: u.data,
|
|
632
|
+
index: u.index
|
|
633
|
+
})),
|
|
634
|
+
128
|
|
635
|
+
/* KEYED_FRAGMENT */
|
|
636
|
+
))
|
|
637
|
+
],
|
|
638
|
+
16
|
|
639
|
+
/* FULL_PROPS */
|
|
640
|
+
)
|
|
641
|
+
],
|
|
642
|
+
64
|
|
643
|
+
/* STABLE_FRAGMENT */
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
var Xe = `
|
|
647
|
+
.vue3-seamless-horizontal-wrapper[data-v-530d6df5] {
|
|
648
|
+
height: 100%;
|
|
649
|
+
}
|
|
650
|
+
`;
|
|
651
|
+
Ae(Xe);
|
|
652
|
+
Fe.render = Ue;
|
|
653
|
+
Fe.__scopeId = "data-v-530d6df5";
|
|
654
|
+
Fe.__file = "packages/HorizontalScroll.vue";
|
|
655
|
+
var ce = We({
|
|
656
|
+
name: "Vue3SeamlessScroll",
|
|
657
|
+
emits: ["offset", "count"],
|
|
658
|
+
inheritAttrs: !1,
|
|
659
|
+
props: {
|
|
660
|
+
// 是否开启自动滚动
|
|
661
|
+
modelValue: {
|
|
662
|
+
type: Boolean,
|
|
663
|
+
default: !0
|
|
664
|
+
},
|
|
665
|
+
list: {
|
|
666
|
+
type: Array,
|
|
667
|
+
required: !0
|
|
668
|
+
},
|
|
669
|
+
// 是否开启鼠标悬停
|
|
670
|
+
hover: {
|
|
671
|
+
type: Boolean,
|
|
672
|
+
default: !1
|
|
673
|
+
},
|
|
674
|
+
// 单步停止等待时间 (默认值 1000ms)
|
|
675
|
+
singleWaitTime: {
|
|
676
|
+
type: Number,
|
|
677
|
+
default: 1e3
|
|
678
|
+
},
|
|
679
|
+
// 开启鼠标悬停时支持滚轮滚动
|
|
680
|
+
wheel: {
|
|
681
|
+
type: Boolean,
|
|
682
|
+
default: !1
|
|
683
|
+
},
|
|
684
|
+
// 启用单行滚动
|
|
685
|
+
singleLine: {
|
|
686
|
+
type: Boolean,
|
|
687
|
+
default: !1
|
|
688
|
+
},
|
|
689
|
+
step: {
|
|
690
|
+
type: Number,
|
|
691
|
+
default: 0.5
|
|
692
|
+
},
|
|
693
|
+
visibleCount: {
|
|
694
|
+
type: Number
|
|
695
|
+
},
|
|
696
|
+
ease: {
|
|
697
|
+
type: String,
|
|
698
|
+
default: "cubic-bezier(0.03, 0.76, 1, 0.16)"
|
|
699
|
+
},
|
|
700
|
+
// up,down,left,right
|
|
701
|
+
direction: {
|
|
702
|
+
type: String,
|
|
703
|
+
default: "up"
|
|
704
|
+
},
|
|
705
|
+
delay: {
|
|
706
|
+
type: Number,
|
|
707
|
+
default: 0
|
|
708
|
+
}
|
|
709
|
+
},
|
|
710
|
+
setup(e, { expose: S, emit: C }) {
|
|
711
|
+
const r = b(null), d = b(null), c = b(null), u = b([]), F = b(0), L = b(!1), y = b(e.direction), x = ae(() => e.hover ? !L.value && e.modelValue : e.modelValue), i = b([]), s = b(e.visibleCount === void 0 ? 0 : e.visibleCount), f = re(e.list);
|
|
712
|
+
let z = 0, R = 0, M = 0, X = [], E = 0, o = 0, m = -1, W = 0, k = null, B = !1, w = 0, I = 0, Y = !1;
|
|
713
|
+
const te = ae(() => y.value === "up" || y.value === "down" ? `translateY(-${F.value}px)` : `translateX(-${F.value}px)`), N = () => {
|
|
714
|
+
cancelAnimationFrame(k), k = null;
|
|
715
|
+
}, $ = () => {
|
|
716
|
+
const l = m + o;
|
|
717
|
+
if (l >= f.length) {
|
|
718
|
+
const a = l - f.length, p = [
|
|
719
|
+
"splice",
|
|
720
|
+
[0, o],
|
|
721
|
+
[m],
|
|
722
|
+
[0, a]
|
|
723
|
+
];
|
|
724
|
+
u.value = p, a > f.length ? m = f.length : m = a;
|
|
725
|
+
} else {
|
|
726
|
+
const a = ["splice", [0, o], [m, l]];
|
|
727
|
+
u.value = a, m = l;
|
|
728
|
+
}
|
|
729
|
+
}, D = () => {
|
|
730
|
+
const l = Array.from(d.value.children);
|
|
731
|
+
X = (y.value === "up" || y.value === "left" ? l.slice(0, o) : l.slice(T.value.length - o, T.value.length)).map((p) => y.value === "left" || y.value === "right" ? p.offsetWidth : p.offsetHeight), E = X.reduce((p, h) => p + h, 0);
|
|
732
|
+
}, j = () => {
|
|
733
|
+
y.value === "up" || y.value === "left" ? F.value = 0 : F.value = _() - W;
|
|
734
|
+
}, O = (l, a) => {
|
|
735
|
+
if (N(), !Y)
|
|
736
|
+
return;
|
|
737
|
+
const p = () => {
|
|
738
|
+
const h = X[0];
|
|
739
|
+
let V = !1;
|
|
740
|
+
w >= h && (V = !0), V && (X.shift(), w = 0, R += 1), R === z && (M += 1, C("count", M), R = 0), e.singleLine && V ? (B = !0, setTimeout(() => {
|
|
741
|
+
B = !1, l || O(!1, e.step);
|
|
742
|
+
}, e.singleWaitTime)) : l || O(!1, e.step);
|
|
743
|
+
};
|
|
744
|
+
(x.value && !B || l) && (k = requestAnimationFrame(() => {
|
|
745
|
+
I += a, w += a, y.value === "up" || y.value === "left" ? F.value += a : F.value -= a, I > E ? (C("offset", o, f), $(), g(() => {
|
|
746
|
+
j(), I = 0, D(), p();
|
|
747
|
+
})) : p();
|
|
748
|
+
}));
|
|
749
|
+
}, Z = () => {
|
|
750
|
+
L.value = !0;
|
|
751
|
+
}, H = () => {
|
|
752
|
+
L.value = !1, e.hover && O(!1, e.step);
|
|
753
|
+
}, U = Ie(30, (l) => {
|
|
754
|
+
O(!0, 10);
|
|
755
|
+
}), P = (l) => {
|
|
756
|
+
e.hover && e.wheel && (U(l), l.preventDefault(), l.stopPropagation());
|
|
757
|
+
}, T = ae(() => {
|
|
758
|
+
let l = [];
|
|
759
|
+
return u.value.length === 0 ? l = f.slice(0, s.value) : u.value[0] === "splice" ? (l = y.value === "up" || y.value === "left" ? T.value : T.value.reverse(), l.splice(...u.value[1]), u.value.slice(2).forEach((a) => {
|
|
760
|
+
l.push(...f.slice(...a));
|
|
761
|
+
})) : u.value.slice(1).forEach((a) => {
|
|
762
|
+
l.push(...f.slice(...a));
|
|
763
|
+
}), y.value === "up" || y.value === "left" || l.reverse(), $e(l);
|
|
764
|
+
}), A = () => {
|
|
765
|
+
if (m = s.value + o, m >= f.length) {
|
|
766
|
+
const l = m - f.length, a = ["slice", [0, m], [0, l]];
|
|
767
|
+
return l > f.length ? m = f.length : m = l, a;
|
|
768
|
+
} else
|
|
769
|
+
return ["slice", [0, m]];
|
|
770
|
+
}, _ = () => Array.from(d.value.children).map((a) => y.value === "left" || y.value === "right" ? a.offsetWidth : a.offsetHeight).reduce((a, p) => a + p, 0), ve = (l) => {
|
|
771
|
+
e.visibleCount === void 0 ? (i.value = re([e.list[0]]), g(() => {
|
|
772
|
+
y.value === "left" || y.value === "right" ? s.value = Math.ceil(W / c.value.offsetWidth) + 2 : s.value = Math.ceil(W / c.value.offsetHeight) + 2, i.value = f.slice(0, s.value), g(() => {
|
|
773
|
+
l();
|
|
774
|
+
});
|
|
775
|
+
})) : (i.value = f.slice(0, s.value), g(() => {
|
|
776
|
+
l();
|
|
777
|
+
}));
|
|
778
|
+
};
|
|
779
|
+
Ve(() => {
|
|
780
|
+
d.value && (d.value.parentElement.addEventListener("mouseenter", Z), d.value.parentElement.addEventListener("mouseleave", H), d.value.parentElement.addEventListener("wheel", P), W = d.value.parentElement.offsetHeight, (y.value === "left" || y.value === "right") && (W = d.value.parentElement.offsetWidth), ve(() => {
|
|
781
|
+
let l = c.value.offsetHeight > W;
|
|
782
|
+
(y.value === "left" || y.value === "right") && (l = c.value.offsetWidth > W), l ? (o = fe(), u.value = A(), g(() => {
|
|
783
|
+
j(), D(), Y = !0, setTimeout(() => {
|
|
784
|
+
O(!1, e.step);
|
|
785
|
+
}, e.delay);
|
|
786
|
+
})) : le(), i.value = [];
|
|
787
|
+
})), z = f.length;
|
|
788
|
+
});
|
|
789
|
+
const le = () => {
|
|
790
|
+
R = 0, M = 0, Y = !1, o = 0, u.value = [], g(() => {
|
|
791
|
+
j(), I = 0, w = 0;
|
|
792
|
+
});
|
|
793
|
+
}, fe = () => {
|
|
794
|
+
let l = f.length - s.value;
|
|
795
|
+
return l = Math.max(1, l), l = Math.min(5, l), l;
|
|
796
|
+
};
|
|
797
|
+
return S({ add: (l, a, p) => {
|
|
798
|
+
if (a && a.length > 0) {
|
|
799
|
+
l > f.length && (l = f.length), l < 0 && (l = 0);
|
|
800
|
+
const h = [];
|
|
801
|
+
a.length === 1 && T.value.forEach((q, se) => {
|
|
802
|
+
q.index === l && h.push(se);
|
|
803
|
+
});
|
|
804
|
+
const V = [];
|
|
805
|
+
a.forEach((q) => {
|
|
806
|
+
V.push({
|
|
807
|
+
id: ee(),
|
|
808
|
+
data: q
|
|
809
|
+
});
|
|
810
|
+
}), f.splice(l, 0, ...V), f.forEach((q, se) => {
|
|
811
|
+
q.index = se;
|
|
812
|
+
});
|
|
813
|
+
const ne = fe();
|
|
814
|
+
if (Y)
|
|
815
|
+
l < m && (m += 1, m > f.length && (m = 0)), a.length === 1 && h.length > 0 && h.forEach((q) => {
|
|
816
|
+
T[q] = V[0];
|
|
817
|
+
}), ne !== o && (o = ne);
|
|
818
|
+
else {
|
|
819
|
+
const q = () => {
|
|
820
|
+
let se = c.value.offsetHeight > W;
|
|
821
|
+
(y.value === "left" || y.value === "right") && (se = c.value.offsetWidth > W), se ? (o = ne, u.value = A(), g(() => {
|
|
822
|
+
j(), I = 0, w = 0, D(), Y = !0, O(!1, e.step);
|
|
823
|
+
})) : (e.visibleCount === void 0 && (s.value = 0), le()), i.value = [];
|
|
824
|
+
};
|
|
825
|
+
s.value === 0 && e.visibleCount === void 0 ? ve(() => {
|
|
826
|
+
q();
|
|
827
|
+
}) : (i.value = f.slice(0, s.value), g(() => {
|
|
828
|
+
q();
|
|
829
|
+
}));
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
p && typeof p == "function" && p(f), z = f.length;
|
|
833
|
+
}, remove: (l, a = 1, p) => {
|
|
834
|
+
l >= 0 && l < f.length && (f.splice(l, a), Y ? (i.value = f.slice(0, s.value), g(() => {
|
|
835
|
+
let h = c.value.offsetHeight > W;
|
|
836
|
+
if ((y.value === "left" || y.value === "right") && (h = c.value.offsetWidth > W), h) {
|
|
837
|
+
const V = fe();
|
|
838
|
+
V !== o && (o = V), u.value = A();
|
|
839
|
+
} else
|
|
840
|
+
le();
|
|
841
|
+
i.value = [];
|
|
842
|
+
})) : le()), p && typeof p == "function" && p(f), z = f.length;
|
|
843
|
+
}, update: (l, a, p) => {
|
|
844
|
+
if (l >= 0 && l < f.length) {
|
|
845
|
+
const h = [];
|
|
846
|
+
T.value.forEach((ne, q) => {
|
|
847
|
+
ne.index === l && h.push(q);
|
|
848
|
+
});
|
|
849
|
+
const V = {
|
|
850
|
+
id: ee(),
|
|
851
|
+
index: l,
|
|
852
|
+
data: a
|
|
853
|
+
};
|
|
854
|
+
f[l] = V, h.length > 0 && h.forEach((ne) => {
|
|
855
|
+
T[ne] = V;
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
p && typeof p == "function" && p(f);
|
|
859
|
+
}, reset: () => {
|
|
860
|
+
g(() => {
|
|
861
|
+
i.value = f.slice(0, s.value), g(() => {
|
|
862
|
+
let l = c.value.offsetHeight > W;
|
|
863
|
+
(y.value === "left" || y.value === "right") && (l = c.value.offsetWidth > W), l ? u.value[0] === "splice" ? ($(), g(() => {
|
|
864
|
+
D();
|
|
865
|
+
})) : (u.value = A(), g(() => {
|
|
866
|
+
D();
|
|
867
|
+
})) : le();
|
|
868
|
+
});
|
|
869
|
+
});
|
|
870
|
+
} }), He(() => e.modelValue, (l) => {
|
|
871
|
+
l && O(!1, e.step);
|
|
872
|
+
}), Le(() => {
|
|
873
|
+
cancelAnimationFrame(k), d.value && (d.value.parentElement.removeEventListener("mouseenter", Z), d.value.parentElement.removeEventListener("mouseleave", H), d.value.parentElement.removeEventListener("wheel", P));
|
|
874
|
+
}), {
|
|
875
|
+
realBoxRef: r,
|
|
876
|
+
realWrapperRef: d,
|
|
877
|
+
visibleItems: T,
|
|
878
|
+
offset: F,
|
|
879
|
+
testList: i,
|
|
880
|
+
realWrapperHiddenRef: c,
|
|
881
|
+
transform: te
|
|
882
|
+
};
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
function Ye(e, S, C, r, d, c) {
|
|
886
|
+
return J(), G(
|
|
887
|
+
K,
|
|
888
|
+
null,
|
|
889
|
+
[
|
|
890
|
+
ie(
|
|
891
|
+
"div",
|
|
892
|
+
de({
|
|
893
|
+
class: "vue3-seamless-wrapper",
|
|
894
|
+
ref: "realWrapperRef",
|
|
895
|
+
style: { transition: `transform ${e.ease}`, transform: e.transform }
|
|
896
|
+
}, e.$attrs),
|
|
897
|
+
[
|
|
898
|
+
(J(!0), G(
|
|
899
|
+
K,
|
|
900
|
+
null,
|
|
901
|
+
ue(e.visibleItems, (u) => oe(e.$slots, "default", {
|
|
902
|
+
key: u.id,
|
|
903
|
+
data: u.data,
|
|
904
|
+
index: u.index
|
|
905
|
+
})),
|
|
906
|
+
128
|
|
907
|
+
/* KEYED_FRAGMENT */
|
|
908
|
+
))
|
|
909
|
+
],
|
|
910
|
+
16
|
|
911
|
+
/* FULL_PROPS */
|
|
912
|
+
),
|
|
913
|
+
ie(
|
|
914
|
+
"div",
|
|
915
|
+
de({
|
|
916
|
+
style: { position: "absolute !important", left: "-999999px !important" },
|
|
917
|
+
ref: "realWrapperHiddenRef"
|
|
918
|
+
}, e.$attrs),
|
|
919
|
+
[
|
|
920
|
+
(J(!0), G(
|
|
921
|
+
K,
|
|
922
|
+
null,
|
|
923
|
+
ue(e.testList, (u) => oe(e.$slots, "default", {
|
|
924
|
+
key: u.id,
|
|
925
|
+
data: u.data,
|
|
926
|
+
index: u.index
|
|
927
|
+
})),
|
|
928
|
+
128
|
|
929
|
+
/* KEYED_FRAGMENT */
|
|
930
|
+
))
|
|
931
|
+
],
|
|
932
|
+
16
|
|
933
|
+
/* FULL_PROPS */
|
|
934
|
+
)
|
|
935
|
+
],
|
|
936
|
+
64
|
|
937
|
+
/* STABLE_FRAGMENT */
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
var je = `
|
|
941
|
+
.vue3-seamless-wrapper[data-v-b156a416] {\r
|
|
942
|
+
width: 100%;\r
|
|
943
|
+
height: 100%;
|
|
944
|
+
}\r
|
|
945
|
+
`;
|
|
946
|
+
Ae(je);
|
|
947
|
+
ce.render = Ye;
|
|
948
|
+
ce.__scopeId = "data-v-b156a416";
|
|
949
|
+
ce.__file = "packages/Vue3SeamlessScroll.vue";
|
|
950
|
+
const _e = function(e, S = {}) {
|
|
951
|
+
e.component(S.name || ce.name, ce);
|
|
952
|
+
};
|
|
953
|
+
function Ge(e) {
|
|
954
|
+
e.use(_e);
|
|
955
|
+
}
|
|
956
|
+
const xe = Me(), Je = [he, me, pe, ge, ye, Ee, Se, Ce, be], ot = (e) => {
|
|
957
|
+
Je.forEach((S) => {
|
|
958
|
+
e.use(S);
|
|
959
|
+
}), e.use(Te), e.use(Ge, { name: "vue3-seamless-scroll" }), e.config.globalProperties.$router = Te;
|
|
960
|
+
}, Ke = (e) => {
|
|
961
|
+
switch (e) {
|
|
52
962
|
case "browser":
|
|
53
|
-
return
|
|
963
|
+
return ke;
|
|
54
964
|
case "client":
|
|
55
|
-
return
|
|
965
|
+
return Re;
|
|
56
966
|
case "three":
|
|
57
|
-
return
|
|
967
|
+
return Ne;
|
|
58
968
|
}
|
|
59
|
-
},
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
969
|
+
}, Qe = (e) => {
|
|
970
|
+
const S = document.documentElement;
|
|
971
|
+
e == null || e.forEach((C) => {
|
|
972
|
+
S.style.setProperty(C.name, C.value);
|
|
63
973
|
});
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
},
|
|
974
|
+
}, Ze = (e) => {
|
|
975
|
+
xe.setPlatform(e);
|
|
976
|
+
const S = Ke(e);
|
|
977
|
+
Qe(S);
|
|
978
|
+
}, rt = { getPlatform: xe.getPlatform, setPlatform: xe.setPlatform, initPlatform: Ze };
|
|
69
979
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
980
|
+
vt as SvgIcon,
|
|
981
|
+
ot as default,
|
|
982
|
+
rt as platformApi,
|
|
983
|
+
Te as router
|
|
74
984
|
};
|