index-legacy.02f13b7a.js 4.4 KB

1
  1. !function(){function t(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var a,r,u=[],i=!0,l=!1;try{for(e=e.call(t);!(i=(a=e.next()).done)&&(u.push(a.value),!n||u.length!==n);i=!0);}catch(o){l=!0,r=o}finally{try{i||null==e.return||e.return()}finally{if(l)throw r}}return u}(t,e)||function(t,e){if(!t)return;if("string"==typeof t)return n(t,e);var a=Object.prototype.toString.call(t).slice(8,-1);"Object"===a&&t.constructor&&(a=t.constructor.name);if("Map"===a||"Set"===a)return Array.from(t);if("Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return n(t,e)}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,a=new Array(n);e<n;e++)a[e]=t[e];return a}var e=document.createElement("style");e.innerHTML="._animateWrap_127dt_1{width:1.46667rem;height:1.46667rem}._pullRefresh_127dt_5 .van-pull-refresh__track{min-height:inherit}\n",document.head.appendChild(e),System.register(["./index-legacy.90c82f08.js"],(function(n){"use strict";var e,a,r,u,i,l,o,s,c,d,f,h,m,g,p,v,y,S,_,x;return{setters:[function(t){e=t.t,a=t.w,r=t.z,u=t.d,i=t.R,l=t.ap,o=t.r,s=t.aq,c=t.Z,d=t.a0,f=t.c,h=t.L,m=t.a4,g=t._,p=t.ar,v=t.D,y=t.V,S=t.A,_=t.F,x=t.q}],execute:function(){var D=t(e("pull-refresh"),3),T=D[0],V=D[1],b=D[2],H=["pulling","loosing","success"],A={disabled:Boolean,modelValue:Boolean,headHeight:a(50),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:r,successDuration:a(500),animationDuration:a(300)},w=u({name:T,props:A,emits:["change","refresh","update:modelValue"],setup:function(t,n){var e,a=n.emit,r=n.slots,u=i(),v=i(),y=l(u),S=o({status:"normal",distance:0,duration:0}),_=s(),x=function(){if(50!==t.headHeight)return{height:"".concat(t.headHeight,"px")}},D=function(){return"loading"!==S.status&&"success"!==S.status&&!t.disabled},T=function(n,e){var r=+(t.pullDistance||t.headHeight);S.distance=n,S.status=e?"loading":0===n?"normal":n<r?"pulling":"loosing",a("change",{status:S.status,distance:n})},A=function(){var n=S.status;return"normal"===n?"":t["".concat(n,"Text")]||b(n)},w=function(){var t=S.status,n=S.distance;if(r[t])return r[t]({distance:n});var e=[];return H.includes(t)&&e.push(f("div",{class:V("text")},[A()])),"loading"===t&&e.push(f(h,{class:V("loading")},{default:A})),e},j=function(t){(e=0===p(y.value))&&(S.duration=0,_.start(t))},R=function(t){D()&&j(t)},B=function(){e&&_.deltaY.value&&D()&&(S.duration=+t.animationDuration,"loosing"===S.status?(T(+t.headHeight,!0),a("update:modelValue",!0),g((function(){return a("refresh")}))):T(0))};return c((function(){return t.modelValue}),(function(n){S.duration=+t.animationDuration,n?T(+t.headHeight,!0):r.success||t.successText?(S.status="success",setTimeout((function(){T(0)}),+t.successDuration)):T(0,!1)})),d("touchmove",(function(n){if(D()){e||j(n);var a=_.deltaY;_.move(n),e&&a.value>=0&&_.isVertical()&&(m(n),T((r=a.value,u=+(t.pullDistance||t.headHeight),r>u&&(r=r<2*u?u+(r-u)/2:1.5*u+(r-2*u)/4),Math.round(r))))}var r,u}),{target:v}),function(){var t,n={transitionDuration:"".concat(S.duration,"ms"),transform:S.distance?"translate3d(0,".concat(S.distance,"px, 0)"):""};return f("div",{ref:u,class:V()},[f("div",{ref:v,class:V("track"),style:n,onTouchstartPassive:R,onTouchend:B,onTouchcancel:B},[f("div",{class:V("head"),style:x()},[w()]),null==(t=r.default)?void 0:t.call(r)])])}}}),j=v(w),R="_animateWrap_127dt_1",B="_pullRefresh_127dt_5";n("O",u({name:"o-full-refresh",props:{title:String,modelValue:{type:Boolean,default:!1}},emits:["refresh","update:modelValue"],setup:function(t,n){var e=n.emit,a=n.slots,r=o({fullState:!1});return c((function(){return t.modelValue}),(function(t){r.fullState=t})),c((function(){return r.fullState}),(function(t){e("update:modelValue",t)})),function(){return f(j,{modelValue:r.fullState,"onUpdate:modelValue":function(t){return r.fullState=t},onRefresh:function(){return e("refresh")},loadingText:" ",class:B},{loading:function(){return f("div",null,[f(y,{class:R,animationData:S},null)])},pulling:function(){return f("div",null,[f(y,{class:R,animationData:S},null)])},loosing:function(){return f("div",null,[f(y,{class:R,animationData:S},null)])},default:function(){return f(_,null,[x(" "),a.default&&a.default()])}})}}}))}}}))}();