index-legacy-7feeb58d.js 5.5 KB

1
  1. System.register(["./index-legacy-e17b48ce.js","./index-legacy-0c1f0e57.js"],(function(e,t){"use strict";var a,n,l,r,u,o,s,i,c,d,m,h,g,p,f,v,D,y,x,V,_,T,w,k,S,F,Y,H,M;return{setters:[e=>{a=e.a9,n=e.ah,l=e.aP,r=e._,u=e.c,o=e.aQ,s=e.d,i=e.r,c=e.e,d=e.w,m=e.aR,h=e.a,g=e.h,p=e.ae,f=e.k,v=e.b,D=e.n,y=e.aS,x=e.x,V=e.u,_=e.Y,T=e.L,w=e.z,k=e.aT,S=e.p,F=e.F,Y=e.A},e=>{H=e.p,M=e.P}],execute:function(){var t=document.createElement("style");t.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(t);const b=a({},H,{modelValue:n(),filter:Function,formatter:{type:Function,default:(e,t)=>t}}),q=Object.keys(H),C=(e,t,a,n,r,u)=>{const o=function(e,t){if(e<0)return[];const a=Array(e);let n=-1;for(;++n<e;)a[n]=t(n);return a}(t-e+1,(t=>{const r=l(e+t);return n(a,{text:r,value:r})}));return r?r(a,o,u):o},$=(new Date).getFullYear(),[P]=u("date-picker"),R=a({},b,{columnsType:{type:Array,default:()=>["year","month","day"]},minDate:{type:Date,default:()=>new Date($-10,0,1),validator:o},maxDate:{type:Date,default:()=>new Date($+10,11,31),validator:o}});var j=s({name:P,props:R,emits:["confirm","cancel","change","update:modelValue"],setup(e,{emit:t,slots:a}){const n=i(e.modelValue),u=i(!1),o=t=>t===e.minDate.getFullYear(),s=t=>t===e.maxDate.getFullYear(),f=t=>{const{minDate:a,columnsType:l}=e,r=l.indexOf(t),o=u.value?e.modelValue[r]:n.value[r];if(o)return+o;switch(t){case"year":return a.getFullYear();case"month":return a.getMonth()+1;case"day":return a.getDate()}},v=()=>{const t=f("year"),a=f("month"),n=o(t)&&(t=>t===e.minDate.getMonth()+1)(a)?e.minDate.getDate():1,l=s(t)&&(t=>t===e.maxDate.getMonth()+1)(a)?e.maxDate.getDate():((e,t)=>32-new Date(e,t-1,32).getDate())(t,a);return C(n,l,"day",e.formatter,e.filter)},D=c((()=>e.columnsType.map((t=>{switch(t){case"year":return(()=>{const t=e.minDate.getFullYear(),a=e.maxDate.getFullYear();return C(t,a,"year",e.formatter,e.filter)})();case"month":return(()=>{const t=f("year"),a=o(t)?e.minDate.getMonth()+1:1,n=s(t)?e.maxDate.getMonth()+1:12;return C(a,n,"month",e.formatter,e.filter)})();case"day":return v();default:throw new Error(`[Vant] DatePicker: unsupported columns type: ${t}`)}}))));d(n,(a=>{m(a,e.modelValue)||t("update:modelValue",a)})),d((()=>e.modelValue),((e,t)=>{u.value=m(t,n.value),e=((e,t)=>e.map(((e,a)=>{const n=t[a];if(n.length){const t=+n[0].value,a=+n[n.length-1].value;return l(r(+e,t,a))}return e})))(e,D.value),m(e,n.value)||(n.value=e),u.value=!1}),{immediate:!0});const y=(...e)=>t("change",...e),x=(...e)=>t("cancel",...e),V=(...e)=>t("confirm",...e);return()=>h(M,g({modelValue:n.value,"onUpdate:modelValue":e=>n.value=e,columns:D.value,onChange:y,onCancel:x,onConfirm:V},p(e,q)),a)}});e("D",f(j));const[A,B,E]=u("pull-refresh"),O=["pulling","loosing","success"],U={disabled:Boolean,modelValue:Boolean,headHeight:v(50),successText:String,pullingText:String,loosingText:String,loadingText:String,pullDistance:D,successDuration:v(500),animationDuration:v(300)};var z=s({name:A,props:U,emits:["change","refresh","update:modelValue"],setup(e,{emit:t,slots:a}){let n;const l=i(),r=i(),u=y(l),o=x({status:"normal",distance:0,duration:0}),s=V(),c=()=>{if(50!==e.headHeight)return{height:`${e.headHeight}px`}},m=()=>"loading"!==o.status&&"success"!==o.status&&!e.disabled,g=(a,n)=>{const l=+(e.pullDistance||e.headHeight);o.distance=a,o.status=n?"loading":0===a?"normal":a<l?"pulling":"loosing",t("change",{status:o.status,distance:a})},p=()=>{const{status:t}=o;return"normal"===t?"":e[`${t}Text`]||E(t)},f=()=>{const{status:e,distance:t}=o;if(a[e])return a[e]({distance:t});const n=[];return O.includes(e)&&n.push(h("div",{class:B("text")},[p()])),"loading"===e&&n.push(h(T,{class:B("loading")},{default:p})),n},v=e=>{n=0===k(u.value),n&&(o.duration=0,s.start(e))},D=e=>{m()&&v(e)},F=()=>{n&&s.deltaY.value&&m()&&(o.duration=+e.animationDuration,"loosing"===o.status?(g(+e.headHeight,!0),t("update:modelValue",!0),w((()=>t("refresh")))):g(0))};return d((()=>e.modelValue),(t=>{o.duration=+e.animationDuration,t?g(+e.headHeight,!0):a.success||e.successText?(o.status="success",setTimeout((()=>{g(0)}),+e.successDuration)):g(0,!1)})),_("touchmove",(t=>{if(m()){n||v(t);const{deltaY:a}=s;s.move(t),n&&a.value>=0&&s.isVertical()&&(S(t),g((t=>{const a=+(e.pullDistance||e.headHeight);return t>a&&(t=t<2*a?a+(t-a)/2:1.5*a+(t-2*a)/4),Math.round(t)})(a.value)))}}),{target:r}),()=>{var e;const t={transitionDuration:`${o.duration}ms`,transform:o.distance?`translate3d(0,${o.distance}px, 0)`:""};return h("div",{ref:l,class:B()},[h("div",{ref:r,class:B("track"),style:t,onTouchstartPassive:D,onTouchend:F,onTouchcancel:F},[h("div",{class:B("head"),style:c()},[f()]),null==(e=a.default)?void 0:e.call(a)])])}}});const L=f(z),Q="_pullRefresh_1kuq9_13";e("M",s({name:"m-full-refresh",props:{title:String,modelValue:{type:Boolean,default:!1}},emits:["refresh","update:modelValue"],setup(e,{emit:t,slots:a}){const n=x({fullState:!1});return d((()=>e.modelValue),(e=>{n.fullState=e})),d((()=>n.fullState),(e=>{t("update:modelValue",e)})),()=>h(L,{modelValue:n.fullState,"onUpdate:modelValue":e=>n.fullState=e,onRefresh:()=>t("refresh"),loadingText:" ",class:Q},{default:()=>h(F,null,[Y(" "),a.default&&a.default()])})}}))}}}));