index-legacy-c2c369b5.js 7.3 KB

1
  1. !function(){function t(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var a,r,u,o,i=[],l=!0,c=!1;try{if(u=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(a=u.call(n)).done)&&(i.push(a.value),i.length!==e);l=!0);}catch(s){c=!0,r=s}finally{try{if(!l&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(c)throw r}}return i}}(t,n)||function(t,n){if(!t)return;if("string"==typeof t)return e(t,n);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 e(t,n)}(t,n)||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 e(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,a=new Array(e);n<e;n++)a[n]=t[n];return a}System.register(["./index-legacy-cc54d40b.js","./index-legacy-e495f5bd.js"],(function(e,n){"use strict";var a,r,u,o,i,l,c,s,f,d,m,h,g,p,v,y,D,x,w,V,S,b,_,T,k,A,F,Y,j=document.createElement("style");return j.textContent="._animateWrap_1kuq9_1{width:1.46667rem!important;height:1.46667rem!important}._loading_1kuq9_5{height:1.46667rem!important}._loading_1kuq9_5 img{height:.8rem;width:3.2rem;margin-top:.53333rem}._pullRefresh_1kuq9_13 .van-pull-refresh__track{min-height:inherit}.lottie-animation-container{width:var(--lottie-animation-container-width);height:var(--lottie-animation-container-height);background-color:var(--lottie-animation-container-background-color);overflow:hidden;margin:0 auto}\n",document.head.appendChild(j),{setters:[function(t){a=t.a9,r=t.ah,u=t.aO,o=t.c,i=t.aP,l=t.d,c=t.r,s=t.e,f=t.w,d=t.aQ,m=t.a,h=t.h,g=t.ae,p=t.k,v=t.b,y=t.n,D=t.aR,x=t.x,w=t.u,V=t.Y,S=t.L,b=t.z,_=t.aS,T=t.p,k=t.F,A=t.A},function(t){F=t.p,Y=t.P}],execute:function(){var n=a({},F,{modelValue:r(),filter:Function,formatter:{type:Function,default:function(t,e){return e}}}),j=Object.keys(F);var M=function(t,e,n,a,r){var o=function(t,e){if(t<0)return[];for(var n=Array(t),a=-1;++a<t;)n[a]=e(a);return n}(e-t+1,(function(e){var r=u(t+e);return a(n,{text:r,value:r})}));return r?r(n,o):o},H=(new Date).getFullYear(),O=t(o("date-picker"),1)[0],C=a({},n,{columnsType:{type:Array,default:function(){return["year","month","day"]}},minDate:{type:Date,default:function(){return new Date(H-10,0,1)},validator:i},maxDate:{type:Date,default:function(){return new Date(H+10,11,31)},validator:i}}),q=l({name:O,props:C,emits:["confirm","cancel","change","update:modelValue"],setup:function(t,e){var n=e.emit,a=e.slots,r=c(t.modelValue),u=function(e){return e===t.minDate.getFullYear()},o=function(e){return e===t.maxDate.getFullYear()},i=function(e){var n=t.minDate,a=t.columnsType.indexOf(e),u=r.value[a];if(u)return+u;switch(e){case"year":return n.getFullYear();case"month":return n.getMonth()+1;case"day":return n.getDate()}},l=function(){var e=i("year"),n=i("month"),a=u(e)&&function(e){return e===t.minDate.getMonth()+1}(n)?t.minDate.getDate():1,r=o(e)&&function(e){return e===t.maxDate.getMonth()+1}(n)?t.maxDate.getDate():function(t,e){return 32-new Date(t,e-1,32).getDate()}(e,n);return M(a,r,"day",t.formatter,t.filter)},p=s((function(){return t.columnsType.map((function(e){switch(e){case"year":return c=t.minDate.getFullYear(),s=t.maxDate.getFullYear(),M(c,s,"year",t.formatter,t.filter);case"month":return n=i("year"),a=u(n)?t.minDate.getMonth()+1:1,r=o(n)?t.maxDate.getMonth()+1:12,M(a,r,"month",t.formatter,t.filter);case"day":return l();default:throw new Error("[Vant] DatePicker: unsupported columns type: ".concat(e))}var n,a,r,c,s}))}));f(r,(function(e){d(e,t.modelValue)||n("update:modelValue",e)})),f((function(){return t.modelValue}),(function(t){t=function(t,e){return t.map((function(t,n){var a=e[n];if(a.length){var r=+a[a.length-1].value;if(+t>r)return String(r)}return t}))}(t,p.value),d(t,r.value)||(r.value=t)}),{immediate:!0});var v=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return n.apply(void 0,["change"].concat(e))},y=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return n.apply(void 0,["cancel"].concat(e))},D=function(){for(var t=arguments.length,e=new Array(t),a=0;a<t;a++)e[a]=arguments[a];return n.apply(void 0,["confirm"].concat(e))};return function(){return m(Y,h({modelValue:r.value,"onUpdate:modelValue":function(t){return r.value=t},columns:p.value,onChange:v,onCancel:y,onConfirm:D},g(t,j)),a)}}}),P=(e("D",p(q)),t(o("pull-refresh"),3)),R=P[0],B=P[1],E=P[2],I=["pulling","loosing","success"],U={disabled:Boolean,modelValue:Boolean,headHeight:v(50),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:y,successDuration:v(500),animationDuration:v(300)},z=l({name:R,props:U,emits:["change","refresh","update:modelValue"],setup:function(t,e){var n,a=e.emit,r=e.slots,u=c(),o=c(),i=D(u),l=x({status:"normal",distance:0,duration:0}),s=w(),d=function(){if(50!==t.headHeight)return{height:"".concat(t.headHeight,"px")}},h=function(){return"loading"!==l.status&&"success"!==l.status&&!t.disabled},g=function(e,n){var r=+(t.pullDistance||t.headHeight);l.distance=e,l.status=n?"loading":0===e?"normal":e<r?"pulling":"loosing",a("change",{status:l.status,distance:e})},p=function(){var e=l.status;return"normal"===e?"":t["".concat(e,"Text")]||E(e)},v=function(){var t=l.status,e=l.distance;if(r[t])return r[t]({distance:e});var n=[];return I.includes(t)&&n.push(m("div",{class:B("text")},[p()])),"loading"===t&&n.push(m(S,{class:B("loading")},{default:p})),n},y=function(t){(n=0===_(i.value))&&(l.duration=0,s.start(t))},k=function(t){h()&&y(t)},A=function(){n&&s.deltaY.value&&h()&&(l.duration=+t.animationDuration,"loosing"===l.status?(g(+t.headHeight,!0),a("update:modelValue",!0),b((function(){return a("refresh")}))):g(0))};return f((function(){return t.modelValue}),(function(e){l.duration=+t.animationDuration,e?g(+t.headHeight,!0):r.success||t.successText?(l.status="success",setTimeout((function(){g(0)}),+t.successDuration)):g(0,!1)})),V("touchmove",(function(e){if(h()){n||y(e);var a=s.deltaY;s.move(e),n&&a.value>=0&&s.isVertical()&&(T(e),g((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:o}),function(){var t,e={transitionDuration:"".concat(l.duration,"ms"),transform:l.distance?"translate3d(0,".concat(l.distance,"px, 0)"):""};return m("div",{ref:u,class:B()},[m("div",{ref:o,class:B("track"),style:e,onTouchstartPassive:k,onTouchend:A,onTouchcancel:A},[m("div",{class:B("head"),style:d()},[v()]),null==(t=r.default)?void 0:t.call(r)])])}}}),L=p(z),Q="_pullRefresh_1kuq9_13";e("M",l({name:"m-full-refresh",props:{title:String,modelValue:{type:Boolean,default:!1}},emits:["refresh","update:modelValue"],setup:function(t,e){var n=e.emit,a=e.slots,r=x({fullState:!1});return f((function(){return t.modelValue}),(function(t){r.fullState=t})),f((function(){return r.fullState}),(function(t){n("update:modelValue",t)})),function(){return m(L,{modelValue:r.fullState,"onUpdate:modelValue":function(t){return r.fullState=t},onRefresh:function(){return n("refresh")},loadingText:" ",class:Q},{default:function(){return m(k,null,[A(" "),a.default&&a.default()])}})}}}))}}}))}();