diff --git a/README.md b/README.md index 8dbf06a..fba5c0f 100644 --- a/README.md +++ b/README.md @@ -129,11 +129,14 @@ This project is licensed under the MIT License ## Change log +### 2.10.0 (2021-11-03) + * Feat: Added support for display format when using [`custom-input`](https://talkhabi.github.io/vue-persian-datetime-picker/guide/custom-input.html) + ### 2.9.1 (2021-10-31) * Fixed: [Using jumpMinute and roundMinute together](https://github.com/talkhabi/vue-persian-datetime-picker/issues/182) ### 2.9.0 (2021-09-27) - * Feat: [Added simple-mode](https://talkhabi.github.io/vue-persian-datetime-picker/#/simple-mode) + * Feat: [Added simple-mode](https://talkhabi.github.io/vue-persian-datetime-picker/guide/simple-mode.html) * Feat: [Added `input-attrs`](https://github.com/talkhabi/vue-persian-datetime-picker/issues/170) * Feat: [Added `@next-month` and `@prev-month` events](https://github.com/talkhabi/vue-persian-datetime-picker/issues/176) * Feat: Added `@year-change` and `@month-change` events @@ -141,7 +144,7 @@ This project is licensed under the MIT License * Fixed: Prevent selected dates from being reset ### 2.8.0 (2021-08-01) - * Feat: [Added ability to control route in show/close action](https://talkhabi.github.io/vue-persian-datetime-picker/#/use-router) + * Feat: [Added ability to control route in show/close action](https://talkhabi.github.io/vue-persian-datetime-picker/guide/use-router.html) * Fixed Date change animation and transition ### 2.7.0 (2021-07-23) @@ -154,12 +157,12 @@ This project is licensed under the MIT License * Fixed [year-month](https://github.com/talkhabi/vue-persian-datetime-picker/issues/150) ### 2.6.0 (2021-02-05) - * Added [multiple selection](https://talkhabi.github.io/vue-persian-datetime-picker/#/multiple) (for type `date` only) - * Added [popover mode](https://talkhabi.github.io/vue-persian-datetime-picker/#/popover) + * Added [multiple selection](https://talkhabi.github.io/vue-persian-datetime-picker/guide/multiple.html) (for type `date` only) + * Added [popover mode](https://talkhabi.github.io/vue-persian-datetime-picker/guide/popover.html) * Close picker with `escape` key, fixes [#141](https://github.com/talkhabi/vue-persian-datetime-picker/issues/141) ### 2.5.0 (2021-01-30) - * Added [range option](https://talkhabi.github.io/vue-persian-datetime-picker/#/range) (for type `date` only) + * Added [range option](https://talkhabi.github.io/vue-persian-datetime-picker/guide/range.html) (for type `date` only) * Fixed [#136](https://github.com/talkhabi/vue-persian-datetime-picker/issues/136) ### 2.4.1 (2020-11-13) @@ -176,8 +179,8 @@ This project is licensed under the MIT License * Added [`convert-numbers`](https://github.com/talkhabi/vue-persian-datetime-picker/pull/117) prop that converts numbers to persian in fa locale: `` ### 2.2.0 (2020-08-02) - * [Custom localization](https://talkhabi.github.io/vue-persian-datetime-picker/#/locale) is now supported - * Added some [slots](https://talkhabi.github.io/vue-persian-datetime-picker/#/slots) + * [Custom localization](https://talkhabi.github.io/vue-persian-datetime-picker/guide/localization.html) is now supported + * Added some [slots](https://talkhabi.github.io/vue-persian-datetime-picker/guide/slots.html) ### 2.1.6 (2020-07-13) * Fixed `locale-config` prop [#116](https://github.com/talkhabi/vue-persian-datetime-picker/issues/116) diff --git a/dist/vue-persian-datetime-picker.common.js b/dist/vue-persian-datetime-picker.common.js index 1bb1b4e..23eff04 100644 --- a/dist/vue-persian-datetime-picker.common.js +++ b/dist/vue-persian-datetime-picker.common.js @@ -614,8 +614,8 @@ if (typeof window !== 'undefined') { // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/VuePersianDatetimePicker.vue?vue&type=template&id=6a3f7a5c& -var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"vpd-main",class:{ 'vpd-is-popover': _vm.isPopover },attrs:{"data-type":_vm.type,"data-placement":_vm.popoverPlace,"data-locale":_vm.localeData.name,"data-locale-dir":_vm.localeData.config.dir}},[(!_vm.element)?_c('span',{ref:"inputGroup",class:['vpd-input-group', { 'vpd-disabled': _vm.disabled }]},[_c('label',{staticClass:"vpd-icon-btn",style:({ 'background-color': _vm.color }),attrs:{"for":_vm.id},on:{"click":function($event){$event.preventDefault();$event.stopPropagation();_vm.visible = !_vm.visible}}},[_vm._t("label",function(){return [(_vm.type === 'time')?_c('time-icon',{attrs:{"width":"16px","height":"16px"}}):_c('calendar-icon',{attrs:{"width":"16px","height":"16px"}}),(_vm.label)?_c('span',{domProps:{"textContent":_vm._s(_vm.label)}}):_vm._e()]})],2),_c('input',_vm._b({ref:"input",class:[_vm.inputClass, { 'vpd-is-editable': _vm.editable }],attrs:{"id":_vm.id,"type":"text","name":_vm.name,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":_vm.displayValue},on:{"focus":_vm.focus,"blur":_vm.setOutput,"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.setOutput.apply(null, arguments)}}},'input',_vm.inputAttrs,false)),(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),(_vm.clearable && !_vm.disabled && _vm.displayValue)?_c('i',{staticClass:"vpd-clear-btn",on:{"click":_vm.clearValue}},[_vm._t("clear-btn",function(){return [_vm._v("x")]},null,{ vm: _vm.vm })],2):_vm._e()]):(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),_c('transition',{attrs:{"name":_vm.isPopover ? '' : 'vpd-fade-scale'}},[(_vm.visible)?_c('div',{ref:"picker",class:[ +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/VuePersianDatetimePicker.vue?vue&type=template&id=433cf0ae& +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"vpd-main",class:{ 'vpd-is-popover': _vm.isPopover },attrs:{"data-type":_vm.type,"data-placement":_vm.popoverPlace,"data-locale":_vm.localeData.name,"data-locale-dir":_vm.localeData.config.dir}},[(!_vm.customInputElement)?_c('span',{ref:"inputGroup",class:['vpd-input-group', { 'vpd-disabled': _vm.disabled }]},[_c('label',{staticClass:"vpd-icon-btn",style:({ 'background-color': _vm.color }),attrs:{"for":_vm.id},on:{"click":function($event){$event.preventDefault();$event.stopPropagation();_vm.visible = !_vm.visible}}},[_vm._t("label",function(){return [(_vm.type === 'time')?_c('time-icon',{attrs:{"width":"16px","height":"16px"}}):_c('calendar-icon',{attrs:{"width":"16px","height":"16px"}}),(_vm.label)?_c('span',{domProps:{"textContent":_vm._s(_vm.label)}}):_vm._e()]})],2),_c('input',_vm._b({ref:"input",class:[_vm.inputClass, { 'vpd-is-editable': _vm.editable }],attrs:{"id":_vm.id,"type":"text","name":_vm.name,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":_vm.displayValue},on:{"focus":_vm.focus,"blur":_vm.setOutput,"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.setOutput.apply(null, arguments)}}},'input',_vm.inputAttrs,false)),(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),(_vm.clearable && !_vm.disabled && _vm.displayValue)?_c('i',{staticClass:"vpd-clear-btn",on:{"click":_vm.clearValue}},[_vm._t("clear-btn",function(){return [_vm._v("x")]},null,{ vm: _vm.vm })],2):_vm._e()]):(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),_c('transition',{attrs:{"name":_vm.isPopover ? '' : 'vpd-fade-scale'}},[(_vm.visible)?_c('div',{ref:"picker",class:[ 'vpd-wrapper', ("vpd-dir-" + (_vm.localeData.config.dir)), { @@ -666,12 +666,12 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel var staticRenderFns = [] -// CONCATENATED MODULE: ./src/VuePersianDatetimePicker.vue?vue&type=template&id=6a3f7a5c& +// CONCATENATED MODULE: ./src/VuePersianDatetimePicker.vue?vue&type=template&id=433cf0ae& // EXTERNAL MODULE: ./src/assets/scss/style.scss var style = __webpack_require__("78a7"); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Arrow.vue?vue&type=template&id=374124c8& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Arrow.vue?vue&type=template&id=374124c8& var Arrowvue_type_template_id_374124c8_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{style:({ transform: ("rotate(" + _vm.rotation + "deg)") }),attrs:{"version":"1.1","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 129 129","width":"30","height":"30","perspectiveAspectRato":"none"}},[_c('path',{attrs:{"fill":_vm.fill,"d":"M88.6 121.3c.8.8 1.8 1.2 2.9 1.2s2.1-.4 2.9-1.2a4.1 4.1 0 0 0 0-5.8l-51-51 51-51a4.1 4.1 0 0 0-5.8-5.8l-54\n 53.9a4.1 4.1 0 0 0 0 5.8l54 53.9z"}})])} var Arrowvue_type_template_id_374124c8_staticRenderFns = [] @@ -841,7 +841,7 @@ var component = normalizeComponent( ) /* harmony default export */ var Arrow = (component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TimeIcon.vue?vue&type=template&id=3b53c8ae& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TimeIcon.vue?vue&type=template&id=3b53c8ae& var TimeIconvue_type_template_id_3b53c8ae_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{attrs:{"version":"1.1","role":"presentation","width":"16","height":"16","fill":_vm.fill,"viewBox":"0 0 512 512"}},[_c('path',{attrs:{"d":"M256 8C119 8 8 119 8 256S119 504 256 504 504 393 504 256 393 8 256 8zM313.1 358.1L224.9 294C221.8 291.7 220\n 288.1 220 284.3V116C220 109.4 225.4 104 232 104H280C286.6 104 292 109.4 292 116V253.7L355.5 299.9C360.9 303.8\n 362 311.3 358.1 316.7L329.9 355.5C326 360.8 318.5 362 313.1 358.1z"}})])} var TimeIconvue_type_template_id_3b53c8ae_staticRenderFns = [] @@ -896,7 +896,7 @@ var TimeIcon_component = normalizeComponent( ) /* harmony default export */ var TimeIcon = (TimeIcon_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CalendarIcon.vue?vue&type=template&id=786fd7a5& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CalendarIcon.vue?vue&type=template&id=786fd7a5& var CalendarIconvue_type_template_id_786fd7a5_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{attrs:{"version":"1.1","width":"14","height":"16","viewBox":"0 0 448 512","xmlns":"http://www.w3.org/2000/svg","fill":_vm.fill}},[_c('path',{attrs:{"d":"M436 160H12C5.4 160 0 154.6 0 148V112C0 85.5 21.5 64 48 64H96V12C96 5.4 101.4 0 108 0H148C154.6 0 160 5.4 160\n 12V64H288V12C288 5.4 293.4 0 300 0H340C346.6 0 352 5.4 352 12V64H400C426.5 64 448 85.5 448 112V148C448 154.6\n 442.6 160 436 160zM12 192H436C442.6 192 448 197.4 448 204V464C448 490.5 426.5 512 400 512H48C21.5 512 0 490.5 0\n 464V204C0 197.4 5.4 192 12 192zM128 396C128 389.4 122.6 384 116 384H76C69.4 384 64 389.4 64 396V436C64 442.6 69.4\n 448 76 448H116C122.6 448 128 442.6 128 436V396zM128 268C128 261.4 122.6 256 116 256H76C69.4 256 64 261.4 64\n 268V308C64 314.6 69.4 320 76 320H116C122.6 320 128 314.6 128 308V268zM256 396C256 389.4 250.6 384 244\n 384H204C197.4 384 192 389.4 192 396V436C192 442.6 197.4 448 204 448H244C250.6 448 256 442.6 256 436V396zM256\n 268C256 261.4 250.6 256 244 256H204C197.4 256 192 261.4 192 268V308C192 314.6 197.4 320 204 320H244C250.6 320 256\n 314.6 256 308V268zM384 396C384 389.4 378.6 384 372 384H332C325.4 384 320 389.4 320 396V436C320 442.6 325.4 448\n 332 448H372C378.6 448 384 442.6 384 436V396zM384 268C384 261.4 378.6 256 372 256H332C325.4 256 320 261.4 320\n 268V308C320 314.6 325.4 320 332 320H372C378.6 320 384 314.6 384 308V268z"}})])} var CalendarIconvue_type_template_id_786fd7a5_staticRenderFns = [] @@ -959,7 +959,7 @@ var CalendarIcon_component = normalizeComponent( ) /* harmony default export */ var CalendarIcon = (CalendarIcon_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/LocaleChange.vue?vue&type=template&id=652aafc2& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/LocaleChange.vue?vue&type=template&id=652aafc2& var LocaleChangevue_type_template_id_652aafc2_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ul',[_c('li',{domProps:{"textContent":_vm._s(_vm.label)},on:{"click":function($event){return _vm.$emit('change', _vm.activeItem)}}})])} var LocaleChangevue_type_template_id_652aafc2_staticRenderFns = [] @@ -1028,14 +1028,14 @@ var LocaleChange_component = normalizeComponent( ) /* harmony default export */ var LocaleChange = (LocaleChange_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeSection.vue?vue&type=template&id=1e44cb88& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeSection.vue?vue&type=template&id=1e44cb88& var TimeSectionvue_type_template_id_1e44cb88_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['vpd-addon-list vpd-time', { 'vpd-disabled': _vm.isDisableTime }]},[_c('div',{staticClass:"vpd-addon-list-content"},[_c('time-column',{ref:"hour",staticClass:"vpd-time-h",attrs:{"attributes":_vm.timeAttributes,"formatter":_vm.convertToLocaleNumber},on:{"filled":_vm.focusNext},model:{value:(_vm.hourModel),callback:function ($$v) {_vm.hourModel=$$v},expression:"hourModel"}}),_c('time-column',{ref:"minute",staticClass:"vpd-time-m",attrs:{"jump":_vm.jumpMinute,"attributes":_vm.timeAttributes,"formatter":_vm.convertToLocaleNumber},model:{value:(_vm.minuteModel),callback:function ($$v) {_vm.minuteModel=$$v},expression:"minuteModel"}})],1)])} var TimeSectionvue_type_template_id_1e44cb88_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/time/TimeSection.vue?vue&type=template&id=1e44cb88& -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeColumn.vue?vue&type=template&id=dd55353a& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeColumn.vue?vue&type=template&id=dd55353a& var TimeColumnvue_type_template_id_dd55353a_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vpd-time-column",class:_vm.classFastCounter},[_c('btn',{staticClass:"vpd-up-arrow-btn",on:{"update":function($event){return _vm.update(1)},"fastUpdate":_vm.fastUpdateCounter}},[_c('arrow',{attrs:{"width":"20","direction":"up"}})],1),_c('div',{staticClass:"vpd-counter",class:[_vm.directionClass, { 'vpd-is-focused': _vm.isInputFocused }],on:{"mousewheel":function($event){$event.stopPropagation();$event.preventDefault();return _vm.wheelUpdate($event)},"DOMMouseScroll":function($event){$event.stopPropagation();$event.preventDefault();return _vm.wheelUpdate($event)}}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",class:{ 'is-empty': !_vm.inputValue.length },attrs:{"type":"tel","maxlength":_vm.selfValue.length},domProps:{"value":(_vm.inputValue)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value},_vm.onInputChange],"focus":function($event){_vm.isInputFocused = true},"blur":function($event){_vm.isInputFocused = false},"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.preventDefault();return _vm.update(1)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.preventDefault();return _vm.update(-1)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();return _vm.onInputSubmit.apply(null, arguments)}]}}),_vm._l((_vm.value.toString().split('')),function(item,i){return _c('div',_vm._b({key:("h__" + i),staticClass:"vpd-counter-item"},'div',_vm.attributes,false),[_c('transition',{attrs:{"name":"slideY"}},[_c('span',{key:(item + "__" + i + "_h"),style:({ transition: 'all ' + _vm.transitionSpeed + 'ms ease-in-out' }),domProps:{"textContent":_vm._s(_vm.formatter(item))}})])],1)})],2),_c('btn',{staticClass:"vpd-down-arrow-btn",on:{"update":function($event){return _vm.update(-1)},"fastUpdate":_vm.fastUpdateCounter}},[_c('arrow',{attrs:{"width":"20","direction":"down"}})],1)],1)} @@ -1044,7 +1044,7 @@ var TimeColumnvue_type_template_id_dd55353a_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/time/TimeColumn.vue?vue&type=template&id=dd55353a& -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Btn.vue?vue&type=template&id=770c78cf& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Btn.vue?vue&type=template&id=770c78cf& var Btnvue_type_template_id_770c78cf_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{on:{"mousedown":_vm.down,"touchstart":_vm.down,"mouseup":_vm.click}},[_vm._t("default")],2)} var Btnvue_type_template_id_770c78cf_staticRenderFns = [] @@ -1318,6 +1318,16 @@ var scrollIntoCenter = function scrollIntoCenter(element) { } }); }; +var addEventListener = function addEventListener(el, type, handler) { + if (typeof el === 'string') el = document.querySelector(el); + if (!el) throw new Error('Cant find custom element: ' + el); + if (el.addEventListener) el.addEventListener(type, handler, true);else el.attachEvent('on' + type, handler, true); +}; +var addLiveEvent = function addLiveEvent(selector, event, callback, context) { + addEventListener(context || document, event, function (e) { + if (e.target.closest(selector)) callback.call(e.target, e); + }); +}; /* harmony default export */ var utils = ({ extend: extend, clone: clone @@ -1769,7 +1779,7 @@ var TimeSection_component = normalizeComponent( ) /* harmony default export */ var TimeSection = (TimeSection_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleMode.vue?vue&type=template&id=80c3a516& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleMode.vue?vue&type=template&id=80c3a516& var SimpleModevue_type_template_id_80c3a516_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vpd-simple-body"},[(_vm.showHeader)?_c('div',{staticClass:"vpd-header",style:({ 'background-color': _vm.color })},[_c('div',[_vm._t("header-date",function(){return [_vm._v(" "+_vm._s(_vm.convertToLocaleNumber(_vm.formattedDate))+" ")]},null,{ vm: _vm.vm, formattedDate: _vm.formattedDate })],2),(_vm.locales.length > 1)?_vm._t("locales",function(){return [_c('locale-change',{staticClass:"vpd-locales",attrs:{"locale-data":_vm.core.locale,"core":_vm.core,"locales":_vm.locales},on:{"change":_vm.setLocale}})]},null,{ vm: _vm.vm, locales: _vm.locales, setLocale: _vm.setLocale }):_vm._e()],2):_vm._e(),_c('div',{staticClass:"vpd-simple-content",on:{"mouseleave":function($event){return _vm.$emit('update:hovered-item', null)}}},[(_vm.hasStep('y'))?_c('simple-mode-column',{attrs:{"label":_vm.lang.year,"value":_vm.selectedYear,"locale":_vm.core.locale.name}},_vm._l((_vm.years),function(year,yi){return _c('div',_vm._b({key:yi,class:[ 'vpd-addon-list-item', { 'vpd-selected': year.selected }, @@ -1804,7 +1814,7 @@ var SimpleModevue_type_template_id_80c3a516_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/simple/SimpleMode.vue?vue&type=template&id=80c3a516& -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3fb91f42-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleModeColumn.vue?vue&type=template&id=396e7ab4& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"653641ba-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleModeColumn.vue?vue&type=template&id=396e7ab4& var SimpleModeColumnvue_type_template_id_396e7ab4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vpd-column",class:{ 'vpd-is-mounted': _vm.isMounted },on:{"mousewheel":function($event){$event.stopPropagation();}}},[(_vm.label)?_c('div',{staticClass:"vpd-column-header",domProps:{"textContent":_vm._s(_vm.label)}}):_vm._e(),_c('div',{ref:"content",staticClass:"vpd-column-content"},[_vm._t("default")],2)])} var SimpleModeColumnvue_type_template_id_396e7ab4_staticRenderFns = [] @@ -2997,6 +3007,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + /* harmony default export */ var VuePersianDatetimePickervue_type_script_lang_js_ = ({ components: { SimpleMode: SimpleMode, @@ -3144,6 +3155,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } }, /** + * @deprecated * The specified input element ID * @type String * @default Undefined @@ -3156,6 +3168,20 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } default: undefined }, + /** + * New version of `element` + * @type String (DOMString containing a selector list) + * @desc use this instead of `element`, + * this custom input does not need v-model, and it will be automatically updated + * also supports `display-format` + * @example .my-custom-input | #my-custom-input | div.foo > input + * @version 2.10.0 + */ + customInput: { + type: String, + default: undefined + }, + /** * The form input name when not using {element} * @type String @@ -3856,6 +3882,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } }, isCompactTime: function isCompactTime() { return this.compactTime || this.type === 'datetime' && this.simple; + }, + customInputElement: function customInputElement() { + if (this.element) return "#".concat(this.element); + return this.customInput; } }, watch: { @@ -3950,6 +3980,14 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 'localeData.name': function localeDataName() { this.$emit('localeChange', this.localeData); this.setMinMax(); + }, + displayValue: { + immediate: true, + handler: function handler(displayValue) { + if (!this.customInput) return; + var customInput = document.querySelector(this.customInput); + if (customInput) customInput.value = displayValue; + } } }, created: function created() { @@ -3963,26 +4001,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var _this9 = this; this.$nextTick(function () { - var addEvent = function addEvent(el, type, handler) { - if (el.attachEvent) el.attachEvent('on' + type, handler);else el.addEventListener(type, handler); - }; - - var live = function live(selector, event, callback, context) { - addEvent(context || document, event, function (e) { - var found, - el = e.target || e.srcElement; - - while (el && !(found = el.id === selector)) { - el = el.parentElement; - } - - if (found) callback.call(el, e); - }); - }; - - if (_this9.element && !_this9.editable) { - live(_this9.element, 'click', _this9.focus); - } + if (_this9.customInputElement && !_this9.editable) addLiveEvent(_this9.customInputElement, 'click', _this9.focus); + if (_this9.customInput && _this9.editable) addLiveEvent(_this9.customInput, 'blur', _this9.setOutput); }); document.body.addEventListener('keydown', function (e) { e = e || event; @@ -4165,7 +4185,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } updateDates: function updateDates(payload) { var _this13 = this; - if (this.isDataArray && !payload) payload = []; // fix: don't update dates if they are already up to date + if (!payload) payload = this.isDataArray ? [] : ''; // fix: don't update dates if they are already up to date if (this.date.clone && payload.toString() === this.outputValue.toString()) return; var payloadIsArray = payload instanceof Array; diff --git a/dist/vue-persian-datetime-picker.umd.js b/dist/vue-persian-datetime-picker.umd.js index 12fe9a2..7f72a61 100644 --- a/dist/vue-persian-datetime-picker.umd.js +++ b/dist/vue-persian-datetime-picker.umd.js @@ -616,8 +616,8 @@ if (typeof window !== 'undefined') { // Indicate to webpack that this file can be concatenated /* harmony default export */ var setPublicPath = (null); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/VuePersianDatetimePicker.vue?vue&type=template&id=6a3f7a5c& -var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"vpd-main",class:{ 'vpd-is-popover': _vm.isPopover },attrs:{"data-type":_vm.type,"data-placement":_vm.popoverPlace,"data-locale":_vm.localeData.name,"data-locale-dir":_vm.localeData.config.dir}},[(!_vm.element)?_c('span',{ref:"inputGroup",class:['vpd-input-group', { 'vpd-disabled': _vm.disabled }]},[_c('label',{staticClass:"vpd-icon-btn",style:({ 'background-color': _vm.color }),attrs:{"for":_vm.id},on:{"click":function($event){$event.preventDefault();$event.stopPropagation();_vm.visible = !_vm.visible}}},[_vm._t("label",function(){return [(_vm.type === 'time')?_c('time-icon',{attrs:{"width":"16px","height":"16px"}}):_c('calendar-icon',{attrs:{"width":"16px","height":"16px"}}),(_vm.label)?_c('span',{domProps:{"textContent":_vm._s(_vm.label)}}):_vm._e()]})],2),_c('input',_vm._b({ref:"input",class:[_vm.inputClass, { 'vpd-is-editable': _vm.editable }],attrs:{"id":_vm.id,"type":"text","name":_vm.name,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":_vm.displayValue},on:{"focus":_vm.focus,"blur":_vm.setOutput,"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.setOutput.apply(null, arguments)}}},'input',_vm.inputAttrs,false)),(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),(_vm.clearable && !_vm.disabled && _vm.displayValue)?_c('i',{staticClass:"vpd-clear-btn",on:{"click":_vm.clearValue}},[_vm._t("clear-btn",function(){return [_vm._v("x")]},null,{ vm: _vm.vm })],2):_vm._e()]):(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),_c('transition',{attrs:{"name":_vm.isPopover ? '' : 'vpd-fade-scale'}},[(_vm.visible)?_c('div',{ref:"picker",class:[ +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/VuePersianDatetimePicker.vue?vue&type=template&id=433cf0ae& +var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"vpd-main",class:{ 'vpd-is-popover': _vm.isPopover },attrs:{"data-type":_vm.type,"data-placement":_vm.popoverPlace,"data-locale":_vm.localeData.name,"data-locale-dir":_vm.localeData.config.dir}},[(!_vm.customInputElement)?_c('span',{ref:"inputGroup",class:['vpd-input-group', { 'vpd-disabled': _vm.disabled }]},[_c('label',{staticClass:"vpd-icon-btn",style:({ 'background-color': _vm.color }),attrs:{"for":_vm.id},on:{"click":function($event){$event.preventDefault();$event.stopPropagation();_vm.visible = !_vm.visible}}},[_vm._t("label",function(){return [(_vm.type === 'time')?_c('time-icon',{attrs:{"width":"16px","height":"16px"}}):_c('calendar-icon',{attrs:{"width":"16px","height":"16px"}}),(_vm.label)?_c('span',{domProps:{"textContent":_vm._s(_vm.label)}}):_vm._e()]})],2),_c('input',_vm._b({ref:"input",class:[_vm.inputClass, { 'vpd-is-editable': _vm.editable }],attrs:{"id":_vm.id,"type":"text","name":_vm.name,"placeholder":_vm.placeholder,"disabled":_vm.disabled},domProps:{"value":_vm.displayValue},on:{"focus":_vm.focus,"blur":_vm.setOutput,"keydown":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.setOutput.apply(null, arguments)}}},'input',_vm.inputAttrs,false)),(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),(_vm.clearable && !_vm.disabled && _vm.displayValue)?_c('i',{staticClass:"vpd-clear-btn",on:{"click":_vm.clearValue}},[_vm._t("clear-btn",function(){return [_vm._v("x")]},null,{ vm: _vm.vm })],2):_vm._e()]):(_vm.altName)?_c('input',{attrs:{"type":"hidden","name":_vm.altName},domProps:{"value":_vm.altFormatted}}):_vm._e(),_c('transition',{attrs:{"name":_vm.isPopover ? '' : 'vpd-fade-scale'}},[(_vm.visible)?_c('div',{ref:"picker",class:[ 'vpd-wrapper', ("vpd-dir-" + (_vm.localeData.config.dir)), { @@ -668,12 +668,12 @@ var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._sel var staticRenderFns = [] -// CONCATENATED MODULE: ./src/VuePersianDatetimePicker.vue?vue&type=template&id=6a3f7a5c& +// CONCATENATED MODULE: ./src/VuePersianDatetimePicker.vue?vue&type=template&id=433cf0ae& // EXTERNAL MODULE: ./src/assets/scss/style.scss var style = __webpack_require__("78a7"); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Arrow.vue?vue&type=template&id=374124c8& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Arrow.vue?vue&type=template&id=374124c8& var Arrowvue_type_template_id_374124c8_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{style:({ transform: ("rotate(" + _vm.rotation + "deg)") }),attrs:{"version":"1.1","xmlns":"http://www.w3.org/2000/svg","viewBox":"0 0 129 129","width":"30","height":"30","perspectiveAspectRato":"none"}},[_c('path',{attrs:{"fill":_vm.fill,"d":"M88.6 121.3c.8.8 1.8 1.2 2.9 1.2s2.1-.4 2.9-1.2a4.1 4.1 0 0 0 0-5.8l-51-51 51-51a4.1 4.1 0 0 0-5.8-5.8l-54\n 53.9a4.1 4.1 0 0 0 0 5.8l54 53.9z"}})])} var Arrowvue_type_template_id_374124c8_staticRenderFns = [] @@ -843,7 +843,7 @@ var component = normalizeComponent( ) /* harmony default export */ var Arrow = (component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TimeIcon.vue?vue&type=template&id=3b53c8ae& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/TimeIcon.vue?vue&type=template&id=3b53c8ae& var TimeIconvue_type_template_id_3b53c8ae_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{attrs:{"version":"1.1","role":"presentation","width":"16","height":"16","fill":_vm.fill,"viewBox":"0 0 512 512"}},[_c('path',{attrs:{"d":"M256 8C119 8 8 119 8 256S119 504 256 504 504 393 504 256 393 8 256 8zM313.1 358.1L224.9 294C221.8 291.7 220\n 288.1 220 284.3V116C220 109.4 225.4 104 232 104H280C286.6 104 292 109.4 292 116V253.7L355.5 299.9C360.9 303.8\n 362 311.3 358.1 316.7L329.9 355.5C326 360.8 318.5 362 313.1 358.1z"}})])} var TimeIconvue_type_template_id_3b53c8ae_staticRenderFns = [] @@ -898,7 +898,7 @@ var TimeIcon_component = normalizeComponent( ) /* harmony default export */ var TimeIcon = (TimeIcon_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CalendarIcon.vue?vue&type=template&id=786fd7a5& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/CalendarIcon.vue?vue&type=template&id=786fd7a5& var CalendarIconvue_type_template_id_786fd7a5_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{attrs:{"version":"1.1","width":"14","height":"16","viewBox":"0 0 448 512","xmlns":"http://www.w3.org/2000/svg","fill":_vm.fill}},[_c('path',{attrs:{"d":"M436 160H12C5.4 160 0 154.6 0 148V112C0 85.5 21.5 64 48 64H96V12C96 5.4 101.4 0 108 0H148C154.6 0 160 5.4 160\n 12V64H288V12C288 5.4 293.4 0 300 0H340C346.6 0 352 5.4 352 12V64H400C426.5 64 448 85.5 448 112V148C448 154.6\n 442.6 160 436 160zM12 192H436C442.6 192 448 197.4 448 204V464C448 490.5 426.5 512 400 512H48C21.5 512 0 490.5 0\n 464V204C0 197.4 5.4 192 12 192zM128 396C128 389.4 122.6 384 116 384H76C69.4 384 64 389.4 64 396V436C64 442.6 69.4\n 448 76 448H116C122.6 448 128 442.6 128 436V396zM128 268C128 261.4 122.6 256 116 256H76C69.4 256 64 261.4 64\n 268V308C64 314.6 69.4 320 76 320H116C122.6 320 128 314.6 128 308V268zM256 396C256 389.4 250.6 384 244\n 384H204C197.4 384 192 389.4 192 396V436C192 442.6 197.4 448 204 448H244C250.6 448 256 442.6 256 436V396zM256\n 268C256 261.4 250.6 256 244 256H204C197.4 256 192 261.4 192 268V308C192 314.6 197.4 320 204 320H244C250.6 320 256\n 314.6 256 308V268zM384 396C384 389.4 378.6 384 372 384H332C325.4 384 320 389.4 320 396V436C320 442.6 325.4 448\n 332 448H372C378.6 448 384 442.6 384 436V396zM384 268C384 261.4 378.6 256 372 256H332C325.4 256 320 261.4 320\n 268V308C320 314.6 325.4 320 332 320H372C378.6 320 384 314.6 384 308V268z"}})])} var CalendarIconvue_type_template_id_786fd7a5_staticRenderFns = [] @@ -961,7 +961,7 @@ var CalendarIcon_component = normalizeComponent( ) /* harmony default export */ var CalendarIcon = (CalendarIcon_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/LocaleChange.vue?vue&type=template&id=652aafc2& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/LocaleChange.vue?vue&type=template&id=652aafc2& var LocaleChangevue_type_template_id_652aafc2_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('ul',[_c('li',{domProps:{"textContent":_vm._s(_vm.label)},on:{"click":function($event){return _vm.$emit('change', _vm.activeItem)}}})])} var LocaleChangevue_type_template_id_652aafc2_staticRenderFns = [] @@ -1030,14 +1030,14 @@ var LocaleChange_component = normalizeComponent( ) /* harmony default export */ var LocaleChange = (LocaleChange_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeSection.vue?vue&type=template&id=1e44cb88& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeSection.vue?vue&type=template&id=1e44cb88& var TimeSectionvue_type_template_id_1e44cb88_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{class:['vpd-addon-list vpd-time', { 'vpd-disabled': _vm.isDisableTime }]},[_c('div',{staticClass:"vpd-addon-list-content"},[_c('time-column',{ref:"hour",staticClass:"vpd-time-h",attrs:{"attributes":_vm.timeAttributes,"formatter":_vm.convertToLocaleNumber},on:{"filled":_vm.focusNext},model:{value:(_vm.hourModel),callback:function ($$v) {_vm.hourModel=$$v},expression:"hourModel"}}),_c('time-column',{ref:"minute",staticClass:"vpd-time-m",attrs:{"jump":_vm.jumpMinute,"attributes":_vm.timeAttributes,"formatter":_vm.convertToLocaleNumber},model:{value:(_vm.minuteModel),callback:function ($$v) {_vm.minuteModel=$$v},expression:"minuteModel"}})],1)])} var TimeSectionvue_type_template_id_1e44cb88_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/time/TimeSection.vue?vue&type=template&id=1e44cb88& -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeColumn.vue?vue&type=template&id=dd55353a& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/time/TimeColumn.vue?vue&type=template&id=dd55353a& var TimeColumnvue_type_template_id_dd55353a_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vpd-time-column",class:_vm.classFastCounter},[_c('btn',{staticClass:"vpd-up-arrow-btn",on:{"update":function($event){return _vm.update(1)},"fastUpdate":_vm.fastUpdateCounter}},[_c('arrow',{attrs:{"width":"20","direction":"up"}})],1),_c('div',{staticClass:"vpd-counter",class:[_vm.directionClass, { 'vpd-is-focused': _vm.isInputFocused }],on:{"mousewheel":function($event){$event.stopPropagation();$event.preventDefault();return _vm.wheelUpdate($event)},"DOMMouseScroll":function($event){$event.stopPropagation();$event.preventDefault();return _vm.wheelUpdate($event)}}},[_c('input',{directives:[{name:"model",rawName:"v-model",value:(_vm.inputValue),expression:"inputValue"}],ref:"input",class:{ 'is-empty': !_vm.inputValue.length },attrs:{"type":"tel","maxlength":_vm.selfValue.length},domProps:{"value":(_vm.inputValue)},on:{"input":[function($event){if($event.target.composing){ return; }_vm.inputValue=$event.target.value},_vm.onInputChange],"focus":function($event){_vm.isInputFocused = true},"blur":function($event){_vm.isInputFocused = false},"keydown":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.preventDefault();return _vm.update(1)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.preventDefault();return _vm.update(-1)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }$event.preventDefault();return _vm.onInputSubmit.apply(null, arguments)}]}}),_vm._l((_vm.value.toString().split('')),function(item,i){return _c('div',_vm._b({key:("h__" + i),staticClass:"vpd-counter-item"},'div',_vm.attributes,false),[_c('transition',{attrs:{"name":"slideY"}},[_c('span',{key:(item + "__" + i + "_h"),style:({ transition: 'all ' + _vm.transitionSpeed + 'ms ease-in-out' }),domProps:{"textContent":_vm._s(_vm.formatter(item))}})])],1)})],2),_c('btn',{staticClass:"vpd-down-arrow-btn",on:{"update":function($event){return _vm.update(-1)},"fastUpdate":_vm.fastUpdateCounter}},[_c('arrow',{attrs:{"width":"20","direction":"down"}})],1)],1)} @@ -1046,7 +1046,7 @@ var TimeColumnvue_type_template_id_dd55353a_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/time/TimeColumn.vue?vue&type=template&id=dd55353a& -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Btn.vue?vue&type=template&id=770c78cf& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Btn.vue?vue&type=template&id=770c78cf& var Btnvue_type_template_id_770c78cf_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{on:{"mousedown":_vm.down,"touchstart":_vm.down,"mouseup":_vm.click}},[_vm._t("default")],2)} var Btnvue_type_template_id_770c78cf_staticRenderFns = [] @@ -1320,6 +1320,16 @@ var scrollIntoCenter = function scrollIntoCenter(element) { } }); }; +var addEventListener = function addEventListener(el, type, handler) { + if (typeof el === 'string') el = document.querySelector(el); + if (!el) throw new Error('Cant find custom element: ' + el); + if (el.addEventListener) el.addEventListener(type, handler, true);else el.attachEvent('on' + type, handler, true); +}; +var addLiveEvent = function addLiveEvent(selector, event, callback, context) { + addEventListener(context || document, event, function (e) { + if (e.target.closest(selector)) callback.call(e.target, e); + }); +}; /* harmony default export */ var utils = ({ extend: extend, clone: clone @@ -1771,7 +1781,7 @@ var TimeSection_component = normalizeComponent( ) /* harmony default export */ var TimeSection = (TimeSection_component.exports); -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleMode.vue?vue&type=template&id=80c3a516& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleMode.vue?vue&type=template&id=80c3a516& var SimpleModevue_type_template_id_80c3a516_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vpd-simple-body"},[(_vm.showHeader)?_c('div',{staticClass:"vpd-header",style:({ 'background-color': _vm.color })},[_c('div',[_vm._t("header-date",function(){return [_vm._v(" "+_vm._s(_vm.convertToLocaleNumber(_vm.formattedDate))+" ")]},null,{ vm: _vm.vm, formattedDate: _vm.formattedDate })],2),(_vm.locales.length > 1)?_vm._t("locales",function(){return [_c('locale-change',{staticClass:"vpd-locales",attrs:{"locale-data":_vm.core.locale,"core":_vm.core,"locales":_vm.locales},on:{"change":_vm.setLocale}})]},null,{ vm: _vm.vm, locales: _vm.locales, setLocale: _vm.setLocale }):_vm._e()],2):_vm._e(),_c('div',{staticClass:"vpd-simple-content",on:{"mouseleave":function($event){return _vm.$emit('update:hovered-item', null)}}},[(_vm.hasStep('y'))?_c('simple-mode-column',{attrs:{"label":_vm.lang.year,"value":_vm.selectedYear,"locale":_vm.core.locale.name}},_vm._l((_vm.years),function(year,yi){return _c('div',_vm._b({key:yi,class:[ 'vpd-addon-list-item', { 'vpd-selected': year.selected }, @@ -1806,7 +1816,7 @@ var SimpleModevue_type_template_id_80c3a516_staticRenderFns = [] // CONCATENATED MODULE: ./src/components/simple/SimpleMode.vue?vue&type=template&id=80c3a516& -// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29d53284-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleModeColumn.vue?vue&type=template&id=396e7ab4& +// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"e4141cb8-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/simple/SimpleModeColumn.vue?vue&type=template&id=396e7ab4& var SimpleModeColumnvue_type_template_id_396e7ab4_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vpd-column",class:{ 'vpd-is-mounted': _vm.isMounted },on:{"mousewheel":function($event){$event.stopPropagation();}}},[(_vm.label)?_c('div',{staticClass:"vpd-column-header",domProps:{"textContent":_vm._s(_vm.label)}}):_vm._e(),_c('div',{ref:"content",staticClass:"vpd-column-content"},[_vm._t("default")],2)])} var SimpleModeColumnvue_type_template_id_396e7ab4_staticRenderFns = [] @@ -2995,6 +3005,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + /* harmony default export */ var VuePersianDatetimePickervue_type_script_lang_js_ = ({ components: { SimpleMode: SimpleMode, @@ -3142,6 +3153,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } }, /** + * @deprecated * The specified input element ID * @type String * @default Undefined @@ -3154,6 +3166,20 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } default: undefined }, + /** + * New version of `element` + * @type String (DOMString containing a selector list) + * @desc use this instead of `element`, + * this custom input does not need v-model, and it will be automatically updated + * also supports `display-format` + * @example .my-custom-input | #my-custom-input | div.foo > input + * @version 2.10.0 + */ + customInput: { + type: String, + default: undefined + }, + /** * The form input name when not using {element} * @type String @@ -3854,6 +3880,10 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } }, isCompactTime: function isCompactTime() { return this.compactTime || this.type === 'datetime' && this.simple; + }, + customInputElement: function customInputElement() { + if (this.element) return "#".concat(this.element); + return this.customInput; } }, watch: { @@ -3948,6 +3978,14 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } 'localeData.name': function localeDataName() { this.$emit('localeChange', this.localeData); this.setMinMax(); + }, + displayValue: { + immediate: true, + handler: function handler(displayValue) { + if (!this.customInput) return; + var customInput = document.querySelector(this.customInput); + if (customInput) customInput.value = displayValue; + } } }, created: function created() { @@ -3961,26 +3999,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } var _this9 = this; this.$nextTick(function () { - var addEvent = function addEvent(el, type, handler) { - if (el.attachEvent) el.attachEvent('on' + type, handler);else el.addEventListener(type, handler); - }; - - var live = function live(selector, event, callback, context) { - addEvent(context || document, event, function (e) { - var found, - el = e.target || e.srcElement; - - while (el && !(found = el.id === selector)) { - el = el.parentElement; - } - - if (found) callback.call(el, e); - }); - }; - - if (_this9.element && !_this9.editable) { - live(_this9.element, 'click', _this9.focus); - } + if (_this9.customInputElement && !_this9.editable) addLiveEvent(_this9.customInputElement, 'click', _this9.focus); + if (_this9.customInput && _this9.editable) addLiveEvent(_this9.customInput, 'blur', _this9.setOutput); }); document.body.addEventListener('keydown', function (e) { e = e || event; @@ -4163,7 +4183,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } updateDates: function updateDates(payload) { var _this13 = this; - if (this.isDataArray && !payload) payload = []; // fix: don't update dates if they are already up to date + if (!payload) payload = this.isDataArray ? [] : ''; // fix: don't update dates if they are already up to date if (this.date.clone && payload.toString() === this.outputValue.toString()) return; var payloadIsArray = payload instanceof Array; diff --git a/dist/vue-persian-datetime-picker.umd.min.js b/dist/vue-persian-datetime-picker.umd.min.js index 4420568..bbefb6b 100644 --- a/dist/vue-persian-datetime-picker.umd.min.js +++ b/dist/vue-persian-datetime-picker.umd.min.js @@ -1 +1 @@ -(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e(require("moment")):"function"===typeof define&&define.amd?define(["moment"],e):"object"===typeof exports?exports["VuePersianDatetimePicker"]=e(require("moment")):t["VuePersianDatetimePicker"]=e(t["moment"])})("undefined"!==typeof self?self:this,(function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s="fb15")}({"24fb":function(t,e,n){"use strict";function i(t,e){var n=t[1]||"",i=t[3];if(!i)return n;if(e&&"function"===typeof btoa){var a=o(i),r=i.sources.map((function(t){return"/*# sourceURL=".concat(i.sourceRoot||"").concat(t," */")}));return[n].concat(r).concat([a]).join("\n")}return[n].join("\n")}function o(t){var e=btoa(unescape(encodeURIComponent(JSON.stringify(t)))),n="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(e);return"/*# ".concat(n," */")}t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=i(e,t);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,i){"string"===typeof t&&(t=[[null,t,""]]);var o={};if(i)for(var a=0;aspan{display:inline-block;padding:0 10px;line-height:22px;height:22px;border-width:1px;border-style:solid;border-radius:2px;transition:all .1s ease-out}.vpd-year-label>span:not(:hover){border-color:transparent!important;color:inherit!important}.vpd-date{position:relative;font-size:28px;line-height:40px;height:40px;overflow:hidden}.vpd-date span{display:block;height:inherit;line-height:inherit}.vpd-week{font-size:12px;padding:0 14px;line-height:20px;color:#b9b9b9;margin-bottom:10px;height:20px}.vpd-weekday{float:right;width:40px;text-align:center}.vpd-days{padding:0 18px;position:relative;overflow:hidden;transition:height .3s cubic-bezier(.75,.02,.27,.99)}.vpd-day{width:40px;height:40px;float:right;line-height:40px;position:relative}.vpd-day:not(.vpd-empty){cursor:pointer;transition:color .45s ease;text-align:center}.vpd-day[disabled]{cursor:default;color:#ccc}.vpd-day[disabled] .vpd-day-effect{background-color:transparent}.vpd-day[disabled] .vpd-day-text{color:#ccc}.vpd-day:not([disabled]):hover{color:#fff}.vpd-day:not([disabled]):hover .vpd-day-effect{transform:scale(1);opacity:.6}.vpd-day:not([disabled]).vpd-selected{color:#fff}.vpd-day:not([disabled]).vpd-selected .vpd-day-effect{transform:scale(1);opacity:1}.vpd-day:not([disabled]).vpd-range-between{color:#fff}.vpd-day:not([disabled]).vpd-range-between .vpd-day-effect{transform:scale(.75);opacity:1}.vpd-day:not([disabled]).vpd-range-hover{color:#fff}.vpd-day:not([disabled]).vpd-range-hover .vpd-day-effect{transform:scale(.7);opacity:.6}.vpd-day-effect{position:absolute;width:36px;height:36px;border-radius:50%;top:2px;left:2px;transform:scale(0);opacity:0;transition:all .45s ease}.vpd-controls,.vpd-day-text{position:relative}.vpd-controls{z-index:2;height:50px;line-height:50px;text-align:center}.vpd-controls button{position:relative;background-color:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer}.vpd-controls button[disabled]{opacity:.3;cursor:default}.vpd-next,.vpd-prev{width:50px;height:50px;line-height:50px}.vpd-next{float:right}.vpd-prev{float:left}.vpd-arrow{width:11px;height:11px}.vpd-month{position:relative;overflow:hidden}.vpd-month-label{position:absolute;top:0;left:50px;right:50px;overflow:hidden;width:95px;margin-left:auto;margin-right:auto;line-height:50px;height:50px;text-align:center;cursor:pointer}.vpd-month-label>span{display:inline-block;padding:0 5px;line-height:26px;height:26px;border-width:1px;border-style:solid;border-radius:2px;transition:all .1s ease-out;white-space:nowrap}.vpd-month-label>span:not(:hover){border-color:transparent!important;color:inherit!important}.vpd-actions{text-align:right;padding:8px}.vpd-actions button{border:none;background-color:transparent;display:inline-block;cursor:pointer;outline:none;font-size:14px;text-transform:uppercase;min-width:88px;text-align:center;-webkit-appearance:none;line-height:36px;height:36px;transition:all .3s ease}.vpd-actions button:hover{background-color:#f2f2f2}.vpd-actions button[disabled]{opacity:.6;cursor:default}.vpd-addon-list-content{direction:rtl}.vpd-addon-list-item{width:33.33333%;text-align:center;font-size:14px;height:44px;line-height:36px;transition:all .3s ease;color:#8a8a8a;cursor:pointer;float:right;border:4px solid #fff}.vpd-addon-list-item.vpd-selected,.vpd-addon-list-item:hover{background-color:#f9f9f9}.vpd-addon-list-item.vpd-selected{font-weight:700;background-color:#f5f5f5}.vpd-addon-list{width:100%;background-color:#fff;position:absolute;z-index:2;overflow:auto;top:0;bottom:52px;border-bottom:1px solid #eee;direction:ltr}.vpd-addon-list.vpd-can-close{padding-top:30px}.vpd-month-list{padding-top:15px}.vpd-month-list .vpd-addon-list-item{height:54px;line-height:46px}.vpd-addon-list-item[disabled]{opacity:.3;cursor:default!important;background-color:transparent!important}.vpd-close-addon{position:absolute;top:4px;left:4px;z-index:2;width:30px;height:30px;line-height:30px;color:#444;font-family:sans-serif;text-align:center;cursor:pointer;background-color:rgba(0,0,0,.1)}.vpd-time{-ms-user-select:none;user-select:none;-moz-user-select:none;-webkit-user-select:none}.vpd-time .vpd-time-h,.vpd-time .vpd-time-m{position:relative;margin-top:70px;float:left;width:50%;height:100%;text-align:center;color:#a2a2a2}.vpd-time .vpd-time-h .vpd-counter,.vpd-time .vpd-time-m .vpd-counter{font-size:90px;height:100px;line-height:100px;overflow:hidden;position:relative;direction:ltr;transition:opacity .3s ease-in-out}.vpd-time .vpd-time-h .vpd-counter-item,.vpd-time .vpd-time-m .vpd-counter-item{height:inherit;width:51px;display:inline-block;vertical-align:text-top;position:relative}.vpd-time .vpd-time-h:after{position:absolute;top:50%;right:0;content:":";font-size:70px;transform:translate(50%,-50%);transition:inherit}.vpd-time .vpd-down-arrow-btn,.vpd-time .vpd-up-arrow-btn{display:block;cursor:pointer;outline:none;height:34px}.vpd-time.vpd-disabled .vpd-counter-item{opacity:.5}.vpd-time-column .vpd-counter{position:relative}.vpd-time-column .vpd-counter input{position:absolute;z-index:5;border:none;background-color:transparent;top:0;left:0;width:100%;height:100%;text-align:center;outline:none;font-size:inherit;color:inherit;line-height:inherit;opacity:0;padding:5% 0 0 0}.vpd-time-column .vpd-counter input:focus{opacity:1}.vpd-time-column .vpd-counter input:focus:not(.is-empty)~div{opacity:0}.vpd-prev-step{position:absolute;top:0;left:0;width:30px;height:30px;text-align:center;padding:9px;cursor:pointer}.vpd-prev-step:hover{background-color:rgba(0,0,0,.2)}[data-type=time] .vpd-time .vpd-time-h,[data-type=time] .vpd-time .vpd-time-m{margin-top:40px}.vpd-is-inline{position:static;background-color:transparent;height:auto;width:auto;display:block;margin-top:2px}.vpd-is-inline .vpd-container{position:static;transform:none}.vpd-is-inline .vpd-content{box-shadow:0 0 1px -1px #000}.vpd-is-popover{display:inline-block;position:relative}.vpd-is-popover .vpd-wrapper{position:static;width:auto;height:0}.vpd-is-popover .vpd-wrapper .vpd-container{transform:none;top:auto;left:auto;z-index:500}.vpd-is-popover .vpd-wrapper .vpd-content{transition:none;box-shadow:0 3px 8px rgba(0,0,0,.4)}.vpd-is-popover[data-placement=top-left] .vpd-container{bottom:100%;left:0}.vpd-is-popover[data-placement=top-left] .vpd-content{box-shadow:0 -3px 8px rgba(0,0,0,.4)}.vpd-is-popover[data-placement=top-right] .vpd-container{bottom:100%;right:0}.vpd-is-popover[data-placement=top-right] .vpd-content{box-shadow:0 -3px 8px rgba(0,0,0,.4)}.vpd-is-popover[data-placement=bottom-left] .vpd-container{top:100%;left:0}.vpd-is-popover[data-placement=bottom-right] .vpd-container{top:100%;right:0}.vpd-is-popover[data-placement=left-top] .vpd-container{bottom:0;right:100%}.vpd-is-popover[data-placement=left-bottom] .vpd-container{top:0;right:100%}.vpd-is-popover[data-placement=right-top] .vpd-container{bottom:0;left:100%}.vpd-is-popover[data-placement=right-bottom] .vpd-container{top:0;left:100%}.vpd-no-footer .vpd-addon-list{bottom:0;border-bottom:none}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time{margin-top:10px;display:block!important;position:relative;border-top:1px solid #eee;overflow:hidden}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-addon-list-content{display:flex;justify-content:center;direction:ltr}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-counter-item{width:18px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-counter{height:30px;font-size:20px;line-height:34px;width:40px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-down-arrow-btn,.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-up-arrow-btn{position:absolute;top:0;height:26px;width:26px;margin:2px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.05)}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-m{margin-top:0;float:none;width:100px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-m .vpd-up-arrow-btn{right:30px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-m .vpd-down-arrow-btn{right:0}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h{margin-top:0;float:none;width:100px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h:after{font-size:20px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h .vpd-counter{margin-left:auto}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h .vpd-up-arrow-btn{left:0}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h .vpd-down-arrow-btn{left:30px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time svg{height:10px}.vpd-wrapper[data-type=datetime] .vpd-date{font-size:22px}.vpd-wrapper.vpd-is-range .vpd-date{font-size:16px}.vpd-wrapper.vpd-is-multiple .vpd-date{font-size:14px;white-space:normal;line-height:20px}@media screen and (max-height:460px){.vpd-wrapper{overflow:auto;text-align:center}.vpd-wrapper .vpd-container{position:relative;top:0;left:0;transform:none;display:inline-block;margin:20px auto}}.vpd-locales{list-style-type:none;padding:0;margin:0;position:absolute;left:14px;top:12px;line-height:24px;text-align:center;opacity:.7}.vpd-locales li{cursor:pointer}.vpd-simple-body .vpd-header{display:flex;padding:10px;justify-content:space-between}.vpd-simple-body .vpd-locales{position:static;padding:0 5px;line-height:unset}.vpd-simple-content{display:flex;justify-content:center;height:240px;direction:ltr}.vpd-simple-content .vpd-column{height:100%;flex-grow:1;display:flex;flex-flow:column;padding:5px}.vpd-simple-content .vpd-column .vpd-column-header{text-align:center;font-weight:700;color:#000;height:30px;line-height:30px}.vpd-simple-content .vpd-column .vpd-column-content{flex-grow:1;height:100%;overflow:auto;padding-right:4px;position:relative}.vpd-simple-content .vpd-column .vpd-column-content:after,.vpd-simple-content .vpd-column .vpd-column-content:before{display:block;height:80px;content:""}@media screen and (min-width:640px){.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar{width:8px}.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar-track{background:rgba(0,0,0,.05);border-radius:5px}.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2);border-radius:5px}.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.5)}}.vpd-simple-content .vpd-addon-list-item{width:100%;float:none!important;line-height:42px;height:44px;border:1px solid #fff}.vpd-simple-content .vpd-range-first{border-radius:40px 40px 0 0}.vpd-simple-content .vpd-range-between{font-weight:700;background-color:#f5f5f5}.vpd-simple-content .vpd-range-last{border-radius:0 0 40px 40px}.vpd-simple-content .vpd-range-last.vpd-range-first{border-radius:40px}.vpd-simple-content .vpd-column.vpd-is-mounted .vpd-selected:not(.vpd-range-first):not(.vpd-range-last):not([disabled]){position:sticky;top:0;bottom:0}.vpd-is-multiple .vpd-simple-content .vpd-column .vpd-selected{position:static!important}.vpd-dir-ltr .vpd-actions,.vpd-dir-ltr .vpd-addon-list-content,.vpd-dir-ltr .vpd-content{direction:ltr}.vpd-dir-ltr .vpd-actions,.vpd-dir-ltr .vpd-content{text-align:left;font-family:sans-serif}.vpd-dir-ltr .vpd-month-label{font-size:90%}.vpd-dir-ltr .vpd-addon-list-item,.vpd-dir-ltr .vpd-day,.vpd-dir-ltr .vpd-weekday{float:left}.vpd-dir-ltr .vpd-locales{left:auto;right:14px}.vpd-dir-rtl .vpd-next,.vpd-dir-rtl .vpd-prev{transform:rotateY(180deg)}.vpd-dir-rtl .vpd-next{float:left}.vpd-dir-rtl .vpd-prev{float:right}',""]),t.exports=e},"499e":function(t,e,n){"use strict";function i(t,e){for(var n=[],i={},o=0;on.parts.length&&(i.parts.length=n.parts.length)}else{var r=[];for(o=0;o([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(i,"$1").trim());for(var u=0;u1?t._t("locales",(function(){return[n("locale-change",{staticClass:"vpd-locales",attrs:{"locale-data":t.localeData,core:t.core,locales:t.locales},on:{change:t.setLocale}})]}),null,{vm:t.vm,locales:t.locales,setLocale:t.setLocale}):t._e()],2),n("div",{staticClass:"vpd-body"},[t.simple?n("simple-mode",{attrs:{lang:t.lang,core:t.core,range:t.range,color:t.color,locales:t.locales,visible:t.visible,multiple:t.multiple,years:t.years,months:t.months,"month-days":t.monthDays,"has-step":t.hasStep,"selected-dates":t.selectedDates,"formatted-date":t.formattedDate,"hovered-item":t.hoveredItem,"set-locale":t.setLocale,"convert-to-locale-number":t.convertToLocaleNumber},on:{"update:hoveredItem":function(e){t.hoveredItem=e},"update:hovered-item":function(e){t.hoveredItem=e},"select-year":t.selectYear,"select-month":t.selectMonth,"select-day":t.selectDay},scopedSlots:t._u([{key:"header-date",fn:function(e){return[t._t("header-date",null,null,e)]}},{key:"locales",fn:function(e){return[t._t("locales",null,null,e)]}},{key:"year-item",fn:function(e){return[t._t("year-item",null,null,e)]}},{key:"month-item",fn:function(e){return[t._t("month-item",null,null,e)]}},{key:"day-item",fn:function(e){return[t._t("day-item",null,null,e)]}}],null,!0)}):[t.hasStep("d")?[n("div",{class:["vpd-controls",t.directionClassDate]},[n("button",{staticClass:"vpd-next",attrs:{type:"button",title:t.lang.nextMonth,disabled:t.nextMonthDisabled},on:{click:t.nextMonth}},[t._t("next-month",(function(){return[n("arrow",{staticStyle:{"vertical-align":"middle"},attrs:{width:"10",fill:"#000",direction:"right"}})]}))],2),n("button",{staticClass:"vpd-prev",attrs:{type:"button",title:t.lang.prevMonth,disabled:t.prevMonthDisabled},on:{click:t.prevMonth}},[t._t("prev-month",(function(){return[n("arrow",{staticStyle:{"vertical-align":"middle"},attrs:{width:"10",fill:"#000",direction:"left"}})]}))],2),n("transition",{attrs:{name:"slideX"}},[n("div",{key:t.date.xMonth(),staticClass:"vpd-month-label",on:{click:function(e){return t.goStep("m")}}},[t._t("month-name",(function(){return[n("span",{style:{"border-color":t.color,color:t.color},domProps:{textContent:t._s(t.convertToLocaleNumber(t.date.xFormat("jMMMM jYYYY")))}})]}),null,{vm:t.vm,date:t.date,color:t.color})],2)])],1),n("div",{staticClass:"vpd-clearfix",class:["vpd-month",t.directionClassDate]},[n("div",{staticClass:"vpd-clearfix vpd-week"},t._l(t.weekDays,(function(e,i){return n("div",{key:i+"-"+e,staticClass:"vpd-weekday"},[t._t("weekday",(function(){return[t._v(" "+t._s(e)+" ")]}),null,{vm:t.vm,day:e})],2)})),0),n("div",{staticClass:"vpd-days",style:{height:40*t.month.length+"px"},on:{mouseleave:function(e){t.hoveredItem=null}}},[n("transition",{class:t.directionClassDate,attrs:{name:"slideX"}},[n("div",{key:t.date.xMonth()},t._l(t.monthDays,(function(e,i){return n("div",{key:i,staticClass:"vpd-clearfix"},t._l(e,(function(e,i){return n("div",t._b({key:i,class:["vpd-day",{"vpd-selected":e.selected,"vpd-empty":null==e.date,"vpd-range-first":e.isFirst,"vpd-range-last":e.isLast,"vpd-range-between":e.isBetween,"vpd-range-hover":t.hoveredItem&&e.isHover},e.attributes.class],attrs:{disabled:e.disabled},on:{click:function(n){return t.selectDay(e)},mouseover:function(n){t.hoveredItem=e.date}}},"div",e.attributes,!1),[null!=e.date?[t._t("day-item",(function(){return[n("span",{staticClass:"vpd-day-effect",style:{"background-color":t.color}}),n("span",{staticClass:"vpd-day-text",domProps:{textContent:t._s(t.convertToLocaleNumber(e.formatted))}})]}),null,{vm:t.vm,day:e,color:t.color})]:t._e()],2)})),0)})),0)])],1)])]:n("div",{staticStyle:{height:"250px"}}),n("transition",{attrs:{name:"fade"}},[t.hasStep("y")?n("div",{directives:[{name:"show",rawName:"v-show",value:"y"===t.currentStep,expression:"currentStep === 'y'"}],ref:"year",class:["vpd-addon-list",{"vpd-can-close":t.steps.length>1}]},[n("div",{staticClass:"vpd-addon-list-content"},t._l(t.years,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.selectYear(e)}}},"div",e.attributes,!1),[t._t("year-item",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(e.xFormat("jYYYY")))+" ")]}),null,{vm:t.vm,year:e,color:t.color})],2)})),0)]):t._e()]),n("transition",{attrs:{name:"fade"}},[t.hasStep("m")?n("div",{directives:[{name:"show",rawName:"v-show",value:"m"===t.currentStep,expression:"currentStep === 'm'"}],ref:"month",class:["vpd-addon-list vpd-month-list",{"vpd-can-close":t.steps.length>1}]},[n("div",{staticClass:"vpd-addon-list-content"},t._l(t.months,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.selectMonth(e)}}},"div",e.attributes,!1),[t._t("month-item",(function(){return[t._v(" "+t._s(e.xFormat("jMMMM"))+" ")]}),null,{vm:t.vm,monthItem:e,color:t.color})],2)})),0)]):t._e()]),n("transition",{attrs:{name:"fade"}},[t.steps.length>1&&"d"!==t.currentStep&&t.hasStep("d")?n("span",{staticClass:"vpd-close-addon",on:{click:function(e){return t.goStep("d")}}},[t._t("close-btn",(function(){return[t._v("x")]}),null,{vm:t.vm})],2):t._e()])],n("transition",{attrs:{name:"fade"}},[t.hasStep("t")?n("time-section",{directives:[{name:"show",rawName:"v-show",value:"t"===t.currentStep,expression:"currentStep === 't'"}],ref:"time",attrs:{date:t.date,time:t.time,"is-more":t.isMore,"is-lower":t.isLower,"min-date":t.minDate,"max-date":t.maxDate,"jump-minute":t.jumpMinute,"round-minute":t.roundMinute,"get-highlights":t.getHighlights,"selected-dates":t.selectedDates,"convert-to-locale-number":t.convertToLocaleNumber},on:{"update:date":function(e){t.date=e},"update:time":function(e){t.time=e}}}):t._e()],1),t.autoSubmit&&!t.hasStep("t")?[t.simple?t._e():n("br")]:n("div",{staticClass:"vpd-actions"},[t._t("submit-btn",(function(){return[n("button",{style:{color:t.color},attrs:{type:"button",disabled:!t.canSubmit},domProps:{textContent:t._s(t.lang.submit)},on:{click:t.submit}})]}),null,{vm:t.vm,canSubmit:t.canSubmit,color:t.color,submit:t.submit,lang:t.lang}),t.inline?t._e():t._t("cancel-btn",(function(){return[n("button",{style:{color:t.color},attrs:{type:"button"},domProps:{textContent:t._s(t.lang.cancel)},on:{click:function(e){t.visible=!1}}})]}),null,{vm:t.vm,color:t.color,lang:t.lang}),t.showNowBtn&&t.canGoToday?t._t("now-btn",(function(){return[n("button",{style:{color:t.color},attrs:{type:"button"},domProps:{textContent:t._s(t.lang.now)},on:{click:t.goToday}})]}),null,{vm:t.vm,color:t.color,goToday:t.goToday,lang:t.lang}):t._e()],2)],2)])])]):t._e()])],1)},s=[],l=(n("78a7"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{style:{transform:"rotate("+t.rotation+"deg)"},attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 129 129",width:"30",height:"30",perspectiveAspectRato:"none"}},[n("path",{attrs:{fill:t.fill,d:"M88.6 121.3c.8.8 1.8 1.2 2.9 1.2s2.1-.4 2.9-1.2a4.1 4.1 0 0 0 0-5.8l-51-51 51-51a4.1 4.1 0 0 0-5.8-5.8l-54\n 53.9a4.1 4.1 0 0 0 0 5.8l54 53.9z"}})])}),d=[],c={props:{fill:{type:String,default:"#a2a2a2"},direction:{type:String,default:"up"}},computed:{rotation:function(){return{up:90,left:0,right:180,down:-90}[this.direction]}}},p=c;function u(t,e,n,i,o,a,r,s){var l,d="function"===typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=n,d._compiled=!0),i&&(d.functional=!0),a&&(d._scopeId="data-v-"+a),r?(l=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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},d._ssrRegister=l):o&&(l=s?function(){o.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(d.functional){d._injectStyles=l;var c=d.render;d.render=function(t,e){return l.call(e),c(t,e)}}else{var p=d.beforeCreate;d.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:d}}var h=u(p,l,d,!1,null,null,null),m=h.exports,f=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{attrs:{version:"1.1",role:"presentation",width:"16",height:"16",fill:t.fill,viewBox:"0 0 512 512"}},[n("path",{attrs:{d:"M256 8C119 8 8 119 8 256S119 504 256 504 504 393 504 256 393 8 256 8zM313.1 358.1L224.9 294C221.8 291.7 220\n 288.1 220 284.3V116C220 109.4 225.4 104 232 104H280C286.6 104 292 109.4 292 116V253.7L355.5 299.9C360.9 303.8\n 362 311.3 358.1 316.7L329.9 355.5C326 360.8 318.5 362 313.1 358.1z"}})])},v=[],y={props:{fill:{type:String,default:"#f9f9f9"}}},g=y,b=u(g,f,v,!1,null,null,null),x=b.exports,w=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{attrs:{version:"1.1",width:"14",height:"16",viewBox:"0 0 448 512",xmlns:"http://www.w3.org/2000/svg",fill:t.fill}},[n("path",{attrs:{d:"M436 160H12C5.4 160 0 154.6 0 148V112C0 85.5 21.5 64 48 64H96V12C96 5.4 101.4 0 108 0H148C154.6 0 160 5.4 160\n 12V64H288V12C288 5.4 293.4 0 300 0H340C346.6 0 352 5.4 352 12V64H400C426.5 64 448 85.5 448 112V148C448 154.6\n 442.6 160 436 160zM12 192H436C442.6 192 448 197.4 448 204V464C448 490.5 426.5 512 400 512H48C21.5 512 0 490.5 0\n 464V204C0 197.4 5.4 192 12 192zM128 396C128 389.4 122.6 384 116 384H76C69.4 384 64 389.4 64 396V436C64 442.6 69.4\n 448 76 448H116C122.6 448 128 442.6 128 436V396zM128 268C128 261.4 122.6 256 116 256H76C69.4 256 64 261.4 64\n 268V308C64 314.6 69.4 320 76 320H116C122.6 320 128 314.6 128 308V268zM256 396C256 389.4 250.6 384 244\n 384H204C197.4 384 192 389.4 192 396V436C192 442.6 197.4 448 204 448H244C250.6 448 256 442.6 256 436V396zM256\n 268C256 261.4 250.6 256 244 256H204C197.4 256 192 261.4 192 268V308C192 314.6 197.4 320 204 320H244C250.6 320 256\n 314.6 256 308V268zM384 396C384 389.4 378.6 384 372 384H332C325.4 384 320 389.4 320 396V436C320 442.6 325.4 448\n 332 448H372C378.6 448 384 442.6 384 436V396zM384 268C384 261.4 378.6 256 372 256H332C325.4 256 320 261.4 320\n 268V308C320 314.6 325.4 320 332 320H372C378.6 320 384 314.6 384 308V268z"}})])},D=[],_={props:{fill:{type:String,default:"#f9f9f9"}}},S=_,M=u(S,w,D,!1,null,null,null),k=M.exports,C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",[n("li",{domProps:{textContent:t._s(t.label)},on:{click:function(e){return t.$emit("change",t.activeItem)}}})])},Y=[],T={name:"LocaleChange",props:{locales:{type:Array,default:function(){return[]}},core:{type:Object,default:function(){return{}}},localeData:{type:Object,default:function(){return{}}}},computed:{activeItem:function(){var t=this.locales.indexOf(this.localeData.name)+1;return t===this.locales.length&&(t=0),String(this.locales[t])},label:function(){return this.core.localesConfig[this.activeItem].lang.label||this.activeItem.toUpperCase()}}},j=T,L=u(j,C,Y,!1,null,null,null),$=L.exports,O=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vpd-addon-list vpd-time",{"vpd-disabled":t.isDisableTime}]},[n("div",{staticClass:"vpd-addon-list-content"},[n("time-column",{ref:"hour",staticClass:"vpd-time-h",attrs:{attributes:t.timeAttributes,formatter:t.convertToLocaleNumber},on:{filled:t.focusNext},model:{value:t.hourModel,callback:function(e){t.hourModel=e},expression:"hourModel"}}),n("time-column",{ref:"minute",staticClass:"vpd-time-m",attrs:{jump:t.jumpMinute,attributes:t.timeAttributes,formatter:t.convertToLocaleNumber},model:{value:t.minuteModel,callback:function(e){t.minuteModel=e},expression:"minuteModel"}})],1)])},F=[],V=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vpd-time-column",class:t.classFastCounter},[n("btn",{staticClass:"vpd-up-arrow-btn",on:{update:function(e){return t.update(1)},fastUpdate:t.fastUpdateCounter}},[n("arrow",{attrs:{width:"20",direction:"up"}})],1),n("div",{staticClass:"vpd-counter",class:[t.directionClass,{"vpd-is-focused":t.isInputFocused}],on:{mousewheel:function(e){return e.stopPropagation(),e.preventDefault(),t.wheelUpdate(e)},DOMMouseScroll:function(e){return e.stopPropagation(),e.preventDefault(),t.wheelUpdate(e)}}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",class:{"is-empty":!t.inputValue.length},attrs:{type:"tel",maxlength:t.selfValue.length},domProps:{value:t.inputValue},on:{input:[function(e){e.target.composing||(t.inputValue=e.target.value)},t.onInputChange],focus:function(e){t.isInputFocused=!0},blur:function(e){t.isInputFocused=!1},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.update(1))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.update(-1))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onInputSubmit.apply(null,arguments))}]}}),t._l(t.value.toString().split(""),(function(e,i){return n("div",t._b({key:"h__"+i,staticClass:"vpd-counter-item"},"div",t.attributes,!1),[n("transition",{attrs:{name:"slideY"}},[n("span",{key:e+"__"+i+"_h",style:{transition:"all "+t.transitionSpeed+"ms ease-in-out"},domProps:{textContent:t._s(t.formatter(e))}})])],1)}))],2),n("btn",{staticClass:"vpd-down-arrow-btn",on:{update:function(e){return t.update(-1)},fastUpdate:t.fastUpdateCounter}},[n("arrow",{attrs:{width:"20",direction:"down"}})],1)],1)},N=[],I=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{on:{mousedown:t.down,touchstart:t.down,mouseup:t.click}},[t._t("default")],2)},H=[],A={name:"Btn",data:function(){return{interval:!1,timeout:!1,intervalDelay:150}},computed:{},mounted:function(){var t=this;document.addEventListener("mouseup",(function(){(t.timeout||t.interval)&&t.up()})),document.addEventListener("touchend",(function(){(t.timeout||t.interval)&&t.up()}))},methods:{click:function(){this.interval||this.$emit("update",1)},down:function(){var t=this;window.clearTimeout(this.timeout),window.clearInterval(this.interval),this.interval=!1,this.timeout=window.setTimeout((function(){t.intervalFn()}),600)},up:function(){window.clearTimeout(this.timeout),window.clearInterval(this.interval),this.$emit("fastUpdate",!1),this.timeout=!1,this.interval=!1,this.intervalDelay=150},intervalFn:function(){var t=this;this.interval=window.setTimeout((function(){t.$emit("update",1),t.$emit("fastUpdate",!0),t.intervalFn(),t.intervalDelay>30&&(t.intervalDelay-=3)}),this.intervalDelay)}}},P=A,E=u(P,I,H,!1,null,null,null),z=E.exports;function B(t){return B="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}var U=Object.prototype.toString,R=Object.prototype.hasOwnProperty,X={isFunction:function(t){return"[object Function]"===U.call(t)},isArray:function(t){return"[object Array]"===U.call(t)},isPlainObject:function(t){if(!t||"[object Object]"!==U.call(t)||t.nodeType||t.setInterval)return!1;if(t.constructor&&!R.call(t,"constructor")&&!R.call(t.constructor.prototype,"isPrototypeOf"))return!1;var e;for(e in t);return void 0===e||R.call(t,e)}},W=function t(){var e,n,i,o,a,r,s=arguments[0]||{},l=1,d=arguments.length,c=!1;for("boolean"===typeof s&&(c=s,s=arguments[1]||{},l=2),"object"===B(s)||X.isFunction(s)||(s={}),d===l&&(s=this,--l);l1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2?arguments[2]:void 0,o=t.parentNode,a=o.scrollTop,r=o.offsetHeight/2,s=t.offsetHeight/2,l=t.offsetTop-a-r+s,d=function(){"function"===typeof i&&i()};if(!n)return o.scrollTo(0,a+l),void d();window.requestAnimationFrame((function t(i){e||(e=i);var r=i-e,s=Math.min(r/n,1);o.scrollTo(0,a+l*s),r0;this.update(n?e:-e)},fastUpdateCounter:function(t){t||(this.transitionSpeed=300),this.classFastCounter=t?"fast-updating":""},setDirection:function(t,e){this.directionClass=t>e?"direction-next":"direction-prev"},onInputSubmit:function(){this.selfValue=this.inputValue,this.transitionSpeed=0},onInputChange:function(t){t.target.value.length>=this.selfValue.length&&this.$emit("filled")}}},nt=et,it=u(nt,V,N,!1,null,null,null),ot=it.exports,at={name:"TimeSection",components:{TimeColumn:ot},props:{date:{type:Object,default:function(){return{}}},time:{type:Object,default:function(){return{}}},jumpMinute:{type:Number,default:1},roundMinute:{type:Boolean,default:!1},isDisableTime:{type:Boolean,default:!1},getHighlights:{type:Function,default:null},isMore:{type:Function,default:null},isLower:{type:Function,default:null},minDate:{type:[Object,Boolean],default:!1},maxDate:{type:[Object,Boolean],default:!1},selectedDates:{type:Array,default:function(){return[]}},convertToLocaleNumber:{type:Function,default:null}},computed:{timeAttributes:function(){return this.getHighlights("t",this.time)},hourModel:{get:function(){return this.time.format("HH")},set:function(t){this.setTime(t,"hours")}},minuteModel:{get:function(){return this.time.format("mm")},set:function(t){this.setTime(t,"minutes")}}},watch:{time:{handler:function(){if(this.roundMinute){var t=this.time.clone(),e=this.jumpMinute,n=(e-t.minute()%e)%e;t.add({m:n}),t.valueOf()!==this.time.valueOf()&&(this.$emit("update:time",t),this.selectedDates.forEach((function(e){return e.set({m:t.minute()})})))}},immediate:!0}},methods:{setTime:function(t,e){var n=this.time.clone();if(n.set(e,t),"time"!==this.type){var i=this.date.clone();n.set({year:i.year(),month:i.month(),date:i.date()}),i.set({hour:n.hour(),minute:n.minute()}),this.$emit("update:date",i)}this.isLower(n)&&(n=this.minDate.clone()),this.isMore(n)&&(n=this.maxDate.clone()),this.$emit("update:time",n)},focusNext:function(){this.$refs.minute.$el.querySelector("input").focus()}}},rt=at,st=u(rt,O,F,!1,null,null,null),lt=st.exports,dt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vpd-simple-body"},[t.showHeader?n("div",{staticClass:"vpd-header",style:{"background-color":t.color}},[n("div",[t._t("header-date",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(t.formattedDate))+" ")]}),null,{vm:t.vm,formattedDate:t.formattedDate})],2),t.locales.length>1?t._t("locales",(function(){return[n("locale-change",{staticClass:"vpd-locales",attrs:{"locale-data":t.core.locale,core:t.core,locales:t.locales},on:{change:t.setLocale}})]}),null,{vm:t.vm,locales:t.locales,setLocale:t.setLocale}):t._e()],2):t._e(),n("div",{staticClass:"vpd-simple-content",on:{mouseleave:function(e){return t.$emit("update:hovered-item",null)}}},[t.hasStep("y")?n("simple-mode-column",{attrs:{label:t.lang.year,value:t.selectedYear,locale:t.core.locale.name}},t._l(t.years,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.$emit("select-year",e)}}},"div",e.attributes,!1),[t._t("year-item",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(e.xFormat("jYYYY")))+" ")]}),null,{vm:t.vm,year:e,color:t.color})],2)})),0):t._e(),t.hasStep("m")?n("simple-mode-column",{attrs:{label:t.lang.month,value:t.selectedMonth,locale:t.core.locale.name}},t._l(t.months,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.$emit("select-month",e)}}},"div",e.attributes,!1),[t._t("month-item",(function(){return[t._v(" "+t._s(e.xFormat("jMMMM"))+" ")]}),null,{vm:t.vm,monthItem:e,color:t.color})],2)})),0):t._e(),t.hasStep("d")?n("simple-mode-column",{attrs:{label:t.lang.day,value:t.selectedDay,locale:t.core.locale.name}},t._l(t.days,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected,"vpd-empty":null==e.date,"vpd-range-first":e.isFirst,"vpd-range-last":e.isLast,"vpd-range-between":e.isBetween,"vpd-range-hover":t.hoveredItem&&e.isHover},e.attributes.class],style:[{color:e.selected||e.isBetween?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.$emit("select-day",e)},mouseover:function(n){return t.$emit("update:hovered-item",e.date)}}},"div",e.attributes,!1),[null!=e.date?[t._t("day-item",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(e.formatted))+" ")]}),null,{vm:t.vm,day:e,color:t.color})]:t._e()],2)})),0):t._e()],1)])},ct=[],pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vpd-column",class:{"vpd-is-mounted":t.isMounted},on:{mousewheel:function(t){t.stopPropagation()}}},[t.label?n("div",{staticClass:"vpd-column-header",domProps:{textContent:t._s(t.label)}}):t._e(),n("div",{ref:"content",staticClass:"vpd-column-content"},[t._t("default")],2)])},ut=[],ht={name:"SimpleModeColumn",props:{label:{type:String,default:null},locale:{type:String,default:null},value:{type:[String,Number],default:null}},data:function(){return{isMounted:!1}},watch:{value:function(){this.scrollIntoView(200)},locale:function(){this.scrollIntoView(200)}},mounted:function(){this.scrollIntoView(0)},methods:{scrollIntoView:function(t){var e=this;try{this.isMounted=!1,this.$nextTick((function(){var n=e.$refs.content.querySelector(".vpd-selected")||e.$refs.content.querySelector(".vpd-addon-list-item:not([disabled])");n&&Q(n,t,(function(){e.isMounted=!0}))}))}catch(n){console.warn(n)}}}},mt=ht,ft=u(mt,pt,ut,!1,null,null,null),vt=ft.exports,yt={name:"SimpleMode",components:{LocaleChange:$,SimpleModeColumn:vt},props:{visible:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},range:{type:Boolean,default:!1},lang:{type:Object,default:null},color:{type:String,default:null},hasStep:{type:Function,default:null},years:{type:Array,default:function(){return[]}},months:{type:Array,default:function(){return[]}},monthDays:{type:Array,default:function(){return[]}},selectedDates:{type:Array,default:function(){return[]}},formattedDate:{type:String,default:null},hoveredItem:{type:Date,default:null},locales:{type:Array,default:function(){return[]}},core:{type:Object,default:null},setLocale:{type:Function,default:null},convertToLocaleNumber:{type:Function,default:null}},data:function(){return{vm:this}},computed:{days:function(){var t=[];return this.monthDays.forEach((function(e){e.forEach((function(e){e.date&&t.push(e)}))})),t},selectedYear:function(){var t=this.years.find((function(t){return t.selected}));return t?t.xFormat("YYYY"):""},selectedMonth:function(){var t=this.months.find((function(t){return t.selected}));return t?t.xFormat("MM"):""},selectedDay:function(){var t=this.days.find((function(t){return t.selected}))||{};return t&&t.date?t.date.getDate():""},showHeader:function(){var t=this.selectedDates.length;return this.locales.length>1||t>1||this.range&&t||this.multiple&&t}}},gt=yt,bt=u(gt,dt,ct,!1,null,null,null),xt=bt.exports,wt=n("c32d"),Dt=n.n(wt),_t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},St={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},Mt={months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(t){return/بعد از ظهر/.test(t)},meridiem:function(t){return t<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"ثانیه d%",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(t){return t.replace(/[۰-۹]/g,(function(t){return St[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return _t[t]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}};Dt.a.updateLocale("en",{weekdaysMin:"S_M_T_W_T_F_S".split("_")}),Dt.a.updateLocale("fa",Mt),Dt.a.loadPersian({dialect:"persian-modern"}),Dt.a.daysInMonth=function(t,e){return Dt()({year:t,month:e}).daysInMonth()};var kt={fa:{daysInMonth:"jDaysInMonth",year:"jYear",month:"jMonth",date:"jDate",day:"day"},en:{daysInMonth:"daysInMonth",year:"year",month:"month",date:"date",day:"day"}},Ct={fa:{dow:6,dir:"rtl",displayFormat:null,lang:{label:"شمسی",submit:"تایید",cancel:"انصراف",now:"اکنون",nextMonth:"ماه بعد",prevMonth:"ماه قبل",year:"سال",month:"ماه",day:"روز"}},en:{dow:0,dir:"ltr",displayFormat:null,lang:{label:"میلادی",submit:"Select",cancel:"Cancel",now:"Now",nextMonth:"Next month",prevMonth:"Previous month",year:"Year",month:"Month",day:"Day"}}},Yt=function(t,e){var n,i={moment:Dt.a,momentBase:Dt.a,locale:{name:"fa",config:{}},localesConfig:{},setLocalesConfig:null,changeLocale:null,getWeekArray:null,getYearsList:null,getMonthsList:null};return i.changeLocale=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"fa",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.locale,a=Z.clone(Ct[t]||Ct.en),r=kt[t]||kt.en;function s(t){if(void 0!==t){var e=function(t){return"fa"!==o.name&&(t=t.replace(/j/g,"")),t};t.xYear=Dt.a.fn[r.year],t.xMonth=Dt.a.fn[r.month],t.xDate=Dt.a.fn[r.date],t.xFormat=function(t){return this.format(e(t))},t.xStartOf=function(t){return this.startOf(r[t])},t.xEndOf=function(t){return this.endOf(r[t])},t.xAdd=function(t,e){return this.add(t,r[e])},t.clone=function(){return i.moment(this.toDate())}}}e=e[t]||{},Ct[t]||(e=Z.extend(!0,{},Z.clone(Ct.en),e)),o.name=t,o.config=Z.extend(!0,a,e),n=Dt.a[r.daysInMonth],this.moment=function(){var t=Dt.a.apply(null,arguments);return t.locale(o.name),s(t),t}},i.setLocalesConfig=function(t){var e=Z.clone(Ct);for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=Z.extend(!0,{},Z.clone(e.en),{lang:{label:n}},t[n]));this.localesConfig=Z.extend(!0,e,t)},i.getWeekArray=function(t){var e=this;function i(t,e){for(var n=7-e.length,i=0;i0&&t.getDay()===e.locale.config.dow&&(i(l,d),d=[]),d.push(t),r.indexOf(t)===r.length-1&&i(l,d)})),l},i.getYearsList=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=[];if(n){var a=getYear(i);t=a-n,e=a+n}for(var r=t;r<=e;r++)o.push(r);return o},i.getMonthsList=function(t,e,n){for(var i=[],o=t?t.clone().xStartOf("month"):-1/0,a=e?e.clone().xEndOf("month"):1/0,r=0;r<12;r++){var s=n.clone().xMonth(r),l=s.clone().xStartOf("month"),d=s.clone().xEndOf("month");s.disabled=la,i.push(s)}return i},i.changeLocale(t,e),i},Tt=Yt;function jt(t){return jt="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(t)}function Lt(t,e){return Nt(t)||Vt(t,e)||Ot(t,e)||$t()}function $t(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Ot(t,e){if(t){if("string"===typeof t)return Ft(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ft(t,e):void 0}}function Ft(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);nn||t.checkDisable("d",a),t.range&&!o.disabled){var r=Lt(t.selectedDates,2),s=r[0],l=r[1];o.isFirst=o.selected&&s&&G(s,i),o.isLast=o.selected&&l&&G(l,i),o.isBetween=!o.selected&&s&&l&&i>s&&in&&o=this.date.clone().xStartOf("month")},nextMonthDisabled:function(){return this.hasStep("d")&&this.maxDate&&this.maxDate.clone().xStartOf("month")<=this.date.clone().xStartOf("month")},canGoToday:function(){if(!this.minDate&&!this.maxDate)return!0;var t=this.now,e=this.minDate&&this.minDate<=t,n=this.maxDate&&t<=this.maxDate;return"time"===this.type&&(this.minDate&&(e=t.clone().hour(this.minDate.hour()).minute(this.minDate.minute()),e=e<=t),this.maxDate&&(n=this.now.clone().hour(this.maxDate.hour()).minute(this.maxDate.minute()),n=t<=n)),this.minDate&&this.maxDate?e&&n:this.minDate?e:!!this.maxDate&&n},altFormatted:function(){var t=this.altFormat;if(""===t||void 0===t)switch(this.type){case"time":t="HH:mm:ss [GMT]ZZ";break;case"datetime":t="YYYY-MM-DD HH:mm:ss [GMT]ZZ";break;case"date":t="YYYY-MM-DD";break;case"year":t="YYYY";break;case"month":t="MM";break;case"year-month":t="YYYY-MM";break}return this.output.map((function(e){return e.format(t)})).join(" ~ ")},selfFormat:function(){var t=this.format;if(-1!==["",void 0,"date"].indexOf(t))switch(this.type){case"time":t="HH:mm";break;case"datetime":t="jYYYY/jMM/jDD HH:mm";break;case"date":t="jYYYY/jMM/jDD";break;case"year":t="jYYYY";break;case"month":t="jMM";break;case"year-month":t="jYYYY/jMM";break}return t},selfInputFormat:function(){return""===this.inputFormat||void 0===this.inputFormat?this.selfFormat:this.inputFormat},outputValue:function(){var t=this,e=q(this.output),n=this.selfFormat,i=this.value instanceof Date||"date"===this.format;return e.map((function(e){return/j\w/.test(n)&&e.locale("fa"),t.setTimezone(e,"out"),i?e.toDate():e.format(n)}))},selfDisplayFormat:function(){var t=this.displayFormat||this.selfFormat,e=this.localeData.config.displayFormat;return e?"function"===typeof e?e(this):e:("fa"!==this.localeData.name&&(t=t.replace(/j/g,"")),t)},displayValue:function(){var t=this,e=this.selfDisplayFormat;return this.output.map((function(n){var i=n.clone();return/j\w/.test(e)&&i.locale("fa"),t.convertToLocaleNumber(i.format(e))})).join(" ~ ")},isDisableTime:function(){return this.hasStep("t")&&this.checkDisable("t",this.time)},canSubmit:function(){if(!this.disable)return!0;var t=!0;return this.hasStep("t")&&(t=!this.isDisableTime),t&&"time"!==this.type&&(t=!this.checkDisable("d",this.date)),t},weekDays:function(){var t=JSON.parse(JSON.stringify(this.core.moment().localeData().weekdaysMin())),e=this.core.locale.config.dow;while(e>0)t.push(t.shift()),e--;return t},lang:function(){return this.localeData.config.lang},isPopover:function(){return(""===this.popover||this.popover)&&this.windowWidth>480},isDataArray:function(){return this.range||this.multiple},isCompactTime:function(){return this.compactTime||"datetime"===this.type&&this.simple}},watch:{type:{handler:"setType",immediate:!0},view:{handler:"setView",immediate:!0},value:{handler:"updateDates",immediate:!0},min:{handler:"setMinMax",immediate:!0},max:{handler:"setMinMax",immediate:!0},timezone:{handler:"updateDates"},inline:{handler:function(t){this.disabled||(this.visible=!!t)},immediate:!0},disabled:{handler:function(t){t?this.visible=!1:this.inline&&(this.visible=!0)},immediate:!0},selectedDate:function(t,e){this.setDirection("directionClass",t,e)},date:function(t,e){this.setDirection("directionClassDate",t,e),this.isLower(this.date)&&(this.date=this.minDate.clone()),this.isMore(this.date)&&(this.date=this.maxDate.clone())},visible:function(t){var e=this;if(t){if(this.disabled)return this.visible=!1;"datetime"===this.type&&"day"===this.view&&this.goStep("d"),"day"!==this.view&&this.goStep(this.shortCodes[this.view]||"d"),this.$nextTick((function(){if(e.appendTo)try{var t=document.querySelector(e.appendTo);t.appendChild(e.$refs.picker)}catch(n){console.warn('Cannot append picker to "'.concat(e.appendTo,'"!'))}})),this.checkScroll(),this.setPlacement(),this.$emit("open",this)}else{if(this.inline&&!this.disabled)return this.visible=!0;this.$emit("close",this)}},show:function(t){this.visible=t},locale:{immediate:!0,handler:function(t){var e=t.toString().split(",");this.locales=e.length?e:["fa"],this.core.locale.name!==this.locales[0]&&this.setLocale(this.locales[0])}},localeConfig:{deep:!0,immediate:!0,handler:function(t){this.core.setLocalesConfig(t),this.setLocale(this.localeData.name)}},"localeData.name":function(){this.$emit("localeChange",this.localeData),this.setMinMax()}},created:function(){var t=this;this.updateNowInterval=setInterval((function(){t.now=t.core.moment()}),1e3)},mounted:function(){var t=this;this.$nextTick((function(){var e=function(t,e,n){t.attachEvent?t.attachEvent("on"+e,n):t.addEventListener(e,n)},n=function(t,n,i,o){e(o||document,n,(function(e){var n,o=e.target||e.srcElement;while(o&&!(n=o.id===t))o=o.parentElement;n&&i.call(o,e)}))};t.element&&!t.editable&&n(t.element,"click",t.focus)})),document.body.addEventListener("keydown",(function(e){e=e||event;var n=e.keyCode;9!==n&&27!==n||!t.visible||(t.visible=!1)})),window.addEventListener("resize",this.onWindowResize,!0),window.addEventListener("mousedown",this.onWindowClick,!0)},beforeDestroy:function(){window.clearInterval(this.updateNowInterval),window.removeEventListener("resize",this.onWindowResize,!0),window.removeEventListener("mousedown",this.onWindowClick,!0);var t=this.$refs.picker;this.appendTo&&t&&t.$el&&t.$el.parentNode&&t.$el.parentNode.removeChild(t.$el)},methods:{nextStep:function(t){var e=this,n=function(){var t=e.range?2:e.multiple?0:1,n=e.selectedDates.length>=t;(e.autoSubmit||e.inline)&&n&&e.submit(!e.multiple)};if(this.simple)("date"===this.type&&"day"===t||"year-month"===this.type&&"month"===t||"year"===this.type||"month"===this.type)&&n();else{var i=this.step+1;this.isCompactTime&&"datetime"===this.type&&(i+=1),this.steps.length<=i?n():(this.step++,this.goStep(this.step))}},goStep:function(t){this.step="number"===typeof t?t:this.steps.indexOf(t),this.checkScroll()},checkScroll:function(){var t=this,e=this.currentStep;("y"===e||"m"===e&&this.visible)&&setTimeout((function(){var n=t.$refs[{y:"year",m:"month"}[e]];if(n){var i=n.querySelector(".vpd-selected");if(i&&"scrollIntoView"in i)try{i.scrollIntoView({block:"center"})}catch(o){i.scrollIntoView()}}}),100)},nextMonth:function(){this.date=this.date.clone().xAdd(1,"month"),this.$emit("next-month",this.date.clone())},prevMonth:function(){this.date=this.date.clone().xAdd(-1,"month"),this.$emit("prev-month",this.date.clone())},selectDay:function(t){if(t.date&&!t.disabled){var e=this.core.moment(t.date);if(e.set({hour:this.time.hour(),minute:this.time.minute(),second:0}),this.date=e.clone(),this.time=e.clone(),this.range){var n=this.selectedDates.length;!n||n>1?this.selectedDates=[e.clone()]:(this.selectedDates.push(e.clone()),this.selectedDates.sort((function(t,e){return t-e})))}else if(this.multiple){var i=this.selectedDates.findIndex((function(t){return t.valueOf()===e.valueOf()}));i>-1?this.selectedDates.splice(i,1):this.selectedDates.push(e.clone())}else this.selectedDates=[e.clone()];this.nextStep("day")}},selectYear:function(t){t.disabled||(this.date=this.date.clone().xYear(t.xYear()),-1!==["year","year-month"].indexOf(this.type)&&(this.selectedDates=[this.date.clone()]),this.$emit("year-change",t),this.nextStep("year"))},selectMonth:function(t){t.disabled||(this.date=this.date.clone().xMonth(t.xMonth()),-1!==["month","year-month"].indexOf(this.type)&&(this.selectedDates=[this.date.clone()]),this.$emit("month-change",t),this.nextStep("month"))},submit:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.steps.length-1,i=this.selectedDates;if(this.isCompactTime&&"datetime"===this.type&&(n-=1),this.step1&&(i[0].xStartOf("day"),i[1].xEndOf("day")),this.output=q(i),e&&(this.visible=!1),this.isDataArray?(this.$emit("input",this.outputValue),this.$emit("change",q(i))):(this.$emit("input",this.outputValue[0]),this.$emit("change",i[0].clone()))},updateDates:function(t){var e=this;if(this.isDataArray&&!t&&(t=[]),!this.date.clone||t.toString()!==this.outputValue.toString()){var n=t instanceof Array,i=function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=e.value instanceof Array?e.value[i]:e.value;try{var a="object"===jt(t);t instanceof Date?n=e.getMoment(t):t&&a&&"clone"in t?n=t.clone():null!==t&&a||(n=e.getMoment(t||o||e.initialValue)),n=n.isValid()?n:e.core.moment()}catch(r){n=e.core.moment()}return e.setTimezone(n,"in"),n};n?(this.date=i(t[0]),this.selectedDates=t.map(i)):this.date=i(t),this.hasStep("t")||this.date.set({hour:0,minute:0,second:0}),this.isLower(this.date)?this.date=this.minDate.clone():this.isMore(this.date)&&(this.date=this.maxDate.clone()),n||(this.selectedDates=[this.date.clone()]),this.time=this.date.clone(),""!==this.value&&null!==this.value&&this.value.length?this.output=q(this.selectedDates):(this.output=[],this.$forceUpdate())}},goToday:function(){var t=this.core.moment();this.hasStep("t")||t.set({hour:0,minute:0,second:0}),this.date=t.clone(),this.time=t.clone(),this.selectedDates=[t.clone()]},setType:function(){switch(this.type){case"date":this.steps=["y","m","d"],this.goStep("d");break;case"datetime":this.steps=["y","m","d","t"],this.goStep("d");break;case"year":this.steps=["y"],this.goStep("y");break;case"month":this.steps=["m"],this.goStep("m");break;case"time":this.steps=["t"],this.goStep("t");break;case"year-month":this.steps=["y","m"],this.goStep("y");break}},setView:function(){var t=this.shortCodes[this.view];this.hasStep(t)&&this.goStep(t)},setDirection:function(t,e,n){this[t]=e>n?"direction-next":"direction-prev"},setMinMax:function(){var t=this.getMoment(this.min),e=this.getMoment(this.max);this.minDate=!(!this.min||!t.isValid())&&t,this.maxDate=!(!this.max||!e.isValid())&&e},getMoment:function(t){var e,n=this.core.moment;if(t instanceof Date)return n(t);if("x"===this.selfInputFormat||"unix"===this.selfInputFormat)e=n(10===t.toString().length?1e3*t:1*t);else try{if(t){var i=n(t,this.selfInputFormat),o=n(t,this.selfFormat),a=n(),r=a.xYear();"month"===this.type?(i.xYear(r),o.xYear(r)):"time"===this.type&&(i=a.clone().set({h:i.hour(),m:i.minute(),s:0}),o=i.clone()),e=i.year()!==o.year()&&i.year()<1900?o.clone():i.clone()}else e=n()}catch(s){e=n()}return e},focus:function(t){if(!this.editable)return t?(t.preventDefault(),t.stopPropagation(),t.target.blur(),this.visible=!this.visible):this.visible=!0,!1;this.$refs.input&&this.$refs.input.focus()},hasStep:function(t){return-1!==this.steps.indexOf(t)},setOutput:function(t){var e=this;if(this.editable){var n=t.target.value.split("~"),i=n.map((function(t){if(t="".concat(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),""===t)return null;try{var n=e.core.moment(t,e.selfDisplayFormat);return n.isValid()?n:null}catch(i){return null}}));this.output=i.filter((function(t){return t})),this.output.sort((function(t,e){return t-e})),this.output.length?(this.updateDates(q(this.output)),this.submit()):(this.$forceUpdate(),this.$emit("input",this.isDataArray?[]:null),this.$emit("change",this.isDataArray?[]:null))}},wrapperClick:function(){this.visible=!1,this.wrapperSubmit&&this.canSubmit&&this.submit()},applyDevFn:function(t,e){var n=!1,i=Array.prototype.splice.call(arguments,2);try{i.push({y:"year",m:"month",d:"day",t:"time"}[e]),n=t.apply(null,i)}catch(o){console.error(o)}return n},checkDisable:function(t,e){var n=this,i=this.disable;if(!i)return!1;var o=jt(i),a=function(e,n,i){if(e instanceof RegExp)return e.test(n);if(e===n)return!0;if("d"===t){var o=e.length;return n.substr(0,o)===e||i.clone().locale("en").format("dddd")===e}return!1},r=function(e,r){var s=!1;if("function"===o)return n.applyDevFn(i,t,r,e.clone());if("[object Array]"===Object.prototype.toString.call(i)){for(var l=i.length,d=0;dthis.maxDate},clearValue:function(){this.disabled||(this.output=[],this.$emit("input",this.isDataArray?[]:""),this.$emit("change",this.isDataArray?[]:null))},setLocale:function(t){this.core.changeLocale(t,this.localeConfig),this.date=this.date.clone(),this.selectedDates=this.selectedDates.map((function(t){return t.clone()})),this.$forceUpdate()},setTimezone:function(t,e){var n=this.timezone;if(n){var i="in"===e?1:-1,o=this.core.momentBase;if("string"===typeof n){var a=o().utc().format("YYYY-MM-DDTHH:mm:ss")+n;t.add(o.parseZone(a).utcOffset()*i,"minutes")}else"boolean"===typeof n&&n?t.subtract(new Date(t).getTimezoneOffset()*i,"minutes"):"function"===typeof n&&(t=n(t,e,this))}return t.clone()},convertToLocaleNumber:function(t){return this.convertNumbers&&"fa"===this.locale?"".concat(t).replace(/\d+/g,(function(t){for(var e="",n=0,i=t.length;nspan{display:inline-block;padding:0 10px;line-height:22px;height:22px;border-width:1px;border-style:solid;border-radius:2px;transition:all .1s ease-out}.vpd-year-label>span:not(:hover){border-color:transparent!important;color:inherit!important}.vpd-date{position:relative;font-size:28px;line-height:40px;height:40px;overflow:hidden}.vpd-date span{display:block;height:inherit;line-height:inherit}.vpd-week{font-size:12px;padding:0 14px;line-height:20px;color:#b9b9b9;margin-bottom:10px;height:20px}.vpd-weekday{float:right;width:40px;text-align:center}.vpd-days{padding:0 18px;position:relative;overflow:hidden;transition:height .3s cubic-bezier(.75,.02,.27,.99)}.vpd-day{width:40px;height:40px;float:right;line-height:40px;position:relative}.vpd-day:not(.vpd-empty){cursor:pointer;transition:color .45s ease;text-align:center}.vpd-day[disabled]{cursor:default;color:#ccc}.vpd-day[disabled] .vpd-day-effect{background-color:transparent}.vpd-day[disabled] .vpd-day-text{color:#ccc}.vpd-day:not([disabled]):hover{color:#fff}.vpd-day:not([disabled]):hover .vpd-day-effect{transform:scale(1);opacity:.6}.vpd-day:not([disabled]).vpd-selected{color:#fff}.vpd-day:not([disabled]).vpd-selected .vpd-day-effect{transform:scale(1);opacity:1}.vpd-day:not([disabled]).vpd-range-between{color:#fff}.vpd-day:not([disabled]).vpd-range-between .vpd-day-effect{transform:scale(.75);opacity:1}.vpd-day:not([disabled]).vpd-range-hover{color:#fff}.vpd-day:not([disabled]).vpd-range-hover .vpd-day-effect{transform:scale(.7);opacity:.6}.vpd-day-effect{position:absolute;width:36px;height:36px;border-radius:50%;top:2px;left:2px;transform:scale(0);opacity:0;transition:all .45s ease}.vpd-controls,.vpd-day-text{position:relative}.vpd-controls{z-index:2;height:50px;line-height:50px;text-align:center}.vpd-controls button{position:relative;background-color:transparent;border:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;outline:none;cursor:pointer}.vpd-controls button[disabled]{opacity:.3;cursor:default}.vpd-next,.vpd-prev{width:50px;height:50px;line-height:50px}.vpd-next{float:right}.vpd-prev{float:left}.vpd-arrow{width:11px;height:11px}.vpd-month{position:relative;overflow:hidden}.vpd-month-label{position:absolute;top:0;left:50px;right:50px;overflow:hidden;width:95px;margin-left:auto;margin-right:auto;line-height:50px;height:50px;text-align:center;cursor:pointer}.vpd-month-label>span{display:inline-block;padding:0 5px;line-height:26px;height:26px;border-width:1px;border-style:solid;border-radius:2px;transition:all .1s ease-out;white-space:nowrap}.vpd-month-label>span:not(:hover){border-color:transparent!important;color:inherit!important}.vpd-actions{text-align:right;padding:8px}.vpd-actions button{border:none;background-color:transparent;display:inline-block;cursor:pointer;outline:none;font-size:14px;text-transform:uppercase;min-width:88px;text-align:center;-webkit-appearance:none;line-height:36px;height:36px;transition:all .3s ease}.vpd-actions button:hover{background-color:#f2f2f2}.vpd-actions button[disabled]{opacity:.6;cursor:default}.vpd-addon-list-content{direction:rtl}.vpd-addon-list-item{width:33.33333%;text-align:center;font-size:14px;height:44px;line-height:36px;transition:all .3s ease;color:#8a8a8a;cursor:pointer;float:right;border:4px solid #fff}.vpd-addon-list-item.vpd-selected,.vpd-addon-list-item:hover{background-color:#f9f9f9}.vpd-addon-list-item.vpd-selected{font-weight:700;background-color:#f5f5f5}.vpd-addon-list{width:100%;background-color:#fff;position:absolute;z-index:2;overflow:auto;top:0;bottom:52px;border-bottom:1px solid #eee;direction:ltr}.vpd-addon-list.vpd-can-close{padding-top:30px}.vpd-month-list{padding-top:15px}.vpd-month-list .vpd-addon-list-item{height:54px;line-height:46px}.vpd-addon-list-item[disabled]{opacity:.3;cursor:default!important;background-color:transparent!important}.vpd-close-addon{position:absolute;top:4px;left:4px;z-index:2;width:30px;height:30px;line-height:30px;color:#444;font-family:sans-serif;text-align:center;cursor:pointer;background-color:rgba(0,0,0,.1)}.vpd-time{-ms-user-select:none;user-select:none;-moz-user-select:none;-webkit-user-select:none}.vpd-time .vpd-time-h,.vpd-time .vpd-time-m{position:relative;margin-top:70px;float:left;width:50%;height:100%;text-align:center;color:#a2a2a2}.vpd-time .vpd-time-h .vpd-counter,.vpd-time .vpd-time-m .vpd-counter{font-size:90px;height:100px;line-height:100px;overflow:hidden;position:relative;direction:ltr;transition:opacity .3s ease-in-out}.vpd-time .vpd-time-h .vpd-counter-item,.vpd-time .vpd-time-m .vpd-counter-item{height:inherit;width:51px;display:inline-block;vertical-align:text-top;position:relative}.vpd-time .vpd-time-h:after{position:absolute;top:50%;right:0;content:":";font-size:70px;transform:translate(50%,-50%);transition:inherit}.vpd-time .vpd-down-arrow-btn,.vpd-time .vpd-up-arrow-btn{display:block;cursor:pointer;outline:none;height:34px}.vpd-time.vpd-disabled .vpd-counter-item{opacity:.5}.vpd-time-column .vpd-counter{position:relative}.vpd-time-column .vpd-counter input{position:absolute;z-index:5;border:none;background-color:transparent;top:0;left:0;width:100%;height:100%;text-align:center;outline:none;font-size:inherit;color:inherit;line-height:inherit;opacity:0;padding:5% 0 0 0}.vpd-time-column .vpd-counter input:focus{opacity:1}.vpd-time-column .vpd-counter input:focus:not(.is-empty)~div{opacity:0}.vpd-prev-step{position:absolute;top:0;left:0;width:30px;height:30px;text-align:center;padding:9px;cursor:pointer}.vpd-prev-step:hover{background-color:rgba(0,0,0,.2)}[data-type=time] .vpd-time .vpd-time-h,[data-type=time] .vpd-time .vpd-time-m{margin-top:40px}.vpd-is-inline{position:static;background-color:transparent;height:auto;width:auto;display:block;margin-top:2px}.vpd-is-inline .vpd-container{position:static;transform:none}.vpd-is-inline .vpd-content{box-shadow:0 0 1px -1px #000}.vpd-is-popover{display:inline-block;position:relative}.vpd-is-popover .vpd-wrapper{position:static;width:auto;height:0}.vpd-is-popover .vpd-wrapper .vpd-container{transform:none;top:auto;left:auto;z-index:500}.vpd-is-popover .vpd-wrapper .vpd-content{transition:none;box-shadow:0 3px 8px rgba(0,0,0,.4)}.vpd-is-popover[data-placement=top-left] .vpd-container{bottom:100%;left:0}.vpd-is-popover[data-placement=top-left] .vpd-content{box-shadow:0 -3px 8px rgba(0,0,0,.4)}.vpd-is-popover[data-placement=top-right] .vpd-container{bottom:100%;right:0}.vpd-is-popover[data-placement=top-right] .vpd-content{box-shadow:0 -3px 8px rgba(0,0,0,.4)}.vpd-is-popover[data-placement=bottom-left] .vpd-container{top:100%;left:0}.vpd-is-popover[data-placement=bottom-right] .vpd-container{top:100%;right:0}.vpd-is-popover[data-placement=left-top] .vpd-container{bottom:0;right:100%}.vpd-is-popover[data-placement=left-bottom] .vpd-container{top:0;right:100%}.vpd-is-popover[data-placement=right-top] .vpd-container{bottom:0;left:100%}.vpd-is-popover[data-placement=right-bottom] .vpd-container{top:0;left:100%}.vpd-no-footer .vpd-addon-list{bottom:0;border-bottom:none}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time{margin-top:10px;display:block!important;position:relative;border-top:1px solid #eee;overflow:hidden}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-addon-list-content{display:flex;justify-content:center;direction:ltr}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-counter-item{width:18px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-counter{height:30px;font-size:20px;line-height:34px;width:40px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-down-arrow-btn,.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-up-arrow-btn{position:absolute;top:0;height:26px;width:26px;margin:2px;border-radius:50%;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,.05)}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-m{margin-top:0;float:none;width:100px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-m .vpd-up-arrow-btn{right:30px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-m .vpd-down-arrow-btn{right:0}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h{margin-top:0;float:none;width:100px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h:after{font-size:20px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h .vpd-counter{margin-left:auto}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h .vpd-up-arrow-btn{left:0}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time .vpd-time-h .vpd-down-arrow-btn{left:30px}.vpd-wrapper[data-type=datetime].vpd-compact-time .vpd-time svg{height:10px}.vpd-wrapper[data-type=datetime] .vpd-date{font-size:22px}.vpd-wrapper.vpd-is-range .vpd-date{font-size:16px}.vpd-wrapper.vpd-is-multiple .vpd-date{font-size:14px;white-space:normal;line-height:20px}@media screen and (max-height:460px){.vpd-wrapper{overflow:auto;text-align:center}.vpd-wrapper .vpd-container{position:relative;top:0;left:0;transform:none;display:inline-block;margin:20px auto}}.vpd-locales{list-style-type:none;padding:0;margin:0;position:absolute;left:14px;top:12px;line-height:24px;text-align:center;opacity:.7}.vpd-locales li{cursor:pointer}.vpd-simple-body .vpd-header{display:flex;padding:10px;justify-content:space-between}.vpd-simple-body .vpd-locales{position:static;padding:0 5px;line-height:unset}.vpd-simple-content{display:flex;justify-content:center;height:240px;direction:ltr}.vpd-simple-content .vpd-column{height:100%;flex-grow:1;display:flex;flex-flow:column;padding:5px}.vpd-simple-content .vpd-column .vpd-column-header{text-align:center;font-weight:700;color:#000;height:30px;line-height:30px}.vpd-simple-content .vpd-column .vpd-column-content{flex-grow:1;height:100%;overflow:auto;padding-right:4px;position:relative}.vpd-simple-content .vpd-column .vpd-column-content:after,.vpd-simple-content .vpd-column .vpd-column-content:before{display:block;height:80px;content:""}@media screen and (min-width:640px){.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar{width:8px}.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar-track{background:rgba(0,0,0,.05);border-radius:5px}.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2);border-radius:5px}.vpd-simple-content .vpd-column .vpd-column-content::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.5)}}.vpd-simple-content .vpd-addon-list-item{width:100%;float:none!important;line-height:42px;height:44px;border:1px solid #fff}.vpd-simple-content .vpd-range-first{border-radius:40px 40px 0 0}.vpd-simple-content .vpd-range-between{font-weight:700;background-color:#f5f5f5}.vpd-simple-content .vpd-range-last{border-radius:0 0 40px 40px}.vpd-simple-content .vpd-range-last.vpd-range-first{border-radius:40px}.vpd-simple-content .vpd-column.vpd-is-mounted .vpd-selected:not(.vpd-range-first):not(.vpd-range-last):not([disabled]){position:sticky;top:0;bottom:0}.vpd-is-multiple .vpd-simple-content .vpd-column .vpd-selected{position:static!important}.vpd-dir-ltr .vpd-actions,.vpd-dir-ltr .vpd-addon-list-content,.vpd-dir-ltr .vpd-content{direction:ltr}.vpd-dir-ltr .vpd-actions,.vpd-dir-ltr .vpd-content{text-align:left;font-family:sans-serif}.vpd-dir-ltr .vpd-month-label{font-size:90%}.vpd-dir-ltr .vpd-addon-list-item,.vpd-dir-ltr .vpd-day,.vpd-dir-ltr .vpd-weekday{float:left}.vpd-dir-ltr .vpd-locales{left:auto;right:14px}.vpd-dir-rtl .vpd-next,.vpd-dir-rtl .vpd-prev{transform:rotateY(180deg)}.vpd-dir-rtl .vpd-next{float:left}.vpd-dir-rtl .vpd-prev{float:right}',""]),t.exports=e},"499e":function(t,e,n){"use strict";function i(t,e){for(var n=[],i={},o=0;on.parts.length&&(i.parts.length=n.parts.length)}else{var r=[];for(o=0;o([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),o=n.replace(i,"$1").trim());for(var u=0;u1?t._t("locales",(function(){return[n("locale-change",{staticClass:"vpd-locales",attrs:{"locale-data":t.localeData,core:t.core,locales:t.locales},on:{change:t.setLocale}})]}),null,{vm:t.vm,locales:t.locales,setLocale:t.setLocale}):t._e()],2),n("div",{staticClass:"vpd-body"},[t.simple?n("simple-mode",{attrs:{lang:t.lang,core:t.core,range:t.range,color:t.color,locales:t.locales,visible:t.visible,multiple:t.multiple,years:t.years,months:t.months,"month-days":t.monthDays,"has-step":t.hasStep,"selected-dates":t.selectedDates,"formatted-date":t.formattedDate,"hovered-item":t.hoveredItem,"set-locale":t.setLocale,"convert-to-locale-number":t.convertToLocaleNumber},on:{"update:hoveredItem":function(e){t.hoveredItem=e},"update:hovered-item":function(e){t.hoveredItem=e},"select-year":t.selectYear,"select-month":t.selectMonth,"select-day":t.selectDay},scopedSlots:t._u([{key:"header-date",fn:function(e){return[t._t("header-date",null,null,e)]}},{key:"locales",fn:function(e){return[t._t("locales",null,null,e)]}},{key:"year-item",fn:function(e){return[t._t("year-item",null,null,e)]}},{key:"month-item",fn:function(e){return[t._t("month-item",null,null,e)]}},{key:"day-item",fn:function(e){return[t._t("day-item",null,null,e)]}}],null,!0)}):[t.hasStep("d")?[n("div",{class:["vpd-controls",t.directionClassDate]},[n("button",{staticClass:"vpd-next",attrs:{type:"button",title:t.lang.nextMonth,disabled:t.nextMonthDisabled},on:{click:t.nextMonth}},[t._t("next-month",(function(){return[n("arrow",{staticStyle:{"vertical-align":"middle"},attrs:{width:"10",fill:"#000",direction:"right"}})]}))],2),n("button",{staticClass:"vpd-prev",attrs:{type:"button",title:t.lang.prevMonth,disabled:t.prevMonthDisabled},on:{click:t.prevMonth}},[t._t("prev-month",(function(){return[n("arrow",{staticStyle:{"vertical-align":"middle"},attrs:{width:"10",fill:"#000",direction:"left"}})]}))],2),n("transition",{attrs:{name:"slideX"}},[n("div",{key:t.date.xMonth(),staticClass:"vpd-month-label",on:{click:function(e){return t.goStep("m")}}},[t._t("month-name",(function(){return[n("span",{style:{"border-color":t.color,color:t.color},domProps:{textContent:t._s(t.convertToLocaleNumber(t.date.xFormat("jMMMM jYYYY")))}})]}),null,{vm:t.vm,date:t.date,color:t.color})],2)])],1),n("div",{staticClass:"vpd-clearfix",class:["vpd-month",t.directionClassDate]},[n("div",{staticClass:"vpd-clearfix vpd-week"},t._l(t.weekDays,(function(e,i){return n("div",{key:i+"-"+e,staticClass:"vpd-weekday"},[t._t("weekday",(function(){return[t._v(" "+t._s(e)+" ")]}),null,{vm:t.vm,day:e})],2)})),0),n("div",{staticClass:"vpd-days",style:{height:40*t.month.length+"px"},on:{mouseleave:function(e){t.hoveredItem=null}}},[n("transition",{class:t.directionClassDate,attrs:{name:"slideX"}},[n("div",{key:t.date.xMonth()},t._l(t.monthDays,(function(e,i){return n("div",{key:i,staticClass:"vpd-clearfix"},t._l(e,(function(e,i){return n("div",t._b({key:i,class:["vpd-day",{"vpd-selected":e.selected,"vpd-empty":null==e.date,"vpd-range-first":e.isFirst,"vpd-range-last":e.isLast,"vpd-range-between":e.isBetween,"vpd-range-hover":t.hoveredItem&&e.isHover},e.attributes.class],attrs:{disabled:e.disabled},on:{click:function(n){return t.selectDay(e)},mouseover:function(n){t.hoveredItem=e.date}}},"div",e.attributes,!1),[null!=e.date?[t._t("day-item",(function(){return[n("span",{staticClass:"vpd-day-effect",style:{"background-color":t.color}}),n("span",{staticClass:"vpd-day-text",domProps:{textContent:t._s(t.convertToLocaleNumber(e.formatted))}})]}),null,{vm:t.vm,day:e,color:t.color})]:t._e()],2)})),0)})),0)])],1)])]:n("div",{staticStyle:{height:"250px"}}),n("transition",{attrs:{name:"fade"}},[t.hasStep("y")?n("div",{directives:[{name:"show",rawName:"v-show",value:"y"===t.currentStep,expression:"currentStep === 'y'"}],ref:"year",class:["vpd-addon-list",{"vpd-can-close":t.steps.length>1}]},[n("div",{staticClass:"vpd-addon-list-content"},t._l(t.years,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.selectYear(e)}}},"div",e.attributes,!1),[t._t("year-item",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(e.xFormat("jYYYY")))+" ")]}),null,{vm:t.vm,year:e,color:t.color})],2)})),0)]):t._e()]),n("transition",{attrs:{name:"fade"}},[t.hasStep("m")?n("div",{directives:[{name:"show",rawName:"v-show",value:"m"===t.currentStep,expression:"currentStep === 'm'"}],ref:"month",class:["vpd-addon-list vpd-month-list",{"vpd-can-close":t.steps.length>1}]},[n("div",{staticClass:"vpd-addon-list-content"},t._l(t.months,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.selectMonth(e)}}},"div",e.attributes,!1),[t._t("month-item",(function(){return[t._v(" "+t._s(e.xFormat("jMMMM"))+" ")]}),null,{vm:t.vm,monthItem:e,color:t.color})],2)})),0)]):t._e()]),n("transition",{attrs:{name:"fade"}},[t.steps.length>1&&"d"!==t.currentStep&&t.hasStep("d")?n("span",{staticClass:"vpd-close-addon",on:{click:function(e){return t.goStep("d")}}},[t._t("close-btn",(function(){return[t._v("x")]}),null,{vm:t.vm})],2):t._e()])],n("transition",{attrs:{name:"fade"}},[t.hasStep("t")?n("time-section",{directives:[{name:"show",rawName:"v-show",value:"t"===t.currentStep,expression:"currentStep === 't'"}],ref:"time",attrs:{date:t.date,time:t.time,"is-more":t.isMore,"is-lower":t.isLower,"min-date":t.minDate,"max-date":t.maxDate,"jump-minute":t.jumpMinute,"round-minute":t.roundMinute,"get-highlights":t.getHighlights,"selected-dates":t.selectedDates,"convert-to-locale-number":t.convertToLocaleNumber},on:{"update:date":function(e){t.date=e},"update:time":function(e){t.time=e}}}):t._e()],1),t.autoSubmit&&!t.hasStep("t")?[t.simple?t._e():n("br")]:n("div",{staticClass:"vpd-actions"},[t._t("submit-btn",(function(){return[n("button",{style:{color:t.color},attrs:{type:"button",disabled:!t.canSubmit},domProps:{textContent:t._s(t.lang.submit)},on:{click:t.submit}})]}),null,{vm:t.vm,canSubmit:t.canSubmit,color:t.color,submit:t.submit,lang:t.lang}),t.inline?t._e():t._t("cancel-btn",(function(){return[n("button",{style:{color:t.color},attrs:{type:"button"},domProps:{textContent:t._s(t.lang.cancel)},on:{click:function(e){t.visible=!1}}})]}),null,{vm:t.vm,color:t.color,lang:t.lang}),t.showNowBtn&&t.canGoToday?t._t("now-btn",(function(){return[n("button",{style:{color:t.color},attrs:{type:"button"},domProps:{textContent:t._s(t.lang.now)},on:{click:t.goToday}})]}),null,{vm:t.vm,color:t.color,goToday:t.goToday,lang:t.lang}):t._e()],2)],2)])])]):t._e()])],1)},s=[],l=(n("78a7"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{style:{transform:"rotate("+t.rotation+"deg)"},attrs:{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 129 129",width:"30",height:"30",perspectiveAspectRato:"none"}},[n("path",{attrs:{fill:t.fill,d:"M88.6 121.3c.8.8 1.8 1.2 2.9 1.2s2.1-.4 2.9-1.2a4.1 4.1 0 0 0 0-5.8l-51-51 51-51a4.1 4.1 0 0 0-5.8-5.8l-54\n 53.9a4.1 4.1 0 0 0 0 5.8l54 53.9z"}})])}),d=[],c={props:{fill:{type:String,default:"#a2a2a2"},direction:{type:String,default:"up"}},computed:{rotation:function(){return{up:90,left:0,right:180,down:-90}[this.direction]}}},p=c;function u(t,e,n,i,o,a,r,s){var l,d="function"===typeof t?t.options:t;if(e&&(d.render=e,d.staticRenderFns=n,d._compiled=!0),i&&(d.functional=!0),a&&(d._scopeId="data-v-"+a),r?(l=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__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},d._ssrRegister=l):o&&(l=s?function(){o.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:o),l)if(d.functional){d._injectStyles=l;var c=d.render;d.render=function(t,e){return l.call(e),c(t,e)}}else{var p=d.beforeCreate;d.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:d}}var h=u(p,l,d,!1,null,null,null),m=h.exports,f=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{attrs:{version:"1.1",role:"presentation",width:"16",height:"16",fill:t.fill,viewBox:"0 0 512 512"}},[n("path",{attrs:{d:"M256 8C119 8 8 119 8 256S119 504 256 504 504 393 504 256 393 8 256 8zM313.1 358.1L224.9 294C221.8 291.7 220\n 288.1 220 284.3V116C220 109.4 225.4 104 232 104H280C286.6 104 292 109.4 292 116V253.7L355.5 299.9C360.9 303.8\n 362 311.3 358.1 316.7L329.9 355.5C326 360.8 318.5 362 313.1 358.1z"}})])},v=[],y={props:{fill:{type:String,default:"#f9f9f9"}}},g=y,b=u(g,f,v,!1,null,null,null),x=b.exports,w=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("svg",{attrs:{version:"1.1",width:"14",height:"16",viewBox:"0 0 448 512",xmlns:"http://www.w3.org/2000/svg",fill:t.fill}},[n("path",{attrs:{d:"M436 160H12C5.4 160 0 154.6 0 148V112C0 85.5 21.5 64 48 64H96V12C96 5.4 101.4 0 108 0H148C154.6 0 160 5.4 160\n 12V64H288V12C288 5.4 293.4 0 300 0H340C346.6 0 352 5.4 352 12V64H400C426.5 64 448 85.5 448 112V148C448 154.6\n 442.6 160 436 160zM12 192H436C442.6 192 448 197.4 448 204V464C448 490.5 426.5 512 400 512H48C21.5 512 0 490.5 0\n 464V204C0 197.4 5.4 192 12 192zM128 396C128 389.4 122.6 384 116 384H76C69.4 384 64 389.4 64 396V436C64 442.6 69.4\n 448 76 448H116C122.6 448 128 442.6 128 436V396zM128 268C128 261.4 122.6 256 116 256H76C69.4 256 64 261.4 64\n 268V308C64 314.6 69.4 320 76 320H116C122.6 320 128 314.6 128 308V268zM256 396C256 389.4 250.6 384 244\n 384H204C197.4 384 192 389.4 192 396V436C192 442.6 197.4 448 204 448H244C250.6 448 256 442.6 256 436V396zM256\n 268C256 261.4 250.6 256 244 256H204C197.4 256 192 261.4 192 268V308C192 314.6 197.4 320 204 320H244C250.6 320 256\n 314.6 256 308V268zM384 396C384 389.4 378.6 384 372 384H332C325.4 384 320 389.4 320 396V436C320 442.6 325.4 448\n 332 448H372C378.6 448 384 442.6 384 436V396zM384 268C384 261.4 378.6 256 372 256H332C325.4 256 320 261.4 320\n 268V308C320 314.6 325.4 320 332 320H372C378.6 320 384 314.6 384 308V268z"}})])},D=[],S={props:{fill:{type:String,default:"#f9f9f9"}}},_=S,M=u(_,w,D,!1,null,null,null),k=M.exports,C=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ul",[n("li",{domProps:{textContent:t._s(t.label)},on:{click:function(e){return t.$emit("change",t.activeItem)}}})])},Y=[],T={name:"LocaleChange",props:{locales:{type:Array,default:function(){return[]}},core:{type:Object,default:function(){return{}}},localeData:{type:Object,default:function(){return{}}}},computed:{activeItem:function(){var t=this.locales.indexOf(this.localeData.name)+1;return t===this.locales.length&&(t=0),String(this.locales[t])},label:function(){return this.core.localesConfig[this.activeItem].lang.label||this.activeItem.toUpperCase()}}},j=T,L=u(j,C,Y,!1,null,null,null),O=L.exports,$=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{class:["vpd-addon-list vpd-time",{"vpd-disabled":t.isDisableTime}]},[n("div",{staticClass:"vpd-addon-list-content"},[n("time-column",{ref:"hour",staticClass:"vpd-time-h",attrs:{attributes:t.timeAttributes,formatter:t.convertToLocaleNumber},on:{filled:t.focusNext},model:{value:t.hourModel,callback:function(e){t.hourModel=e},expression:"hourModel"}}),n("time-column",{ref:"minute",staticClass:"vpd-time-m",attrs:{jump:t.jumpMinute,attributes:t.timeAttributes,formatter:t.convertToLocaleNumber},model:{value:t.minuteModel,callback:function(e){t.minuteModel=e},expression:"minuteModel"}})],1)])},F=[],V=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vpd-time-column",class:t.classFastCounter},[n("btn",{staticClass:"vpd-up-arrow-btn",on:{update:function(e){return t.update(1)},fastUpdate:t.fastUpdateCounter}},[n("arrow",{attrs:{width:"20",direction:"up"}})],1),n("div",{staticClass:"vpd-counter",class:[t.directionClass,{"vpd-is-focused":t.isInputFocused}],on:{mousewheel:function(e){return e.stopPropagation(),e.preventDefault(),t.wheelUpdate(e)},DOMMouseScroll:function(e){return e.stopPropagation(),e.preventDefault(),t.wheelUpdate(e)}}},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],ref:"input",class:{"is-empty":!t.inputValue.length},attrs:{type:"tel",maxlength:t.selfValue.length},domProps:{value:t.inputValue},on:{input:[function(e){e.target.composing||(t.inputValue=e.target.value)},t.onInputChange],focus:function(e){t.isInputFocused=!0},blur:function(e){t.isInputFocused=!1},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),t.update(1))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),t.update(-1))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:(e.preventDefault(),t.onInputSubmit.apply(null,arguments))}]}}),t._l(t.value.toString().split(""),(function(e,i){return n("div",t._b({key:"h__"+i,staticClass:"vpd-counter-item"},"div",t.attributes,!1),[n("transition",{attrs:{name:"slideY"}},[n("span",{key:e+"__"+i+"_h",style:{transition:"all "+t.transitionSpeed+"ms ease-in-out"},domProps:{textContent:t._s(t.formatter(e))}})])],1)}))],2),n("btn",{staticClass:"vpd-down-arrow-btn",on:{update:function(e){return t.update(-1)},fastUpdate:t.fastUpdateCounter}},[n("arrow",{attrs:{width:"20",direction:"down"}})],1)],1)},I=[],N=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{on:{mousedown:t.down,touchstart:t.down,mouseup:t.click}},[t._t("default")],2)},H=[],A={name:"Btn",data:function(){return{interval:!1,timeout:!1,intervalDelay:150}},computed:{},mounted:function(){var t=this;document.addEventListener("mouseup",(function(){(t.timeout||t.interval)&&t.up()})),document.addEventListener("touchend",(function(){(t.timeout||t.interval)&&t.up()}))},methods:{click:function(){this.interval||this.$emit("update",1)},down:function(){var t=this;window.clearTimeout(this.timeout),window.clearInterval(this.interval),this.interval=!1,this.timeout=window.setTimeout((function(){t.intervalFn()}),600)},up:function(){window.clearTimeout(this.timeout),window.clearInterval(this.interval),this.$emit("fastUpdate",!1),this.timeout=!1,this.interval=!1,this.intervalDelay=150},intervalFn:function(){var t=this;this.interval=window.setTimeout((function(){t.$emit("update",1),t.$emit("fastUpdate",!0),t.intervalFn(),t.intervalDelay>30&&(t.intervalDelay-=3)}),this.intervalDelay)}}},E=A,P=u(E,N,H,!1,null,null,null),z=P.exports;function B(t){return B="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},B(t)}var U=Object.prototype.toString,R=Object.prototype.hasOwnProperty,X={isFunction:function(t){return"[object Function]"===U.call(t)},isArray:function(t){return"[object Array]"===U.call(t)},isPlainObject:function(t){if(!t||"[object Object]"!==U.call(t)||t.nodeType||t.setInterval)return!1;if(t.constructor&&!R.call(t,"constructor")&&!R.call(t.constructor.prototype,"isPrototypeOf"))return!1;var e;for(e in t);return void 0===e||R.call(t,e)}},W=function t(){var e,n,i,o,a,r,s=arguments[0]||{},l=1,d=arguments.length,c=!1;for("boolean"===typeof s&&(c=s,s=arguments[1]||{},l=2),"object"===B(s)||X.isFunction(s)||(s={}),d===l&&(s=this,--l);l1&&void 0!==arguments[1]?arguments[1]:200,i=arguments.length>2?arguments[2]:void 0,o=t.parentNode,a=o.scrollTop,r=o.offsetHeight/2,s=t.offsetHeight/2,l=t.offsetTop-a-r+s,d=function(){"function"===typeof i&&i()};if(!n)return o.scrollTo(0,a+l),void d();window.requestAnimationFrame((function t(i){e||(e=i);var r=i-e,s=Math.min(r/n,1);o.scrollTo(0,a+l*s),r0;this.update(n?e:-e)},fastUpdateCounter:function(t){t||(this.transitionSpeed=300),this.classFastCounter=t?"fast-updating":""},setDirection:function(t,e){this.directionClass=t>e?"direction-next":"direction-prev"},onInputSubmit:function(){this.selfValue=this.inputValue,this.transitionSpeed=0},onInputChange:function(t){t.target.value.length>=this.selfValue.length&&this.$emit("filled")}}},ot=it,at=u(ot,V,I,!1,null,null,null),rt=at.exports,st={name:"TimeSection",components:{TimeColumn:rt},props:{date:{type:Object,default:function(){return{}}},time:{type:Object,default:function(){return{}}},jumpMinute:{type:Number,default:1},roundMinute:{type:Boolean,default:!1},isDisableTime:{type:Boolean,default:!1},getHighlights:{type:Function,default:null},isMore:{type:Function,default:null},isLower:{type:Function,default:null},minDate:{type:[Object,Boolean],default:!1},maxDate:{type:[Object,Boolean],default:!1},selectedDates:{type:Array,default:function(){return[]}},convertToLocaleNumber:{type:Function,default:null}},computed:{timeAttributes:function(){return this.getHighlights("t",this.time)},hourModel:{get:function(){return this.time.format("HH")},set:function(t){this.setTime(t,"hours")}},minuteModel:{get:function(){return this.time.format("mm")},set:function(t){this.setTime(t,"minutes")}}},watch:{time:{handler:function(){if(this.roundMinute){var t=this.time.clone(),e=this.jumpMinute,n=(e-t.minute()%e)%e;t.add({m:n}),t.valueOf()!==this.time.valueOf()&&(this.$emit("update:time",t),this.selectedDates.forEach((function(e){return e.set({m:t.minute()})})))}},immediate:!0}},methods:{setTime:function(t,e){var n=this.time.clone();if(n.set(e,t),"time"!==this.type){var i=this.date.clone();n.set({year:i.year(),month:i.month(),date:i.date()}),i.set({hour:n.hour(),minute:n.minute()}),this.$emit("update:date",i)}this.isLower(n)&&(n=this.minDate.clone()),this.isMore(n)&&(n=this.maxDate.clone()),this.$emit("update:time",n)},focusNext:function(){this.$refs.minute.$el.querySelector("input").focus()}}},lt=st,dt=u(lt,$,F,!1,null,null,null),ct=dt.exports,pt=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vpd-simple-body"},[t.showHeader?n("div",{staticClass:"vpd-header",style:{"background-color":t.color}},[n("div",[t._t("header-date",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(t.formattedDate))+" ")]}),null,{vm:t.vm,formattedDate:t.formattedDate})],2),t.locales.length>1?t._t("locales",(function(){return[n("locale-change",{staticClass:"vpd-locales",attrs:{"locale-data":t.core.locale,core:t.core,locales:t.locales},on:{change:t.setLocale}})]}),null,{vm:t.vm,locales:t.locales,setLocale:t.setLocale}):t._e()],2):t._e(),n("div",{staticClass:"vpd-simple-content",on:{mouseleave:function(e){return t.$emit("update:hovered-item",null)}}},[t.hasStep("y")?n("simple-mode-column",{attrs:{label:t.lang.year,value:t.selectedYear,locale:t.core.locale.name}},t._l(t.years,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.$emit("select-year",e)}}},"div",e.attributes,!1),[t._t("year-item",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(e.xFormat("jYYYY")))+" ")]}),null,{vm:t.vm,year:e,color:t.color})],2)})),0):t._e(),t.hasStep("m")?n("simple-mode-column",{attrs:{label:t.lang.month,value:t.selectedMonth,locale:t.core.locale.name}},t._l(t.months,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected},e.attributes.class],style:[{color:e.selected?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.$emit("select-month",e)}}},"div",e.attributes,!1),[t._t("month-item",(function(){return[t._v(" "+t._s(e.xFormat("jMMMM"))+" ")]}),null,{vm:t.vm,monthItem:e,color:t.color})],2)})),0):t._e(),t.hasStep("d")?n("simple-mode-column",{attrs:{label:t.lang.day,value:t.selectedDay,locale:t.core.locale.name}},t._l(t.days,(function(e,i){return n("div",t._b({key:i,class:["vpd-addon-list-item",{"vpd-selected":e.selected,"vpd-empty":null==e.date,"vpd-range-first":e.isFirst,"vpd-range-last":e.isLast,"vpd-range-between":e.isBetween,"vpd-range-hover":t.hoveredItem&&e.isHover},e.attributes.class],style:[{color:e.selected||e.isBetween?t.color:""},e.attributes.style],attrs:{disabled:e.disabled},on:{click:function(n){return t.$emit("select-day",e)},mouseover:function(n){return t.$emit("update:hovered-item",e.date)}}},"div",e.attributes,!1),[null!=e.date?[t._t("day-item",(function(){return[t._v(" "+t._s(t.convertToLocaleNumber(e.formatted))+" ")]}),null,{vm:t.vm,day:e,color:t.color})]:t._e()],2)})),0):t._e()],1)])},ut=[],ht=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vpd-column",class:{"vpd-is-mounted":t.isMounted},on:{mousewheel:function(t){t.stopPropagation()}}},[t.label?n("div",{staticClass:"vpd-column-header",domProps:{textContent:t._s(t.label)}}):t._e(),n("div",{ref:"content",staticClass:"vpd-column-content"},[t._t("default")],2)])},mt=[],ft={name:"SimpleModeColumn",props:{label:{type:String,default:null},locale:{type:String,default:null},value:{type:[String,Number],default:null}},data:function(){return{isMounted:!1}},watch:{value:function(){this.scrollIntoView(200)},locale:function(){this.scrollIntoView(200)}},mounted:function(){this.scrollIntoView(0)},methods:{scrollIntoView:function(t){var e=this;try{this.isMounted=!1,this.$nextTick((function(){var n=e.$refs.content.querySelector(".vpd-selected")||e.$refs.content.querySelector(".vpd-addon-list-item:not([disabled])");n&&Q(n,t,(function(){e.isMounted=!0}))}))}catch(n){console.warn(n)}}}},vt=ft,yt=u(vt,ht,mt,!1,null,null,null),gt=yt.exports,bt={name:"SimpleMode",components:{LocaleChange:O,SimpleModeColumn:gt},props:{visible:{type:Boolean,default:!1},multiple:{type:Boolean,default:!1},range:{type:Boolean,default:!1},lang:{type:Object,default:null},color:{type:String,default:null},hasStep:{type:Function,default:null},years:{type:Array,default:function(){return[]}},months:{type:Array,default:function(){return[]}},monthDays:{type:Array,default:function(){return[]}},selectedDates:{type:Array,default:function(){return[]}},formattedDate:{type:String,default:null},hoveredItem:{type:Date,default:null},locales:{type:Array,default:function(){return[]}},core:{type:Object,default:null},setLocale:{type:Function,default:null},convertToLocaleNumber:{type:Function,default:null}},data:function(){return{vm:this}},computed:{days:function(){var t=[];return this.monthDays.forEach((function(e){e.forEach((function(e){e.date&&t.push(e)}))})),t},selectedYear:function(){var t=this.years.find((function(t){return t.selected}));return t?t.xFormat("YYYY"):""},selectedMonth:function(){var t=this.months.find((function(t){return t.selected}));return t?t.xFormat("MM"):""},selectedDay:function(){var t=this.days.find((function(t){return t.selected}))||{};return t&&t.date?t.date.getDate():""},showHeader:function(){var t=this.selectedDates.length;return this.locales.length>1||t>1||this.range&&t||this.multiple&&t}}},xt=bt,wt=u(xt,pt,ut,!1,null,null,null),Dt=wt.exports,St=n("c32d"),_t=n.n(St),Mt={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},kt={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"},Ct={months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(t){return/بعد از ظهر/.test(t)},meridiem:function(t){return t<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"ثانیه d%",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(t){return t.replace(/[۰-۹]/g,(function(t){return kt[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return Mt[t]})).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}};_t.a.updateLocale("en",{weekdaysMin:"S_M_T_W_T_F_S".split("_")}),_t.a.updateLocale("fa",Ct),_t.a.loadPersian({dialect:"persian-modern"}),_t.a.daysInMonth=function(t,e){return _t()({year:t,month:e}).daysInMonth()};var Yt={fa:{daysInMonth:"jDaysInMonth",year:"jYear",month:"jMonth",date:"jDate",day:"day"},en:{daysInMonth:"daysInMonth",year:"year",month:"month",date:"date",day:"day"}},Tt={fa:{dow:6,dir:"rtl",displayFormat:null,lang:{label:"شمسی",submit:"تایید",cancel:"انصراف",now:"اکنون",nextMonth:"ماه بعد",prevMonth:"ماه قبل",year:"سال",month:"ماه",day:"روز"}},en:{dow:0,dir:"ltr",displayFormat:null,lang:{label:"میلادی",submit:"Select",cancel:"Cancel",now:"Now",nextMonth:"Next month",prevMonth:"Previous month",year:"Year",month:"Month",day:"Day"}}},jt=function(t,e){var n,i={moment:_t.a,momentBase:_t.a,locale:{name:"fa",config:{}},localesConfig:{},setLocalesConfig:null,changeLocale:null,getWeekArray:null,getYearsList:null,getMonthsList:null};return i.changeLocale=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"fa",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=this.locale,a=tt.clone(Tt[t]||Tt.en),r=Yt[t]||Yt.en;function s(t){if(void 0!==t){var e=function(t){return"fa"!==o.name&&(t=t.replace(/j/g,"")),t};t.xYear=_t.a.fn[r.year],t.xMonth=_t.a.fn[r.month],t.xDate=_t.a.fn[r.date],t.xFormat=function(t){return this.format(e(t))},t.xStartOf=function(t){return this.startOf(r[t])},t.xEndOf=function(t){return this.endOf(r[t])},t.xAdd=function(t,e){return this.add(t,r[e])},t.clone=function(){return i.moment(this.toDate())}}}e=e[t]||{},Tt[t]||(e=tt.extend(!0,{},tt.clone(Tt.en),e)),o.name=t,o.config=tt.extend(!0,a,e),n=_t.a[r.daysInMonth],this.moment=function(){var t=_t.a.apply(null,arguments);return t.locale(o.name),s(t),t}},i.setLocalesConfig=function(t){var e=tt.clone(Tt);for(var n in t)t.hasOwnProperty(n)&&void 0===e[n]&&(e[n]=tt.extend(!0,{},tt.clone(e.en),{lang:{label:n}},t[n]));this.localesConfig=tt.extend(!0,e,t)},i.getWeekArray=function(t){var e=this;function i(t,e){for(var n=7-e.length,i=0;i0&&t.getDay()===e.locale.config.dow&&(i(l,d),d=[]),d.push(t),r.indexOf(t)===r.length-1&&i(l,d)})),l},i.getYearsList=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0,o=[];if(n){var a=getYear(i);t=a-n,e=a+n}for(var r=t;r<=e;r++)o.push(r);return o},i.getMonthsList=function(t,e,n){for(var i=[],o=t?t.clone().xStartOf("month"):-1/0,a=e?e.clone().xEndOf("month"):1/0,r=0;r<12;r++){var s=n.clone().xMonth(r),l=s.clone().xStartOf("month"),d=s.clone().xEndOf("month");s.disabled=la,i.push(s)}return i},i.changeLocale(t,e),i},Lt=jt;function Ot(t){return Ot="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ot(t)}function $t(t,e){return Ht(t)||Nt(t,e)||Vt(t,e)||Ft()}function Ft(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Vt(t,e){if(t){if("string"===typeof t)return It(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?It(t,e):void 0}}function It(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);nn||t.checkDisable("d",a),t.range&&!o.disabled){var r=$t(t.selectedDates,2),s=r[0],l=r[1];o.isFirst=o.selected&&s&&G(s,i),o.isLast=o.selected&&l&&G(l,i),o.isBetween=!o.selected&&s&&l&&i>s&&in&&o=this.date.clone().xStartOf("month")},nextMonthDisabled:function(){return this.hasStep("d")&&this.maxDate&&this.maxDate.clone().xStartOf("month")<=this.date.clone().xStartOf("month")},canGoToday:function(){if(!this.minDate&&!this.maxDate)return!0;var t=this.now,e=this.minDate&&this.minDate<=t,n=this.maxDate&&t<=this.maxDate;return"time"===this.type&&(this.minDate&&(e=t.clone().hour(this.minDate.hour()).minute(this.minDate.minute()),e=e<=t),this.maxDate&&(n=this.now.clone().hour(this.maxDate.hour()).minute(this.maxDate.minute()),n=t<=n)),this.minDate&&this.maxDate?e&&n:this.minDate?e:!!this.maxDate&&n},altFormatted:function(){var t=this.altFormat;if(""===t||void 0===t)switch(this.type){case"time":t="HH:mm:ss [GMT]ZZ";break;case"datetime":t="YYYY-MM-DD HH:mm:ss [GMT]ZZ";break;case"date":t="YYYY-MM-DD";break;case"year":t="YYYY";break;case"month":t="MM";break;case"year-month":t="YYYY-MM";break}return this.output.map((function(e){return e.format(t)})).join(" ~ ")},selfFormat:function(){var t=this.format;if(-1!==["",void 0,"date"].indexOf(t))switch(this.type){case"time":t="HH:mm";break;case"datetime":t="jYYYY/jMM/jDD HH:mm";break;case"date":t="jYYYY/jMM/jDD";break;case"year":t="jYYYY";break;case"month":t="jMM";break;case"year-month":t="jYYYY/jMM";break}return t},selfInputFormat:function(){return""===this.inputFormat||void 0===this.inputFormat?this.selfFormat:this.inputFormat},outputValue:function(){var t=this,e=q(this.output),n=this.selfFormat,i=this.value instanceof Date||"date"===this.format;return e.map((function(e){return/j\w/.test(n)&&e.locale("fa"),t.setTimezone(e,"out"),i?e.toDate():e.format(n)}))},selfDisplayFormat:function(){var t=this.displayFormat||this.selfFormat,e=this.localeData.config.displayFormat;return e?"function"===typeof e?e(this):e:("fa"!==this.localeData.name&&(t=t.replace(/j/g,"")),t)},displayValue:function(){var t=this,e=this.selfDisplayFormat;return this.output.map((function(n){var i=n.clone();return/j\w/.test(e)&&i.locale("fa"),t.convertToLocaleNumber(i.format(e))})).join(" ~ ")},isDisableTime:function(){return this.hasStep("t")&&this.checkDisable("t",this.time)},canSubmit:function(){if(!this.disable)return!0;var t=!0;return this.hasStep("t")&&(t=!this.isDisableTime),t&&"time"!==this.type&&(t=!this.checkDisable("d",this.date)),t},weekDays:function(){var t=JSON.parse(JSON.stringify(this.core.moment().localeData().weekdaysMin())),e=this.core.locale.config.dow;while(e>0)t.push(t.shift()),e--;return t},lang:function(){return this.localeData.config.lang},isPopover:function(){return(""===this.popover||this.popover)&&this.windowWidth>480},isDataArray:function(){return this.range||this.multiple},isCompactTime:function(){return this.compactTime||"datetime"===this.type&&this.simple},customInputElement:function(){return this.element?"#".concat(this.element):this.customInput}},watch:{type:{handler:"setType",immediate:!0},view:{handler:"setView",immediate:!0},value:{handler:"updateDates",immediate:!0},min:{handler:"setMinMax",immediate:!0},max:{handler:"setMinMax",immediate:!0},timezone:{handler:"updateDates"},inline:{handler:function(t){this.disabled||(this.visible=!!t)},immediate:!0},disabled:{handler:function(t){t?this.visible=!1:this.inline&&(this.visible=!0)},immediate:!0},selectedDate:function(t,e){this.setDirection("directionClass",t,e)},date:function(t,e){this.setDirection("directionClassDate",t,e),this.isLower(this.date)&&(this.date=this.minDate.clone()),this.isMore(this.date)&&(this.date=this.maxDate.clone())},visible:function(t){var e=this;if(t){if(this.disabled)return this.visible=!1;"datetime"===this.type&&"day"===this.view&&this.goStep("d"),"day"!==this.view&&this.goStep(this.shortCodes[this.view]||"d"),this.$nextTick((function(){if(e.appendTo)try{var t=document.querySelector(e.appendTo);t.appendChild(e.$refs.picker)}catch(n){console.warn('Cannot append picker to "'.concat(e.appendTo,'"!'))}})),this.checkScroll(),this.setPlacement(),this.$emit("open",this)}else{if(this.inline&&!this.disabled)return this.visible=!0;this.$emit("close",this)}},show:function(t){this.visible=t},locale:{immediate:!0,handler:function(t){var e=t.toString().split(",");this.locales=e.length?e:["fa"],this.core.locale.name!==this.locales[0]&&this.setLocale(this.locales[0])}},localeConfig:{deep:!0,immediate:!0,handler:function(t){this.core.setLocalesConfig(t),this.setLocale(this.localeData.name)}},"localeData.name":function(){this.$emit("localeChange",this.localeData),this.setMinMax()},displayValue:{immediate:!0,handler:function(t){if(this.customInput){var e=document.querySelector(this.customInput);e&&(e.value=t)}}}},created:function(){var t=this;this.updateNowInterval=setInterval((function(){t.now=t.core.moment()}),1e3)},mounted:function(){var t=this;this.$nextTick((function(){t.customInputElement&&!t.editable&&K(t.customInputElement,"click",t.focus),t.customInput&&t.editable&&K(t.customInput,"blur",t.setOutput)})),document.body.addEventListener("keydown",(function(e){e=e||event;var n=e.keyCode;9!==n&&27!==n||!t.visible||(t.visible=!1)})),window.addEventListener("resize",this.onWindowResize,!0),window.addEventListener("mousedown",this.onWindowClick,!0)},beforeDestroy:function(){window.clearInterval(this.updateNowInterval),window.removeEventListener("resize",this.onWindowResize,!0),window.removeEventListener("mousedown",this.onWindowClick,!0);var t=this.$refs.picker;this.appendTo&&t&&t.$el&&t.$el.parentNode&&t.$el.parentNode.removeChild(t.$el)},methods:{nextStep:function(t){var e=this,n=function(){var t=e.range?2:e.multiple?0:1,n=e.selectedDates.length>=t;(e.autoSubmit||e.inline)&&n&&e.submit(!e.multiple)};if(this.simple)("date"===this.type&&"day"===t||"year-month"===this.type&&"month"===t||"year"===this.type||"month"===this.type)&&n();else{var i=this.step+1;this.isCompactTime&&"datetime"===this.type&&(i+=1),this.steps.length<=i?n():(this.step++,this.goStep(this.step))}},goStep:function(t){this.step="number"===typeof t?t:this.steps.indexOf(t),this.checkScroll()},checkScroll:function(){var t=this,e=this.currentStep;("y"===e||"m"===e&&this.visible)&&setTimeout((function(){var n=t.$refs[{y:"year",m:"month"}[e]];if(n){var i=n.querySelector(".vpd-selected");if(i&&"scrollIntoView"in i)try{i.scrollIntoView({block:"center"})}catch(o){i.scrollIntoView()}}}),100)},nextMonth:function(){this.date=this.date.clone().xAdd(1,"month"),this.$emit("next-month",this.date.clone())},prevMonth:function(){this.date=this.date.clone().xAdd(-1,"month"),this.$emit("prev-month",this.date.clone())},selectDay:function(t){if(t.date&&!t.disabled){var e=this.core.moment(t.date);if(e.set({hour:this.time.hour(),minute:this.time.minute(),second:0}),this.date=e.clone(),this.time=e.clone(),this.range){var n=this.selectedDates.length;!n||n>1?this.selectedDates=[e.clone()]:(this.selectedDates.push(e.clone()),this.selectedDates.sort((function(t,e){return t-e})))}else if(this.multiple){var i=this.selectedDates.findIndex((function(t){return t.valueOf()===e.valueOf()}));i>-1?this.selectedDates.splice(i,1):this.selectedDates.push(e.clone())}else this.selectedDates=[e.clone()];this.nextStep("day")}},selectYear:function(t){t.disabled||(this.date=this.date.clone().xYear(t.xYear()),-1!==["year","year-month"].indexOf(this.type)&&(this.selectedDates=[this.date.clone()]),this.$emit("year-change",t),this.nextStep("year"))},selectMonth:function(t){t.disabled||(this.date=this.date.clone().xMonth(t.xMonth()),-1!==["month","year-month"].indexOf(this.type)&&(this.selectedDates=[this.date.clone()]),this.$emit("month-change",t),this.nextStep("month"))},submit:function(){var t=this,e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=this.steps.length-1,i=this.selectedDates;if(this.isCompactTime&&"datetime"===this.type&&(n-=1),this.step1&&(i[0].xStartOf("day"),i[1].xEndOf("day")),this.output=q(i),e&&(this.visible=!1),this.isDataArray?(this.$emit("input",this.outputValue),this.$emit("change",q(i))):(this.$emit("input",this.outputValue[0]),this.$emit("change",i[0].clone()))},updateDates:function(t){var e=this;if(t||(t=this.isDataArray?[]:""),!this.date.clone||t.toString()!==this.outputValue.toString()){var n=t instanceof Array,i=function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=e.value instanceof Array?e.value[i]:e.value;try{var a="object"===Ot(t);t instanceof Date?n=e.getMoment(t):t&&a&&"clone"in t?n=t.clone():null!==t&&a||(n=e.getMoment(t||o||e.initialValue)),n=n.isValid()?n:e.core.moment()}catch(r){n=e.core.moment()}return e.setTimezone(n,"in"),n};n?(this.date=i(t[0]),this.selectedDates=t.map(i)):this.date=i(t),this.hasStep("t")||this.date.set({hour:0,minute:0,second:0}),this.isLower(this.date)?this.date=this.minDate.clone():this.isMore(this.date)&&(this.date=this.maxDate.clone()),n||(this.selectedDates=[this.date.clone()]),this.time=this.date.clone(),""!==this.value&&null!==this.value&&this.value.length?this.output=q(this.selectedDates):(this.output=[],this.$forceUpdate())}},goToday:function(){var t=this.core.moment();this.hasStep("t")||t.set({hour:0,minute:0,second:0}),this.date=t.clone(),this.time=t.clone(),this.selectedDates=[t.clone()]},setType:function(){switch(this.type){case"date":this.steps=["y","m","d"],this.goStep("d");break;case"datetime":this.steps=["y","m","d","t"],this.goStep("d");break;case"year":this.steps=["y"],this.goStep("y");break;case"month":this.steps=["m"],this.goStep("m");break;case"time":this.steps=["t"],this.goStep("t");break;case"year-month":this.steps=["y","m"],this.goStep("y");break}},setView:function(){var t=this.shortCodes[this.view];this.hasStep(t)&&this.goStep(t)},setDirection:function(t,e,n){this[t]=e>n?"direction-next":"direction-prev"},setMinMax:function(){var t=this.getMoment(this.min),e=this.getMoment(this.max);this.minDate=!(!this.min||!t.isValid())&&t,this.maxDate=!(!this.max||!e.isValid())&&e},getMoment:function(t){var e,n=this.core.moment;if(t instanceof Date)return n(t);if("x"===this.selfInputFormat||"unix"===this.selfInputFormat)e=n(10===t.toString().length?1e3*t:1*t);else try{if(t){var i=n(t,this.selfInputFormat),o=n(t,this.selfFormat),a=n(),r=a.xYear();"month"===this.type?(i.xYear(r),o.xYear(r)):"time"===this.type&&(i=a.clone().set({h:i.hour(),m:i.minute(),s:0}),o=i.clone()),e=i.year()!==o.year()&&i.year()<1900?o.clone():i.clone()}else e=n()}catch(s){e=n()}return e},focus:function(t){if(!this.editable)return t?(t.preventDefault(),t.stopPropagation(),t.target.blur(),this.visible=!this.visible):this.visible=!0,!1;this.$refs.input&&this.$refs.input.focus()},hasStep:function(t){return-1!==this.steps.indexOf(t)},setOutput:function(t){var e=this;if(this.editable){var n=t.target.value.split("~"),i=n.map((function(t){if(t="".concat(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),""===t)return null;try{var n=e.core.moment(t,e.selfDisplayFormat);return n.isValid()?n:null}catch(i){return null}}));this.output=i.filter((function(t){return t})),this.output.sort((function(t,e){return t-e})),this.output.length?(this.updateDates(q(this.output)),this.submit()):(this.$forceUpdate(),this.$emit("input",this.isDataArray?[]:null),this.$emit("change",this.isDataArray?[]:null))}},wrapperClick:function(){this.visible=!1,this.wrapperSubmit&&this.canSubmit&&this.submit()},applyDevFn:function(t,e){var n=!1,i=Array.prototype.splice.call(arguments,2);try{i.push({y:"year",m:"month",d:"day",t:"time"}[e]),n=t.apply(null,i)}catch(o){console.error(o)}return n},checkDisable:function(t,e){var n=this,i=this.disable;if(!i)return!1;var o=Ot(i),a=function(e,n,i){if(e instanceof RegExp)return e.test(n);if(e===n)return!0;if("d"===t){var o=e.length;return n.substr(0,o)===e||i.clone().locale("en").format("dddd")===e}return!1},r=function(e,r){var s=!1;if("function"===o)return n.applyDevFn(i,t,r,e.clone());if("[object Array]"===Object.prototype.toString.call(i)){for(var l=i.length,d=0;dthis.maxDate},clearValue:function(){this.disabled||(this.output=[],this.$emit("input",this.isDataArray?[]:""),this.$emit("change",this.isDataArray?[]:null))},setLocale:function(t){this.core.changeLocale(t,this.localeConfig),this.date=this.date.clone(),this.selectedDates=this.selectedDates.map((function(t){return t.clone()})),this.$forceUpdate()},setTimezone:function(t,e){var n=this.timezone;if(n){var i="in"===e?1:-1,o=this.core.momentBase;if("string"===typeof n){var a=o().utc().format("YYYY-MM-DDTHH:mm:ss")+n;t.add(o.parseZone(a).utcOffset()*i,"minutes")}else"boolean"===typeof n&&n?t.subtract(new Date(t).getTimezoneOffset()*i,"minutes"):"function"===typeof n&&(t=n(t,e,this))}return t.clone()},convertToLocaleNumber:function(t){return this.convertNumbers&&"fa"===this.locale?"".concat(t).replace(/\d+/g,(function(t){for(var e="",n=0,i=t.length;n= 2.10.0` + + ## name The form input name (when you are not using `element`) diff --git a/docs/guide/custom-input.md b/docs/guide/custom-input.md index c3e3af3..c65e945 100644 --- a/docs/guide/custom-input.md +++ b/docs/guide/custom-input.md @@ -1,18 +1,19 @@ # Custom input +- #### Using `custom-input` prop ```vue +date = {{ date }} ``` ```js @@ -30,6 +31,7 @@ export default { data() { return { date: '', + date1: '', date2: '', show: false } @@ -38,33 +40,30 @@ export default { +date = {{ date }} + -::: danger -Custom input does not support `display-format`. - -You have to create a specific component for this purpose or use a computed property. -See the following example: -::: +- #### Method B: Using `element` prop (deprecated) +:::details show example ```vue ``` ```js -import moment from 'moment-jalaali' export default { data() { return { date: '' } - }, - computed: { - dateFormatted() { - return moment(this.date, 'YYYY-MM-DD').format('jYYYY/jMM/jDD') - } } } ``` + + + + + + +::: + + +::: danger +`element` does not support `display-format`. + +please use `custom-input`. +::: + + ### Custom editable input ```vue - ``` @@ -139,17 +153,19 @@ Show Datepicker type="text" class="form-control is-editable" placeholder="YYYY/MM/DD" - v-model="date2" id="my-custom-editable-input" /> +date = {{ date2 }} + diff --git a/package-lock.json b/package-lock.json index 521b048..b6d2d87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vue-persian-datetime-picker", - "version": "2.9.1", + "version": "2.10.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 9d13edf..a494c55 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-persian-datetime-picker", "description": "A vue plugin to select jalali date and time", - "version": "2.9.1", + "version": "2.10.0", "private": false, "author": "Mohammad Talkhabi", "license": "MIT", diff --git a/src/VuePersianDatetimePicker.vue b/src/VuePersianDatetimePicker.vue index 10e7330..048cca8 100644 --- a/src/VuePersianDatetimePicker.vue +++ b/src/VuePersianDatetimePicker.vue @@ -8,7 +8,7 @@ :class="{ 'vpd-is-popover': isPopover }" > @@ -457,6 +457,7 @@ import SimpleMode from './components/simple/SimpleMode' import CoreModule from './modules/core' import { popupRouteChanger } from './modules/mixins' import { cloneDates, isSameDay } from './modules/utils' +import { addLiveEvent } from './modules/utils' export default { components: { @@ -575,6 +576,7 @@ export default { editable: { type: Boolean, default: false }, /** + * @deprecated * The specified input element ID * @type String * @default Undefined @@ -584,6 +586,17 @@ export default { */ element: { type: String, default: undefined }, + /** + * New version of `element` + * @type String (DOMString containing a selector list) + * @desc use this instead of `element`, + * this custom input does not need v-model, and it will be automatically updated + * also supports `display-format` + * @example .my-custom-input | #my-custom-input | div.foo > input + * @version 2.10.0 + */ + customInput: { type: String, default: undefined }, + /** * The form input name when not using {element} * @type String @@ -1176,6 +1189,10 @@ export default { }, isCompactTime() { return this.compactTime || (this.type === 'datetime' && this.simple) + }, + customInputElement() { + if (this.element) return `#${this.element}` + return this.customInput } }, watch: { @@ -1253,6 +1270,14 @@ export default { 'localeData.name'() { this.$emit('localeChange', this.localeData) this.setMinMax() + }, + displayValue: { + immediate: true, + handler: function(displayValue) { + if (!this.customInput) return + const customInput = document.querySelector(this.customInput) + if (customInput) customInput.value = displayValue + } } }, created() { @@ -1262,21 +1287,10 @@ export default { }, mounted() { this.$nextTick(() => { - let addEvent = (el, type, handler) => { - if (el.attachEvent) el.attachEvent('on' + type, handler) - else el.addEventListener(type, handler) - } - let live = (selector, event, callback, context) => { - addEvent(context || document, event, function(e) { - let found, - el = e.target || e.srcElement - while (el && !(found = el.id === selector)) el = el.parentElement - if (found) callback.call(el, e) - }) - } - if (this.element && !this.editable) { - live(this.element, 'click', this.focus) - } + if (this.customInputElement && !this.editable) + addLiveEvent(this.customInputElement, 'click', this.focus) + if (this.customInput && this.editable) + addLiveEvent(this.customInput, 'blur', this.setOutput) }) document.body.addEventListener('keydown', e => { e = e || event @@ -1435,7 +1449,7 @@ export default { } }, updateDates(payload) { - if (this.isDataArray && !payload) payload = [] + if (!payload) payload = this.isDataArray ? [] : '' // fix: don't update dates if they are already up to date if (this.date.clone && payload.toString() === this.outputValue.toString()) diff --git a/src/modules/utils.js b/src/modules/utils.js index 445497b..a3eb7d8 100644 --- a/src/modules/utils.js +++ b/src/modules/utils.js @@ -180,4 +180,17 @@ export const scrollIntoCenter = function(element, duration = 200, callback) { }) } +export const addEventListener = function(el, type, handler) { + if (typeof el === 'string') el = document.querySelector(el) + if (!el) throw new Error('Cant find custom element: ' + el) + if (el.addEventListener) el.addEventListener(type, handler, true) + else el.attachEvent('on' + type, handler, true) +} + +export const addLiveEvent = function(selector, event, callback, context) { + addEventListener(context || document, event, function(e) { + if (e.target.closest(selector)) callback.call(e.target, e) + }) +} + export default { extend, clone }