index-legacy.5ec06f8e.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(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(["./utils-legacy.24861f33.js","./index-legacy.62a334e5.js","./index-legacy.47bc1690.js"],(function(t){"use strict";var n,r,a,u,o,l,i,c,f,m,y,s,d,g,p,v,h,D;return{setters:[function(e){n=e.s,r=e.f,a=e.p,u=e.a,o=e.g},function(e){l=e.P},function(e){i=e.t,c=e.N,f=e.aG,m=e.d,y=e.R,s=e.y,d=e.Z,g=e.aW,p=e.c,v=e.E,h=e.am,D=e.D}],execute:function(){var w=(new Date).getFullYear(),x=e(i("date-picker"),1)[0],b=c({},n,{columnsType:{type:Array,default:function(){return["year","month","day"]}},minDate:{type:Date,default:function(){return new Date(w-10,0,1)},validator:f},maxDate:{type:Date,default:function(){return new Date(w+10,11,31)},validator:f}}),A=m({name:x,props:b,emits:["confirm","cancel","change","update:modelValue"],setup:function(e,t){var n=t.emit,i=t.slots,c=y(e.modelValue),f=function(t){return t===e.minDate.getFullYear()},m=function(t){return t===e.maxDate.getFullYear()},D=function(t){var n=e.minDate,r=e.columnsType.indexOf(t),a=c.value[r];if(a)return+a;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=f(t)&&function(t){return t===e.minDate.getMonth()+1}(n)?e.minDate.getDate():1,a=m(t)&&function(t){return t===e.maxDate.getMonth()+1}(n)?e.maxDate.getDate():o(t,n);return u(r,a,"day",e.formatter,e.filter)},x=s((function(){return e.columnsType.map((function(t){switch(t){case"year":return o=e.minDate.getFullYear(),l=e.maxDate.getFullYear(),u(o,l,"year",e.formatter,e.filter);case"month":return n=D("year"),r=f(n)?e.minDate.getMonth()+1:1,a=m(n)?e.maxDate.getMonth()+1:12,u(r,a,"month",e.formatter,e.filter);case"day":return w();default:return[]}var n,r,a,o,l}))}));d(c,(function(t){g(t,e.modelValue)||n("update:modelValue",t)})),d((function(){return e.modelValue}),(function(e){e=r(e,x.value),g(e,c.value)||(c.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 p(l,v({modelValue:c.value,"onUpdate:modelValue":function(e){return c.value=e},columns:x.value,onChange:b,onCancel:A,onConfirm:V},h(e,a)),i)}}});t("D",D(A))}}}))}();