@@ -109,6 +109,9 @@ export default {
}
},
methods: {
+ selectDate (date) {
+
+ },
closePopup () {
this.showPopup = false
},
diff --git a/src/datepicker/languages.js b/datepicker/languages.js
similarity index 100%
rename from src/datepicker/languages.js
rename to datepicker/languages.js
diff --git a/dist/build.js b/dist/build.js
deleted file mode 100644
index b5feeab..0000000
--- a/dist/build.js
+++ /dev/null
@@ -1,6 +0,0 @@
-!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=9)}([function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e
n.parts.length&&(r.parts.length=n.parts.length)}else{for(var i=[],o=0;o-1)return t.splice(n,1)}}function p(t,e){return Qn.call(t,e)}function h(t){var e=Object.create(null);return function(n){return e[n]||(e[n]=t(n))}}function v(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function m(t,e){e=e||0;for(var n=t.length-e,r=new Array(n);n--;)r[n]=t[n+e];return r}function g(t,e){for(var n in e)t[n]=e[n];return t}function y(t){for(var e={},n=0;n=0&&Rr[n].id>t.id;)n--;Rr.splice(Math.max(n,Hr)+1,0,t)}else Rr.push(t);zr||(zr=!0,xr(Ct))}}function St(t){Qr.clear(),Dt(t,Qr)}function Dt(t,e){var n,r,o=Array.isArray(t);if((o||i(t))&&Object.isExtensible(t)){if(t.__ob__){var a=t.__ob__.dep.id;if(e.has(a))return;e.add(a)}if(o)for(n=t.length;n--;)Dt(t[n],e);else for(r=Object.keys(t),n=r.length;n--;)Dt(t[r[n]],e)}}function Et(t,e,n){Wr.get=function(){return this[e][n]},Wr.set=function(t){this[e][n]=t},Object.defineProperty(t,n,Wr)}function Pt(t){t._watchers=[];var e=t.$options;e.props&&Mt(t,e.props),e.methods&&Lt(t,e.methods),e.data?jt(t):M(t._data={},!0),e.computed&&It(t,e.computed),e.watch&&Rt(t,e.watch)}function Mt(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[],a=!t.$parent;Dr.shouldConvert=a;for(var i in e)!function(a){o.push(a);var i=H(a,e,n,t);j(r,a,i),a in t||Et(t,"_props",a)}(i);Dr.shouldConvert=!0}function jt(t){var e=t.$options.data;e=t._data="function"==typeof e?Tt(e,t):e||{},s(e)||(e={});for(var n=Object.keys(e),r=t.$options.props,o=n.length;o--;)r&&p(r,n[o])||C(n[o])||Et(t,"_data",n[o]);M(e,!0)}function Tt(t,e){try{return t.call(e)}catch(t){return $(t,e,"data()"),{}}}function It(t,e){var n=t._computedWatchers=Object.create(null);for(var r in e){var o=e[r],a="function"==typeof o?o:o.get;n[r]=new qr(t,a,_,Jr),r in t||Nt(t,r,o)}}function Nt(t,e,n){"function"==typeof n?(Wr.get=Vt(e),Wr.set=_):(Wr.get=n.get?!1!==n.cache?Vt(e):n.get:_,Wr.set=n.set?n.set:_),Object.defineProperty(t,e,Wr)}function Vt(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),Ar.target&&e.depend(),e.value}}function Lt(t,e){t.$options.props;for(var n in e)t[n]=null==e[n]?_:v(e[n],t)}function Rt(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var o=0;o=0||n.indexOf(t[o])<0)&&r.push(t[o]);return r}return t}function he(t){this._init(t)}function ve(t){t.use=function(t){if(!t.installed){var e=m(arguments,1);return e.unshift(this),"function"==typeof t.install?t.install.apply(t,e):"function"==typeof t&&t.apply(null,e),t.installed=!0,this}}}function me(t){t.mixin=function(t){this.options=z(this.options,t)}}function ge(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var a=t.name||n.options.name,i=function(t){this._init(t)};return i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.cid=e++,i.options=z(n.options,t),i.super=n,i.options.props&&ye(i),i.options.computed&&_e(i),i.extend=n.extend,i.mixin=n.mixin,i.use=n.use,tr.forEach(function(t){i[t]=n[t]}),a&&(i.options.components[a]=i),i.superOptions=n.options,i.extendOptions=t,i.sealedOptions=g({},i.options),o[r]=i,i}}function ye(t){var e=t.options.props;for(var n in e)Et(t.prototype,"_props",n)}function _e(t){var e=t.options.computed;for(var n in e)Nt(t.prototype,n,e[n])}function be(t){tr.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&s(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"==typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function we(t){return t&&(t.Ctor.options.name||t.tag)}function xe(t,e){return"string"==typeof t?t.split(",").indexOf(e)>-1:!!c(t)&&t.test(e)}function Ce(t,e,n){for(var r in t){var o=t[r];if(o){var a=we(o.componentOptions);a&&!n(a)&&(o!==e&&Ae(o),t[r]=null)}}}function Ae(t){t&&t.componentInstance.$destroy()}function ke(t){for(var e=t.data,n=t,o=t;r(o.componentInstance);)o=o.componentInstance._vnode,o.data&&(e=$e(o.data,e));for(;r(n=n.parent);)n.data&&(e=$e(e,n.data));return Oe(e)}function $e(t,e){return{staticClass:Se(t.staticClass,e.staticClass),class:r(t.class)?[t.class,e.class]:e.class}}function Oe(t){var e=t.class,n=t.staticClass;return r(n)||r(e)?Se(n,De(e)):""}function Se(t,e){return t?e?t+" "+e:t:e||""}function De(t){if(n(t))return"";if("string"==typeof t)return t;var e="";if(Array.isArray(t)){for(var o,a=0,s=t.length;a-1?bo[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:bo[t]=/HTMLUnknownElement/.test(e.toString())}function Me(t){if("string"==typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function je(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function Te(t,e){return document.createElementNS(mo[t],e)}function Ie(t){return document.createTextNode(t)}function Ne(t){return document.createComment(t)}function Ve(t,e,n){t.insertBefore(e,n)}function Le(t,e){t.removeChild(e)}function Re(t,e){t.appendChild(e)}function Be(t){return t.parentNode}function Ue(t){return t.nextSibling}function ze(t){return t.tagName}function Fe(t,e){t.textContent=e}function He(t,e,n){t.setAttribute(e,n)}function Ye(t,e){var n=t.data.ref;if(n){var r=t.context,o=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?f(a[n],o):a[n]===o&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])&&a[n].indexOf(o)<0?a[n].push(o):a[n]=[o]:a[n]=o}}function qe(t,e){return t.key===e.key&&t.tag===e.tag&&t.isComment===e.isComment&&r(t.data)===r(e.data)&&Qe(t,e)}function Qe(t,e){if("input"!==t.tag)return!0;var n;return(r(n=t.data)&&r(n=n.attrs)&&n.type)===(r(n=e.data)&&r(n=n.attrs)&&n.type)}function We(t,e,n){var o,a,i={};for(o=e;o<=n;++o)a=t[o].key,r(a)&&(i[a]=o);return i}function Je(t,e){(t.data.directives||e.data.directives)&&Ke(t,e)}function Ke(t,e){var n,r,o,a=t===Co,i=e===Co,s=Ge(t.data.directives,t.context),c=Ge(e.data.directives,e.context),u=[],l=[];for(n in c)r=s[n],o=c[n],r?(o.oldValue=r.value,Xe(o,"update",e,t),o.def&&o.def.componentUpdated&&l.push(o)):(Xe(o,"bind",e,t),o.def&&o.def.inserted&&u.push(o));if(u.length){var d=function(){for(var n=0;n-1?e.split(/\s+/).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function gn(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(/\s+/).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e);else{for(var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";n.indexOf(r)>=0;)n=n.replace(r," ");t.setAttribute("class",n.trim())}}function yn(t){if(t){if("object"==typeof t){var e={};return!1!==t.css&&g(e,Uo(t.name||"v")),g(e,t),e}return"string"==typeof t?Uo(t):void 0}}function _n(t){Jo(function(){Jo(t)})}function bn(t,e){(t._transitionClasses||(t._transitionClasses=[])).push(e),mn(t,e)}function wn(t,e){t._transitionClasses&&f(t._transitionClasses,e),gn(t,e)}function xn(t,e,n){var r=Cn(t,e),o=r.type,a=r.timeout,i=r.propCount;if(!o)return n();var s=o===Fo?qo:Wo,c=0,u=function(){t.removeEventListener(s,l),n()},l=function(e){e.target===t&&++c>=i&&u()};setTimeout(function(){c0&&(n=Fo,l=i,d=a.length):e===Ho?u>0&&(n=Ho,l=u,d=c.length):(l=Math.max(i,u),n=l>0?i>u?Fo:Ho:null,d=n?n===Fo?a.length:c.length:0),{type:n,timeout:l,propCount:d,hasTransform:n===Fo&&Ko.test(r[Yo+"Property"])}}function An(t,e){for(;t.length1}function En(t,e){!0!==e.data.show&&$n(e)}function Pn(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var a,i,s=0,c=t.options.length;s-1,i.selected!==a&&(i.selected=a);else if(b(jn(i),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function Mn(t,e){for(var n=0,r=e.length;n0,dr=cr&&cr.indexOf("edge/")>0,fr=cr&&cr.indexOf("android")>0,pr=cr&&/iphone|ipad|ipod|ios/.test(cr),hr=cr&&/chrome\/\d+/.test(cr)&&!dr,vr=!1;if(sr)try{var mr={};Object.defineProperty(mr,"passive",{get:function(){vr=!0}}),window.addEventListener("test-passive",null,mr)}catch(t){}var gr,yr,_r=function(){return void 0===gr&&(gr=!sr&&void 0!==t&&"server"===t.process.env.VUE_ENV),gr},br=sr&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__,wr="undefined"!=typeof Symbol&&O(Symbol)&&"undefined"!=typeof Reflect&&O(Reflect.ownKeys),xr=function(){function t(){r=!1;var t=n.slice(0);n.length=0;for(var e=0;e1?m(n):n;for(var r=m(arguments,1),o=0,a=n.length;o1&&(e[n[0].trim()]=n[1].trim())}}),e}),Io=/^--/,No=/\s*!important$/,Vo=function(t,e,n){if(Io.test(e))t.style.setProperty(e,n);else if(No.test(n))t.style.setProperty(e,n.replace(No,""),"important");else{var r=Ro(e);if(Array.isArray(n))for(var o=0,a=n.length;oh?(d=n(o[g+1])?null:o[g+1].elm,y(t,d,o,p,g,a)):p>g&&b(t,e,f,h)}function C(t,e,a,i){if(t!==e){if(o(e.isStatic)&&o(t.isStatic)&&e.key===t.key&&(o(e.isCloned)||o(e.isOnce)))return e.elm=t.elm,void(e.componentInstance=t.componentInstance);var s,c=e.data;r(c)&&r(s=c.hook)&&r(s=s.prepatch)&&s(t,e);var u=e.elm=t.elm,l=t.children,d=e.children;if(r(c)&&v(e)){for(s=0;sa?e.push("disabled"):r&&n>=r&&e.push("inrange")),e.join(" ")},showMonths:function(){"months"===this.currentPanel?this.currentPanel="date":this.currentPanel="months"},showYears:function(){if("years"===this.currentPanel)this.currentPanel="date";else{for(var t=10*Math.floor(this.now.getFullYear()/10),e=[],n=0;n<10;n++)e.push(t+n);this.years=e,this.currentPanel="years"}},changeYear:function(t){if("years"===this.currentPanel)this.years=this.years.map(function(e){return e+10*t});else{var e=new Date(this.now);e.setFullYear(e.getFullYear()+t),this.now=e}},changeMonth:function(t){var e=new Date(this.now);e.setMonth(e.getMonth()+t),this.now=e},selectDate:function(t){-1===this.getClasses(t).indexOf("disabled")&&this.$emit("input",t.date)},selectYear:function(t){var e=new Date(this.now);e.setFullYear(t),this.now=e,this.currentPanel="months"},selectMonth:function(t){var e=new Date(this.now);e.setMonth(t),this.now=e,this.currentPanel="date"}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(13),o=n.n(r),a=n(8);e.default={components:{CalendarPanel:o.a},props:{format:{type:String,default:"yyyy-MM-dd"},range:{type:Boolean,default:!1},width:{type:[String,Number],default:210},placeholder:String,lang:{type:String,default:"zh"},value:null},data:function(){return{showPopup:!1,showCloseIcon:!1,currentValue:this.value,position:null,ranges:[]}},watch:{value:{handler:function(t){this.range?this.currentValue=this.isValidRange(t)?t:[void 0,void 0]:this.currentValue=this.isValidDate(t)?t:void 0},immediate:!0},currentValue:function(t){(!this.range&&t||this.range&&t[0]&&t[1])&&this.$emit("input",t)},showPopup:function(t){t&&this.$nextTick(this.displayPopup)}},computed:{translation:function(){return a.a[this.lang]||a.a.en},innerPlaceholder:function(){return this.placeholder||(this.range?this.translation.placeholder.dateRange:this.translation.placeholder.date)},text:function(){return!this.range&&this.currentValue?this.stringify(this.currentValue):this.range&&this.currentValue[0]&&this.currentValue[1]?this.stringify(this.currentValue[0])+" ~ "+this.stringify(this.currentValue[1]):""}},methods:{closePopup:function(){this.showPopup=!1},togglePopup:function(){this.showPopup?(this.$refs.input.blur(),this.showPopup=!1):(this.$refs.input.focus(),this.showPopup=!0)},hoverIcon:function(t){"mouseenter"===t.type&&this.text&&(this.showCloseIcon=!0),"mouseleave"===t.type&&(this.showCloseIcon=!1)},clickIcon:function(){this.showCloseIcon?this.$emit("input",""):this.togglePopup()},formatDate:function(t,e){var n={"M+":t.getMonth()+1,"[Dd]+":t.getDate(),"[Hh]+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),S:t.getMilliseconds()},r=e.replace(/[Yy]+/g,function(e){return(""+t.getFullYear()).slice(4-e.length)});return Object.keys(n).forEach(function(t){r=r.replace(new RegExp(t),function(e){var r=""+n[t];return 1===e.length?r:("00"+r).slice(r.length)})}),r},stringify:function(t){return this.formatDate(new Date(t),this.format)},isValidDate:function(t){return!!new Date(t).getTime()},isValidRange:function(t){return Array.isArray(t)&&2===t.length&&this.isValidDate(t[0])&&this.isValidDate(t[1])},selectRange:function(t){this.$emit("input",[t.start,t.end])},initRanges:function(){var t=this;this.ranges=[{text:"未来7天",start:new Date,end:new Date(Date.now()+6048e5)},{text:"未来30天",start:new Date,end:new Date(Date.now()+2592e6)},{text:"最近7天",start:new Date(Date.now()-6048e5),end:new Date},{text:"最近30天",start:new Date(Date.now()-2592e6),end:new Date}],this.ranges.forEach(function(e,n){e.text=t.translation.pickers[n]})},displayPopup:function(){var t=document.documentElement.clientWidth,e=document.documentElement.clientHeight,n=this.$el.getBoundingClientRect(),r=this.$refs.calendar.getBoundingClientRect();this.position={},t-n.lefta[data-v-7ac78f0d]:hover{color:#1284e7}.calendar__prev-icon[data-v-7ac78f0d]{float:left}.calendar__next-icon[data-v-7ac78f0d]{float:right}.calendar-table[data-v-7ac78f0d]{width:100%;font-size:12px;table-layout:fixed;border-collapse:collapse;border-spacing:0}.calendar-table td[data-v-7ac78f0d],.calendar-table th[data-v-7ac78f0d]{width:32px;height:32px;text-align:center}.calendar-table td[data-v-7ac78f0d]{cursor:pointer}.calendar-month>a[data-v-7ac78f0d]:hover,.calendar-table td.inrange[data-v-7ac78f0d],.calendar-table td[data-v-7ac78f0d]:hover,.calendar-year>a[data-v-7ac78f0d]:hover{background-color:#eaf8fe}.calendar-month>a.current[data-v-7ac78f0d],.calendar-table td.current[data-v-7ac78f0d],.calendar-year>a.current[data-v-7ac78f0d]{color:#fff;background-color:#1284e7}.calendar-table td.disabled[data-v-7ac78f0d]{cursor:not-allowed;color:#ccc;background-color:#f3f3f3}.lastMonth[data-v-7ac78f0d],.nextMonth[data-v-7ac78f0d]{color:#ddd}.today[data-v-7ac78f0d]{color:#20a0ff}.calendar-month[data-v-7ac78f0d],.calendar-year[data-v-7ac78f0d]{width:100%;height:224px;padding:7px 0;text-align:center}.calendar-year>a[data-v-7ac78f0d]{display:inline-block;width:40%;margin:1px 5%;line-height:40px}.calendar-month>a[data-v-7ac78f0d]{display:inline-block;width:30%;line-height:40px;margin:8px 1.5%}",""])},function(t,e,n){e=t.exports=n(0)(),e.push([t.i,'.datepicker[data-v-908b63ac]{position:relative;display:inline-block;color:#73879c;font:14px/1.5 Helvetica Neue,Helvetica,Arial,Microsoft Yahei,sans-serif}.datepicker [data-v-908b63ac]{box-sizing:border-box}.datepicker-popup[data-v-908b63ac]{position:absolute;width:250px;margin-top:1px;margin-bottom:1px;border:1px solid #d9d9d9;background-color:#fff;box-shadow:0 6px 12px rgba(0,0,0,.175);z-index:1000}.range[data-v-908b63ac]{width:496px}.input[data-v-908b63ac]{display:inline-block;width:100%;height:34px;padding:6px 30px 6px 10px;font-size:14px;line-height:1.4;color:#555;background-color:#fff;border:1px solid #ccc;border-radius:4px;box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.input-icon[data-v-908b63ac]{top:0;right:0;position:absolute;width:30px;height:100%;color:#888;text-align:center;font-style:normal}.input-icon[data-v-908b63ac]:after{content:"";display:inline-block;width:0;height:100%;vertical-align:middle}.input-icon__calendar[data-v-908b63ac]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAA00lEQVQ4T72SzQ2CQBCF54UGKIES6EAswQq0BS/A3PQ0hAt0oKVQgiVYAkcuZMwSMOyCyRKNe9uf+d6b2Qf6csGtL8sy7vu+Zebn/E5EoiAIwjRNH/PzBUBEGiJqmPniAMw+YeZkFSAiJwA3j45aVT0wsxGitwOjDGDnASBVvU4OLQARRURk9e4CAcSqWn8CLHp3Ae6MXAe/B4yzUeMkz/P9ZgdFUQzFIwD/B4yKgwMTos0OtvzCHcDRJ0gAzlmW1VYSq6oKu66LfQBTjC2AT+Hamxcml5IRpPq3VQAAAABJRU5ErkJggg==);background-position:50%;background-repeat:no-repeat}.input-icon__close[data-v-908b63ac]:before{content:"\\2716";vertical-align:middle}.datepicker-top[data-v-908b63ac]{margin:0 12px;line-height:34px;border-bottom:1px solid rgba(0,0,0,.05)}.datepicker-top>span[data-v-908b63ac]{white-space:nowrap;cursor:pointer}.datepicker-top>span[data-v-908b63ac]:hover{color:#1284e7}.datepicker-top>span[data-v-908b63ac]:after{content:"|";margin:0 10px;color:#48576a}',""])},function(t,e,n){n(19);var r=n(1)(n(6),n(16),"data-v-7ac78f0d",null);t.exports=r.exports},function(t,e,n){n(20);var r=n(1)(n(7),n(17),"data-v-908b63ac",null);t.exports=r.exports},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{attrs:{id:"app"}},[n("div",{staticClass:"demo"},[n("span",{staticClass:"label"},[t._v("default:")]),t._v(" "),n("date-picker",{attrs:{lang:"en"},model:{value:t.value1,callback:function(e){t.value1=e},expression:"value1"}})],1),t._v(" "),n("div",{staticClass:"demo"},[n("span",{staticClass:"label"},[t._v("range:")]),t._v(" "),n("date-picker",{attrs:{range:"",lang:"zh"},model:{value:t.value2,callback:function(e){t.value2=e},expression:"value2"}})],1)])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"calendar"},[n("div",{staticClass:"calendar-header"},[n("a",{staticClass:"calendar__prev-icon",on:{click:function(e){t.changeYear(-1)}}},[t._v("«")]),t._v(" "),n("a",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentPanel,expression:"currentPanel === 'date'"}],staticClass:"calendar__prev-icon",on:{click:function(e){t.changeMonth(-1)}}},[t._v("‹")]),t._v(" "),n("a",{staticClass:"calendar__next-icon",on:{click:function(e){t.changeYear(1)}}},[t._v("»")]),t._v(" "),n("a",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentPanel,expression:"currentPanel === 'date'"}],staticClass:"calendar__next-icon",on:{click:function(e){t.changeMonth(1)}}},[t._v("›")]),t._v(" "),n("a",{on:{click:t.showMonths}},[t._v(t._s(t.months[t.currentMonth]))]),t._v(" "),n("a",{on:{click:t.showYears}},[t._v(t._s(t.currentYear))])]),t._v(" "),n("div",{staticClass:"calendar-content"},[n("table",{directives:[{name:"show",rawName:"v-show",value:"date"===t.currentPanel,expression:"currentPanel === 'date'"}],staticClass:"calendar-table"},[n("thead",[n("tr",t._l(t.days,function(e){return n("th",[t._v(t._s(e))])}))]),t._v(" "),n("tbody",t._l(t.dates,function(e){return n("tr",t._l(e,function(e){return n("td",{class:t.getClasses(e),attrs:{title:e.title},on:{click:function(n){t.selectDate(e)}}},[t._v(t._s(e.day))])}))}))]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:"years"===t.currentPanel,expression:"currentPanel === 'years'"}],staticClass:"calendar-year"},t._l(t.years,function(e){return n("a",{class:{current:t.currentYear===e},on:{click:function(n){t.selectYear(e)}}},[t._v(t._s(e))])})),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:"months"===t.currentPanel,expression:"currentPanel === 'months'"}],staticClass:"calendar-month"},t._l(t.months,function(e,r){return n("a",{class:{current:t.currentMonth===r},on:{click:function(e){t.selectMonth(r)}}},[t._v(t._s(e))])}))])])},staticRenderFns:[]}},function(t,e){t.exports={render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:t.closePopup,expression:"closePopup"}],staticClass:"datepicker",style:{width:t.width+"px","min-width":t.range?"210px":"140px"}},[n("input",{ref:"input",staticClass:"input",attrs:{readonly:"",placeholder:t.innerPlaceholder},domProps:{value:t.text},on:{click:t.togglePopup,mousedown:function(t){t.preventDefault()}}}),t._v(" "),n("i",{staticClass:"input-icon",class:t.showCloseIcon?"input-icon__close":"input-icon__calendar",on:{mouseenter:t.hoverIcon,mouseleave:t.hoverIcon,click:t.clickIcon}}),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.showPopup,expression:"showPopup"}],ref:"calendar",staticClass:"datepicker-popup",class:{range:t.range},style:t.position},[t.range?[n("div",{staticClass:"datepicker-top"},t._l(t.ranges,function(e){return n("span",{on:{click:function(n){t.selectRange(e)}}},[t._v(t._s(e.text))])})),t._v(" "),n("calendar-panel",{staticStyle:{width:"50%","box-shadow":"1px 0 rgba(0, 0, 0, .1)"},attrs:{"end-at":t.currentValue[1],show:t.showPopup},model:{value:t.currentValue[0],callback:function(e){var n=t.currentValue;Array.isArray(n)?n.splice(0,1,e):t.currentValue[0]=e},expression:"currentValue[0]"}}),t._v(" "),n("calendar-panel",{staticStyle:{width:"50%"},attrs:{"start-at":t.currentValue[0],show:t.showPopup},model:{value:t.currentValue[1],callback:function(e){var n=t.currentValue;Array.isArray(n)?n.splice(1,1,e):t.currentValue[1]=e},expression:"currentValue[1]"}})]:[n("calendar-panel",{attrs:{show:t.showPopup},model:{value:t.currentValue,callback:function(e){t.currentValue=e},expression:"currentValue"}})]],2)])},staticRenderFns:[]}},function(t,e,n){var r=n(10);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(2)("70a25e23",r,!0)},function(t,e,n){var r=n(11);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(2)("af23f1d6",r,!0)},function(t,e,n){var r=n(12);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(2)("252a46d8",r,!0)},function(t,e){t.exports=function(t,e){for(var n=[],r={},o=0;o
-
-
-
- vue2-datepicker
-
-
-
-
-
-
diff --git a/package.json b/package.json
index 4c0ae2f..39bb1ac 100644
--- a/package.json
+++ b/package.json
@@ -1,8 +1,8 @@
{
"name": "vue2-datepicker",
"description": "A Datepicker Component For Vue2",
- "main": "src/datepicker/index.vue",
- "version": "1.2.0",
+ "main": "datepicker/index.vue",
+ "version": "1.2.1",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
diff --git a/src/App.vue b/src/App.vue
deleted file mode 100644
index 1617d18..0000000
--- a/src/App.vue
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
- default:
-
-
-
- range:
-
-
-
-
-
-
-
-
diff --git a/src/main.js b/src/main.js
deleted file mode 100644
index bfc71bd..0000000
--- a/src/main.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import Vue from 'vue'
-import App from './App.vue'
-
-new Vue({ // eslint-disable-line
- el: '#app',
- render: h => h(App)
-})
diff --git a/webpack.config.js b/webpack.config.js
deleted file mode 100644
index b53dc46..0000000
--- a/webpack.config.js
+++ /dev/null
@@ -1,71 +0,0 @@
-var path = require('path')
-var webpack = require('webpack')
-
-module.exports = {
- entry: './src/main.js',
- output: {
- path: path.resolve(__dirname, './dist'),
- publicPath: '/dist/',
- filename: 'build.js'
- },
- module: {
- rules: [
- {
- test: /\.vue$/,
- loader: 'vue-loader',
- options: {
- loaders: {
- }
- // other vue-loader options go here
- }
- },
- {
- test: /\.js$/,
- loader: 'babel-loader',
- exclude: /node_modules/
- },
- {
- test: /\.(png|jpg|gif|svg)$/,
- loader: 'file-loader',
- options: {
- name: '[name].[ext]?[hash]'
- }
- }
- ]
- },
- resolve: {
- alias: {
- // 'vue$': 'vue/dist/vue.esm.js'
- }
- },
- devServer: {
- historyApiFallback: true,
- noInfo: true,
- port: 9000
- },
- performance: {
- hints: false
- },
- devtool: '#eval-source-map'
-}
-
-if (process.env.NODE_ENV === 'production') {
- module.exports.devtool = '#source-map'
- // http://vue-loader.vuejs.org/en/workflow/production.html
- module.exports.plugins = (module.exports.plugins || []).concat([
- new webpack.DefinePlugin({
- 'process.env': {
- NODE_ENV: '"production"'
- }
- }),
- new webpack.optimize.UglifyJsPlugin({
- sourceMap: false,
- compress: {
- warnings: false
- }
- }),
- new webpack.LoaderOptionsPlugin({
- minimize: true
- })
- ])
-}