1 |
- import{d as oe,m as y,t as B,a2 as o,h as e,aC as xe,aD as De,o as E,c as x,I as k,v as le,ad as L,a as ae,e as d,_ as se,p as Te,X as ke,aw as Be,Q as Me,f as Oe,x as $e,F as je,y as He,G 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(D){return Object.prototype.toString.call(D)==="[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 Ie=["innerHTML"],We={name:"ReSeamlessScroll"},ze=oe({...We,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),D=y(0),T=y(0),C=y(0),M=y(0),O=y(""),_=null,U=null,$=null,Y=null,X=null,j=!1,H="ease-in",{classOption:v}=p;v.key===void 0&&(v.key=0);const V=B(`wrap${v.key}`,null),G=B(`slotList${v.key}`,null),Q=B(`realBox${v.key}`,null);let J=o(()=>e(t)<0),K=o(()=>Math.abs(e(t))<e(C)-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(J)?"":e(i).switchDisabledClass);let fe=o(()=>e(K)?"":e(i).switchDisabledClass),me=o(()=>({position:"absolute",margin:`${e(D)/2}px 0 0 -${e(i).switchOffset}px`,transform:"translate(-100%,-50%)"})),de=o(()=>({position:"absolute",margin:`${e(D)/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)),I=o(()=>e(i).openTouch),ne=o(()=>e(i).isSingleRemUnit?parseInt(window.getComputedStyle(document.documentElement,null).fontSize):1),W=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(W):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(J)){if(Math.abs(e(t))<e(i).switchSingleStep){t.value=0;return}t.value+=e(i).switchSingleStep}}function we(){if(!!e(K)){if(e(C)-e(T)+e(t)<e(i).switchSingleStep){t.value=e(T)-e(C);return}t.value-=e(i).switchSingleStep}}function A(){cancelAnimationFrame(U||"")}function ye(n){if(!e(I))return;let l;const s=n.targetTouches[0],{waitTime:w,singleHeight:b,singleWidth:Ee}=e(i);$={x:s.pageX,y:s.pageY},Y=e(a),X=e(t),!!b&&!!Ee?(l&&clearTimeout(l),l=setTimeout(()=>{A()},w+20)):A()}function ge(n){if(!e(I)||n.targetTouches.length>1||n.scale&&n.scale!==1)return;const l=n.targetTouches[0],{direction:s}=e(i);let w={x:l.pageX-$.x,y:l.pageY-$.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=X+w.x)}function Fe(){if(!e(I))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(C)*-1;e(t)<s&&(t.value=s)}n&&clearTimeout(n),n=setTimeout(()=>{h.value=0,F()},e(h))}function Se(){e(te)&&Ae()}function _e(){e(te)&&Ce()}function F(){j||(U=requestAnimationFrame(function(){const n=e(M)/2,l=e(C)/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),_&&clearTimeout(_),e(z)?Math.abs(e(a))%e(z)<e(g)?_=setTimeout(()=>{F()},w):F():e(W)&&Math.abs(e(t))%e(W)<e(g)?_=setTimeout(()=>{F()},w):F()}))}function ie(){Te(()=>{const{switchDelay:n}=e(i);if(O.value="",e(q)){D.value=e(V).offsetHeight,T.value=e(V).offsetWidth;let l=e(G).offsetWidth;e(R)&&(l=l*2+1),e(Q).style.width=l+"px",C.value=l}if(e(R))H="ease-in",h.value=0;else{H="linear",h.value=n;return}e(ee)?(O.value=e(G).innerHTML,setTimeout(()=>{M.value=e(Q).offsetHeight,F()},0)):(A(),a.value=t.value=0)})}function Ce(){j=!1,F()}function Ae(){j=!0,_&&clearTimeout(_),A()}function be(n){n.preventDefault(),!(e(i).direction==="left"||e(i).direction==="right")&&ke(()=>{n.deltaY>0?a.value-=g.value:a.value+=g.value},50)()}return xe(()=>{ie()}),De(()=>{A(),clearTimeout(_)}),f({reset:he}),(n,l)=>(E(),x("div",{ref:"wrap"+e(v).key},[e(P)?(E(),x("div",{key:0,style:k(e(me)),class:le(ce.value),onClick:ve},[L(n.$slots,"left-switch")],6)):ae("v-if",!0),e(P)?(E(),x("div",{key:1,style:k(e(de)),class:le(e(fe)),onClick:we},[L(n.$slots,"right-switch")],6)):ae("v-if",!0),d("div",{ref:"realBox"+e(v).key,style:k(e(pe)),onMouseenter:Se,onMouseleave:_e,onTouchstart:ye,onTouchmove:ge,onTouchend:Fe,onMousewheel:be},[d("div",{ref:"slotList"+e(v).key,style:k(e(Z))},[L(n.$slots,"default")],4),d("div",{innerHTML:e(O),style:k(e(Z))},null,12,Ie)],36)],512))}});var Le=se(ze,[["__file","C:/Users/89793/Desktop/projects/ticket-system/src/components/ReSeamlessScroll/src/index.vue"]]);const Ne=Be(Le);const Ue={class:"infinite"},Ye={class:"item"},Xe=["textContent"],Ve=["textContent"],Ge=["textContent"],Qe=oe({__name:"Infinite",setup(r){const f=B("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(),x("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)),Oe(e(Ne),{ref_key:"scroll",ref:f,data:e(u),"class-option":e(m),class:"warp"},{default:$e(()=>[d("ul",Ye,[(E(!0),x(je,null,He(e(u),(c,t)=>(E(),x("li",{key:t},[d("span",{textContent:N(c.date)},null,8,Xe),d("span",{textContent:N(c.name)},null,8,Ve),d("span",{textContent:N(c.star)},null,8,Ge)]))),128))])]),_:1},8,["data","class-option"])]))}});var Ke=se(Qe,[["__scopeId","data-v-1ac0eab6"],["__file","C:/Users/89793/Desktop/projects/ticket-system/src/views/welcome/components/Infinite.vue"]]);export{Ke as default};
|