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