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(i){l=!0,a=i}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.48c8d62c.js","./utils-legacy.60f652b8.js","./index-legacy.384d768f.js"],(function(t){"use strict";var n,r,a,u,o,l,i,c,f,m,y,s,d,p,g,v,h,D;return{setters:[function(e){n=e.t,r=e.N,a=e.aq,u=e.d,o=e.R,l=e.y,i=e.Z,c=e.ar,f=e.c,m=e.E,y=e.al,s=e.D},function(e){d=e.s,p=e.f,g=e.p,v=e.g,h=e.a},function(e){D=e.P}],execute:function(){var w=(new Date).getFullYear(),x=e(n("date-picker"),1)[0],b=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}}),A=u({name:x,props:b,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}))}));i(a,(function(t){c(t,e.modelValue)||n("update:modelValue",t)})),i((function(){return e.modelValue}),(function(e){e=p(e,x.value),c(e,a.value)||(a.value=e)}),{immediate:!0});var 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,["change"].concat(t))},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,["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:b,onCancel:A,onConfirm:V},y(e,g)),r)}}});t("D",s(A))}}}))}();
|