From e0dc8b5e3498541b9c3b613d56437703714b0183 Mon Sep 17 00:00:00 2001 From: weifeiyue Date: Wed, 7 Feb 2018 10:24:38 +0800 Subject: [PATCH] add event handler #27 --- README.md | 8 ++++---- dist/vue-datepicker-local.css | 6 +++--- dist/vue-datepicker-local.js | 6 +++--- example/App.vue | 10 +++++----- package.json | 2 +- src/VueDatepickerLocal.vue | 22 ++++++++++++---------- webpack.config.js | 2 +- 7 files changed, 29 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index e3aa933..1f10bb0 100644 --- a/README.md +++ b/README.md @@ -81,13 +81,13 @@ The `dist` folder contains `vue-datepicker-local.js` and `vue-datepicker-local.c | format | to set the date format | String | "YYYY-MM-DD" | | local | the local of the DatePicker | Object | {
dow: 1, // Monday is the first day of the week
hourTip: '选择小时', // tip of select hour
minuteTip: '选择分钟', // tip of select minute
secondTip: '选择秒数', // tip of select second
yearSuffix: '年', // format of head
monthsHead: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), // months of head
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), // months of panel
weeks: '一_二_三_四_五_六_日'.split('_'), // weeks
cancelTip: '取消', // default text for cancel button
, submitTip: '提交' // default text for submit button
} | | disabledDate | specify the date that cannot be selected | Function | ()=>{return false} | -| showButtons | show Cancel/Submit buttons on daterangepicker only | Boolean | false | +| showButtons | show Cancel/Submit buttons | Boolean | false | ### Events -| Name | Return | About | -|:---------------|:-------------------------------------------------|:-------------------| -| dateRangeSelect| Array of Dates| This function is triggered after user click submit, usefull when need to make something after select time interval| +| Event Name | Description | Parameters | +|:---------------|:-------------------------------------------------|:-------------------------------------| +| confirm |triggers when user confirms | the value component's binding value | ## License vue-datepicker-local is licensed under [The MIT License](LICENSE). diff --git a/dist/vue-datepicker-local.css b/dist/vue-datepicker-local.css index bb01a58..6c8d1e6 100644 --- a/dist/vue-datepicker-local.css +++ b/dist/vue-datepicker-local.css @@ -1,6 +1,6 @@ /*! - * vue-datetime-local.js v1.0.9 - * (c) 2017-2017 weifeiyue + * vue-datetime-local.js v1.0.10 + * (c) 2017-2018 weifeiyue * Released under the MIT License. */ -.datepicker{display:inline-block;position:relative}.datepicker:before{content:"";display:block;background:url("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiPjxwYXRoIGQ9Ik01NjQgMTgwLjJINDQ4Yy04LjMgMC0xNS02LjctMTUtMTVzNi43LTE1IDE1LTE1aDExNmM4LjIgMCAxNSA2LjcgMTUgMTVzLTYuOCAxNS0xNSAxNXoiIGZpbGw9IiM5ODk4OTgiLz48cGF0aCBkPSJNOTQ1IDk1Mi4ySDgxLjJjLTguMiAwLTE1LTYuNy0xNS0xNVYxNjIuOGMwLTguMyA2LjgtMTUgMTUtMTVIMjk0YzguMiAwIDE1IDYuNyAxNSAxNXMtNi44IDE1LTE1IDE1SDk2LjJ2NzQ0LjRIOTMwVjE3Ny44SDcxMy42Yy04LjMgMC0xNS02LjctMTUtMTVzNi43LTE1IDE1LTE1SDk0NWM4LjIgMCAxNSA2LjcgMTUgMTV2Nzc0LjRjMCA4LjMtNi44IDE1LTE1IDE1eiIgZmlsbD0iIzk4OTg5OCIvPjxwYXRoIGQ9Ik0zMzMuMyA1NTFIMjE2Yy04LjIgMC0xNS02LjgtMTUtMTVzNi44LTE1IDE1LTE1aDExNy4zYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1em0yMzAuMyAwSDQ0Ni4zYy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4zYzguMiAwIDE1IDYuNiAxNSAxNXMtNi44IDE1LTE1IDE1em0yMzAuMiAwSDY3Ni42Yy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4yYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1ek0zMzMuMyA3NDBIMjE2Yy04LjIgMC0xNS02LjgtMTUtMTVzNi44LTE1IDE1LTE1aDExNy4zYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1em0yMzAuMyAwSDQ0Ni4zYy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4zYzguMiAwIDE1IDYuNiAxNSAxNXMtNi44IDE1LTE1IDE1em0yMzAuMiAwSDY3Ni42Yy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4yYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1ek0zNzAuOCAyNTguNmMtOC4zIDAtMTUtNi43LTE1LTE1Vjg2LjhjMC04LjIgNi43LTE1IDE1LTE1czE1IDYuOCAxNSAxNXYxNTYuOGMwIDguMy02LjcgMTUtMTUgMTV6bTI3MC4yIDBjLTguMyAwLTE1LTYuNy0xNS0xNVY4Ni44YzAtOC4yIDYuNy0xNSAxNS0xNXMxNSA2LjggMTUgMTV2MTU2LjhjMCA4LjMtNi43IDE1LTE1IDE1ek05NDUgMzcyLjJIODEuMmMtOC4yIDAtMTUtNi43LTE1LTE1czYuOC0xNSAxNS0xNUg5NDVjOC4yIDAgMTUgNi43IDE1IDE1cy02LjggMTUtMTUgMTV6IiBmaWxsPSIjOTg5ODk4Ii8+PC9zdmc+") no-repeat 50% 50%}.datepicker-close,.datepicker:before{position:absolute;width:34px;height:100%;top:0;right:0}.datepicker-close{display:none;cursor:pointer}.datepicker-close:before{display:block;content:"";position:absolute;width:16px;height:16px;left:50%;top:50%;margin-left:-8px;margin-top:-8px;text-align:center;background:#ccc;color:#fff;border-radius:50%;background:#ccc url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3IDciIHdpZHRoPSI3IiBoZWlnaHQ9IjciPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik01LjU4LDVsMi44LTIuODFBLjQxLjQxLDAsMSwwLDcuOCwxLjZMNSw0LjQxLDIuMiwxLjZhLjQxLjQxLDAsMCwwLS41OC41OGgwTDQuNDIsNSwxLjYyLDcuOGEuNDEuNDEsMCwwLDAsLjU4LjU4TDUsNS41OCw3LjgsOC4zOWEuNDEuNDEsMCwwLDAsLjU4LS41OGgwWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEuNSAtMS40OCkiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4NCg==") no-repeat 50% 50%}.datepicker__clearable:hover:before{display:none}.datepicker__clearable:hover .datepicker-close{display:block}.datepicker-close:hover:before{background-color:#afafaf}.datepicker>input{color:#666;transition:all .2s ease;border:1px solid #e5e5e5;height:34px;box-sizing:border-box;outline:none;padding:0 34px 0 12px;font-size:14px;width:100%;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.datepicker>input.focus{border-color:#3bb4f2;-webkit-box-shadow:0 0 5px rgba(59,180,242,.3);box-shadow:0 0 5px rgba(59,180,242,.3)}.datepicker>input:disabled{cursor:not-allowed;background-color:#ebebe4;border-color:#e5e5e5;-webkit-box-shadow:none;box-shadow:none}.datepicker-popup{position:absolute;transition:all .2s ease;opacity:1;transform:scaleY(1);transform-origin:center top;font-size:12px;background:#fff;border:1px solid #d9d9d9;box-shadow:0 1px 6px rgba(99,99,99,.2);margin-top:2px;outline:0;padding:5px;overflow:hidden;z-index:999}.datepicker-inline{position:relative;margin-top:0}.datepicker-range{min-width:325px}.datepicker-range .datepicker-popup{width:403px}.datepicker-bottom{float:left;width:100%;text-align:right}.datepicker-btn{padding:5px 10px;background:#1284e7;color:#fff;border-radius:2px;display:inline-block;cursor:pointer}.datepicker-anim-enter-active{transform-origin:0 0;animation:datepicker-anim-in .2s cubic-bezier(.23,1,.32,1)}.datepicker-anim-leave-active{transform-origin:0 0;animation:datepicker-anim-out .2s cubic-bezier(.755,.05,.855,.06)}@keyframes datepicker-anim-in{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}@keyframes datepicker-anim-out{0%{opacity:1;transform:scaleY(1)}to{opacity:0;transform:scaleY(.8)}}.calendar{float:left;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.calendar+.calendar{border-left:1px solid #eaeaea;margin-left:5px;padding-left:5px}.calendar-head{line-height:34px;height:34px;text-align:center;position:relative}.calendar-head a{color:#666;font-weight:700;cursor:pointer;display:inline-block;text-align:center;position:absolute;padding:0 5px;font-size:16px}.calendar-head a:hover{color:#1284e7}.calendar-head .calendar-month-select,.calendar-head .calendar-year-select{font-size:12px;padding:0 2px;position:relative}.calendar-prev-decade-btn,.calendar-prev-year-btn{left:6px}.calendar-prev-month-btn{left:24px}.calendar-next-decade-btn,.calendar-next-year-btn{right:6px}.calendar-next-month-btn{right:24px}.calendar-body{position:relative;width:196px;height:196px}.calendar-days{width:100%;height:100%}.calendar-date,.calendar-week{font-weight:400;width:14.28%;height:14.28%;text-align:center;box-sizing:border-box;display:inline-block;overflow:hidden;float:left}.calendar-date:before,.calendar-week:before{content:"";display:inline-block;height:100%;vertical-align:middle}.calendar-date{cursor:pointer}.calendar-date-out{color:#ccc}.calendar-date-on,.calendar-date:hover{background:#eaf8fe}.calendar-date-selected,.calendar-date-selected:hover{color:#fff;font-weight:700;background:#1284e7}.calendar-date-disabled{cursor:not-allowed!important;color:#bcbcbc!important;background:#f3f3f3!important}.calendar-foot{margin-top:5px}.calendar-hour{display:inline-block;border:1px solid #e6e5e5;color:#9e9e9e}.calendar-hour a{display:inline-block;padding:2px 4px;cursor:pointer}.calendar-hour a.on,.calendar-hour a:hover{color:#1284e7}.calendar-hours,.calendar-minutes,.calendar-months,.calendar-seconds,.calendar-years{width:100%;height:100%;position:absolute;background:#fff;left:0;top:0}.calendar-months a,.calendar-years a{width:33.33%;height:25%}.calendar-hours a{width:20%;height:20%}.calendar-minutes a,.calendar-seconds a{width:16.66%;height:10%}.calendar-title{margin-top:-30px;height:30px;line-height:30px;background:#fff;text-align:center;font-weight:700} \ No newline at end of file +.datepicker{display:inline-block;position:relative}.datepicker:before{content:"";display:block;background:url("data:image/svg+xml;base64,PHN2ZyBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB3aWR0aD0iMjAiIGhlaWdodD0iMjAiPjxwYXRoIGQ9Ik01NjQgMTgwLjJINDQ4Yy04LjMgMC0xNS02LjctMTUtMTVzNi43LTE1IDE1LTE1aDExNmM4LjIgMCAxNSA2LjcgMTUgMTVzLTYuOCAxNS0xNSAxNXoiIGZpbGw9IiM5ODk4OTgiLz48cGF0aCBkPSJNOTQ1IDk1Mi4ySDgxLjJjLTguMiAwLTE1LTYuNy0xNS0xNVYxNjIuOGMwLTguMyA2LjgtMTUgMTUtMTVIMjk0YzguMiAwIDE1IDYuNyAxNSAxNXMtNi44IDE1LTE1IDE1SDk2LjJ2NzQ0LjRIOTMwVjE3Ny44SDcxMy42Yy04LjMgMC0xNS02LjctMTUtMTVzNi43LTE1IDE1LTE1SDk0NWM4LjIgMCAxNSA2LjcgMTUgMTV2Nzc0LjRjMCA4LjMtNi44IDE1LTE1IDE1eiIgZmlsbD0iIzk4OTg5OCIvPjxwYXRoIGQ9Ik0zMzMuMyA1NTFIMjE2Yy04LjIgMC0xNS02LjgtMTUtMTVzNi44LTE1IDE1LTE1aDExNy4zYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1em0yMzAuMyAwSDQ0Ni4zYy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4zYzguMiAwIDE1IDYuNiAxNSAxNXMtNi44IDE1LTE1IDE1em0yMzAuMiAwSDY3Ni42Yy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4yYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1ek0zMzMuMyA3NDBIMjE2Yy04LjIgMC0xNS02LjgtMTUtMTVzNi44LTE1IDE1LTE1aDExNy4zYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1em0yMzAuMyAwSDQ0Ni4zYy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4zYzguMiAwIDE1IDYuNiAxNSAxNXMtNi44IDE1LTE1IDE1em0yMzAuMiAwSDY3Ni42Yy04LjMgMC0xNS02LjgtMTUtMTVzNi43LTE1IDE1LTE1aDExNy4yYzguMyAwIDE1IDYuNiAxNSAxNXMtNi43IDE1LTE1IDE1ek0zNzAuOCAyNTguNmMtOC4zIDAtMTUtNi43LTE1LTE1Vjg2LjhjMC04LjIgNi43LTE1IDE1LTE1czE1IDYuOCAxNSAxNXYxNTYuOGMwIDguMy02LjcgMTUtMTUgMTV6bTI3MC4yIDBjLTguMyAwLTE1LTYuNy0xNS0xNVY4Ni44YzAtOC4yIDYuNy0xNSAxNS0xNXMxNSA2LjggMTUgMTV2MTU2LjhjMCA4LjMtNi43IDE1LTE1IDE1ek05NDUgMzcyLjJIODEuMmMtOC4yIDAtMTUtNi43LTE1LTE1czYuOC0xNSAxNS0xNUg5NDVjOC4yIDAgMTUgNi43IDE1IDE1cy02LjggMTUtMTUgMTV6IiBmaWxsPSIjOTg5ODk4Ii8+PC9zdmc+") no-repeat 50% 50%}.datepicker-close,.datepicker:before{position:absolute;width:34px;height:100%;top:0;right:0}.datepicker-close{display:none;cursor:pointer}.datepicker-close:before{display:block;content:"";position:absolute;width:16px;height:16px;left:50%;top:50%;margin-left:-8px;margin-top:-8px;text-align:center;background:#ccc;color:#fff;border-radius:50%;background:#ccc url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA3IDciIHdpZHRoPSI3IiBoZWlnaHQ9IjciPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik01LjU4LDVsMi44LTIuODFBLjQxLjQxLDAsMSwwLDcuOCwxLjZMNSw0LjQxLDIuMiwxLjZhLjQxLjQxLDAsMCwwLS41OC41OGgwTDQuNDIsNSwxLjYyLDcuOGEuNDEuNDEsMCwwLDAsLjU4LjU4TDUsNS41OCw3LjgsOC4zOWEuNDEuNDEsMCwwLDAsLjU4LS41OGgwWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEuNSAtMS40OCkiIHN0eWxlPSJmaWxsOiNmZmYiLz48L3N2Zz4NCg==") no-repeat 50% 50%}.datepicker__clearable:hover:before{display:none}.datepicker__clearable:hover .datepicker-close{display:block}.datepicker-close:hover:before{background-color:#afafaf}.datepicker>input{color:#666;transition:all .2s ease;border:1px solid #e5e5e5;height:34px;box-sizing:border-box;outline:none;padding:0 34px 0 12px;font-size:14px;width:100%;user-select:none;-ms-user-select:none;-moz-user-select:none;-webkit-user-select:none}.datepicker>input.focus{border-color:#3bb4f2;-webkit-box-shadow:0 0 5px rgba(59,180,242,.3);box-shadow:0 0 5px rgba(59,180,242,.3)}.datepicker>input:disabled{cursor:not-allowed;background-color:#ebebe4;border-color:#e5e5e5;-webkit-box-shadow:none;box-shadow:none}.datepicker-popup{position:absolute;transition:all .2s ease;opacity:1;transform:scaleY(1);transform-origin:center top;font-size:12px;background:#fff;border:1px solid #d9d9d9;box-shadow:0 1px 6px rgba(99,99,99,.2);margin-top:2px;outline:0;padding:5px;overflow:hidden;z-index:999}.datepicker-inline{position:relative;margin-top:0}.datepicker-range{min-width:325px}.datepicker-range .datepicker-popup{width:403px}.datepicker-bottom{float:left;width:100%;text-align:right}.datepicker-btn{padding:5px 10px;background:#1284e7;color:#fff;border-radius:2px;display:inline-block;cursor:pointer}.datepicker-anim-enter-active{transform-origin:0 0;animation:datepicker-anim-in .2s cubic-bezier(.23,1,.32,1)}.datepicker-anim-leave-active{transform-origin:0 0;animation:datepicker-anim-out .2s cubic-bezier(.755,.05,.855,.06)}.datepicker__buttons{display:block;text-align:right}.datepicker__buttons button{display:inline-block;font-size:13px;border:none;cursor:pointer;margin:10px 0 0 5px;padding:5px 15px;color:#fff}.datepicker__buttons .datepicker__button-select{background:#1284e7}.datepicker__buttons .datepicker__button-cancel{background:#666}@keyframes datepicker-anim-in{0%{opacity:0;transform:scaleY(.8)}to{opacity:1;transform:scaleY(1)}}@keyframes datepicker-anim-out{0%{opacity:1;transform:scaleY(1)}to{opacity:0;transform:scaleY(.8)}}.calendar{float:left;display:inline-block;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.calendar+.calendar{border-left:1px solid #eaeaea;margin-left:5px;padding-left:5px}.calendar-head{line-height:34px;height:34px;text-align:center;position:relative}.calendar-head a{color:#666;font-weight:700;cursor:pointer;display:inline-block;text-align:center;position:absolute;padding:0 5px;font-size:16px}.calendar-head a:hover{color:#1284e7}.calendar-head .calendar-month-select,.calendar-head .calendar-year-select{font-size:12px;padding:0 2px;position:relative}.calendar-prev-decade-btn,.calendar-prev-year-btn{left:6px}.calendar-prev-month-btn{left:24px}.calendar-next-decade-btn,.calendar-next-year-btn{right:6px}.calendar-next-month-btn{right:24px}.calendar-body{position:relative;width:196px;height:196px}.calendar-days{width:100%;height:100%}.calendar-date,.calendar-week{font-weight:400;width:14.28%;height:14.28%;text-align:center;box-sizing:border-box;display:inline-block;overflow:hidden;float:left}.calendar-date:before,.calendar-week:before{content:"";display:inline-block;height:100%;vertical-align:middle}.calendar-date{cursor:pointer}.calendar-date-out{color:#ccc}.calendar-date-on,.calendar-date:hover{background:#eaf8fe}.calendar-date-selected,.calendar-date-selected:hover{color:#fff;font-weight:700;background:#1284e7}.calendar-date-disabled{cursor:not-allowed!important;color:#bcbcbc!important;background:#f3f3f3!important}.calendar-foot{margin-top:5px}.calendar-hour{display:inline-block;border:1px solid #e6e5e5;color:#9e9e9e}.calendar-hour a{display:inline-block;padding:2px 4px;cursor:pointer}.calendar-hour a.on,.calendar-hour a:hover{color:#1284e7}.calendar-hours,.calendar-minutes,.calendar-months,.calendar-seconds,.calendar-years{width:100%;height:100%;position:absolute;background:#fff;left:0;top:0}.calendar-months a,.calendar-years a{width:33.33%;height:25%}.calendar-hours a{width:20%;height:20%}.calendar-minutes a,.calendar-seconds a{width:16.66%;height:10%}.calendar-title{margin-top:-30px;height:30px;line-height:30px;background:#fff;text-align:center;font-weight:700} \ No newline at end of file diff --git a/dist/vue-datepicker-local.js b/dist/vue-datepicker-local.js index 5664ea7..7ebed99 100644 --- a/dist/vue-datepicker-local.js +++ b/dist/vue-datepicker-local.js @@ -1,6 +1,6 @@ /*! - * vue-datetime-local.js v1.0.9 - * (c) 2017-2017 weifeiyue + * vue-datetime-local.js v1.0.10 + * (c) 2017-2018 weifeiyue * Released under the MIT License. */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["vue-datepicker-local"]=t():e["vue-datepicker-local"]=t()}(this,function(){return function(e){function t(n){if(s[n])return s[n].exports;var o=s[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var s={};return t.m=e,t.c=s,t.d=function(e,s,n){t.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t){e.exports=function(e,t,s,n,o,a){var r,i=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(r=e,i=e.default);var u="function"==typeof i?i.options:i;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),s&&(u.functional=!0),o&&(u._scopeId=o);var l;if(a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):n&&(l=n),l){var h=u.functional,d=h?u.render:u.beforeCreate;h?(u._injectStyles=l,u.render=function(e,t){return l.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:r,exports:i,options:u}}},function(e,t,s){"use strict";function n(e){e.component(a.a.name,a.a)}Object.defineProperty(t,"__esModule",{value:!0});var o=s(2),a=s.n(o);a.a.install=n,"undefined"!=typeof window&&window.Vue&&n(window.Vue),t.default=a.a},function(e,t,s){function n(e){s(3)}var o=s(0),a=s(4),r=s(9),i=n,c=o(a,r,!1,i,null,null);e.exports=c.exports},function(e,t){},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(5),o=s.n(n);t.default={name:"VueDatepickerLocal",components:{VueDatepickerLocalCalendar:o.a},props:{name:[String],inputClass:[String],popupClass:[String],value:[Date,Array,String],disabled:[Boolean],type:{type:String,default:"normal"},rangeSeparator:{type:String,default:"~"},clearable:{type:Boolean,default:!1},placeholder:[String],disabledDate:{type:Function,default:function(){return!1}},format:{type:String,default:"YYYY-MM-DD"},local:{type:Object,default:function(){return{dow:1,hourTip:"选择小时",minuteTip:"选择分钟",secondTip:"选择秒数",yearSuffix:"年",monthsHead:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),weeks:"一_二_三_四_五_六_日".split("_")}}}},data:function(){return{show:!1,dates:this.vi(this.value)}},computed:{range:function(){return 2===this.dates.length},text:function(){var e=this,t=this.value,s=this.dates.map(function(t){return e.tf(t)}).join(" "+this.rangeSeparator+" ");return Array.isArray(t)?t.length>1?s:"":t?s:""}},watch:{value:function(e){this.dates=this.vi(this.value)}},methods:{cls:function(){this.$emit("input",this.range?[]:"")},vi:function(e){return Array.isArray(e)?e.length>1?e.map(function(e){return new Date(e)}):[new Date,new Date]:e?new Array(new Date(e)):[new Date]},ok:function(){var e=this;e.$emit("input",Array.isArray(e.value)?e.dates:e.dates[0]),setTimeout(function(){e.show=e.range})},tf:function(e,t){var s=e.getFullYear(),n=e.getMonth(),o=e.getDate(),a=e.getHours(),r=a%12==0?12:a%12,i=e.getMinutes(),c=e.getSeconds(),u=e.getMilliseconds(),l=function(e){return("0"+e).slice(-2)},h={YYYY:s,MM:l(n+1),MMM:this.local.months[n],MMMM:this.local.monthsHead[n],M:n+1,DD:l(o),D:o,HH:l(a),H:a,hh:l(r),h:r,mm:l(i),m:i,ss:l(c),s:c,S:u};return(t||this.format).replace(/Y+|M+|D+|H+|h+|m+|s+|S+/g,function(e){return h[e]})},dc:function(e){this.show=this.$el.contains(e.target)&&!this.disabled}},mounted:function(){document.addEventListener("click",this.dc)},beforeDestroy:function(){document.removeEventListener("click",this.dc)}}},function(e,t,s){function n(e){s(6)}var o=s(0),a=s(7),r=s(8),i=n,c=o(a,r,!1,i,null,null);e.exports=c.exports},function(e,t){},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"VueDatepickerLocalCalendar",props:{value:null,left:!1,right:!1},data:function(){var e=this.get(this.value);return{pre:"calendar",m:"D",showYears:!1,showMonths:!1,showHours:!1,showMinutes:!1,showSeconds:!1,year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second}},watch:{value:function(e){var t=this,s=t.get(e);t.year=s.year,t.month=s.month,t.day=s.day,t.hour=s.hour,t.minute=s.minute,t.second=s.second}},computed:{local:function(){return this.$parent.local},format:function(){return this.$parent.format},start:function(){return this.parse(this.$parent.dates[0])},end:function(){return this.parse(this.$parent.dates[1])},ys:function(){return 10*parseInt(this.year/10)},ye:function(){return this.ys+10},years:function(){for(var e=[],t=this.ys-1;e.length<12;)e.push(t++);return e},days:function(){var e=[],t=this,s=t.year,n=t.month,o=new Date(s,n,1),a=t.local.dow||7;o.setDate(0);for(var r=o.getDate(),i=o.getDay()||7,c=a<=i?i-a+1:i+(7-a+1);c>0;)e.push({i:r-c+1,y:n>0?s:s-1,m:n>0?n-1:11,p:!0}),c--;o.setMonth(o.getMonth()+2,0),r=o.getDate();var u=1;for(u=1;u<=r;u++)e.push({i:u,y:s,m:n});for(u=1;e.length<42;u++)e.push({i:u,y:n<11?s:s+1,m:n<11?n+1:0,n:!0});return e}},filters:{dd:function(e){return("0"+e).slice(-2)}},methods:{get:function(e){return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()}},parse:function(e){return parseInt(e/1e3)},status:function(e,t,s,n,o,a,r){var i=this,c=new Date(e,t+1,0).getDate(),u=new Date(e,t,s>c?c:s,n,o,a),l=i.parse(u),h=i.$parent.tf,d={},p=!1;return p="YYYY"===r?e===i.year:"YYYYMM"===r?t===i.month:h(i.value,r)===h(u,r),d[i.pre+"-date"]=!0,d[i.pre+"-date-disabled"]=i.right&&li.end||i.$parent.disabledDate(u),d[i.pre+"-date-on"]=i.left&&l>i.start||i.right&&l0?this.month--:(this.month=11,this.year--)},is:function(e){return-1===e.target.className.indexOf(this.pre+"-date-disabled")},ok:function(e){var t=this,s="",n="";if(e&&e.n&&t.nm(),e&&e.p&&t.pm(),"h"===e){var o=t.get(this.value);s=o.year,n=o.month}t.$emit("input",new Date(s||t.year,n||t.month,t.day,t.hour,t.minute,t.second)),t.$parent.ok()}},mounted:function(){var e=this,t=function(t){return-1!==e.format.indexOf(t)};t("s")&&t("m")&&(t("h")||t("H"))?e.m="H":t("D")?e.m="D":t("M")?(e.m="M",e.showMonths=!0):t("Y")&&(e.m="Y",e.showYears=!0)}}},function(e,t){var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:""+e.pre},[s("div",{class:e.pre+"-head"},[s("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-prev-decade-btn",on:{click:function(t){e.year-=10}}},[e._v("«")]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-prev-year-btn",on:{click:function(t){e.year--}}},[e._v("«")]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-prev-month-btn",on:{click:e.pm}},[e._v("‹")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-year-select"},[e._v(e._s(e.ys+"-"+e.ye))]),e.local.yearSuffix?[s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-year-select",on:{click:function(t){e.showYears=!e.showYears}}},[e._v(e._s(e.year)+e._s(e.local.yearSuffix))]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-month-select",on:{click:function(t){e.showMonths=!e.showMonths}}},[e._v(e._s(e.local.monthsHead[e.month]))])]:[s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-month-select",on:{click:function(t){e.showMonths=!e.showMonths}}},[e._v(e._s(e.local.monthsHead[e.month]))]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-year-select",on:{click:function(t){e.showYears=!e.showYears}}},[e._v(e._s(e.year))])],s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-next-month-btn",on:{click:e.nm}},[e._v("›")]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-next-year-btn",on:{click:function(t){e.year++}}},[e._v("»")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-next-decade-btn",on:{click:function(t){e.year+=10}}},[e._v("»")])],2),s("div",{class:e.pre+"-body"},[s("div",{class:e.pre+"-days"},[e._l(e.local.weeks,function(t){return s("a",{class:e.pre+"-week"},[e._v(e._s(t))])}),e._l(e.days,function(t){return s("a",{class:[t.p||t.n?e.pre+"-date-out":"",e.status(t.y,t.m,t.i,e.hour,e.minute,e.second,"YYYYMMDD")],on:{click:function(s){e.is(s)&&(e.day=t.i,e.ok(t))}}},[e._v(e._s(t.i))])})],2),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showMonths,expression:"showMonths"}],class:e.pre+"-months"},e._l(e.local.months,function(t,n){return s("a",{class:[e.status(e.year,n,e.day,e.hour,e.minute,e.second,"YYYYMM")],on:{click:function(t){e.is(t)&&(e.showMonths="M"===e.m,e.month=n,"M"===e.m&&e.ok())}}},[e._v(e._s(t))])})),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-years"},e._l(e.years,function(t,n){return s("a",{class:[0===n||11===n?e.pre+"-date-out":"",e.status(t,e.month,e.day,e.hour,e.minute,e.second,"YYYY")],on:{click:function(s){e.is(s)&&(e.showYears="Y"===e.m,e.year=t,"Y"===e.m&&e.ok())}}},[e._v(e._s(t))])})),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showHours,expression:"showHours"}],class:e.pre+"-hours"},[s("div",{class:e.pre+"-title"},[e._v(e._s(e.local.hourTip))]),e._l(24,function(t,n){return s("a",{class:[e.status(e.year,e.month,e.day,n,e.minute,e.second,"YYYYMMDDHH")],on:{click:function(t){e.is(t)&&(e.showHours=!1,e.hour=n,e.ok("h"))}}},[e._v(e._s(n))])})],2),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showMinutes,expression:"showMinutes"}],class:e.pre+"-minutes"},[s("div",{class:e.pre+"-title"},[e._v(e._s(e.local.minuteTip))]),e._l(60,function(t,n){return s("a",{class:[e.status(e.year,e.month,e.day,e.hour,n,e.second,"YYYYMMDDHHmm")],on:{click:function(t){e.is(t)&&(e.showMinutes=!1,e.minute=n,e.ok("h"))}}},[e._v(e._s(n))])})],2),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showSeconds,expression:"showSeconds"}],class:e.pre+"-seconds"},[s("div",{class:e.pre+"-title"},[e._v(e._s(e.local.secondTip))]),e._l(60,function(t,n){return s("a",{class:[e.status(e.year,e.month,e.day,e.hour,e.minute,n,"YYYYMMDDHHmmss")],on:{click:function(t){e.is(t)&&(e.showSeconds=!1,e.second=n,e.ok("h"))}}},[e._v(e._s(n))])})],2)]),"H"===e.m?s("div",{class:e.pre+"-foot"},[s("div",{class:e.pre+"-hour"},[s("a",{class:{on:e.showHours},attrs:{title:e.local.hourTip},on:{click:function(t){e.showHours=!e.showHours,e.showMinutes=e.showSeconds=!1}}},[e._v(e._s(e._f("dd")(e.hour)))]),s("span",[e._v(":")]),s("a",{class:{on:e.showMinutes},attrs:{title:e.local.minuteTip},on:{click:function(t){e.showMinutes=!e.showMinutes,e.showHours=e.showSeconds=!1}}},[e._v(e._s(e._f("dd")(e.minute)))]),s("span",[e._v(":")]),s("a",{class:{on:e.showSeconds},attrs:{title:e.local.secondTip},on:{click:function(t){e.showSeconds=!e.showSeconds,e.showHours=e.showMinutes=!1}}},[e._v(e._s(e._f("dd")(e.second)))])])]):e._e()])},n=[];e.exports={render:s,staticRenderFns:n}},function(e,t){var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"datepicker",class:{"datepicker-range":e.range,datepicker__clearable:e.clearable&&e.text&&!e.disabled}},["inline"!==e.type?s("input",{class:[e.show?"focus":"",e.inputClass],attrs:{readonly:"",disabled:e.disabled,placeholder:e.placeholder,name:e.name},domProps:{value:e.text}}):e._e(),s("a",{staticClass:"datepicker-close",on:{click:function(t){t.stopPropagation(),e.cls(t)}}}),s("transition",{attrs:{name:"datepicker-anim"}},[e.show||"inline"===e.type?s("div",{staticClass:"datepicker-popup",class:[e.popupClass,{"datepicker-inline":"inline"===e.type}],attrs:{tabindex:"-1"}},[e.range?[s("vue-datepicker-local-calendar",{attrs:{left:!0},model:{value:e.dates[0],callback:function(t){e.$set(e.dates,0,t)},expression:"dates[0]"}}),s("vue-datepicker-local-calendar",{attrs:{right:!0},model:{value:e.dates[1],callback:function(t){e.$set(e.dates,1,t)},expression:"dates[1]"}})]:[s("vue-datepicker-local-calendar",{model:{value:e.dates[0],callback:function(t){e.$set(e.dates,0,t)},expression:"dates[0]"}})]],2):e._e()])],1)},n=[];e.exports={render:s,staticRenderFns:n}}])}); \ No newline at end of file +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["vue-datepicker-local"]=t():e["vue-datepicker-local"]=t()}(this,function(){return function(e){function t(n){if(s[n])return s[n].exports;var o=s[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var s={};return t.m=e,t.c=s,t.d=function(e,s,n){t.o(e,s)||Object.defineProperty(e,s,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var s=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(s,"a",s),s},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=1)}([function(e,t){e.exports=function(e,t,s,n,o,a){var r,i=e=e||{},c=typeof e.default;"object"!==c&&"function"!==c||(r=e,i=e.default);var u="function"==typeof i?i.options:i;t&&(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0),s&&(u.functional=!0),o&&(u._scopeId=o);var l;if(a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),n&&n.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):n&&(l=n),l){var h=u.functional,d=h?u.render:u.beforeCreate;h?(u._injectStyles=l,u.render=function(e,t){return l.call(t),d(e,t)}):u.beforeCreate=d?[].concat(d,l):[l]}return{esModule:r,exports:i,options:u}}},function(e,t,s){"use strict";function n(e){e.component(a.a.name,a.a)}Object.defineProperty(t,"__esModule",{value:!0});var o=s(2),a=s.n(o);a.a.install=n,"undefined"!=typeof window&&window.Vue&&n(window.Vue),t.default=a.a},function(e,t,s){function n(e){s(3)}var o=s(0),a=s(4),r=s(9),i=n,c=o(a,r,!1,i,null,null);e.exports=c.exports},function(e,t){},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=s(5),o=s.n(n);t.default={name:"VueDatepickerLocal",components:{VueDatepickerLocalCalendar:o.a},props:{name:[String],inputClass:[String],popupClass:[String],value:[Date,Array,String],disabled:[Boolean],type:{type:String,default:"normal"},rangeSeparator:{type:String,default:"~"},clearable:{type:Boolean,default:!1},placeholder:[String],disabledDate:{type:Function,default:function(){return!1}},format:{type:String,default:"YYYY-MM-DD"},local:{type:Object,default:function(){return{dow:1,hourTip:"选择小时",minuteTip:"选择分钟",secondTip:"选择秒数",yearSuffix:"年",monthsHead:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),weeks:"一_二_三_四_五_六_日".split("_"),cancelTip:"取消",submitTip:"确定"}}},showButtons:{type:Boolean,default:!1},dateRangeSelect:[Function]},data:function(){return{show:!1,dates:this.vi(this.value)}},computed:{range:function(){return 2===this.dates.length},text:function(){var e=this,t=this.value,s=this.dates.map(function(t){return e.tf(t)}).join(" "+this.rangeSeparator+" ");return Array.isArray(t)?t.length>1?s:"":t?s:""}},watch:{value:function(e){this.dates=this.vi(this.value)}},methods:{get:function(){return Array.isArray(this.value)?this.dates:this.dates[0]},cls:function(){this.$emit("input",this.range?[]:"")},vi:function(e){return Array.isArray(e)?e.length>1?e.map(function(e){return new Date(e)}):[new Date,new Date]:e?new Array(new Date(e)):[new Date]},ok:function(){var e=this;e.$emit("input",e.get()),!e.showButtons&&setTimeout(function(){e.show=e.range})},tf:function(e,t){var s=e.getFullYear(),n=e.getMonth(),o=e.getDate(),a=e.getHours(),r=a%12==0?12:a%12,i=e.getMinutes(),c=e.getSeconds(),u=e.getMilliseconds(),l=function(e){return("0"+e).slice(-2)},h={YYYY:s,MM:l(n+1),MMM:this.local.months[n],MMMM:this.local.monthsHead[n],M:n+1,DD:l(o),D:o,HH:l(a),H:a,hh:l(r),h:r,mm:l(i),m:i,ss:l(c),s:c,S:u};return(t||this.format).replace(/Y+|M+|D+|H+|h+|m+|s+|S+/g,function(e){return h[e]})},dc:function(e){this.show=this.$el.contains(e.target)&&!this.disabled},submit:function(){this.$emit("confirm",this.get()),this.show=!1},cancel:function(){this.show=!1}},mounted:function(){document.addEventListener("click",this.dc)},beforeDestroy:function(){document.removeEventListener("click",this.dc)}}},function(e,t,s){function n(e){s(6)}var o=s(0),a=s(7),r=s(8),i=n,c=o(a,r,!1,i,null,null);e.exports=c.exports},function(e,t){},function(e,t,s){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"VueDatepickerLocalCalendar",props:{value:null,left:!1,right:!1},data:function(){var e=this.get(this.value);return{pre:"calendar",m:"D",showYears:!1,showMonths:!1,showHours:!1,showMinutes:!1,showSeconds:!1,year:e.year,month:e.month,day:e.day,hour:e.hour,minute:e.minute,second:e.second}},watch:{value:function(e){var t=this,s=t.get(e);t.year=s.year,t.month=s.month,t.day=s.day,t.hour=s.hour,t.minute=s.minute,t.second=s.second}},computed:{local:function(){return this.$parent.local},format:function(){return this.$parent.format},start:function(){return this.parse(this.$parent.dates[0])},end:function(){return this.parse(this.$parent.dates[1])},ys:function(){return 10*parseInt(this.year/10)},ye:function(){return this.ys+10},years:function(){for(var e=[],t=this.ys-1;e.length<12;)e.push(t++);return e},days:function(){var e=[],t=this,s=t.year,n=t.month,o=new Date(s,n,1),a=t.local.dow||7;o.setDate(0);for(var r=o.getDate(),i=o.getDay()||7,c=a<=i?i-a+1:i+(7-a+1);c>0;)e.push({i:r-c+1,y:n>0?s:s-1,m:n>0?n-1:11,p:!0}),c--;o.setMonth(o.getMonth()+2,0),r=o.getDate();var u=1;for(u=1;u<=r;u++)e.push({i:u,y:s,m:n});for(u=1;e.length<42;u++)e.push({i:u,y:n<11?s:s+1,m:n<11?n+1:0,n:!0});return e}},filters:{dd:function(e){return("0"+e).slice(-2)}},methods:{get:function(e){return{year:e.getFullYear(),month:e.getMonth(),day:e.getDate(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds()}},parse:function(e){return parseInt(e/1e3)},status:function(e,t,s,n,o,a,r){var i=this,c=new Date(e,t+1,0).getDate(),u=new Date(e,t,s>c?c:s,n,o,a),l=i.parse(u),h=i.$parent.tf,d={},p=!1;return p="YYYY"===r?e===i.year:"YYYYMM"===r?t===i.month:h(i.value,r)===h(u,r),d[i.pre+"-date"]=!0,d[i.pre+"-date-disabled"]=i.right&&li.end||i.$parent.disabledDate(u),d[i.pre+"-date-on"]=i.left&&l>i.start||i.right&&l0?this.month--:(this.month=11,this.year--)},is:function(e){return-1===e.target.className.indexOf(this.pre+"-date-disabled")},ok:function(e){var t=this,s="",n="";if(e&&e.n&&t.nm(),e&&e.p&&t.pm(),"h"===e){var o=t.get(this.value);s=o.year,n=o.month}t.$emit("input",new Date(s||t.year,n||t.month,t.day,t.hour,t.minute,t.second)),t.$parent.ok()}},mounted:function(){var e=this,t=function(t){return-1!==e.format.indexOf(t)};t("s")&&t("m")&&(t("h")||t("H"))?e.m="H":t("D")?e.m="D":t("M")?(e.m="M",e.showMonths=!0):t("Y")&&(e.m="Y",e.showYears=!0)}}},function(e,t){var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{class:""+e.pre},[s("div",{class:e.pre+"-head"},[s("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-prev-decade-btn",on:{click:function(t){e.year-=10}}},[e._v("«")]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-prev-year-btn",on:{click:function(t){e.year--}}},[e._v("«")]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-prev-month-btn",on:{click:e.pm}},[e._v("‹")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-year-select"},[e._v(e._s(e.ys+"-"+e.ye))]),e.local.yearSuffix?[s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-year-select",on:{click:function(t){e.showYears=!e.showYears}}},[e._v(e._s(e.year)+e._s(e.local.yearSuffix))]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-month-select",on:{click:function(t){e.showMonths=!e.showMonths}}},[e._v(e._s(e.local.monthsHead[e.month]))])]:[s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-month-select",on:{click:function(t){e.showMonths=!e.showMonths}}},[e._v(e._s(e.local.monthsHead[e.month]))]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-year-select",on:{click:function(t){e.showYears=!e.showYears}}},[e._v(e._s(e.year))])],s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears&&!e.showMonths,expression:"!showYears&&!showMonths"}],class:e.pre+"-next-month-btn",on:{click:e.nm}},[e._v("›")]),s("a",{directives:[{name:"show",rawName:"v-show",value:!e.showYears,expression:"!showYears"}],class:e.pre+"-next-year-btn",on:{click:function(t){e.year++}}},[e._v("»")]),s("a",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-next-decade-btn",on:{click:function(t){e.year+=10}}},[e._v("»")])],2),s("div",{class:e.pre+"-body"},[s("div",{class:e.pre+"-days"},[e._l(e.local.weeks,function(t){return s("a",{class:e.pre+"-week"},[e._v(e._s(t))])}),e._l(e.days,function(t){return s("a",{class:[t.p||t.n?e.pre+"-date-out":"",e.status(t.y,t.m,t.i,e.hour,e.minute,e.second,"YYYYMMDD")],on:{click:function(s){e.is(s)&&(e.day=t.i,e.ok(t))}}},[e._v(e._s(t.i))])})],2),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showMonths,expression:"showMonths"}],class:e.pre+"-months"},e._l(e.local.months,function(t,n){return s("a",{class:[e.status(e.year,n,e.day,e.hour,e.minute,e.second,"YYYYMM")],on:{click:function(t){e.is(t)&&(e.showMonths="M"===e.m,e.month=n,"M"===e.m&&e.ok())}}},[e._v(e._s(t))])})),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showYears,expression:"showYears"}],class:e.pre+"-years"},e._l(e.years,function(t,n){return s("a",{class:[0===n||11===n?e.pre+"-date-out":"",e.status(t,e.month,e.day,e.hour,e.minute,e.second,"YYYY")],on:{click:function(s){e.is(s)&&(e.showYears="Y"===e.m,e.year=t,"Y"===e.m&&e.ok())}}},[e._v(e._s(t))])})),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showHours,expression:"showHours"}],class:e.pre+"-hours"},[s("div",{class:e.pre+"-title"},[e._v(e._s(e.local.hourTip))]),e._l(24,function(t,n){return s("a",{class:[e.status(e.year,e.month,e.day,n,e.minute,e.second,"YYYYMMDDHH")],on:{click:function(t){e.is(t)&&(e.showHours=!1,e.hour=n,e.ok("h"))}}},[e._v(e._s(n))])})],2),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showMinutes,expression:"showMinutes"}],class:e.pre+"-minutes"},[s("div",{class:e.pre+"-title"},[e._v(e._s(e.local.minuteTip))]),e._l(60,function(t,n){return s("a",{class:[e.status(e.year,e.month,e.day,e.hour,n,e.second,"YYYYMMDDHHmm")],on:{click:function(t){e.is(t)&&(e.showMinutes=!1,e.minute=n,e.ok("h"))}}},[e._v(e._s(n))])})],2),s("div",{directives:[{name:"show",rawName:"v-show",value:e.showSeconds,expression:"showSeconds"}],class:e.pre+"-seconds"},[s("div",{class:e.pre+"-title"},[e._v(e._s(e.local.secondTip))]),e._l(60,function(t,n){return s("a",{class:[e.status(e.year,e.month,e.day,e.hour,e.minute,n,"YYYYMMDDHHmmss")],on:{click:function(t){e.is(t)&&(e.showSeconds=!1,e.second=n,e.ok("h"))}}},[e._v(e._s(n))])})],2)]),"H"===e.m?s("div",{class:e.pre+"-foot"},[s("div",{class:e.pre+"-hour"},[s("a",{class:{on:e.showHours},attrs:{title:e.local.hourTip},on:{click:function(t){e.showHours=!e.showHours,e.showMinutes=e.showSeconds=!1}}},[e._v(e._s(e._f("dd")(e.hour)))]),s("span",[e._v(":")]),s("a",{class:{on:e.showMinutes},attrs:{title:e.local.minuteTip},on:{click:function(t){e.showMinutes=!e.showMinutes,e.showHours=e.showSeconds=!1}}},[e._v(e._s(e._f("dd")(e.minute)))]),s("span",[e._v(":")]),s("a",{class:{on:e.showSeconds},attrs:{title:e.local.secondTip},on:{click:function(t){e.showSeconds=!e.showSeconds,e.showHours=e.showMinutes=!1}}},[e._v(e._s(e._f("dd")(e.second)))])])]):e._e()])},n=[];e.exports={render:s,staticRenderFns:n}},function(e,t){var s=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"datepicker",class:{"datepicker-range":e.range,datepicker__clearable:e.clearable&&e.text&&!e.disabled}},["inline"!==e.type?s("input",{class:[e.show?"focus":"",e.inputClass],attrs:{readonly:"",disabled:e.disabled,placeholder:e.placeholder,name:e.name},domProps:{value:e.text}}):e._e(),s("a",{staticClass:"datepicker-close",on:{click:function(t){t.stopPropagation(),e.cls(t)}}}),s("transition",{attrs:{name:"datepicker-anim"}},[e.show||"inline"===e.type?s("div",{staticClass:"datepicker-popup",class:[e.popupClass,{"datepicker-inline":"inline"===e.type}],attrs:{tabindex:"-1"}},[e.range?[s("vue-datepicker-local-calendar",{attrs:{left:!0},model:{value:e.dates[0],callback:function(t){e.$set(e.dates,0,t)},expression:"dates[0]"}}),s("vue-datepicker-local-calendar",{attrs:{right:!0},model:{value:e.dates[1],callback:function(t){e.$set(e.dates,1,t)},expression:"dates[1]"}})]:[s("vue-datepicker-local-calendar",{model:{value:e.dates[0],callback:function(t){e.$set(e.dates,0,t)},expression:"dates[0]"}})],e.showButtons?s("div",{staticClass:"datepicker__buttons"},[s("button",{staticClass:"datepicker__button-cancel",on:{click:function(t){t.stopPropagation(),e.cancel(t)}}},[e._v(e._s(this.local.cancelTip))]),s("button",{staticClass:"datepicker__button-select",on:{click:function(t){t.stopPropagation(),e.submit(t)}}},[e._v(e._s(this.local.submitTip))])]):e._e()],2):e._e()])],1)},n=[];e.exports={render:s,staticRenderFns:n}}])}); \ No newline at end of file diff --git a/example/App.vue b/example/App.vue index 052c3ef..880f2d1 100644 --- a/example/App.vue +++ b/example/App.vue @@ -2,9 +2,9 @@


-
-
-
+
+
+


@@ -44,9 +44,9 @@ export default { disabledDate (time) { return time < this.min || time > this.max }, - selectedDate (selectedRange) { + selectedDate (date) { console.log('You have been selected:') - console.log(selectedRange) + console.log(date) } } } diff --git a/package.json b/package.json index 6082d02..ba777e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vue-datepicker-local", - "version": "1.0.9", + "version": "1.0.10", "description": "A datepicker for Vue.js", "main": "src/index.js", "files": [ diff --git a/src/VueDatepickerLocal.vue b/src/VueDatepickerLocal.vue index 711893d..0d92a14 100644 --- a/src/VueDatepickerLocal.vue +++ b/src/VueDatepickerLocal.vue @@ -7,14 +7,14 @@ +
+ + +
@@ -67,7 +67,7 @@ export default { months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), // months of panel weeks: '一_二_三_四_五_六_日'.split('_'), // weeks cancelTip: '取消', // default text for cancel button - submitTip: '提交' // default text for submit button + submitTip: '确定' // default text for submit button } } }, @@ -103,6 +103,9 @@ export default { } }, methods: { + get () { + return Array.isArray(this.value) ? this.dates : this.dates[0] + }, cls () { this.$emit('input', this.range ? [] : '') }, @@ -115,8 +118,8 @@ export default { }, ok () { const $this = this - $this.$emit('input', Array.isArray($this.value) ? $this.dates : $this.dates[0]) - setTimeout(() => { + $this.$emit('input', $this.get()) + !$this.showButtons && setTimeout(() => { $this.show = $this.range }) }, @@ -154,7 +157,7 @@ export default { this.show = this.$el.contains(e.target) && !this.disabled }, submit () { - this.$emit('dateRangeSelect', this.dates) + this.$emit('confirm', this.get()) this.show = false }, cancel () { @@ -319,8 +322,7 @@ export default { font-size: 13px; border: none; cursor: pointer; - margin: 10px 0 10px 5px; - font-weight: 600; + margin: 10px 0 0 5px; padding: 5px 15px; color: #ffffff; } diff --git a/webpack.config.js b/webpack.config.js index 8bef4b5..e01fca0 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,7 +2,7 @@ const path = require('path') const webpack = require('webpack') const ExtractTextPlugin = require('extract-text-webpack-plugin') const banner = - 'vue-datetime-local.js v1.0.9\n' + + 'vue-datetime-local.js v1.0.10\n' + '(c) 2017-' + new Date().getFullYear() + ' weifeiyue\n' + 'Released under the MIT License.' module.exports = {