/
home
/
liman
/
app
/
assets
/
File Upload :
llllll
Current File: /home/liman/app/assets/index.3c5fbbc2.js
import{c as K,t as A,n as H,f as D,K as se,p as ce,v as j,q as ue,N as re,O as ve,x as fe,h as V,M as he,Q as M,R as _,w as q,D as de}from"./on-popup-reopen.cb0ac754.js";import{d as G,j as me,x as L,G as h,y as S,k as Q,aW as ge,aV as we,a7 as pe,a as C,z as U}from"./index.5541076c.js";const[F,I]=K("swipe"),ye={loop:A,width:H,height:H,vertical:Boolean,autoplay:D(0),duration:D(500),touchable:A,lazyRender:Boolean,initialSwipe:D(0),indicatorColor:String,showIndicators:A,stopPropagation:A},J=Symbol(F);var be=G({name:F,props:ye,emits:["change"],setup(a,{emit:P,slots:d}){const u=me(),e=L({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)},z=()=>{e.swiping=!0,e.active<=-1?g({pace:i.value}):e.active>=i.value&&g({pace:-i.value})},te=()=>{z(),s.reset(),M(()=>{e.swiping=!1,g({pace:-1,emitChange:!0})})},E=()=>{z(),s.reset(),M(()=>{e.swiping=!1,g({pace:1,emitChange:!0})})};let Y;const b=()=>clearTimeout(Y),x=()=>{b(),a.autoplay>0&&i.value>1&&(Y=setTimeout(()=>{E(),x()},+a.autoplay))},p=(t=+a.initialSwipe)=>{if(!u.value)return;const l=()=>{var o,v;if(!V(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()};V(u)?U().then(l):l()},N=()=>p(e.active);let W;const ae=t=>{!a.touchable||(s.start(t),W=Date.now(),b(),z())},ie=t=>{a.touchable&&e.swiping&&(s.move(t),R.value&&(he(t,a.stopPropagation),g({offset:r.value})))},X=()=>{if(!a.touchable||!e.swiping)return;const t=Date.now()-W,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={})=>{z(),s.reset(),M(()=>{let o;a.loop&&t===i.value?o=e.active===0?0:t:o=t%i.value,l.immediate?M(()=>{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 j({prev:te,next:E,state:e,resize:N,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],N),S(ve(),t=>{t==="visible"?x():b()}),Q(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:X,onTouchcancel:X},[(t=d.default)==null?void 0:t.call(d)]),le()])}}});const $e=q(be),[xe,Te]=K("swipe-item");var Se=G({name:xe,setup(a,{slots:P}){let d;const u=L({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 Q(()=>{U(()=>{u.mounted=!0})}),j({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 ze=q(Se);export{$e as S,ze as a};
Copyright ©2k19 -
Hexid
|
Tex7ure