Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sums-components

Package Overview
Dependencies
Maintainers
1
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sums-components - npm Package Compare versions

Comparing version 0.3.2 to 0.3.4

2

lib/calendar.js

@@ -1,1 +0,1 @@

module.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=38)}([function(t,e,i){"use strict";function n(t,e,i,n,s,r,o,a){var h,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):s&&(h=a?function(){s.call(this,this.$root.$options.shadowRoot)}:s),h)if(c.functional){c._injectStyles=h;var l=c.render;c.render=function(t,e){return h.call(e),l(t,e)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,h):[h]}return{exports:t,options:c}}i.d(e,"a",function(){return n})},function(t,e){t.exports=require("core-js/modules/es6.function.name")},function(t,e,i){t.exports=i(10)},function(t,e,i){"use strict";var n=i(7),s=i.n(n);var r=i(21),o=i.n(r);function a(t,e){return function(t){if(s()(t))return t}(t)||function(t,e){var i=[],n=!0,s=!1,r=void 0;try{for(var a,h=o()(t);!(n=(a=h.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){s=!0,r=t}finally{try{n||null==h.return||h.return()}finally{if(s)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}i.d(e,"a",function(){return a})},function(t,e,i){"use strict";i.r(e);i(1);var n={name:"SResizeSensor",props:{initial:{type:[Boolean,String],default:!1}},data:function(){return{size:{width:-1,height:-1}}},watch:{size:{deep:!0,handler:function(t){this.$emit("resize",Object.assign({},t))}}},mounted:function(){!0===this.initial&&this.$nextTick(this.update),this.$el.offsetParent!==this.$el.parentNode&&(this.$el.parentNode.style.position="relative"),"AnimationEvent"in window||this.reset()},methods:{reset:function(){var t=this.$el.firstChild,e=this.$el.lastChild;t.scrollLeft=1e5,t.scrollTop=1e5,e.scrollLeft=1e5,e.scrollTop=1e5},update:function(){this.size.width=this.$el.offsetWidth,this.size.height=this.$el.offsetHeight,this.reset()}},render:function(t){return t("div",{on:{"~animationstart":this.update},class:"s-resize-sensor"},[t("div",{on:{scroll:this.update}},[t("div")]),t("div",{on:{scroll:this.update}},[t("div")])])}},s=i(0),r=Object(s.a)(n,void 0,void 0,!1,null,null,null);r.options.__file="packages/resize-sensor/main.vue";var o=r.exports;o.install=function(t){t.component(o.name,o)};e.default=o},function(t,e,i){"use strict";var n=i(7),s=i.n(n);i(13);var r=i(11),o=i.n(r),a=i(12),h=i.n(a);function c(t){return function(t){if(s()(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(h()(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return o()(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}i.d(e,"a",function(){return c})},function(t,e,i){"use strict";i.d(e,"a",function(){return o});var n=i(2),s=i.n(n);function r(t,e,i,n,r,o,a){try{var h=t[o](a),c=h.value}catch(t){return void i(t)}h.done?e(c):s.a.resolve(c).then(n,r)}function o(t){return function(){var e=this,i=arguments;return new s.a(function(n,s){var o=t.apply(e,i);function a(t){r(o,n,s,a,h,"next",t)}function h(t){r(o,n,s,a,h,"throw",t)}a(void 0)})}}},function(t,e,i){t.exports=i(17)},function(t,e){t.exports=require("chinese-lunar_fix")},function(t,e){t.exports=require("regenerator-runtime/runtime")},function(t,e){t.exports=require("core-js/library/fn/promise")},function(t,e,i){t.exports=i(18)},function(t,e,i){t.exports=i(19)},function(t,e){t.exports=require("core-js/modules/es6.regexp.to-string")},function(t,e,i){"use strict";i.r(e);i(1),i(9);var n=i(6),s=function(t,e,i){t.addEventListener(e,function(t){"function"==typeof i&&!1===i(t)&&(t.preventDefault(),t.stopPropagation())},{passive:!1})},r={methods:{touchtrack:function(t,e,i){var n=this,r=0,o=0,a=0,h=0,c=function(t,i,s,c){if(!1===n[e]({target:t.target,currentTarget:t.currentTarget,preventDefault:t.preventDefault.bind(t),stopPropagation:t.stopPropagation.bind(t),touches:t.touches,changedTouches:t.changedTouches,detail:{state:i,x0:s,y0:c,dx:s-r,dy:c-o,ddx:s-a,ddy:c-h,timeStamp:t.timeStamp}}))return!1},l=null;s(t,"touchstart",function(t){if(1===t.touches.length&&!l)return l=t,r=a=t.touches[0].pageX,o=h=t.touches[0].pageY,c(t,"start",r,o)}),s(t,"touchmove",function(t){if(1===t.touches.length&&l){var e=c(t,"move",t.touches[0].pageX,t.touches[0].pageY);return a=t.touches[0].pageX,h=t.touches[0].pageY,e}}),s(t,"touchend",function(t){if(0===t.touches.length&&l)return l=null,c(t,"end",t.changedTouches[0].pageX,t.changedTouches[0].pageY)}),s(t,"touchcancel",function(t){if(l){var e=l;return l=null,c(t,i?"cancel":"end",e.touches[0].pageX,e.touches[0].pageY)}})}}};function o(t){this._drag=t,this._dragLog=Math.log(t),this._x=0,this._v=0,this._startTime=0}function a(t,e,i){return t>e-i&&t<e+i}function h(t,e){return a(t,0,e)}function c(t,e,i){this._m=t,this._k=e,this._c=i,this._solution=null,this._endPosition=0,this._startTime=0}function l(t,e,i){this._extent=t,this._friction=e||new o(.01),this._spring=i||new c(1,90,20),this._startTime=0,this._springing=!1,this._springOffset=0}function u(t,e){e=e||{},this._element=t,this._options=e,this._enableSnap=e.enableSnap||!1,this._itemSize=e.itemSize||0,this._enableX=e.enableX||!1,this._enableY=e.enableY||!1,this._shouldDispatchScrollEvent=!!e.onScroll,this._enableX?(this._extent=(e.scrollWidth||this._element.offsetWidth)-this._element.parentElement.offsetWidth,this._scrollWidth=e.scrollWidth):(this._extent=(e.scrollHeight||this._element.offsetHeight)-this._element.parentElement.offsetHeight,this._scrollHeight=e.scrollHeight),this._position=0,this._scroll=new l(this._extent,e.friction,e.spring),this._onTransitionEnd=this.onTransitionEnd.bind(this),this.updatePosition()}function d(t,e){var i=navigator.maxTouchPoints,n=0,s=0;t.addEventListener(i?"touchstart":"mousedown",function(t){var e=i?t.changedTouches[0]:t;n=e.clientX,s=e.clientY}),t.addEventListener(i?"touchend":"mouseup",function(t){var r=i?t.changedTouches[0]:t;Math.abs(r.clientX-n)<20&&Math.abs(r.clientY-s)<20&&e(r)})}o.prototype.set=function(t,e){this._x=t,this._v=e,this._startTime=(new Date).getTime()},o.prototype.setVelocityByEnd=function(t){this._v=(t-this._x)*this._dragLog/(Math.pow(this._drag,100)-1)},o.prototype.x=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._x+this._v*e/this._dragLog-this._v/this._dragLog},o.prototype.dx=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._v*e},o.prototype.done=function(){return Math.abs(this.dx())<3},o.prototype.reconfigure=function(t){var e=this.x(),i=this.dx();this._drag=t,this._dragLog=Math.log(t),this.set(e,i)},o.prototype.configuration=function(){var t=this;return[{label:"Friction",read:function(){return t._drag},write:function(e){t.reconfigure(e)},min:.001,max:.1,step:.001}]},c.prototype._solve=function(t,e){var i=this._c,n=this._m,s=this._k,r=i*i-4*n*s;if(0===r){var o=-i/(2*n),a=t,h=e/(o*t);return{x:function(t){return(a+h*t)*Math.pow(Math.E,o*t)},dx:function(t){var e=Math.pow(Math.E,o*t);return o*(a+h*t)*e+h*e}}}if(r>0){var c=(-i-Math.sqrt(r))/(2*n),l=(-i+Math.sqrt(r))/(2*n),u=(e-c*t)/(l-c),d=t-u;return{x:function(t){var e,i;return t===this._t&&(e=this._powER1T,i=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,c*t)),i||(i=this._powER2T=Math.pow(Math.E,l*t)),d*e+u*i},dx:function(t){var e,i;return t===this._t&&(e=this._powER1T,i=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,c*t)),i||(i=this._powER2T=Math.pow(Math.E,l*t)),d*c*e+u*l*i}}}var f=Math.sqrt(4*n*s-i*i)/(2*n),p=-i/2*n,_=t,m=(e-p*t)/f;return{x:function(t){return Math.pow(Math.E,p*t)*(_*Math.cos(f*t)+m*Math.sin(f*t))},dx:function(t){var e=Math.pow(Math.E,p*t),i=Math.cos(f*t),n=Math.sin(f*t);return e*(m*f*i-_*f*n)+p*e*(m*n+_*i)}}},c.prototype.x=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._endPosition+this._solution.x(t):0},c.prototype.dx=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._solution.dx(t):0},c.prototype.setEnd=function(t,e,i){if(i||(i=(new Date).getTime()),t!==this._endPosition||!h(e,.4)){e=e||0;var n=this._endPosition;this._solution&&(h(e,.4)&&(e=this._solution.dx((i-this._startTime)/1e3)),n=this._solution.x((i-this._startTime)/1e3),h(e,.4)&&(e=0),h(n,.4)&&(n=0),n+=this._endPosition),this._solution&&h(n-t,.4)&&h(e,.4)||(this._endPosition=t,this._solution=this._solve(n-this._endPosition,e),this._startTime=i)}},c.prototype.snap=function(t){this._startTime=(new Date).getTime(),this._endPosition=t,this._solution={x:function(){return 0},dx:function(){return 0}}},c.prototype.done=function(t){return t||(t=(new Date).getTime()),a(this.x(),this._endPosition,.4)&&h(this.dx(),.4)},c.prototype.reconfigure=function(t,e,i){this._m=t,this._k=e,this._c=i,this.done()||(this._solution=this._solve(this.x()-this._endPosition,this.dx()),this._startTime=(new Date).getTime())},c.prototype.springConstant=function(){return this._k},c.prototype.damping=function(){return this._c},c.prototype.configuration=function(){return[{label:"Spring Constant",read:this.springConstant.bind(this),write:function(t,e){t.reconfigure(1,e,t.damping())}.bind(this,this),min:100,max:1e3},{label:"Damping",read:this.damping.bind(this),write:function(t,e){t.reconfigure(1,t.springConstant(),e)}.bind(this,this),min:1,max:500}]},l.prototype.snap=function(t,e){this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(e)},l.prototype.set=function(t,e){this._friction.set(t,e),t>0&&e>=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(0)):t<-this._extent&&e<=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(-this._extent)):this._springing=!1,this._startTime=(new Date).getTime()},l.prototype.x=function(t){if(!this._startTime)return 0;if(t||(t=((new Date).getTime()-this._startTime)/1e3),this._springing)return this._spring.x()+this._springOffset;var e=this._friction.x(t),i=this.dx(t);return(e>0&&i>=0||e<-this._extent&&i<=0)&&(this._springing=!0,this._spring.setEnd(0,i),e<-this._extent?this._springOffset=-this._extent:this._springOffset=0,e=this._spring.x()+this._springOffset),e},l.prototype.dx=function(t){var e;return e=this._lastTime===t?this._lastDx:this._springing?this._spring.dx(t):this._friction.dx(t),this._lastTime=t,this._lastDx=e,e},l.prototype.done=function(){return this._springing?this._spring.done():this._friction.done()},l.prototype.setVelocityByEnd=function(t){this._friction.setVelocityByEnd(t)},l.prototype.configuration=function(){var t=this._friction.configuration();return t.push.apply(t,this._spring.configuration()),t},u.prototype.onTouchStart=function(){this._startPosition=this._position,this._lastChangePos=this._startPosition,this._startPosition>0?this._startPosition/=.5:this._startPosition<-this._extent&&(this._startPosition=(this._startPosition+this._extent)/.5-this._extent),this._animation&&(this._animation.cancel(),this._scrolling=!1),this.updatePosition()},u.prototype.onTouchMove=function(t,e){var i=this._startPosition;this._enableX?i+=t:this._enableY&&(i+=e),i>0?i*=.5:i<-this._extent&&(i=.5*(i+this._extent)-this._extent),this._position=i,this.updatePosition(),this.dispatchScroll()},u.prototype.onTouchEnd=function(t,e,i){var n=this;if(this._enableSnap&&this._position>-this._extent&&this._position<0){if(this._enableY&&(Math.abs(e)<this._itemSize&&Math.abs(i.y)<300||Math.abs(i.y)<150))return void this.snap();if(this._enableX&&(Math.abs(t)<this._itemSize&&Math.abs(i.x)<300||Math.abs(i.x)<150))return void this.snap()}if(this._enableX?this._scroll.set(this._position,i.x):this._enableY&&this._scroll.set(this._position,i.y),this._enableSnap){var s=this._scroll._friction.x(100),r=s%this._itemSize,o=Math.abs(r)>this._itemSize/2?s-(this._itemSize-Math.abs(r)):s-r;o<=0&&o>=-this._extent&&this._scroll.setVelocityByEnd(o)}this._lastTime=Date.now(),this._lastDelay=0,this._scrolling=!0,this._lastChangePos=this._position,this._lastIdx=Math.floor(Math.abs(this._position/this._itemSize)),this._animation=function(t,e,i){var n={id:0,cancelled:!1};return function t(e,i,n,s){if(!e||!e.cancelled){n(i);var r=i.done();r||e.cancelled||(e.id=requestAnimationFrame(t.bind(null,e,i,n,s))),r&&s&&s(i)}}(n,t,e,i),{cancel:function(t){t&&t.id&&cancelAnimationFrame(t.id),t&&(t.cancelled=!0)}.bind(null,n),model:t}}(this._scroll,function(){var t=Date.now(),e=(t-n._scroll._startTime)/1e3,i=n._scroll.x(e);n._position=i,n.updatePosition();var s=n._scroll.dx(e);n._shouldDispatchScrollEvent&&t-n._lastTime>n._lastDelay&&(n.dispatchScroll(),n._lastDelay=Math.abs(2e3/s),n._lastTime=t)},function(){n._enableSnap&&(o<=0&&o>=-n._extent&&(n._position=o,n.updatePosition()),"function"==typeof n._options.onSnap&&n._options.onSnap(Math.floor(Math.abs(n._position)/n._itemSize))),n._shouldDispatchScrollEvent&&n.dispatchScroll(),n._scrolling=!1})},u.prototype.onTransitionEnd=function(){this._element.style.transition="",this._element.style.webkitTransition="",this._element.removeEventListener("transitionend",this._onTransitionEnd),this._element.removeEventListener("webkitTransitionEnd",this._onTransitionEnd),this._snapping&&(this._snapping=!1),this.dispatchScroll()},u.prototype.snap=function(){var t=this._itemSize,e=this._position%t,i=Math.abs(e)>this._itemSize/2?this._position-(t-Math.abs(e)):this._position-e;this._position!==i&&(this._snapping=!0,this.scrollTo(-i),"function"==typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize)))},u.prototype.scrollTo=function(t,e){this._animation&&(this._animation.cancel(),this._scrolling=!1),"number"==typeof t&&(this._position=-t),this._position<-this._extent?this._position=-this._extent:this._position>0&&(this._position=0),this._element.style.transition="transform "+(e||.2)+"s ease-out",this._element.style.webkitTransition="-webkit-transform "+(e||.2)+"s ease-out",this.updatePosition(),this._element.addEventListener("transitionend",this._onTransitionEnd),this._element.addEventListener("webkitTransitionEnd",this._onTransitionEnd)},u.prototype.dispatchScroll=function(){if("function"==typeof this._options.onScroll&&Math.floor(this._lastPos)!==Math.floor(this._position)){this._lastPos=this._position;var t={target:{scrollLeft:this._enableX?-this._position:0,scrollTop:this._enableY?-this._position:0,scrollHeight:this._scrollHeight||this._element.offsetHeight,scrollWidth:this._scrollWidth||this._element.offsetWidth,offsetHeight:this._element.parentElement.offsetHeight,offsetWidth:this._element.parentElement.offsetWidth}};this._options.onScroll(t)}},u.prototype.update=function(t,e,i){var n=0,s=this._position;this._enableX?(n=this._element.childNodes.length?(e||this._element.offsetWidth)-this._element.parentElement.offsetWidth:0,this._scrollWidth=e):(n=this._element.childNodes.length?(e||this._element.offsetHeight)-this._element.parentElement.offsetHeight:0,this._scrollHeight=e),"number"==typeof t&&(this._position=-t),this._position<-n?this._position=-n:this._position>0&&(this._position=0),this._itemSize=i||this._itemSize,this.updatePosition(),s!==this._position&&(this.dispatchScroll(),"function"==typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize))),this._extent=n,this._scroll._extent=n},u.prototype.updatePosition=function(){var t="";this._enableX?t="translateX("+this._position+"px) translateZ(0)":this._enableY&&(t="translateY("+this._position+"px) translateZ(0)"),this._element.style.webkitTransform=t,this._element.style.transform=t},u.prototype.isScrolling=function(){return this._scrolling||this._snapping};var f,p={name:"SPickerViewColumn",mixins:[r,{methods:{initScroller:function(t,e){this._touchInfo={trackingID:-1,maxDy:0,maxDx:0},this._scroller=new u(t,e),this.__handleTouchStart=this._handleTouchStart.bind(this),this.__handleTouchMove=this._handleTouchMove.bind(this),this.__handleTouchEnd=this._handleTouchEnd.bind(this),this._initedScroller=!0},_findDelta:function(t){var e=this._touchInfo;return"move"===t.detail.state||"end"===t.detail.state?{x:t.detail.dx,y:t.detail.dy}:{x:t.screenX-e.x,y:t.screenY-e.y}},_handleTouchStart:function(t){var e=this._touchInfo,i=this._scroller;i&&("start"===t.detail.state?(e.trackingID="touch",e.x=t.detail.x,e.y=t.detail.y):(e.trackingID="mouse",e.x=t.screenX,e.y=t.screenY),e.maxDx=0,e.maxDy=0,e.historyX=[0],e.historyY=[0],e.historyTime=[t.detail.timeStamp],e.listener=i,i.onTouchStart&&i.onTouchStart())},_handleTouchMove:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var i=this._findDelta(t);if(i){for(e.maxDy=Math.max(e.maxDy,Math.abs(i.y)),e.maxDx=Math.max(e.maxDx,Math.abs(i.x)),e.historyX.push(i.x),e.historyY.push(i.y),e.historyTime.push(t.detail.timeStamp);e.historyTime.length>10;)e.historyTime.shift(),e.historyX.shift(),e.historyY.shift();e.listener&&e.listener.onTouchMove&&e.listener.onTouchMove(i.x,i.y,t.detail.timeStamp)}}},_handleTouchEnd:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var i=this._findDelta(t);if(i){var n=e.listener;e.trackingID=-1,e.listener=null;var s={x:0,y:0};if(e.historyTime.length>2)for(var r=e.historyTime.length-1,o=e.historyTime[r],a=e.historyX[r],h=e.historyY[r];r>0;){r--;var c=o-e.historyTime[r];if(c>30&&c<50){s.x=(a-e.historyX[r])/(c/1e3),s.y=(h-e.historyY[r])/(c/1e3);break}}e.historyTime=[],e.historyX=[],e.historyY=[],n&&n.onTouchEnd&&n.onTouchEnd(i.x,i.y,s)}}}}}],components:{ResizeSensor:i(4).default},data:function(){return{scope:"picker-view-column-".concat(Date.now()),inited:!1,indicatorStyle:"",indicatorClass:"",indicatorHeight:34,maskStyle:"",maskClass:"",current:this.$parent.getItemValue(this),length:0}},computed:{height:function(){return this.$parent.height},maskSize:function(){return(this.height-this.indicatorHeight)/2}},watch:{indicatorHeight:function(t){this._setItemHeight(t),this.inited&&this.update()},current:function(t){this.$parent.setItemValue(this,t)},length:function(t){this.inited&&this.update(t)}},created:function(){var t=this.$parent;this.indicatorStyle=t.indicatorStyle,this.indicatorClass=t.indicatorClass,this.maskStyle=t.maskStyle,this.maskClass=t.maskClass,this.deltaY=0},mounted:(f=Object(n.a)(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this.touchtrack(this.$refs.main,"_handleTrack",!0),this.setCurrent(this.current),this.$nextTick(function(){e.init(),e.update()}),d(this.$el,this._handleTap.bind(this));case 4:case"end":return t.stop()}},t,this)})),function(){return f.apply(this,arguments)}),methods:{_setItemHeight:function(t){var e=document.createElement("style");e.innerText=".s-picker-view-content.".concat(this.scope,">*{height: ").concat(t,"px;line-height: ").concat(t,"px;overflow: hidden;}"),document.head.appendChild(e)},_handleTrack:function(t){if(this._scroller)switch(t.detail.state){case"start":this._handleTouchStart(t);break;case"move":this._handleTouchMove(t);break;case"end":case"cancel":this._handleTouchEnd(t)}},_handleTap:function(t){var e=t.clientY;if(!this._scroller.isScrolling()){var i=e-this.$el.getBoundingClientRect().top-this.height/2,n=this.indicatorHeight/2;if(!(Math.abs(i)<=n)){var s=Math.ceil((Math.abs(i)-n)/this.indicatorHeight),r=i<0?-s:s,o=Math.min(this.current+r,this.length-1);this.current=o=Math.max(o,0),this._scroller.scrollTo(o*this.indicatorHeight)}}},_handleWheel:function(t){var e=this.deltaY+t.deltaY;if(Math.abs(e)>10){this.deltaY=0;var i=Math.min(this.current+(e<0?-1:1),this.length-1);this.current=i=Math.max(i,0),this._scroller.scrollTo(i*this.indicatorHeight)}else this.deltaY=e;t.preventDefault()},setCurrent:function(t){t!==this.current&&(this.current=t,this.inited&&this.update())},init:function(){var t=this;this.initScroller(this.$refs.content,{enableY:!0,enableX:!1,enableSnap:!0,itemSize:this.indicatorHeight,friction:new o(1e-4),spring:new c(2,90,20),onSnap:function(e){isNaN(e)||e===t.current||(t.current=e)}}),this.inited=!0},update:function(){var t=this;this.$nextTick(function(){var e=Math.min(t.current,t.length-1);e=Math.max(e,0),t._scroller.update(e*t.indicatorHeight,void 0,t.indicatorHeight)})},_resize:function(t){var e=t.height;this.indicatorHeight=e}},render:function(t){return this.length=this.$slots.default&&this.$slots.default.length||0,t("div",{on:{wheel:this._handleWheel},class:"s-picker-view-column"},[t("div",{ref:"main",staticClass:"s-picker-view-group"},[t("div",{ref:"mask",staticClass:"s-picker-view-mask",class:this.maskClass,style:"background-size: 100% ".concat(this.maskSize,"px;").concat(this.maskStyle)}),t("div",{ref:"indicator",staticClass:"s-picker-view-indicator",class:this.indicatorClass,style:this.indicatorStyle},[t("resize-sensor",{attrs:{initial:!0},on:{resize:this._resize}})]),t("div",{ref:"content",staticClass:"s-picker-view-content",class:this.scope,style:"padding: ".concat(this.maskSize,"px 0;")},[this.$slots.default])])])}},_=i(0),m=Object(_.a)(p,void 0,void 0,!1,null,null,null);m.options.__file="packages/picker-view-column/main.vue";var v=m.exports;v.install=function(t){t.component(v.name,v)};e.default=v},function(t,e,i){"use strict";i.r(e);i(1),i(16);var n=i(5),s={name:"SPickerView",components:{ResizeSensor:i(4).default},props:{value:{type:Array,default:function(){return[]},validator:function(t){return Array.isArray(t)&&t.filter(function(t){return"number"==typeof t}).length===t.length}},indicatorStyle:{type:String,default:""},indicatorClass:{type:String,default:""},maskStyle:{type:String,default:""},maskClass:{type:String,default:""}},data:function(){return{valueSync:Object(n.a)(this.value),height:34,items:[],changeSource:""}},watch:{value:function(t){var e=this;this.valueSync.length=t.length,t.forEach(function(t,i){t!==e.valueSync[i]&&e.$set(e.valueSync,i,t)})},valueSync:{deep:!0,handler:function(t){if(""===this.changeSource)this._valueChanged(t);else{this.changeSource="";var e=Object(n.a)(t);this.$emit("update:value",e),this.$emit("change",e)}}}},methods:{getItemIndex:function(t){return this.items.indexOf(t)},getItemValue:function(t){return this.valueSync[this.getItemIndex(t.$vnode)]||0},setItemValue:function(t,e){var i=this.getItemIndex(t.$vnode);this.valueSync[i]!==e&&(this.changeSource="touch",this.$set(this.valueSync,i,e))},_valueChanged:function(t){this.items.forEach(function(e,i){e.componentInstance.setCurrent(t[i]||0)})},_resize:function(t){var e=t.height;this.height=e}},render:function(t){var e=[];return this.$slots.default&&this.$slots.default.forEach(function(t){t.componentOptions&&"picker-view-column"===t.componentOptions.tag&&e.push(t)}),this.items=e,t("div",{on:this.$listeners,class:"s-picker-view"},[t("resize-sensor",{attrs:{initial:!0},on:{resize:this._resize}}),t("div",{ref:"wrapper",class:"s-picker-view-wrapper"},e)])}},r=i(0),o=Object(r.a)(s,void 0,void 0,!1,null,null,null);o.options.__file="packages/picker-view/main.vue";var a=o.exports;a.install=function(t){t.component(a.name,a)};e.default=a},function(t,e){t.exports=require("core-js/modules/web.dom.iterable")},function(t,e){t.exports=require("core-js/library/fn/array/is-array")},function(t,e){t.exports=require("core-js/library/fn/array/from")},function(t,e){t.exports=require("core-js/library/fn/is-iterable")},function(t,e){t.exports=require("core-js/modules/es6.number.constructor")},function(t,e,i){t.exports=i(23)},function(t,e,i){t.exports=i(31)},function(t,e){t.exports=require("core-js/library/fn/get-iterator")},,function(t,e,i){t.exports=i(32)},,,,function(t,e){t.exports=require("core-js/modules/es6.array.find-index")},function(t,e){t.exports=require("core-js/modules/es6.regexp.match")},function(t,e){t.exports=require("core-js/library/fn/reflect/construct")},function(t,e){t.exports=require("core-js/library/fn/object/set-prototype-of")},function(t,e){t.exports=require("core-js/modules/es6.array.sort")},function(t,e){t.exports=require("core-js/modules/es6.array.fill")},,,,function(t,e,i){"use strict";i.r(e);i(1);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("van-popup",{staticClass:"s-calendar-box",attrs:{value:t.value,position:"bottom"},on:{input:function(e){return t.$emit("input",e)}}},[i("div",{staticClass:"s-calendar"},[i("div",{staticClass:"s-calendar-header"},[0===t.type?i("div",{staticClass:"s-calendar-header--date"},[t._v("\n "+t._s(t.currentSolar[0].hans)+"年"+t._s(t.currentSolar[1].hans)+"月"+t._s(t.currentSolar[2].hans)+"日\n ")]):i("div",{staticClass:"s-calendar-header--date"},[t._v("\n "+t._s(t.currentLunar[0].hans)+t._s(t.currentLunar[1]?t.currentLunar[1].hans:"")+"\n "+t._s(t.currentLunar[2]?t.currentLunar[2].hans:"")+"\n ")]),i("div",{staticClass:"s-calendar-header--btn-group"},t._l(t.dateList,function(e,n){return i("div",{key:n,staticClass:"s-calendar-header--btn",class:["s-calendar-header--btn__"+n],style:[n===t.type?{color:"#fff",background:t.color,borderColor:t.color}:{}],on:{click:function(e){return e.stopPropagation(),t.handleCalendarChange(n)}}},[t._v("\n "+t._s(e)+"\n ")])}),0)]),i("div",{staticClass:"s-calendar-content"},[0===t.type?i("picker-view",{staticClass:"s-calendar-content--picker",attrs:{value:t.solarTime,"indicator-class":"ignore-calendar-indicator","mask-style":"opacity:0.5"},on:{change:t.handleSolarDateChange}},[i("picker-view-column",t._l(t.solarYears,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[0]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"年\n ")])}),0),i("picker-view-column",t._l(t.solarMonths,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[1]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"月\n ")])}),0),i("picker-view-column",t._l(t.solarDates,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[2]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"日\n ")])}),0),t.hasDateTime?[i("picker-view-column",t._l(t.hours,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[3]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0),i("picker-view-column",t._l(t.minutes,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[4]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0)]:t._e()],2):i("picker-view",{staticClass:"s-calendar-content--picker",attrs:{value:t.lunarTime,"indicator-class":"ignore-calendar-indicator","mask-style":"opacity:0.5"},on:{change:t.handleLunarDateChange}},[i("picker-view-column",t._l(t.lunarYears,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[0]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e.hans)+"\n ")])}),0),i("picker-view-column",t._l(t.lunarMonths,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[1]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e.hans)+"\n ")])}),0),i("picker-view-column",t._l(t.lunarDates,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[2]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e.hans)+"\n ")])}),0),t.hasDateTime?[i("picker-view-column",t._l(t.hours,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[3]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0),i("picker-view-column",t._l(t.minutes,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[4]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0)]:t._e()],2)],1),i("div",{staticClass:"s-calendar-footer"},[i("div",{staticClass:"s-calendar-footer--btn s-calendar-footer--cancel",on:{click:t.handleCancel}},[t._v("\n 取消\n ")]),i("div",{staticClass:"s-calendar-footer--btn",style:{background:t.color,color:"#fff",borderColor:t.color},on:{click:t.handleSubmit}},[t._v("\n 确定\n ")])])])])};n._withStripped=!0;i(29),i(13),i(30);var s=i(22),r=i.n(s),o=i(25),a=i.n(o);function h(t,e){return(h=a.a||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e,i){return(c=function(){if("undefined"==typeof Reflect||!r.a)return!1;if(r.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(r()(Date,[],function(){})),!0}catch(t){return!1}}()?r.a:function(t,e,i){var n=[null];n.push.apply(n,e);var s=new(Function.bind.apply(t,n));return i&&h(s,i.prototype),s}).apply(null,arguments)}var l=i(3),u=(i(33),i(20),i(34),i(5)),d=i(8),f=i(15),p=i(14),_=function(t,e){return["未知"].concat(Object(u.a)(new Array(t).fill().map(function(t,i){return"".concat(i).concat(e)})))};function m(t){for(var e="";t>0;)e="〇一二三四五六七八九"[t%10]+e,t=Math.floor(t/10);return e}function v(t,e){return 2!==e?[0,31,0,31,30,31,30,31,31,30,31,30,31][e]:t%400?t%100?t%4?28:29:28:29}function g(t){var e=Object(d.leapMonthOfYear)(t),i=Object(u.a)(Array(12)).map(function(t,e){return{month:e+1,leap:!1}});return e&&(i=i.concat({month:e,leap:!0}).sort(function(t,e){return t.month-e.month})),i.map(function(t){return Object.assign({},t,{hans:Object(d.monthName)(t.month,!0,t.leap)})})}function y(t,e,i){for(var n=function(t,e,i){var n=Object(d.lunarToSolar)(t,e,1,i);return Object(d.leapMonthOfYear)(t)!==e||i?12===e?(t+=1,e=1):(i=!1,e+=1):i=!0,(Object(d.lunarToSolar)(t,e,1,i).valueOf()-n.valueOf())/864e5}(t,e,i),s=[],r=1;r<=n;r+=1)s.push({date:r,hans:Object(d.dayName)(r)});return s}function x(t){return t<10?"0".concat(t):"".concat(t)}var b=_(24,"时"),T=_(60,"分"),S=function(){for(var t=(new Date).getFullYear(),e=[],i=1930;i<=t;i++)e.push(i);return e}(),w=function(t){for(var e=Number(Object(d.solarToLunar)(new Date(t[0],0,1),"y")),i=Number(Object(d.solarToLunar)(new Date(t[t.length-1],11,31),"y")),n=[],s=e;s<=i;s+=1)n.push({year:s,hans:m(s)});return n}(S),k={name:"SCalendar",components:{PickerView:f.default,PickerViewColumn:p.default},props:{defaultDate:{type:Array,required:!1,default:function(){var t=new Date;return[t.getFullYear(),t.getMonth()+1,t.getDate(),1,1]}},defaultTime:{type:Array,required:!1,default:function(){return[-1,-1]}},isLunar:{type:Boolean,required:!1,dafault:!0},value:{type:Boolean,default:!1},defaultType:{type:Number,default:0},color:{type:String,default:"#522273"},dateType:{type:String,default:"date"}},data:function(){return{solarValue:[-1,-1,-1],solarYears:S,solarMonths:12,solarDates:31,lunarValue:[-1,-1,-1],lunarYears:w,lunarMonths:[],lunarDates:[],type:0,hours:b,minutes:T,dateList:["公历","农历"],currentTime:[-1,-1]}},computed:{solarTime:function(){var t=Object(l.a)(this.currentTime,2),e=t[0],i=void 0===e?0:e,n=t[1],s=void 0===n?0:n;return this.solarValue.concat(i,s)},lunarTime:function(){var t=Object(l.a)(this.currentTime,2),e=t[0],i=void 0===e?0:e,n=t[1],s=void 0===n?0:n;return this.lunarValue.concat(i,s)},currentSolar:function(){var t=Object(l.a)(this.solarValue,3),e=t[0],i=t[1],n=t[2],s=this.solarYears[e]||this.solarYears[0],r=i+1,o=n+1;return[{hans:x(s),year:s},{hans:x(r),month:r},{hans:x(o),date:o}]},currentLunar:function(){var t=Object(l.a)(this.lunarValue,3),e=t[0],i=t[1],n=t[2];return[this.lunarYears[e]||this.lunarYears[0],this.lunarMonths[i]||this.lunarMonths[0],this.lunarDates[n]||this.lunarDates[0]]},hasDateTime:function(){return"datetime"===this.dateType}},mounted:function(){this.currentTime=this.defaultTime,this.initDate()},methods:{cancal:function(){this.$emit("input",!1)},handleSubmit:function(){var t={solar:this.currentSolar,lunar:this.currentLunar,type:this.type,time:[0,0]};if(this.hasDateTime){var e=Object(l.a)(this.currentTime,2),i=e[0],n=void 0===i?0:i,s=e[1],r=void 0===s?0:s;0===n&&(n=1),0===r&&(r=1),t.time=[n-1,r-1]}var o=c(Date,[this.currentSolar[0].year,this.currentSolar[1].month-1,this.currentSolar[2].date].concat(Object(u.a)(t.time))),a=+o;o.toString().match(/\+0900/)&&(a+=36e5),this.cancal(),this.$emit("change",t,a)},handleCancel:function(){this.cancal(),this.$emit("cancel")},initDate:function(){var t=Object(l.a)(this.defaultDate,3),e=t[0],i=t[1],n=t[2];this.type=this.defaultType;var s=this.solarYears.findIndex(function(t){return t===e});this.handleSolarDateChange([s,i-1,n-1],!0)},handleCalendarChange:function(t){this.type=t},handleSolarDateChange:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=Object(l.a)(t,5),r=s[0],o=s[1],a=s[2],h=s[3],c=s[4],u=Object(l.a)(this.solarValue,3),d=u[0],f=u[1],p=u[2];if(i||r!==d||o!==f){var _=this.solarYears[r],m=o+1;this.solarDates=v(_,m)}this.$nextTick().then(function(){e.solarValue=[r,o,a],e.currentTime=[h,c]}),!n||r===d&&o===f&&a===p||this.$nextTick().then(function(){var t=Object(l.a)(e.currentSolar,3),i=t[0].year,n=t[1].month,s=t[2].date;e.findLunarValue(i,n,s)})},handleLunarDateChange:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=Object(l.a)(t,5),r=s[0],o=s[1],a=s[2],h=s[3],c=s[4],u=Object(l.a)(this.lunarValue,3),d=u[0],f=u[1],p=u[2];if((i||r!==d)&&(this.lunarMonths=g(this.lunarYears[r].year)),i||r!==d||o!==f){var _=this.lunarYears[r].year,m=this.lunarMonths[o],v=m.month,x=m.leap;this.lunarDates=y(_,v,x)}this.$nextTick().then(function(){e.lunarValue=[r,o,a],e.currentTime=[h,c]}),!n||r===d&&o===f&&a===p||this.$nextTick().then(function(){var t=Object(l.a)(e.currentLunar,3),i=t[0],n=(i=void 0===i?{}:i).year,s=void 0===n?1989:n,r=t[1],o=(r=void 0===r?{}:r).month,a=void 0===o?12:o,h=r.leap,c=void 0!==h&&h,u=t[2],d=(u=void 0===u?{}:u).date,f=void 0===d?5:d;e.findSolarValue(s,a,f,c)})},findSolarValue:function(t,e,i,n){var s=Object(d.lunarToSolar)(t,e,i,n),r=s.getFullYear(),o=s.getMonth(),a=s.getDate()-1,h=this.solarYears.findIndex(function(t){return t===r});this.handleSolarDateChange([h,o,a].concat(Object(u.a)(this.currentTime)),!0,!1)},findLunarValue:function(t,e,i){var n=Object(d.solarToLunar)(new Date(t,e-1,i,0,0,0)),s=n.leap,r=n.year,o=n.month,a=n.day,h=n.leapMonth,c=this.lunarYears.findIndex(function(t){return t.year===r}),l=h&&(s||o>h)?o:o-1,f=a-1;this.handleLunarDateChange([c,l,f].concat(Object(u.a)(this.currentTime)),!0,!1)}}},D=i(0),M=Object(D.a)(k,n,[],!1,null,null,null);M.options.__file="packages/calendar/main.vue";var C=M.exports;C.install=function(t){t.component(C.name,C)};e.default=C}]);
module.exports=function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=38)}([function(t,e,i){"use strict";function n(t,e,i,n,s,r,o,a){var h,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),o?(h=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},c._ssrRegister=h):s&&(h=a?function(){s.call(this,this.$root.$options.shadowRoot)}:s),h)if(c.functional){c._injectStyles=h;var l=c.render;c.render=function(t,e){return h.call(e),l(t,e)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,h):[h]}return{exports:t,options:c}}i.d(e,"a",function(){return n})},function(t,e){t.exports=require("core-js/modules/es6.function.name")},function(t,e,i){t.exports=i(10)},function(t,e,i){"use strict";var n=i(7),s=i.n(n);var r=i(21),o=i.n(r);function a(t,e){return function(t){if(s()(t))return t}(t)||function(t,e){var i=[],n=!0,s=!1,r=void 0;try{for(var a,h=o()(t);!(n=(a=h.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){s=!0,r=t}finally{try{n||null==h.return||h.return()}finally{if(s)throw r}}return i}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}i.d(e,"a",function(){return a})},function(t,e,i){"use strict";i.r(e);i(1);var n={name:"SResizeSensor",props:{initial:{type:[Boolean,String],default:!1}},data:function(){return{size:{width:-1,height:-1}}},watch:{size:{deep:!0,handler:function(t){this.$emit("resize",Object.assign({},t))}}},mounted:function(){!0===this.initial&&this.$nextTick(this.update),this.$el.offsetParent!==this.$el.parentNode&&(this.$el.parentNode.style.position="relative"),"AnimationEvent"in window||this.reset()},methods:{reset:function(){var t=this.$el.firstChild,e=this.$el.lastChild;t.scrollLeft=1e5,t.scrollTop=1e5,e.scrollLeft=1e5,e.scrollTop=1e5},update:function(){this.size.width=this.$el.offsetWidth,this.size.height=this.$el.offsetHeight,this.reset()}},render:function(t){return t("div",{on:{"~animationstart":this.update},class:"s-resize-sensor"},[t("div",{on:{scroll:this.update}},[t("div")]),t("div",{on:{scroll:this.update}},[t("div")])])}},s=i(0),r=Object(s.a)(n,void 0,void 0,!1,null,null,null);r.options.__file="packages/resize-sensor/main.vue";var o=r.exports;o.install=function(t){t.component(o.name,o)};e.default=o},function(t,e,i){"use strict";var n=i(7),s=i.n(n);i(13);var r=i(11),o=i.n(r),a=i(12),h=i.n(a);function c(t){return function(t){if(s()(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(h()(Object(t))||"[object Arguments]"===Object.prototype.toString.call(t))return o()(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}i.d(e,"a",function(){return c})},function(t,e,i){"use strict";i.d(e,"a",function(){return o});var n=i(2),s=i.n(n);function r(t,e,i,n,r,o,a){try{var h=t[o](a),c=h.value}catch(t){return void i(t)}h.done?e(c):s.a.resolve(c).then(n,r)}function o(t){return function(){var e=this,i=arguments;return new s.a(function(n,s){var o=t.apply(e,i);function a(t){r(o,n,s,a,h,"next",t)}function h(t){r(o,n,s,a,h,"throw",t)}a(void 0)})}}},function(t,e,i){t.exports=i(17)},function(t,e){t.exports=require("chinese-lunar_fix")},function(t,e){t.exports=require("regenerator-runtime/runtime")},function(t,e){t.exports=require("core-js/library/fn/promise")},function(t,e,i){t.exports=i(18)},function(t,e,i){t.exports=i(19)},function(t,e){t.exports=require("core-js/modules/es6.regexp.to-string")},function(t,e,i){"use strict";i.r(e);i(1),i(9);var n=i(6),s=function(t,e,i){t.addEventListener(e,function(t){"function"==typeof i&&!1===i(t)&&(t.preventDefault(),t.stopPropagation())},{passive:!1})},r={methods:{touchtrack:function(t,e,i){var n=this,r=0,o=0,a=0,h=0,c=function(t,i,s,c){if(!1===n[e]({target:t.target,currentTarget:t.currentTarget,preventDefault:t.preventDefault.bind(t),stopPropagation:t.stopPropagation.bind(t),touches:t.touches,changedTouches:t.changedTouches,detail:{state:i,x0:s,y0:c,dx:s-r,dy:c-o,ddx:s-a,ddy:c-h,timeStamp:t.timeStamp}}))return!1},l=null;s(t,"touchstart",function(t){if(1===t.touches.length&&!l)return l=t,r=a=t.touches[0].pageX,o=h=t.touches[0].pageY,c(t,"start",r,o)}),s(t,"touchmove",function(t){if(1===t.touches.length&&l){var e=c(t,"move",t.touches[0].pageX,t.touches[0].pageY);return a=t.touches[0].pageX,h=t.touches[0].pageY,e}}),s(t,"touchend",function(t){if(0===t.touches.length&&l)return l=null,c(t,"end",t.changedTouches[0].pageX,t.changedTouches[0].pageY)}),s(t,"touchcancel",function(t){if(l){var e=l;return l=null,c(t,i?"cancel":"end",e.touches[0].pageX,e.touches[0].pageY)}})}}};function o(t){this._drag=t,this._dragLog=Math.log(t),this._x=0,this._v=0,this._startTime=0}function a(t,e,i){return t>e-i&&t<e+i}function h(t,e){return a(t,0,e)}function c(t,e,i){this._m=t,this._k=e,this._c=i,this._solution=null,this._endPosition=0,this._startTime=0}function l(t,e,i){this._extent=t,this._friction=e||new o(.01),this._spring=i||new c(1,90,20),this._startTime=0,this._springing=!1,this._springOffset=0}function u(t,e){e=e||{},this._element=t,this._options=e,this._enableSnap=e.enableSnap||!1,this._itemSize=e.itemSize||0,this._enableX=e.enableX||!1,this._enableY=e.enableY||!1,this._shouldDispatchScrollEvent=!!e.onScroll,this._enableX?(this._extent=(e.scrollWidth||this._element.offsetWidth)-this._element.parentElement.offsetWidth,this._scrollWidth=e.scrollWidth):(this._extent=(e.scrollHeight||this._element.offsetHeight)-this._element.parentElement.offsetHeight,this._scrollHeight=e.scrollHeight),this._position=0,this._scroll=new l(this._extent,e.friction,e.spring),this._onTransitionEnd=this.onTransitionEnd.bind(this),this.updatePosition()}function d(t,e){var i=navigator.maxTouchPoints,n=0,s=0;t.addEventListener(i?"touchstart":"mousedown",function(t){var e=i?t.changedTouches[0]:t;n=e.clientX,s=e.clientY}),t.addEventListener(i?"touchend":"mouseup",function(t){var r=i?t.changedTouches[0]:t;Math.abs(r.clientX-n)<20&&Math.abs(r.clientY-s)<20&&e(r)})}o.prototype.set=function(t,e){this._x=t,this._v=e,this._startTime=(new Date).getTime()},o.prototype.setVelocityByEnd=function(t){this._v=(t-this._x)*this._dragLog/(Math.pow(this._drag,100)-1)},o.prototype.x=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._x+this._v*e/this._dragLog-this._v/this._dragLog},o.prototype.dx=function(t){var e;return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),e=t===this._dt&&this._powDragDt?this._powDragDt:this._powDragDt=Math.pow(this._drag,t),this._dt=t,this._v*e},o.prototype.done=function(){return Math.abs(this.dx())<3},o.prototype.reconfigure=function(t){var e=this.x(),i=this.dx();this._drag=t,this._dragLog=Math.log(t),this.set(e,i)},o.prototype.configuration=function(){var t=this;return[{label:"Friction",read:function(){return t._drag},write:function(e){t.reconfigure(e)},min:.001,max:.1,step:.001}]},c.prototype._solve=function(t,e){var i=this._c,n=this._m,s=this._k,r=i*i-4*n*s;if(0===r){var o=-i/(2*n),a=t,h=e/(o*t);return{x:function(t){return(a+h*t)*Math.pow(Math.E,o*t)},dx:function(t){var e=Math.pow(Math.E,o*t);return o*(a+h*t)*e+h*e}}}if(r>0){var c=(-i-Math.sqrt(r))/(2*n),l=(-i+Math.sqrt(r))/(2*n),u=(e-c*t)/(l-c),d=t-u;return{x:function(t){var e,i;return t===this._t&&(e=this._powER1T,i=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,c*t)),i||(i=this._powER2T=Math.pow(Math.E,l*t)),d*e+u*i},dx:function(t){var e,i;return t===this._t&&(e=this._powER1T,i=this._powER2T),this._t=t,e||(e=this._powER1T=Math.pow(Math.E,c*t)),i||(i=this._powER2T=Math.pow(Math.E,l*t)),d*c*e+u*l*i}}}var p=Math.sqrt(4*n*s-i*i)/(2*n),f=-i/2*n,_=t,m=(e-f*t)/p;return{x:function(t){return Math.pow(Math.E,f*t)*(_*Math.cos(p*t)+m*Math.sin(p*t))},dx:function(t){var e=Math.pow(Math.E,f*t),i=Math.cos(p*t),n=Math.sin(p*t);return e*(m*p*i-_*p*n)+f*e*(m*n+_*i)}}},c.prototype.x=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._endPosition+this._solution.x(t):0},c.prototype.dx=function(t){return void 0===t&&(t=((new Date).getTime()-this._startTime)/1e3),this._solution?this._solution.dx(t):0},c.prototype.setEnd=function(t,e,i){if(i||(i=(new Date).getTime()),t!==this._endPosition||!h(e,.4)){e=e||0;var n=this._endPosition;this._solution&&(h(e,.4)&&(e=this._solution.dx((i-this._startTime)/1e3)),n=this._solution.x((i-this._startTime)/1e3),h(e,.4)&&(e=0),h(n,.4)&&(n=0),n+=this._endPosition),this._solution&&h(n-t,.4)&&h(e,.4)||(this._endPosition=t,this._solution=this._solve(n-this._endPosition,e),this._startTime=i)}},c.prototype.snap=function(t){this._startTime=(new Date).getTime(),this._endPosition=t,this._solution={x:function(){return 0},dx:function(){return 0}}},c.prototype.done=function(t){return t||(t=(new Date).getTime()),a(this.x(),this._endPosition,.4)&&h(this.dx(),.4)},c.prototype.reconfigure=function(t,e,i){this._m=t,this._k=e,this._c=i,this.done()||(this._solution=this._solve(this.x()-this._endPosition,this.dx()),this._startTime=(new Date).getTime())},c.prototype.springConstant=function(){return this._k},c.prototype.damping=function(){return this._c},c.prototype.configuration=function(){return[{label:"Spring Constant",read:this.springConstant.bind(this),write:function(t,e){t.reconfigure(1,e,t.damping())}.bind(this,this),min:100,max:1e3},{label:"Damping",read:this.damping.bind(this),write:function(t,e){t.reconfigure(1,t.springConstant(),e)}.bind(this,this),min:1,max:500}]},l.prototype.snap=function(t,e){this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(e)},l.prototype.set=function(t,e){this._friction.set(t,e),t>0&&e>=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(0)):t<-this._extent&&e<=0?(this._springOffset=0,this._springing=!0,this._spring.snap(t),this._spring.setEnd(-this._extent)):this._springing=!1,this._startTime=(new Date).getTime()},l.prototype.x=function(t){if(!this._startTime)return 0;if(t||(t=((new Date).getTime()-this._startTime)/1e3),this._springing)return this._spring.x()+this._springOffset;var e=this._friction.x(t),i=this.dx(t);return(e>0&&i>=0||e<-this._extent&&i<=0)&&(this._springing=!0,this._spring.setEnd(0,i),e<-this._extent?this._springOffset=-this._extent:this._springOffset=0,e=this._spring.x()+this._springOffset),e},l.prototype.dx=function(t){var e;return e=this._lastTime===t?this._lastDx:this._springing?this._spring.dx(t):this._friction.dx(t),this._lastTime=t,this._lastDx=e,e},l.prototype.done=function(){return this._springing?this._spring.done():this._friction.done()},l.prototype.setVelocityByEnd=function(t){this._friction.setVelocityByEnd(t)},l.prototype.configuration=function(){var t=this._friction.configuration();return t.push.apply(t,this._spring.configuration()),t},u.prototype.onTouchStart=function(){this._startPosition=this._position,this._lastChangePos=this._startPosition,this._startPosition>0?this._startPosition/=.5:this._startPosition<-this._extent&&(this._startPosition=(this._startPosition+this._extent)/.5-this._extent),this._animation&&(this._animation.cancel(),this._scrolling=!1),this.updatePosition()},u.prototype.onTouchMove=function(t,e){var i=this._startPosition;this._enableX?i+=t:this._enableY&&(i+=e),i>0?i*=.5:i<-this._extent&&(i=.5*(i+this._extent)-this._extent),this._position=i,this.updatePosition(),this.dispatchScroll()},u.prototype.onTouchEnd=function(t,e,i){var n=this;if(this._enableSnap&&this._position>-this._extent&&this._position<0){if(this._enableY&&(Math.abs(e)<this._itemSize&&Math.abs(i.y)<300||Math.abs(i.y)<150))return void this.snap();if(this._enableX&&(Math.abs(t)<this._itemSize&&Math.abs(i.x)<300||Math.abs(i.x)<150))return void this.snap()}if(this._enableX?this._scroll.set(this._position,i.x):this._enableY&&this._scroll.set(this._position,i.y),this._enableSnap){var s=this._scroll._friction.x(100),r=s%this._itemSize,o=Math.abs(r)>this._itemSize/2?s-(this._itemSize-Math.abs(r)):s-r;o<=0&&o>=-this._extent&&this._scroll.setVelocityByEnd(o)}this._lastTime=Date.now(),this._lastDelay=0,this._scrolling=!0,this._lastChangePos=this._position,this._lastIdx=Math.floor(Math.abs(this._position/this._itemSize)),this._animation=function(t,e,i){var n={id:0,cancelled:!1};return function t(e,i,n,s){if(!e||!e.cancelled){n(i);var r=i.done();r||e.cancelled||(e.id=requestAnimationFrame(t.bind(null,e,i,n,s))),r&&s&&s(i)}}(n,t,e,i),{cancel:function(t){t&&t.id&&cancelAnimationFrame(t.id),t&&(t.cancelled=!0)}.bind(null,n),model:t}}(this._scroll,function(){var t=Date.now(),e=(t-n._scroll._startTime)/1e3,i=n._scroll.x(e);n._position=i,n.updatePosition();var s=n._scroll.dx(e);n._shouldDispatchScrollEvent&&t-n._lastTime>n._lastDelay&&(n.dispatchScroll(),n._lastDelay=Math.abs(2e3/s),n._lastTime=t)},function(){n._enableSnap&&(o<=0&&o>=-n._extent&&(n._position=o,n.updatePosition()),"function"==typeof n._options.onSnap&&n._options.onSnap(Math.floor(Math.abs(n._position)/n._itemSize))),n._shouldDispatchScrollEvent&&n.dispatchScroll(),n._scrolling=!1})},u.prototype.onTransitionEnd=function(){this._element.style.transition="",this._element.style.webkitTransition="",this._element.removeEventListener("transitionend",this._onTransitionEnd),this._element.removeEventListener("webkitTransitionEnd",this._onTransitionEnd),this._snapping&&(this._snapping=!1),this.dispatchScroll()},u.prototype.snap=function(){var t=this._itemSize,e=this._position%t,i=Math.abs(e)>this._itemSize/2?this._position-(t-Math.abs(e)):this._position-e;this._position!==i&&(this._snapping=!0,this.scrollTo(-i),"function"==typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize)))},u.prototype.scrollTo=function(t,e){this._animation&&(this._animation.cancel(),this._scrolling=!1),"number"==typeof t&&(this._position=-t),this._position<-this._extent?this._position=-this._extent:this._position>0&&(this._position=0),this._element.style.transition="transform "+(e||.2)+"s ease-out",this._element.style.webkitTransition="-webkit-transform "+(e||.2)+"s ease-out",this.updatePosition(),this._element.addEventListener("transitionend",this._onTransitionEnd),this._element.addEventListener("webkitTransitionEnd",this._onTransitionEnd)},u.prototype.dispatchScroll=function(){if("function"==typeof this._options.onScroll&&Math.floor(this._lastPos)!==Math.floor(this._position)){this._lastPos=this._position;var t={target:{scrollLeft:this._enableX?-this._position:0,scrollTop:this._enableY?-this._position:0,scrollHeight:this._scrollHeight||this._element.offsetHeight,scrollWidth:this._scrollWidth||this._element.offsetWidth,offsetHeight:this._element.parentElement.offsetHeight,offsetWidth:this._element.parentElement.offsetWidth}};this._options.onScroll(t)}},u.prototype.update=function(t,e,i){var n=0,s=this._position;this._enableX?(n=this._element.childNodes.length?(e||this._element.offsetWidth)-this._element.parentElement.offsetWidth:0,this._scrollWidth=e):(n=this._element.childNodes.length?(e||this._element.offsetHeight)-this._element.parentElement.offsetHeight:0,this._scrollHeight=e),"number"==typeof t&&(this._position=-t),this._position<-n?this._position=-n:this._position>0&&(this._position=0),this._itemSize=i||this._itemSize,this.updatePosition(),s!==this._position&&(this.dispatchScroll(),"function"==typeof this._options.onSnap&&this._options.onSnap(Math.floor(Math.abs(this._position)/this._itemSize))),this._extent=n,this._scroll._extent=n},u.prototype.updatePosition=function(){var t="";this._enableX?t="translateX("+this._position+"px) translateZ(0)":this._enableY&&(t="translateY("+this._position+"px) translateZ(0)"),this._element.style.webkitTransform=t,this._element.style.transform=t},u.prototype.isScrolling=function(){return this._scrolling||this._snapping};var p,f={name:"SPickerViewColumn",mixins:[r,{methods:{initScroller:function(t,e){this._touchInfo={trackingID:-1,maxDy:0,maxDx:0},this._scroller=new u(t,e),this.__handleTouchStart=this._handleTouchStart.bind(this),this.__handleTouchMove=this._handleTouchMove.bind(this),this.__handleTouchEnd=this._handleTouchEnd.bind(this),this._initedScroller=!0},_findDelta:function(t){var e=this._touchInfo;return"move"===t.detail.state||"end"===t.detail.state?{x:t.detail.dx,y:t.detail.dy}:{x:t.screenX-e.x,y:t.screenY-e.y}},_handleTouchStart:function(t){var e=this._touchInfo,i=this._scroller;i&&("start"===t.detail.state?(e.trackingID="touch",e.x=t.detail.x,e.y=t.detail.y):(e.trackingID="mouse",e.x=t.screenX,e.y=t.screenY),e.maxDx=0,e.maxDy=0,e.historyX=[0],e.historyY=[0],e.historyTime=[t.detail.timeStamp],e.listener=i,i.onTouchStart&&i.onTouchStart())},_handleTouchMove:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var i=this._findDelta(t);if(i){for(e.maxDy=Math.max(e.maxDy,Math.abs(i.y)),e.maxDx=Math.max(e.maxDx,Math.abs(i.x)),e.historyX.push(i.x),e.historyY.push(i.y),e.historyTime.push(t.detail.timeStamp);e.historyTime.length>10;)e.historyTime.shift(),e.historyX.shift(),e.historyY.shift();e.listener&&e.listener.onTouchMove&&e.listener.onTouchMove(i.x,i.y,t.detail.timeStamp)}}},_handleTouchEnd:function(t){var e=this._touchInfo;if(-1!==e.trackingID){t.preventDefault();var i=this._findDelta(t);if(i){var n=e.listener;e.trackingID=-1,e.listener=null;var s={x:0,y:0};if(e.historyTime.length>2)for(var r=e.historyTime.length-1,o=e.historyTime[r],a=e.historyX[r],h=e.historyY[r];r>0;){r--;var c=o-e.historyTime[r];if(c>30&&c<50){s.x=(a-e.historyX[r])/(c/1e3),s.y=(h-e.historyY[r])/(c/1e3);break}}e.historyTime=[],e.historyX=[],e.historyY=[],n&&n.onTouchEnd&&n.onTouchEnd(i.x,i.y,s)}}}}}],components:{ResizeSensor:i(4).default},data:function(){return{scope:"picker-view-column-".concat(Date.now()),inited:!1,indicatorStyle:"",indicatorClass:"",indicatorHeight:34,maskStyle:"",maskClass:"",current:this.$parent.getItemValue(this),length:0}},computed:{height:function(){return this.$parent.height},maskSize:function(){return(this.height-this.indicatorHeight)/2}},watch:{indicatorHeight:function(t){this._setItemHeight(t),this.inited&&this.update()},current:function(t){this.$parent.setItemValue(this,t)},length:function(t){this.inited&&this.update(t)}},created:function(){var t=this.$parent;this.indicatorStyle=t.indicatorStyle,this.indicatorClass=t.indicatorClass,this.maskStyle=t.maskStyle,this.maskClass=t.maskClass,this.deltaY=0},mounted:(p=Object(n.a)(regeneratorRuntime.mark(function t(){var e=this;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:this.touchtrack(this.$refs.main,"_handleTrack",!0),this.setCurrent(this.current),this.$nextTick(function(){e.init(),e.update()}),d(this.$el,this._handleTap.bind(this));case 4:case"end":return t.stop()}},t,this)})),function(){return p.apply(this,arguments)}),methods:{_setItemHeight:function(t){var e=document.createElement("style");e.innerText=".s-picker-view-content.".concat(this.scope,">*{height: ").concat(t,"px;line-height: ").concat(t,"px;overflow: hidden;}"),document.head.appendChild(e)},_handleTrack:function(t){if(this._scroller)switch(t.detail.state){case"start":this._handleTouchStart(t);break;case"move":this._handleTouchMove(t);break;case"end":case"cancel":this._handleTouchEnd(t)}},_handleTap:function(t){var e=t.clientY;if(!this._scroller.isScrolling()){var i=e-this.$el.getBoundingClientRect().top-this.height/2,n=this.indicatorHeight/2;if(!(Math.abs(i)<=n)){var s=Math.ceil((Math.abs(i)-n)/this.indicatorHeight),r=i<0?-s:s,o=Math.min(this.current+r,this.length-1);this.current=o=Math.max(o,0),this._scroller.scrollTo(o*this.indicatorHeight)}}},_handleWheel:function(t){var e=this.deltaY+t.deltaY;if(Math.abs(e)>10){this.deltaY=0;var i=Math.min(this.current+(e<0?-1:1),this.length-1);this.current=i=Math.max(i,0),this._scroller.scrollTo(i*this.indicatorHeight)}else this.deltaY=e;t.preventDefault()},setCurrent:function(t){t!==this.current&&(this.current=t,this.inited&&this.update())},init:function(){var t=this;this.initScroller(this.$refs.content,{enableY:!0,enableX:!1,enableSnap:!0,itemSize:this.indicatorHeight,friction:new o(1e-4),spring:new c(2,90,20),onSnap:function(e){isNaN(e)||e===t.current||(t.current=e)}}),this.inited=!0},update:function(){var t=this;this.$nextTick(function(){var e=Math.min(t.current,t.length-1);e=Math.max(e,0),t._scroller.update(e*t.indicatorHeight,void 0,t.indicatorHeight)})},_resize:function(t){var e=t.height;this.indicatorHeight=e}},render:function(t){return this.length=this.$slots.default&&this.$slots.default.length||0,t("div",{on:{wheel:this._handleWheel},class:"s-picker-view-column"},[t("div",{ref:"main",staticClass:"s-picker-view-group"},[t("div",{ref:"mask",staticClass:"s-picker-view-mask",class:this.maskClass,style:"background-size: 100% ".concat(this.maskSize,"px;").concat(this.maskStyle)}),t("div",{ref:"indicator",staticClass:"s-picker-view-indicator",class:this.indicatorClass,style:this.indicatorStyle},[t("resize-sensor",{attrs:{initial:!0},on:{resize:this._resize}})]),t("div",{ref:"content",staticClass:"s-picker-view-content",class:this.scope,style:"padding: ".concat(this.maskSize,"px 0;")},[this.$slots.default])])])}},_=i(0),m=Object(_.a)(f,void 0,void 0,!1,null,null,null);m.options.__file="packages/picker-view-column/main.vue";var v=m.exports;v.install=function(t){t.component(v.name,v)};e.default=v},function(t,e,i){"use strict";i.r(e);i(1),i(16);var n=i(5),s={name:"SPickerView",components:{ResizeSensor:i(4).default},props:{value:{type:Array,default:function(){return[]},validator:function(t){return Array.isArray(t)&&t.filter(function(t){return"number"==typeof t}).length===t.length}},indicatorStyle:{type:String,default:""},indicatorClass:{type:String,default:""},maskStyle:{type:String,default:""},maskClass:{type:String,default:""}},data:function(){return{valueSync:Object(n.a)(this.value),height:34,items:[],changeSource:""}},watch:{value:function(t){var e=this;this.valueSync.length=t.length,t.forEach(function(t,i){t!==e.valueSync[i]&&e.$set(e.valueSync,i,t)})},valueSync:{deep:!0,handler:function(t){if(""===this.changeSource)this._valueChanged(t);else{this.changeSource="";var e=Object(n.a)(t);this.$emit("update:value",e),this.$emit("change",e)}}}},methods:{getItemIndex:function(t){return this.items.indexOf(t)},getItemValue:function(t){return this.valueSync[this.getItemIndex(t.$vnode)]||0},setItemValue:function(t,e){var i=this.getItemIndex(t.$vnode);this.valueSync[i]!==e&&(this.changeSource="touch",this.$set(this.valueSync,i,e))},_valueChanged:function(t){this.items.forEach(function(e,i){e.componentInstance.setCurrent(t[i]||0)})},_resize:function(t){var e=t.height;this.height=e}},render:function(t){var e=[];return this.$slots.default&&this.$slots.default.forEach(function(t){t.componentOptions&&"picker-view-column"===t.componentOptions.tag&&e.push(t)}),this.items=e,t("div",{on:this.$listeners,class:"s-picker-view"},[t("resize-sensor",{attrs:{initial:!0},on:{resize:this._resize}}),t("div",{ref:"wrapper",class:"s-picker-view-wrapper"},e)])}},r=i(0),o=Object(r.a)(s,void 0,void 0,!1,null,null,null);o.options.__file="packages/picker-view/main.vue";var a=o.exports;a.install=function(t){t.component(a.name,a)};e.default=a},function(t,e){t.exports=require("core-js/modules/web.dom.iterable")},function(t,e){t.exports=require("core-js/library/fn/array/is-array")},function(t,e){t.exports=require("core-js/library/fn/array/from")},function(t,e){t.exports=require("core-js/library/fn/is-iterable")},function(t,e){t.exports=require("core-js/modules/es6.number.constructor")},function(t,e,i){t.exports=i(23)},function(t,e,i){t.exports=i(31)},function(t,e){t.exports=require("core-js/library/fn/get-iterator")},,function(t,e,i){t.exports=i(32)},,,,function(t,e){t.exports=require("core-js/modules/es6.array.find-index")},function(t,e){t.exports=require("core-js/modules/es6.regexp.match")},function(t,e){t.exports=require("core-js/library/fn/reflect/construct")},function(t,e){t.exports=require("core-js/library/fn/object/set-prototype-of")},function(t,e){t.exports=require("core-js/modules/es6.array.sort")},function(t,e){t.exports=require("core-js/modules/es6.array.fill")},,,,function(t,e,i){"use strict";i.r(e);i(1);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("van-popup",{staticClass:"s-calendar-box",attrs:{value:t.value,position:"bottom"},on:{input:function(e){return t.$emit("input",e)}}},[i("div",{staticClass:"s-calendar"},[i("div",{staticClass:"s-calendar-header"},[0===t.type?i("div",{staticClass:"s-calendar-header--date"},[i("p",[t._v(t._s(t.currentSolar[0].hans)+"年")]),i("p",[t._v(t._s(t.currentSolar[1].hans)+"月"+t._s(t.currentSolar[2].hans)+"日")])]):i("div",{staticClass:"s-calendar-header--date"},[i("p",[t._v(t._s(t.currentLunar[0].hans)+t._s(t.currentLunar[1]?t.currentLunar[1].hans:""))]),i("p",[t._v(t._s(t.currentLunar[2]?t.currentLunar[2].hans:""))])]),i("div",{staticClass:"s-calendar-header--btn-group"},t._l(t.dateList,function(e,n){return i("div",{key:n,staticClass:"s-calendar-header--btn",class:["s-calendar-header--btn__"+n],style:[n===t.type?{color:"#fff",background:t.color,borderColor:t.color}:{}],on:{click:function(e){return e.stopPropagation(),t.handleCalendarChange(n)}}},[t._v("\n "+t._s(e)+"\n ")])}),0)]),i("div",{staticClass:"s-calendar-content"},[0===t.type?i("picker-view",{staticClass:"s-calendar-content--picker",attrs:{value:t.solarTime,"indicator-class":"ignore-calendar-indicator","mask-style":"opacity:0.5"},on:{change:t.handleSolarDateChange}},[i("picker-view-column",t._l(t.solarYears,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[0]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"年\n ")])}),0),i("picker-view-column",t._l(t.solarMonths,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[1]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"月\n ")])}),0),i("picker-view-column",t._l(t.solarDates,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[2]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"日\n ")])}),0),t.hasDateTime?[i("picker-view-column",t._l(t.hours,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[3]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0),i("picker-view-column",t._l(t.minutes,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.solarTime[4]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0)]:t._e()],2):i("picker-view",{staticClass:"s-calendar-content--picker",attrs:{value:t.lunarTime,"indicator-class":"ignore-calendar-indicator","mask-style":"opacity:0.5"},on:{change:t.handleLunarDateChange}},[i("picker-view-column",t._l(t.lunarYears,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[0]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e.hans)+"\n ")])}),0),i("picker-view-column",t._l(t.lunarMonths,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[1]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e.hans)+"\n ")])}),0),i("picker-view-column",t._l(t.lunarDates,function(e,n){return i("div",{key:n,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[2]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e.hans)+"\n ")])}),0),t.hasDateTime?[i("picker-view-column",t._l(t.hours,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[3]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0),i("picker-view-column",t._l(t.minutes,function(e,n){return i("div",{key:e,staticClass:"ignore-calendar-content--picker-item",style:[n===t.lunarTime[4]?{color:t.color,fontWeight:600}:{}]},[t._v("\n "+t._s(e)+"\n ")])}),0)]:t._e()],2)],1),i("div",{staticClass:"s-calendar-footer"},[i("div",{staticClass:"s-calendar-footer--btn s-calendar-footer--cancel",on:{click:t.handleCancel}},[t._v("\n 取消\n ")]),i("div",{staticClass:"s-calendar-footer--btn",style:{background:t.color,color:"#fff",borderColor:t.color},on:{click:t.handleSubmit}},[t._v("\n 确定\n ")])])])])};n._withStripped=!0;i(29),i(13),i(30);var s=i(22),r=i.n(s),o=i(25),a=i.n(o);function h(t,e){return(h=a.a||function(t,e){return t.__proto__=e,t})(t,e)}function c(t,e,i){return(c=function(){if("undefined"==typeof Reflect||!r.a)return!1;if(r.a.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(r()(Date,[],function(){})),!0}catch(t){return!1}}()?r.a:function(t,e,i){var n=[null];n.push.apply(n,e);var s=new(Function.bind.apply(t,n));return i&&h(s,i.prototype),s}).apply(null,arguments)}var l=i(3),u=(i(33),i(20),i(34),i(5)),d=i(8),p=i(15),f=i(14),_=function(t,e){return["未知"].concat(Object(u.a)(new Array(t).fill().map(function(t,i){return"".concat(i).concat(e)})))};function m(t){for(var e="";t>0;)e="〇一二三四五六七八九"[t%10]+e,t=Math.floor(t/10);return e}function v(t,e){return 2!==e?[0,31,0,31,30,31,30,31,31,30,31,30,31][e]:t%400?t%100?t%4?28:29:28:29}function g(t){var e=Object(d.leapMonthOfYear)(t),i=Object(u.a)(Array(12)).map(function(t,e){return{month:e+1,leap:!1}});return e&&(i=i.concat({month:e,leap:!0}).sort(function(t,e){return t.month-e.month})),i.map(function(t){return Object.assign({},t,{hans:Object(d.monthName)(t.month,!0,t.leap)})})}function y(t,e,i){for(var n=function(t,e,i){var n=Object(d.lunarToSolar)(t,e,1,i);return Object(d.leapMonthOfYear)(t)!==e||i?12===e?(t+=1,e=1):(i=!1,e+=1):i=!0,(Object(d.lunarToSolar)(t,e,1,i).valueOf()-n.valueOf())/864e5}(t,e,i),s=[],r=1;r<=n;r+=1)s.push({date:r,hans:Object(d.dayName)(r)});return s}function x(t){return t<10?"0".concat(t):"".concat(t)}var b=_(24,"时"),T=_(60,"分"),S=function(){for(var t=(new Date).getFullYear(),e=[],i=1930;i<=t;i++)e.push(i);return e}(),w=function(t){for(var e=Number(Object(d.solarToLunar)(new Date(t[0],0,1),"y")),i=Number(Object(d.solarToLunar)(new Date(t[t.length-1],11,31),"y")),n=[],s=e;s<=i;s+=1)n.push({year:s,hans:m(s)});return n}(S),k={name:"SCalendar",components:{PickerView:p.default,PickerViewColumn:f.default},props:{defaultDate:{type:Array,required:!1,default:function(){var t=new Date;return[t.getFullYear(),t.getMonth()+1,t.getDate(),1,1]}},defaultTime:{type:Array,required:!1,default:function(){return[-1,-1]}},isLunar:{type:Boolean,required:!1,dafault:!0},value:{type:Boolean,default:!1},defaultType:{type:Number,default:0},color:{type:String,default:"#522273"},dateType:{type:String,default:"date"}},data:function(){return{solarValue:[-1,-1,-1],solarYears:S,solarMonths:12,solarDates:31,lunarValue:[-1,-1,-1],lunarYears:w,lunarMonths:[],lunarDates:[],type:0,hours:b,minutes:T,dateList:["公历","农历"],currentTime:[-1,-1]}},computed:{solarTime:function(){var t=Object(l.a)(this.currentTime,2),e=t[0],i=void 0===e?0:e,n=t[1],s=void 0===n?0:n;return this.solarValue.concat(i,s)},lunarTime:function(){var t=Object(l.a)(this.currentTime,2),e=t[0],i=void 0===e?0:e,n=t[1],s=void 0===n?0:n;return this.lunarValue.concat(i,s)},currentSolar:function(){var t=Object(l.a)(this.solarValue,3),e=t[0],i=t[1],n=t[2],s=this.solarYears[e]||this.solarYears[0],r=i+1,o=n+1;return[{hans:x(s),year:s},{hans:x(r),month:r},{hans:x(o),date:o}]},currentLunar:function(){var t=Object(l.a)(this.lunarValue,3),e=t[0],i=t[1],n=t[2];return[this.lunarYears[e]||this.lunarYears[0],this.lunarMonths[i]||this.lunarMonths[0],this.lunarDates[n]||this.lunarDates[0]]},hasDateTime:function(){return"datetime"===this.dateType}},mounted:function(){this.currentTime=this.defaultTime,this.initDate()},methods:{cancal:function(){this.$emit("input",!1)},handleSubmit:function(){var t={solar:this.currentSolar,lunar:this.currentLunar,type:this.type,time:[0,0]};if(this.hasDateTime){var e=Object(l.a)(this.currentTime,2),i=e[0],n=void 0===i?0:i,s=e[1],r=void 0===s?0:s;0===n&&(n=1),0===r&&(r=1),t.time=[n-1,r-1]}var o=c(Date,[this.currentSolar[0].year,this.currentSolar[1].month-1,this.currentSolar[2].date].concat(Object(u.a)(t.time))),a=+o;o.toString().match(/\+0900/)&&(a+=36e5),this.cancal(),this.$emit("change",t,a)},handleCancel:function(){this.cancal(),this.$emit("cancel")},initDate:function(){var t=Object(l.a)(this.defaultDate,3),e=t[0],i=t[1],n=t[2];this.type=this.defaultType;var s=this.solarYears.findIndex(function(t){return t===e});this.handleSolarDateChange([s,i-1,n-1],!0)},handleCalendarChange:function(t){this.type=t},handleSolarDateChange:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=Object(l.a)(t,5),r=s[0],o=s[1],a=s[2],h=s[3],c=s[4],u=Object(l.a)(this.solarValue,3),d=u[0],p=u[1],f=u[2];if(i||r!==d||o!==p){var _=this.solarYears[r],m=o+1;this.solarDates=v(_,m)}this.$nextTick().then(function(){e.solarValue=[r,o,a],e.currentTime=[h,c]}),!n||r===d&&o===p&&a===f||this.$nextTick().then(function(){var t=Object(l.a)(e.currentSolar,3),i=t[0].year,n=t[1].month,s=t[2].date;e.findLunarValue(i,n,s)})},handleLunarDateChange:function(t){var e=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=Object(l.a)(t,5),r=s[0],o=s[1],a=s[2],h=s[3],c=s[4],u=Object(l.a)(this.lunarValue,3),d=u[0],p=u[1],f=u[2];if((i||r!==d)&&(this.lunarMonths=g(this.lunarYears[r].year)),i||r!==d||o!==p){var _=this.lunarYears[r].year,m=this.lunarMonths[o],v=m.month,x=m.leap;this.lunarDates=y(_,v,x)}this.$nextTick().then(function(){e.lunarValue=[r,o,a],e.currentTime=[h,c]}),!n||r===d&&o===p&&a===f||this.$nextTick().then(function(){var t=Object(l.a)(e.currentLunar,3),i=t[0],n=(i=void 0===i?{}:i).year,s=void 0===n?1989:n,r=t[1],o=(r=void 0===r?{}:r).month,a=void 0===o?12:o,h=r.leap,c=void 0!==h&&h,u=t[2],d=(u=void 0===u?{}:u).date,p=void 0===d?5:d;e.findSolarValue(s,a,p,c)})},findSolarValue:function(t,e,i,n){var s=Object(d.lunarToSolar)(t,e,i,n),r=s.getFullYear(),o=s.getMonth(),a=s.getDate()-1,h=this.solarYears.findIndex(function(t){return t===r});this.handleSolarDateChange([h,o,a].concat(Object(u.a)(this.currentTime)),!0,!1)},findLunarValue:function(t,e,i){var n=Object(d.solarToLunar)(new Date(t,e-1,i,0,0,0)),s=n.leap,r=n.year,o=n.month,a=n.day,h=n.leapMonth,c=this.lunarYears.findIndex(function(t){return t.year===r}),l=h&&(s||o>h)?o:o-1,p=a-1;this.handleLunarDateChange([c,l,p].concat(Object(u.a)(this.currentTime)),!0,!1)}}},D=i(0),M=Object(D.a)(k,n,[],!1,null,null,null);M.options.__file="packages/calendar/main.vue";var C=M.exports;C.install=function(t){t.component(C.name,C)};e.default=C}]);

@@ -1,1 +0,1 @@

module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=41)}({1:function(e,t){e.exports=require("core-js/modules/es6.function.name")},20:function(e,t){e.exports=require("core-js/modules/es6.number.constructor")},26:function(e,t){e.exports=require("html2canvas")},27:function(e,t){e.exports=require("vue")},41:function(e,t,n){"use strict";n.r(t);n(1),n(20);var r=n(26),o=n.n(r),i={name:"SCanvasImg",props:{scale:{type:[Number,String],default:2}},data:function(){return{src:""}},render:function(e){return e("div",{class:"s-canvas-image"},this.src?[e("img",{attrs:{src:this.src},style:{width:"100%"}})]:this.$slots.default)},methods:{draw:function(){var e=this,t=this.$el,n=document.createElement("canvas"),r=t.offsetWidth,i=t.offsetHeight,a=this.scale;n.width=r*a,n.height=i*a,n.style.width="".concat(r,"px"),n.style.height="".concat(i,"px"),o()(t,{width:r,height:i,scale:a,useCORS:!0,canvas:n,scrollX:0,scrollY:0,imageTimeout:0}).then(function(t){var n=t.toDataURL("image/jpeg",1);console.log(n),e.src=n,e.$emit("drawed",n)}).catch(function(t){console.error(t),e.$emit("drawed",null)})}}},a=n(27),c=n.n(a).a.extend(),s=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:4,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return new Promise(function(o){var a=new c({el:document.createElement("div"),render:function(a){var c=this;return a(i,{ref:"canvasImage",props:{scale:n},class:{"s-canvas-to-imgae--debug":r},staticClass:"s-canvas-to-image",on:{drawed:function(e){o(e),c.$destroy(),document.body.removeChild(c.$el)}}},[a(e,{props:t})])}}).$mount();a.$nextTick(function(){console.log(a.$el.innerHTML,"html"),document.body.appendChild(a.$el),r||a.$refs.canvasImage.draw()})})};i.install=function(e){e.prototype.$genImage=s,e.component(i.name,i)};t.default=i}});
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=41)}({1:function(e,t){e.exports=require("core-js/modules/es6.function.name")},20:function(e,t){e.exports=require("core-js/modules/es6.number.constructor")},26:function(e,t){e.exports=require("html2canvas")},27:function(e,t){e.exports=require("vue")},41:function(e,t,n){"use strict";n.r(t);n(1),n(20);var r=n(26),o=n.n(r),a={name:"SCanvasImg",props:{scale:{type:[Number,String],default:2}},data:function(){return{src:""}},render:function(e){return e("div",{class:"s-canvas-image"},this.src?[e("img",{attrs:{src:this.src},style:{width:"100%"}})]:this.$slots.default)},methods:{draw:function(){var e=this,t=this.$el,n=document.createElement("canvas"),r=t.offsetWidth,a=t.offsetHeight,i=this.scale;n.width=r*i,n.height=a*i,n.style.width="".concat(r,"px"),n.style.height="".concat(a,"px"),o()(t,{width:r,height:a,scale:i,useCORS:!0,canvas:n,scrollX:0,scrollY:0,imageTimeout:0}).then(function(t){var n=t.toDataURL("image/jpeg",1);console.log(n),e.src=n,e.$emit("drawed",n)}).catch(function(t){console.error(t),e.$emit("drawed",null)})}}},i=n(27),c=n.n(i).a.extend(),s=function(e,t,n){var r=n.scale,o=void 0===r?4:r,i=n.debug,s=void 0!==i&&i;return new Promise(function(n){var r=new c({el:document.createElement("div"),render:function(r){var i=this;return r(a,{ref:"canvasImage",props:{scale:o},class:{"s-canvas-to-imgae--debug":s},staticClass:"s-canvas-to-image",on:{drawed:function(e){n(e),i.$destroy(),document.body.removeChild(i.$el)}}},[r(e,{props:t})])}}).$mount();r.$nextTick(function(){document.body.appendChild(r.$el),s?n():r.$refs.canvasImage.draw()})})};a.install=function(e){e.prototype.$genImage=s,e.component(a.name,a)};t.default=a}});
{
"name": "sums-components",
"version": "0.3.2",
"version": "0.3.4",
"private": false,

@@ -5,0 +5,0 @@ "main": "lib/sums-components.umd.min.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc