1 |
- import{_ as ae,d as oe,w as v,p as B,W as r,u as e,ay as Ae,az as De,o as D,c as T,N as x,B as le,a9 as z,a as ie,b as d,y as Te,aA as xe,ar as Be,ad as Me,l as ke,C as Oe,F as $e,D as He,L,Q as je,R as Ie}from"./index.1d5f2f42.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 We=["innerHTML"],ze={name:"ReSeamlessScroll"},Le=oe({...ze,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,Y=null,U=null,$=!1,H="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),Q=B(`realBox${p.key}`,null);let G=r(()=>e(t)<0),J=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})),i=r(()=>C({},e(re),p));const ue=r(()=>e(G)?"":e(i).switchDisabledClass);let ce=r(()=>e(J)?"":e(i).switchDisabledClass),fe=r(()=>({position:"absolute",margin:`${e(b)/2}px 0 0 -${e(i).switchOffset}px`,transform:"translate(-100%,-50%)"})),de=r(()=>({position:"absolute",margin:`${e(b)/2}px 0 0 ${e(S)+e(i).switchOffset}px`,transform:"translateY(-50%)"})),j=r(()=>e(i).direction!=="bottom"&&e(i).direction!=="top"),K=r(()=>e(j)?{float:"left",overflow:"hidden"}:{overflow:"hidden"}),me=r(()=>({transform:`translate(${e(t)}px,${e(n)}px)`,transition:`all ${H} ${e(m)}ms`,overflow:"hidden"})),I=r(()=>e(i).navigation),R=r(()=>e(I)?!1:e(i).autoPlay),Z=r(()=>c.data.length>=e(i).limitMoveNum),ee=r(()=>e(i).hoverStop&&e(R)&&e(Z)),q=r(()=>e(i).openTouch),te=r(()=>e(i).isSingleRemUnit?parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1),P=r(()=>e(i).singleWidth*e(te)),W=r(()=>e(i).singleHeight*e(te)),w=r(()=>{let l,a=e(i).step;if(e(j)?l=e(P):l=e(W),l>0&&l%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(G)){if(Math.abs(e(t))<e(i).switchSingleStep){t.value=0;return}t.value+=e(i).switchSingleStep}}function ve(){if(!!e(J)){if(e(F)-e(S)+e(t)<e(i).switchSingleStep){t.value=e(S)-e(F);return}t.value-=e(i).switchSingleStep}}function E(){cancelAnimationFrame(N||"")}function we(l){if(!e(q))return;let a;const u=l.targetTouches[0],{waitTime:h,singleHeight:A,singleWidth:Ee}=e(i);O={x:u.pageX,y:u.pageY},Y=e(n),U=e(t),!!A&&!!Ee?(a&&clearTimeout(a),a=setTimeout(()=>{E()},h+20)):E()}function ye(l){if(!e(q)||l.targetTouches.length>1||l.scale&&l.scale!==1)return;const a=l.targetTouches[0],{direction:u}=e(i);let h={x:a.pageX-O.x,y:a.pageY-O.y};l.preventDefault();const A=Math.abs(h.x)<Math.abs(h.y)?1:0;A===1&&u==="bottom"||A===1&&u==="top"?n.value=Y+h.y:(A===0&&u==="left"||A===0&&u==="right")&&(t.value=U+h.x)}function ge(){if(!e(q))return;let l;const a=e(i).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)}l&&clearTimeout(l),l=setTimeout(()=>{m.value=0,y()},e(m))}function Se(){e(ee)&&be()}function _e(){e(ee)&&Ce()}function y(){$||(N=requestAnimationFrame(function(){const l=e(M)/2,a=e(F)/2;let{direction:u,waitTime:h}=e(i);u==="top"?(Math.abs(e(n))>=l&&(s("scrollEnd"),n.value=0),n.value-=w.value):u==="bottom"?(e(n)>=0&&(s("scrollEnd"),n.value=l*-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(W)?Math.abs(e(n))%e(W)<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:l}=e(i);if(k.value="",e(j)){b.value=e(V).offsetHeight,S.value=e(V).offsetWidth;let a=e(X).offsetWidth;e(R)&&(a=a*2+1),e(Q).style.width=a+"px",F.value=a}if(e(R))H="ease-in",m.value=0;else{H="linear",m.value=l;return}e(Z)?(k.value=e(X).innerHTML,setTimeout(()=>{M.value=e(Q).offsetHeight,y()},0)):(E(),n.value=t.value=0)})}function Ce(){$=!1,y()}function be(){$=!0,_&&clearTimeout(_),E()}function Fe(l){l.preventDefault(),!(e(i).direction==="left"||e(i).direction==="right")&&xe(()=>{l.deltaY>0?n.value-=w.value:n.value+=w.value},50)()}return Ae(()=>{ne()}),De(()=>{E(),clearTimeout(_)}),f({reset:pe}),(l,a)=>(D(),T("div",{ref:"wrap"+e(p).key},[e(I)?(D(),T("div",{key:0,style:x(e(fe)),class:le(e(ue)),onClick:he},[z(l.$slots,"left-switch")],6)):ie("v-if",!0),e(I)?(D(),T("div",{key:1,style:x(e(de)),class:le(e(ce)),onClick:ve},[z(l.$slots,"right-switch")],6)):ie("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(K))},[z(l.$slots,"default")],4),d("div",{innerHTML:e(k),style:x(e(K))},null,12,We)],36)],512))}});var Ne=ae(Le,[["__file","D:/work/rep-v3/report-v3/src/components/ReSeamlessScroll/src/index.vue"]]);const Ye=Be(Ne);const Ue=o=>(je("data-v-1ac0eab6"),o=o(),Ie(),o),Ve={class:"infinite"},Xe=Ue(()=>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)),Qe={class:"item"},Ge=["textContent"],Je=["textContent"],Ke=["textContent"],Ze=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)=>(D(),T("div",Ve,[Xe,ke(e(Ye),{ref_key:"scroll",ref:f,data:e(s),"class-option":e(c),class:"warp"},{default:Oe(()=>[d("ul",Qe,[(D(!0),T($e,null,He(e(s),(t,n)=>(D(),T("li",{key:n},[d("span",{textContent:L(t.date)},null,8,Ge),d("span",{textContent:L(t.name)},null,8,Je),d("span",{textContent:L(t.star)},null,8,Ke)]))),128))])]),_:1},8,["data","class-option"])]))}});var tt=ae(Ze,[["__scopeId","data-v-1ac0eab6"],["__file","D:/work/rep-v3/report-v3/src/views/welcome/components/Infinite.vue"]]);export{tt as default};
|