@progress/kendo-vue-scheduler 9.0.0-develop.1 → 9.0.0-develop.3

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.
@@ -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 a=require("vue"),z=require("./SchedulerItem.js"),p=require("../utils/main.js"),c=require("../views/common/utils.js"),d=require("../constants/main.js"),I=require("@progress/kendo-vue-intl"),f=require("./SchedulerItemContent.js"),m=require("@progress/kendo-vue-common");function b(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!a.isVNode(e)}const D=1,v=a.defineComponent({name:"KendoSchedulerViewItem",inheritAttrs:!1,props:{ignoreIsAllDay:Boolean,item:[String,Function,Object],uid:[String,Number],start:Date,end:Date,originalStart:Date,startTimezone:String,endTimezone:String,isAllDay:Boolean,title:String,description:String,occurrenceId:String,recurrenceExceptions:Array,recurrenceRule:String,recurrenceId:[String,Number],dataItem:Object,head:Boolean,tail:Boolean,order:Number,zonedStart:Object,zonedEnd:Object,slots:Array,group:Object,range:Object,isException:Boolean,isRecurring:Boolean,id:String,tabIndex:Number,className:String,itemStyle:Object,editable:[Object,Boolean],selected:Boolean,vertical:Boolean,dragHint:Boolean,resizeHint:Boolean,format:String,showOccurrenceDialog:{type:Boolean,default:void 0},showRemoveDialog:{type:Boolean,default:void 0},formItem:Object,dragItem:Object,resizeItem:Object,removeItem:Object,itemRef:Object,onKeydown:Function,onKeyup:Function,onFocus:Function,onMouseup:Function,onMousedown:Function,onClick:Function,onDoubleclick:Function,onRemoveclick:Function,onPress:Function,onDrag:Function,onRelease:Function,onResizepress:Function,onResizeenddrag:Function,onResizestartdrag:Function,onResizerelease:Function},inject:{kendoIntlService:{default:null},ks:{default:null},bv:{default:null}},computed:{itemTime(){return this.$props.isAllDay?this.intl.toString(this.$props.zonedStart,"t"):this.intl.format("{0:t} - {1:t}",this.$props.zonedStart,this.$props.zonedEnd)},itemTitle(){return`(${this.itemTime}): ${this.$props.title}`}},data(){return{timeout:void 0,currentItem:null,viewItem:null,display:!0,visible:!1,maxSiblingsPerSlot:0}},mounted(){this.element=this.getElement(),!(!this.ks.scheduler||!this.ks.scheduler.$el)&&m.canUseDOM&&(this.observer=new window.ResizeObserver(this.handleResize),this.observer.observe(this.ks.scheduler.$el))},updated(){const e=this;this.$nextTick(function(){e.align(),e.position()}),!(!this.ks.scheduler||!this.ks.scheduler.$el||this.observer)&&m.canUseDOM&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(this.handleResize),this.observer.observe(this.ks.scheduler.$el))},unmounted(){this.observer&&this.observer.disconnect()},render(){const e=m.getDefaultSlots(this);this.intl=I.provideIntlService(this);let t;const r=a.createVNode(z.SchedulerItem,{ignoreIsAllDay:this.ignoreIsAllDay,item:this.item,uid:this.uid,start:this.start,end:this.end,originalStart:this.originalStart,startTimezone:this.startTimezone,endTimezone:this.endTimezone,isAllDay:this.isAllDay,title:this.title,description:this.description,occurrenceId:this.occurrenceId,recurrenceExceptions:this.recurrenceExceptions,recurrenceRule:this.recurrenceRule,recurrenceId:this.recurrenceId,dataItem:this.dataItem,head:this.head,tail:this.tail,order:this.order,zonedStart:this.zonedStart,zonedEnd:this.zonedEnd,slots:this.slots,group:this.group,range:this.range,isException:this.isException,isRecurring:this.isRecurring,id:this.id,tabIndex:this.tabIndex,className:this.className,itemStyle:{visibility:this.visible?void 0:"hidden",display:this.display?void 0:"none",...this.$props.itemStyle},editable:this.editable,selected:this.selected,vertical:this.vertical,dragHint:this.dragHint,resizeHint:this.resizeHint,format:this.format,itemTitle:this.itemTitle,showOccurrenceDialog:this.showOccurrenceDialog,showRemoveDialog:this.showRemoveDialog,formItem:this.formItem,dragItem:this.dragItem,resizeItem:this.resizeItem,removeItem:this.removeItem,maxSiblingsPerSlot:this.maxSiblingsPerSlot,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onFocus:this.handleFocus,onMouseup:this.handleMouseUp,onMousedown:this.handleMouseDown,onClick:this.handleClick,onDoubleclick:this.handleDoubleClick,onRemoveclick:this.handleRemoveClick,onPress:this.handlePress,onDrag:this.handleDrag,onRelease:this.handleRelease,onResizepress:this.handleResizePress,onResizeenddrag:this.handleResizeEndDrag,onResizestartdrag:this.handleResizeStartDrag,onResizerelease:this.handleResizeRelease},{default:()=>[!this.$props.resizeHint&&a.createVNode("div",{title:this.itemTitle},[!this.$props.isAllDay&&a.createVNode(f.SchedulerItemContent,{title:this.itemTitle,class:"k-event-template k-event-time "},b(e)?e:{default:()=>[e]}),a.createVNode(f.SchedulerItemContent,{title:this.$props.title,class:"k-event-template"},b(e)?e:{default:()=>[e]})])]});return t=m.getTemplate.call(this,{h:a.h,template:this.$props.item,defaultRendering:r,defaultSlots:e,additionalListeners:{doubleclick:this.handleDoubleClick,removeclick:this.handleRemoveClick,press:this.handlePress,drag:this.handleDrag,release:this.handleRelease,resizepress:this.handleResizePress,resizeenddrag:this.handleResizeEndDrag,resizestartdrag:this.handleResizeStartDrag,resizerelease:this.handleResizeRelease}}),t},methods:{getElement(){return this.$el.nodeType===8?this.$el.parentElement:this.$el.nodeType===3?this.$el.nextElementSibling:this.$el},handleFocus(e){this.$emit("focus",e)},handleBlur(e){this.$emit("blur",e)},handleMouseDown(e){this.$emit("mousedown",e)},handleClick(e){this.$emit("click",e)},handleMouseUp(e){this.$emit("mouseup",e)},handleMouseOver(e){this.$emit("mouseover",e)},handleMouseOut(e){this.$emit("mouseout",e)},handleMouseEnter(e){this.$emit("mouseenter",e)},handleMouseLeave(e){this.$emit("mouseleave",e)},handleDoubleClick(e){this.$emit("doubleclick",e)},handleRemoveClick(e){this.$emit("removeclick",e)},handleKeyDown(e){this.$emit("keydown",e)},handleKeyPress(e){this.$emit("keypress",e)},handleKeyUp(e){this.$emit("keyup",e)},handlePress(e){this.$emit("press",e)},handleDrag(e){this.$emit("drag",e)},handleRelease(e){this.$emit("release",e)},handleResizePress(e){this.$emit("resizepress",e)},handleResizeStartDrag(e){this.$emit("resizestartdrag",e)},handleResizeEndDrag(e){this.$emit("resizeenddrag",e)},handleResizeRelease(e){this.$emit("resizerelease",e)},calculateMostSiblings(e,t){let r=1;return e.forEach(s=>{const n=t.filter(h=>this.inSlot(s.cSlot,h.$props));n.length>r&&(r=n.length)}),r},getSiblingsInAllSlots(e,t){return e.map(s=>t.filter(n=>this.inSlot(s.cSlot,n.$props)))},inSlot(e,t){return p.intersects(e.start,e.end,t.start,t.end)&&e.group.index===t.group.index&&e.range.index===t.range.index&&(this.$props.ignoreIsAllDay||e.isAllDay===t.isAllDay)},align(){if(!this.element)return;const e=(this.bv.slots||[]).filter(s=>s&&this.inSlot(s.cSlot,this.$props));if(e.length===0){this.display=!1;return}const t=p.first(e.sort(function(s,n){return s.cSlot.start&&n.cSlot.start?s.cSlot.start.getTime()-n.cSlot.start.getTime():!0}));if(!t)return;const r=c.getRect(t.$el);c.setRect(this.element,r)},position(){if(!this.element)return;const e=(this.bv.slots||[]).filter(o=>o&&this.inSlot(o.cSlot,this.$props)),t=[],r=[],s=[];(this.bv.items||[]).forEach(o=>{o&&(o.$props.dragHint?r.push(o):o.$props.resizeHint?s.push(o):t.push(o))});const n=this.$props.dragHint||this.$props.resizeHint?p.calculateOrder(this,this.$props.dragHint?r:s,e,this.$props.ignoreIsAllDay):this.$props.order||0;let h=this.$props.dragHint||this.$props.resizeHint?this.calculateMostSiblings(e,this.$props.dragHint?r:s):this.calculateMostSiblings(e,t);const R=this.getSiblingsInAllSlots(e,t);let g=0;const i=c.getRect(this.element);if(R.forEach(o=>{let S=0;o.sort(function(l,u){return l.$props.order-u.$props.order}).forEach(l=>{p.intersects(l.$props.start,l.$props.end,this.$props.start,this.$props.end)&&!(this.$props.dragHint||this.$props.resizeHint)&&l.$props.maxSiblingsPerSlot&&l.$props.maxSiblingsPerSlot>h&&l.getElement()!==this.element&&(h=l.$props.maxSiblingsPerSlot);const u=c.getRect(l.getElement());l.$props.order!==null&&l.$props.order<n&&(S=(u.top||i.top)+u.height-i.top-d.BORDER_WIDTH*n+D)}),S>g&&(g=S)}),e.length===0){this.display=!1;return}const $=20;i.width=this.$props.vertical?i.width/h-d.BORDER_WIDTH-$/h:i.width*e.length-d.BORDER_WIDTH-$,i.height=this.$props.vertical?i.height*e.length-d.BORDER_WIDTH:(this.$props.resizeHint||this.$props.dragHint)&&h<=1?i.height:this.$props.itemStyle&&this.$props.itemStyle.height?this.$props.itemStyle.height:25,i.left=this.$props.vertical?i.left+n*i.width+d.BORDER_WIDTH*n:i.left,i.top=this.$props.vertical?i.top:i.top+g+d.BORDER_WIDTH*n,this.maxSiblingsPerSlot=h,c.setRect(this.element,i),this.visible=!0,this.display=!0},handleResize(){this.timeout!==void 0&&window.cancelAnimationFrame(this.timeout),this.timeout=window.requestAnimationFrame(()=>{this.align(),this.position()})}}});exports.SchedulerViewItem=v;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("vue"),z=require("./SchedulerItem.js"),m=require("../utils/main.js"),u=require("../views/common/utils.js"),c=require("../constants/main.js"),D=require("@progress/kendo-vue-intl"),b=require("./SchedulerItemContent.js"),g=require("@progress/kendo-vue-common");function R(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!h.isVNode(e)}const I=1,v=h.defineComponent({name:"KendoSchedulerViewItem",inheritAttrs:!1,props:{ignoreIsAllDay:Boolean,item:[String,Function,Object],uid:[String,Number],start:Date,end:Date,originalStart:Date,startTimezone:String,endTimezone:String,isAllDay:Boolean,title:String,description:String,occurrenceId:String,recurrenceExceptions:Array,recurrenceRule:String,recurrenceId:[String,Number],dataItem:Object,head:Boolean,tail:Boolean,order:Number,zonedStart:Object,zonedEnd:Object,slots:Array,group:Object,range:Object,isException:Boolean,isRecurring:Boolean,id:String,tabIndex:Number,className:String,itemStyle:Object,editable:[Object,Boolean],selected:Boolean,vertical:Boolean,dragHint:Boolean,resizeHint:Boolean,format:String,showOccurrenceDialog:{type:Boolean,default:void 0},showRemoveDialog:{type:Boolean,default:void 0},formItem:Object,dragItem:Object,resizeItem:Object,removeItem:Object,itemRef:Object,onKeydown:Function,onKeyup:Function,onFocus:Function,onMouseup:Function,onMousedown:Function,onClick:Function,onDoubleclick:Function,onRemoveclick:Function,onPress:Function,onDrag:Function,onRelease:Function,onResizepress:Function,onResizeenddrag:Function,onResizestartdrag:Function,onResizerelease:Function},inject:{kendoIntlService:{default:null},ks:{default:null},bv:{default:null}},computed:{itemTime(){return this.$props.isAllDay?this.intl.toString(this.$props.zonedStart,"t"):this.intl.format("{0:t} - {1:t}",this.$props.zonedStart,this.$props.zonedEnd)},itemTitle(){return`(${this.itemTime}): ${this.$props.title}`}},data(){return{timeout:void 0,currentItem:null,viewItem:null,display:!0,visible:!1,maxSiblingsPerSlot:0}},mounted(){if(this.element=this.getElement(),!this.ks.scheduler||!this.ks.scheduler.$el)return;g.canUseDOM&&(this.observer=new window.ResizeObserver(this.handleResize),this.observer.observe(this.ks.scheduler.$el));const e=this;this.$nextTick(function(){e.align(),e.position()})},updated(){const e=this;this.$nextTick(function(){e.align(),e.position()}),!(!this.ks.scheduler||!this.ks.scheduler.$el||this.observer)&&g.canUseDOM&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(this.handleResize),this.observer.observe(this.ks.scheduler.$el))},unmounted(){this.observer&&this.observer.disconnect()},render(){const e=g.getDefaultSlots(this);this.intl=D.provideIntlService(this);let t;const n=h.createVNode(z.SchedulerItem,{ignoreIsAllDay:this.ignoreIsAllDay,item:this.item,uid:this.uid,start:this.start,end:this.end,originalStart:this.originalStart,startTimezone:this.startTimezone,endTimezone:this.endTimezone,isAllDay:this.isAllDay,title:this.title,description:this.description,occurrenceId:this.occurrenceId,recurrenceExceptions:this.recurrenceExceptions,recurrenceRule:this.recurrenceRule,recurrenceId:this.recurrenceId,dataItem:this.dataItem,head:this.head,tail:this.tail,order:this.order,zonedStart:this.zonedStart,zonedEnd:this.zonedEnd,slots:this.slots,group:this.group,range:this.range,isException:this.isException,isRecurring:this.isRecurring,id:this.id,tabIndex:this.tabIndex,className:this.className,itemStyle:{visibility:this.visible?void 0:"hidden",display:this.display?void 0:"none",...this.$props.itemStyle},editable:this.editable,selected:this.selected,vertical:this.vertical,dragHint:this.dragHint,resizeHint:this.resizeHint,format:this.format,itemTitle:this.itemTitle,showOccurrenceDialog:this.showOccurrenceDialog,showRemoveDialog:this.showRemoveDialog,formItem:this.formItem,dragItem:this.dragItem,resizeItem:this.resizeItem,removeItem:this.removeItem,maxSiblingsPerSlot:this.maxSiblingsPerSlot,onKeydown:this.handleKeyDown,onKeyup:this.handleKeyUp,onFocus:this.handleFocus,onMouseup:this.handleMouseUp,onMousedown:this.handleMouseDown,onClick:this.handleClick,onDoubleclick:this.handleDoubleClick,onRemoveclick:this.handleRemoveClick,onPress:this.handlePress,onDrag:this.handleDrag,onRelease:this.handleRelease,onResizepress:this.handleResizePress,onResizeenddrag:this.handleResizeEndDrag,onResizestartdrag:this.handleResizeStartDrag,onResizerelease:this.handleResizeRelease},{default:()=>[!this.$props.resizeHint&&h.createVNode("div",{title:this.itemTitle},[!this.$props.isAllDay&&h.createVNode(b.SchedulerItemContent,{title:this.itemTitle,class:"k-event-template k-event-time "},R(e)?e:{default:()=>[e]}),h.createVNode(b.SchedulerItemContent,{title:this.$props.title,class:"k-event-template"},R(e)?e:{default:()=>[e]})])]});return t=g.getTemplate.call(this,{h:h.h,template:this.$props.item,defaultRendering:n,defaultSlots:e,additionalListeners:{doubleclick:this.handleDoubleClick,removeclick:this.handleRemoveClick,press:this.handlePress,drag:this.handleDrag,release:this.handleRelease,resizepress:this.handleResizePress,resizeenddrag:this.handleResizeEndDrag,resizestartdrag:this.handleResizeStartDrag,resizerelease:this.handleResizeRelease}}),t},methods:{getElement(){return this.$el.nodeType===8?this.$el.parentElement:this.$el.nodeType===3?this.$el.nextElementSibling:this.$el},handleFocus(e){this.$emit("focus",e)},handleBlur(e){this.$emit("blur",e)},handleMouseDown(e){this.$emit("mousedown",e)},handleClick(e){this.$emit("click",e)},handleMouseUp(e){this.$emit("mouseup",e)},handleMouseOver(e){this.$emit("mouseover",e)},handleMouseOut(e){this.$emit("mouseout",e)},handleMouseEnter(e){this.$emit("mouseenter",e)},handleMouseLeave(e){this.$emit("mouseleave",e)},handleDoubleClick(e){this.$emit("doubleclick",e)},handleRemoveClick(e){this.$emit("removeclick",e)},handleKeyDown(e){this.$emit("keydown",e)},handleKeyPress(e){this.$emit("keypress",e)},handleKeyUp(e){this.$emit("keyup",e)},handlePress(e){this.$emit("press",e)},handleDrag(e){this.$emit("drag",e)},handleRelease(e){this.$emit("release",e)},handleResizePress(e){this.$emit("resizepress",e)},handleResizeStartDrag(e){this.$emit("resizestartdrag",e)},handleResizeEndDrag(e){this.$emit("resizeenddrag",e)},handleResizeRelease(e){this.$emit("resizerelease",e)},calculateMostSiblings(e,t){let n=1;return e.forEach(o=>{const i=t.filter(r=>this.inSlot(o.cSlot,r.$props));i.length>n&&(n=i.length)}),n},getSiblingsInAllSlots(e,t){return e.map(o=>t.filter(i=>this.inSlot(o.cSlot,i.$props)))},inSlot(e,t){return m.intersects(e.start,e.end,t.start,t.end)&&e.group.index===t.group.index&&e.range.index===t.range.index&&(this.$props.ignoreIsAllDay||e.isAllDay===t.isAllDay)},align(){if(!this.element)return;const e=(this.bv.slots||[]).filter(i=>i&&this.inSlot(i.cSlot,this.$props));if(e.length===0){this.display=!1;return}const t=m.first(e.sort(function(i,r){return i.cSlot.start&&r.cSlot.start?i.cSlot.start.getTime()-r.cSlot.start.getTime():!0}));if(!t)return;const n=u.getRect(t.$el),o=t.$el;if(o&&!this.$props.vertical){const i=o.querySelector(".k-nav-day");if(i)n.top+=i.offsetTop+parseFloat(window.getComputedStyle(i).lineHeight||"0");else if(o.firstElementChild){const r=window.getComputedStyle(o),S=parseFloat(r.paddingTop||"0"),d=parseFloat(r.lineHeight||"0");d>0&&(n.top+=S+d)}}u.setRect(this.element,n)},position(){if(!this.element)return;const e=(this.bv.slots||[]).filter(l=>l&&this.inSlot(l.cSlot,this.$props)),t=[],n=[],o=[];(this.bv.items||[]).forEach(l=>{l&&(l.$props.dragHint?n.push(l):l.$props.resizeHint?o.push(l):t.push(l))});const i=this.$props.dragHint||this.$props.resizeHint?m.calculateOrder(this,this.$props.dragHint?n:o,e,this.$props.ignoreIsAllDay):this.$props.order||0;let r=this.$props.dragHint||this.$props.resizeHint?this.calculateMostSiblings(e,this.$props.dragHint?n:o):this.calculateMostSiblings(e,t);const S=this.getSiblingsInAllSlots(e,t);let d=0;const s=u.getRect(this.element);if(S.forEach(l=>{let $=0;l.sort(function(a,p){return a.$props.order-p.$props.order}).forEach(a=>{m.intersects(a.$props.start,a.$props.end,this.$props.start,this.$props.end)&&!(this.$props.dragHint||this.$props.resizeHint)&&a.$props.maxSiblingsPerSlot&&a.$props.maxSiblingsPerSlot>r&&a.getElement()!==this.element&&(r=a.$props.maxSiblingsPerSlot);const p=u.getRect(a.getElement());a.$props.order!==null&&a.$props.order<i&&($=(p.top||s.top)+p.height-s.top-c.BORDER_WIDTH*i+I)}),$>d&&(d=$)}),e.length===0){this.display=!1;return}const f=20;s.width=this.$props.vertical?s.width/r-c.BORDER_WIDTH-f/r:s.width*e.length-c.BORDER_WIDTH-f,s.height=this.$props.vertical?s.height*e.length-c.BORDER_WIDTH:(this.$props.resizeHint||this.$props.dragHint)&&r<=1?s.height:this.$props.itemStyle&&this.$props.itemStyle.height?this.$props.itemStyle.height:25,s.left=this.$props.vertical?s.left+i*s.width+c.BORDER_WIDTH*i:s.left,s.top=this.$props.vertical?s.top:s.top+d+c.BORDER_WIDTH*i,this.maxSiblingsPerSlot=r,u.setRect(this.element,s),this.visible=!0,this.display=!0},handleResize(){this.timeout!==void 0&&window.cancelAnimationFrame(this.timeout),this.timeout=window.requestAnimationFrame(()=>{this.align(),this.position()})}}});exports.SchedulerViewItem=v;
@@ -5,18 +5,18 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as v, createVNode as c, h as I, isVNode as D } from "vue";
9
- import { SchedulerItem as y } from "./SchedulerItem.mjs";
8
+ import { defineComponent as v, createVNode as p, h as y, isVNode as I } from "vue";
9
+ import { SchedulerItem as D } from "./SchedulerItem.mjs";
10
10
  import { calculateOrder as w, intersects as S, first as k } from "../utils/main.mjs";
11
- import { getRect as u, setRect as f } from "../views/common/utils.mjs";
12
- import { BORDER_WIDTH as a } from "../constants/main.mjs";
13
- import { provideIntlService as O } from "@progress/kendo-vue-intl";
14
- import { SchedulerItemContent as $ } from "./SchedulerItemContent.mjs";
15
- import { getDefaultSlots as E, getTemplate as F, canUseDOM as b } from "@progress/kendo-vue-common";
16
- function z(e) {
17
- return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !D(e);
11
+ import { getRect as g, setRect as $ } from "../views/common/utils.mjs";
12
+ import { BORDER_WIDTH as d } from "../constants/main.mjs";
13
+ import { provideIntlService as E } from "@progress/kendo-vue-intl";
14
+ import { SchedulerItemContent as b } from "./SchedulerItemContent.mjs";
15
+ import { getDefaultSlots as O, getTemplate as F, canUseDOM as z } from "@progress/kendo-vue-common";
16
+ function R(e) {
17
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !I(e);
18
18
  }
19
- const x = 1, N = /* @__PURE__ */ v({
19
+ const T = 1, N = /* @__PURE__ */ v({
20
20
  name: "KendoSchedulerViewItem",
21
21
  inheritAttrs: !1,
22
22
  props: {
@@ -115,22 +115,28 @@ const x = 1, N = /* @__PURE__ */ v({
115
115
  };
116
116
  },
117
117
  mounted() {
118
- this.element = this.getElement(), !(!this.ks.scheduler || !this.ks.scheduler.$el) && b && (this.observer = new window.ResizeObserver(this.handleResize), this.observer.observe(this.ks.scheduler.$el));
118
+ if (this.element = this.getElement(), !this.ks.scheduler || !this.ks.scheduler.$el)
119
+ return;
120
+ z && (this.observer = new window.ResizeObserver(this.handleResize), this.observer.observe(this.ks.scheduler.$el));
121
+ const e = this;
122
+ this.$nextTick(function() {
123
+ e.align(), e.position();
124
+ });
119
125
  },
120
126
  updated() {
121
127
  const e = this;
122
128
  this.$nextTick(function() {
123
129
  e.align(), e.position();
124
- }), !(!this.ks.scheduler || !this.ks.scheduler.$el || this.observer) && b && window.ResizeObserver && (this.observer = new window.ResizeObserver(this.handleResize), this.observer.observe(this.ks.scheduler.$el));
130
+ }), !(!this.ks.scheduler || !this.ks.scheduler.$el || this.observer) && z && window.ResizeObserver && (this.observer = new window.ResizeObserver(this.handleResize), this.observer.observe(this.ks.scheduler.$el));
125
131
  },
126
132
  unmounted() {
127
133
  this.observer && this.observer.disconnect();
128
134
  },
129
135
  render() {
130
- const e = E(this);
131
- this.intl = O(this);
136
+ const e = O(this);
137
+ this.intl = E(this);
132
138
  let t;
133
- const r = c(y, {
139
+ const n = p(D, {
134
140
  ignoreIsAllDay: this.ignoreIsAllDay,
135
141
  item: this.item,
136
142
  uid: this.uid,
@@ -195,24 +201,24 @@ const x = 1, N = /* @__PURE__ */ v({
195
201
  onResizestartdrag: this.handleResizeStartDrag,
196
202
  onResizerelease: this.handleResizeRelease
197
203
  }, {
198
- default: () => [!this.$props.resizeHint && c("div", {
204
+ default: () => [!this.$props.resizeHint && p("div", {
199
205
  title: this.itemTitle
200
- }, [!this.$props.isAllDay && c($, {
206
+ }, [!this.$props.isAllDay && p(b, {
201
207
  title: this.itemTitle,
202
208
  class: "k-event-template k-event-time "
203
- }, z(e) ? e : {
209
+ }, R(e) ? e : {
204
210
  default: () => [e]
205
- }), c($, {
211
+ }), p(b, {
206
212
  title: this.$props.title,
207
213
  class: "k-event-template"
208
- }, z(e) ? e : {
214
+ }, R(e) ? e : {
209
215
  default: () => [e]
210
216
  })])]
211
217
  });
212
218
  return t = F.call(this, {
213
- h: I,
219
+ h: y,
214
220
  template: this.$props.item,
215
- defaultRendering: r,
221
+ defaultRendering: n,
216
222
  defaultSlots: e,
217
223
  additionalListeners: {
218
224
  // keydown: this.handleKeyDown,
@@ -309,14 +315,14 @@ const x = 1, N = /* @__PURE__ */ v({
309
315
  this.$emit("resizerelease", e);
310
316
  },
311
317
  calculateMostSiblings(e, t) {
312
- let r = 1;
313
- return e.forEach((s) => {
314
- const n = t.filter((h) => this.inSlot(s.cSlot, h.$props));
315
- n.length > r && (r = n.length);
316
- }), r;
318
+ let n = 1;
319
+ return e.forEach((o) => {
320
+ const i = t.filter((r) => this.inSlot(o.cSlot, r.$props));
321
+ i.length > n && (n = i.length);
322
+ }), n;
317
323
  },
318
324
  getSiblingsInAllSlots(e, t) {
319
- return e.map((s) => t.filter((n) => this.inSlot(s.cSlot, n.$props)));
325
+ return e.map((o) => t.filter((i) => this.inSlot(o.cSlot, i.$props)));
320
326
  },
321
327
  inSlot(e, t) {
322
328
  return S(e.start, e.end, t.start, t.end) && e.group.index === t.group.index && e.range.index === t.range.index && (this.$props.ignoreIsAllDay || e.isAllDay === t.isAllDay);
@@ -324,46 +330,55 @@ const x = 1, N = /* @__PURE__ */ v({
324
330
  align() {
325
331
  if (!this.element)
326
332
  return;
327
- const e = (this.bv.slots || []).filter((s) => s && this.inSlot(s.cSlot, this.$props));
333
+ const e = (this.bv.slots || []).filter((i) => i && this.inSlot(i.cSlot, this.$props));
328
334
  if (e.length === 0) {
329
335
  this.display = !1;
330
336
  return;
331
337
  }
332
- const t = k(e.sort(function(s, n) {
333
- return s.cSlot.start && n.cSlot.start ? s.cSlot.start.getTime() - n.cSlot.start.getTime() : !0;
338
+ const t = k(e.sort(function(i, r) {
339
+ return i.cSlot.start && r.cSlot.start ? i.cSlot.start.getTime() - r.cSlot.start.getTime() : !0;
334
340
  }));
335
341
  if (!t)
336
342
  return;
337
- const r = u(t.$el);
338
- f(this.element, r);
343
+ const n = g(t.$el), o = t.$el;
344
+ if (o && !this.$props.vertical) {
345
+ const i = o.querySelector(".k-nav-day");
346
+ if (i)
347
+ n.top += i.offsetTop + parseFloat(window.getComputedStyle(i).lineHeight || "0");
348
+ else if (o.firstElementChild) {
349
+ const r = window.getComputedStyle(o), m = parseFloat(r.paddingTop || "0"), a = parseFloat(r.lineHeight || "0");
350
+ a > 0 && (n.top += m + a);
351
+ }
352
+ }
353
+ $(this.element, n);
339
354
  },
340
355
  position() {
341
356
  if (!this.element)
342
357
  return;
343
- const e = (this.bv.slots || []).filter((o) => o && this.inSlot(o.cSlot, this.$props)), t = [], r = [], s = [];
344
- (this.bv.items || []).forEach((o) => {
345
- o && (o.$props.dragHint ? r.push(o) : o.$props.resizeHint ? s.push(o) : t.push(o));
358
+ const e = (this.bv.slots || []).filter((l) => l && this.inSlot(l.cSlot, this.$props)), t = [], n = [], o = [];
359
+ (this.bv.items || []).forEach((l) => {
360
+ l && (l.$props.dragHint ? n.push(l) : l.$props.resizeHint ? o.push(l) : t.push(l));
346
361
  });
347
- const n = this.$props.dragHint || this.$props.resizeHint ? w(this, this.$props.dragHint ? r : s, e, this.$props.ignoreIsAllDay) : this.$props.order || 0;
348
- let h = this.$props.dragHint || this.$props.resizeHint ? this.calculateMostSiblings(e, this.$props.dragHint ? r : s) : this.calculateMostSiblings(e, t);
349
- const R = this.getSiblingsInAllSlots(e, t);
350
- let p = 0;
351
- const i = u(this.element);
352
- if (R.forEach((o) => {
353
- let m = 0;
354
- o.sort(function(l, d) {
355
- return l.$props.order - d.$props.order;
356
- }).forEach((l) => {
357
- S(l.$props.start, l.$props.end, this.$props.start, this.$props.end) && !(this.$props.dragHint || this.$props.resizeHint) && l.$props.maxSiblingsPerSlot && l.$props.maxSiblingsPerSlot > h && l.getElement() !== this.element && (h = l.$props.maxSiblingsPerSlot);
358
- const d = u(l.getElement());
359
- l.$props.order !== null && l.$props.order < n && (m = (d.top || i.top) + d.height - i.top - a * n + x);
360
- }), m > p && (p = m);
362
+ const i = this.$props.dragHint || this.$props.resizeHint ? w(this, this.$props.dragHint ? n : o, e, this.$props.ignoreIsAllDay) : this.$props.order || 0;
363
+ let r = this.$props.dragHint || this.$props.resizeHint ? this.calculateMostSiblings(e, this.$props.dragHint ? n : o) : this.calculateMostSiblings(e, t);
364
+ const m = this.getSiblingsInAllSlots(e, t);
365
+ let a = 0;
366
+ const s = g(this.element);
367
+ if (m.forEach((l) => {
368
+ let u = 0;
369
+ l.sort(function(h, c) {
370
+ return h.$props.order - c.$props.order;
371
+ }).forEach((h) => {
372
+ S(h.$props.start, h.$props.end, this.$props.start, this.$props.end) && !(this.$props.dragHint || this.$props.resizeHint) && h.$props.maxSiblingsPerSlot && h.$props.maxSiblingsPerSlot > r && h.getElement() !== this.element && (r = h.$props.maxSiblingsPerSlot);
373
+ const c = g(h.getElement());
374
+ h.$props.order !== null && h.$props.order < i && (u = (c.top || s.top) + c.height - s.top - d * i + T);
375
+ }), u > a && (a = u);
361
376
  }), e.length === 0) {
362
377
  this.display = !1;
363
378
  return;
364
379
  }
365
- const g = 20;
366
- i.width = this.$props.vertical ? i.width / h - a - g / h : i.width * e.length - a - g, i.height = this.$props.vertical ? i.height * e.length - a : (this.$props.resizeHint || this.$props.dragHint) && h <= 1 ? i.height : this.$props.itemStyle && this.$props.itemStyle.height ? this.$props.itemStyle.height : 25, i.left = this.$props.vertical ? i.left + n * i.width + a * n : i.left, i.top = this.$props.vertical ? i.top : i.top + p + a * n, this.maxSiblingsPerSlot = h, f(this.element, i), this.visible = !0, this.display = !0;
380
+ const f = 20;
381
+ s.width = this.$props.vertical ? s.width / r - d - f / r : s.width * e.length - d - f, s.height = this.$props.vertical ? s.height * e.length - d : (this.$props.resizeHint || this.$props.dragHint) && r <= 1 ? s.height : this.$props.itemStyle && this.$props.itemStyle.height ? this.$props.itemStyle.height : 25, s.left = this.$props.vertical ? s.left + i * s.width + d * i : s.left, s.top = this.$props.vertical ? s.top : s.top + a + d * i, this.maxSiblingsPerSlot = r, $(this.element, s), this.visible = !0, this.display = !0;
367
382
  },
368
383
  handleResize() {
369
384
  this.timeout !== void 0 && window.cancelAnimationFrame(this.timeout), this.timeout = window.requestAnimationFrame(() => {
@@ -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 e={name:"@progress/kendo-vue-scheduler",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1779205228,version:"9.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=vue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={name:"@progress/kendo-vue-scheduler",productName:"Kendo UI for Vue",productCode:"KENDOUIVUE",productCodes:["KENDOUIVUE"],publishDate: 1779271874,version:"9.0.0-develop.3",licensingDocsUrl:"https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=vue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"};exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = {
10
10
  productName: "Kendo UI for Vue",
11
11
  productCode: "KENDOUIVUE",
12
12
  productCodes: ["KENDOUIVUE"],
13
- publishDate: 1779205228,
14
- version: "9.0.0-develop.1",
13
+ publishDate: 1779271874,
14
+ version: "9.0.0-develop.3",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=vue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
16
16
  };
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-vue-scheduler",
3
- "version": "9.0.0-develop.1",
3
+ "version": "9.0.0-develop.3",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -27,15 +27,15 @@
27
27
  "@progress/kendo-date-math": "^1.5.13",
28
28
  "@progress/kendo-drawing": "^1.20.1",
29
29
  "@progress/kendo-licensing": "^1.7.2",
30
- "@progress/kendo-vue-common": "9.0.0-develop.1",
31
- "@progress/kendo-vue-buttons": "9.0.0-develop.1",
32
- "@progress/kendo-vue-dateinputs": "9.0.0-develop.1",
33
- "@progress/kendo-vue-dialogs": "9.0.0-develop.1",
34
- "@progress/kendo-vue-dropdowns": "9.0.0-develop.1",
35
- "@progress/kendo-vue-form": "9.0.0-develop.1",
36
- "@progress/kendo-vue-inputs": "9.0.0-develop.1",
37
- "@progress/kendo-vue-intl": "9.0.0-develop.1",
38
- "@progress/kendo-vue-popup": "9.0.0-develop.1",
30
+ "@progress/kendo-vue-common": "9.0.0-develop.3",
31
+ "@progress/kendo-vue-buttons": "9.0.0-develop.3",
32
+ "@progress/kendo-vue-dateinputs": "9.0.0-develop.3",
33
+ "@progress/kendo-vue-dialogs": "9.0.0-develop.3",
34
+ "@progress/kendo-vue-dropdowns": "9.0.0-develop.3",
35
+ "@progress/kendo-vue-form": "9.0.0-develop.3",
36
+ "@progress/kendo-vue-inputs": "9.0.0-develop.3",
37
+ "@progress/kendo-vue-intl": "9.0.0-develop.3",
38
+ "@progress/kendo-vue-popup": "9.0.0-develop.3",
39
39
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
40
40
  "vue": "^3.0.2"
41
41
  },
@@ -60,7 +60,7 @@
60
60
  "package": {
61
61
  "productName": "Kendo UI for Vue",
62
62
  "productCode": "KENDOUIVUE",
63
- "publishDate": 1779205228,
63
+ "publishDate": 1779271874,
64
64
  "licensingDocsUrl": "https://www.telerik.com/kendo-vue-ui/my-license/?utm_medium=product&utm_source=vue&utm_campaign=kendo-ui-vue-purchase-license-keys-warning"
65
65
  }
66
66
  },
@@ -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"),i=require("@progress/kendo-vue-common"),v=require("../constants/main.js"),s=require("../utils/main.js"),w=require("./SchedulerViewSlot.js"),T=require("../hooks/use-slots-selection.js"),x=require("../hooks/use-items-selection.js"),A=require("../hooks/use-items-focus.js"),r=require("../hooks/use-slots-focus.js"),N=require("../hooks/useEditable.js");function j(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const _=n.defineComponent({name:"KendoSchedulerEditSlot",inheritAttrs:!1,props:{tabIndex:{type:Number,default:void 0},className:String,form:Object,formItem:Object,refTo:[Function,Object],items:Array,row:Number,group:Object,range:Object,isWorkDay:{type:Boolean,default:!0},isWorkHour:{type:Boolean,default:!0},selected:Boolean,col:Number,index:Number,start:Date,end:Date,zonedStart:Object,zonedEnd:Object,isAllDay:Boolean,expandable:[Boolean,Object],slotRender:[String,Function,Object],viewSlot:[String,Function,Object],navDay:Boolean,editable:[Object,Boolean],itemsPerSlot:Number,onDataaction:Function},created(){this.slot=null,this.editableSlot=null},provide(){return{ksEditFormSubmit:this.handleEditFormSubmit,ksEditFormCancel:this.handleEditFormCancel,ksEditFormClose:this.handleEditFormClose}},inject:{bv:{default:null},ks:{default:null},dispatchSelectedItems:{default:null},dispatchFocusedItems:{default:null},dispatchFocusedSlots:{default:null},dispatchSelectedSlots:{default:null},ksSlots:{default:{}}},data(){return{currentFormItem:null}},computed:{cSlot(){return this.ksSlots.cSlots?this.ksSlots.cSlots[this.index]:{}},currentTabIndex(){const e=this.bv.slots.length&&s.compareSlots(this.bv.slots[0].cSlot,this.cSlot);return this.$props.tabIndex!==void 0?this.$props.tabIndex===null?void 0:this.$props.tabIndex:this.bv.selectedSlots.length===0&&e&&this.cSlot.items.length===0?0:void 0},computedEditable(){return N.useEditable(this.$props.editable)},compFormItem(){return this.formItem!==void 0?this.formItem:this.currentFormItem}},render(){const e=i.getDefaultSlots(this),{viewSlot:t,form:o,formItem:l,items:a,row:F,group:I,range:y,isWorkDay:d,isWorkHour:c,col:g,index:u,start:D,end:k,zonedStart:h,zonedEnd:m,navDay:S,itemsPerSlot:p,className:C}=this.$props,b=this.bv.selectedSlots.some(E=>s.compareSlots(E.cSlot,this.cSlot));let f;const O=n.createVNode(w.SchedulerViewSlot,{className:C,slotRender:this.$props.slotRender,isAllDay:this.isAllDay,expandable:this.expandable,editable:this.editable,items:a,row:F,group:I,range:y,isWorkDay:d,isWorkHour:c,col:g,index:u,start:D,end:k,zonedStart:h,zonedEnd:m,selected:b,navDay:S,itemsPerSlot:p,tabIndex:this.currentTabIndex,formItem:this.compFormItem,onFocus:this.handleFocus,onDoubleclick:this.handleDoubleClick,onKeydown:this.handleKeyDown,onShowmoreitems:this.handleShowMoreItemsClick},j(e)?e:{default:()=>[e]});return f=i.getTemplate.call(this,{h:n.h,template:this.$props.slotRender,defaultRendering:O,defaultSlots:e,additionalProps:{...this.cSlot,isAllDay:this.cSlot.isAllDay,expandable:this.expandable,editable:this.editable,items:a,row:this.cSlot.row,group:this.cSlot.group,range:this.cSlot.range,isWorkDay:d,isWorkHour:c,col:this.cSlot.col,index:u,start:this.cSlot.start,end:this.cSlot.end,zonedStart:h,zonedEnd:m,selected:b,navDay:S,itemsPerSlot:p,tabIndex:this.currentTabIndex},additionalListeners:{focus:this.handleFocus,doubleclick:this.handleDoubleClick,keydown:this.handleKeyDown,showmoreitems:this.handleShowMoreItemsClick}}),f},methods:{handleShowMoreItemsClick(e){this.$emit("showmoreitems",e)},createDataItemFromSlot(){const e={};if(s.setField(e,this.ks.fields.start,new Date(this.cSlot.start.getTime())),s.setField(e,this.ks.fields.end,new Date(this.cSlot.end.getTime())),s.setField(e,this.ks.fields.isAllDay,this.cSlot.isAllDay),this.cSlot.group.resources.length)for(let t=0;t<this.cSlot.group.resources.length;t++){const o=this.cSlot.group.resources[t];if(s.isGroupped(this.cSlot.group.resources)){const l=s.getField(this.cSlot.group.resources[t],o.valueField);s.setField(e,o.field,o.multiple?[l]:l)}else s.setField(e,o.field,o.multiple?[]:void 0)}return e},handleFocus(e){this.computedEditable.select&&this.dispatchSelectedSlots({type:T.SLOTS_SELECT_ACTION.select,slot:this},e.event),this.$emit("focus",e)},handleDoubleClick(e){if(this.computedEditable.add){const t=this.createDataItemFromSlot();this.setFormItem(t,e)}this.$emit("doubleclick",e)},handleKeyDown(e){let t,o,l;switch(e.event.keyCode){case i.Keys.left:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.left,slot:this},e.event);break;case i.Keys.right:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.right,slot:this},e.event);break;case i.Keys.up:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.up,slot:this},e.event);break;case i.Keys.down:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.down,slot:this},e.event);break;case i.Keys.enter:if(!this.bv.slots||!this.computedEditable.add)return;l=this.createDataItemFromSlot(),this.setFormItem(l);break;case i.Keys.tab:o=s.findFirstItem(e.target),t=o?s.findCurrentItem(o,this.bv.items,!1):s.getSortedSlots(this.bv.items,this.ignoreIsAllDay)[0],this.dispatchFocusedItems({type:A.ITEMS_FOCUS_ACTION.current,item:t},e.event),this.dispatchSelectedItems({type:x.ITEMS_SELECT_ACTION.select,item:t},e);break}t&&e.event.preventDefault()},handleEditFormSubmit(e){this.$emit("dataaction",{type:v.DATA_ACTION.create,series:!1,dataItem:e.value},e),this.setFormItem(null,e.event)},handleEditFormCancel(e){this.setFormItem(null,e.event)},handleEditFormClose(e){this.setFormItem(null,e)},handleFormItemChange(e,t){this.setFormItem&&this.setFormItem(e,t)},setFormItem(e,t){this.currentFormItem=e,this.$emit("formitemchange",t)}}});exports.SchedulerEditSlot=_;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),i=require("@progress/kendo-vue-common"),T=require("../constants/main.js"),s=require("../utils/main.js"),v=require("./SchedulerViewSlot.js"),w=require("../hooks/use-slots-selection.js"),$=require("../hooks/use-items-selection.js"),A=require("../hooks/use-items-focus.js"),r=require("../hooks/use-slots-focus.js"),N=require("../hooks/useEditable.js"),F=require("../hooks/useSlotExpand.js");function j(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Object]"&&!n.isVNode(e)}const _=n.defineComponent({name:"KendoSchedulerEditSlot",inheritAttrs:!1,props:{tabIndex:{type:Number,default:void 0},className:String,form:Object,formItem:Object,refTo:[Function,Object],items:Array,row:Number,group:Object,range:Object,isWorkDay:{type:Boolean,default:!0},isWorkHour:{type:Boolean,default:!0},selected:Boolean,col:Number,index:Number,start:Date,end:Date,zonedStart:Object,zonedEnd:Object,isAllDay:Boolean,expandable:[Boolean,Object],slotRender:[String,Function,Object],viewSlot:[String,Function,Object],navDay:Boolean,editable:[Object,Boolean],itemsPerSlot:Number,onDataaction:Function},created(){this.slot=null,this.editableSlot=null},mounted(){if(this.$props.slotRender&&this.$props.expandable){const e=this;this.$nextTick(function(){F.useSlotExpand(e,e.ks.scheduler.$el,e.$props.expandable)})}},updated(){if(this.$props.slotRender&&this.$props.expandable){const e=this;this.$nextTick(function(){F.useSlotExpand(e,e.ks.scheduler.$el,e.$props.expandable)})}},provide(){return{ksEditFormSubmit:this.handleEditFormSubmit,ksEditFormCancel:this.handleEditFormCancel,ksEditFormClose:this.handleEditFormClose}},inject:{bv:{default:null},ks:{default:null},dispatchSelectedItems:{default:null},dispatchFocusedItems:{default:null},dispatchFocusedSlots:{default:null},dispatchSelectedSlots:{default:null},ksSlots:{default:{}}},data(){return{currentFormItem:null}},computed:{cSlot(){return this.ksSlots.cSlots?this.ksSlots.cSlots[this.index]:{}},currentTabIndex(){const e=this.bv.slots.length&&s.compareSlots(this.bv.slots[0].cSlot,this.cSlot);return this.$props.tabIndex!==void 0?this.$props.tabIndex===null?void 0:this.$props.tabIndex:this.bv.selectedSlots.length===0&&e&&this.cSlot.items.length===0?0:void 0},computedEditable(){return N.useEditable(this.$props.editable)},compFormItem(){return this.formItem!==void 0?this.formItem:this.currentFormItem}},render(){const e=i.getDefaultSlots(this),{viewSlot:t,form:o,formItem:l,items:a,row:I,group:y,range:g,isWorkDay:d,isWorkHour:c,col:k,index:u,start:D,end:C,zonedStart:h,zonedEnd:m,navDay:S,itemsPerSlot:p,className:O}=this.$props,b=this.bv.selectedSlots.some(x=>s.compareSlots(x.cSlot,this.cSlot));let f;const E=n.createVNode(v.SchedulerViewSlot,{className:O,slotRender:this.$props.slotRender,isAllDay:this.isAllDay,expandable:this.expandable,editable:this.editable,items:a,row:I,group:y,range:g,isWorkDay:d,isWorkHour:c,col:k,index:u,start:D,end:C,zonedStart:h,zonedEnd:m,selected:b,navDay:S,itemsPerSlot:p,tabIndex:this.currentTabIndex,formItem:this.compFormItem,onFocus:this.handleFocus,onDoubleclick:this.handleDoubleClick,onKeydown:this.handleKeyDown,onShowmoreitems:this.handleShowMoreItemsClick},j(e)?e:{default:()=>[e]});return f=i.getTemplate.call(this,{h:n.h,template:this.$props.slotRender,defaultRendering:E,defaultSlots:e,additionalProps:{...this.cSlot,isAllDay:this.cSlot.isAllDay,expandable:this.expandable,editable:this.editable,items:a,row:this.cSlot.row,group:this.cSlot.group,range:this.cSlot.range,isWorkDay:d,isWorkHour:c,col:this.cSlot.col,index:u,start:this.cSlot.start,end:this.cSlot.end,zonedStart:h,zonedEnd:m,selected:b,navDay:S,itemsPerSlot:p,tabIndex:this.currentTabIndex},additionalListeners:{focus:this.handleFocus,doubleclick:this.handleDoubleClick,keydown:this.handleKeyDown,showmoreitems:this.handleShowMoreItemsClick}}),f},methods:{handleShowMoreItemsClick(e){this.$emit("showmoreitems",e)},createDataItemFromSlot(){const e={};if(s.setField(e,this.ks.fields.start,new Date(this.cSlot.start.getTime())),s.setField(e,this.ks.fields.end,new Date(this.cSlot.end.getTime())),s.setField(e,this.ks.fields.isAllDay,this.cSlot.isAllDay),this.cSlot.group.resources.length)for(let t=0;t<this.cSlot.group.resources.length;t++){const o=this.cSlot.group.resources[t];if(s.isGroupped(this.cSlot.group.resources)){const l=s.getField(this.cSlot.group.resources[t],o.valueField);s.setField(e,o.field,o.multiple?[l]:l)}else s.setField(e,o.field,o.multiple?[]:void 0)}return e},handleFocus(e){this.computedEditable.select&&this.dispatchSelectedSlots({type:w.SLOTS_SELECT_ACTION.select,slot:this},e.event),this.$emit("focus",e)},handleDoubleClick(e){if(this.computedEditable.add){const t=this.createDataItemFromSlot();this.setFormItem(t,e)}this.$emit("doubleclick",e)},handleKeyDown(e){let t,o,l;switch(e.event.keyCode){case i.Keys.left:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.left,slot:this},e.event);break;case i.Keys.right:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.right,slot:this},e.event);break;case i.Keys.up:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.up,slot:this},e.event);break;case i.Keys.down:if(!this.bv.slots)return;e.event.preventDefault(),this.dispatchFocusedSlots({type:r.SLOTS_FOCUS_ACTION.down,slot:this},e.event);break;case i.Keys.enter:if(!this.bv.slots||!this.computedEditable.add)return;l=this.createDataItemFromSlot(),this.setFormItem(l);break;case i.Keys.tab:o=s.findFirstItem(e.target),t=o?s.findCurrentItem(o,this.bv.items,!1):s.getSortedSlots(this.bv.items,this.ignoreIsAllDay)[0],this.dispatchFocusedItems({type:A.ITEMS_FOCUS_ACTION.current,item:t},e.event),this.dispatchSelectedItems({type:$.ITEMS_SELECT_ACTION.select,item:t},e);break}t&&e.event.preventDefault()},handleEditFormSubmit(e){this.$emit("dataaction",{type:T.DATA_ACTION.create,series:!1,dataItem:e.value},e),this.setFormItem(null,e.event)},handleEditFormCancel(e){this.setFormItem(null,e.event)},handleEditFormClose(e){this.setFormItem(null,e)},handleFormItemChange(e,t){this.setFormItem&&this.setFormItem(e,t)},setFormItem(e,t){this.currentFormItem=e,this.$emit("formitemchange",t)}}});exports.SchedulerEditSlot=_;
@@ -5,20 +5,21 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { defineComponent as C, createVNode as x, h as O, isVNode as T } from "vue";
8
+ import { defineComponent as C, createVNode as O, h as $, isVNode as T } from "vue";
9
9
  import { Keys as i, getDefaultSlots as A, getTemplate as j } from "@progress/kendo-vue-common";
10
10
  import { DATA_ACTION as N } from "../constants/main.mjs";
11
- import { findFirstItem as $, findCurrentItem as _, getSortedSlots as z, setField as l, isGroupped as R, getField as W, compareSlots as b } from "../utils/main.mjs";
12
- import { SchedulerViewSlot as B } from "./SchedulerViewSlot.mjs";
13
- import { SLOTS_SELECT_ACTION as K } from "../hooks/use-slots-selection.mjs";
14
- import { ITEMS_SELECT_ACTION as L } from "../hooks/use-items-selection.mjs";
15
- import { ITEMS_FOCUS_ACTION as M } from "../hooks/use-items-focus.mjs";
11
+ import { findFirstItem as R, findCurrentItem as _, getSortedSlots as z, setField as l, isGroupped as W, getField as B, compareSlots as b } from "../utils/main.mjs";
12
+ import { SchedulerViewSlot as K } from "./SchedulerViewSlot.mjs";
13
+ import { SLOTS_SELECT_ACTION as L } from "../hooks/use-slots-selection.mjs";
14
+ import { ITEMS_SELECT_ACTION as M } from "../hooks/use-items-selection.mjs";
15
+ import { ITEMS_FOCUS_ACTION as P } from "../hooks/use-items-focus.mjs";
16
16
  import { SLOTS_FOCUS_ACTION as r } from "../hooks/use-slots-focus.mjs";
17
- import { useEditable as P } from "../hooks/useEditable.mjs";
18
- function H(t) {
17
+ import { useEditable as H } from "../hooks/useEditable.mjs";
18
+ import { useSlotExpand as I } from "../hooks/useSlotExpand.mjs";
19
+ function V(t) {
19
20
  return typeof t == "function" || Object.prototype.toString.call(t) === "[object Object]" && !T(t);
20
21
  }
21
- const et = /* @__PURE__ */ C({
22
+ const ot = /* @__PURE__ */ C({
22
23
  name: "KendoSchedulerEditSlot",
23
24
  inheritAttrs: !1,
24
25
  props: {
@@ -61,6 +62,22 @@ const et = /* @__PURE__ */ C({
61
62
  created() {
62
63
  this.slot = null, this.editableSlot = null;
63
64
  },
65
+ mounted() {
66
+ if (this.$props.slotRender && this.$props.expandable) {
67
+ const t = this;
68
+ this.$nextTick(function() {
69
+ I(t, t.ks.scheduler.$el, t.$props.expandable);
70
+ });
71
+ }
72
+ },
73
+ updated() {
74
+ if (this.$props.slotRender && this.$props.expandable) {
75
+ const t = this;
76
+ this.$nextTick(function() {
77
+ I(t, t.ks.scheduler.$el, t.$props.expandable);
78
+ });
79
+ }
80
+ },
64
81
  provide() {
65
82
  return {
66
83
  ksEditFormSubmit: this.handleEditFormSubmit,
@@ -105,7 +122,7 @@ const et = /* @__PURE__ */ C({
105
122
  return this.$props.tabIndex !== void 0 ? this.$props.tabIndex === null ? void 0 : this.$props.tabIndex : this.bv.selectedSlots.length === 0 && t && this.cSlot.items.length === 0 ? 0 : void 0;
106
123
  },
107
124
  computedEditable() {
108
- return P(this.$props.editable);
125
+ return H(this.$props.editable);
109
126
  },
110
127
  compFormItem() {
111
128
  return this.formItem !== void 0 ? this.formItem : this.currentFormItem;
@@ -117,15 +134,15 @@ const et = /* @__PURE__ */ C({
117
134
  form: s,
118
135
  formItem: o,
119
136
  items: n,
120
- row: I,
121
- group: F,
137
+ row: F,
138
+ group: k,
122
139
  range: D,
123
140
  isWorkDay: a,
124
141
  isWorkHour: d,
125
142
  col: g,
126
143
  index: c,
127
144
  start: y,
128
- end: k,
145
+ end: x,
129
146
  zonedStart: h,
130
147
  zonedEnd: m,
131
148
  navDay: u,
@@ -133,22 +150,22 @@ const et = /* @__PURE__ */ C({
133
150
  className: E
134
151
  } = this.$props, S = this.bv.selectedSlots.some((w) => b(w.cSlot, this.cSlot));
135
152
  let f;
136
- const v = x(B, {
153
+ const v = O(K, {
137
154
  className: E,
138
155
  slotRender: this.$props.slotRender,
139
156
  isAllDay: this.isAllDay,
140
157
  expandable: this.expandable,
141
158
  editable: this.editable,
142
159
  items: n,
143
- row: I,
144
- group: F,
160
+ row: F,
161
+ group: k,
145
162
  range: D,
146
163
  isWorkDay: a,
147
164
  isWorkHour: d,
148
165
  col: g,
149
166
  index: c,
150
167
  start: y,
151
- end: k,
168
+ end: x,
152
169
  zonedStart: h,
153
170
  zonedEnd: m,
154
171
  selected: S,
@@ -160,11 +177,11 @@ const et = /* @__PURE__ */ C({
160
177
  onDoubleclick: this.handleDoubleClick,
161
178
  onKeydown: this.handleKeyDown,
162
179
  onShowmoreitems: this.handleShowMoreItemsClick
163
- }, H(t) ? t : {
180
+ }, V(t) ? t : {
164
181
  default: () => [t]
165
182
  });
166
183
  return f = j.call(this, {
167
- h: O,
184
+ h: $,
168
185
  template: this.$props.slotRender,
169
186
  defaultRendering: v,
170
187
  defaultSlots: t,
@@ -207,8 +224,8 @@ const et = /* @__PURE__ */ C({
207
224
  if (l(t, this.ks.fields.start, new Date(this.cSlot.start.getTime())), l(t, this.ks.fields.end, new Date(this.cSlot.end.getTime())), l(t, this.ks.fields.isAllDay, this.cSlot.isAllDay), this.cSlot.group.resources.length)
208
225
  for (let e = 0; e < this.cSlot.group.resources.length; e++) {
209
226
  const s = this.cSlot.group.resources[e];
210
- if (R(this.cSlot.group.resources)) {
211
- const o = W(this.cSlot.group.resources[e], s.valueField);
227
+ if (W(this.cSlot.group.resources)) {
228
+ const o = B(this.cSlot.group.resources[e], s.valueField);
212
229
  l(t, s.field, s.multiple ? [o] : o);
213
230
  } else
214
231
  l(t, s.field, s.multiple ? [] : void 0);
@@ -217,7 +234,7 @@ const et = /* @__PURE__ */ C({
217
234
  },
218
235
  handleFocus(t) {
219
236
  this.computedEditable.select && this.dispatchSelectedSlots({
220
- type: K.select,
237
+ type: L.select,
221
238
  slot: this
222
239
  }, t.event), this.$emit("focus", t);
223
240
  },
@@ -269,11 +286,11 @@ const et = /* @__PURE__ */ C({
269
286
  o = this.createDataItemFromSlot(), this.setFormItem(o);
270
287
  break;
271
288
  case i.tab:
272
- s = $(t.target), e = s ? _(s, this.bv.items, !1) : z(this.bv.items, this.ignoreIsAllDay)[0], this.dispatchFocusedItems({
273
- type: M.current,
289
+ s = R(t.target), e = s ? _(s, this.bv.items, !1) : z(this.bv.items, this.ignoreIsAllDay)[0], this.dispatchFocusedItems({
290
+ type: P.current,
274
291
  item: e
275
292
  }, t.event), this.dispatchSelectedItems({
276
- type: L.select,
293
+ type: M.select,
277
294
  item: e
278
295
  }, t);
279
296
  break;
@@ -302,5 +319,5 @@ const et = /* @__PURE__ */ C({
302
319
  }
303
320
  });
304
321
  export {
305
- et as SchedulerEditSlot
322
+ ot as SchedulerEditSlot
306
323
  };
@@ -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 t=require("vue"),g=require("../../slots/SchedulerEditSlot.js"),d=require("@progress/kendo-vue-intl"),k=require("../../tasks/SchedulerEditTask.js"),a=require("../../messages/main.js"),u=require("@progress/kendo-vue-common"),i=require("@progress/kendo-svg-icons"),S=t.defineComponent({name:"KendoAgendaViewBody",emits:["dataaction"],props:{items:Array,rangeIndex:Number,itemsPerSlot:Number,agendaSlots:Array,task:[String,Function,Object],editable:[Object,Boolean],onDataaction:Function},inject:{ri:{default:null},ks:{default:null},kendoIntlService:{default:null},kendoLocalizationService:{default:null},setSlots:{default:null}},provide(){return{ksSlots:this.ksSlots}},data(){return{hasMounted:!1,ksSlots:{cSlots:this.agendaSlots.filter(r=>r.group.index===(this.ri.groupIndex||0))}}},watch:{currentCellSlots(r){this.ksSlots.cSlots=r}},computed:{currentCellSlots(){return this.agendaSlots.filter(r=>r.group.index===(this.ri.groupIndex||0))}},mounted(){this.hasMounted=!0},render(){this.intl=d.provideIntlService(this);const r=this.$props.editSlot||g.SchedulerEditSlot,n=this.$props.editTask||k.SchedulerEditTask,o=d.provideLocalizationService(this);return t.createVNode("div",{class:"k-scheduler-body"},[this.currentCellSlots.map(function(s,l,h){return t.createVNode("div",{class:"k-scheduler-row k-scheduler-content",key:`${this.ri.groupIndex}:${l}`},[t.createVNode(r,{index:l,editable:this.$props.editable,row:h.length*(this.ri.groupIndex||0)+l,col:0,viewSlot:this.$props.viewSlot,onDataaction:this.handleDataAction,className:"k-scheduler-datecolumn k-group-cell"},{default:()=>[t.createVNode("div",null,[t.createVNode("strong",{class:"k-scheduler-agendaday"},[this.intl.formatDate(s.zonedStart,"dd")]),t.createVNode("em",{class:"k-scheduler-agendaweek"},[this.intl.formatDate(s.zonedStart,"EEEE")]),t.createVNode("span",{class:"k-scheduler-agendadate"},[this.intl.formatDate(s.zonedStart,"y")])])]}),t.createVNode("div",{class:"k-scheduler-cell k-group-content"},[this.hasMounted&&s.items.length?s.items.map(function(e,c){return t.createVNode("div",{class:"k-scheduler-row",key:c},[t.createVNode("div",{class:"k-scheduler-cell k-scheduler-timecolumn"},[t.createVNode("div",null,[e.tail&&t.createVNode(u.Icon,{name:this.ks.isRtl?"chevron-right":"chevron-left",icon:this.ks.isRtl?i.chevronRightIcon:i.chevronLeftIcon},null),e.isAllDay?o.toLanguageString(a.allDay,a.messages[a.allDay]):p(this.intl,e),e.head&&t.createVNode(u.Icon,{name:this.ks.isRtl?"chevron-left":"chevron-right",icon:this.ks.isRtl?i.chevronLeftIcon:i.chevronRightIcon},null)])]),t.createVNode("div",{class:"k-scheduler-cell"},[t.createVNode(n,{key:`${l}:${c}`,uid:e.uid,start:e.start,end:e.end,originalStart:e.originalStart,startTimezone:e.startTimezone,endTimezone:e.endTimezone,isAllDay:e.isAllDay,title:e.title,description:e.description,occurrenceId:e.occurrenceId,recurrenceExceptions:e.recurrenceExceptions,recurrenceRule:e.recurrenceRule,recurrenceId:e.recurrenceId,dataItem:e.dataItem,itemRef:e.itemRef,head:e.head,tail:e.tail,order:e.order,zonedStart:e.zonedStart,zonedEnd:e.zonedEnd,slots:e.slots,group:e.group,range:e.range,isException:e.isException,isRecurring:e.isRecurring,onDataaction:this.handleDataAction,task:this.$props.task,viewTask:this.$props.viewTask,editable:this.$props.editable},null)])])},this):t.createVNode("div",{class:"k-scheduler-cell k-heading-cell k-group-cell"},[o.toLanguageString(a.noEvents,a.messages[a.noEvents])])])])},this)])},methods:{handleDataAction(r){this.$emit("dataaction",r)}}}),p=(r,n)=>{let o="{0:t}-{1:t}";return n.head?o="{0:t}":n.tail&&(o="{1:t}"),r.format(o,n.zonedStart,n.zonedEnd)};exports.AgendaViewBody=S;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),g=require("../../slots/SchedulerEditSlot.js"),c=require("@progress/kendo-vue-intl"),S=require("../../tasks/SchedulerEditTask.js"),s=require("../../messages/main.js"),u=require("@progress/kendo-vue-common"),d=require("@progress/kendo-svg-icons"),p=t.defineComponent({name:"KendoAgendaViewBody",emits:["dataaction"],props:{items:Array,rangeIndex:Number,itemsPerSlot:Number,agendaSlots:Array,task:[String,Function,Object],editable:[Object,Boolean],onDataaction:Function},inject:{ri:{default:null},ks:{default:null},ksMobile:{default:()=>()=>!1},kendoIntlService:{default:null},kendoLocalizationService:{default:null},setSlots:{default:null}},provide(){return{ksSlots:this.ksSlots}},data(){return{hasMounted:!1,ksSlots:{cSlots:this.agendaSlots.filter(a=>a.group.index===(this.ri.groupIndex||0))}}},watch:{currentCellSlots(a){this.ksSlots.cSlots=a}},computed:{currentCellSlots(){return this.agendaSlots.filter(a=>a.group.index===(this.ri.groupIndex||0))}},mounted(){this.hasMounted=!0},render(){this.intl=c.provideIntlService(this);const a=this.$props.editSlot||g.SchedulerEditSlot,n=this.$props.editTask||S.SchedulerEditTask,o=c.provideLocalizationService(this),h=typeof this.ksMobile=="function"?this.ksMobile():!1;return t.createVNode("div",{class:"k-scheduler-body"},[this.currentCellSlots.map(function(r,l,k){return t.createVNode("div",{class:"k-scheduler-row k-scheduler-content",key:`${this.ri.groupIndex}:${l}`},[t.createVNode(a,{index:l,editable:this.$props.editable,row:k.length*(this.ri.groupIndex||0)+l,col:0,viewSlot:this.$props.viewSlot,onDataaction:this.handleDataAction,className:"k-scheduler-datecolumn k-group-cell"},{default:()=>[h?t.createVNode("div",{class:"k-scheduler-datecolumn-wrap"},[t.createVNode("span",{class:"k-mobile-scheduler-agendadate"},[t.createVNode("span",{class:"k-mobile-scheduler-agendaday"},[this.intl.formatDate(r.zonedStart,"dd")]),t.createTextVNode(" "),t.createVNode("span",{class:"k-mobile-scheduler-agendamonth"},[this.intl.formatDate(r.zonedStart,"MMMM")])]),t.createVNode("span",{class:"k-mobile-scheduler-agendaweekday"},[this.intl.formatDate(r.zonedStart,"EEEE")])]):t.createVNode("div",null,[t.createVNode("strong",{class:"k-scheduler-agendaday"},[this.intl.formatDate(r.zonedStart,"dd")]),t.createVNode("em",{class:"k-scheduler-agendaweek"},[this.intl.formatDate(r.zonedStart,"EEEE")]),t.createVNode("span",{class:"k-scheduler-agendadate"},[this.intl.formatDate(r.zonedStart,"y")])])]}),t.createVNode("div",{class:"k-scheduler-cell k-group-content"},[this.hasMounted&&r.items.length?r.items.map(function(e,i){return t.createVNode("div",{class:"k-scheduler-row",key:i},[t.createVNode("div",{class:"k-scheduler-cell k-scheduler-timecolumn"},[t.createVNode("div",null,[e.tail&&t.createVNode(u.Icon,{name:this.ks.isRtl?"chevron-right":"chevron-left",icon:this.ks.isRtl?d.chevronRightIcon:d.chevronLeftIcon},null),e.isAllDay?o.toLanguageString(s.allDay,s.messages[s.allDay]):f(this.intl,e),e.head&&t.createVNode(u.Icon,{name:this.ks.isRtl?"chevron-left":"chevron-right",icon:this.ks.isRtl?d.chevronLeftIcon:d.chevronRightIcon},null)])]),t.createVNode("div",{class:"k-scheduler-cell"},[t.createVNode(n,{key:`${l}:${i}`,uid:e.uid,start:e.start,end:e.end,originalStart:e.originalStart,startTimezone:e.startTimezone,endTimezone:e.endTimezone,isAllDay:e.isAllDay,title:e.title,description:e.description,occurrenceId:e.occurrenceId,recurrenceExceptions:e.recurrenceExceptions,recurrenceRule:e.recurrenceRule,recurrenceId:e.recurrenceId,dataItem:e.dataItem,itemRef:e.itemRef,head:e.head,tail:e.tail,order:e.order,zonedStart:e.zonedStart,zonedEnd:e.zonedEnd,slots:e.slots,group:e.group,range:e.range,isException:e.isException,isRecurring:e.isRecurring,onDataaction:this.handleDataAction,task:this.$props.task,viewTask:this.$props.viewTask,editable:this.$props.editable},null)])])},this):t.createVNode("div",{class:"k-scheduler-cell k-heading-cell k-group-cell"},[o.toLanguageString(s.noEvents,s.messages[s.noEvents])])])])},this)])},methods:{handleDataAction(a){this.$emit("dataaction",a)}}}),f=(a,n)=>{let o="{0:t}-{1:t}";return n.head?o="{0:t}":n.tail&&(o="{1:t}"),a.format(o,n.zonedStart,n.zonedEnd)};exports.AgendaViewBody=p;