1 |
- import{_ as ae,d as oe,w as v,p as B,ag as r,u as e,b0 as De,b1 as Ae,o as A,c as T,N as x,B as ie,ar as W,a as le,b as d,y as Te,a1 as xe,aK as Be,Z as Me,l as ke,C as Oe,F as $e,D as je,L as z,Q as He,R as Ie}from"./index.fd765376.js";const Re=()=>{window.cancelAnimationFrame=(()=>window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(o){return window.clearTimeout(o)})(),window.requestAnimationFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(o){return window.setTimeout(o,1e3/60)}}()},qe=(o,f)=>{if(o===f)return!0;if(o.length!==f.length)return!1;for(let s=0;s<o.length;++s)if(o[s]!==f[s])return!1;return!0};function se(){Array.isArray||(Array.isArray=function(S){return Object.prototype.toString.call(S)==="[object Array]"});let o,f,s,c,g,C,t=1,n=arguments[0]||{},m=!1,b=arguments.length;if(typeof n=="boolean"&&(m=n,n=arguments[1]||{},t++),typeof n!="object"&&typeof n!="function"&&(n={}),t===b)return n;for(;t<b;t++)if((f=arguments[t])!=null)for(o in f)s=n[o],c=f[o],g=Array.isArray(c),m&&c&&(typeof c=="object"||g)?(g?(g=!1,C=s&&Array.isArray(s)?s:[]):C=s&&typeof s=="object"?s:{},n[o]=se(m,C,c)):c!==void 0&&(n[o]=c);return n}var Pe=Object.freeze(Object.defineProperty({__proto__:null,animationFrame:Re,arrayEqual:qe,copyObj:se},Symbol.toStringTag,{value:"Module"}));const Le=["innerHTML"],We={name:"ReSeamlessScroll"},ze=oe({...We,props:{data:{type:Array},classOption:{type:Object}},emits:["scrollEnd"],setup(o,{expose:f,emit:s}){const c=o,{animationFrame:g,copyObj:C}=Pe;g();let t=v(0),n=v(0),m=v(0),b=v(0),S=v(0),F=v(0),M=v(0),k=v(""),_=null,N=null,O=null,U=null,Y=null,$=!1,j="ease-in",{classOption:p}=c;p.key===void 0&&(p.key=0);const V=B(`wrap${p.key}`,null),X=B(`slotList${p.key}`,null),K=B(`realBox${p.key}`,null);let Q=r(()=>e(t)<0),Z=r(()=>Math.abs(e(t))<e(F)-e(S)),re=r(()=>({step:1,limitMoveNum:5,hoverStop:!0,direction:"top",openTouch:!0,singleHeight:0,singleWidth:0,waitTime:1e3,switchOffset:30,autoPlay:!0,navigation:!1,switchSingleStep:134,switchDelay:400,switchDisabledClass:"disabled",isSingleRemUnit:!1})),l=r(()=>C({},e(re),p));const ue=r(()=>e(Q)?"":e(l).switchDisabledClass);let ce=r(()=>e(Z)?"":e(l).switchDisabledClass),fe=r(()=>({position:"absolute",margin:`${e(b)/2}px 0 0 -${e(l).switchOffset}px`,transform:"translate(-100%,-50%)"})),de=r(()=>({position:"absolute",margin:`${e(b)/2}px 0 0 ${e(S)+e(l).switchOffset}px`,transform:"translateY(-50%)"})),H=r(()=>e(l).direction!=="bottom"&&e(l).direction!=="top"),G=r(()=>e(H)?{float:"left",overflow:"hidden"}:{overflow:"hidden"}),me=r(()=>({transform:`translate(${e(t)}px,${e(n)}px)`,transition:`all ${j} ${e(m)}ms`,overflow:"hidden"})),I=r(()=>e(l).navigation),R=r(()=>e(I)?!1:e(l).autoPlay),J=r(()=>c.data.length>=e(l).limitMoveNum),ee=r(()=>e(l).hoverStop&&e(R)&&e(J)),q=r(()=>e(l).openTouch),te=r(()=>e(l).isSingleRemUnit?parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1),P=r(()=>e(l).singleWidth*e(te)),L=r(()=>e(l).singleHeight*e(te)),w=r(()=>{let i,a=e(l).step;if(e(H)?i=e(P):i=e(L),i>0&&i%a>0)throw"\u5982\u679C\u8BBE\u7F6E\u4E86\u5355\u6B65\u6EDA\u52A8\uFF0Cstep\u9700\u662F\u5355\u6B65\u5927\u5C0F\u7684\u7EA6\u6570\uFF0C\u5426\u5219\u65E0\u6CD5\u4FDD\u8BC1\u5355\u6B65\u6EDA\u52A8\u7ED3\u675F\u7684\u4F4D\u7F6E\u662F\u5426\u51C6\u786E";return a});function pe(){t.value=0,n.value=0,E(),ne()}function he(){if(!!e(Q)){if(Math.abs(e(t))<e(l).switchSingleStep){t.value=0;return}t.value+=e(l).switchSingleStep}}function ve(){if(!!e(Z)){if(e(F)-e(S)+e(t)<e(l).switchSingleStep){t.value=e(S)-e(F);return}t.value-=e(l).switchSingleStep}}function E(){cancelAnimationFrame(N||"")}function we(i){if(!e(q))return;let a;const u=i.targetTouches[0],{waitTime:h,singleHeight:D,singleWidth:Ee}=e(l);O={x:u.pageX,y:u.pageY},U=e(n),Y=e(t),!!D&&!!Ee?(a&&clearTimeout(a),a=setTimeout(()=>{E()},h+20)):E()}function ye(i){if(!e(q)||i.targetTouches.length>1||i.scale&&i.scale!==1)return;const a=i.targetTouches[0],{direction:u}=e(l);let h={x:a.pageX-O.x,y:a.pageY-O.y};i.preventDefault();const D=Math.abs(h.x)<Math.abs(h.y)?1:0;D===1&&u==="bottom"||D===1&&u==="top"?n.value=U+h.y:(D===0&&u==="left"||D===0&&u==="right")&&(t.value=Y+h.x)}function ge(){if(!e(q))return;let i;const a=e(l).direction;if(m.value=50,a==="top")e(n)>0&&(n.value=0);else if(a==="bottom"){let u=e(M)/2*-1;e(n)<u&&(n.value=u)}else if(a==="left")e(t)>0&&(t.value=0);else if(a==="right"){let u=e(F)*-1;e(t)<u&&(t.value=u)}i&&clearTimeout(i),i=setTimeout(()=>{m.value=0,y()},e(m))}function Se(){e(ee)&&be()}function _e(){e(ee)&&Ce()}function y(){$||(N=requestAnimationFrame(function(){const i=e(M)/2,a=e(F)/2;let{direction:u,waitTime:h}=e(l);u==="top"?(Math.abs(e(n))>=i&&(s("scrollEnd"),n.value=0),n.value-=w.value):u==="bottom"?(e(n)>=0&&(s("scrollEnd"),n.value=i*-1),n.value+=w.value):u==="left"?(Math.abs(e(t))>=a&&(s("scrollEnd"),t.value=0),t.value-=w.value):u==="right"&&(e(t)>=0&&(s("scrollEnd"),t.value=a*-1),t.value+=w.value),_&&clearTimeout(_),e(L)?Math.abs(e(n))%e(L)<e(w)?_=setTimeout(()=>{y()},h):y():e(P)&&Math.abs(e(t))%e(P)<e(w)?_=setTimeout(()=>{y()},h):y()}))}function ne(){Te(()=>{const{switchDelay:i}=e(l);if(k.value="",e(H)){b.value=e(V).offsetHeight,S.value=e(V).offsetWidth;let a=e(X).offsetWidth;e(R)&&(a=a*2+1),e(K).style.width=a+"px",F.value=a}if(e(R))j="ease-in",m.value=0;else{j="linear",m.value=i;return}e(J)?(k.value=e(X).innerHTML,setTimeout(()=>{M.value=e(K).offsetHeight,y()},0)):(E(),n.value=t.value=0)})}function Ce(){$=!1,y()}function be(){$=!0,_&&clearTimeout(_),E()}function Fe(i){i.preventDefault(),!(e(l).direction==="left"||e(l).direction==="right")&&xe(()=>{i.deltaY>0?n.value-=w.value:n.value+=w.value},50)()}return De(()=>{ne()}),Ae(()=>{E(),clearTimeout(_)}),f({reset:pe}),(i,a)=>(A(),T("div",{ref:"wrap"+e(p).key},[e(I)?(A(),T("div",{key:0,style:x(e(fe)),class:ie(e(ue)),onClick:he},[W(i.$slots,"left-switch")],6)):le("v-if",!0),e(I)?(A(),T("div",{key:1,style:x(e(de)),class:ie(e(ce)),onClick:ve},[W(i.$slots,"right-switch")],6)):le("v-if",!0),d("div",{ref:"realBox"+e(p).key,style:x(e(me)),onMouseenter:Se,onMouseleave:_e,onTouchstart:we,onTouchmove:ye,onTouchend:ge,onMousewheel:Fe},[d("div",{ref:"slotList"+e(p).key,style:x(e(G))},[W(i.$slots,"default")],4),d("div",{innerHTML:e(k),style:x(e(G))},null,12,Le)],36)],512))}});var Ne=ae(ze,[["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/components/ReSeamlessScroll/src/index.vue"]]);const Ue=Be(Ne);const Ye=o=>(He("data-v-1ac0eab6"),o=o(),Ie(),o),Ve={class:"infinite"},Xe=Ye(()=>d("ul",{class:"top"},[d("li",null,"\u66F4\u65B0\u65E5\u671F"),d("li",null,"\u9879\u76EE\u540D\u79F0"),d("li",null,"Star\u6570\u91CF")],-1)),Ke={class:"item"},Qe=["textContent"],Ze=["textContent"],Ge=["textContent"],Je=oe({__name:"Infinite",setup(o){const f=B("scroll",null);let s=v([{date:"2021-09-01",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1000"},{date:"2021-09-02",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1100"},{date:"2021-09-03",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1200"},{date:"2021-09-04",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1300"},{date:"2021-09-05",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1400"},{date:"2021-09-06",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1500"},{date:"2021-09-07",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1600"},{date:"2021-09-08",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1700"},{date:"2021-09-09",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1800"},{date:"2021-09-10",name:"\u91C7\u9500365\u7ED3\u7B97",star:"1900"}]),c=Me({direction:"top"});return(g,C)=>(A(),T("div",Ve,[Xe,ke(e(Ue),{ref_key:"scroll",ref:f,data:e(s),"class-option":e(c),class:"warp"},{default:Oe(()=>[d("ul",Ke,[(A(!0),T($e,null,je(e(s),(t,n)=>(A(),T("li",{key:n},[d("span",{textContent:z(t.date)},null,8,Qe),d("span",{textContent:z(t.name)},null,8,Ze),d("span",{textContent:z(t.star)},null,8,Ge)]))),128))])]),_:1},8,["data","class-option"])]))}});var tt=ae(Je,[["__scopeId","data-v-1ac0eab6"],["__file","C:/Users/63107/Desktop/projects/accout-vue3-ui/src/views/welcome/components/Infinite.vue"]]);export{tt as default};
|