index-legacy.537e6dca.js 3.4 KB

1
  1. !function(){function e(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,a,u=[],o=!0,l=!1;try{for(n=n.call(e);!(o=(r=n.next()).done)&&(u.push(r.value),!t||u.length!==t);o=!0);}catch(c){l=!0,a=c}finally{try{o||null==n.return||n.return()}finally{if(l)throw a}}return u}(e,n)||function(e,n){if(!e)return;if("string"==typeof e)return t(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t(e,n)}(e,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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}System.register(["./index-legacy.90c82f08.js","./utils-legacy.8e06f916.js","./index-legacy.c8871c95.js"],(function(t){"use strict";var n,r,a,u,o,l,c,i,f,m,y,s,d,p,g,v,h,D;return{setters:[function(e){n=e.t,r=e.N,a=e.aG,u=e.d,o=e.R,l=e.y,c=e.Z,i=e.aW,f=e.c,m=e.E,y=e.am,s=e.D},function(e){d=e.s,p=e.f,g=e.p,v=e.a,h=e.g},function(e){D=e.P}],execute:function(){var w=(new Date).getFullYear(),x=e(n("date-picker"),1)[0],A=r({},d,{columnsType:{type:Array,default:function(){return["year","month","day"]}},minDate:{type:Date,default:function(){return new Date(w-10,0,1)},validator:a},maxDate:{type:Date,default:function(){return new Date(w+10,11,31)},validator:a}}),b=u({name:x,props:A,emits:["confirm","cancel","change","update:modelValue"],setup:function(e,t){var n=t.emit,r=t.slots,a=o(e.modelValue),u=function(t){return t===e.minDate.getFullYear()},s=function(t){return t===e.maxDate.getFullYear()},d=function(t){var n=e.minDate,r=e.columnsType.indexOf(t),u=a.value[r];if(u)return+u;switch(t){case"year":return n.getFullYear();case"month":return n.getMonth()+1;case"day":return n.getDate()}},w=function(){var t=d("year"),n=d("month"),r=u(t)&&function(t){return t===e.minDate.getMonth()+1}(n)?e.minDate.getDate():1,a=s(t)&&function(t){return t===e.maxDate.getMonth()+1}(n)?e.maxDate.getDate():h(t,n);return v(r,a,"day",e.formatter,e.filter)},x=l((function(){return e.columnsType.map((function(t){switch(t){case"year":return o=e.minDate.getFullYear(),l=e.maxDate.getFullYear(),v(o,l,"year",e.formatter,e.filter);case"month":return n=d("year"),r=u(n)?e.minDate.getMonth()+1:1,a=s(n)?e.maxDate.getMonth()+1:12,v(r,a,"month",e.formatter,e.filter);case"day":return w();default:throw new Error("[Vant] DatePicker: unsupported columns type: ".concat(t))}var n,r,a,o,l}))}));c(a,(function(t){i(t,e.modelValue)||n("update:modelValue",t)})),c((function(){return e.modelValue}),(function(e){e=p(e,x.value),i(e,a.value)||(a.value=e)}),{immediate:!0});var A=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.apply(void 0,["change"].concat(t))},b=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.apply(void 0,["cancel"].concat(t))},V=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return n.apply(void 0,["confirm"].concat(t))};return function(){return f(D,m({modelValue:a.value,"onUpdate:modelValue":function(e){return a.value=e},columns:x.value,onChange:A,onCancel:b,onConfirm:V},y(e,g)),r)}}});t("D",s(b))}}}))}();