├── .browserslistrc ├── .circleci └── config.yml ├── .editorconfig ├── .eslintrc.js ├── .gitignore ├── LICENSE ├── README.md ├── babel.config.js ├── cypress.json ├── demo_vue_hotel_picker_desktop.png ├── demo_vue_hotel_picker_mobile.png ├── docs ├── favicon.ico ├── img │ └── vue-logo.82b9c7a5.png ├── index.html ├── js │ ├── app.b3a0f7a0.js │ ├── app.b3a0f7a0.js.map │ ├── chunk-vendors.61bc5260.js │ └── chunk-vendors.61bc5260.js.map ├── precache-manifest.6e88207729253afd2e7e1d9ea71db2d8.js └── service-worker.js ├── jest.config.js ├── lib ├── demo.html ├── vue-hotel-datepicker.common.js ├── vue-hotel-datepicker.common.js.map ├── vue-hotel-datepicker.umd.js ├── vue-hotel-datepicker.umd.js.map ├── vue-hotel-datepicker.umd.min.js └── vue-hotel-datepicker.umd.min.js.map ├── package-lock.json ├── package.json ├── postcss.config.js ├── public ├── favicon.ico └── index.html ├── src ├── App.vue ├── assets │ ├── baseline-arrow_back-24px.svg │ ├── baseline-arrow_back_ios-24px.svg │ ├── baseline-arrow_forward-24px.svg │ ├── baseline-arrow_forward_ios-24px.svg │ ├── baseline-check-24px.svg │ ├── baseline-chevron_left-24px.svg │ ├── baseline-chevron_right-24px.svg │ ├── baseline-clear-24px.svg │ ├── baseline-close-24px.svg │ └── vue-logo.png ├── components │ ├── VueHotelDatepicker.vue │ ├── VueHotelDatepickerModal.vue │ └── icon │ │ ├── IconArrowBack.vue │ │ ├── IconArrowForward.vue │ │ ├── IconChevronLeft.vue │ │ ├── IconChevronRight.vue │ │ └── IconClose.vue ├── main.js └── views │ ├── Demo.vue │ └── Demo2.vue ├── tests ├── e2e │ ├── .eslintrc.js │ ├── plugins │ │ └── index.js │ ├── specs │ │ └── test.js │ └── support │ │ ├── commands.js │ │ └── index.js └── unit │ ├── .eslintrc.js │ └── example.spec.js └── vue.config.js /.browserslistrc: -------------------------------------------------------------------------------- 1 | > 1% 2 | last 2 versions 3 | not ie <= 8 4 | -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: circleci/node:latest 6 | steps: 7 | - checkout 8 | - run: echo "Github pages building job." 9 | test: 10 | docker: 11 | - image: circleci/node:latest 12 | steps: 13 | - checkout 14 | - run: echo "Github pages testing job." 15 | 16 | workflows: 17 | version: 2 18 | build_and_test: 19 | jobs: 20 | - build 21 | - test -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{js,jsx,ts,tsx,vue}] 2 | indent_style = space 3 | indent_size = 2 4 | trim_trailing_whitespace = true 5 | insert_final_newline = true 6 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | env: { 4 | node: true 5 | }, 6 | 'extends': [ 7 | 'plugin:vue/essential', 8 | '@vue/standard' 9 | ], 10 | rules: { 11 | 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', 12 | 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' 13 | }, 14 | parserOptions: { 15 | parser: 'babel-eslint' 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | /coverage 5 | 6 | /tests/e2e/videos/ 7 | /tests/e2e/screenshots/ 8 | 9 | # local env files 10 | .env.local 11 | .env.*.local 12 | 13 | # Log files 14 | npm-debug.log* 15 | yarn-debug.log* 16 | yarn-error.log* 17 | 18 | # Editor directories and files 19 | .idea 20 | .vscode 21 | *.suo 22 | *.ntvs* 23 | *.njsproj 24 | *.sln 25 | *.sw* 26 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Northwalker 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | npm 3 | build 4 | license 5 | code Style 6 | 7 | # vue-hotel-datepicker 8 | 9 | A pure [Vue.js](https://vuejs.org/) date range picker component without any other dependencies, for hotels date range selection and multi-purpose. Vue hotel datepicker provide date range selecting, minimum and maximum night limitation, custom methods for date restriction, custom date formating and localization support. 10 | 11 | ## Demo 12 | 13 | ### Live demo(Github page) 14 | [https://northwalker.github.io/vue-hotel-datepicker/](https://northwalker.github.io/vue-hotel-datepicker/) 15 | 16 | ### Desktop capture preview 17 | 18 | 19 | ### Mobile capture preview 20 | 21 | 22 | ### Previous version 23 | v1.0.0: [Document](https://github.com/northwalker/vue-hotel-datepicker/tree/v1.0.0) 24 | 25 | ## Installation 26 | 27 | Use ```npm``` or ```yarn``` for installation 28 | ```bash 29 | $ npm install @northwalker/vue-hotel-datepicker 30 | # OR 31 | $ yarn add @northwalker/vue-hotel-datepicker 32 | ``` 33 | 34 | ## Usage 35 | 36 | Method 1: Import component in `.vue` file 37 | 38 | ```vue 39 | 42 | 43 | 55 | ``` 56 | 57 | Method 2: Via static javascript in `html` file 58 | 59 | Download this repo and copy file ```/lib/vue-hotel-datepicker.umd.min.js``` to ```//```, and add below code to your html file. 60 | 61 | ```html 62 | 63 | ``` 64 | 65 | ## Props/Options 66 | 67 | ### placeholder 68 | - Type: `String` 69 | - Default: `'Select a date range'` 70 | 71 | The input placeholder text 72 | 73 | ### format 74 | 75 | - Type: `String` 76 | - Default: `'YYYY-MM-DD'` 77 | 78 | The date format string. 79 | 80 | ### separator 81 | 82 | - Type: `String` 83 | - Default: `' ~ '` 84 | 85 | The separator string used between date strings. 86 | 87 | ### startDate 88 | 89 | - Type: `Date` or `String` 90 | - Default: `undefined` 91 | 92 | The start date of given date range. 93 | 94 | ### endDate 95 | 96 | - Type: `Date` or `String` 97 | - Default: `undefined` 98 | 99 | The end date of given date range. 100 | 101 | ### minDate 102 | 103 | - Type: `Date` or `String` 104 | - Default: today midnight. 105 | 106 | The start view date. All the dates before this date will be disabled. 107 | If preset `startDate` less than `minDate`, `minDate` will reset to preset `startDate`. 108 | 109 | ### maxDate 110 | 111 | - Type: `Date` or `String` or `Boolean` 112 | - Default: `false` 113 | 114 | The end view date. All the dates after this date will be disabled. 115 | 116 | ### minNight 117 | 118 | - Type: `Number` 119 | - Default: `0` 120 | 121 | Minimum nights required to select a range of dates. 122 | 123 | ### maxNight 124 | 125 | - Type: `Number` 126 | - Default: `0` 127 | 128 | Maximum nights required to select a range of dates. 129 | 130 | ### selectForward 131 | 132 | - Type: `Boolean` 133 | - Default: `false` 134 | 135 | If `true`, The selection of the second date must be after the first date. 136 | If `false`, you can select a range of dates in both directions. 137 | 138 | ### disabledDates 139 | 140 | - Type: `Array` 141 | - Default: `[]` 142 | 143 | An array of strings by props format value, default `'YYYY-MM-DD'` (as same as default `format`). All the dates passed to the list can not be selected as a start and end date. 144 | 145 | ### weekList 146 | - Type: `Array` 147 | - Default: `['Sun.', 'Mon.', 'Tue.', 'Wen.', 'Thu.', 'Fri.', 'Sat.']` 148 | - Example with i18n `zh-tw`: `['週一', '週二', '週三', '週四', '週五', '週六', '週日']` 149 | 150 | A array of strings for week text. 151 | 152 | ### monthList 153 | - Type: `Array` 154 | - Default: `['Jan.', 'Feb.', 'Mar.', 'Apr.', 'May.', 'Jun.', 'Jul.', 'Aug.', 'Sep.', 'Oct', 'Nov.', 'Dec.']` 155 | - Example with i18n `zh-tw`: `['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']` 156 | 157 | A array of strings for month text. 158 | 159 | ### fromText 160 | - Type: `String` 161 | - Default: `'From'` 162 | - Example with i18n `zh-tw`: `'從'` 163 | 164 | Text of label "From". 165 | 166 | ### toText 167 | - Type: `String` 168 | - Default: `'To'` 169 | - Example with i18n `zh-tw`: `'到'` 170 | 171 | Text of label "To". 172 | 173 | ### resetText 174 | - Type: `String` 175 | - Default: `'Reset'` 176 | - Example with i18n `zh-tw`: `'重設'` 177 | 178 | Text of button "Reset" 179 | 180 | ### confirmText 181 | - Type: `String` 182 | - Default: `'Confirm'` 183 | - Example with i18n `zh-tw`: `'確認'` 184 | 185 | Text of button "Confirm" 186 | 187 | ### mobile 188 | - Type: `String` 189 | - Default: `''` 190 | - value: `'mobile'` or `'desktop'` or `''` 191 | 192 | Display in mobile or desktop date picker style version, default will depend on common brower's width. 193 | 194 | ## Events 195 | 196 | ### update 197 | When a new date is selected, ```VueHotelDatepicker``` will emit an event ```update```, passing the new date range object to parent component. 198 | 199 | Date range Object: 200 | ```javacript 201 | { 202 | start: 'YYYY-MM-DD', 203 | end: 'YYYY-MM-DD' 204 | } 205 | ``` 206 | 207 | ### confirm 208 | When a confirm button click, passing the new date range object to parent component (as same as event `'update'`). 209 | 210 | ### close 211 | when a cancellation button click or occurred, ```VueHotelDatepicker``` will emit an event ```close``` to notify parent component. 212 | 213 | ### reset 214 | when a reset button click or occurred, ```VueHotelDatepicker``` will emit an event ```reset``` to notify parent component. 215 | 216 | ## License 217 | [MIT License](http://opensource.org/licenses/MIT) 218 | 219 | Copyright © 2019 [Northwalker](https://northwalker.github.io) -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/app' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "pluginsFile": "tests/e2e/plugins/index.js" 3 | } 4 | -------------------------------------------------------------------------------- /demo_vue_hotel_picker_desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/northwalker/vue-hotel-datepicker/6780b2b2505908b99d71f638cc17c6a4c475a7a1/demo_vue_hotel_picker_desktop.png -------------------------------------------------------------------------------- /demo_vue_hotel_picker_mobile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/northwalker/vue-hotel-datepicker/6780b2b2505908b99d71f638cc17c6a4c475a7a1/demo_vue_hotel_picker_mobile.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/northwalker/vue-hotel-datepicker/6780b2b2505908b99d71f638cc17c6a4c475a7a1/docs/favicon.ico -------------------------------------------------------------------------------- /docs/img/vue-logo.82b9c7a5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/northwalker/vue-hotel-datepicker/6780b2b2505908b99d71f638cc17c6a4c475a7a1/docs/img/vue-logo.82b9c7a5.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | Vue Hotel Datepicker by Northwalker
-------------------------------------------------------------------------------- /docs/js/app.b3a0f7a0.js: -------------------------------------------------------------------------------- 1 | (function(t){function e(e){for(var i,s,o=e[0],d=e[1],l=e[2],h=0,f=[];hthis.selectStartDate.getTime()&&(this.selectMinDate=new Date(a)),this.endDate){var i="string"===typeof this.endDate?this.endDate:this.endDate.getTime();this.selectEndDate=new Date(i)}else this.selectEndDate=new Date(this.selectStartDate.getTime()+864e5);this.updateValue()}this.updateCalendar()},mounted:function(){},methods:{toggle:function(t){if("focus"===t.type)return this.active=!0,!0;this.active=!this.active},close:function(){this.active=!1,this.$emit("close")},reset:function(){this.selectStartDate=void 0,this.selectEndDate=void 0,this.value="",this.$emit("reset")},confirm:function(){if(this.selectStartDate&&!this.selectEndDate&&(this.selectEndDate=new Date(this.selectStartDate.getTime()),this.selectEndDate.setDate(this.selectStartDate.getDate()+1),this.updateValue()),this.selectStartDate&&this.selectEndDate){var t={start:this.displayDateText(this.selectStartDate),end:this.displayDateText(this.selectEndDate)};this.$emit("confirm",t),this.active=!1}},displayDateText:function(t){if(t){t="string"===typeof t?new Date(t):t;var e=t.getFullYear(),a=t.getMonth()+1>9?t.getMonth()+1:"0".concat(t.getMonth()+1),i=t.getDate()>9?t.getDate():"0".concat(t.getDate()),n=(this.format||"YYYY/MM/DD").replace("YYYY",e).replace("MM",a).replace("DD",i);return n}},generateCalendar:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(new Date).getFullYear(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(new Date).getMonth(),a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=a.showPreviousMonthDate||!1,n=a.showNextMonthDate||!1,r=new Date(t,e,1,0,0,0),s=new Date(t,e,1,0,0,0),o=[],d=[],l=!1,c=!1;while(!l||l&&!c){var h=s.getDay(),f=s.getDate(),v=s.getMonth();if(v!==e&&(l=!0,(6===h||1===f&&0===h)&&(c=!0)),d[h]=l?!!n&&new Date(s.getTime()):new Date(s.getTime()),s.getTime()===r.getTime()&&0!==h){var p=h,u=new Date(s.getTime());if(u.setDate(u.getDate()),i)while(0!==p){var g=new Date(u.getTime());p=g.getDay(),d[p]=g,u.setDate(u.getDate()-1)}}(s.getTime()===r.getTime()&&7===d.length||s.getTime()>r&&6===h)&&(o.push(d),d=[]),s.setDate(s.getDate()+1)}return o},updateCalendar:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.startMonthDate||(this.startMonthDate=this.selectStartDate?new Date(this.selectStartDate.getTime()):new Date((new Date).getFullYear(),(new Date).getMonth())),this.startMonthDate.setMonth(this.startMonthDate.getMonth()+t),this.endMonthDate=new Date(this.startMonthDate.getFullYear(),this.startMonthDate.getMonth()+1),this.startMonthAry=[],this.endMonthAry=[],this.startMonthAry=this.generateCalendar(this.startMonthDate.getFullYear(),this.startMonthDate.getMonth()),this.endMonthAry=this.generateCalendar(this.endMonthDate.getFullYear(),this.endMonthDate.getMonth())},updateValue:function(){this.value="".concat(this.displayDateText(this.selectStartDate)," ").concat(this.separator," ").concat(this.displayDateText(this.selectEndDate))},disabledPreviousArrow:function(t){var e=new Date,a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);if(t&&this.selectForward)if(this.selectMinDate){if(t.getFullYear()t.getTime()?e.push("disabled"):this.selectMaxDate&&this.selectMaxDate.getTime()-1?(e.push("disabled"),e.push("forbidden")):this.selectStartDate&&this.selectStartDate.getTime()>t.getTime()&&!this.selectForward?e.push("disabled"):this.selectStartDate&&this.selectStartDate.getTime()===t.getTime()?e.push("start-date"):this.selectEndDate&&this.selectEndDate.getTime()===t.getTime()?e.push("end-date"):this.selectStartDate&&this.selectEndDate&&t.getTime()>this.selectStartDate.getTime()&&t.getTime()0||Number.isInteger(this.maxNight)&&this.maxNight>0)){var i=Math.abs(t.getTime()-this.selectStartDate.getTime())/864e5;ithis.maxNight&&e.push("disabled")}a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()&&e.push("today")}return e},dayOnClick:function(t){if(t){if(this.selectStartDate?this.selectEndDate?t.getTime()this.selectEndDate.getTime()?this.selectEndDate=t:t.getTime()>this.selectStartDate.getTime()&&t.getTime()e&&(this.selectEndDate=new Date(e))}if(this.selectStartDate&&this.selectEndDate&&this.minNight){var a=this.selectStartDate.getTime()+1e3*this.minNight*60*60*24;this.selectEndDate.getTime()9?t.getMonth()+1:"0".concat(t.getMonth()+1),i=t.getDate()>9?t.getDate():"0".concat(t.getDate()),n=(this.format||"YYYY/MM/DD").replace("YYYY",e).replace("MM",a).replace("DD",i);return n}return null}}},N=A,H=(a("dd39"),Object(p["a"])(N,s,o,!1,null,null,null)),V=H.exports,O={name:"app",components:{Demo:V},data:function(){return{}},methods:{}},$=O,j=(a("5c0b"),Object(p["a"])($,n,r,!1,null,null,null)),I=j.exports;i["a"].config.productionTip=!1,new i["a"]({render:function(t){return t(I)}}).$mount("#app")},"5c0b":function(t,e,a){"use strict";var i=a("e959"),n=a.n(i);n.a},a33e:function(t,e,a){e=t.exports=a("2350")(!1),e.push([t.i,"*{-webkit-box-sizing:border-box;box-sizing:border-box}#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50;padding:60px}a.app-link{margin-right:16px;font-weight:500;color:#08f;text-decoration:none;-webkit-transition:color .4s ease;transition:color .4s ease}@media (hover:hover){a.app-link:hover{color:#005299}}.text-center{text-align:center}",""])},b9a0:function(t,e,a){e=t.exports=a("2350")(!1),e.push([t.i,'*[data-v-0cb4ff92]{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Avenir,Helvetica,Arial,sans-serif}svg[data-v-0cb4ff92]{fill:#7d7d7d}@media (hover:hover){svg[data-v-0cb4ff92]:hover{fill:#4a4a4a}}.vhd-container.mobile .vhd-picker[data-v-0cb4ff92]{width:300px;padding:8px}.vhd-container.mobile .vhd-calendar-header[data-v-0cb4ff92]{height:60px}.vhd-container.mobile .vhd-calendar-header>.info[data-v-0cb4ff92]{display:block;width:100%;height:60px;padding-top:36px}.vhd-container.mobile .vhd-calendar-left[data-v-0cb4ff92]{width:100%;margin-right:0}.vhd-container.mobile .vhd-calendar-right[data-v-0cb4ff92],.vhd-container.mobile .vhd-calendar .calendar-month .previous-arrow.offset-2[data-v-0cb4ff92]{display:none}.vhd-container.mobile .vhd-calendar .calendar-month .next-arrow.offset-1[data-v-0cb4ff92],.vhd-container.mobile .vhd-calendar .calendar-month .previous-arrow.offset-1[data-v-0cb4ff92]{display:inline-block}.vhd-container.mobile .vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]{width:14.28571%}.vhd-container.mobile .vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]{color:#fff;border-left:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}.vhd-container.mobile .vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]{color:#fff;border-right:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}.vhd-container[data-v-0cb4ff92]{display:inline-block;position:relative}.vhd-input[data-v-0cb4ff92]{min-width:300px;padding:8px;border:1px solid #eee;color:#505050;font-size:16px;line-height:32px;outline:none}.vhd-input[data-v-0cb4ff92]::-webkit-input-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]::-moz-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]:-ms-input-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]::-ms-input-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]::placeholder{color:#ccc}.vhd-picker[data-v-0cb4ff92]{z-index:100;position:absolute;left:0;width:648px;min-height:420px;padding:24px;background-color:#fff;border-radius:6px;-webkit-box-shadow:0 2px 30px 0 rgba(0,0,0,.27);box-shadow:0 2px 30px 0 rgba(0,0,0,.27);overflow:hidden}.vhd-calendar-header[data-v-0cb4ff92]{position:relative;width:100%;height:36px}.vhd-calendar-header>.info[data-v-0cb4ff92]{display:inline-block;width:calc(100% - 24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vhd-calendar-header>.info .from-date[data-v-0cb4ff92],.vhd-calendar-header>.info .to-date[data-v-0cb4ff92]{margin:0 8px;font-weight:700}.vhd-calendar-header>a.close[data-v-0cb4ff92]{position:absolute;right:0;width:24px;height:24px;cursor:pointer}.vhd-calendar-footer[data-v-0cb4ff92]{position:relative;width:100%;height:36px}.vhd-calendar-footer .confirm[data-v-0cb4ff92],.vhd-calendar-footer .reset[data-v-0cb4ff92]{position:absolute;bottom:0;margin:8px 0;padding:0 8px;font-weight:500;cursor:pointer}.vhd-calendar-footer .reset[data-v-0cb4ff92]{left:0;color:#7d7d7d}@media (hover:hover){.vhd-calendar-footer .reset[data-v-0cb4ff92]:hover{color:#4a4a4a}}.vhd-calendar-footer .confirm[data-v-0cb4ff92]{right:0;color:#08f}@media (hover:hover){.vhd-calendar-footer .confirm[data-v-0cb4ff92]:hover{color:#005299}}.vhd-calendar-left[data-v-0cb4ff92],.vhd-calendar-right[data-v-0cb4ff92]{display:inline-block;vertical-align:top;width:280px}.vhd-calendar-left[data-v-0cb4ff92]{margin-right:40px}.vhd-calendar .calendar-month[data-v-0cb4ff92]{position:relative;height:32px;margin-bottom:8px}.vhd-calendar .calendar-month .next-arrow[data-v-0cb4ff92],.vhd-calendar .calendar-month .previous-arrow[data-v-0cb4ff92]{position:absolute;top:0;padding-top:4px;cursor:pointer}.vhd-calendar .calendar-month .next-arrow.disabled[data-v-0cb4ff92],.vhd-calendar .calendar-month .previous-arrow.disabled[data-v-0cb4ff92]{display:none!important}.vhd-calendar .calendar-month .previous-arrow[data-v-0cb4ff92]{left:0}.vhd-calendar .calendar-month .next-arrow[data-v-0cb4ff92]{right:0}.vhd-calendar .calendar-month .next-arrow.offset-1[data-v-0cb4ff92],.vhd-calendar .calendar-month .previous-arrow.offset-1[data-v-0cb4ff92]{display:none}.vhd-calendar .calendar-month-title[data-v-0cb4ff92]{margin:8px 0;font-size:20px;font-weight:500;line-height:1.6;text-align:center;color:#505050}.vhd-calendar .calendar-week[data-v-0cb4ff92]{width:100%;height:32px}.vhd-calendar .calendar-week-item[data-v-0cb4ff92]{float:left;display:inline-block;font-size:12px;font-weight:500;width:14.28571%;height:20px;color:#505050;text-align:center;line-height:20px}.vhd-calendar .calendar-date .week[data-v-0cb4ff92]{display:block;width:100%;height:40px}.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]{float:left;position:relative;display:inline-block;width:40px;height:40px;font-size:16px;font-weight:500;line-height:40px;color:#505050;background-color:transparent;text-align:center;cursor:pointer;-webkit-transition:background-color .4s cubic-bezier(.165,.84,.44,1);transition:background-color .4s cubic-bezier(.165,.84,.44,1)}.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]:after,.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]:before{content:"";position:absolute;width:0;height:100%;left:0;background-color:transparent;opacity:0;-webkit-transition:opacity .4s cubic-bezier(.165,.84,.44,1),background-color .4s cubic-bezier(.165,.84,.44,1),width .4s cubic-bezier(.165,.84,.44,1);transition:opacity .4s cubic-bezier(.165,.84,.44,1),background-color .4s cubic-bezier(.165,.84,.44,1),width .4s cubic-bezier(.165,.84,.44,1)}.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]:after{left:auto;right:0}.vhd-calendar .calendar-date .week .day.disabled[data-v-0cb4ff92]{color:#ececec;pointer-events:none}.vhd-calendar .calendar-date .week .day.in-date-range[data-v-0cb4ff92]{background-color:#b2d7ff}.vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]{position:relative;background-color:#b2d7ff}.vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]:before{width:4px;background-color:#08f;opacity:1}.vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]{position:relative;background-color:#b2d7ff}.vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]:after{width:4px;background-color:#08f;opacity:1;-webkit-transition:opacity .2s cubic-bezier(.165,.84,.44,1),background-color .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1);transition:opacity .2s cubic-bezier(.165,.84,.44,1),background-color .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}.vhd-calendar .calendar-date .week .day.today[data-v-0cb4ff92]{border:1px solid #08f}.vhd-calendar .calendar-date .week .day.forbidden[data-v-0cb4ff92]{color:#fed9d8;cursor:not-allowed}@media only screen and (max-width:767.98px){.vhd-container:not(.desktop) .vhd-picker[data-v-0cb4ff92]{width:300px;padding:8px}.vhd-container:not(.desktop) .vhd-calendar-header[data-v-0cb4ff92]{height:60px}.vhd-container:not(.desktop) .vhd-calendar-header>.info[data-v-0cb4ff92]{display:block;width:100%;height:60px;padding-top:36px}.vhd-container:not(.desktop) .vhd-calendar-left[data-v-0cb4ff92]{width:100%;margin-right:0}.vhd-container:not(.desktop) .vhd-calendar-right[data-v-0cb4ff92],.vhd-container:not(.desktop) .vhd-calendar .calendar-month .previous-arrow.offset-2[data-v-0cb4ff92]{display:none}.vhd-container:not(.desktop) .vhd-calendar .calendar-month .next-arrow.offset-1[data-v-0cb4ff92],.vhd-container:not(.desktop) .vhd-calendar .calendar-month .previous-arrow.offset-1[data-v-0cb4ff92]{display:inline-block}.vhd-container:not(.desktop) .vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]{width:14.28571%}.vhd-container:not(.desktop) .vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]{color:#fff;border-left:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}.vhd-container:not(.desktop) .vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]{color:#fff;border-right:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}}',""])},dd39:function(t,e,a){"use strict";var i=a("55a0"),n=a.n(i);n.a},e959:function(t,e,a){var i=a("a33e");"string"===typeof i&&(i=[[t.i,i,""]]),i.locals&&(t.exports=i.locals);var n=a("499e").default;n("6f19147e",i,!0,{sourceMap:!1,shadowMode:!1})},f867:function(t,e,a){e=t.exports=a("2350")(!1),e.push([t.i,".demo{margin-bottom:200px}.demo-example{margin-bottom:60px}.demo code{padding:4px;color:#08f;font-weight:700;background-color:#ececec;border-radius:4px}",""])}}); 2 | //# sourceMappingURL=app.b3a0f7a0.js.map -------------------------------------------------------------------------------- /docs/precache-manifest.6e88207729253afd2e7e1d9ea71db2d8.js: -------------------------------------------------------------------------------- 1 | self.__precacheManifest = [ 2 | { 3 | "revision": "d762c3662b1b4089688e", 4 | "url": "/vue-hotel-datepicker/js/app.b3a0f7a0.js" 5 | }, 6 | { 7 | "revision": "5ef125f3e3f8ab3d9f7d", 8 | "url": "/vue-hotel-datepicker/js/chunk-vendors.61bc5260.js" 9 | }, 10 | { 11 | "revision": "82b9c7a5a3f405032b1db71a25f67021", 12 | "url": "/vue-hotel-datepicker/img/vue-logo.82b9c7a5.png" 13 | }, 14 | { 15 | "revision": "189bb1334e3d0c637bd98cd9b73252a7", 16 | "url": "/vue-hotel-datepicker/index.html" 17 | } 18 | ]; -------------------------------------------------------------------------------- /docs/service-worker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Welcome to your Workbox-powered service worker! 3 | * 4 | * You'll need to register this file in your web app and you should 5 | * disable HTTP caching for this file too. 6 | * See https://goo.gl/nhQhGp 7 | * 8 | * The rest of the code is auto-generated. Please don't update this file 9 | * directly; instead, make changes to your Workbox build configuration 10 | * and re-run your build process. 11 | * See https://goo.gl/2aRDsh 12 | */ 13 | 14 | importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); 15 | 16 | importScripts( 17 | "/vue-hotel-datepicker/precache-manifest.6e88207729253afd2e7e1d9ea71db2d8.js" 18 | ); 19 | 20 | workbox.core.setCacheNameDetails({prefix: "@northwalker/vue-hotel-datepicker"}); 21 | 22 | /** 23 | * The workboxSW.precacheAndRoute() method efficiently caches and responds to 24 | * requests for URLs in the manifest. 25 | * See https://goo.gl/S9QRab 26 | */ 27 | self.__precacheManifest = [].concat(self.__precacheManifest || []); 28 | workbox.precaching.suppressWarnings(); 29 | workbox.precaching.precacheAndRoute(self.__precacheManifest, {}); 30 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | moduleFileExtensions: [ 3 | 'js', 4 | 'jsx', 5 | 'json', 6 | 'vue' 7 | ], 8 | transform: { 9 | '^.+\\.vue$': 'vue-jest', 10 | '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', 11 | '^.+\\.jsx?$': 'babel-jest' 12 | }, 13 | moduleNameMapper: { 14 | '^@/(.*)$': '/src/$1' 15 | }, 16 | snapshotSerializers: [ 17 | 'jest-serializer-vue' 18 | ], 19 | testMatch: [ 20 | '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' 21 | ], 22 | testURL: 'http://localhost/' 23 | } 24 | -------------------------------------------------------------------------------- /lib/demo.html: -------------------------------------------------------------------------------- 1 | 2 | vue-hotel-datepicker demo 3 | 4 | 5 | 6 | 7 |
8 | 9 |
10 | 11 | 18 | -------------------------------------------------------------------------------- /lib/vue-hotel-datepicker.umd.min.js: -------------------------------------------------------------------------------- 1 | (function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["vue-hotel-datepicker"]=e():t["vue-hotel-datepicker"]=e()})("undefined"!==typeof self?self:this,function(){return function(t){var e={};function a(n){if(e[n])return e[n].exports;var r=e[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)a.d(n,r,function(e){return t[e]}.bind(null,r));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s="fb15")}({"02f4":function(t,e,a){var n=a("4588"),r=a("be13");t.exports=function(t){return function(e,a){var i,o,c=String(r(e)),s=n(a),d=c.length;return s<0||s>=d?t?"":void 0:(i=c.charCodeAt(s),i<55296||i>56319||s+1===d||(o=c.charCodeAt(s+1))<56320||o>57343?t?c.charAt(s):i:t?c.slice(s,s+2):o-56320+(i-55296<<10)+65536)}}},"0390":function(t,e,a){"use strict";var n=a("02f4")(!0);t.exports=function(t,e,a){return e+(a?n(t,e).length:1)}},"0bfb":function(t,e,a){"use strict";var n=a("cb7c");t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},"0d58":function(t,e,a){var n=a("ce10"),r=a("e11e");t.exports=Object.keys||function(t){return n(t,r)}},"11e9":function(t,e,a){var n=a("52a7"),r=a("4630"),i=a("6821"),o=a("6a99"),c=a("69a8"),s=a("c69a"),d=Object.getOwnPropertyDescriptor;e.f=a("9e1e")?d:function(t,e){if(t=i(t),e=o(e,!0),s)try{return d(t,e)}catch(a){}if(c(t,e))return r(!n.f.call(t,e),t[e])}},1495:function(t,e,a){var n=a("86cc"),r=a("cb7c"),i=a("0d58");t.exports=a("9e1e")?Object.defineProperties:function(t,e){r(t);var a,o=i(e),c=o.length,s=0;while(c>s)n.f(t,a=o[s++],e[a]);return t}},"214f":function(t,e,a){"use strict";a("b0c5");var n=a("2aba"),r=a("32e9"),i=a("79e5"),o=a("be13"),c=a("2b4c"),s=a("520a"),d=c("species"),l=!i(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var a="ab".split(t);return 2===a.length&&"a"===a[0]&&"b"===a[1]}();t.exports=function(t,e,a){var u=c(t),h=!i(function(){var e={};return e[u]=function(){return 7},7!=""[t](e)}),p=h?!i(function(){var e=!1,a=/a/;return a.exec=function(){return e=!0,null},"split"===t&&(a.constructor={},a.constructor[d]=function(){return a}),a[u](""),!e}):void 0;if(!h||!p||"replace"===t&&!l||"split"===t&&!f){var v=/./[u],g=a(o,u,""[t],function(t,e,a,n,r){return e.exec===s?h&&!r?{done:!0,value:v.call(e,a,n)}:{done:!0,value:t.call(a,e,n)}:{done:!1}}),b=g[0],m=g[1];n(String.prototype,t,b),r(RegExp.prototype,u,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},"230e":function(t,e,a){var n=a("d3f4"),r=a("7726").document,i=n(r)&&n(r.createElement);t.exports=function(t){return i?r.createElement(t):{}}},2350:function(t,e){function a(t,e){var a=t[1]||"",r=t[3];if(!r)return a;if(e&&"function"===typeof btoa){var i=n(r),o=r.sources.map(function(t){return"/*# sourceURL="+r.sourceRoot+t+" */"});return[a].concat(o).concat([i]).join("\n")}return[a].join("\n")}function n(t){var e=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),a="sourceMappingURL=data:application/json;charset=utf-8;base64,"+e;return"/*# "+a+" */"}t.exports=function(t){var e=[];return e.toString=function(){return this.map(function(e){var n=a(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n}).join("")},e.i=function(t,a){"string"===typeof t&&(t=[[null,t,""]]);for(var n={},r=0;r";e.style.display="none",a("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(r+"script"+o+"document.F=Object"+r+"/script"+o),t.close(),d=t.F;while(n--)delete d[s][i[n]];return d()};t.exports=Object.create||function(t,e){var a;return null!==t?(c[s]=n(t),a=new c,c[s]=null,a[o]=t):a=d(),void 0===e?a:r(a,e)}},"2b4c":function(t,e,a){var n=a("5537")("wks"),r=a("ca5a"),i=a("7726").Symbol,o="function"==typeof i,c=t.exports=function(t){return n[t]||(n[t]=o&&i[t]||(o?i:r)("Symbol."+t))};c.store=n},"2d00":function(t,e){t.exports=!1},"2d95":function(t,e){var a={}.toString;t.exports=function(t){return a.call(t).slice(8,-1)}},"32e9":function(t,e,a){var n=a("86cc"),r=a("4630");t.exports=a("9e1e")?function(t,e,a){return n.f(t,e,r(1,a))}:function(t,e,a){return t[e]=a,t}},"3ab0":function(t,e,a){"use strict";var n=a("4c0d"),r=a.n(n);r.a},4588:function(t,e){var a=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:a)(t)}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"499e":function(t,e,a){"use strict";function n(t,e){for(var a=[],n={},r=0;ra.parts.length&&(n.parts.length=a.parts.length)}else{var o=[];for(r=0;r1&&i.call(o[0],a,function(){for(l=1;l0?r(n(t),9007199254740991):0}},"9e1e":function(t,e,a){t.exports=!a("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},a481:function(t,e,a){"use strict";var n=a("cb7c"),r=a("4bf8"),i=a("9def"),o=a("4588"),c=a("0390"),s=a("5f1b"),d=Math.max,l=Math.min,f=Math.floor,u=/\$([$&`']|\d\d?|<[^>]*>)/g,h=/\$([$&`']|\d\d?)/g,p=function(t){return void 0===t?t:String(t)};a("214f")("replace",2,function(t,e,a,v){return[function(n,r){var i=t(this),o=void 0==n?void 0:n[e];return void 0!==o?o.call(n,i,r):a.call(String(i),n,r)},function(t,e){var r=v(a,t,this,e);if(r.done)return r.value;var f=n(t),u=String(this),h="function"===typeof e;h||(e=String(e));var b=f.global;if(b){var m=f.unicode;f.lastIndex=0}var y=[];while(1){var w=s(f,u);if(null===w)break;if(y.push(w),!b)break;var x=String(w[0]);""===x&&(f.lastIndex=c(u,i(f.lastIndex),m))}for(var D="",k=0,S=0;S=k&&(D+=u.slice(k,_)+O,k=_+M.length)}return D+u.slice(k)}];function g(t,e,n,i,o,c){var s=n+t.length,d=i.length,l=h;return void 0!==o&&(o=r(o),l=u),a.call(c,l,function(a,r){var c;switch(r.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(s);case"<":c=o[r.slice(1,-1)];break;default:var l=+r;if(0===l)return a;if(l>d){var u=f(l/10);return 0===u?a:u<=d?void 0===i[u-1]?r.charAt(1):i[u-1]+r.charAt(1):a}c=i[l-1]}return void 0===c?"":c})}})},aa77:function(t,e,a){var n=a("5ca1"),r=a("be13"),i=a("79e5"),o=a("fdef"),c="["+o+"]",s="​…",d=RegExp("^"+c+c+"*"),l=RegExp(c+c+"*$"),f=function(t,e,a){var r={},c=i(function(){return!!o[t]()||s[t]()!=s}),d=r[t]=c?e(u):o[t];a&&(r[a]=d),n(n.P+n.F*c,"String",r)},u=f.trim=function(t,e){return t=String(r(t)),1&e&&(t=t.replace(d,"")),2&e&&(t=t.replace(l,"")),t};t.exports=f},b0c5:function(t,e,a){"use strict";var n=a("520a");a("5ca1")({target:"RegExp",proto:!0,forced:n!==/./.exec},{exec:n})},b9a0:function(t,e,a){e=t.exports=a("2350")(!1),e.push([t.i,'*[data-v-0cb4ff92]{-webkit-box-sizing:border-box;box-sizing:border-box;font-family:Avenir,Helvetica,Arial,sans-serif}svg[data-v-0cb4ff92]{fill:#7d7d7d}@media (hover:hover){svg[data-v-0cb4ff92]:hover{fill:#4a4a4a}}.vhd-container.mobile .vhd-picker[data-v-0cb4ff92]{width:300px;padding:8px}.vhd-container.mobile .vhd-calendar-header[data-v-0cb4ff92]{height:60px}.vhd-container.mobile .vhd-calendar-header>.info[data-v-0cb4ff92]{display:block;width:100%;height:60px;padding-top:36px}.vhd-container.mobile .vhd-calendar-left[data-v-0cb4ff92]{width:100%;margin-right:0}.vhd-container.mobile .vhd-calendar-right[data-v-0cb4ff92],.vhd-container.mobile .vhd-calendar .calendar-month .previous-arrow.offset-2[data-v-0cb4ff92]{display:none}.vhd-container.mobile .vhd-calendar .calendar-month .next-arrow.offset-1[data-v-0cb4ff92],.vhd-container.mobile .vhd-calendar .calendar-month .previous-arrow.offset-1[data-v-0cb4ff92]{display:inline-block}.vhd-container.mobile .vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]{width:14.28571%}.vhd-container.mobile .vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]{color:#fff;border-left:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}.vhd-container.mobile .vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]{color:#fff;border-right:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}.vhd-container[data-v-0cb4ff92]{display:inline-block;position:relative}.vhd-input[data-v-0cb4ff92]{min-width:300px;padding:8px;border:1px solid #eee;color:#505050;font-size:16px;line-height:32px;outline:none}.vhd-input[data-v-0cb4ff92]::-webkit-input-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]::-moz-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]:-ms-input-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]::-ms-input-placeholder{color:#ccc}.vhd-input[data-v-0cb4ff92]::placeholder{color:#ccc}.vhd-picker[data-v-0cb4ff92]{z-index:100;position:absolute;left:0;width:648px;min-height:420px;padding:24px;background-color:#fff;border-radius:6px;-webkit-box-shadow:0 2px 30px 0 rgba(0,0,0,.27);box-shadow:0 2px 30px 0 rgba(0,0,0,.27);overflow:hidden}.vhd-calendar-header[data-v-0cb4ff92]{position:relative;width:100%;height:36px}.vhd-calendar-header>.info[data-v-0cb4ff92]{display:inline-block;width:calc(100% - 24px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vhd-calendar-header>.info .from-date[data-v-0cb4ff92],.vhd-calendar-header>.info .to-date[data-v-0cb4ff92]{margin:0 8px;font-weight:700}.vhd-calendar-header>a.close[data-v-0cb4ff92]{position:absolute;right:0;width:24px;height:24px;cursor:pointer}.vhd-calendar-footer[data-v-0cb4ff92]{position:relative;width:100%;height:36px}.vhd-calendar-footer .confirm[data-v-0cb4ff92],.vhd-calendar-footer .reset[data-v-0cb4ff92]{position:absolute;bottom:0;margin:8px 0;padding:0 8px;font-weight:500;cursor:pointer}.vhd-calendar-footer .reset[data-v-0cb4ff92]{left:0;color:#7d7d7d}@media (hover:hover){.vhd-calendar-footer .reset[data-v-0cb4ff92]:hover{color:#4a4a4a}}.vhd-calendar-footer .confirm[data-v-0cb4ff92]{right:0;color:#08f}@media (hover:hover){.vhd-calendar-footer .confirm[data-v-0cb4ff92]:hover{color:#005299}}.vhd-calendar-left[data-v-0cb4ff92],.vhd-calendar-right[data-v-0cb4ff92]{display:inline-block;vertical-align:top;width:280px}.vhd-calendar-left[data-v-0cb4ff92]{margin-right:40px}.vhd-calendar .calendar-month[data-v-0cb4ff92]{position:relative;height:32px;margin-bottom:8px}.vhd-calendar .calendar-month .next-arrow[data-v-0cb4ff92],.vhd-calendar .calendar-month .previous-arrow[data-v-0cb4ff92]{position:absolute;top:0;padding-top:4px;cursor:pointer}.vhd-calendar .calendar-month .next-arrow.disabled[data-v-0cb4ff92],.vhd-calendar .calendar-month .previous-arrow.disabled[data-v-0cb4ff92]{display:none!important}.vhd-calendar .calendar-month .previous-arrow[data-v-0cb4ff92]{left:0}.vhd-calendar .calendar-month .next-arrow[data-v-0cb4ff92]{right:0}.vhd-calendar .calendar-month .next-arrow.offset-1[data-v-0cb4ff92],.vhd-calendar .calendar-month .previous-arrow.offset-1[data-v-0cb4ff92]{display:none}.vhd-calendar .calendar-month-title[data-v-0cb4ff92]{margin:8px 0;font-size:20px;font-weight:500;line-height:1.6;text-align:center;color:#505050}.vhd-calendar .calendar-week[data-v-0cb4ff92]{width:100%;height:32px}.vhd-calendar .calendar-week-item[data-v-0cb4ff92]{float:left;display:inline-block;font-size:12px;font-weight:500;width:14.28571%;height:20px;color:#505050;text-align:center;line-height:20px}.vhd-calendar .calendar-date .week[data-v-0cb4ff92]{display:block;width:100%;height:40px}.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]{float:left;position:relative;display:inline-block;width:40px;height:40px;font-size:16px;font-weight:500;line-height:40px;color:#505050;background-color:transparent;text-align:center;cursor:pointer;-webkit-transition:background-color .4s cubic-bezier(.165,.84,.44,1);transition:background-color .4s cubic-bezier(.165,.84,.44,1)}.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]:after,.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]:before{content:"";position:absolute;width:0;height:100%;left:0;background-color:transparent;opacity:0;-webkit-transition:opacity .4s cubic-bezier(.165,.84,.44,1),background-color .4s cubic-bezier(.165,.84,.44,1),width .4s cubic-bezier(.165,.84,.44,1);transition:opacity .4s cubic-bezier(.165,.84,.44,1),background-color .4s cubic-bezier(.165,.84,.44,1),width .4s cubic-bezier(.165,.84,.44,1)}.vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]:after{left:auto;right:0}.vhd-calendar .calendar-date .week .day.disabled[data-v-0cb4ff92]{color:#ececec;pointer-events:none}.vhd-calendar .calendar-date .week .day.in-date-range[data-v-0cb4ff92]{background-color:#b2d7ff}.vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]{position:relative;background-color:#b2d7ff}.vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]:before{width:4px;background-color:#08f;opacity:1}.vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]{position:relative;background-color:#b2d7ff}.vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]:after{width:4px;background-color:#08f;opacity:1;-webkit-transition:opacity .2s cubic-bezier(.165,.84,.44,1),background-color .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1);transition:opacity .2s cubic-bezier(.165,.84,.44,1),background-color .2s cubic-bezier(.165,.84,.44,1),width .2s cubic-bezier(.165,.84,.44,1)}.vhd-calendar .calendar-date .week .day.today[data-v-0cb4ff92]{border:1px solid #08f}.vhd-calendar .calendar-date .week .day.forbidden[data-v-0cb4ff92]{color:#fed9d8;cursor:not-allowed}@media only screen and (max-width:767.98px){.vhd-container:not(.desktop) .vhd-picker[data-v-0cb4ff92]{width:300px;padding:8px}.vhd-container:not(.desktop) .vhd-calendar-header[data-v-0cb4ff92]{height:60px}.vhd-container:not(.desktop) .vhd-calendar-header>.info[data-v-0cb4ff92]{display:block;width:100%;height:60px;padding-top:36px}.vhd-container:not(.desktop) .vhd-calendar-left[data-v-0cb4ff92]{width:100%;margin-right:0}.vhd-container:not(.desktop) .vhd-calendar-right[data-v-0cb4ff92],.vhd-container:not(.desktop) .vhd-calendar .calendar-month .previous-arrow.offset-2[data-v-0cb4ff92]{display:none}.vhd-container:not(.desktop) .vhd-calendar .calendar-month .next-arrow.offset-1[data-v-0cb4ff92],.vhd-container:not(.desktop) .vhd-calendar .calendar-month .previous-arrow.offset-1[data-v-0cb4ff92]{display:inline-block}.vhd-container:not(.desktop) .vhd-calendar .calendar-date .week .day[data-v-0cb4ff92]{width:14.28571%}.vhd-container:not(.desktop) .vhd-calendar .calendar-date .week .day.start-date[data-v-0cb4ff92]{color:#fff;border-left:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}.vhd-container:not(.desktop) .vhd-calendar .calendar-date .week .day.end-date[data-v-0cb4ff92]{color:#fff;border-right:none;background-color:#08f;-webkit-transition:all .2s ease;transition:all .2s ease}}',""])},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},c366:function(t,e,a){var n=a("6821"),r=a("9def"),i=a("77f1");t.exports=function(t){return function(e,a,o){var c,s=n(e),d=r(s.length),l=i(o,d);if(t&&a!=a){while(d>l)if(c=s[l++],c!=c)return!0}else for(;d>l;l++)if((t||l in s)&&s[l]===a)return t||l||0;return!t&&-1}}},c5f6:function(t,e,a){"use strict";var n=a("7726"),r=a("69a8"),i=a("2d95"),o=a("5dbc"),c=a("6a99"),s=a("79e5"),d=a("9093").f,l=a("11e9").f,f=a("86cc").f,u=a("aa77").trim,h="Number",p=n[h],v=p,g=p.prototype,b=i(a("2aeb")(g))==h,m="trim"in String.prototype,y=function(t){var e=c(t,!1);if("string"==typeof e&&e.length>2){e=m?e.trim():u(e,3);var a,n,r,i=e.charCodeAt(0);if(43===i||45===i){if(a=e.charCodeAt(2),88===a||120===a)return NaN}else if(48===i){switch(e.charCodeAt(1)){case 66:case 98:n=2,r=49;break;case 79:case 111:n=8,r=55;break;default:return+e}for(var o,s=e.slice(2),d=0,l=s.length;dr)return NaN;return parseInt(s,n)}}return+e};if(!p(" 0o1")||!p("0b1")||p("+0x1")){p=function(t){var e=arguments.length<1?0:t,a=this;return a instanceof p&&(b?s(function(){g.valueOf.call(a)}):i(a)!=h)?o(new v(y(e)),a,p):y(e)};for(var w,x=a("9e1e")?d(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),D=0;x.length>D;D++)r(v,w=x[D])&&!r(p,w)&&f(p,w,l(v,w));p.prototype=g,g.constructor=p,a("2aba")(n,h,p)}},c69a:function(t,e,a){t.exports=!a("9e1e")&&!a("79e5")(function(){return 7!=Object.defineProperty(a("230e")("div"),"a",{get:function(){return 7}}).a})},ca5a:function(t,e){var a=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++a+n).toString(36))}},cb7c:function(t,e,a){var n=a("d3f4");t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},ce10:function(t,e,a){var n=a("69a8"),r=a("6821"),i=a("c366")(!1),o=a("613b")("IE_PROTO");t.exports=function(t,e){var a,c=r(t),s=0,d=[];for(a in c)a!=o&&n(c,a)&&d.push(a);while(e.length>s)n(c,a=e[s++])&&(~i(d,a)||d.push(a));return d}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},f6fd:function(t,e){(function(t){var e="currentScript",a=t.getElementsByTagName("script");e in t||Object.defineProperty(t,e,{get:function(){try{throw new Error}catch(n){var t,e=(/.*at [^\(]*\((.*):.+:.+\)$/gi.exec(n.stack)||[!1])[1];for(t in a)if(a[t].src==e||"interactive"==a[t].readyState)return a[t];return null}}})})(document)},fa5b:function(t,e,a){t.exports=a("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,a){var n=a("7726").document;t.exports=n&&n.documentElement},fb15:function(t,e,a){"use strict";var n;(a.r(e),"undefined"!==typeof window)&&(a("f6fd"),(n=window.document.currentScript)&&(n=n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/))&&(a.p=n[1]));var r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"vhd-container",class:t.mobile.toLowerCase()},[a("input",{directives:[{name:"model",rawName:"v-model",value:t.value,expression:"value"}],staticClass:"vhd-input",attrs:{placeholder:t.placeholder,type:"text","aria-label":"vue-hotel-datepicker-input"},domProps:{value:t.value},on:{mousedown:function(e){return e.preventDefault(),t.toggle(e)},focus:function(e){return e.preventDefault(),t.toggle(e)},input:function(e){e.target.composing||(t.value=e.target.value)}}}),t.active?a("div",{staticClass:"vhd-picker"},[a("div",{staticClass:"vhd-calendar"},[a("div",{staticClass:"vhd-calendar-header"},[a("a",{staticClass:"close",on:{click:t.close}},[a("IconClose")],1),a("span",{staticClass:"info"},[t.selectStartDate?a("span",{staticClass:"from-text"},[t._v(t._s(t.fromText))]):t._e(),t.selectStartDate?a("span",{staticClass:"from-date"},[t._v(" "+t._s(t.displayDateText(t.selectStartDate))+" ")]):t._e(),t.selectEndDate?a("span",{staticClass:"to-text"},[t._v(t._s(t.toText))]):t._e(),t.selectEndDate?a("span",{staticClass:"from-date"},[t._v(" "+t._s(t.displayDateText(t.selectEndDate))+" ")]):t._e()])]),a("div",{staticClass:"vhd-calendar-left"},[a("div",{staticClass:"calendar-month"},[a("a",{staticClass:"previous-arrow offset-2",class:t.disabledPreviousArrow(t.startMonthDate),on:{click:function(e){return t.updateCalendar(-2)}}},[a("IconArrowBack",{staticClass:"arrow"})],1),a("a",{staticClass:"previous-arrow offset-1",class:t.disabledPreviousArrow(t.startMonthDate),on:{click:function(e){return t.updateCalendar(-1)}}},[a("IconArrowBack",{staticClass:"arrow"})],1),a("div",{staticClass:"calendar-month-title"},[t._v("\n "+t._s(t.monthList[t.startMonthDate.getMonth()])+" "+t._s(t.startMonthDate.getFullYear())+"\n ")]),a("a",{staticClass:"next-arrow offset-1",on:{click:function(e){return t.updateCalendar(1)}}},[a("IconArrowForward",{staticClass:"arrow"})],1)]),a("div",{staticClass:"calendar-week"},t._l(t.weekList,function(e,n){return a("div",{key:n,staticClass:"calendar-week-item"},[t._v("\n "+t._s(e)+"\n ")])}),0),a("div",{staticClass:"calendar-date"},t._l(t.startMonthAry,function(e,n){return a("div",{key:n,staticClass:"week"},t._l(e,function(e,n){return a("div",{key:n,staticClass:"day",class:t.dayStatus(e),on:{click:function(a){return t.dayOnClick(e)}}},[e?a("span",[t._v("\n "+t._s(e.getDate())+"\n ")]):t._e()])}),0)}),0)]),a("div",{staticClass:"vhd-calendar-right"},[a("div",{staticClass:"calendar-month"},[a("a",{staticClass:"next-arrow",on:{click:function(e){return t.updateCalendar(2)}}},[a("IconArrowForward",{staticClass:"arrow"})],1),a("div",{staticClass:"calendar-month-title"},[t._v("\n "+t._s(t.monthList[t.endMonthDate.getMonth()])+" "+t._s(t.endMonthDate.getFullYear())+"\n ")])]),a("div",{staticClass:"calendar-week"},t._l(t.weekList,function(e,n){return a("div",{key:n,staticClass:"calendar-week-item"},[t._v("\n "+t._s(e)+"\n ")])}),0),a("div",{staticClass:"calendar-date"},t._l(t.endMonthAry,function(e,n){return a("div",{key:n,staticClass:"week"},t._l(e,function(e,n){return a("div",{key:n,staticClass:"day",class:t.dayStatus(e),on:{click:function(a){return t.dayOnClick(e)}}},[e?a("span",[t._v("\n "+t._s(e.getDate())+"\n ")]):t._e()])}),0)}),0)]),a("div",{staticClass:"vhd-calendar-footer"},[t.selectStartDate||t.selectEndDate?a("div",{staticClass:"reset",on:{click:t.reset}},[t._v(t._s(t.resetText))]):t._e(),t.selectStartDate&&t.selectEndDate?a("div",{staticClass:"confirm",on:{click:t.confirm}},[t._v(t._s(t.confirmText))]):t._e()])])]):t._e()])},i=[],o=(a("7cdf"),a("a481"),a("c5f6"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),a("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])}),c=[],s={name:"IconClose"},d=s;function l(t,e,a,n,r,i,o,c){var s,d="function"===typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=a,d._compiled=!0),n&&(d.functional=!0),i&&(d._scopeId="data-v-"+i),o?(s=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(o)},d._ssrRegister=s):r&&(s=c?function(){r.call(this,this.$root.$options.shadowRoot)}:r),s)if(d.functional){d._injectStyles=s;var l=d.render;d.render=function(t,e){return s.call(e),l(t,e)}}else{var f=d.beforeCreate;d.beforeCreate=f?[].concat(f,s):[s]}return{exports:t,options:d}}var f=l(d,o,c,!1,null,null,null),u=f.exports,h=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),a("path",{attrs:{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"}})])},p=[],v={name:"IconArrowBack"},g=v,b=l(g,h,p,!1,null,null,null),m=b.exports,y=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[a("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}}),a("path",{attrs:{d:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}})])},w=[],x={name:"IconArrowForward"},D=x,k=l(D,y,w,!1,null,null,null),S=k.exports,M={name:"VueHotelDatepicker",components:{IconClose:u,IconArrowBack:m,IconArrowForward:S},directives:{},props:{placeholder:{type:String,default:"Select a date range"},separator:{type:String,default:"~"},format:{type:String,default:"YYYY/MM/DD"},startDate:{type:[String,Date],default:void 0},endDate:{type:[String,Date],default:void 0},minDate:{type:[String,Date],default:function(){return new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate(),0,0,0)}},maxDate:{type:[String,Date,Boolean],default:!1},minNight:{type:Number,default:void 0},maxNight:{type:Number,default:void 0},selectForward:{type:Boolean,default:!0},disabledDates:{type:Array,default:function(){return[]}},weekList:{type:Array,default:function(){return["Sun.","Mon.","Tue.","Wen.","Thu.","Fri.","Sat."]}},monthList:{type:Array,default:function(){return["Jan.","Feb.","Mar.","Apr.","May.","Jun.","Jul.","Aug.","Sep.","Oct","Nov.","Dec."]}},fromText:{type:String,default:"From"},toText:{type:String,default:"To"},resetText:{type:String,default:"Reset"},confirmText:{type:String,default:"Confirm"},mobile:{type:String,default:""}},data:function(){return{value:"",active:!1,startMonthDate:void 0,endMonthDate:void 0,selectStartDate:void 0,selectEndDate:void 0,selectMinDate:void 0,selectMaxDate:void 0,startMonthAry:[],endMonthAry:[],clickCount:0}},computed:{},watch:{},created:function(){if(this.minDate){var t="string"===typeof this.minDate?this.minDate:this.minDate.getTime();this.selectMinDate=new Date(t)}if(this.maxDate){var e="string"===typeof this.maxDate?this.maxDate:this.maxDate.getTime();this.selectMaxDate=new Date(e)}if(this.startDate){var a="string"===typeof this.startDate?this.startDate:this.startDate.getTime();if(this.selectStartDate=new Date(a),this.selectMinDate&&this.selectMinDate.getTime()>this.selectStartDate.getTime()&&(this.selectMinDate=new Date(a)),this.endDate){var n="string"===typeof this.endDate?this.endDate:this.endDate.getTime();this.selectEndDate=new Date(n)}else this.selectEndDate=new Date(this.selectStartDate.getTime()+864e5);this.updateValue()}this.updateCalendar()},mounted:function(){},methods:{toggle:function(t){if("focus"===t.type)return this.active=!0,!0;this.active=!this.active},close:function(){this.active=!1,this.$emit("close")},reset:function(){this.selectStartDate=void 0,this.selectEndDate=void 0,this.value="",this.$emit("reset")},confirm:function(){if(this.selectStartDate&&!this.selectEndDate&&(this.selectEndDate=new Date(this.selectStartDate.getTime()),this.selectEndDate.setDate(this.selectStartDate.getDate()+1),this.updateValue()),this.selectStartDate&&this.selectEndDate){var t={start:this.displayDateText(this.selectStartDate),end:this.displayDateText(this.selectEndDate)};this.$emit("confirm",t),this.active=!1}},displayDateText:function(t){if(t){t="string"===typeof t?new Date(t):t;var e=t.getFullYear(),a=t.getMonth()+1>9?t.getMonth()+1:"0".concat(t.getMonth()+1),n=t.getDate()>9?t.getDate():"0".concat(t.getDate()),r=(this.format||"YYYY/MM/DD").replace("YYYY",e).replace("MM",a).replace("DD",n);return r}},generateCalendar:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(new Date).getFullYear(),e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(new Date).getMonth(),a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=a.showPreviousMonthDate||!1,r=a.showNextMonthDate||!1,i=new Date(t,e,1,0,0,0),o=new Date(t,e,1,0,0,0),c=[],s=[],d=!1,l=!1;while(!d||d&&!l){var f=o.getDay(),u=o.getDate(),h=o.getMonth();if(h!==e&&(d=!0,(6===f||1===u&&0===f)&&(l=!0)),s[f]=d?!!r&&new Date(o.getTime()):new Date(o.getTime()),o.getTime()===i.getTime()&&0!==f){var p=f,v=new Date(o.getTime());if(v.setDate(v.getDate()),n)while(0!==p){var g=new Date(v.getTime());p=g.getDay(),s[p]=g,v.setDate(v.getDate()-1)}}(o.getTime()===i.getTime()&&7===s.length||o.getTime()>i&&6===f)&&(c.push(s),s=[]),o.setDate(o.getDate()+1)}return c},updateCalendar:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.startMonthDate||(this.startMonthDate=this.selectStartDate?new Date(this.selectStartDate.getTime()):new Date((new Date).getFullYear(),(new Date).getMonth())),this.startMonthDate.setMonth(this.startMonthDate.getMonth()+t),this.endMonthDate=new Date(this.startMonthDate.getFullYear(),this.startMonthDate.getMonth()+1),this.startMonthAry=[],this.endMonthAry=[],this.startMonthAry=this.generateCalendar(this.startMonthDate.getFullYear(),this.startMonthDate.getMonth()),this.endMonthAry=this.generateCalendar(this.endMonthDate.getFullYear(),this.endMonthDate.getMonth())},updateValue:function(){this.value="".concat(this.displayDateText(this.selectStartDate)," ").concat(this.separator," ").concat(this.displayDateText(this.selectEndDate))},disabledPreviousArrow:function(t){var e=new Date,a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);if(t&&this.selectForward)if(this.selectMinDate){if(t.getFullYear()t.getTime()?e.push("disabled"):this.selectMaxDate&&this.selectMaxDate.getTime()-1?(e.push("disabled"),e.push("forbidden")):this.selectStartDate&&this.selectStartDate.getTime()>t.getTime()&&!this.selectForward?e.push("disabled"):this.selectStartDate&&this.selectStartDate.getTime()===t.getTime()?e.push("start-date"):this.selectEndDate&&this.selectEndDate.getTime()===t.getTime()?e.push("end-date"):this.selectStartDate&&this.selectEndDate&&t.getTime()>this.selectStartDate.getTime()&&t.getTime()0||Number.isInteger(this.maxNight)&&this.maxNight>0)){var n=Math.abs(t.getTime()-this.selectStartDate.getTime())/864e5;nthis.maxNight&&e.push("disabled")}a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getDate()===t.getDate()&&e.push("today")}return e},dayOnClick:function(t){if(t){if(this.selectStartDate?this.selectEndDate?t.getTime()this.selectEndDate.getTime()?this.selectEndDate=t:t.getTime()>this.selectStartDate.getTime()&&t.getTime()e&&(this.selectEndDate=new Date(e))}if(this.selectStartDate&&this.selectEndDate&&this.minNight){var a=this.selectStartDate.getTime()+1e3*this.minNight*60*60*24;this.selectEndDate.getTime()", 23 | "license": "MIT", 24 | "repository": { 25 | "type": "git", 26 | "url": "git+https://github.com/northwalker/vue-hotel-datepicker.git" 27 | }, 28 | "keywords": [ 29 | "vue", 30 | "vuejs", 31 | "datepicker", 32 | "date picker", 33 | "date range picker", 34 | "hotel datepicker", 35 | "vue datepicker", 36 | "vue hotel datepicker" 37 | ], 38 | "bugs": { 39 | "url": "https://github.com/northwalker/vue-hotel-datepicker/issues" 40 | }, 41 | "homepage": "https://github.com/northwalker/vue-hotel-datepicker#readme", 42 | "dependencies": {}, 43 | "devDependencies": { 44 | "@vue/cli-plugin-babel": "^3.10.0", 45 | "@vue/cli-plugin-e2e-cypress": "^3.10.0", 46 | "@vue/cli-plugin-eslint": "^3.10.0", 47 | "@vue/cli-plugin-pwa": "^3.10.0", 48 | "@vue/cli-plugin-unit-jest": "^3.10.0", 49 | "@vue/cli-service": "^3.10.0", 50 | "@vue/eslint-config-standard": "^4.0.0", 51 | "@vue/test-utils": "1.0.0-beta.29", 52 | "babel-core": "7.0.0-bridge.0", 53 | "babel-eslint": "^10.0.1", 54 | "babel-jest": "^23.6.0", 55 | "eslint": "^5.16.0", 56 | "eslint-plugin-vue": "^5.0.0", 57 | "node-sass": "^4.9.0", 58 | "sass-loader": "^7.1.0", 59 | "vue": "^2.6.10", 60 | "vue-template-compiler": "^2.6.10" 61 | }, 62 | "peerDependencies": { 63 | "vue": "^2.6.10" 64 | }, 65 | "directories": { 66 | "doc": "docs", 67 | "lib": "lib", 68 | "test": "tests" 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /postcss.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/northwalker/vue-hotel-datepicker/6780b2b2505908b99d71f638cc17c6a4c475a7a1/public/favicon.ico -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | Vue Hotel Datepicker by Northwalker 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 27 |
28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/App.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 33 | 34 | 62 | -------------------------------------------------------------------------------- /src/assets/baseline-arrow_back-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-arrow_back_ios-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-arrow_forward-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-arrow_forward_ios-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-check-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-chevron_left-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-chevron_right-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-clear-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/baseline-close-24px.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/vue-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/northwalker/vue-hotel-datepicker/6780b2b2505908b99d71f638cc17c6a4c475a7a1/src/assets/vue-logo.png -------------------------------------------------------------------------------- /src/components/VueHotelDatepicker.vue: -------------------------------------------------------------------------------- 1 | 87 | 451 | 781 | -------------------------------------------------------------------------------- /src/components/VueHotelDatepickerModal.vue: -------------------------------------------------------------------------------- 1 | 105 | 325 | 684 | -------------------------------------------------------------------------------- /src/components/icon/IconArrowBack.vue: -------------------------------------------------------------------------------- 1 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/icon/IconArrowForward.vue: -------------------------------------------------------------------------------- 1 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/icon/IconChevronLeft.vue: -------------------------------------------------------------------------------- 1 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/icon/IconChevronRight.vue: -------------------------------------------------------------------------------- 1 | 7 | 12 | -------------------------------------------------------------------------------- /src/components/icon/IconClose.vue: -------------------------------------------------------------------------------- 1 | 7 | 12 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | 4 | Vue.config.productionTip = false 5 | 6 | new Vue({ 7 | render: h => h(App) 8 | }).$mount('#app') 9 | -------------------------------------------------------------------------------- /src/views/Demo.vue: -------------------------------------------------------------------------------- 1 | 61 | 62 | 121 | 122 | 137 | -------------------------------------------------------------------------------- /src/views/Demo2.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 38 | 39 | 41 | -------------------------------------------------------------------------------- /tests/e2e/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: [ 3 | 'cypress' 4 | ], 5 | env: { 6 | mocha: true, 7 | 'cypress/globals': true 8 | }, 9 | rules: { 10 | strict: 'off' 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /tests/e2e/plugins/index.js: -------------------------------------------------------------------------------- 1 | // https://docs.cypress.io/guides/guides/plugins-guide.html 2 | 3 | // if you need a custom webpack configuration you can uncomment the following import 4 | // and then use the `file:preprocessor` event 5 | // as explained in the cypress docs 6 | // https://docs.cypress.io/api/plugins/preprocessors-api.html#Examples 7 | 8 | /* eslint-disable import/no-extraneous-dependencies, global-require, arrow-body-style */ 9 | // const webpack = require('@cypress/webpack-preprocessor') 10 | 11 | module.exports = (on, config) => { 12 | // on('file:preprocessor', webpack({ 13 | // webpackOptions: require('@vue/cli-service/webpack.config'), 14 | // watchOptions: {} 15 | // })) 16 | 17 | return Object.assign({}, config, { 18 | fixturesFolder: 'tests/e2e/fixtures', 19 | integrationFolder: 'tests/e2e/specs', 20 | screenshotsFolder: 'tests/e2e/screenshots', 21 | videosFolder: 'tests/e2e/videos', 22 | supportFile: 'tests/e2e/support/index.js' 23 | }) 24 | } 25 | -------------------------------------------------------------------------------- /tests/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // https://docs.cypress.io/api/introduction/api.html 2 | 3 | describe('My First Test', () => { 4 | it('Visits the app root url', () => { 5 | cy.visit('/') 6 | cy.contains('h1', 'Welcome to Your Vue.js App') 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /tests/e2e/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /tests/e2e/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | jest: true 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /tests/unit/example.spec.js: -------------------------------------------------------------------------------- 1 | import { shallowMount } from '@vue/test-utils' 2 | import App from '@/App.vue' 3 | jest.mock('@/views/Demo', () => {}) 4 | 5 | describe('App.vue', () => { 6 | it('renders header when passed', () => { 7 | const wrapper = shallowMount(App, { 8 | stubs: { 9 | Demo: true 10 | } 11 | }) 12 | expect(wrapper.text()).toMatch('Vue Hotel Datepicker') 13 | }) 14 | }) 15 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | css: { extract: false }, 3 | publicPath: process.env.NODE_ENV === 'production' 4 | ? '/vue-hotel-datepicker/' // project name 5 | : '/' 6 | } 7 | --------------------------------------------------------------------------------