@alibaba-aero/vue-calendar
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -5,2 +5,20 @@ # Change Log | ||
<a name="0.6.0"></a> | ||
# [0.6.0](https://github.com/alibaba-aero/vue-calendar/compare/v0.5.1...v0.6.0) (2019-04-28) | ||
### Features | ||
* month name as slot ([f4b039c](https://github.com/alibaba-aero/vue-calendar/commit/f4b039c)) | ||
* Merge pull request #2 from SasanFarrokh/master ([cab477e](https://github.com/alibaba-aero/vue-calendar/commit/cab477e)), closes [#2](https://github.com/alibaba-aero/vue-calendar/issues/2) | ||
### BREAKING CHANGES | ||
* remove monthTitleFormat and introduce named slot month-title | ||
<a name="0.5.1"></a> | ||
@@ -7,0 +25,0 @@ ## [0.5.1](https://github.com/alibaba-aero/vue-calendar/compare/v0.5.0...v0.5.1) (2019-01-08) |
@@ -1,2 +0,2 @@ | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var dayjs=_interopDefault(require("dayjs")),isBetween=_interopDefault(require("dayjs/plugin/isBetween")),jalaliday=_interopDefault(require("jalaliday"));dayjs.extend(isBetween),dayjs.extend(jalaliday);var PERSIAN_DIGITS=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],ARABIC_DIGITS=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],PERSIAN_ZERO_CHAR_CODE=PERSIAN_DIGITS[0].charCodeAt(0),ARABIC_ZERO_CHAR_CODE=ARABIC_DIGITS[0].charCodeAt(0);function rotate(e,t){return e.slice(t,e.length).concat(e.slice(0,t))}var script={props:{index:{type:String,required:!0},date:{type:Object,default:null},data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},methods:{onClick:function(){this.selectable&&this.$emit("click",{key:this.index,date:this.date,data:this.data,selected:this.selected,selectable:this.selectable})}}};const __vue_script__=script;var __vue_render__=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-day",class:[e.data.class,{disabled:e.disabled,selected:e.selected,selectable:e.selectable}],on:{mouseover:function(t){e.$emit("hover",e.date)},mouseout:function(t){e.$emit("blur",e.date)},click:e.onClick}},[n("div",{staticClass:"vuec-day-content"},[e._t("day",[n("div",{staticClass:"vuec-default-day"},[e._v("\n "+e._s(e.date.format("D"))+"\n ")])],{data:e.data,date:e.date})],2),e._v(" "),n("div",{staticClass:"vuec-square-placeholder"})])},__vue_staticRenderFns__=[];const __vue_inject_styles__=void 0,__vue_scope_id__=void 0,__vue_module_identifier__=void 0,__vue_is_functional_template__=!1;function __vue_normalize__(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="day.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var DayView=__vue_normalize__({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},void 0,__vue_script__,void 0,!1,void 0,void 0,void 0),script$1={components:{DayView:DayView},props:{date:{type:Object,required:!0},adapter:{type:Function,default:function(){return{}}},selectable:{type:Boolean,default:!1},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selection:{type:Array,default:function(){return[]}},showTitle:{type:Boolean,default:!0},title:{type:String,default:""},dateUnderCursor:{type:Object,default:null}},data:function(){var e=this.date.startOf("week").day();return{locale:this.date.$locale().name,weekDays:rotate(this.date.$locale().weekdays,e),days:this.getDaysOfMonthArray(this.date)}},computed:{propsToTriggerRecreateDays:function(){return this.date,this.minDate,this.maxDate,this.selection,this.adapter,Date.now()},propsToTriggerDataReaload:function(){return this.dateUnderCursor,Date.now()}},watch:{propsToTriggerRecreateDays:function(){this.days=this.getDaysOfMonthArray(this.date)},propsToTriggerDataReaload:function(){var e=this;this.days.forEach(function(t){t.data=e.adapter({date:t.date,dayKey:t.key,monthKey:t.date.format("YYYY/MM")})})}},methods:{getDaysOfMonthArray:function(e){for(var t=e.month(),n=e.format("YYYY/MM"),i=e.startOf("Month").startOf("week"),a=e.endOf("Month").endOf("week"),s=[],o=this.minDate?dayjs(this.minDate).startOf("day"):null,r=this.maxDate?dayjs(this.maxDate).endOf("day"):null;i.isBefore(a);){var _=i.format("YYYY/MM/DD");o&&i.isBefore(o)||r&&i.isAfter(r)||i.month()!==t?s.push({key:_,disabled:!0,hide:i.month()!==t,date:dayjs(i),data:this.adapter({date:i,dayKey:_,monthKey:n})||{}}):s.push({key:_,data:this.adapter({date:i,dayKey:_,monthKey:n})||{},date:dayjs(i),selected:-1!==this.selection.indexOf(_)}),i=i.add(1,"days")}return s}}};const __vue_script__$1=script$1;var __vue_render__$1=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-month"},[n("div",{staticClass:"vuec-month-name",attrs:{show:e.showTitle}},[n("h2",[e._v(e._s(e.title||e.date.format("MMMM")))])]),e._v(" "),n("div",{staticClass:"vuec-week-nav vuec-7col"},e._l(e.weekDays,function(t,i){return n("div",{key:i,staticClass:"vuec-col"},[n("div",{staticClass:"vuec-week-content"},[e._t("day-of-week",[e._v("\n "+e._s(t)+"\n ")],null,{name:t,index:i,locale:e.locale})],2),e._v(" "),n("div",{staticClass:"vuec-week-placeholder"})])}),0),e._v(" "),n("div",{staticClass:"vuec-month-content"},[n("div",{staticClass:"vuec-month-days vuec-7col"},e._l(e.days,function(t){return n("DayView",{key:t.key,staticClass:"vuec-col",attrs:{index:t.key,data:t.data,date:t.date,title:t.title,"aria-hidden":t.hide,disabled:t.disabled,selectable:!t.disabled&&e.selectable,selected:t.selected},on:{click:function(t){e.$emit("click-day",t)},hover:function(t){e.$emit("hover",t)},blur:function(t){e.$emit("blur",t)}},scopedSlots:e._u([{key:"day",fn:function(t){return[e._t("day",null,null,t)]}}])})}),1),e._v(" "),n("div",{staticClass:"vuec-month-placeholder"})])])},__vue_staticRenderFns__$1=[];const __vue_inject_styles__$1=void 0,__vue_scope_id__$1=void 0,__vue_module_identifier__$1=void 0,__vue_is_functional_template__$1=!1;function __vue_normalize__$1(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="month.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecMonth=__vue_normalize__$1({render:__vue_render__$1,staticRenderFns:__vue_staticRenderFns__$1},void 0,__vue_script__$1,void 0,!1,void 0,void 0,void 0),__vue_render__$2=function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[t("path",{attrs:{d:"M15.41,16.59L10.83,12l4.58-4.59L14,6l-6,6l6,6L15.41,16.59z"}}),this._v(" "),t("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},__vue_staticRenderFns__$2=[];const __vue_inject_styles__$2=void 0,__vue_scope_id__$2=void 0,__vue_module_identifier__$2=void 0,__vue_is_functional_template__$2=!1;function __vue_normalize__$2(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="arrow-left.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var IconArrowLeft=__vue_normalize__$2({render:__vue_render__$2,staticRenderFns:__vue_staticRenderFns__$2},void 0,{},void 0,!1,void 0,void 0,void 0),__vue_render__$3=function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[t("path",{attrs:{d:"M8.59,16.59L13.17,12L8.59,7.41L10,6l6,6l-6,6L8.59,16.59z"}}),this._v(" "),t("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},__vue_staticRenderFns__$3=[];const __vue_inject_styles__$3=void 0,__vue_scope_id__$3=void 0,__vue_module_identifier__$3=void 0,__vue_is_functional_template__$3=!1;function __vue_normalize__$3(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="arrow-right.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var IconArrowRight=__vue_normalize__$3({render:__vue_render__$3,staticRenderFns:__vue_staticRenderFns__$3},void 0,{},void 0,!1,void 0,void 0,void 0),script$2={components:{VuecMonth:VuecMonth,IconArrowLeft:IconArrowLeft,IconArrowRight:IconArrowRight},props:{theme:{type:String,default:"default"},showPreviousWeeks:{type:Boolean,default:!0},showNavigation:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},date:{type:Object,default:function(){return dayjs()}},visibleMonths:{type:Number,default:1},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selections:{type:Array,default:function(){return[]}},monthTitleFormat:{type:String,default:"MMMM"}},data:function(){return{localDate:this.date,dateUnderCursor:null}},computed:{monthSelections:function(){var e={};return this.selections.forEach(function(t){var n=dayjs(t,"YYYY/MM/DD").format("YYYY/MM");return e[n]=e[n]||[],e[n].push(t),e}),e},months:function(){var e=[],t=dayjs(this.localDate);this.showPreviousWeeks&&t.startOf("Month");for(var n=0;n<this.visibleMonths;){var i=t.format("YYYY/MM");e.push({title:t.format(this.monthTitleFormat),date:dayjs(t),selections:this.monthSelections[i]}),t=t.add(1,"Month").startOf("Month"),n+=1}return e}},watch:{date:function(e){this.localDate=e}},methods:{onHover:function(e){e.isSame(this.dateUnderCursor)||(this.dateUnderCursor=e)},onBlur:function(e){null===e&&(this.dateUnderCursor=null)},getDayData:function(e){var t=e.dayKey,n=e.monthKey;return(this.data[n]||{})[t]||{}},onDayClick:function(e){this.$emit("click-day",e)},previousPage:function(){this.localDate=this.localDate.subtract(this.visibleMonths,"Month").startOf("Month"),this.$emit("previous-page",this.localDate)},nextPage:function(){this.localDate=this.localDate.add(this.visibleMonths,"Month").startOf("Month"),this.$emit("next-page",this.localDate)}}};const __vue_script__$2=script$2;var __vue_render__$4=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-calendar",class:["vuec-theme-"+e.theme,e.date.$C]},[e.showNavigation?n("div",{staticClass:"vuec-nav",attrs:{"align-v":"center"}},[n("span",{staticClass:"vuec-btn-prev",on:{click:e.previousPage}},[e._t("prev-page",[n("IconArrowRight")])],2),e._v(" "),n("span",{staticClass:"vuec-btn-next",on:{click:e.nextPage}},[e._t("next-page",[n("IconArrowLeft")])],2)]):e._e(),e._v(" "),n("div",{staticClass:"vuec-month-wrapper"},e._l(e.months,function(t,i){return n("VuecMonth",{key:i,attrs:{adapter:e.getDayData,title:t.title,date:t.date,"min-date":e.minDate,"max-date":e.maxDate,selectable:e.selectable,inventory:t.inventory,selection:t.selections,"date-under-cursor":e.dateUnderCursor},on:{"click-day":e.onDayClick,hover:e.onHover,blur:e.onBlur},scopedSlots:e._u([{key:"day-of-week",fn:function(t){var n=t.name,i=t.index,a=t.locale;return[e._t("day-of-week",[e._v("\n "+e._s(n)+"\n ")],null,{name:n,index:i,locale:a})]}},{key:"day",fn:function(t){return[e._t("day",[n("div",{staticClass:"vuec-default-day"},[e._v("\n "+e._s(t.date.format("D"))+"\n ")])],null,t)]}}])})}),1)])},__vue_staticRenderFns__$4=[];const __vue_inject_styles__$4=void 0,__vue_scope_id__$4=void 0,__vue_module_identifier__$4=void 0,__vue_is_functional_template__$4=!1;function __vue_normalize__$4(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="calendar.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecCalendar=__vue_normalize__$4({render:__vue_render__$4,staticRenderFns:__vue_staticRenderFns__$4},void 0,__vue_script__$2,void 0,!1,void 0,void 0,void 0);function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=[],i=!0,a=!1,s=void 0;try{for(var o,r=e[Symbol.iterator]();!(i=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){a=!0,s=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw s}}return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var script$3={extends:VuecCalendar,props:{value:{type:Array,default:function(){return[]}}},data:function(){return{localSelection:[].concat(this.value)}},computed:{monthSelections:function(){var e={};return this.localSelection.forEach(function(t){var n=t.format("YYYY/MM");e[n]=e[n]||[],e[n].push(t)}),e}},watch:{value:function(e){this.localSelection=e}},methods:{getDayData:function(e){var t=e.dayKey,n=e.monthKey,i=e.date,a=(this.data[n]||{})[t]||{},s=this.localSelection[0]||this.dateUnderCursor,o=this.localSelection[1]||this.dateUnderCursor;return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:this.localSelection.length>0&&i.isSame(s,"day"),end:this.localSelection.length>1&&i.isSame(o,"day"),selected:this.localSelection.length>1&&i.isBetween(s,o,"days","[]"),highlight:this.dateUnderCursor&&1===this.localSelection.length&&i.isBetween(s,this.dateUnderCursor,"days","[]")}})},onHover:function(e){this.dateUnderCursor!==e&&(this.dateUnderCursor=e)},onDayClick:function(e){var t=e.date;0===this.localSelection.length||void 0===this.localSelection[0]?this.$set(this.localSelection,0,t):1!==this.localSelection.length&&(this.localSelection.length=0,this.localSelection.push(t)),t.isAfter(this.localSelection[0],"day")?this.localSelection.push(t):this.$set(this.localSelection,0,t),this.$emit("input",this.localSelection)}}};const __vue_script__$3=script$3,__vue_inject_styles__$5=void 0,__vue_scope_id__$5=void 0,__vue_module_identifier__$5=void 0,__vue_is_functional_template__$5=void 0;function __vue_normalize__$5(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="select-range.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecSelectRange=__vue_normalize__$5({},void 0,__vue_script__$3,void 0,void 0,void 0,void 0,void 0),__vue_render__$5=function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),this._v(" "),t("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])},__vue_staticRenderFns__$5=[];const __vue_inject_styles__$6=void 0,__vue_scope_id__$6=void 0,__vue_module_identifier__$6=void 0,__vue_is_functional_template__$6=!1;function __vue_normalize__$6(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="close.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var IconClose=__vue_normalize__$6({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},void 0,{},void 0,!1,void 0,void 0,void 0),script$4={components:{VuecSelectRange:VuecSelectRange,IconClose:IconClose},props:{theme:{type:String,default:"default"},mobile:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},date:{type:Object,default:function(){return dayjs()}},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Array,default:function(){return[]}},open:{type:Boolean,default:!1},format:{type:String,default:"YYYY/MM/DD"}},data:function(){var e=_slicedToArray(this.value,2),t=e[0],n=void 0===t?this.date:t,i=e[1],a=void 0===i?this.date:i;return{visible:this.open,temporaryDisableClickListen:!1,fromDate:n,toDate:a,dates:[dayjs(n),dayjs(a)]}},computed:{formattedDates:function(){var e=this;return this.dates.map(function(t){return t.format(e.format)})}},watch:{open:function(e){this.showPicker(e)}},mounted:function(){this.showPicker(this.open),document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.temporaryDisableClickListen=e,this.visible=e},onClickDelegate:function(e){e.stopPropagation()},onSelectionChange:function(e){this.fromDate=dayjs(e[0]),this.toDate=dayjs(e[e.length-1]),this.$emit("input",[this.fromDate,this.toDate])}}};const __vue_script__$4=script$4;var __vue_render__$6=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-range-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:e.showPicker}},[n("div",{staticClass:"input"},[e._v("\n "+e._s(e.formattedDates[0])+"\n ")]),e._v(" "),n("div",{staticClass:"input"},[e._v("\n "+e._s(e.formattedDates[1])+"\n ")])]),e._v(" "),n("Transition",{attrs:{name:"popup-animation"}},[e.visible?n("div",{staticClass:"vuec-popup",class:{mobile:e.mobile},on:{click:e.onClickDelegate}},[e.mobile?n("div",{staticClass:"vuec-popup-header"},[e._t("title",[e._v("\n تاریخ ورود و خروج\n ")]),e._v(" "),n("div",{staticClass:"vuec-popup-close",on:{click:function(t){e.showPicker(!1)}}},[n("IconClose")],1)],2):e._e(),e._v(" "),n("VuecSelectRange",{attrs:{theme:e.theme,value:e.dates,date:e.date,"min-date":e.minDate,"max-date":e.maxDate,"visible-months":2,selectable:!0}})],1):e._e()])],1)},__vue_staticRenderFns__$6=[];const __vue_inject_styles__$7=void 0,__vue_scope_id__$7=void 0,__vue_module_identifier__$7=void 0,__vue_is_functional_template__$7=!1;function __vue_normalize__$7(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="range-input.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var rangeInput=__vue_normalize__$7({render:__vue_render__$6,staticRenderFns:__vue_staticRenderFns__$6},void 0,__vue_script__$4,void 0,!1,void 0,void 0,void 0),script$5={extends:VuecCalendar,props:{value:{type:Object,default:null}},data:function(){return{localSelection:this.value?dayjs(this.value):null}},computed:{monthSelections:function(){var e={};if(this.localSelection){var t=this.localSelection.format("YYYY/MM");e[t]=e[t]||[],e[t].push(this.localSelection)}return e}},watch:{value:function(e){this.localSelection=e?dayjs(e):null}},methods:{getDayData:function(e){var t=e.dayKey,n=e.monthKey,i=e.date,a=(this.data[n]||{})[t]||{},s=this.localSelection&&i.isSame(this.localSelection,"day");return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:s,end:s}})},onHover:function(e){this.dateUnderCursor!==e&&(this.dateUnderCursor=e)},onDayClick:function(e){this.localSelection=e.date,this.$emit("input",e)}}};const __vue_script__$5=script$5,__vue_inject_styles__$8=void 0,__vue_scope_id__$8=void 0,__vue_module_identifier__$8=void 0,__vue_is_functional_template__$8=void 0;function __vue_normalize__$8(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="select-single.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecSelectSingle=__vue_normalize__$8({},void 0,__vue_script__$5,void 0,void 0,void 0,void 0,void 0),script$6={components:{VuecSelectSingle:VuecSelectSingle},props:{theme:{type:String,default:"default"},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},data:{type:Object,default:function(){return{}}},date:{type:[Object,String],default:void 0},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Object,default:function(){return{}}},open:{type:Boolean,default:!1}},data:function(){return{visible:this.open,temporaryDisableClickListen:!1,selection:void 0}},computed:{formattedDate:function(){return this.selection?this.selection.format("YYYY/MM/DD"):""}},watch:{open:function(e){this.visible=e,this.temporaryDisableClickListen=!0}},mounted:function(){document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){this.temporaryDisableClickListen=!0,this.visible=!0},onClickDelegate:function(e){e.stopPropagation()},onSelectionChange:function(e){var t=e.date;this.selection=dayjs(t),this.$emit("input",this.selection),this.visible=!1}}};const __vue_script__$6=script$6;var __vue_render__$7=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-single-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:e.showPicker}},[n("div",{staticClass:"input"},[e._v("\n "+e._s(e.formattedDate)+"\n ")])]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"vuec-popup",on:{click:e.onClickDelegate}},[n("VuecSelectSingle",{attrs:{theme:e.theme,date:e.date,value:e.selection,"visible-months":e.visibleMonths,selectable:!0,"min-date":e.minDate,"max-date":e.maxDate},on:{input:e.onSelectionChange}})],1)])},__vue_staticRenderFns__$7=[];const __vue_inject_styles__$9=void 0,__vue_scope_id__$9=void 0,__vue_module_identifier__$9=void 0,__vue_is_functional_template__$9=!1;function __vue_normalize__$9(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="single-input.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var singleInput=__vue_normalize__$9({render:__vue_render__$7,staticRenderFns:__vue_staticRenderFns__$7},void 0,__vue_script__$6,void 0,!1,void 0,void 0,void 0);exports.dayjs=dayjs,exports.VuecCalendar=VuecCalendar,exports.VuecDay=DayView,exports.VuecMonth=VuecMonth,exports.VuecRangeInput=rangeInput,exports.VuecSelectRange=VuecSelectRange,exports.VuecSingleInput=singleInput,exports.VuecSelectSingle=VuecSelectSingle; | ||
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var dayjs=_interopDefault(require("dayjs")),isBetween=_interopDefault(require("dayjs/plugin/isBetween")),jalaliday=_interopDefault(require("jalaliday"));dayjs.extend(isBetween),dayjs.extend(jalaliday);var PERSIAN_DIGITS=["۰","۱","۲","۳","۴","۵","۶","۷","۸","۹"],ARABIC_DIGITS=["٠","١","٢","٣","٤","٥","٦","٧","٨","٩"],PERSIAN_ZERO_CHAR_CODE=PERSIAN_DIGITS[0].charCodeAt(0),ARABIC_ZERO_CHAR_CODE=ARABIC_DIGITS[0].charCodeAt(0);function rotate(e,t){return e.slice(t,e.length).concat(e.slice(0,t))}var script={props:{index:{type:String,required:!0},date:{type:Object,default:null},data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},methods:{onClick:function(){this.selectable&&this.$emit("click",{key:this.index,date:this.date,data:this.data,selected:this.selected,selectable:this.selectable})}}};const __vue_script__=script;var __vue_render__=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-day",class:[e.data.class,{disabled:e.disabled,selected:e.selected,selectable:e.selectable}],on:{mouseover:function(t){e.$emit("hover",e.date)},mouseout:function(t){e.$emit("blur",e.date)},click:e.onClick}},[n("div",{staticClass:"vuec-day-content"},[e._t("day",[n("div",{staticClass:"vuec-default-day"},[e._v("\n "+e._s(e.date.format("D"))+"\n ")])],{data:e.data,date:e.date})],2),e._v(" "),n("div",{staticClass:"vuec-square-placeholder"})])},__vue_staticRenderFns__=[];const __vue_inject_styles__=void 0,__vue_scope_id__=void 0,__vue_module_identifier__=void 0,__vue_is_functional_template__=!1;function __vue_normalize__(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="day.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var DayView=__vue_normalize__({render:__vue_render__,staticRenderFns:__vue_staticRenderFns__},void 0,__vue_script__,void 0,!1,void 0,void 0,void 0),script$1={components:{DayView:DayView},props:{date:{type:Object,required:!0},adapter:{type:Function,default:function(){return{}}},selectable:{type:Boolean,default:!1},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selection:{type:Array,default:function(){return[]}},showTitle:{type:Boolean,default:!0},dateUnderCursor:{type:Object,default:null}},data:function(){var e=this.date.startOf("week").day();return{locale:this.date.$locale().name,weekDays:rotate(this.date.$locale().weekdays,e),days:this.getDaysOfMonthArray(this.date)}},computed:{propsToTriggerRecreateDays:function(){return this.date,this.minDate,this.maxDate,this.selection,this.adapter,Date.now()},propsToTriggerDataReaload:function(){return this.dateUnderCursor,Date.now()}},watch:{propsToTriggerRecreateDays:function(){this.days=this.getDaysOfMonthArray(this.date)},propsToTriggerDataReaload:function(){var e=this;this.days.forEach(function(t){t.data=e.adapter({date:t.date,dayKey:t.key,monthKey:t.date.format("YYYY/MM")})})}},methods:{getDaysOfMonthArray:function(e){for(var t=e.month(),n=e.format("YYYY/MM"),i=e.startOf("Month").startOf("week"),a=e.endOf("Month").endOf("week"),s=[],o=this.minDate?dayjs(this.minDate).startOf("day"):null,r=this.maxDate?dayjs(this.maxDate).endOf("day"):null;i.isBefore(a);){var _=i.format("YYYY/MM/DD");o&&i.isBefore(o)||r&&i.isAfter(r)||i.month()!==t?s.push({key:_,disabled:!0,hide:i.month()!==t,date:dayjs(i),data:this.adapter({date:i,dayKey:_,monthKey:n})||{}}):s.push({key:_,data:this.adapter({date:i,dayKey:_,monthKey:n})||{},date:dayjs(i),selected:-1!==this.selection.indexOf(_)}),i=i.add(1,"days")}return s}}};const __vue_script__$1=script$1;var __vue_render__$1=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-month"},[n("div",{staticClass:"vuec-month-name",attrs:{show:e.showTitle}},[e._t("month-title",null,{date:e.date})],2),e._v(" "),n("div",{staticClass:"vuec-week-nav vuec-7col"},e._l(e.weekDays,function(t,i){return n("div",{key:i,staticClass:"vuec-col"},[n("div",{staticClass:"vuec-week-content"},[e._t("day-of-week",[e._v("\n "+e._s(t)+"\n ")],null,{name:t,index:i,locale:e.locale})],2),e._v(" "),n("div",{staticClass:"vuec-week-placeholder"})])}),0),e._v(" "),n("div",{staticClass:"vuec-month-content"},[n("div",{staticClass:"vuec-month-days vuec-7col"},e._l(e.days,function(t){return n("DayView",{key:t.key,staticClass:"vuec-col",attrs:{index:t.key,data:t.data,date:t.date,title:t.title,"aria-hidden":t.hide,disabled:t.disabled,selectable:!t.disabled&&e.selectable,selected:t.selected},on:{click:function(t){e.$emit("click-day",t)},hover:function(t){e.$emit("hover",t)},blur:function(t){e.$emit("blur",t)}},scopedSlots:e._u([{key:"day",fn:function(t){return[e._t("day",null,null,t)]}}])})}),1),e._v(" "),n("div",{staticClass:"vuec-month-placeholder"})])])},__vue_staticRenderFns__$1=[];const __vue_inject_styles__$1=void 0,__vue_scope_id__$1=void 0,__vue_module_identifier__$1=void 0,__vue_is_functional_template__$1=!1;function __vue_normalize__$1(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="month.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecMonth=__vue_normalize__$1({render:__vue_render__$1,staticRenderFns:__vue_staticRenderFns__$1},void 0,__vue_script__$1,void 0,!1,void 0,void 0,void 0),__vue_render__$2=function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[t("path",{attrs:{d:"M15.41,16.59L10.83,12l4.58-4.59L14,6l-6,6l6,6L15.41,16.59z"}}),this._v(" "),t("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},__vue_staticRenderFns__$2=[];const __vue_inject_styles__$2=void 0,__vue_scope_id__$2=void 0,__vue_module_identifier__$2=void 0,__vue_is_functional_template__$2=!1;function __vue_normalize__$2(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="arrow-left.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var IconArrowLeft=__vue_normalize__$2({render:__vue_render__$2,staticRenderFns:__vue_staticRenderFns__$2},void 0,{},void 0,!1,void 0,void 0,void 0),__vue_render__$3=function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[t("path",{attrs:{d:"M8.59,16.59L13.17,12L8.59,7.41L10,6l6,6l-6,6L8.59,16.59z"}}),this._v(" "),t("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},__vue_staticRenderFns__$3=[];const __vue_inject_styles__$3=void 0,__vue_scope_id__$3=void 0,__vue_module_identifier__$3=void 0,__vue_is_functional_template__$3=!1;function __vue_normalize__$3(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="arrow-right.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var IconArrowRight=__vue_normalize__$3({render:__vue_render__$3,staticRenderFns:__vue_staticRenderFns__$3},void 0,{},void 0,!1,void 0,void 0,void 0),script$2={components:{VuecMonth:VuecMonth,IconArrowLeft:IconArrowLeft,IconArrowRight:IconArrowRight},props:{theme:{type:String,default:"default"},showPreviousWeeks:{type:Boolean,default:!0},showNavigation:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},date:{type:Object,default:function(){return dayjs()}},visibleMonths:{type:Number,default:1},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selections:{type:Array,default:function(){return[]}}},data:function(){return{localDate:this.date,dateUnderCursor:null}},computed:{monthSelections:function(){var e={};return this.selections.forEach(function(t){var n=dayjs(t,"YYYY/MM/DD").format("YYYY/MM");return e[n]=e[n]||[],e[n].push(t),e}),e},months:function(){var e=[],t=dayjs(this.localDate);this.showPreviousWeeks&&t.startOf("Month");for(var n=0;n<this.visibleMonths;){var i=t.format("YYYY/MM");e.push({date:dayjs(t),selections:this.monthSelections[i]}),t=t.add(1,"Month").startOf("Month"),n+=1}return e}},watch:{date:function(e){this.localDate=e}},methods:{onHover:function(e){e.isSame(this.dateUnderCursor)||(this.dateUnderCursor=e)},onBlur:function(e){null===e&&(this.dateUnderCursor=null)},getDayData:function(e){var t=e.dayKey,n=e.monthKey;return(this.data[n]||{})[t]||{}},onDayClick:function(e){this.$emit("click-day",e)},previousPage:function(){this.localDate=this.localDate.subtract(this.visibleMonths,"Month").startOf("Month"),this.$emit("previous-page",this.localDate)},nextPage:function(){this.localDate=this.localDate.add(this.visibleMonths,"Month").startOf("Month"),this.$emit("next-page",this.localDate)}}};const __vue_script__$2=script$2;var __vue_render__$4=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-calendar",class:["vuec-theme-"+e.theme,e.date.$C]},[e.showNavigation?n("div",{staticClass:"vuec-nav",attrs:{"align-v":"center"}},[n("span",{staticClass:"vuec-btn-prev",on:{click:e.previousPage}},[e._t("prev-page",[n("IconArrowRight")])],2),e._v(" "),n("span",{staticClass:"vuec-btn-next",on:{click:e.nextPage}},[e._t("next-page",[n("IconArrowLeft")])],2)]):e._e(),e._v(" "),n("div",{staticClass:"vuec-month-wrapper"},e._l(e.months,function(t,i){return n("VuecMonth",{key:i,attrs:{adapter:e.getDayData,date:t.date,"min-date":e.minDate,"max-date":e.maxDate,selectable:e.selectable,inventory:t.inventory,selection:t.selections,"date-under-cursor":e.dateUnderCursor},on:{"click-day":e.onDayClick,hover:e.onHover,blur:e.onBlur},scopedSlots:e._u([{key:"day-of-week",fn:function(t){var n=t.name,i=t.index,a=t.locale;return[e._t("day-of-week",[e._v("\n "+e._s(n)+"\n ")],null,{name:n,index:i,locale:a})]}},{key:"day",fn:function(t){return[e._t("day",[n("div",{staticClass:"vuec-default-day"},[e._v("\n "+e._s(t.date.format("D"))+"\n ")])],null,t)]}},{key:"month-title",fn:function(t){return[e._t("month-title",[n("h2",[e._v(e._s(t.date.format("MMMM")))])],null,t)]}}])})}),1)])},__vue_staticRenderFns__$4=[];const __vue_inject_styles__$4=void 0,__vue_scope_id__$4=void 0,__vue_module_identifier__$4=void 0,__vue_is_functional_template__$4=!1;function __vue_normalize__$4(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="calendar.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecCalendar=__vue_normalize__$4({render:__vue_render__$4,staticRenderFns:__vue_staticRenderFns__$4},void 0,__vue_script__$2,void 0,!1,void 0,void 0,void 0);function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){var n=[],i=!0,a=!1,s=void 0;try{for(var o,r=e[Symbol.iterator]();!(i=(o=r.next()).done)&&(n.push(o.value),!t||n.length!==t);i=!0);}catch(e){a=!0,s=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw s}}return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}var script$3={extends:VuecCalendar,props:{value:{type:Array,default:function(){return[]}}},data:function(){return{localSelection:[].concat(this.value)}},computed:{monthSelections:function(){var e={};return this.localSelection.forEach(function(t){var n=t.format("YYYY/MM");e[n]=e[n]||[],e[n].push(t)}),e}},watch:{value:function(e){this.localSelection=e}},methods:{getDayData:function(e){var t=e.dayKey,n=e.monthKey,i=e.date,a=(this.data[n]||{})[t]||{},s=this.localSelection[0]||this.dateUnderCursor,o=this.localSelection[1]||this.dateUnderCursor;return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:this.localSelection.length>0&&i.isSame(s,"day"),end:this.localSelection.length>1&&i.isSame(o,"day"),selected:this.localSelection.length>1&&i.isBetween(s,o,"days","[]"),highlight:this.dateUnderCursor&&1===this.localSelection.length&&i.isBetween(s,this.dateUnderCursor,"days","[]")}})},onHover:function(e){this.dateUnderCursor!==e&&(this.dateUnderCursor=e)},onDayClick:function(e){var t=e.date;0===this.localSelection.length||void 0===this.localSelection[0]?this.$set(this.localSelection,0,t):1!==this.localSelection.length&&(this.localSelection.length=0,this.localSelection.push(t)),t.isAfter(this.localSelection[0],"day")?this.localSelection.push(t):this.$set(this.localSelection,0,t),this.$emit("input",this.localSelection)}}};const __vue_script__$3=script$3,__vue_inject_styles__$5=void 0,__vue_scope_id__$5=void 0,__vue_module_identifier__$5=void 0,__vue_is_functional_template__$5=void 0;function __vue_normalize__$5(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="select-range.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecSelectRange=__vue_normalize__$5({},void 0,__vue_script__$3,void 0,void 0,void 0,void 0,void 0),__vue_render__$5=function(){var e=this.$createElement,t=this._self._c||e;return t("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),this._v(" "),t("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])},__vue_staticRenderFns__$5=[];const __vue_inject_styles__$6=void 0,__vue_scope_id__$6=void 0,__vue_module_identifier__$6=void 0,__vue_is_functional_template__$6=!1;function __vue_normalize__$6(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="close.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var IconClose=__vue_normalize__$6({render:__vue_render__$5,staticRenderFns:__vue_staticRenderFns__$5},void 0,{},void 0,!1,void 0,void 0,void 0),script$4={components:{VuecSelectRange:VuecSelectRange,IconClose:IconClose},props:{theme:{type:String,default:"default"},mobile:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},date:{type:Object,default:function(){return dayjs()}},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Array,default:function(){return[]}},open:{type:Boolean,default:!1},format:{type:String,default:"YYYY/MM/DD"}},data:function(){var e=_slicedToArray(this.value,2),t=e[0],n=void 0===t?this.date:t,i=e[1],a=void 0===i?this.date:i;return{visible:this.open,temporaryDisableClickListen:!1,fromDate:n,toDate:a,dates:[dayjs(n),dayjs(a)]}},computed:{formattedDates:function(){var e=this;return this.dates.map(function(t){return t.format(e.format)})}},watch:{open:function(e){this.showPicker(e)}},mounted:function(){this.showPicker(this.open),document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.temporaryDisableClickListen=e,this.visible=e},onClickDelegate:function(e){e.stopPropagation()},onSelectionChange:function(e){this.fromDate=dayjs(e[0]),this.toDate=dayjs(e[e.length-1]),this.$emit("input",[this.fromDate,this.toDate])}}};const __vue_script__$4=script$4;var __vue_render__$6=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-range-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:e.showPicker}},[n("div",{staticClass:"input"},[e._v("\n "+e._s(e.formattedDates[0])+"\n ")]),e._v(" "),n("div",{staticClass:"input"},[e._v("\n "+e._s(e.formattedDates[1])+"\n ")])]),e._v(" "),n("Transition",{attrs:{name:"popup-animation"}},[e.visible?n("div",{staticClass:"vuec-popup",class:{mobile:e.mobile},on:{click:e.onClickDelegate}},[e.mobile?n("div",{staticClass:"vuec-popup-header"},[e._t("title",[e._v("\n تاریخ ورود و خروج\n ")]),e._v(" "),n("div",{staticClass:"vuec-popup-close",on:{click:function(t){e.showPicker(!1)}}},[n("IconClose")],1)],2):e._e(),e._v(" "),n("VuecSelectRange",{attrs:{theme:e.theme,value:e.dates,date:e.date,"min-date":e.minDate,"max-date":e.maxDate,"visible-months":2,selectable:!0}})],1):e._e()])],1)},__vue_staticRenderFns__$6=[];const __vue_inject_styles__$7=void 0,__vue_scope_id__$7=void 0,__vue_module_identifier__$7=void 0,__vue_is_functional_template__$7=!1;function __vue_normalize__$7(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="range-input.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var rangeInput=__vue_normalize__$7({render:__vue_render__$6,staticRenderFns:__vue_staticRenderFns__$6},void 0,__vue_script__$4,void 0,!1,void 0,void 0,void 0),script$5={extends:VuecCalendar,props:{value:{type:Object,default:null}},data:function(){return{localSelection:this.value?dayjs(this.value):null}},computed:{monthSelections:function(){var e={};if(this.localSelection){var t=this.localSelection.format("YYYY/MM");e[t]=e[t]||[],e[t].push(this.localSelection)}return e}},watch:{value:function(e){this.localSelection=e?dayjs(e):null}},methods:{getDayData:function(e){var t=e.dayKey,n=e.monthKey,i=e.date,a=(this.data[n]||{})[t]||{},s=this.localSelection&&i.isSame(this.localSelection,"day");return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:s,end:s}})},onHover:function(e){this.dateUnderCursor!==e&&(this.dateUnderCursor=e)},onDayClick:function(e){this.localSelection=e.date,this.$emit("input",e)}}};const __vue_script__$5=script$5,__vue_inject_styles__$8=void 0,__vue_scope_id__$8=void 0,__vue_module_identifier__$8=void 0,__vue_is_functional_template__$8=void 0;function __vue_normalize__$8(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="select-single.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var VuecSelectSingle=__vue_normalize__$8({},void 0,__vue_script__$5,void 0,void 0,void 0,void 0,void 0),script$6={components:{VuecSelectSingle:VuecSelectSingle},props:{theme:{type:String,default:"default"},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},data:{type:Object,default:function(){return{}}},date:{type:[Object,String],default:void 0},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Object,default:function(){return{}}},open:{type:Boolean,default:!1}},data:function(){return{visible:this.open,temporaryDisableClickListen:!1,selection:void 0}},computed:{formattedDate:function(){return this.selection?this.selection.format("YYYY/MM/DD"):""}},watch:{open:function(e){this.visible=e,this.temporaryDisableClickListen=!0}},mounted:function(){document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){this.temporaryDisableClickListen=!0,this.visible=!0},onClickDelegate:function(e){e.stopPropagation()},onSelectionChange:function(e){var t=e.date;this.selection=dayjs(t),this.$emit("input",this.selection),this.visible=!1}}};const __vue_script__$6=script$6;var __vue_render__$7=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"vuec-single-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:e.showPicker}},[n("div",{staticClass:"input"},[e._v("\n "+e._s(e.formattedDate)+"\n ")])]),e._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"vuec-popup",on:{click:e.onClickDelegate}},[n("VuecSelectSingle",{attrs:{theme:e.theme,date:e.date,value:e.selection,"visible-months":e.visibleMonths,selectable:!0,"min-date":e.minDate,"max-date":e.maxDate},on:{input:e.onSelectionChange}})],1)])},__vue_staticRenderFns__$7=[];const __vue_inject_styles__$9=void 0,__vue_scope_id__$9=void 0,__vue_module_identifier__$9=void 0,__vue_is_functional_template__$9=!1;function __vue_normalize__$9(e,t,n,i,a,s,o,r){const _=("function"==typeof n?n.options:n)||{};return _.__file="single-input.vue",_.render||(_.render=e.render,_.staticRenderFns=e.staticRenderFns,_._compiled=!0,a&&(_.functional=!0)),_._scopeId=i,_}var singleInput=__vue_normalize__$9({render:__vue_render__$7,staticRenderFns:__vue_staticRenderFns__$7},void 0,__vue_script__$6,void 0,!1,void 0,void 0,void 0);exports.dayjs=dayjs,exports.VuecCalendar=VuecCalendar,exports.VuecDay=DayView,exports.VuecMonth=VuecMonth,exports.VuecRangeInput=rangeInput,exports.VuecSelectRange=VuecSelectRange,exports.VuecSingleInput=singleInput,exports.VuecSelectSingle=VuecSelectSingle; | ||
//# sourceMappingURL=vue-calendar.cjs.min.js.map |
@@ -191,6 +191,2 @@ import dayjs from 'dayjs'; | ||
}, | ||
title: { | ||
type: String, | ||
default: '' | ||
}, | ||
dateUnderCursor: { | ||
@@ -300,3 +296,3 @@ type: Object, | ||
/* template */ | ||
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vuec-month"},[_c('div',{staticClass:"vuec-month-name",attrs:{"show":_vm.showTitle}},[_c('h2',[_vm._v(_vm._s(_vm.title || _vm.date.format('MMMM')))])]),_vm._v(" "),_c('div',{staticClass:"vuec-week-nav vuec-7col"},_vm._l((_vm.weekDays),function(name,index){return _c('div',{key:index,staticClass:"vuec-col"},[_c('div',{staticClass:"vuec-week-content"},[_vm._t("day-of-week",[_vm._v("\n "+_vm._s(name)+"\n ")],null,{ name: name, index: index, locale: _vm.locale })],2),_vm._v(" "),_c('div',{staticClass:"vuec-week-placeholder"})])}),0),_vm._v(" "),_c('div',{staticClass:"vuec-month-content"},[_c('div',{staticClass:"vuec-month-days vuec-7col"},_vm._l((_vm.days),function(day){return _c('DayView',{key:day.key,staticClass:"vuec-col",attrs:{"index":day.key,"data":day.data,"date":day.date,"title":day.title,"aria-hidden":day.hide,"disabled":day.disabled,"selectable":!day.disabled && _vm.selectable,"selected":day.selected},on:{"click":function($event){_vm.$emit('click-day', $event);},"hover":function($event){_vm.$emit('hover', $event);},"blur":function($event){_vm.$emit('blur', $event);}},scopedSlots:_vm._u([{key:"day",fn:function(props){return [_vm._t("day",null,null,props)]}}])})}),1),_vm._v(" "),_c('div',{staticClass:"vuec-month-placeholder"})])])}; | ||
var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vuec-month"},[_c('div',{staticClass:"vuec-month-name",attrs:{"show":_vm.showTitle}},[_vm._t("month-title",null,{date:_vm.date})],2),_vm._v(" "),_c('div',{staticClass:"vuec-week-nav vuec-7col"},_vm._l((_vm.weekDays),function(name,index){return _c('div',{key:index,staticClass:"vuec-col"},[_c('div',{staticClass:"vuec-week-content"},[_vm._t("day-of-week",[_vm._v("\n "+_vm._s(name)+"\n ")],null,{ name: name, index: index, locale: _vm.locale })],2),_vm._v(" "),_c('div',{staticClass:"vuec-week-placeholder"})])}),0),_vm._v(" "),_c('div',{staticClass:"vuec-month-content"},[_c('div',{staticClass:"vuec-month-days vuec-7col"},_vm._l((_vm.days),function(day){return _c('DayView',{key:day.key,staticClass:"vuec-col",attrs:{"index":day.key,"data":day.data,"date":day.date,"title":day.title,"aria-hidden":day.hide,"disabled":day.disabled,"selectable":!day.disabled && _vm.selectable,"selected":day.selected},on:{"click":function($event){_vm.$emit('click-day', $event);},"hover":function($event){_vm.$emit('hover', $event);},"blur":function($event){_vm.$emit('blur', $event);}},scopedSlots:_vm._u([{key:"day",fn:function(props){return [_vm._t("day",null,null,props)]}}])})}),1),_vm._v(" "),_c('div',{staticClass:"vuec-month-placeholder"})])])}; | ||
var __vue_staticRenderFns__$1 = []; | ||
@@ -513,6 +509,2 @@ | ||
} | ||
}, | ||
monthTitleFormat: { | ||
type: String, | ||
default: 'MMMM' | ||
} | ||
@@ -550,3 +542,2 @@ }, | ||
months.push({ | ||
title: date.format(this.monthTitleFormat), | ||
date: dayjs(date), | ||
@@ -600,7 +591,7 @@ selections: this.monthSelections[monthKey] | ||
/* template */ | ||
var __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vuec-calendar",class:['vuec-theme-' + _vm.theme, _vm.date.$C]},[(_vm.showNavigation)?_c('div',{staticClass:"vuec-nav",attrs:{"align-v":"center"}},[_c('span',{staticClass:"vuec-btn-prev",on:{"click":_vm.previousPage}},[_vm._t("prev-page",[_c('IconArrowRight')])],2),_vm._v(" "),_c('span',{staticClass:"vuec-btn-next",on:{"click":_vm.nextPage}},[_vm._t("next-page",[_c('IconArrowLeft')])],2)]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"vuec-month-wrapper"},_vm._l((_vm.months),function(month,monthIndex){return _c('VuecMonth',{key:monthIndex,attrs:{"adapter":_vm.getDayData,"title":month.title,"date":month.date,"min-date":_vm.minDate,"max-date":_vm.maxDate,"selectable":_vm.selectable,"inventory":month.inventory,"selection":month.selections,"date-under-cursor":_vm.dateUnderCursor},on:{"click-day":_vm.onDayClick,"hover":_vm.onHover,"blur":_vm.onBlur},scopedSlots:_vm._u([{key:"day-of-week",fn:function(ref){ | ||
var __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"vuec-calendar",class:['vuec-theme-' + _vm.theme, _vm.date.$C]},[(_vm.showNavigation)?_c('div',{staticClass:"vuec-nav",attrs:{"align-v":"center"}},[_c('span',{staticClass:"vuec-btn-prev",on:{"click":_vm.previousPage}},[_vm._t("prev-page",[_c('IconArrowRight')])],2),_vm._v(" "),_c('span',{staticClass:"vuec-btn-next",on:{"click":_vm.nextPage}},[_vm._t("next-page",[_c('IconArrowLeft')])],2)]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"vuec-month-wrapper"},_vm._l((_vm.months),function(month,monthIndex){return _c('VuecMonth',{key:monthIndex,attrs:{"adapter":_vm.getDayData,"date":month.date,"min-date":_vm.minDate,"max-date":_vm.maxDate,"selectable":_vm.selectable,"inventory":month.inventory,"selection":month.selections,"date-under-cursor":_vm.dateUnderCursor},on:{"click-day":_vm.onDayClick,"hover":_vm.onHover,"blur":_vm.onBlur},scopedSlots:_vm._u([{key:"day-of-week",fn:function(ref){ | ||
var name = ref.name; | ||
var index = ref.index; | ||
var locale = ref.locale; | ||
return [_vm._t("day-of-week",[_vm._v("\n "+_vm._s(name)+"\n ")],null,{ name: name, index: index, locale: locale })]}},{key:"day",fn:function(props){return [_vm._t("day",[_c('div',{staticClass:"vuec-default-day"},[_vm._v("\n "+_vm._s(props.date.format('D'))+"\n ")])],null,props)]}}])})}),1)])}; | ||
return [_vm._t("day-of-week",[_vm._v("\n "+_vm._s(name)+"\n ")],null,{ name: name, index: index, locale: locale })]}},{key:"day",fn:function(props){return [_vm._t("day",[_c('div',{staticClass:"vuec-default-day"},[_vm._v("\n "+_vm._s(props.date.format('D'))+"\n ")])],null,props)]}},{key:"month-title",fn:function(scope){return [_vm._t("month-title",[_c('h2',[_vm._v(_vm._s(scope.date.format('MMMM')))])],null,scope)]}}])})}),1)])}; | ||
var __vue_staticRenderFns__$4 = []; | ||
@@ -607,0 +598,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.vueCalendar={})}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e(function(t,e){t.exports=function(){var t="millisecond",e="second",n="minute",i="hour",a="day",r="week",s="month",o="year",l=/^(\d{4})-?(\d{1,2})-?(\d{0,2})(.*?(\d{1,2}):(\d{1,2}):(\d{1,2}))?.?(\d{1,3})?$/,c=/\[.*?\]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,u={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},d=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},h={padStart:d,padZoneStr:function(t){var e=Math.abs(t),n=Math.floor(e/60),i=e%60;return(t<=0?"+":"-")+d(n,2,"0")+":"+d(i,2,"0")},monthDiff:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(n,"months"),a=e-i<0,r=t.clone().add(n+(a?-1:1),"months");return Number(-(n+(e-i)/(a?i-r:r-i)))},absFloor:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},prettyUnit:function(l){return{M:s,y:o,w:r,d:a,h:i,m:n,s:e,ms:t}[l]||String(l||"").toLowerCase().replace(/s$/,"")},isUndefined:function(t){return void 0===t}},f="en",v={};v[f]=u;var p=function(t){return t instanceof M},y=function(t,e,n){var i;if(!t)return null;if("string"==typeof t)v[t]&&(i=t),e&&(v[t]=e,i=t);else{var a=t.name;v[a]=t,i=a}return n||(f=i),i},m=function(t,e){if(p(t))return t.clone();var n=e||{};return n.date=t,new M(n)},$=function(t,e){return m(t,{locale:e.$L})},_=h;_.parseLocale=y,_.isDayjs=p,_.wrapper=$;var M=function(){function u(t){this.parse(t)}var d=u.prototype;return d.parse=function(t){var e,n;this.$d=null===(e=t.date)?new Date(NaN):_.isUndefined(e)?new Date:e instanceof Date?e:"string"==typeof e&&/.*[^Z]$/i.test(e)&&(n=e.match(l))?new Date(n[1],n[2]-1,n[3]||1,n[5]||0,n[6]||0,n[7]||0,n[8]||0):new Date(e),this.init(t)},d.init=function(t){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds(),this.$L=this.$L||y(t.locale,null,!0)||f},d.$utils=function(){return _},d.isValid=function(){return!("Invalid Date"===this.$d.toString())},d.isSame=function(t,e){var n=m(t);return this.startOf(e)<=n&&n<=this.endOf(e)},d.isAfter=function(t,e){return m(t)<this.startOf(e)},d.isBefore=function(t,e){return this.endOf(e)<m(t)},d.year=function(){return this.$y},d.month=function(){return this.$M},d.day=function(){return this.$W},d.date=function(){return this.$D},d.hour=function(){return this.$H},d.minute=function(){return this.$m},d.second=function(){return this.$s},d.millisecond=function(){return this.$ms},d.unix=function(){return Math.floor(this.valueOf()/1e3)},d.valueOf=function(){return this.$d.getTime()},d.startOf=function(t,l){var c=this,u=!!_.isUndefined(l)||l,d=function(t,e){var n=$(new Date(c.$y,e,t),c);return u?n:n.endOf(a)},h=function(t,e){return $(c.toDate()[t].apply(c.toDate(),(u?[0,0,0,0]:[23,59,59,999]).slice(e)),c)};switch(_.prettyUnit(t)){case o:return u?d(1,0):d(31,11);case s:return u?d(1,this.$M):d(0,this.$M+1);case r:return d(u?this.$D-this.$W:this.$D+(6-this.$W),this.$M);case a:case"date":return h("setHours",0);case i:return h("setMinutes",1);case n:return h("setSeconds",2);case e:return h("setMilliseconds",3);default:return this.clone()}},d.endOf=function(t){return this.startOf(t,!1)},d.$set=function(r,l){var c,u=_.prettyUnit(r),d=(c={},c[a]="setDate",c.date="setDate",c[s]="setMonth",c[o]="setFullYear",c[i]="setHours",c[n]="setMinutes",c[e]="setSeconds",c[t]="setMilliseconds",c)[u],h=u===a?this.$D+(l-this.$W):l;return this.$d[d]&&this.$d[d](h),this.init(),this},d.set=function(t,e){return this.clone().$set(t,e)},d.add=function(t,l){var c,u=this;t=Number(t);var d=_.prettyUnit(l),h=function(e,n){var i=u.set("date",1).set(e,n+t);return i.set("date",Math.min(u.$D,i.daysInMonth()))},f=function(e){var n=new Date(u.$d);return n.setDate(n.getDate()+e*t),$(n,u)};if(d===s)return h(s,this.$M);if(d===o)return h(o,this.$y);if(d===a)return f(1);if(d===r)return f(7);var v=(c={},c[n]=6e4,c[i]=36e5,c[e]=1e3,c)[d]||1,p=this.valueOf()+t*v;return $(p,this)},d.subtract=function(t,e){return this.add(-1*t,e)},d.format=function(t){var e=this,n=t||"YYYY-MM-DDTHH:mm:ssZ",i=_.padZoneStr(this.$d.getTimezoneOffset()),a=this.$locale(),r=a.weekdays,s=a.months,o=function(t,e,n,i){return t&&t[e]||n[e].substr(0,i)},l=function(t){return 0===e.$H?12:_.padStart(e.$H<13?e.$H:e.$H-12,"hh"===t?2:1,"0")};return n.replace(c,function(t){return t.indexOf("[")>-1?t.replace(/\[|\]/g,""):{YY:String(e.$y).slice(-2),YYYY:String(e.$y),M:String(e.$M+1),MM:_.padStart(e.$M+1,2,"0"),MMM:o(a.monthsShort,e.$M,s,3),MMMM:s[e.$M],D:String(e.$D),DD:_.padStart(e.$D,2,"0"),d:String(e.$W),dd:o(a.weekdaysMin,e.$W,r,2),ddd:o(a.weekdaysShort,e.$W,r,3),dddd:r[e.$W],H:String(e.$H),HH:_.padStart(e.$H,2,"0"),h:l(t),hh:l(t),a:e.$H<12?"am":"pm",A:e.$H<12?"AM":"PM",m:String(e.$m),mm:_.padStart(e.$m,2,"0"),s:String(e.$s),ss:_.padStart(e.$s,2,"0"),SSS:_.padStart(e.$ms,3,"0"),Z:i}[t]||i.replace(":","")})},d.diff=function(t,l,c){var u,d=_.prettyUnit(l),h=m(t),f=this-h,v=_.monthDiff(this,h);return v=(u={},u[o]=v/12,u[s]=v,u.quarter=v/3,u[r]=f/6048e5,u[a]=f/864e5,u[i]=f/36e5,u[n]=f/6e4,u[e]=f/1e3,u)[d]||f,c?v:_.absFloor(v)},d.daysInMonth=function(){return this.endOf(s).$D},d.$locale=function(){return v[this.$L]},d.locale=function(t,e){var n=this.clone();return n.$L=y(t,e,!0),n},d.clone=function(){return $(this.toDate(),this)},d.toDate=function(){return new Date(this.$d)},d.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]},d.toJSON=function(){return this.toISOString()},d.toISOString=function(){return this.$d.toISOString()},d.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}},d.toString=function(){return this.$d.toUTCString()},u}();return m.extend=function(t,e){return t(e,M,m),m},m.locale=y,m.isDayjs=p,m.unix=function(t){return m(1e3*t)},m.en=v[f],m}()}),i=e(function(t,e){t.exports=function(t,e,n){e.prototype.isBetween=function(t,e,i){var a=n(t),r=n(e);return this.isAfter(a,i)&&this.isBefore(r,i)||this.isBefore(a,i)&&this.isAfter(r,i)}}});function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==o.return||o.return()}finally{if(a)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function r(t,e){return t-e*Math.floor(t/e)}function s(t){return t%4==0&&!(t%100==0&&t%400!=0)}var o=1721425.5;function l(t,e,n){return o-1+365*(t-1)+Math.floor((t-1)/4)+-Math.floor((t-1)/100)+Math.floor((t-1)/400)+Math.floor((367*e-362)/12+(e<=2?0:s(t)?-1:-2)+n)}var c=1948320.5;function u(t,e,n){var i,a;return a=474+r(i=t-(t>=0?474:473),2820),n+(e<=7?31*(e-1):30*(e-1)+6)+Math.floor((682*a-110)/2816)+365*(a-1)+1029983*Math.floor(i/2820)+(c-1)}var d={toJalaali:function(t,e,n){return i=l(t,e,n),o=(i=Math.floor(i)+.5)-u(475,1,1),c=Math.floor(o/1029983),1029982==(d=r(o,1029983))?h=2820:(f=Math.floor(d/366),v=r(d,366),h=Math.floor((2134*f+2816*v+2815)/1028522)+f+1),(a=h+2820*c+474)<=0&&a--,[a,s=(p=i-u(a,1,1)+1)<=186?Math.ceil(p/31):Math.ceil((p-6)/30),i-u(a,s,1)+1];var i,a,s,o,c,d,h,f,v,p},toGregorian:function(t,e,n){return function(t){var e,n,i,a,c,u,d,h,f,v,p,y;n=(e=Math.floor(t-.5)+.5)-o,i=Math.floor(n/146097),a=r(n,146097),c=Math.floor(a/36524),u=r(a,36524),d=Math.floor(u/1461),h=r(u,1461),v=400*i+100*c+4*d+(f=Math.floor(h/365)),4!=c&&4!=f&&v++,p=e-l(v,1,1),y=e<l(v,3,1)?0:s(v)?1:2;var m=Math.floor((12*(p+y)+373)/367);return[v,m,e-l(v,m,1)+1]}(u(t,e,n))}},h=/^(\d{4})[-\/]?(\d{1,2})[-\/]?(\d{0,2})(.*)?$/,f=/\[.*?\]|jY{2,4}|jM{1,4}|jD{1,2}|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v="day",p="month",y="year",m={name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),jmonths:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),ordinal:function(t){return t}};n.extend(i),n.extend(function(t,e,n){var i=e.prototype,r=i.$utils(),s=function(t){return function(){var e=t.bind(this).apply(void 0,arguments);return e.$C=this.$C,e.isJalali()&&e.InitJalali(),e}};i.startOf=s(i.startOf),i.endOf=s(i.endOf),i.add=s(i.add),i.subtract=s(i.subtract),i.set=s(i.set);var o=i.parse,l=i.init,c=i.startOf,u=i.$set,$=i.add,_=i.format,M=i.diff,g=i.year,D=i.month,b=i.date,S=i.daysInMonth;n.$C="gregory",n.$fdow=6,n.calendar=function(t){return n.$C=t,n},i.calendar=function(t){var e=this.clone();return e.$C=t,e.isJalali()&&e.InitJalali(),e},i.isJalali=function(){return"jalali"===this.$C},n.en.jmonths="Farvardin_Ordibehesht_Khordaad_Tir_Mordaad_Shahrivar_Mehr_Aabaan_Aazar_Dey_Bahman_Esfand".split("_"),n.locale("fa",m,!0);var w=function(t,e){return n(t,{locale:e.$L,calendar:e.$C})};i.init=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};l.bind(this)(t),this.$C=t.calendar||this.$C||n.$C,this.isJalali()&&this.InitJalali()},i.parse=function(t){var e;if(t.jalali&&"string"==typeof t.date&&/.*[^Z]$/i.test(t.date)&&(e=t.date.match(h))){var n=a(d.toGregorian(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||1,10)),3),i=n[0],r=n[1],s=n[2];t.date="".concat(i,"-").concat(r,"-").concat(s).concat(e[4]||"")}return o.bind(this)(t)},i.InitJalali=function(){var t=a(d.toJalaali(this.$y,this.$M+1,this.$D),3),e=t[0],n=t[1],i=t[2];this.$jy=e,this.$jM=n-1,this.$jD=i},i.startOf=function(t,e){var i=this;if(!this.isJalali())return c.bind(this)(t,e);var s=!!r.isUndefined(e)||e,o=r.prettyUnit(t),l=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.$jy,r=a(d.toGregorian(n,e+1,t),3),o=r[0],l=r[1],c=r[2],u=w(new Date(o,l-1,c),i);return s?u:u.endOf(v)},u=(this.$W+(7-n.$fdow))%7;switch(o){case y:return s?l(1,0):l(0,0,this.$jy+1);case p:return s?l(1,this.$jM):l(0,this.$jM+1);case"week":return l(s?this.$jD-u:this.$jD+(6-u),this.$jM);default:return c.bind(this)(t,e)}},i.$set=function(t,e){var n=this;if(!this.isJalali())return u.bind(this)(t,e);var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.$jy,r=a(d.toGregorian(i,e+1,t),3),s=r[0],o=r[1],l=r[2];return n.$d.setDate(l),n.$d.setMonth(o-1),n.$d.setFullYear(s),n};switch(r.prettyUnit(t)){case"date":i(e,this.$jM);break;case p:i(this.$jD,e);break;case y:i(this.$jD,this.$jM,e);break;default:return u.bind(this)(t,e)}return this.init(),this},i.add=function(t,e){var n=this;if(!this.isJalali())return $.bind(this)(t,e);t=Number(t);var i=!e||1!==e.length&&"ms"!==e?r.prettyUnit(e):e,a=function(e,i){var a=n.set("date",1).set(e,i+t);return a.set("date",Math.min(n.$jD,a.daysInMonth()))};if(["M",p].indexOf(i)>-1)return a(p,this.$jM);if(["y",y].indexOf(i)>-1)return a(y,this.$jy);if(["d",v].indexOf(i)>-1){var s=new Date(this.$d);return s.setDate(s.getDate()+t),w(s,this)}return $.bind(this)(t,e)},i.format=function(t,e){var n=this;if(!this.isJalali())return _.bind(this)(t,e);var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=(e||this.$locale()).jmonths;return i.replace(f,function(t){if(t.indexOf("[")>-1)return t.replace(/\[|\]/g,"");switch(t){case"YY":return String(n.$jy).slice(-2);case"YYYY":return String(n.$jy);case"M":return String(n.$jM+1);case"MM":return r.padStart(n.$jM+1,2,"0");case"MMM":return a[n.$jM].slice(0,3);case"MMMM":return a[n.$jM];case"D":return String(n.$jD);case"DD":return r.padStart(n.$jD,2,"0");default:return _.bind(n)(t,e)}})},i.diff=function(t,e,i){if(!this.isJalali())return M.bind(this)(t,e,i);var a=r.prettyUnit(e),s=n(t),o=r.monthDiff(this,s);switch(a){case y:o/=12;break;case p:break;default:return M.bind(this)(t,e,i)}return i?o:r.absFloor(o)},i.year=function(){return this.isJalali()?this.$jy:g.bind(this)()},i.month=function(){return this.isJalali()?this.$jM:D.bind(this)()},i.date=function(){return this.isJalali()?this.$jD:b.bind(this)()},i.daysInMonth=function(){return this.isJalali()?this.endOf(p).$jD:S.bind(this)()},i.clone=function(){return w(this.toDate(),this)}});"۰".charCodeAt(0),"٠".charCodeAt(0);var $=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="day.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-day",class:[t.data.class,{disabled:t.disabled,selected:t.selected,selectable:t.selectable}],on:{mouseover:function(e){t.$emit("hover",t.date)},mouseout:function(e){t.$emit("blur",t.date)},click:t.onClick}},[n("div",{staticClass:"vuec-day-content"},[t._t("day",[n("div",{staticClass:"vuec-default-day"},[t._v("\n "+t._s(t.date.format("D"))+"\n ")])],{data:t.data,date:t.date})],2),t._v(" "),n("div",{staticClass:"vuec-square-placeholder"})])},staticRenderFns:[]},0,{props:{index:{type:String,required:!0},date:{type:Object,default:null},data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},methods:{onClick:function(){this.selectable&&this.$emit("click",{key:this.index,date:this.date,data:this.data,selected:this.selected,selectable:this.selectable})}}},void 0,!1);var _=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="month.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-month"},[n("div",{staticClass:"vuec-month-name",attrs:{show:t.showTitle}},[n("h2",[t._v(t._s(t.title||t.date.format("MMMM")))])]),t._v(" "),n("div",{staticClass:"vuec-week-nav vuec-7col"},t._l(t.weekDays,function(e,i){return n("div",{key:i,staticClass:"vuec-col"},[n("div",{staticClass:"vuec-week-content"},[t._t("day-of-week",[t._v("\n "+t._s(e)+"\n ")],null,{name:e,index:i,locale:t.locale})],2),t._v(" "),n("div",{staticClass:"vuec-week-placeholder"})])}),0),t._v(" "),n("div",{staticClass:"vuec-month-content"},[n("div",{staticClass:"vuec-month-days vuec-7col"},t._l(t.days,function(e){return n("DayView",{key:e.key,staticClass:"vuec-col",attrs:{index:e.key,data:e.data,date:e.date,title:e.title,"aria-hidden":e.hide,disabled:e.disabled,selectable:!e.disabled&&t.selectable,selected:e.selected},on:{click:function(e){t.$emit("click-day",e)},hover:function(e){t.$emit("hover",e)},blur:function(e){t.$emit("blur",e)}},scopedSlots:t._u([{key:"day",fn:function(e){return[t._t("day",null,null,e)]}}])})}),1),t._v(" "),n("div",{staticClass:"vuec-month-placeholder"})])])},staticRenderFns:[]},0,{components:{DayView:$},props:{date:{type:Object,required:!0},adapter:{type:Function,default:function(){return{}}},selectable:{type:Boolean,default:!1},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selection:{type:Array,default:function(){return[]}},showTitle:{type:Boolean,default:!0},title:{type:String,default:""},dateUnderCursor:{type:Object,default:null}},data:function(){var t,e,n=this.date.startOf("week").day();return{locale:this.date.$locale().name,weekDays:(t=this.date.$locale().weekdays,e=n,t.slice(e,t.length).concat(t.slice(0,e))),days:this.getDaysOfMonthArray(this.date)}},computed:{propsToTriggerRecreateDays:function(){return this.date,this.minDate,this.maxDate,this.selection,this.adapter,Date.now()},propsToTriggerDataReaload:function(){return this.dateUnderCursor,Date.now()}},watch:{propsToTriggerRecreateDays:function(){this.days=this.getDaysOfMonthArray(this.date)},propsToTriggerDataReaload:function(){var t=this;this.days.forEach(function(e){e.data=t.adapter({date:e.date,dayKey:e.key,monthKey:e.date.format("YYYY/MM")})})}},methods:{getDaysOfMonthArray:function(t){for(var e=t.month(),i=t.format("YYYY/MM"),a=t.startOf("Month").startOf("week"),r=t.endOf("Month").endOf("week"),s=[],o=this.minDate?n(this.minDate).startOf("day"):null,l=this.maxDate?n(this.maxDate).endOf("day"):null;a.isBefore(r);){var c=a.format("YYYY/MM/DD");o&&a.isBefore(o)||l&&a.isAfter(l)||a.month()!==e?s.push({key:c,disabled:!0,hide:a.month()!==e,date:n(a),data:this.adapter({date:a,dayKey:c,monthKey:i})||{}}):s.push({key:c,data:this.adapter({date:a,dayKey:c,monthKey:i})||{},date:n(a),selected:-1!==this.selection.indexOf(c)}),a=a.add(1,"days")}return s}}},void 0,!1);var M=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="calendar.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-calendar",class:["vuec-theme-"+t.theme,t.date.$C]},[t.showNavigation?n("div",{staticClass:"vuec-nav",attrs:{"align-v":"center"}},[n("span",{staticClass:"vuec-btn-prev",on:{click:t.previousPage}},[t._t("prev-page",[n("IconArrowRight")])],2),t._v(" "),n("span",{staticClass:"vuec-btn-next",on:{click:t.nextPage}},[t._t("next-page",[n("IconArrowLeft")])],2)]):t._e(),t._v(" "),n("div",{staticClass:"vuec-month-wrapper"},t._l(t.months,function(e,i){return n("VuecMonth",{key:i,attrs:{adapter:t.getDayData,title:e.title,date:e.date,"min-date":t.minDate,"max-date":t.maxDate,selectable:t.selectable,inventory:e.inventory,selection:e.selections,"date-under-cursor":t.dateUnderCursor},on:{"click-day":t.onDayClick,hover:t.onHover,blur:t.onBlur},scopedSlots:t._u([{key:"day-of-week",fn:function(e){var n=e.name,i=e.index,a=e.locale;return[t._t("day-of-week",[t._v("\n "+t._s(n)+"\n ")],null,{name:n,index:i,locale:a})]}},{key:"day",fn:function(e){return[t._t("day",[n("div",{staticClass:"vuec-default-day"},[t._v("\n "+t._s(e.date.format("D"))+"\n ")])],null,e)]}}])})}),1)])},staticRenderFns:[]},0,{components:{VuecMonth:_,IconArrowLeft:function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="arrow-left.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[e("path",{attrs:{d:"M15.41,16.59L10.83,12l4.58-4.59L14,6l-6,6l6,6L15.41,16.59z"}}),this._v(" "),e("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},staticRenderFns:[]},0,{},void 0,!1),IconArrowRight:function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="arrow-right.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[e("path",{attrs:{d:"M8.59,16.59L13.17,12L8.59,7.41L10,6l6,6l-6,6L8.59,16.59z"}}),this._v(" "),e("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},staticRenderFns:[]},0,{},void 0,!1)},props:{theme:{type:String,default:"default"},showPreviousWeeks:{type:Boolean,default:!0},showNavigation:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},date:{type:Object,default:function(){return n()}},visibleMonths:{type:Number,default:1},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selections:{type:Array,default:function(){return[]}},monthTitleFormat:{type:String,default:"MMMM"}},data:function(){return{localDate:this.date,dateUnderCursor:null}},computed:{monthSelections:function(){var t={};return this.selections.forEach(function(e){var i=n(e,"YYYY/MM/DD").format("YYYY/MM");return t[i]=t[i]||[],t[i].push(e),t}),t},months:function(){var t=[],e=n(this.localDate);this.showPreviousWeeks&&e.startOf("Month");for(var i=0;i<this.visibleMonths;){var a=e.format("YYYY/MM");t.push({title:e.format(this.monthTitleFormat),date:n(e),selections:this.monthSelections[a]}),e=e.add(1,"Month").startOf("Month"),i+=1}return t}},watch:{date:function(t){this.localDate=t}},methods:{onHover:function(t){t.isSame(this.dateUnderCursor)||(this.dateUnderCursor=t)},onBlur:function(t){null===t&&(this.dateUnderCursor=null)},getDayData:function(t){var e=t.dayKey,n=t.monthKey;return(this.data[n]||{})[e]||{}},onDayClick:function(t){this.$emit("click-day",t)},previousPage:function(){this.localDate=this.localDate.subtract(this.visibleMonths,"Month").startOf("Month"),this.$emit("previous-page",this.localDate)},nextPage:function(){this.localDate=this.localDate.add(this.visibleMonths,"Month").startOf("Month"),this.$emit("next-page",this.localDate)}}},void 0,!1);function g(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==o.return||o.return()}finally{if(a)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var D=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="select-range.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({},0,{extends:M,props:{value:{type:Array,default:function(){return[]}}},data:function(){return{localSelection:[].concat(this.value)}},computed:{monthSelections:function(){var t={};return this.localSelection.forEach(function(e){var n=e.format("YYYY/MM");t[n]=t[n]||[],t[n].push(e)}),t}},watch:{value:function(t){this.localSelection=t}},methods:{getDayData:function(t){var e=t.dayKey,n=t.monthKey,i=t.date,a=(this.data[n]||{})[e]||{},r=this.localSelection[0]||this.dateUnderCursor,s=this.localSelection[1]||this.dateUnderCursor;return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:this.localSelection.length>0&&i.isSame(r,"day"),end:this.localSelection.length>1&&i.isSame(s,"day"),selected:this.localSelection.length>1&&i.isBetween(r,s,"days","[]"),highlight:this.dateUnderCursor&&1===this.localSelection.length&&i.isBetween(r,this.dateUnderCursor,"days","[]")}})},onHover:function(t){this.dateUnderCursor!==t&&(this.dateUnderCursor=t)},onDayClick:function(t){var e=t.date;0===this.localSelection.length||void 0===this.localSelection[0]?this.$set(this.localSelection,0,e):1!==this.localSelection.length&&(this.localSelection.length=0,this.localSelection.push(e)),e.isAfter(this.localSelection[0],"day")?this.localSelection.push(e):this.$set(this.localSelection,0,e),this.$emit("input",this.localSelection)}}},void 0,void 0);var b=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="range-input.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-range-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:t.showPicker}},[n("div",{staticClass:"input"},[t._v("\n "+t._s(t.formattedDates[0])+"\n ")]),t._v(" "),n("div",{staticClass:"input"},[t._v("\n "+t._s(t.formattedDates[1])+"\n ")])]),t._v(" "),n("Transition",{attrs:{name:"popup-animation"}},[t.visible?n("div",{staticClass:"vuec-popup",class:{mobile:t.mobile},on:{click:t.onClickDelegate}},[t.mobile?n("div",{staticClass:"vuec-popup-header"},[t._t("title",[t._v("\n تاریخ ورود و خروج\n ")]),t._v(" "),n("div",{staticClass:"vuec-popup-close",on:{click:function(e){t.showPicker(!1)}}},[n("IconClose")],1)],2):t._e(),t._v(" "),n("VuecSelectRange",{attrs:{theme:t.theme,value:t.dates,date:t.date,"min-date":t.minDate,"max-date":t.maxDate,"visible-months":2,selectable:!0}})],1):t._e()])],1)},staticRenderFns:[]},0,{components:{VuecSelectRange:D,IconClose:function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="close.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),this._v(" "),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])},staticRenderFns:[]},0,{},void 0,!1)},props:{theme:{type:String,default:"default"},mobile:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},date:{type:Object,default:function(){return n()}},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Array,default:function(){return[]}},open:{type:Boolean,default:!1},format:{type:String,default:"YYYY/MM/DD"}},data:function(){var t=g(this.value,2),e=t[0],i=void 0===e?this.date:e,a=t[1],r=void 0===a?this.date:a;return{visible:this.open,temporaryDisableClickListen:!1,fromDate:i,toDate:r,dates:[n(i),n(r)]}},computed:{formattedDates:function(){var t=this;return this.dates.map(function(e){return e.format(t.format)})}},watch:{open:function(t){this.showPicker(t)}},mounted:function(){this.showPicker(this.open),document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.temporaryDisableClickListen=t,this.visible=t},onClickDelegate:function(t){t.stopPropagation()},onSelectionChange:function(t){this.fromDate=n(t[0]),this.toDate=n(t[t.length-1]),this.$emit("input",[this.fromDate,this.toDate])}}},void 0,!1);var S=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="select-single.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({},0,{extends:M,props:{value:{type:Object,default:null}},data:function(){return{localSelection:this.value?n(this.value):null}},computed:{monthSelections:function(){var t={};if(this.localSelection){var e=this.localSelection.format("YYYY/MM");t[e]=t[e]||[],t[e].push(this.localSelection)}return t}},watch:{value:function(t){this.localSelection=t?n(t):null}},methods:{getDayData:function(t){var e=t.dayKey,n=t.monthKey,i=t.date,a=(this.data[n]||{})[e]||{},r=this.localSelection&&i.isSame(this.localSelection,"day");return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:r,end:r}})},onHover:function(t){this.dateUnderCursor!==t&&(this.dateUnderCursor=t)},onDayClick:function(t){this.localSelection=t.date,this.$emit("input",t)}}},void 0,void 0);var w=function(t,e,n,i,a,r,s,o){const l=("function"==typeof n?n.options:n)||{};return l.__file="single-input.vue",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,a&&(l.functional=!0)),l._scopeId=i,l}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-single-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:t.showPicker}},[n("div",{staticClass:"input"},[t._v("\n "+t._s(t.formattedDate)+"\n ")])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"vuec-popup",on:{click:t.onClickDelegate}},[n("VuecSelectSingle",{attrs:{theme:t.theme,date:t.date,value:t.selection,"visible-months":t.visibleMonths,selectable:!0,"min-date":t.minDate,"max-date":t.maxDate},on:{input:t.onSelectionChange}})],1)])},staticRenderFns:[]},0,{components:{VuecSelectSingle:S},props:{theme:{type:String,default:"default"},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},data:{type:Object,default:function(){return{}}},date:{type:[Object,String],default:void 0},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Object,default:function(){return{}}},open:{type:Boolean,default:!1}},data:function(){return{visible:this.open,temporaryDisableClickListen:!1,selection:void 0}},computed:{formattedDate:function(){return this.selection?this.selection.format("YYYY/MM/DD"):""}},watch:{open:function(t){this.visible=t,this.temporaryDisableClickListen=!0}},mounted:function(){document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){this.temporaryDisableClickListen=!0,this.visible=!0},onClickDelegate:function(t){t.stopPropagation()},onSelectionChange:function(t){var e=t.date;this.selection=n(e),this.$emit("input",this.selection),this.visible=!1}}},void 0,!1);t.dayjs=n,t.VuecCalendar=M,t.VuecDay=$,t.VuecMonth=_,t.VuecRangeInput=b,t.VuecSelectRange=D,t.VuecSingleInput=w,t.VuecSelectSingle=S,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.vueCalendar={})}(this,function(t){"use strict";"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e){return t(e={exports:{}},e.exports),e.exports}var n=e(function(t,e){t.exports=function(){var t="millisecond",e="second",n="minute",i="hour",a="day",r="week",s="month",o="quarter",c="year",u=/^(\d{4})-?(\d{1,2})-?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?.?(\d{1,3})?$/,l=/\[([^\]]+)]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},h={s:d,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),a=n%60;return(e<=0?"+":"-")+d(i,2,"0")+":"+d(a,2,"0")},m:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),i=t.clone().add(n,s),a=e-i<0,r=t.clone().add(n+(a?-1:1),s);return Number(-(n+(e-i)/(a?i-r:r-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(u){return{M:s,y:c,w:r,d:a,h:i,m:n,s:e,ms:t,Q:o}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},f={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},v="en",p={};p[v]=f;var y=function(t){return t instanceof g},m=function(t,e,n){var i;if(!t)return null;if("string"==typeof t)p[t]&&(i=t),e&&(p[t]=e,i=t);else{var a=t.name;p[a]=t,i=a}return n||(v=i),i},$=function(t,e,n){if(y(t))return t.clone();var i=e?"string"==typeof e?{format:e,pl:n}:e:{};return i.date=t,new g(i)},_=h;_.l=m,_.i=y,_.w=function(t,e){return $(t,{locale:e.$L,utc:e.$u})};var g=function(){function d(t){this.$L=this.$L||m(t.locale,null,!0)||v,this.parse(t)}var h=d.prototype;return h.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(u);if(i)return n?new Date(Date.UTC(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)):new Date(i[1],i[2]-1,i[3]||1,i[4]||0,i[5]||0,i[6]||0,i[7]||0)}return new Date(e)}(t),this.init()},h.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},h.$utils=function(){return _},h.isValid=function(){return!("Invalid Date"===this.$d.toString())},h.isSame=function(t,e){var n=$(t);return this.startOf(e)<=n&&n<=this.endOf(e)},h.isAfter=function(t,e){return $(t)<this.startOf(e)},h.isBefore=function(t,e){return this.endOf(e)<$(t)},h.$g=function(t,e,n){return _.u(t)?this[e]:this.set(n,t)},h.year=function(t){return this.$g(t,"$y",c)},h.month=function(t){return this.$g(t,"$M",s)},h.day=function(t){return this.$g(t,"$W",a)},h.date=function(t){return this.$g(t,"$D","date")},h.hour=function(t){return this.$g(t,"$H",i)},h.minute=function(t){return this.$g(t,"$m",n)},h.second=function(t){return this.$g(t,"$s",e)},h.millisecond=function(e){return this.$g(e,"$ms",t)},h.unix=function(){return Math.floor(this.valueOf()/1e3)},h.valueOf=function(){return this.$d.getTime()},h.startOf=function(t,o){var u=this,l=!!_.u(o)||o,d=_.p(t),h=function(t,e){var n=_.w(u.$u?Date.UTC(u.$y,e,t):new Date(u.$y,e,t),u);return l?n:n.endOf(a)},f=function(t,e){return _.w(u.toDate()[t].apply(u.toDate(),(l?[0,0,0,0]:[23,59,59,999]).slice(e)),u)},v=this.$W,p=this.$M,y=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case c:return l?h(1,0):h(31,11);case s:return l?h(1,p):h(0,p+1);case r:var $=this.$locale().weekStart||0,g=(v<$?v+7:v)-$;return h(l?y-g:y+(6-g),p);case a:case"date":return f(m+"Hours",0);case i:return f(m+"Minutes",1);case n:return f(m+"Seconds",2);case e:return f(m+"Milliseconds",3);default:return this.clone()}},h.endOf=function(t){return this.startOf(t,!1)},h.$set=function(r,o){var u,l=_.p(r),d="set"+(this.$u?"UTC":""),h=(u={},u[a]=d+"Date",u.date=d+"Date",u[s]=d+"Month",u[c]=d+"FullYear",u[i]=d+"Hours",u[n]=d+"Minutes",u[e]=d+"Seconds",u[t]=d+"Milliseconds",u)[l],f=l===a?this.$D+(o-this.$W):o;if(l===s||l===c){var v=this.clone().set("date",1);v.$d[h](f),v.init(),this.$d=v.set("date",Math.min(this.$D,v.daysInMonth())).toDate()}else h&&this.$d[h](f);return this.init(),this},h.set=function(t,e){return this.clone().$set(t,e)},h.get=function(t){return this[_.p(t)]()},h.add=function(t,o){var u,l=this;t=Number(t);var d=_.p(o),h=function(e){var n=new Date(l.$d);return n.setDate(n.getDate()+e*t),_.w(n,l)};if(d===s)return this.set(s,this.$M+t);if(d===c)return this.set(c,this.$y+t);if(d===a)return h(1);if(d===r)return h(7);var f=(u={},u[n]=6e4,u[i]=36e5,u[e]=1e3,u)[d]||1,v=this.valueOf()+t*f;return _.w(v,this)},h.subtract=function(t,e){return this.add(-1*t,e)},h.format=function(t){var e=this;if(!this.isValid())return"Invalid Date";var n=t||"YYYY-MM-DDTHH:mm:ssZ",i=_.z(this),a=this.$locale(),r=a.weekdays,s=a.months,o=function(t,e,n,i){return t&&t[e]||n[e].substr(0,i)},c=function(t){return _.s(e.$H%12||12,t,"0")},u={YY:String(this.$y).slice(-2),YYYY:String(this.$y),M:String(this.$M+1),MM:_.s(this.$M+1,2,"0"),MMM:o(a.monthsShort,this.$M,s,3),MMMM:s[this.$M],D:String(this.$D),DD:_.s(this.$D,2,"0"),d:String(this.$W),dd:o(a.weekdaysMin,this.$W,r,2),ddd:o(a.weekdaysShort,this.$W,r,3),dddd:r[this.$W],H:String(this.$H),HH:_.s(this.$H,2,"0"),h:c(1),hh:c(2),a:this.$H<12?"am":"pm",A:this.$H<12?"AM":"PM",m:String(this.$m),mm:_.s(this.$m,2,"0"),s:String(this.$s),ss:_.s(this.$s,2,"0"),SSS:_.s(this.$ms,3,"0"),Z:i};return n.replace(l,function(t,e){return e||u[t]||i.replace(":","")})},h.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},h.diff=function(t,u,l){var d,h=_.p(u),f=$(t),v=6e4*(f.utcOffset()-this.utcOffset()),p=this-f,y=_.m(this,f);return y=(d={},d[c]=y/12,d[s]=y,d[o]=y/3,d[r]=(p-v)/6048e5,d[a]=(p-v)/864e5,d[i]=p/36e5,d[n]=p/6e4,d[e]=p/1e3,d)[h]||p,l?y:_.a(y)},h.daysInMonth=function(){return this.endOf(s).$D},h.$locale=function(){return p[this.$L]},h.locale=function(t,e){if(!t)return this.$L;var n=this.clone();return n.$L=m(t,e,!0),n},h.clone=function(){return _.w(this.toDate(),this)},h.toDate=function(){return new Date(this.$d)},h.toJSON=function(){return this.toISOString()},h.toISOString=function(){return this.$d.toISOString()},h.toString=function(){return this.$d.toUTCString()},d}();return $.prototype=g.prototype,$.extend=function(t,e){return t(e,g,$),$},$.locale=m,$.isDayjs=y,$.unix=function(t){return $(1e3*t)},$.en=p[v],$.Ls=p,$}()}),i=e(function(t,e){t.exports=function(t,e,n){e.prototype.isBetween=function(t,e,i,a){var r=n(t),s=n(e),o="("===(a=a||"()")[0],c=")"===a[1];return(o?this.isAfter(r,i):!this.isBefore(r,i))&&(c?this.isBefore(s,i):!this.isAfter(s,i))||(o?this.isBefore(r,i):!this.isAfter(r,i))&&(c?this.isAfter(s,i):!this.isBefore(s,i))}}});function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==o.return||o.return()}finally{if(a)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var r=Math.floor;function s(t,e){return t-e*r(t/e)}function o(t){return t%4==0&&!(t%100==0&&t%400!=0)}var c=1721425.5;function u(t,e,n){return c-1+365*(t-1)+r((t-1)/4)+-r((t-1)/100)+r((t-1)/400)+r((367*e-362)/12+(e<=2?0:o(t)?-1:-2)+n)}var l=1948320.5;function d(t,e,n){var i,a;return a=474+s(i=t-(t>=0?474:473),2820),n+(e<=7?31*(e-1):30*(e-1)+6)+r((682*a-110)/2816)+365*(a-1)+1029983*r(i/2820)+(l-1)}var h=function(t,e,n){return i=u(t,e,n),c=(i=r(i)+.5)-d(475,1,1),l=r(c/1029983),1029982==(h=s(c,1029983))?f=2820:(v=r(h/366),p=s(h,366),f=r((2134*v+2816*p+2815)/1028522)+v+1),(a=f+2820*l+474)<=0&&a--,[a,o=(y=i-d(a,1,1)+1)<=186?Math.ceil(y/31):Math.ceil((y-6)/30),i-d(a,o,1)+1];var i,a,o,c,l,h,f,v,p,y},f=function(t,e,n){return function(t){var e,n,i,a,l,d,h,f,v,p,y,m;e=r(t-.5)+.5,i=r((n=e-c)/146097),a=s(n,146097),l=r(a/36524),d=s(a,36524),h=r(d/1461),f=s(d,1461),p=400*i+100*l+4*h+(v=r(f/365)),4!=l&&4!=v&&p++,y=e-u(p,1,1),m=e<u(p,3,1)?0:o(p)?1:2;var $=r((12*(y+m)+373)/367);return[p,$,e-u(p,$,1)+1]}(d(t,e,n))},v=/^(\d{4})[-\/]?(\d{1,2})[-\/]?(\d{0,2})(.*)?$/,p=/\[.*?\]|jY{2,4}|jM{1,4}|jD{1,2}|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,y="day",m="month",$="year",_={name:"fa",weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),jmonths:"فروردین_اردیبهشت_خرداد_تیر_مرداد_شهریور_مهر_آبان_آذر_دی_بهمن_اسفند".split("_"),ordinal:function(t){return t},relativeTime:{future:"در %s ثانیهی آتی",past:"%s پیش",s:"چند ثانیه پیش",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};n.extend(i),n.extend(function(t,e,n){var i=e.prototype,r=i.$utils(),s=function(t){return"jalali"===t.$C},o=r.prettyUnit||r.p,c=r.isUndefined||r.u,u=r.padStart||r.s,l=r.monthDiff||r.m,d=r.absFloor||r.a,g=function(t){return function(){var e=t.bind(this).apply(void 0,arguments);return e.$C=this.$C,e.isJalali()&&e.InitJalali(),e}};i.startOf=g(i.startOf),i.endOf=g(i.endOf),i.add=g(i.add),i.subtract=g(i.subtract),i.set=g(i.set);var D=i.parse,b=i.init,M=i.startOf,w=i.$set,S=i.add,C=i.format,k=i.diff,O=i.year,x=i.month,j=i.date,Y=i.daysInMonth,I=i.toArray;n.$C="gregory",n.$fdow=6,n.calendar=function(t){return n.$C=t,n},i.calendar=function(t){var e=this.clone();return e.$C=t,e.isJalali()&&e.InitJalali(),e},i.isJalali=function(){return s(this)},n.en.jmonths="Farvardin_Ordibehesht_Khordaad_Tir_Mordaad_Shahrivar_Mehr_Aabaan_Aazar_Dey_Bahman_Esfand".split("_"),n.locale("fa",_,!0);var R=function(t,e){return n(t,{locale:e.$L,calendar:e.$C})};i.init=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};b.bind(this)(t),this.isJalali()&&this.InitJalali()},i.parse=function(t){var e;if(this.$C=t.calendar||this.$C||n.$C,t.jalali&&"string"==typeof t.date&&/.*[^Z]$/i.test(t.date)&&(e=t.date.match(v))){var i=a(f(parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||1,10)),3),r=i[0],s=i[1],o=i[2];t.date="".concat(r,"-").concat(s,"-").concat(o).concat(e[4]||"")}return D.bind(this)(t)},i.InitJalali=function(){var t=a(h(this.$y,this.$M+1,this.$D),3),e=t[0],n=t[1],i=t[2];this.$jy=e,this.$jM=n-1,this.$jD=i},i.startOf=function(t,e){var i=this;if(!s(this))return M.bind(this)(t,e);var r=!!c(e)||e,u=o(t),l=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.$jy,s=a(f(n,e+1,t),3),o=s[0],c=s[1],u=s[2],l=R(new Date(o,c-1,u),i);return r?l:l.endOf(y)},d=(this.$W+(7-n.$fdow))%7;switch(u){case $:return r?l(1,0):l(0,0,this.$jy+1);case m:return r?l(1,this.$jM):l(0,(this.$jM+1)%12,this.$jy+parseInt((this.$jM+1)/12,10));case"week":return l(r?this.$jD-d:this.$jD+(6-d),this.$jM);default:return M.bind(this)(t,e)}},i.$set=function(t,e){var n=this;if(!s(this))return w.bind(this)(t,e);var i=function(t,e){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:n.$jy,r=a(f(i,e+1,t),3),s=r[0],o=r[1],c=r[2];return n.$d.setDate(c),n.$d.setMonth(o-1),n.$d.setFullYear(s),n};switch(o(t)){case"date":case y:i(e,this.$jM);break;case m:i(this.$jD,e);break;case $:i(this.$jD,this.$jM,e);break;default:return w.bind(this)(t,e)}return this.init(),this},i.add=function(t,e){var n=this;if(!s(this))return S.bind(this)(t,e);t=Number(t);var i=!e||1!==e.length&&"ms"!==e?o(e):e;if(["M",m].indexOf(i)>-1){var a=this.$jM+t,r=a<0?-Math.ceil(-a/12):parseInt(a/12,10);return this.add(r,$).set(m,a-12*r)}if(["y",$].indexOf(i)>-1)return function(e,i){var a=n.set("date",1).set(e,i+t);return a.set("date",Math.min(n.$jD,a.daysInMonth()))}($,this.$jy);if(["d",y].indexOf(i)>-1){var c=new Date(this.$d);return c.setDate(c.getDate()+t),R(c,this)}return S.bind(this)(t,e)},i.format=function(t,e){var n=this;if(!s(this))return C.bind(this)(t,e);var i=t||"YYYY-MM-DDTHH:mm:ssZ",a=(e||this.$locale()).jmonths;return i.replace(p,function(t){if(t.indexOf("[")>-1)return t.replace(/\[|\]/g,"");switch(t){case"YY":return String(n.$jy).slice(-2);case"YYYY":return String(n.$jy);case"M":return String(n.$jM+1);case"MM":return u(n.$jM+1,2,"0");case"MMM":return a[n.$jM].slice(0,3);case"MMMM":return a[n.$jM];case"D":return String(n.$jD);case"DD":return u(n.$jD,2,"0");default:return C.bind(n)(t,e)}})},i.diff=function(t,e,i){if(!s(this))return k.bind(this)(t,e,i);var a=o(e),r=n(t),c=l(this,r);switch(a){case $:c/=12;break;case m:break;default:return k.bind(this)(t,e,i)}return i?c:d(c)},i.year=function(){return s(this)?this.$jy:O.bind(this)()},i.month=function(){return s(this)?this.$jM:x.bind(this)()},i.date=function(){return s(this)?this.$jD:j.bind(this)()},i.daysInMonth=function(){return s(this)?this.endOf(m).$jD:Y.bind(this)()},I&&(i.toArray=function(){return s(this)?[this.$jy,this.$jM,this.$jD,this.$H,this.$m,this.$s,this.$ms]:I.bind(this)()}),i.clone=function(){return R(this.toDate(),this)}});"۰".charCodeAt(0),"٠".charCodeAt(0);var g=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="day.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-day",class:[t.data.class,{disabled:t.disabled,selected:t.selected,selectable:t.selectable}],on:{mouseover:function(e){t.$emit("hover",t.date)},mouseout:function(e){t.$emit("blur",t.date)},click:t.onClick}},[n("div",{staticClass:"vuec-day-content"},[t._t("day",[n("div",{staticClass:"vuec-default-day"},[t._v("\n "+t._s(t.date.format("D"))+"\n ")])],{data:t.data,date:t.date})],2),t._v(" "),n("div",{staticClass:"vuec-square-placeholder"})])},staticRenderFns:[]},0,{props:{index:{type:String,required:!0},date:{type:Object,default:null},data:{type:Object,default:function(){return{}}},disabled:{type:Boolean,default:!1},selected:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},methods:{onClick:function(){this.selectable&&this.$emit("click",{key:this.index,date:this.date,data:this.data,selected:this.selected,selectable:this.selectable})}}},void 0,!1);var D=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="month.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-month"},[n("div",{staticClass:"vuec-month-name",attrs:{show:t.showTitle}},[t._t("month-title",null,{date:t.date})],2),t._v(" "),n("div",{staticClass:"vuec-week-nav vuec-7col"},t._l(t.weekDays,function(e,i){return n("div",{key:i,staticClass:"vuec-col"},[n("div",{staticClass:"vuec-week-content"},[t._t("day-of-week",[t._v("\n "+t._s(e)+"\n ")],null,{name:e,index:i,locale:t.locale})],2),t._v(" "),n("div",{staticClass:"vuec-week-placeholder"})])}),0),t._v(" "),n("div",{staticClass:"vuec-month-content"},[n("div",{staticClass:"vuec-month-days vuec-7col"},t._l(t.days,function(e){return n("DayView",{key:e.key,staticClass:"vuec-col",attrs:{index:e.key,data:e.data,date:e.date,title:e.title,"aria-hidden":e.hide,disabled:e.disabled,selectable:!e.disabled&&t.selectable,selected:e.selected},on:{click:function(e){t.$emit("click-day",e)},hover:function(e){t.$emit("hover",e)},blur:function(e){t.$emit("blur",e)}},scopedSlots:t._u([{key:"day",fn:function(e){return[t._t("day",null,null,e)]}}])})}),1),t._v(" "),n("div",{staticClass:"vuec-month-placeholder"})])])},staticRenderFns:[]},0,{components:{DayView:g},props:{date:{type:Object,required:!0},adapter:{type:Function,default:function(){return{}}},selectable:{type:Boolean,default:!1},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selection:{type:Array,default:function(){return[]}},showTitle:{type:Boolean,default:!0},dateUnderCursor:{type:Object,default:null}},data:function(){var t,e,n=this.date.startOf("week").day();return{locale:this.date.$locale().name,weekDays:(t=this.date.$locale().weekdays,e=n,t.slice(e,t.length).concat(t.slice(0,e))),days:this.getDaysOfMonthArray(this.date)}},computed:{propsToTriggerRecreateDays:function(){return this.date,this.minDate,this.maxDate,this.selection,this.adapter,Date.now()},propsToTriggerDataReaload:function(){return this.dateUnderCursor,Date.now()}},watch:{propsToTriggerRecreateDays:function(){this.days=this.getDaysOfMonthArray(this.date)},propsToTriggerDataReaload:function(){var t=this;this.days.forEach(function(e){e.data=t.adapter({date:e.date,dayKey:e.key,monthKey:e.date.format("YYYY/MM")})})}},methods:{getDaysOfMonthArray:function(t){for(var e=t.month(),i=t.format("YYYY/MM"),a=t.startOf("Month").startOf("week"),r=t.endOf("Month").endOf("week"),s=[],o=this.minDate?n(this.minDate).startOf("day"):null,c=this.maxDate?n(this.maxDate).endOf("day"):null;a.isBefore(r);){var u=a.format("YYYY/MM/DD");o&&a.isBefore(o)||c&&a.isAfter(c)||a.month()!==e?s.push({key:u,disabled:!0,hide:a.month()!==e,date:n(a),data:this.adapter({date:a,dayKey:u,monthKey:i})||{}}):s.push({key:u,data:this.adapter({date:a,dayKey:u,monthKey:i})||{},date:n(a),selected:-1!==this.selection.indexOf(u)}),a=a.add(1,"days")}return s}}},void 0,!1);var b=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="calendar.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-calendar",class:["vuec-theme-"+t.theme,t.date.$C]},[t.showNavigation?n("div",{staticClass:"vuec-nav",attrs:{"align-v":"center"}},[n("span",{staticClass:"vuec-btn-prev",on:{click:t.previousPage}},[t._t("prev-page",[n("IconArrowRight")])],2),t._v(" "),n("span",{staticClass:"vuec-btn-next",on:{click:t.nextPage}},[t._t("next-page",[n("IconArrowLeft")])],2)]):t._e(),t._v(" "),n("div",{staticClass:"vuec-month-wrapper"},t._l(t.months,function(e,i){return n("VuecMonth",{key:i,attrs:{adapter:t.getDayData,date:e.date,"min-date":t.minDate,"max-date":t.maxDate,selectable:t.selectable,inventory:e.inventory,selection:e.selections,"date-under-cursor":t.dateUnderCursor},on:{"click-day":t.onDayClick,hover:t.onHover,blur:t.onBlur},scopedSlots:t._u([{key:"day-of-week",fn:function(e){var n=e.name,i=e.index,a=e.locale;return[t._t("day-of-week",[t._v("\n "+t._s(n)+"\n ")],null,{name:n,index:i,locale:a})]}},{key:"day",fn:function(e){return[t._t("day",[n("div",{staticClass:"vuec-default-day"},[t._v("\n "+t._s(e.date.format("D"))+"\n ")])],null,e)]}},{key:"month-title",fn:function(e){return[t._t("month-title",[n("h2",[t._v(t._s(e.date.format("MMMM")))])],null,e)]}}])})}),1)])},staticRenderFns:[]},0,{components:{VuecMonth:D,IconArrowLeft:function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="arrow-left.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[e("path",{attrs:{d:"M15.41,16.59L10.83,12l4.58-4.59L14,6l-6,6l6,6L15.41,16.59z"}}),this._v(" "),e("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},staticRenderFns:[]},0,{},void 0,!1),IconArrowRight:function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="arrow-right.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{id:"Layer_1",version:"1.1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",width:"24px",height:"24px",viewBox:"0 0 24 24","enable-background":"new 0 0 24 24","xml:space":"preserve"}},[e("path",{attrs:{d:"M8.59,16.59L13.17,12L8.59,7.41L10,6l6,6l-6,6L8.59,16.59z"}}),this._v(" "),e("path",{attrs:{fill:"none",d:"M0,0h24v24H0V0z"}})])},staticRenderFns:[]},0,{},void 0,!1)},props:{theme:{type:String,default:"default"},showPreviousWeeks:{type:Boolean,default:!0},showNavigation:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},date:{type:Object,default:function(){return n()}},visibleMonths:{type:Number,default:1},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},selections:{type:Array,default:function(){return[]}}},data:function(){return{localDate:this.date,dateUnderCursor:null}},computed:{monthSelections:function(){var t={};return this.selections.forEach(function(e){var i=n(e,"YYYY/MM/DD").format("YYYY/MM");return t[i]=t[i]||[],t[i].push(e),t}),t},months:function(){var t=[],e=n(this.localDate);this.showPreviousWeeks&&e.startOf("Month");for(var i=0;i<this.visibleMonths;){var a=e.format("YYYY/MM");t.push({date:n(e),selections:this.monthSelections[a]}),e=e.add(1,"Month").startOf("Month"),i+=1}return t}},watch:{date:function(t){this.localDate=t}},methods:{onHover:function(t){t.isSame(this.dateUnderCursor)||(this.dateUnderCursor=t)},onBlur:function(t){null===t&&(this.dateUnderCursor=null)},getDayData:function(t){var e=t.dayKey,n=t.monthKey;return(this.data[n]||{})[e]||{}},onDayClick:function(t){this.$emit("click-day",t)},previousPage:function(){this.localDate=this.localDate.subtract(this.visibleMonths,"Month").startOf("Month"),this.$emit("previous-page",this.localDate)},nextPage:function(){this.localDate=this.localDate.add(this.visibleMonths,"Month").startOf("Month"),this.$emit("next-page",this.localDate)}}},void 0,!1);function M(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],i=!0,a=!1,r=void 0;try{for(var s,o=t[Symbol.iterator]();!(i=(s=o.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){a=!0,r=t}finally{try{i||null==o.return||o.return()}finally{if(a)throw r}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var w=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="select-range.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({},0,{extends:b,props:{value:{type:Array,default:function(){return[]}}},data:function(){return{localSelection:[].concat(this.value)}},computed:{monthSelections:function(){var t={};return this.localSelection.forEach(function(e){var n=e.format("YYYY/MM");t[n]=t[n]||[],t[n].push(e)}),t}},watch:{value:function(t){this.localSelection=t}},methods:{getDayData:function(t){var e=t.dayKey,n=t.monthKey,i=t.date,a=(this.data[n]||{})[e]||{},r=this.localSelection[0]||this.dateUnderCursor,s=this.localSelection[1]||this.dateUnderCursor;return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:this.localSelection.length>0&&i.isSame(r,"day"),end:this.localSelection.length>1&&i.isSame(s,"day"),selected:this.localSelection.length>1&&i.isBetween(r,s,"days","[]"),highlight:this.dateUnderCursor&&1===this.localSelection.length&&i.isBetween(r,this.dateUnderCursor,"days","[]")}})},onHover:function(t){this.dateUnderCursor!==t&&(this.dateUnderCursor=t)},onDayClick:function(t){var e=t.date;0===this.localSelection.length||void 0===this.localSelection[0]?this.$set(this.localSelection,0,e):1!==this.localSelection.length&&(this.localSelection.length=0,this.localSelection.push(e)),e.isAfter(this.localSelection[0],"day")?this.localSelection.push(e):this.$set(this.localSelection,0,e),this.$emit("input",this.localSelection)}}},void 0,void 0);var S=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="range-input.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-range-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:t.showPicker}},[n("div",{staticClass:"input"},[t._v("\n "+t._s(t.formattedDates[0])+"\n ")]),t._v(" "),n("div",{staticClass:"input"},[t._v("\n "+t._s(t.formattedDates[1])+"\n ")])]),t._v(" "),n("Transition",{attrs:{name:"popup-animation"}},[t.visible?n("div",{staticClass:"vuec-popup",class:{mobile:t.mobile},on:{click:t.onClickDelegate}},[t.mobile?n("div",{staticClass:"vuec-popup-header"},[t._t("title",[t._v("\n تاریخ ورود و خروج\n ")]),t._v(" "),n("div",{staticClass:"vuec-popup-close",on:{click:function(e){t.showPicker(!1)}}},[n("IconClose")],1)],2):t._e(),t._v(" "),n("VuecSelectRange",{attrs:{theme:t.theme,value:t.dates,date:t.date,"min-date":t.minDate,"max-date":t.maxDate,"visible-months":2,selectable:!0}})],1):t._e()])],1)},staticRenderFns:[]},0,{components:{VuecSelectRange:w,IconClose:function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="close.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}}),this._v(" "),e("path",{attrs:{d:"M0 0h24v24H0z",fill:"none"}})])},staticRenderFns:[]},0,{},void 0,!1)},props:{theme:{type:String,default:"default"},mobile:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},date:{type:Object,default:function(){return n()}},data:{type:Object,default:function(){return{}}},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Array,default:function(){return[]}},open:{type:Boolean,default:!1},format:{type:String,default:"YYYY/MM/DD"}},data:function(){var t=M(this.value,2),e=t[0],i=void 0===e?this.date:e,a=t[1],r=void 0===a?this.date:a;return{visible:this.open,temporaryDisableClickListen:!1,fromDate:i,toDate:r,dates:[n(i),n(r)]}},computed:{formattedDates:function(){var t=this;return this.dates.map(function(e){return e.format(t.format)})}},watch:{open:function(t){this.showPicker(t)}},mounted:function(){this.showPicker(this.open),document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.temporaryDisableClickListen=t,this.visible=t},onClickDelegate:function(t){t.stopPropagation()},onSelectionChange:function(t){this.fromDate=n(t[0]),this.toDate=n(t[t.length-1]),this.$emit("input",[this.fromDate,this.toDate])}}},void 0,!1);var C=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="select-single.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({},0,{extends:b,props:{value:{type:Object,default:null}},data:function(){return{localSelection:this.value?n(this.value):null}},computed:{monthSelections:function(){var t={};if(this.localSelection){var e=this.localSelection.format("YYYY/MM");t[e]=t[e]||[],t[e].push(this.localSelection)}return t}},watch:{value:function(t){this.localSelection=t?n(t):null}},methods:{getDayData:function(t){var e=t.dayKey,n=t.monthKey,i=t.date,a=(this.data[n]||{})[e]||{},r=this.localSelection&&i.isSame(this.localSelection,"day");return Object.assign({},a,{class:{hover:this.dateUnderCursor&&i.isSame(this.dateUnderCursor),start:r,end:r}})},onHover:function(t){this.dateUnderCursor!==t&&(this.dateUnderCursor=t)},onDayClick:function(t){this.localSelection=t.date,this.$emit("input",t)}}},void 0,void 0);var k=function(t,e,n,i,a,r,s,o){const c=("function"==typeof n?n.options:n)||{};return c.__file="single-input.vue",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,a&&(c.functional=!0)),c._scopeId=i,c}({render:function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"vuec-single-input"},[n("div",{staticClass:"vuec-date-inputs",on:{click:t.showPicker}},[n("div",{staticClass:"input"},[t._v("\n "+t._s(t.formattedDate)+"\n ")])]),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.visible,expression:"visible"}],staticClass:"vuec-popup",on:{click:t.onClickDelegate}},[n("VuecSelectSingle",{attrs:{theme:t.theme,date:t.date,value:t.selection,"visible-months":t.visibleMonths,selectable:!0,"min-date":t.minDate,"max-date":t.maxDate},on:{input:t.onSelectionChange}})],1)])},staticRenderFns:[]},0,{components:{VuecSelectSingle:C},props:{theme:{type:String,default:"default"},selectable:{type:Boolean,default:!1},selectionMode:{type:String,default:"single"},data:{type:Object,default:function(){return{}}},date:{type:[Object,String],default:void 0},minDate:{type:[Object,String],default:null},maxDate:{type:[Object,String],default:null},visibleMonths:{type:Number,default:1},value:{type:Object,default:function(){return{}}},open:{type:Boolean,default:!1}},data:function(){return{visible:this.open,temporaryDisableClickListen:!1,selection:void 0}},computed:{formattedDate:function(){return this.selection?this.selection.format("YYYY/MM/DD"):""}},watch:{open:function(t){this.visible=t,this.temporaryDisableClickListen=!0}},mounted:function(){document.body.addEventListener("click",this.handleBodyClick)},beforeDestroy:function(){document.body.removeEventListener("click",this.handleBodyClick)},methods:{handleBodyClick:function(){this.visible&&!this.temporaryDisableClickListen&&(this.visible=!1,this.$emit("hide")),this.temporaryDisableClickListen=!1},showPicker:function(){this.temporaryDisableClickListen=!0,this.visible=!0},onClickDelegate:function(t){t.stopPropagation()},onSelectionChange:function(t){var e=t.date;this.selection=n(e),this.$emit("input",this.selection),this.visible=!1}}},void 0,!1);t.dayjs=n,t.VuecCalendar=b,t.VuecDay=g,t.VuecMonth=D,t.VuecRangeInput=S,t.VuecSelectRange=w,t.VuecSingleInput=k,t.VuecSelectSingle=C,Object.defineProperty(t,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=vue-calendar.min.js.map |
{ | ||
"name": "@alibaba-aero/vue-calendar", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "Vue Calendar", | ||
@@ -22,4 +22,4 @@ "main": "dist/vue-calendar.cjs.min.js", | ||
"dependencies": { | ||
"dayjs": "^1.7.7", | ||
"jalaliday": "^2.0.1" | ||
"dayjs": "^1.8.12", | ||
"jalaliday": "^2.2.2" | ||
}, | ||
@@ -26,0 +26,0 @@ "devDependencies": { |
@@ -41,3 +41,3 @@ # Vue Calendar | ||
- `open`: Boolean - false | ||
- `format`: String - jYYYY/jM/jD | ||
- `format`: String - YYYY/M/D | ||
@@ -44,0 +44,0 @@ ### calendar |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
222905
1459
Updateddayjs@^1.8.12
Updatedjalaliday@^2.2.2