@progress/kendo-vue-scheduler 10.0.0 → 10.0.1-develop.2

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.
@@ -524,10 +524,6 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
524
524
  name: StringConstructor;
525
525
  accessKey: StringConstructor;
526
526
  checked: {
527
- /**
528
- * Overrides the component used for visualizing the `allDay` field editor.
529
- * The [Kendo UI for Vue Switch]({% slug overview_switch %}) component is used, by default.
530
- */
531
527
  type: BooleanConstructor;
532
528
  default: any;
533
529
  };
@@ -537,7 +533,10 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
537
533
  default: boolean;
538
534
  };
539
535
  defaultChecked: {
540
- type: BooleanConstructor;
536
+ type: BooleanConstructor; /**
537
+ * Overrides the component used for visualizing the `recurrenceRule` field editor.
538
+ * A custom made RecurrenceEditor component is used, by default.
539
+ */
541
540
  default: boolean;
542
541
  };
543
542
  size: {
@@ -628,10 +627,6 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
628
627
  name: StringConstructor;
629
628
  accessKey: StringConstructor;
630
629
  checked: {
631
- /**
632
- * Overrides the component used for visualizing the `allDay` field editor.
633
- * The [Kendo UI for Vue Switch]({% slug overview_switch %}) component is used, by default.
634
- */
635
630
  type: BooleanConstructor;
636
631
  default: any;
637
632
  };
@@ -641,7 +636,10 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
641
636
  default: boolean;
642
637
  };
643
638
  defaultChecked: {
644
- type: BooleanConstructor;
639
+ type: BooleanConstructor; /**
640
+ * Overrides the component used for visualizing the `recurrenceRule` field editor.
641
+ * A custom made RecurrenceEditor component is used, by default.
642
+ */
645
643
  default: boolean;
646
644
  };
647
645
  size: {
@@ -1449,10 +1447,6 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
1449
1447
  name: StringConstructor;
1450
1448
  accessKey: StringConstructor;
1451
1449
  checked: {
1452
- /**
1453
- * Overrides the component used for visualizing the `allDay` field editor.
1454
- * The [Kendo UI for Vue Switch]({% slug overview_switch %}) component is used, by default.
1455
- */
1456
1450
  type: BooleanConstructor;
1457
1451
  default: any;
1458
1452
  };
@@ -1462,7 +1456,10 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
1462
1456
  default: boolean;
1463
1457
  };
1464
1458
  defaultChecked: {
1465
- type: BooleanConstructor;
1459
+ type: BooleanConstructor; /**
1460
+ * Overrides the component used for visualizing the `recurrenceRule` field editor.
1461
+ * A custom made RecurrenceEditor component is used, by default.
1462
+ */
1466
1463
  default: boolean;
1467
1464
  };
1468
1465
  size: {
@@ -1553,10 +1550,6 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
1553
1550
  name: StringConstructor;
1554
1551
  accessKey: StringConstructor;
1555
1552
  checked: {
1556
- /**
1557
- * Overrides the component used for visualizing the `allDay` field editor.
1558
- * The [Kendo UI for Vue Switch]({% slug overview_switch %}) component is used, by default.
1559
- */
1560
1553
  type: BooleanConstructor;
1561
1554
  default: any;
1562
1555
  };
@@ -1566,7 +1559,10 @@ declare const SchedulerFormEditor: import('vue').DefineComponent<import('vue').E
1566
1559
  default: boolean;
1567
1560
  };
1568
1561
  defaultChecked: {
1569
- type: BooleanConstructor;
1562
+ type: BooleanConstructor; /**
1563
+ * Overrides the component used for visualizing the `recurrenceRule` field editor.
1564
+ * A custom made RecurrenceEditor component is used, by default.
1565
+ */
1570
1566
  default: boolean;
1571
1567
  };
1572
1568
  size: {
@@ -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 l=require("../views/common/utils.js"),b=require("../constants/main.js"),d=require("@progress/kendo-vue-common"),E=6,T=(t,$,i)=>{let m=0;const u=e=>e.nodeType===8?e.parentElement:e.nodeType===3?e.nextElementSibling:e,S=()=>{if(!t)return;const e=u(t.$el);e&&(e.style.minHeight=t.$props.slotStyle&&t.$props.slotStyle.minHeight?t.$props.slotStyle.minHeight:null,m=e.clientHeight)},a=()=>{if(!i||!t)return;const e=u(t.$el);if(!e||!t.bv.items.length)return;const p=l.getPadding(e);let c=0;const r=t.cSlot.items.filter(n=>n.refTo),f=t.$props.itemsPerSlot,g=f!==void 0?r.filter((n,o)=>o<f):r;g.forEach(n=>{const o=t.bv.items.find(H=>H.uid===n.uid);if(!o)return;const{height:y}=l.getRect(o.getElement());c+=y});let s=d.isObject(i)&&i.offsetBottom?i.offsetBottom:0;if(s>0){const n=e.querySelector(".k-more-events");if(n){const o=parseFloat(window.getComputedStyle(n).bottom)||0;s=n.offsetHeight+o+E}}let h=g.length*b.BORDER_WIDTH*2+c-(p||0)+(d.isObject(i)&&i.offsetTop?i.offsetTop:0)+s;r.length?h>m-p&&l.setRect(e,{height:h},!0):e&&(e.style.minHeight=t.$props.slotStyle&&t.$props.slotStyle.minHeight?t.$props.slotStyle.minHeight:null)};S(),a()};exports.useSlotExpand=T;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../views/common/utils.js"),H=require("../constants/main.js"),a=require("@progress/kendo-vue-common"),T=6,O=(t,B,i)=>{let m=0;const u=e=>e.nodeType===8?e.parentElement:e.nodeType===3?e.nextElementSibling:e,f=e=>{const o=t.$props.slotStyle;o&&Object.prototype.hasOwnProperty.call(o,"minHeight")&&(e.style.minHeight=o.minHeight)},S=()=>{if(!t)return;const e=u(t.$el);e&&(f(e),m=e.clientHeight)},y=()=>{if(!i||!t)return;const e=u(t.$el);if(!e||!t.bv.items.length)return;const o=c.getPadding(e);let g=0;const s=t.cSlot.items.filter(n=>n.refTo),h=t.$props.itemsPerSlot,d=h!==void 0?s.filter((n,r)=>r<h):s;d.forEach(n=>{const r=t.bv.items.find(E=>E.uid===n.uid);if(!r)return;const{height:b}=c.getRect(r.getElement());g+=b});let l=a.isObject(i)&&i.offsetBottom?i.offsetBottom:0;if(l>0){const n=e.querySelector(".k-more-events");if(n){const r=parseFloat(window.getComputedStyle(n).bottom)||0;l=n.offsetHeight+r+T}}let p=d.length*H.BORDER_WIDTH*2+g-(o||0)+(a.isObject(i)&&i.offsetTop?i.offsetTop:0)+l;s.length?p>m-o&&c.setRect(e,{height:p},!0):e&&f(e)};S(),y()};exports.useSlotExpand=O;
@@ -5,49 +5,52 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { getPadding as a, getRect as E, setRect as T } from "../views/common/utils.mjs";
9
- import { BORDER_WIDTH as $ } from "../constants/main.mjs";
10
- import { isObject as c } from "@progress/kendo-vue-common";
11
- const b = 6, _ = (e, B, n) => {
8
+ import { getPadding as E, getRect as T, setRect as b } from "../views/common/utils.mjs";
9
+ import { BORDER_WIDTH as O } from "../constants/main.mjs";
10
+ import { isObject as d } from "@progress/kendo-vue-common";
11
+ const B = 6, v = (e, x, i) => {
12
12
  let l = 0;
13
- const m = (t) => t.nodeType === 8 ? t.parentElement : t.nodeType === 3 ? t.nextElementSibling : t, d = () => {
13
+ const f = (t) => t.nodeType === 8 ? t.parentElement : t.nodeType === 3 ? t.nextElementSibling : t, c = (t) => {
14
+ const o = e.$props.slotStyle;
15
+ o && Object.prototype.hasOwnProperty.call(o, "minHeight") && (t.style.minHeight = o.minHeight);
16
+ }, a = () => {
14
17
  if (!e)
15
18
  return;
16
- const t = m(e.$el);
17
- t && (t.style.minHeight = e.$props.slotStyle && e.$props.slotStyle.minHeight ? e.$props.slotStyle.minHeight : null, l = t.clientHeight);
19
+ const t = f(e.$el);
20
+ t && (c(t), l = t.clientHeight);
18
21
  }, S = () => {
19
- if (!n || !e)
22
+ if (!i || !e)
20
23
  return;
21
- const t = m(e.$el);
24
+ const t = f(e.$el);
22
25
  if (!t || !e.bv.items.length)
23
26
  return;
24
- const p = a(t);
25
- let f = 0;
26
- const r = e.cSlot.items.filter((i) => i.refTo), h = e.$props.itemsPerSlot, g = h !== void 0 ? r.filter((i, o) => o < h) : r;
27
- g.forEach((i) => {
28
- const o = e.bv.items.find((H) => H.uid === i.uid);
29
- if (!o)
27
+ const o = E(t);
28
+ let p = 0;
29
+ const s = e.cSlot.items.filter((n) => n.refTo), h = e.$props.itemsPerSlot, g = h !== void 0 ? s.filter((n, r) => r < h) : s;
30
+ g.forEach((n) => {
31
+ const r = e.bv.items.find((H) => H.uid === n.uid);
32
+ if (!r)
30
33
  return;
31
34
  const {
32
35
  height: y
33
- } = E(o.getElement());
34
- f += y;
36
+ } = T(r.getElement());
37
+ p += y;
35
38
  });
36
- let s = c(n) && n.offsetBottom ? n.offsetBottom : 0;
37
- if (s > 0) {
38
- const i = t.querySelector(".k-more-events");
39
- if (i) {
40
- const o = parseFloat(window.getComputedStyle(i).bottom) || 0;
41
- s = i.offsetHeight + o + b;
39
+ let m = d(i) && i.offsetBottom ? i.offsetBottom : 0;
40
+ if (m > 0) {
41
+ const n = t.querySelector(".k-more-events");
42
+ if (n) {
43
+ const r = parseFloat(window.getComputedStyle(n).bottom) || 0;
44
+ m = n.offsetHeight + r + B;
42
45
  }
43
46
  }
44
- let u = g.length * $ * 2 + f - (p || 0) + (c(n) && n.offsetTop ? n.offsetTop : 0) + s;
45
- r.length ? u > l - p && T(t, {
47
+ let u = g.length * O * 2 + p - (o || 0) + (d(i) && i.offsetTop ? i.offsetTop : 0) + m;
48
+ s.length ? u > l - o && b(t, {
46
49
  height: u
47
- }, !0) : t && (t.style.minHeight = e.$props.slotStyle && e.$props.slotStyle.minHeight ? e.$props.slotStyle.minHeight : null);
50
+ }, !0) : t && c(t);
48
51
  };
49
- d(), S();
52
+ a(), S();
50
53
  };
51
54
  export {
52
- _ as useSlotExpand
55
+ v as useSlotExpand
53
56
  };
@@ -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: 1788866707,version:"10.0.0",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: 1788964513,version:"10.0.1-develop.2",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: 1788866707,
14
- version: "10.0.0",
13
+ publishDate: 1788964513,
14
+ version: "10.0.1-develop.2",
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": "10.0.0",
3
+ "version": "10.0.1-develop.2",
4
4
  "description": "TODO",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -27,16 +27,16 @@
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": "10.0.0",
31
- "@progress/kendo-vue-buttons": "10.0.0",
32
- "@progress/kendo-vue-dateinputs": "10.0.0",
33
- "@progress/kendo-vue-dialogs": "10.0.0",
34
- "@progress/kendo-vue-dropdowns": "10.0.0",
35
- "@progress/kendo-vue-form": "10.0.0",
36
- "@progress/kendo-vue-inputs": "10.0.0",
37
- "@progress/kendo-vue-intl": "10.0.0",
38
- "@progress/kendo-vue-popup": "10.0.0",
39
- "@progress/kendo-vue-tooltip": "10.0.0",
30
+ "@progress/kendo-vue-common": "10.0.1-develop.2",
31
+ "@progress/kendo-vue-buttons": "10.0.1-develop.2",
32
+ "@progress/kendo-vue-dateinputs": "10.0.1-develop.2",
33
+ "@progress/kendo-vue-dialogs": "10.0.1-develop.2",
34
+ "@progress/kendo-vue-dropdowns": "10.0.1-develop.2",
35
+ "@progress/kendo-vue-form": "10.0.1-develop.2",
36
+ "@progress/kendo-vue-inputs": "10.0.1-develop.2",
37
+ "@progress/kendo-vue-intl": "10.0.1-develop.2",
38
+ "@progress/kendo-vue-popup": "10.0.1-develop.2",
39
+ "@progress/kendo-vue-tooltip": "10.0.1-develop.2",
40
40
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
41
41
  "vue": "^3.0.2"
42
42
  },
@@ -61,7 +61,7 @@
61
61
  "package": {
62
62
  "productName": "Kendo UI for Vue",
63
63
  "productCode": "KENDOUIVUE",
64
- "publishDate": 1788866707,
64
+ "publishDate": 1788964513,
65
65
  "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"
66
66
  }
67
67
  },
@@ -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"),T=require("../constants/main.js"),s=require("../utils/main.js"),v=require("./SchedulerViewSlot.js"),w=require("../hooks/use-slots-selection.js"),A=require("../hooks/use-items-selection.js"),$=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:{role:String,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(){const e=this;this.$nextTick(function(){F.useSlotExpand(e,e.ks.scheduler.$el,e.$props.expandable)})},updated(){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),{role:t,viewSlot:o,form:l,formItem:q,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,{role:t,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:$.ITEMS_FOCUS_ACTION.current,item:t},e.event),this.dispatchSelectedItems({type:A.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=_;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("vue"),i=require("@progress/kendo-vue-common"),x=require("../constants/main.js"),s=require("../utils/main.js"),T=require("./SchedulerViewSlot.js"),w=require("../hooks/use-slots-selection.js"),A=require("../hooks/use-items-selection.js"),$=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:{role:String,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(){const e=this;this.$nextTick(function(){F.useSlotExpand(e,e.ks.scheduler.$el,e.$props.expandable)})},updated(){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),{role:t,viewSlot:o,form:l,formItem:q,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(v=>s.compareSlots(v.cSlot,this.cSlot));let f;const E=n.createVNode(T.SchedulerViewSlot,{role:t,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.viewSlot,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:$.ITEMS_FOCUS_ACTION.current,item:t},e.event),this.dispatchSelectedItems({type:A.ITEMS_SELECT_ACTION.select,item:t},e);break}t&&e.event.preventDefault()},handleEditFormSubmit(e){this.$emit("dataaction",{type:x.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,7 +8,7 @@
8
8
  import { defineComponent as C, createVNode as O, h as T, isVNode as $ } 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 z, getSortedSlots as R, setField as l, isGroupped as W, getField as B, compareSlots as b } from "../utils/main.mjs";
11
+ import { findFirstItem as _, findCurrentItem as z, getSortedSlots as W, setField as l, isGroupped as B, getField as R, compareSlots as b } from "../utils/main.mjs";
12
12
  import { SchedulerViewSlot as K } from "./SchedulerViewSlot.mjs";
13
13
  import { SLOTS_SELECT_ACTION as L } from "../hooks/use-slots-selection.mjs";
14
14
  import { ITEMS_SELECT_ACTION as M } from "../hooks/use-items-selection.mjs";
@@ -181,7 +181,7 @@ const it = /* @__PURE__ */ C({
181
181
  });
182
182
  return f = j.call(this, {
183
183
  h: T,
184
- template: this.$props.slotRender,
184
+ template: this.$props.viewSlot,
185
185
  defaultRendering: v,
186
186
  defaultSlots: t,
187
187
  additionalProps: {
@@ -223,8 +223,8 @@ const it = /* @__PURE__ */ C({
223
223
  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)
224
224
  for (let e = 0; e < this.cSlot.group.resources.length; e++) {
225
225
  const s = this.cSlot.group.resources[e];
226
- if (W(this.cSlot.group.resources)) {
227
- const o = B(this.cSlot.group.resources[e], s.valueField);
226
+ if (B(this.cSlot.group.resources)) {
227
+ const o = R(this.cSlot.group.resources[e], s.valueField);
228
228
  l(t, s.field, s.multiple ? [o] : o);
229
229
  } else
230
230
  l(t, s.field, s.multiple ? [] : void 0);
@@ -285,7 +285,7 @@ const it = /* @__PURE__ */ C({
285
285
  o = this.createDataItemFromSlot(), this.setFormItem(o);
286
286
  break;
287
287
  case i.tab:
288
- s = _(t.target), e = s ? z(s, this.bv.items, !1) : R(this.bv.items, this.ignoreIsAllDay)[0], this.dispatchFocusedItems({
288
+ s = _(t.target), e = s ? z(s, this.bv.items, !1) : W(this.bv.items, this.ignoreIsAllDay)[0], this.dispatchFocusedItems({
289
289
  type: P.current,
290
290
  item: e
291
291
  }, t.event), this.dispatchSelectedItems({