/
home
/
liman
/
app
/
assets
/
File Upload :
llllll
Current File: /home/liman/app/assets/index.e79b410c.js
import{c as V,t as M,n as H,f as D,K as se,p as ce,v as q,q as ue,N as re,O as ve,x as fe,h as K,M as he,Q as z,R as _,w as L,D as de}from"./on-popup-reopen.35850a47.js";import{d as Q,e as me,ai as U,m as h,h as S,i as j,aX as ge,aW as we,k as pe,a as C,s as F}from"./index.a55f9866.js";const[G,I]=V("swipe"),ye={loop:M,width:H,height:H,vertical:Boolean,autoplay:D(0),duration:D(500),touchable:M,lazyRender:Boolean,initialSwipe:D(0),indicatorColor:String,showIndicators:M,stopPropagation:M},J=Symbol(G);var be=Q({name:G,props:ye,emits:["change"],setup(a,{emit:P,slots:d}){const u=me(),e=U({rect:null,width:0,height:0,offset:0,active:0,swiping:!1}),s=se(),{children:m,linkChildren:O}=ce(J),i=h(()=>m.length),n=h(()=>e[a.vertical?"height":"width"]),r=h(()=>a.vertical?s.deltaY.value:s.deltaX.value),f=h(()=>e.rect?(a.vertical?e.rect.height:e.rect.width)-n.value*i.value:0),$=h(()=>Math.ceil(Math.abs(f.value)/n.value)),y=h(()=>i.value*n.value),w=h(()=>(e.active+i.value)%i.value),R=h(()=>{const t=a.vertical?"vertical":"horizontal";return s.direction.value===t}),Z=h(()=>{const t={transitionDuration:`${e.swiping?0:a.duration}ms`,transform:`translate${a.vertical?"Y":"X"}(${e.offset}px)`};if(n.value){const l=a.vertical?"height":"width",o=a.vertical?"width":"height";t[l]=`${y.value}px`,t[o]=a[o]?`${a[o]}px`:""}return t}),ee=t=>{const{active:l}=e;return t?a.loop?_(l+t,-1,i.value):_(l+t,0,$.value):l},B=(t,l=0)=>{let o=t*n.value;a.loop||(o=Math.min(o,-f.value));let v=l-o;return a.loop||(v=_(v,f.value,0)),v},g=({pace:t=0,offset:l=0,emitChange:o})=>{if(i.value<=1)return;const{active:v}=e,c=ee(t),T=B(c,l);if(a.loop){if(m[0]&&T!==f.value){const k=T<f.value;m[0].setOffset(k?y.value:0)}if(m[i.value-1]&&T!==0){const k=T>0;m[i.value-1].setOffset(k?-y.value:0)}}e.active=c,e.offset=T,o&&c!==v&&P("change",w.value)},A=()=>{e.swiping=!0,e.active<=-1?g({pace:i.value}):e.active>=i.value&&g({pace:-i.value})},te=()=>{A(),s.reset(),z(()=>{e.swiping=!1,g({pace:-1,emitChange:!0})})},E=()=>{A(),s.reset(),z(()=>{e.swiping=!1,g({pace:1,emitChange:!0})})};let X;const b=()=>clearTimeout(X),x=()=>{b(),a.autoplay>0&&i.value>1&&(X=setTimeout(()=>{E(),x()},+a.autoplay))},p=(t=+a.initialSwipe)=>{if(!u.value)return;const l=()=>{var o,v;if(!K(u)){const c={width:u.value.offsetWidth,height:u.value.offsetHeight};e.rect=c,e.width=+((o=a.width)!=null?o:c.width),e.height=+((v=a.height)!=null?v:c.height)}i.value&&(t=Math.min(i.value-1,t)),e.active=t,e.swiping=!0,e.offset=B(t),m.forEach(c=>{c.setOffset(0)}),x()};K(u)?F().then(l):l()},Y=()=>p(e.active);let N;const ae=t=>{!a.touchable||(s.start(t),N=Date.now(),b(),A())},ie=t=>{a.touchable&&e.swiping&&(s.move(t),R.value&&(he(t,a.stopPropagation),g({offset:r.value})))},W=()=>{if(!a.touchable||!e.swiping)return;const t=Date.now()-N,l=r.value/t;if((Math.abs(l)>.25||Math.abs(r.value)>n.value/2)&&R.value){const v=a.vertical?s.offsetY.value:s.offsetX.value;let c=0;a.loop?c=v>0?r.value>0?-1:1:0:c=-Math[r.value>0?"ceil":"floor"](r.value/n.value),g({pace:c,emitChange:!0})}else r.value&&g({pace:0});e.swiping=!1,x()},ne=(t,l={})=>{A(),s.reset(),z(()=>{let o;a.loop&&t===i.value?o=e.active===0?0:t:o=t%i.value,l.immediate?z(()=>{e.swiping=!1}):e.swiping=!1,g({pace:o-e.active,emitChange:!0})})},oe=(t,l)=>{const o=l===w.value,v=o?{backgroundColor:a.indicatorColor}:void 0;return C("i",{style:v,class:I("indicator",{active:o})},null)},le=()=>{if(d.indicator)return d.indicator({active:w.value,total:i.value});if(a.showIndicators&&i.value>1)return C("div",{class:I("indicators",{vertical:a.vertical})},[Array(i.value).fill("").map(oe)])};return q({prev:te,next:E,state:e,resize:Y,swipeTo:ne}),O({size:n,props:a,count:i,activeIndicator:w}),S(()=>a.initialSwipe,t=>p(+t)),S(i,()=>p(e.active)),S(()=>a.autoplay,x),S([ue,re],Y),S(ve(),t=>{t==="visible"?x():b()}),j(p),ge(()=>p(e.active)),fe(()=>p(e.active)),we(b),pe(b),()=>{var t;return C("div",{ref:u,class:I()},[C("div",{style:Z.value,class:I("track",{vertical:a.vertical}),onTouchstart:ae,onTouchmove:ie,onTouchend:W,onTouchcancel:W},[(t=d.default)==null?void 0:t.call(d)]),le()])}}});const $e=L(be),[xe,Te]=V("swipe-item");var Se=Q({name:xe,setup(a,{slots:P}){let d;const u=U({offset:0,inited:!1,mounted:!1}),{parent:e,index:s}=de(J);if(!e)return;const m=h(()=>{const n={},{vertical:r}=e.props;return e.size.value&&(n[r?"height":"width"]=`${e.size.value}px`),u.offset&&(n.transform=`translate${r?"Y":"X"}(${u.offset}px)`),n}),O=h(()=>{const{loop:n,lazyRender:r}=e.props;if(!r||d)return!0;if(!u.mounted)return!1;const f=e.activeIndicator.value,$=e.count.value-1,y=f===0&&n?$:f-1,w=f===$&&n?0:f+1;return d=s.value===f||s.value===y||s.value===w,d}),i=n=>{u.offset=n};return j(()=>{F(()=>{u.mounted=!0})}),q({setOffset:i}),()=>{var n;return C("div",{class:Te(),style:m.value},[O.value?(n=P.default)==null?void 0:n.call(P):null])}}});const Ae=L(Se);export{$e as S,Ae as a};
Copyright ©2k19 -
Hexid
|
Tex7ure