@progress/kendo-vue-scheduler 6.4.0-develop.2 → 6.4.0-develop.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/Scheduler.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),t=require("./utils/main.js"),r=require("@progress/kendo-vue-common"),P=require("./components/header/SchedulerHeader.js"),f=require("@progress/kendo-vue-intl"),x=require("./components/header/navigation/SchedulerNavigation.js"),c=require("@progress/kendo-date-math"),O=require("./components/footer/SchedulerFooter.js"),E=require("@progress/kendo-vue-buttons"),A=require("./components/header/navigation/NavigationDatePicker.js"),T=require("./components/header/view-selector/ViewSelectorList.js"),H=require("./components/footer/bussiness-hours/BusinessHours.js"),w=require("./package-metadata.js"),W=require("./views/agenda/AgendaView.js"),M=require("./views/time/TimelineView.js"),u=require("./views/day/DayView.js"),q=require("./views/week/WeekView.js"),j=require("./views/week/WorkWeekView.js"),z=require("./views/month/MonthView.js"),m=require("./constants/main.js"),L=require("./hooks/useEditable.js"),V="{0:D}",D="{0:d}",B=n.defineComponent({name:"KendoScheduler",emits:["datechange","viewchange","datachange","itemclick","itemdoubleclick","slotclick","slotdoubleclick","taskclick","taskdoubleclick"],props:{dataItems:{type:Array,default:function(){return[]}},views:{type:Array,default:function(){return[]}},view:String,defaultView:String,date:Date,rtl:Boolean,height:{type:[Number,String],default:600},timezone:String,group:Object,resources:[Object,Array],modelFields:Object,tabIndex:{type:Number,default:-1},editable:{type:[Boolean,Object],default:!1},defaultDate:{type:Date,default:function(){return new Date}},validator:{type:Function,default:()=>({})},modifyInitialFormValues:{type:Function,default:e=>e},header:[String,Function,Object],footer:[String,Function,Object],slotRender:[String,Function,Object],viewSlot:[String,Function,Object],item:[String,Function,Object],viewItem:[String,Function,Object],task:[String,Function,Object],form:[String,Function,Object],resizeHint:[String,Function,Object],dialogProps:Object,formProps:Object,dateHeaderCell:[String,Function,Object],timeHeaderCell:[String,Function,Object]},computed:{isRtl(){return this.$props.rtl!==void 0?this.$props.rtl:this.currentRtl},wrapperClassName(){return{"k-rtl":this.isRtl,"k-scheduler":!0}},fields(){return t.getModelFields(this.$props.modelFields).fields}},mounted(){this.currentRtl=r.isRtl(this.$el)},provide(){return{ks:this.ks,setActiveViewName:this.handleActiveViewNameChange,setActiveDate:this.handleDateChange,itemDoubleClick:this.handleItemDoubleClick,itemClick:this.handleItemClick,slotDoubleClick:this.handleSlotDoubleClick,slotClick:this.handleSlotClick,taskDoubleClick:this.handleTaskDoubleClick,taskClick:this.handleTaskClick,ksValidator:this.validator,ksModifyInitialFormValues:this.modifyInitialFormValues}},inject:{kendoLocalizationService:{default:null},kendoIntlService:{default:null}},data(){const e=f.provideIntlService(this),s=this.$props.date||this.$props.defaultDate,a=this.$props.view||this.$props.defaultView||this.views[0]&&this.views[0].name||"day",i=this.views.find(h=>h.name===a)||this.views[0]||n.createVNode(u.DayView,null,null),l=this.getViewPropValue(i,"selectedDateFormat",a)||V,o=this.getViewPropValue(i,"selectedShortDateFormat",a)||D,d=this.getViewComponentByName(a).props.dateRange.default()({intl:e,date:s,timezone:this.$props.timezone,numberOfDays:this.getViewPropValue(i,"numberOfDays",a),workWeekStart:this.getViewPropValue(i,"workWeekStart",a)||e.firstDay(),workWeekEnd:this.getViewPropValue(i,"workWeekEnd",a)||(e.firstDay()+this.getViewPropValue(i,"numberOfDays",a))%6});return{ks:{activeViewName:a,currentDate:s,showWorkHours:i.showWorkHours!==void 0?i.showWorkHours:!0,timezone:this.$props.timezone,props:{...this.$props},views:this.views,view:i,fields:t.getModelFields(this.$props.modelFields).fields,groups:t.toSchedulerGroups(this.$props.group,this.$props.resources),dateRange:d,orientation:this.$props.group&&this.$props.group.orientation?this.$props.group.orientation:"horizontal",dateFormat:l,shortDateFormat:o,scheduler:this,dataItems:this.dataItems}}},watch:{isRtl(e){this.ks.isRtl=e},view(e){this.updatePassedState(e)},date(e){this.ks.currentDate=e,this.updatePassedState()},timezone(e){this.ks.timezone=e,this.updatePassedState()},dataItems(e){this.ks.dataItems=e}},render(){r.validatePackage(w.packageMetadata),this.showLicenseWatermark=r.shouldShowValidationUI(w.packageMetadata),this.$props;const e=this.views.find(N=>N.name===this.ks.activeViewName)||this.views[0]||n.createVNode(u.DayView,null,null),s=this.getViewPropValue(this.ks.view,"slotDuration",this.ks.activeViewName),a=r.templateRendering.call(this,e.header||this.$props.header,r.getListeners.call(this)),i=r.templateRendering.call(this,e.footer||this.$props.footer,r.getListeners.call(this)),l=r.templateRendering.call(this,e.slot||this.$props.slotRender,{}),o=r.templateRendering.call(this,e.viewSlot||this.$props.viewSlot,{}),d=r.templateRendering.call(this,e.item||this.$props.item,{}),h=r.templateRendering.call(this,e.viewItem||this.$props.viewItem,{}),p=r.templateRendering.call(this,e.task||this.$props.task,{}),v=r.templateRendering.call(this,e.dateHeaderCell||this.$props.dateHeaderCell,{}),F=r.templateRendering.call(this,e.timeHeaderCell||this.$props.timeHeaderCell,{}),C=r.templateRendering.call(this,e.resizeHint||this.$props.resizeHint,{});this.ks.form=r.templateRendering.call(this,e.form||this.$props.form,{}),this.ks.dialogProps=e.dialogProps||this.$props.dialogProps,this.ks.formProps=e.formProps||this.$props.formProps;const S=L.useEditable(e.editable!==void 0?e.editable:this.$props.editable),b=this.getViewComponentByName(this.ks.activeViewName||e.name),I={...this.$props,...this.ks.view,showWorkHours:this.ks.showWorkHours,dataItems:void 0,views:void 0,defaultDate:void 0,dateRange:this.ks.dateRange,slotRender:l,viewSlot:o,item:d,viewItem:h,task:p,dateHeaderCell:v,timeHeaderCell:F,resizeHint:C,editable:S};let k;const R=n.createVNode(P.SchedulerHeader,null,{default:()=>[n.createVNode(x.SchedulerNavigation,{isRtl:this.isRtl,onPrevclick:this.handlePrevClick,onNextclick:this.handleNextClick,onTodayclick:this.handleTodayClick},null),n.createVNode(A.NavigationDatePicker,{value:this.ks.currentDate,onChange:this.handleDatePickerChange},null),n.createVNode(E.ToolbarSpacer,null,null),n.createVNode(T.ViewSelectorList,null,null)]});k=r.getTemplate.call(this,{h:n.h,template:a,defaultRendering:R,additionalProps:{currentDate:this.ks.currentDate},additionalListeners:{prevclick:this.handlePrevClick,nextclick:this.handleNextClick,todayclick:this.handleTodayClick,datepickerchange:this.handleDatePickerChange}});let g;const y=n.createVNode(O.SchedulerFooter,null,{default:()=>[n.createVNode(H.BusinessHours,{slotDuration:s,onClick:this.handleShowWorkHoursClick},null)]});g=r.getTemplate.call(this,{h:n.h,template:i,defaultRendering:y,additionalProps:{slotDuration:s},additionalListeners:{showworkhoursclick:this.handleShowWorkHoursClick}});const $=this.showLicenseWatermark?n.createVNode(r.WatermarkOverlay,null,null):null;return n.createVNode("div",{id:this.$props.id,style:{height:this.$props.height+"px"},class:this.wrapperClassName,tabindex:this.$props.tabIndex,dir:this.isRtl&&"rtl",role:this.$props.role||"application","aria-label":this.$props.ariaLabel,"aria-labelledby":this.$props.ariaLabelledby,onFocusin:this.handleFocus,onFocusout:this.handleBlur},[k,n.h(b,{key:this.ks.view.name,onDataaction:this.handleDataAction,...I}),g,$])},methods:{getViewComponentByName(e){switch(e.toLowerCase()){case"week":return q.WeekView;case"workweek":return j.WorkWeekView;case"agenda":return W.AgendaView;case"timeline":return M.TimelineView;case"month":return z.MonthView;default:return u.DayView}},getViewPropValue(e,s,a){const i=this.getViewComponentByName(a).props[s];return e[s]||(i?i.default:void 0)},handleDataChange({created:e=[],updated:s=[],deleted:a=[]}){const i={created:e,updated:s,deleted:a};this.$emit("datachange",i)},handleCreate(e){const s=[e.dataItem];this.handleDataChange({created:s})},handleUpdate(e){const s=[],a=[];if(e.series)if(Array.isArray(e.dataItem))e.dataItem.map(i=>{const l=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),o=r.clone(i);t.setField(o,this.fields.originalStart,t.getField(l,this.fields.originalStart)),t.setField(o,this.fields.recurrenceId,t.getField(l,this.fields.recurrenceId)),t.setField(o,this.fields.recurrenceExceptions,t.getField(l,this.fields.recurrenceExceptions)),a.push(o)});else{const i=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),l=r.clone(e.dataItem);t.setField(l,this.fields.originalStart,t.getField(i,this.fields.originalStart)),t.setField(l,this.fields.recurrenceId,t.getField(i,this.fields.recurrenceId)),t.setField(l,this.fields.recurrenceExceptions,t.getField(i,this.fields.recurrenceExceptions)),a.push(l)}else if(Array.isArray(e.dataItem))e.dataItem.map(i=>{const l=t.getField(i,this.fields.recurrenceRule)!==null&&t.getField(i,this.fields.recurrenceRule)!==void 0;if(t.getField(i,this.fields.recurrenceId)!==null&&t.getField(i,this.fields.recurrenceId)!==void 0&&l){const d=r.clone(t.findMaster(i,this.fields,this.dataItems)),h=t.getField(i,this.fields.originalStart),p=t.getField(d,this.fields.recurrenceExceptions)||[];t.setField(d,this.fields.recurrenceExceptions,[...p,h]),t.setField(i,this.fields.recurrenceRule,null),a.push(d),s.push(i)}else a.push(i)});else{const i=t.getField(e.dataItem,this.fields.recurrenceRule)!==null&&t.getField(e.dataItem,this.fields.recurrenceRule)!==void 0;if(t.getField(e.dataItem,this.fields.recurrenceId)!==null&&t.getField(e.dataItem,this.fields.recurrenceId)!==void 0&&i){const o=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),d=t.getField(e.dataItem,this.fields.originalStart),h=t.getField(o,this.fields.recurrenceExceptions)||[];t.setField(o,this.fields.recurrenceExceptions,[...h,d]),t.setField(e.dataItem,this.fields.recurrenceRule,null),a.push(o),s.push(e.dataItem)}else a.push(e.dataItem)}this.handleDataChange({updated:a,created:s})},handleRemove(e){const s=[],a=[];if(e.series){const i=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),l=r.clone(e.dataItem);t.setField(l,this.fields.originalStart,t.getField(i,this.fields.originalStart)),t.setField(l,this.fields.recurrenceId,t.getField(i,this.fields.recurrenceId)),t.setField(l,this.fields.recurrenceRule,t.getField(i,this.fields.recurrenceRule)),t.setField(l,this.fields.recurrenceExceptions,t.getField(i,this.fields.recurrenceExceptions)),a.push(l)}else if(!(t.getField(e.dataItem,this.fields.recurrenceRule)!==null&&t.getField(e.dataItem,this.fields.recurrenceRule)!==void 0))a.push(e.dataItem);else{const l=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),o=t.getField(e.dataItem,this.fields.originalStart),d=t.getField(l,this.fields.recurrenceExceptions)||[];t.setField(l,this.fields.recurrenceExceptions,[...d,o]),t.setField(e.dataItem,this.fields.recurrenceRule,null),s.push(l)}this.handleDataChange({updated:s,deleted:a})},handleDataAction(e){switch(e.type){case m.DATA_ACTION.create:this.handleCreate(e);break;case m.DATA_ACTION.update:this.handleUpdate(e);break;case m.DATA_ACTION.remove:this.handleRemove(e);break}},handleActiveViewNameChange(e,s){this.updatePassedState(e),this.$emit("viewchange",{viewName:e,...s,target:this.ks.scheduler.$el})},handleDateChange(e,s){this.setDate(e,{...s,target:this.ks.scheduler.$el})},handleDatePickerChange(e){e.value&&this.setDate(e.value,{...e,target:this.ks.scheduler.$el,nativeEvent:e.event})},handleNextClick(e){e.preventDefault();const s=this.getViewPropValue(this.ks.view,"step",this.ks.activeViewName)||this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName)||1,i=s>27?c.addMonths(this.ks.currentDate,Math.round(s/27)):c.addDays(this.ks.currentDate,s);this.setDate(i,e)},handlePrevClick(e){e.preventDefault();const s=this.getViewPropValue(this.ks.view,"step",this.ks.activeViewName)||this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName)||1,i=s>27?c.addMonths(this.ks.currentDate,-Math.round(s/27)):c.addDays(this.ks.currentDate,-s);this.setDate(i,e)},handleTodayClick(e){e.preventDefault();const s=t.getToday();this.setDate(s,e)},handleShowWorkHoursClick(){this.ks.showWorkHours=!this.ks.showWorkHours},handleFocus(){this.$el&&(this.$el.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")},handleBlur(){this.$el&&(this.$el.style.boxShadow="")},handleItemClick(e){this.$emit("itemclick",e)},handleItemDoubleClick(e){this.$emit("itemdoubleclick",e)},handleSlotClick(e){this.$emit("slotclick",e)},handleSlotDoubleClick(e){this.$emit("slotdoubleclick",e)},handleTaskClick(e){this.$emit("taskclick",e)},handleTaskDoubleClick(e){this.$emit("taskdoubleclick",e)},setDate(e,s){this.ks.currentDate=e,this.updatePassedState(),this.$emit("datechange",{date:e,event:s})},updatePassedState(e){const s=f.provideIntlService(this),a=e||this.ks.activeViewName;this.ks.activeViewName=a,this.ks.view=this.views.find(i=>i.name===a)||this.views[0]||n.createVNode(u.DayView,null,null),this.ks.dateFormat=this.getViewPropValue(this.ks.view,"selectedDateFormat",a)||V,this.ks.shortDateFormat=this.getViewPropValue(this.ks.view,"selectedShortDateFormat",a)||D,this.ks.dateRange=this.getViewComponentByName(a).props.dateRange.default()({intl:s,date:this.ks.currentDate,timezone:this.$props.timezone,numberOfDays:this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName),workWeekStart:this.getViewPropValue(this.ks.view,"workWeekStart",this.ks.activeViewName)||s.firstDay(),workWeekEnd:this.getViewPropValue(this.ks.view,"workWeekEnd",this.ks.activeViewName)||(s.firstDay()+this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName))%6})}}});exports.Scheduler=B;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),t=require("./utils/main.js"),r=require("@progress/kendo-vue-common"),P=require("./components/header/SchedulerHeader.js"),k=require("@progress/kendo-vue-intl"),x=require("./components/header/navigation/SchedulerNavigation.js"),h=require("@progress/kendo-date-math"),O=require("./components/footer/SchedulerFooter.js"),E=require("@progress/kendo-vue-buttons"),A=require("./components/header/navigation/NavigationDatePicker.js"),T=require("./components/header/view-selector/ViewSelectorList.js"),H=require("./components/footer/bussiness-hours/BusinessHours.js"),g=require("./package-metadata.js"),W=require("./views/agenda/AgendaView.js"),M=require("./views/time/TimelineView.js"),u=require("./views/day/DayView.js"),q=require("./views/week/WeekView.js"),j=require("./views/week/WorkWeekView.js"),z=require("./views/month/MonthView.js"),m=require("./constants/main.js"),L=require("./hooks/useEditable.js"),f="{0:D}",w="{0:d}",B=n.defineComponent({name:"KendoScheduler",emits:["datechange","viewchange","datachange","itemclick","itemdoubleclick","slotclick","slotdoubleclick","taskclick","taskdoubleclick"],props:{dataItems:{type:Array,default:function(){return[]}},views:{type:Array,default:function(){return[]}},view:String,defaultView:String,date:Date,rtl:Boolean,height:{type:[Number,String],default:600},timezone:String,group:Object,resources:[Object,Array],modelFields:Object,tabIndex:{type:Number,default:-1},editable:{type:[Boolean,Object],default:!1},defaultDate:{type:Date,default:function(){return new Date}},validator:{type:Function,default:()=>({})},modifyInitialFormValues:{type:Function,default:e=>e},header:[String,Function,Object],footer:[String,Function,Object],slotRender:[String,Function,Object],viewSlot:[String,Function,Object],item:[String,Function,Object],viewItem:[String,Function,Object],task:[String,Function,Object],form:[String,Function,Object],resizeHint:[String,Function,Object],dialogProps:Object,formProps:Object,dateHeaderCell:[String,Function,Object],timeHeaderCell:[String,Function,Object]},computed:{isRtl(){return this.$props.rtl!==void 0?this.$props.rtl:this.currentRtl},wrapperClassName(){return{"k-rtl":this.isRtl,"k-scheduler":!0}},fields(){return t.getModelFields(this.$props.modelFields).fields}},mounted(){this.currentRtl=r.isRtl(this.$el)},provide(){return{ks:this.ks,setActiveViewName:this.handleActiveViewNameChange,setActiveDate:this.handleDateChange,itemDoubleClick:this.handleItemDoubleClick,itemClick:this.handleItemClick,slotDoubleClick:this.handleSlotDoubleClick,slotClick:this.handleSlotClick,taskDoubleClick:this.handleTaskDoubleClick,taskClick:this.handleTaskClick,ksValidator:this.validator,ksModifyInitialFormValues:this.modifyInitialFormValues}},inject:{kendoLocalizationService:{default:null},kendoIntlService:{default:null}},data(){const e=k.provideIntlService(this),s=this.$props.date||this.$props.defaultDate,a=this.$props.view||this.$props.defaultView||this.views[0]&&this.views[0].name||"day",i=this.views.find(c=>c.name===a)||this.views[0]||n.createVNode(u.DayView,null,null),l=this.getViewPropValue(i,"selectedDateFormat",a)||f,o=this.getViewPropValue(i,"selectedShortDateFormat",a)||w,d=this.getViewComponentByName(a).props.dateRange.default()({intl:e,date:s,timezone:this.$props.timezone,numberOfDays:this.getViewPropValue(i,"numberOfDays",a),workWeekStart:this.getViewPropValue(i,"workWeekStart",a)||e.firstDay(),workWeekEnd:this.getViewPropValue(i,"workWeekEnd",a)||(e.firstDay()+this.getViewPropValue(i,"numberOfDays",a))%6});return{ks:{activeViewName:a,currentDate:s,showWorkHours:i.showWorkHours!==void 0?i.showWorkHours:!0,timezone:this.$props.timezone,props:{...this.$props},views:this.views,view:i,fields:t.getModelFields(this.$props.modelFields).fields,groups:t.toSchedulerGroups(this.$props.group,this.$props.resources),dateRange:d,orientation:this.$props.group&&this.$props.group.orientation?this.$props.group.orientation:"horizontal",dateFormat:l,shortDateFormat:o,scheduler:this,dataItems:this.dataItems}}},watch:{isRtl(e){this.ks.isRtl=e},view(e){this.updatePassedState(e)},date(e){this.ks.currentDate=e,this.updatePassedState()},timezone(e){this.ks.timezone=e,this.updatePassedState()},dataItems(e){this.ks.dataItems=e}},render(){r.validatePackage(g.packageMetadata),this.showLicenseWatermark=r.shouldShowValidationUI(g.packageMetadata);const e=this.views.find(N=>N.name===this.ks.activeViewName)||this.views[0]||n.createVNode(u.DayView,null,null),s=this.getViewPropValue(this.ks.view,"slotDuration",this.ks.activeViewName),a=r.templateRendering.call(this,e.header||this.$props.header,r.getListeners.call(this)),i=r.templateRendering.call(this,e.footer||this.$props.footer,r.getListeners.call(this)),l=r.templateRendering.call(this,e.slot||this.$props.slotRender,{}),o=r.templateRendering.call(this,e.viewSlot||this.$props.viewSlot,{}),d=r.templateRendering.call(this,e.item||this.$props.item,{}),c=r.templateRendering.call(this,e.viewItem||this.$props.viewItem,{}),p=r.templateRendering.call(this,e.task||this.$props.task,{}),V=r.templateRendering.call(this,e.dateHeaderCell||this.$props.dateHeaderCell,{}),D=r.templateRendering.call(this,e.timeHeaderCell||this.$props.timeHeaderCell,{}),v=r.templateRendering.call(this,e.resizeHint||this.$props.resizeHint,{});this.ks.form=r.templateRendering.call(this,e.form||this.$props.form,{}),this.ks.dialogProps=e.dialogProps||this.$props.dialogProps,this.ks.formProps=e.formProps||this.$props.formProps;const F=L.useEditable(e.editable!==void 0?e.editable:this.$props.editable),C=this.getViewComponentByName(this.ks.activeViewName||e.name),S={...this.$props,...this.ks.view,showWorkHours:this.ks.showWorkHours,dataItems:void 0,views:void 0,defaultDate:void 0,dateRange:this.ks.dateRange,slotRender:l,viewSlot:o,item:d,viewItem:c,task:p,dateHeaderCell:V,timeHeaderCell:D,resizeHint:v,editable:F},b=n.createVNode(P.SchedulerHeader,null,{default:()=>[n.createVNode(x.SchedulerNavigation,{isRtl:this.isRtl,onPrevclick:this.handlePrevClick,onNextclick:this.handleNextClick,onTodayclick:this.handleTodayClick},null),n.createVNode(A.NavigationDatePicker,{value:this.ks.currentDate,onChange:this.handleDatePickerChange},null),n.createVNode(E.ToolbarSpacer,null,null),n.createVNode(T.ViewSelectorList,null,null)]}),I=r.getTemplate.call(this,{h:n.h,template:a,defaultRendering:b,additionalProps:{currentDate:this.ks.currentDate},additionalListeners:{prevclick:this.handlePrevClick,nextclick:this.handleNextClick,todayclick:this.handleTodayClick,datepickerchange:this.handleDatePickerChange}}),R=n.createVNode(O.SchedulerFooter,null,{default:()=>[n.createVNode(H.BusinessHours,{slotDuration:s,onClick:this.handleShowWorkHoursClick},null)]}),y=r.getTemplate.call(this,{h:n.h,template:i,defaultRendering:R,additionalProps:{slotDuration:s},additionalListeners:{showworkhoursclick:this.handleShowWorkHoursClick}}),$=this.showLicenseWatermark?n.createVNode(r.WatermarkOverlay,null,null):null;return n.createVNode("div",{id:this.$props.id,style:{height:this.$props.height+"px"},class:this.wrapperClassName,tabindex:this.$props.tabIndex,dir:this.isRtl&&"rtl",role:this.$props.role||"application","aria-label":this.$props.ariaLabel,"aria-labelledby":this.$props.ariaLabelledby,onFocusin:this.handleFocus,onFocusout:this.handleBlur},[I,n.h(C,{key:this.ks.view.name,onDataaction:this.handleDataAction,...S}),y,$])},methods:{getViewComponentByName(e){switch(e.toLowerCase()){case"week":return q.WeekView;case"workweek":return j.WorkWeekView;case"agenda":return W.AgendaView;case"timeline":return M.TimelineView;case"month":return z.MonthView;default:return u.DayView}},getViewPropValue(e,s,a){const i=this.getViewComponentByName(a).props[s];return e[s]||(i?i.default:void 0)},handleDataChange({created:e=[],updated:s=[],deleted:a=[]}){const i={created:e,updated:s,deleted:a};this.$emit("datachange",i)},handleCreate(e){const s=[e.dataItem];this.handleDataChange({created:s})},handleUpdate(e){const s=[],a=[];if(e.series)if(Array.isArray(e.dataItem))e.dataItem.map(i=>{const l=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),o=r.clone(i);t.setField(o,this.fields.originalStart,t.getField(l,this.fields.originalStart)),t.setField(o,this.fields.recurrenceId,t.getField(l,this.fields.recurrenceId)),t.setField(o,this.fields.recurrenceExceptions,t.getField(l,this.fields.recurrenceExceptions)),a.push(o)});else{const i=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),l=r.clone(e.dataItem);t.setField(l,this.fields.originalStart,t.getField(i,this.fields.originalStart)),t.setField(l,this.fields.recurrenceId,t.getField(i,this.fields.recurrenceId)),t.setField(l,this.fields.recurrenceExceptions,t.getField(i,this.fields.recurrenceExceptions)),a.push(l)}else if(Array.isArray(e.dataItem))e.dataItem.map(i=>{const l=t.getField(i,this.fields.recurrenceRule)!==null&&t.getField(i,this.fields.recurrenceRule)!==void 0;if(t.getField(i,this.fields.recurrenceId)!==null&&t.getField(i,this.fields.recurrenceId)!==void 0&&l){const d=r.clone(t.findMaster(i,this.fields,this.dataItems)),c=t.getField(i,this.fields.originalStart),p=t.getField(d,this.fields.recurrenceExceptions)||[];t.setField(d,this.fields.recurrenceExceptions,[...p,c]),t.setField(i,this.fields.recurrenceRule,null),a.push(d),s.push(i)}else a.push(i)});else{const i=t.getField(e.dataItem,this.fields.recurrenceRule)!==null&&t.getField(e.dataItem,this.fields.recurrenceRule)!==void 0;if(t.getField(e.dataItem,this.fields.recurrenceId)!==null&&t.getField(e.dataItem,this.fields.recurrenceId)!==void 0&&i){const o=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),d=t.getField(e.dataItem,this.fields.originalStart),c=t.getField(o,this.fields.recurrenceExceptions)||[];t.setField(o,this.fields.recurrenceExceptions,[...c,d]),t.setField(e.dataItem,this.fields.recurrenceRule,null),a.push(o),s.push(e.dataItem)}else a.push(e.dataItem)}this.handleDataChange({updated:a,created:s})},handleRemove(e){const s=[],a=[];if(e.series){const i=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),l=r.clone(e.dataItem);t.setField(l,this.fields.originalStart,t.getField(i,this.fields.originalStart)),t.setField(l,this.fields.recurrenceId,t.getField(i,this.fields.recurrenceId)),t.setField(l,this.fields.recurrenceRule,t.getField(i,this.fields.recurrenceRule)),t.setField(l,this.fields.recurrenceExceptions,t.getField(i,this.fields.recurrenceExceptions)),a.push(l)}else if(!(t.getField(e.dataItem,this.fields.recurrenceRule)!==null&&t.getField(e.dataItem,this.fields.recurrenceRule)!==void 0))a.push(e.dataItem);else{const l=r.clone(t.findMaster(e.dataItem,this.fields,this.dataItems)),o=t.getField(e.dataItem,this.fields.originalStart),d=t.getField(l,this.fields.recurrenceExceptions)||[];t.setField(l,this.fields.recurrenceExceptions,[...d,o]),t.setField(e.dataItem,this.fields.recurrenceRule,null),s.push(l)}this.handleDataChange({updated:s,deleted:a})},handleDataAction(e){switch(e.type){case m.DATA_ACTION.create:this.handleCreate(e);break;case m.DATA_ACTION.update:this.handleUpdate(e);break;case m.DATA_ACTION.remove:this.handleRemove(e);break}},handleActiveViewNameChange(e,s){this.updatePassedState(e),this.$emit("viewchange",{viewName:e,...s,target:this.ks.scheduler.$el})},handleDateChange(e,s){this.setDate(e,{...s,target:this.ks.scheduler.$el})},handleDatePickerChange(e){e.value&&this.setDate(e.value,{...e,target:this.ks.scheduler.$el,nativeEvent:e.event})},handleNextClick(e){e.preventDefault();const s=this.getViewPropValue(this.ks.view,"step",this.ks.activeViewName)||this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName)||1,i=s>27?h.addMonths(this.ks.currentDate,Math.round(s/27)):h.addDays(this.ks.currentDate,s);this.setDate(i,e)},handlePrevClick(e){e.preventDefault();const s=this.getViewPropValue(this.ks.view,"step",this.ks.activeViewName)||this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName)||1,i=s>27?h.addMonths(this.ks.currentDate,-Math.round(s/27)):h.addDays(this.ks.currentDate,-s);this.setDate(i,e)},handleTodayClick(e){e.preventDefault();const s=t.getToday();this.setDate(s,e)},handleShowWorkHoursClick(){this.ks.showWorkHours=!this.ks.showWorkHours},handleFocus(){this.$el&&(this.$el.style.boxShadow="0 0.5px 0.5px 0.5px rgba(0, 0, 0, .12)")},handleBlur(){this.$el&&(this.$el.style.boxShadow="")},handleItemClick(e){this.$emit("itemclick",e)},handleItemDoubleClick(e){this.$emit("itemdoubleclick",e)},handleSlotClick(e){this.$emit("slotclick",e)},handleSlotDoubleClick(e){this.$emit("slotdoubleclick",e)},handleTaskClick(e){this.$emit("taskclick",e)},handleTaskDoubleClick(e){this.$emit("taskdoubleclick",e)},setDate(e,s){this.ks.currentDate=e,this.updatePassedState(),this.$emit("datechange",{date:e,event:s})},updatePassedState(e){const s=k.provideIntlService(this),a=e||this.ks.activeViewName;this.ks.activeViewName=a,this.ks.view=this.views.find(i=>i.name===a)||this.views[0]||n.createVNode(u.DayView,null,null),this.ks.dateFormat=this.getViewPropValue(this.ks.view,"selectedDateFormat",a)||f,this.ks.shortDateFormat=this.getViewPropValue(this.ks.view,"selectedShortDateFormat",a)||w,this.ks.dateRange=this.getViewComponentByName(a).props.dateRange.default()({intl:s,date:this.ks.currentDate,timezone:this.$props.timezone,numberOfDays:this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName),workWeekStart:this.getViewPropValue(this.ks.view,"workWeekStart",this.ks.activeViewName)||s.firstDay(),workWeekEnd:this.getViewPropValue(this.ks.view,"workWeekEnd",this.ks.activeViewName)||(s.firstDay()+this.getViewPropValue(this.ks.view,"numberOfDays",this.ks.activeViewName))%6})}}});exports.Scheduler=B;
package/Scheduler.mjs CHANGED
@@ -6,18 +6,18 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { defineComponent as j, createVNode as o, h as f } from "vue";
9
- import { getModelFields as D, toSchedulerGroups as z, findMaster as p, setField as l, getField as r, getToday as M } from "./utils/main.mjs";
10
- import { isRtl as L, validatePackage as B, shouldShowValidationUI as _, templateRendering as d, getListeners as V, getTemplate as C, WatermarkOverlay as U, clone as c } from "@progress/kendo-vue-common";
9
+ import { getModelFields as g, toSchedulerGroups as z, findMaster as p, setField as l, getField as r, getToday as M } from "./utils/main.mjs";
10
+ import { isRtl as L, validatePackage as B, shouldShowValidationUI as _, templateRendering as d, getListeners as v, getTemplate as D, WatermarkOverlay as U, clone as c } from "@progress/kendo-vue-common";
11
11
  import { SchedulerHeader as G } from "./components/header/SchedulerHeader.mjs";
12
- import { provideIntlService as b } from "@progress/kendo-vue-intl";
12
+ import { provideIntlService as V } from "@progress/kendo-vue-intl";
13
13
  import { SchedulerNavigation as K } from "./components/header/navigation/SchedulerNavigation.mjs";
14
- import { addMonths as S, addDays as I } from "@progress/kendo-date-math";
14
+ import { addMonths as C, addDays as b } from "@progress/kendo-date-math";
15
15
  import { SchedulerFooter as q } from "./components/footer/SchedulerFooter.mjs";
16
16
  import { ToolbarSpacer as J } from "@progress/kendo-vue-buttons";
17
17
  import { NavigationDatePicker as Q } from "./components/header/navigation/NavigationDatePicker.mjs";
18
18
  import { ViewSelectorList as X } from "./components/header/view-selector/ViewSelectorList.mjs";
19
19
  import { BusinessHours as Y } from "./components/footer/bussiness-hours/BusinessHours.mjs";
20
- import { packageMetadata as $ } from "./package-metadata.mjs";
20
+ import { packageMetadata as S } from "./package-metadata.mjs";
21
21
  import { AgendaView as Z } from "./views/agenda/AgendaView.mjs";
22
22
  import { TimelineView as ee } from "./views/time/TimelineView.mjs";
23
23
  import { DayView as m } from "./views/day/DayView.mjs";
@@ -26,7 +26,7 @@ import { WorkWeekView as ie } from "./views/week/WorkWeekView.mjs";
26
26
  import { MonthView as se } from "./views/month/MonthView.mjs";
27
27
  import { DATA_ACTION as w } from "./constants/main.mjs";
28
28
  import { useEditable as re } from "./hooks/useEditable.mjs";
29
- const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
29
+ const I = "{0:D}", $ = "{0:d}", $e = /* @__PURE__ */ j({
30
30
  name: "KendoScheduler",
31
31
  emits: ["datechange", "viewchange", "datachange", "itemclick", "itemdoubleclick", "slotclick", "slotdoubleclick", "taskclick", "taskdoubleclick"],
32
32
  props: {
@@ -101,7 +101,7 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
101
101
  };
102
102
  },
103
103
  fields() {
104
- return D(this.$props.modelFields).fields;
104
+ return g(this.$props.modelFields).fields;
105
105
  }
106
106
  },
107
107
  mounted() {
@@ -131,7 +131,7 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
131
131
  }
132
132
  },
133
133
  data() {
134
- const e = b(this), i = this.$props.date || this.$props.defaultDate, s = this.$props.view || this.$props.defaultView || this.views[0] && this.views[0].name || "day", t = this.views.find((u) => u.name === s) || this.views[0] || o(m, null, null), a = this.getViewPropValue(t, "selectedDateFormat", s) || y, n = this.getViewPropValue(t, "selectedShortDateFormat", s) || R, h = this.getViewComponentByName(s).props.dateRange.default()({
134
+ const e = V(this), i = this.$props.date || this.$props.defaultDate, s = this.$props.view || this.$props.defaultView || this.views[0] && this.views[0].name || "day", t = this.views.find((u) => u.name === s) || this.views[0] || o(m, null, null), a = this.getViewPropValue(t, "selectedDateFormat", s) || I, n = this.getViewPropValue(t, "selectedShortDateFormat", s) || $, h = this.getViewComponentByName(s).props.dateRange.default()({
135
135
  intl: e,
136
136
  date: i,
137
137
  timezone: this.$props.timezone,
@@ -150,7 +150,7 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
150
150
  },
151
151
  views: this.views,
152
152
  view: t,
153
- fields: D(this.$props.modelFields).fields,
153
+ fields: g(this.$props.modelFields).fields,
154
154
  groups: z(this.$props.group, this.$props.resources),
155
155
  dateRange: h,
156
156
  orientation: this.$props.group && this.$props.group.orientation ? this.$props.group.orientation : "horizontal",
@@ -179,10 +179,10 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
179
179
  }
180
180
  },
181
181
  render() {
182
- B($), this.showLicenseWatermark = _($), this.$props;
183
- const e = this.views.find((T) => T.name === this.ks.activeViewName) || this.views[0] || o(m, null, null), i = this.getViewPropValue(this.ks.view, "slotDuration", this.ks.activeViewName), s = d.call(this, e.header || this.$props.header, V.call(this)), t = d.call(this, e.footer || this.$props.footer, V.call(this)), a = d.call(this, e.slot || this.$props.slotRender, {}), n = d.call(this, e.viewSlot || this.$props.viewSlot, {}), h = d.call(this, e.item || this.$props.item, {}), u = d.call(this, e.viewItem || this.$props.viewItem, {}), k = d.call(this, e.task || this.$props.task, {}), P = d.call(this, e.dateHeaderCell || this.$props.dateHeaderCell, {}), F = d.call(this, e.timeHeaderCell || this.$props.timeHeaderCell, {}), x = d.call(this, e.resizeHint || this.$props.resizeHint, {});
182
+ B(S), this.showLicenseWatermark = _(S);
183
+ const e = this.views.find((T) => T.name === this.ks.activeViewName) || this.views[0] || o(m, null, null), i = this.getViewPropValue(this.ks.view, "slotDuration", this.ks.activeViewName), s = d.call(this, e.header || this.$props.header, v.call(this)), t = d.call(this, e.footer || this.$props.footer, v.call(this)), a = d.call(this, e.slot || this.$props.slotRender, {}), n = d.call(this, e.viewSlot || this.$props.viewSlot, {}), h = d.call(this, e.item || this.$props.item, {}), u = d.call(this, e.viewItem || this.$props.viewItem, {}), k = d.call(this, e.task || this.$props.task, {}), y = d.call(this, e.dateHeaderCell || this.$props.dateHeaderCell, {}), R = d.call(this, e.timeHeaderCell || this.$props.timeHeaderCell, {}), P = d.call(this, e.resizeHint || this.$props.resizeHint, {});
184
184
  this.ks.form = d.call(this, e.form || this.$props.form, {}), this.ks.dialogProps = e.dialogProps || this.$props.dialogProps, this.ks.formProps = e.formProps || this.$props.formProps;
185
- const N = re(e.editable !== void 0 ? e.editable : this.$props.editable), E = this.getViewComponentByName(this.ks.activeViewName || e.name), O = {
185
+ const F = re(e.editable !== void 0 ? e.editable : this.$props.editable), x = this.getViewComponentByName(this.ks.activeViewName || e.name), N = {
186
186
  ...this.$props,
187
187
  ...this.ks.view,
188
188
  showWorkHours: this.ks.showWorkHours,
@@ -195,13 +195,11 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
195
195
  item: h,
196
196
  viewItem: u,
197
197
  task: k,
198
- dateHeaderCell: P,
199
- timeHeaderCell: F,
200
- resizeHint: x,
201
- editable: N
202
- };
203
- let g;
204
- const H = o(G, null, {
198
+ dateHeaderCell: y,
199
+ timeHeaderCell: R,
200
+ resizeHint: P,
201
+ editable: F
202
+ }, E = o(G, null, {
205
203
  default: () => [o(K, {
206
204
  isRtl: this.isRtl,
207
205
  onPrevclick: this.handlePrevClick,
@@ -211,11 +209,10 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
211
209
  value: this.ks.currentDate,
212
210
  onChange: this.handleDatePickerChange
213
211
  }, null), o(J, null, null), o(X, null, null)]
214
- });
215
- g = C.call(this, {
212
+ }), O = D.call(this, {
216
213
  h: f,
217
214
  template: s,
218
- defaultRendering: H,
215
+ defaultRendering: E,
219
216
  additionalProps: {
220
217
  currentDate: this.ks.currentDate
221
218
  },
@@ -225,26 +222,22 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
225
222
  todayclick: this.handleTodayClick,
226
223
  datepickerchange: this.handleDatePickerChange
227
224
  }
228
- });
229
- let v;
230
- const W = o(q, null, {
225
+ }), H = o(q, null, {
231
226
  default: () => [o(Y, {
232
227
  slotDuration: i,
233
228
  onClick: this.handleShowWorkHoursClick
234
229
  }, null)]
235
- });
236
- v = C.call(this, {
230
+ }), W = D.call(this, {
237
231
  h: f,
238
232
  template: t,
239
- defaultRendering: W,
233
+ defaultRendering: H,
240
234
  additionalProps: {
241
235
  slotDuration: i
242
236
  },
243
237
  additionalListeners: {
244
238
  showworkhoursclick: this.handleShowWorkHoursClick
245
239
  }
246
- });
247
- const A = this.showLicenseWatermark ? o(U, null, null) : null;
240
+ }), A = this.showLicenseWatermark ? o(U, null, null) : null;
248
241
  return o("div", {
249
242
  id: this.$props.id,
250
243
  style: {
@@ -258,11 +251,11 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
258
251
  "aria-labelledby": this.$props.ariaLabelledby,
259
252
  onFocusin: this.handleFocus,
260
253
  onFocusout: this.handleBlur
261
- }, [g, f(E, {
254
+ }, [O, f(x, {
262
255
  key: this.ks.view.name,
263
256
  onDataaction: this.handleDataAction,
264
- ...O
265
- }), v, A]);
257
+ ...N
258
+ }), W, A]);
266
259
  },
267
260
  methods: {
268
261
  getViewComponentByName(e) {
@@ -388,12 +381,12 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
388
381
  },
389
382
  handleNextClick(e) {
390
383
  e.preventDefault();
391
- const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ? S(this.ks.currentDate, Math.round(i / 27)) : I(this.ks.currentDate, i);
384
+ const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ? C(this.ks.currentDate, Math.round(i / 27)) : b(this.ks.currentDate, i);
392
385
  this.setDate(t, e);
393
386
  },
394
387
  handlePrevClick(e) {
395
388
  e.preventDefault();
396
- const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ? S(this.ks.currentDate, -Math.round(i / 27)) : I(this.ks.currentDate, -i);
389
+ const i = this.getViewPropValue(this.ks.view, "step", this.ks.activeViewName) || this.getViewPropValue(this.ks.view, "numberOfDays", this.ks.activeViewName) || 1, t = i > 27 ? C(this.ks.currentDate, -Math.round(i / 27)) : b(this.ks.currentDate, -i);
397
390
  this.setDate(t, e);
398
391
  },
399
392
  handleTodayClick(e) {
@@ -435,8 +428,8 @@ const y = "{0:D}", R = "{0:d}", $e = /* @__PURE__ */ j({
435
428
  });
436
429
  },
437
430
  updatePassedState(e) {
438
- const i = b(this), s = e || this.ks.activeViewName;
439
- this.ks.activeViewName = s, this.ks.view = this.views.find((t) => t.name === s) || this.views[0] || o(m, null, null), this.ks.dateFormat = this.getViewPropValue(this.ks.view, "selectedDateFormat", s) || y, this.ks.shortDateFormat = this.getViewPropValue(this.ks.view, "selectedShortDateFormat", s) || R, this.ks.dateRange = this.getViewComponentByName(s).props.dateRange.default()({
431
+ const i = V(this), s = e || this.ks.activeViewName;
432
+ this.ks.activeViewName = s, this.ks.view = this.views.find((t) => t.name === s) || this.views[0] || o(m, null, null), this.ks.dateFormat = this.getViewPropValue(this.ks.view, "selectedDateFormat", s) || I, this.ks.shortDateFormat = this.getViewPropValue(this.ks.view, "selectedShortDateFormat", s) || $, this.ks.dateRange = this.getViewComponentByName(s).props.dateRange.default()({
440
433
  intl: i,
441
434
  date: this.ks.currentDate,
442
435
  timezone: this.$props.timezone,