vue-cal 4.9.0 → 4.10.0

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.
Files changed (138) hide show
  1. package/dist/drag-and-drop.amd.js +4 -3
  2. package/dist/drag-and-drop.cjs.js +4 -3
  3. package/dist/drag-and-drop.es.js +235 -69
  4. package/dist/i18n/ar.amd.js +3 -2
  5. package/dist/i18n/ar.cjs.js +4 -3
  6. package/dist/i18n/ar.es.js +64 -16
  7. package/dist/i18n/bg.amd.js +3 -2
  8. package/dist/i18n/bg.cjs.js +4 -3
  9. package/dist/i18n/bg.es.js +64 -16
  10. package/dist/i18n/bn.amd.js +3 -2
  11. package/dist/i18n/bn.cjs.js +4 -3
  12. package/dist/i18n/bn.es.js +64 -16
  13. package/dist/i18n/bs.amd.js +3 -2
  14. package/dist/i18n/bs.cjs.js +4 -3
  15. package/dist/i18n/bs.es.js +64 -16
  16. package/dist/i18n/ca.amd.js +3 -2
  17. package/dist/i18n/ca.cjs.js +4 -3
  18. package/dist/i18n/ca.es.js +75 -17
  19. package/dist/i18n/cs.amd.js +3 -2
  20. package/dist/i18n/cs.cjs.js +4 -3
  21. package/dist/i18n/cs.es.js +64 -16
  22. package/dist/i18n/da.amd.js +3 -2
  23. package/dist/i18n/da.cjs.js +4 -3
  24. package/dist/i18n/da.es.js +64 -16
  25. package/dist/i18n/de.amd.js +3 -2
  26. package/dist/i18n/de.cjs.js +4 -3
  27. package/dist/i18n/de.es.js +64 -16
  28. package/dist/i18n/el.amd.js +3 -2
  29. package/dist/i18n/el.cjs.js +4 -3
  30. package/dist/i18n/el.es.js +86 -19
  31. package/dist/i18n/en.amd.js +3 -2
  32. package/dist/i18n/en.cjs.js +4 -3
  33. package/dist/i18n/en.es.js +64 -16
  34. package/dist/i18n/es.amd.js +3 -2
  35. package/dist/i18n/es.cjs.js +4 -3
  36. package/dist/i18n/es.es.js +64 -16
  37. package/dist/i18n/et.amd.js +3 -2
  38. package/dist/i18n/et.cjs.js +4 -3
  39. package/dist/i18n/et.es.js +64 -16
  40. package/dist/i18n/fa.amd.js +3 -2
  41. package/dist/i18n/fa.cjs.js +4 -3
  42. package/dist/i18n/fa.es.js +64 -16
  43. package/dist/i18n/fi.amd.js +3 -2
  44. package/dist/i18n/fi.cjs.js +4 -3
  45. package/dist/i18n/fi.es.js +64 -16
  46. package/dist/i18n/fr.amd.js +3 -2
  47. package/dist/i18n/fr.cjs.js +4 -3
  48. package/dist/i18n/fr.es.js +64 -16
  49. package/dist/i18n/he.amd.js +3 -2
  50. package/dist/i18n/he.cjs.js +4 -3
  51. package/dist/i18n/he.es.js +64 -16
  52. package/dist/i18n/hr.amd.js +3 -2
  53. package/dist/i18n/hr.cjs.js +4 -3
  54. package/dist/i18n/hr.es.js +64 -16
  55. package/dist/i18n/hu.amd.js +3 -2
  56. package/dist/i18n/hu.cjs.js +4 -3
  57. package/dist/i18n/hu.es.js +64 -16
  58. package/dist/i18n/id.amd.js +3 -2
  59. package/dist/i18n/id.cjs.js +4 -3
  60. package/dist/i18n/id.es.js +64 -16
  61. package/dist/i18n/is.amd.js +3 -2
  62. package/dist/i18n/is.cjs.js +4 -3
  63. package/dist/i18n/is.es.js +64 -16
  64. package/dist/i18n/it.amd.js +3 -2
  65. package/dist/i18n/it.cjs.js +4 -3
  66. package/dist/i18n/it.es.js +64 -16
  67. package/dist/i18n/ja.amd.js +3 -2
  68. package/dist/i18n/ja.cjs.js +4 -3
  69. package/dist/i18n/ja.es.js +64 -16
  70. package/dist/i18n/ka.amd.js +3 -2
  71. package/dist/i18n/ka.cjs.js +4 -3
  72. package/dist/i18n/ka.es.js +64 -16
  73. package/dist/i18n/ko.amd.js +3 -2
  74. package/dist/i18n/ko.cjs.js +4 -3
  75. package/dist/i18n/ko.es.js +64 -16
  76. package/dist/i18n/lt.amd.js +3 -2
  77. package/dist/i18n/lt.cjs.js +4 -3
  78. package/dist/i18n/lt.es.js +64 -16
  79. package/dist/i18n/mn.amd.js +3 -2
  80. package/dist/i18n/mn.cjs.js +4 -3
  81. package/dist/i18n/mn.es.js +64 -16
  82. package/dist/i18n/nl.amd.js +3 -2
  83. package/dist/i18n/nl.cjs.js +4 -3
  84. package/dist/i18n/nl.es.js +64 -16
  85. package/dist/i18n/no.amd.js +3 -2
  86. package/dist/i18n/no.cjs.js +4 -3
  87. package/dist/i18n/no.es.js +64 -16
  88. package/dist/i18n/pl.amd.js +3 -2
  89. package/dist/i18n/pl.cjs.js +4 -3
  90. package/dist/i18n/pl.es.js +64 -16
  91. package/dist/i18n/pt-br.amd.js +3 -2
  92. package/dist/i18n/pt-br.cjs.js +4 -3
  93. package/dist/i18n/pt-br.es.js +64 -16
  94. package/dist/i18n/pt-pt.amd.js +3 -2
  95. package/dist/i18n/pt-pt.cjs.js +4 -3
  96. package/dist/i18n/pt-pt.es.js +64 -16
  97. package/dist/i18n/ro.amd.js +3 -2
  98. package/dist/i18n/ro.cjs.js +4 -3
  99. package/dist/i18n/ro.es.js +64 -16
  100. package/dist/i18n/ru.amd.js +3 -2
  101. package/dist/i18n/ru.cjs.js +4 -3
  102. package/dist/i18n/ru.es.js +75 -17
  103. package/dist/i18n/sk.amd.js +3 -2
  104. package/dist/i18n/sk.cjs.js +4 -3
  105. package/dist/i18n/sk.es.js +64 -16
  106. package/dist/i18n/sl.amd.js +3 -2
  107. package/dist/i18n/sl.cjs.js +4 -3
  108. package/dist/i18n/sl.es.js +64 -16
  109. package/dist/i18n/sq.amd.js +3 -2
  110. package/dist/i18n/sq.cjs.js +4 -3
  111. package/dist/i18n/sq.es.js +75 -17
  112. package/dist/i18n/sr.amd.js +3 -2
  113. package/dist/i18n/sr.cjs.js +4 -3
  114. package/dist/i18n/sr.es.js +64 -16
  115. package/dist/i18n/sv.amd.js +3 -2
  116. package/dist/i18n/sv.cjs.js +4 -3
  117. package/dist/i18n/sv.es.js +64 -16
  118. package/dist/i18n/tr.amd.js +3 -2
  119. package/dist/i18n/tr.cjs.js +4 -3
  120. package/dist/i18n/tr.es.js +64 -16
  121. package/dist/i18n/uk.amd.js +3 -2
  122. package/dist/i18n/uk.cjs.js +4 -3
  123. package/dist/i18n/uk.es.js +75 -17
  124. package/dist/i18n/vi.amd.js +3 -2
  125. package/dist/i18n/vi.cjs.js +4 -3
  126. package/dist/i18n/vi.es.js +75 -17
  127. package/dist/i18n/zh-cn.amd.js +3 -2
  128. package/dist/i18n/zh-cn.cjs.js +4 -3
  129. package/dist/i18n/zh-cn.es.js +75 -17
  130. package/dist/i18n/zh-hk.amd.js +3 -2
  131. package/dist/i18n/zh-hk.cjs.js +4 -3
  132. package/dist/i18n/zh-hk.es.js +75 -17
  133. package/dist/vue-cal.amd.js +4 -4
  134. package/dist/vue-cal.cjs.js +4 -4
  135. package/dist/vue-cal.es.js +3398 -916
  136. package/dist/vue-cal.iife.js +1 -2
  137. package/dist/vuecal.css +1 -1
  138. package/package.json +18 -19
@@ -1,5 +1,6 @@
1
- var M=Object.defineProperty;var y=(o,c,u)=>c in o?M(o,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):o[c]=u;var w=(o,c,u)=>(y(o,typeof c!="symbol"?c+"":c,u),u);/**
2
- * vue-cal v4.9.0
1
+ var __defProp=Object.defineProperty,__defNormalProp=(e,t,l)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[t]=l,__publicField=(e,t,l)=>__defNormalProp(e,"symbol"!=typeof t?t+"":t,l)
2
+ /**
3
+ * vue-cal v4.10.0
3
4
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
5
  * @license MIT
5
- */define(["exports"],function(o){"use strict";let u=null,d=null,h={id:null,date:null},f=!1,m=!0,s={el:null,cell:null,timeout:null};const n={_eid:null,fromVueCal:null,toVueCal:null},D=class{constructor(t){w(this,"_vuecal");this._vuecal=t}_getEventStart(t){const{timeStep:e,timeCellHeight:l,timeFrom:a,utils:r}=this._vuecal;let{y:i}=r.cell.getPosition(t);return i-=t.dataTransfer.getData("cursor-grab-at")*1,Math.round(i*e/parseInt(l)+a)}_updateEventStartEnd(t,e,l,a){const r=l.duration*1||e.endTimeMinutes-e.startTimeMinutes;let i=Math.max(this._getEventStart(t),0);if(this._vuecal.snapToTime){const g=i+this._vuecal.snapToTime/2;i=g-g%this._vuecal.snapToTime}e.startTimeMinutes=i,e.start=new Date(new Date(a).setMinutes(i)),e.endTimeMinutes=Math.min(i+r,24*60),e.end=new Date(new Date(a).setMinutes(e.endTimeMinutes))}eventDragStart(t,e){if(t.target.nodeType===3)return t.preventDefault();t.dataTransfer.dropEffect="move",t.dataTransfer.setData("event",JSON.stringify(e)),t.dataTransfer.setData("cursor-grab-at",t.offsetY);const{clickHoldAnEvent:l}=this._vuecal.domEvents;setTimeout(()=>{l._eid=null,clearTimeout(l.timeoutId),e.deleting=!1},0),this._vuecal.domEvents.dragAnEvent._eid=e._eid,n._eid=e._eid,n.fromVueCal=this._vuecal._.uid,e.dragging=!0,setTimeout(()=>e.draggingStatic=!0,0),f=!1,h={id:this._vuecal.view.id,date:this._vuecal.view.startDate},m=!0}eventDragEnd(t){this._vuecal.domEvents.dragAnEvent._eid=null,n._eid=null,t.dragging=!1,t.draggingStatic=!1;const{fromVueCal:e,toVueCal:l}=n;l&&e!==l&&this._vuecal.utils.event.deleteAnEvent(t),n.fromVueCal=null,n.toVueCal=null,f&&m&&h.id&&this._vuecal.switchView(h.id,h.date,!0)}cellDragEnter(t,e,l){const a=t.currentTarget;if(!t.currentTarget.contains(t.relatedTarget)){if(a===s.el||!a.className.includes("vuecal__cell-content"))return!1;s.el&&(s.cell.highlighted=!1),s={el:a,cell:e,timeout:clearTimeout(s.timeout)},e.highlighted=!0,["years","year","month"].includes(this._vuecal.view.id)&&(s.timeout=setTimeout(()=>this._vuecal.switchToNarrowerView(l),2e3))}}cellDragOver(t,e,l,a){t.preventDefault(),e.highlighted=!0,(a||a===0)&&(e.highlightedSplit=a)}cellDragLeave(t,e){t.preventDefault(),!t.currentTarget.contains(t.relatedTarget)&&(e.highlightedSplit=!1,s.cell===e&&(clearTimeout(s.timeout),s={el:null,cell:null,timeout:null},e.highlighted=!1))}cellDragDrop(t,e,l,a){t.preventDefault(),clearTimeout(s.timeout),s={el:null,cell:null,timeout:null};const r=JSON.parse(t.dataTransfer.getData("event")||"{}");let i,g;if(n.fromVueCal!==this._vuecal._.uid){const{_eid:v,start:S,end:V,duration:T,...C}=r;i=this._vuecal.utils.event.createAnEvent(l,T,{...C,split:a})}else if(i=this._vuecal.view.events.find(v=>v._eid===n._eid),i||(i=this._vuecal.mutableEvents.find(v=>v._eid===n._eid),g=!!i),!i){const v=r.endTimeMinutes-r.startTimeMinutes,{start:S,end:V,...T}=r;i=this._vuecal.utils.event.createAnEvent(l,v,{...T,split:a})}const{start:E,split:p}=i;this._updateEventStartEnd(t,i,r,l),g&&this._vuecal.addEventsToView([i]),i.dragging=!1,(a||a===0)&&(i.split=a),e.highlighted=!1,e.highlightedSplit=null,m=!1,n.toVueCal=this._vuecal._.uid;const _={event:this._vuecal.cleanupEvent(i),oldDate:E,newDate:i.start,...(a||a===0)&&{oldSplit:p,newSplit:a},originalEvent:this._vuecal.cleanupEvent(r),external:!n.fromVueCal};this._vuecal.$emit("event-drop",_),this._vuecal.$emit("event-change",{event:_.event,originalEvent:_.originalEvent}),setTimeout(()=>{n._eid&&this.eventDragEnd(i)},300)}viewSelectorDragEnter(t,e,l){t.currentTarget.contains(t.relatedTarget)||(l.highlightedControl=e,clearTimeout(u),u=setTimeout(()=>{if(["previous","next"].includes(e))this._vuecal[e](),clearInterval(d),d=setInterval(this._vuecal[e],800);else if(e==="today"){clearInterval(d);let a;this._vuecal.view.id.includes("year")&&(a=this._vuecal.enabledViews.filter(r=>!r.includes("year"))[0]),this._vuecal.switchView(a||this._vuecal.view.id,new Date(new Date().setHours(0,0,0,0)),!0)}else this._vuecal.switchView(e,null,!0);f=!0},800))}viewSelectorDragLeave(t,e,l){t.currentTarget.contains(t.relatedTarget)||l.highlightedControl===e&&(l.highlightedControl=null,u&&(u=clearTimeout(u)),d&&(d=clearInterval(d)))}};o.DragAndDrop=D,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
6
+ */;define(["exports"],(function(e){"use strict";let t=null,l=null,i={id:null,date:null},a=!1,n=!0,r={el:null,cell:null,timeout:null};const u={_eid:null,fromVueCal:null,toVueCal:null};e.DragAndDrop=class{constructor(e){__publicField(this,"_vuecal"),this._vuecal=e}_getEventStart(e){const{timeStep:t,timeCellHeight:l,timeFrom:i,utils:a}=this._vuecal;let{y:n}=a.cell.getPosition(e);return n-=1*e.dataTransfer.getData("cursor-grab-at"),Math.round(n*t/parseInt(l)+i)}_updateEventStartEnd(e,t,l,i){const a=1*l.duration||t.endTimeMinutes-t.startTimeMinutes;let n=Math.max(this._getEventStart(e),0);if(this._vuecal.snapToTime){const e=n+this._vuecal.snapToTime/2;n=e-e%this._vuecal.snapToTime}t.startTimeMinutes=n,t.start=new Date(new Date(i).setMinutes(n)),t.endTimeMinutes=Math.min(n+a,1440),t.end=new Date(new Date(i).setMinutes(t.endTimeMinutes))}eventDragStart(e,t){if(3===e.target.nodeType)return e.preventDefault();e.dataTransfer.dropEffect="move",e.dataTransfer.setData("event",JSON.stringify(t)),e.dataTransfer.setData("cursor-grab-at",e.offsetY);const{clickHoldAnEvent:l}=this._vuecal.domEvents;setTimeout((()=>{l._eid=null,clearTimeout(l.timeoutId),t.deleting=!1}),0),this._vuecal.domEvents.dragAnEvent._eid=t._eid,u._eid=t._eid,u.fromVueCal=this._vuecal._.uid,t.dragging=!0,setTimeout((()=>t.draggingStatic=!0),0),a=!1,i={id:this._vuecal.view.id,date:this._vuecal.view.startDate},n=!0}eventDragEnd(e){this._vuecal.domEvents.dragAnEvent._eid=null,u._eid=null,e.dragging=!1,e.draggingStatic=!1;const{fromVueCal:t,toVueCal:l}=u;l&&t!==l&&this._vuecal.utils.event.deleteAnEvent(e),u.fromVueCal=null,u.toVueCal=null,a&&n&&i.id&&this._vuecal.switchView(i.id,i.date,!0)}cellDragEnter(e,t,l){const i=e.currentTarget;if(!e.currentTarget.contains(e.relatedTarget)){if(i===r.el||!i.className.includes("vuecal__cell-content"))return!1;r.el&&(r.cell.highlighted=!1),r={el:i,cell:t,timeout:clearTimeout(r.timeout)},t.highlighted=!0,["years","year","month"].includes(this._vuecal.view.id)&&(r.timeout=setTimeout((()=>this._vuecal.switchToNarrowerView(l)),2e3))}}cellDragOver(e,t,l,i){e.preventDefault(),t.highlighted=!0,(i||0===i)&&(t.highlightedSplit=i)}cellDragLeave(e,t){e.preventDefault(),e.currentTarget.contains(e.relatedTarget)||(t.highlightedSplit=!1,r.cell===t&&(clearTimeout(r.timeout),r={el:null,cell:null,timeout:null},t.highlighted=!1))}cellDragDrop(e,t,l,i){e.preventDefault(),clearTimeout(r.timeout),r={el:null,cell:null,timeout:null};const a=JSON.parse(e.dataTransfer.getData("event")||"{}");let s,c;if(u.fromVueCal!==this._vuecal._.uid){const{_eid:e,start:t,end:n,duration:r,...u}=a;s=this._vuecal.utils.event.createAnEvent(l,r,{...u,split:i})}else if(s=this._vuecal.view.events.find((e=>e._eid===u._eid)),s||(s=this._vuecal.mutableEvents.find((e=>e._eid===u._eid)),c=!!s),!s){const e=a.endTimeMinutes-a.startTimeMinutes,{start:t,end:n,...r}=a;s=this._vuecal.utils.event.createAnEvent(l,e,{...r,split:i})}const{start:o,split:d}=s;this._updateEventStartEnd(e,s,a,l),c&&this._vuecal.addEventsToView([s]),s.dragging=!1,(i||0===i)&&(s.split=i),t.highlighted=!1,t.highlightedSplit=null,n=!1,u.toVueCal=this._vuecal._.uid;const v={event:this._vuecal.cleanupEvent(s),oldDate:o,newDate:s.start,...(i||0===i)&&{oldSplit:d,newSplit:i},originalEvent:this._vuecal.cleanupEvent(a),external:!u.fromVueCal};this._vuecal.$emit("event-drop",v),this._vuecal.$emit("event-change",{event:v.event,originalEvent:v.originalEvent}),setTimeout((()=>{u._eid&&this.eventDragEnd(s)}),300)}viewSelectorDragEnter(e,i,n){e.currentTarget.contains(e.relatedTarget)||(n.highlightedControl=i,clearTimeout(t),t=setTimeout((()=>{if(["previous","next"].includes(i))this._vuecal[i](),clearInterval(l),l=setInterval(this._vuecal[i],800);else if("today"===i){let e;clearInterval(l),this._vuecal.view.id.includes("year")&&(e=this._vuecal.enabledViews.filter((e=>!e.includes("year")))[0]),this._vuecal.switchView(e||this._vuecal.view.id,new Date((new Date).setHours(0,0,0,0)),!0)}else this._vuecal.switchView(i,null,!0);a=!0}),800))}viewSelectorDragLeave(e,i,a){e.currentTarget.contains(e.relatedTarget)||a.highlightedControl===i&&(a.highlightedControl=null,t&&(t=clearTimeout(t)),l&&(l=clearInterval(l)))}},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -1,5 +1,6 @@
1
- "use strict";var V=Object.defineProperty;var C=(t,e,a)=>e in t?V(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a;var _=(t,e,a)=>(C(t,typeof e!="symbol"?e+"":e,a),a);/**
2
- * vue-cal v4.9.0
1
+ "use strict";var e=Object.defineProperty,t=(t,l,i)=>((t,l,i)=>l in t?e(t,l,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[l]=i)(t,"symbol"!=typeof l?l+"":l,i)
2
+ /**
3
+ * vue-cal v4.10.0
3
4
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
5
  * @license MIT
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=800;let d=null,c=null,v={id:null,date:null},f=!1,m=!0,u={el:null,cell:null,timeout:null};const r={_eid:null,fromVueCal:null,toVueCal:null},M=class{constructor(t){_(this,"_vuecal");this._vuecal=t}_getEventStart(t){const{timeStep:e,timeCellHeight:a,timeFrom:i,utils:n}=this._vuecal;let{y:l}=n.cell.getPosition(t);return l-=t.dataTransfer.getData("cursor-grab-at")*1,Math.round(l*e/parseInt(a)+i)}_updateEventStartEnd(t,e,a,i){const n=a.duration*1||e.endTimeMinutes-e.startTimeMinutes;let l=Math.max(this._getEventStart(t),0);if(this._vuecal.snapToTime){const o=l+this._vuecal.snapToTime/2;l=o-o%this._vuecal.snapToTime}e.startTimeMinutes=l,e.start=new Date(new Date(i).setMinutes(l)),e.endTimeMinutes=Math.min(l+n,24*60),e.end=new Date(new Date(i).setMinutes(e.endTimeMinutes))}eventDragStart(t,e){if(t.target.nodeType===3)return t.preventDefault();t.dataTransfer.dropEffect="move",t.dataTransfer.setData("event",JSON.stringify(e)),t.dataTransfer.setData("cursor-grab-at",t.offsetY);const{clickHoldAnEvent:a}=this._vuecal.domEvents;setTimeout(()=>{a._eid=null,clearTimeout(a.timeoutId),e.deleting=!1},0),this._vuecal.domEvents.dragAnEvent._eid=e._eid,r._eid=e._eid,r.fromVueCal=this._vuecal._.uid,e.dragging=!0,setTimeout(()=>e.draggingStatic=!0,0),f=!1,v={id:this._vuecal.view.id,date:this._vuecal.view.startDate},m=!0}eventDragEnd(t){this._vuecal.domEvents.dragAnEvent._eid=null,r._eid=null,t.dragging=!1,t.draggingStatic=!1;const{fromVueCal:e,toVueCal:a}=r;a&&e!==a&&this._vuecal.utils.event.deleteAnEvent(t),r.fromVueCal=null,r.toVueCal=null,f&&m&&v.id&&this._vuecal.switchView(v.id,v.date,!0)}cellDragEnter(t,e,a){const i=t.currentTarget;if(!t.currentTarget.contains(t.relatedTarget)){if(i===u.el||!i.className.includes("vuecal__cell-content"))return!1;u.el&&(u.cell.highlighted=!1),u={el:i,cell:e,timeout:clearTimeout(u.timeout)},e.highlighted=!0,["years","year","month"].includes(this._vuecal.view.id)&&(u.timeout=setTimeout(()=>this._vuecal.switchToNarrowerView(a),2e3))}}cellDragOver(t,e,a,i){t.preventDefault(),e.highlighted=!0,(i||i===0)&&(e.highlightedSplit=i)}cellDragLeave(t,e){t.preventDefault(),!t.currentTarget.contains(t.relatedTarget)&&(e.highlightedSplit=!1,u.cell===e&&(clearTimeout(u.timeout),u={el:null,cell:null,timeout:null},e.highlighted=!1))}cellDragDrop(t,e,a,i){t.preventDefault(),clearTimeout(u.timeout),u={el:null,cell:null,timeout:null};const n=JSON.parse(t.dataTransfer.getData("event")||"{}");let l,o;if(r.fromVueCal!==this._vuecal._.uid){const{_eid:s,start:E,end:p,duration:h,...S}=n;l=this._vuecal.utils.event.createAnEvent(a,h,{...S,split:i})}else if(l=this._vuecal.view.events.find(s=>s._eid===r._eid),l||(l=this._vuecal.mutableEvents.find(s=>s._eid===r._eid),o=!!l),!l){const s=n.endTimeMinutes-n.startTimeMinutes,{start:E,end:p,...h}=n;l=this._vuecal.utils.event.createAnEvent(a,s,{...h,split:i})}const{start:w,split:D}=l;this._updateEventStartEnd(t,l,n,a),o&&this._vuecal.addEventsToView([l]),l.dragging=!1,(i||i===0)&&(l.split=i),e.highlighted=!1,e.highlightedSplit=null,m=!1,r.toVueCal=this._vuecal._.uid;const g={event:this._vuecal.cleanupEvent(l),oldDate:w,newDate:l.start,...(i||i===0)&&{oldSplit:D,newSplit:i},originalEvent:this._vuecal.cleanupEvent(n),external:!r.fromVueCal};this._vuecal.$emit("event-drop",g),this._vuecal.$emit("event-change",{event:g.event,originalEvent:g.originalEvent}),setTimeout(()=>{r._eid&&this.eventDragEnd(l)},300)}viewSelectorDragEnter(t,e,a){t.currentTarget.contains(t.relatedTarget)||(a.highlightedControl=e,clearTimeout(d),d=setTimeout(()=>{if(["previous","next"].includes(e))this._vuecal[e](),clearInterval(c),c=setInterval(this._vuecal[e],T);else if(e==="today"){clearInterval(c);let i;this._vuecal.view.id.includes("year")&&(i=this._vuecal.enabledViews.filter(n=>!n.includes("year"))[0]),this._vuecal.switchView(i||this._vuecal.view.id,new Date(new Date().setHours(0,0,0,0)),!0)}else this._vuecal.switchView(e,null,!0);f=!0},T))}viewSelectorDragLeave(t,e,a){t.currentTarget.contains(t.relatedTarget)||a.highlightedControl===e&&(a.highlightedControl=null,d&&(d=clearTimeout(d)),c&&(c=clearInterval(c)))}};exports.DragAndDrop=M;
6
+ */;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let l=null,i=null,a={id:null,date:null},n=!1,r=!0,u={el:null,cell:null,timeout:null};const s={_eid:null,fromVueCal:null,toVueCal:null};exports.DragAndDrop=class{constructor(e){t(this,"_vuecal"),this._vuecal=e}_getEventStart(e){const{timeStep:t,timeCellHeight:l,timeFrom:i,utils:a}=this._vuecal;let{y:n}=a.cell.getPosition(e);return n-=1*e.dataTransfer.getData("cursor-grab-at"),Math.round(n*t/parseInt(l)+i)}_updateEventStartEnd(e,t,l,i){const a=1*l.duration||t.endTimeMinutes-t.startTimeMinutes;let n=Math.max(this._getEventStart(e),0);if(this._vuecal.snapToTime){const e=n+this._vuecal.snapToTime/2;n=e-e%this._vuecal.snapToTime}t.startTimeMinutes=n,t.start=new Date(new Date(i).setMinutes(n)),t.endTimeMinutes=Math.min(n+a,1440),t.end=new Date(new Date(i).setMinutes(t.endTimeMinutes))}eventDragStart(e,t){if(3===e.target.nodeType)return e.preventDefault();e.dataTransfer.dropEffect="move",e.dataTransfer.setData("event",JSON.stringify(t)),e.dataTransfer.setData("cursor-grab-at",e.offsetY);const{clickHoldAnEvent:l}=this._vuecal.domEvents;setTimeout((()=>{l._eid=null,clearTimeout(l.timeoutId),t.deleting=!1}),0),this._vuecal.domEvents.dragAnEvent._eid=t._eid,s._eid=t._eid,s.fromVueCal=this._vuecal._.uid,t.dragging=!0,setTimeout((()=>t.draggingStatic=!0),0),n=!1,a={id:this._vuecal.view.id,date:this._vuecal.view.startDate},r=!0}eventDragEnd(e){this._vuecal.domEvents.dragAnEvent._eid=null,s._eid=null,e.dragging=!1,e.draggingStatic=!1;const{fromVueCal:t,toVueCal:l}=s;l&&t!==l&&this._vuecal.utils.event.deleteAnEvent(e),s.fromVueCal=null,s.toVueCal=null,n&&r&&a.id&&this._vuecal.switchView(a.id,a.date,!0)}cellDragEnter(e,t,l){const i=e.currentTarget;if(!e.currentTarget.contains(e.relatedTarget)){if(i===u.el||!i.className.includes("vuecal__cell-content"))return!1;u.el&&(u.cell.highlighted=!1),u={el:i,cell:t,timeout:clearTimeout(u.timeout)},t.highlighted=!0,["years","year","month"].includes(this._vuecal.view.id)&&(u.timeout=setTimeout((()=>this._vuecal.switchToNarrowerView(l)),2e3))}}cellDragOver(e,t,l,i){e.preventDefault(),t.highlighted=!0,(i||0===i)&&(t.highlightedSplit=i)}cellDragLeave(e,t){e.preventDefault(),e.currentTarget.contains(e.relatedTarget)||(t.highlightedSplit=!1,u.cell===t&&(clearTimeout(u.timeout),u={el:null,cell:null,timeout:null},t.highlighted=!1))}cellDragDrop(e,t,l,i){e.preventDefault(),clearTimeout(u.timeout),u={el:null,cell:null,timeout:null};const a=JSON.parse(e.dataTransfer.getData("event")||"{}");let n,c;if(s.fromVueCal!==this._vuecal._.uid){const{_eid:e,start:t,end:r,duration:u,...s}=a;n=this._vuecal.utils.event.createAnEvent(l,u,{...s,split:i})}else if(n=this._vuecal.view.events.find((e=>e._eid===s._eid)),n||(n=this._vuecal.mutableEvents.find((e=>e._eid===s._eid)),c=!!n),!n){const e=a.endTimeMinutes-a.startTimeMinutes,{start:t,end:r,...u}=a;n=this._vuecal.utils.event.createAnEvent(l,e,{...u,split:i})}const{start:o,split:d}=n;this._updateEventStartEnd(e,n,a,l),c&&this._vuecal.addEventsToView([n]),n.dragging=!1,(i||0===i)&&(n.split=i),t.highlighted=!1,t.highlightedSplit=null,r=!1,s.toVueCal=this._vuecal._.uid;const v={event:this._vuecal.cleanupEvent(n),oldDate:o,newDate:n.start,...(i||0===i)&&{oldSplit:d,newSplit:i},originalEvent:this._vuecal.cleanupEvent(a),external:!s.fromVueCal};this._vuecal.$emit("event-drop",v),this._vuecal.$emit("event-change",{event:v.event,originalEvent:v.originalEvent}),setTimeout((()=>{s._eid&&this.eventDragEnd(n)}),300)}viewSelectorDragEnter(e,t,a){e.currentTarget.contains(e.relatedTarget)||(a.highlightedControl=t,clearTimeout(l),l=setTimeout((()=>{if(["previous","next"].includes(t))this._vuecal[t](),clearInterval(i),i=setInterval(this._vuecal[t],800);else if("today"===t){let e;clearInterval(i),this._vuecal.view.id.includes("year")&&(e=this._vuecal.enabledViews.filter((e=>!e.includes("year")))[0]),this._vuecal.switchView(e||this._vuecal.view.id,new Date((new Date).setHours(0,0,0,0)),!0)}else this._vuecal.switchView(t,null,!0);n=!0}),800))}viewSelectorDragLeave(e,t,a){e.currentTarget.contains(e.relatedTarget)||a.highlightedControl===t&&(a.highlightedControl=null,l&&(l=clearTimeout(l)),i&&(i=clearInterval(i)))}};
@@ -1,93 +1,259 @@
1
- var S = Object.defineProperty;
2
- var V = (t, e, l) => e in t ? S(t, e, { enumerable: !0, configurable: !0, writable: !0, value: l }) : t[e] = l;
3
- var T = (t, e, l) => (V(t, typeof e != "symbol" ? e + "" : e, l), l);
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  /**
5
- * vue-cal v4.9.0
5
+ * vue-cal v4.10.0
6
6
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
7
7
  * @license MIT
8
8
  */
9
- let o = null, c = null, v = { id: null, date: null }, _ = !1, m = !0, u = { el: null, cell: null, timeout: null };
10
- const r = { _eid: null, fromVueCal: null, toVueCal: null }, M = class {
11
- constructor(t) {
12
- T(this, "_vuecal");
13
- this._vuecal = t;
9
+ const holdOverTimeout = 800;
10
+ let changeViewTimeout = null;
11
+ let pressPrevOrNextInterval = null;
12
+ let viewBeforeDrag = { id: null, date: null };
13
+ let viewChanged = false;
14
+ let cancelViewChange = true;
15
+ let dragOverCell = { el: null, cell: null, timeout: null };
16
+ const dragging = {
17
+ _eid: null,
18
+ fromVueCal: null,
19
+ toVueCal: null
20
+ };
21
+ const DragAndDrop = class {
22
+ constructor(vuecal) {
23
+ __publicField(this, "_vuecal");
24
+ this._vuecal = vuecal;
14
25
  }
15
- _getEventStart(t) {
16
- const { timeStep: e, timeCellHeight: l, timeFrom: i, utils: n } = this._vuecal;
17
- let { y: a } = n.cell.getPosition(t);
18
- return a -= 1 * t.dataTransfer.getData("cursor-grab-at"), Math.round(a * e / parseInt(l) + i);
26
+ /**
27
+ * When click and drag an event the cursor can be anywhere in the event,
28
+ * when dropping the event, we need to subtract the cursor position in the event.
29
+ *
30
+ * @param {Object} e The associated DOM event.
31
+ */
32
+ _getEventStart(e) {
33
+ const { timeStep, timeCellHeight, timeFrom, utils } = this._vuecal;
34
+ let { y } = utils.cell.getPosition(e);
35
+ y -= e.dataTransfer.getData("cursor-grab-at") * 1;
36
+ return Math.round(y * timeStep / parseInt(timeCellHeight) + timeFrom);
19
37
  }
20
- _updateEventStartEnd(t, e, l, i) {
21
- const n = 1 * l.duration || e.endTimeMinutes - e.startTimeMinutes;
22
- let a = Math.max(this._getEventStart(t), 0);
38
+ /**
39
+ * On drop, update the event start and end date directly into the event.
40
+ *
41
+ * @param {Object} e The associated DOM event.
42
+ * @param {Object} event The event being dragged.
43
+ * @param {Object} transferData The transfer data from the HTML5 dragging event.
44
+ * @param {Date} cellDate The hovered cell starting date.
45
+ */
46
+ _updateEventStartEnd(e, event, transferData, cellDate) {
47
+ const eventDuration = transferData.duration * 1 || event.endTimeMinutes - event.startTimeMinutes;
48
+ let startTimeMinutes = Math.max(this._getEventStart(e), 0);
23
49
  if (this._vuecal.snapToTime) {
24
- const d = a + this._vuecal.snapToTime / 2;
25
- a = d - d % this._vuecal.snapToTime;
50
+ const plusHalfSnapTime = startTimeMinutes + this._vuecal.snapToTime / 2;
51
+ startTimeMinutes = plusHalfSnapTime - plusHalfSnapTime % this._vuecal.snapToTime;
26
52
  }
27
- e.startTimeMinutes = a, e.start = new Date(new Date(i).setMinutes(a)), e.endTimeMinutes = Math.min(a + n, 1440), e.end = new Date(new Date(i).setMinutes(e.endTimeMinutes));
53
+ event.startTimeMinutes = startTimeMinutes;
54
+ event.start = new Date(new Date(cellDate).setMinutes(startTimeMinutes));
55
+ event.endTimeMinutes = Math.min(startTimeMinutes + eventDuration, 24 * 60);
56
+ event.end = new Date(new Date(cellDate).setMinutes(event.endTimeMinutes));
28
57
  }
29
- eventDragStart(t, e) {
30
- if (t.target.nodeType === 3)
31
- return t.preventDefault();
32
- t.dataTransfer.dropEffect = "move", t.dataTransfer.setData("event", JSON.stringify(e)), t.dataTransfer.setData("cursor-grab-at", t.offsetY);
33
- const { clickHoldAnEvent: l } = this._vuecal.domEvents;
58
+ /**
59
+ * On event drag start, only possible if editableEvent is true.
60
+ * /!\ This is using the native HTML5 drag & drop, not supported on touch devices.
61
+ *
62
+ * @param {Object} e The associated DOM event.
63
+ * @param {Object} event The event being dragged.
64
+ */
65
+ eventDragStart(e, event) {
66
+ if (e.target.nodeType === 3) return e.preventDefault();
67
+ e.dataTransfer.dropEffect = "move";
68
+ e.dataTransfer.setData("event", JSON.stringify(event));
69
+ e.dataTransfer.setData("cursor-grab-at", e.offsetY);
70
+ const { clickHoldAnEvent } = this._vuecal.domEvents;
34
71
  setTimeout(() => {
35
- l._eid = null, clearTimeout(l.timeoutId), e.deleting = !1;
36
- }, 0), this._vuecal.domEvents.dragAnEvent._eid = e._eid, r._eid = e._eid, r.fromVueCal = this._vuecal._.uid, e.dragging = !0, setTimeout(() => e.draggingStatic = !0, 0), _ = !1, v = { id: this._vuecal.view.id, date: this._vuecal.view.startDate }, m = !0;
72
+ clickHoldAnEvent._eid = null;
73
+ clearTimeout(clickHoldAnEvent.timeoutId);
74
+ event.deleting = false;
75
+ }, 0);
76
+ this._vuecal.domEvents.dragAnEvent._eid = event._eid;
77
+ dragging._eid = event._eid;
78
+ dragging.fromVueCal = this._vuecal._.uid;
79
+ event.dragging = true;
80
+ setTimeout(() => event.draggingStatic = true, 0);
81
+ viewChanged = false;
82
+ viewBeforeDrag = { id: this._vuecal.view.id, date: this._vuecal.view.startDate };
83
+ cancelViewChange = true;
37
84
  }
38
- eventDragEnd(t) {
39
- this._vuecal.domEvents.dragAnEvent._eid = null, r._eid = null, t.dragging = !1, t.draggingStatic = !1;
40
- const { fromVueCal: e, toVueCal: l } = r;
41
- l && e !== l && this._vuecal.utils.event.deleteAnEvent(t), r.fromVueCal = null, r.toVueCal = null, _ && m && v.id && this._vuecal.switchView(v.id, v.date, !0);
85
+ /**
86
+ * On event drag end, when releasing the event.
87
+ *
88
+ * @param {Object} event The event being dragged.
89
+ */
90
+ eventDragEnd(event) {
91
+ this._vuecal.domEvents.dragAnEvent._eid = null;
92
+ dragging._eid = null;
93
+ event.dragging = false;
94
+ event.draggingStatic = false;
95
+ const { fromVueCal, toVueCal } = dragging;
96
+ if (toVueCal && fromVueCal !== toVueCal) this._vuecal.utils.event.deleteAnEvent(event);
97
+ dragging.fromVueCal = null;
98
+ dragging.toVueCal = null;
99
+ if (viewChanged && cancelViewChange && viewBeforeDrag.id) this._vuecal.switchView(viewBeforeDrag.id, viewBeforeDrag.date, true);
42
100
  }
43
- cellDragEnter(t, e, l) {
44
- const i = t.currentTarget;
45
- if (!t.currentTarget.contains(t.relatedTarget)) {
46
- if (i === u.el || !i.className.includes("vuecal__cell-content"))
47
- return !1;
48
- u.el && (u.cell.highlighted = !1), u = { el: i, cell: e, timeout: clearTimeout(u.timeout) }, e.highlighted = !0, ["years", "year", "month"].includes(this._vuecal.view.id) && (u.timeout = setTimeout(() => this._vuecal.switchToNarrowerView(l), 2e3));
101
+ /**
102
+ * On cell/split enter with a dragging event.
103
+ * Highlight the cell, and if on `years`, `year`, `month` view,
104
+ * set a timer to go deeper on drag hold over this cell.
105
+ *
106
+ * @param {Object} e The associated DOM event.
107
+ * @param {Object} cell The cell component's $data.
108
+ * @param {Date} cellDate The hovered cell starting date.
109
+ */
110
+ cellDragEnter(e, cell, cellDate) {
111
+ const target = e.currentTarget;
112
+ if (e.currentTarget.contains(e.relatedTarget)) return;
113
+ if (target === dragOverCell.el || !target.className.includes("vuecal__cell-content")) return false;
114
+ if (dragOverCell.el) dragOverCell.cell.highlighted = false;
115
+ dragOverCell = { el: target, cell, timeout: clearTimeout(dragOverCell.timeout) };
116
+ cell.highlighted = true;
117
+ if (["years", "year", "month"].includes(this._vuecal.view.id)) {
118
+ dragOverCell.timeout = setTimeout(() => this._vuecal.switchToNarrowerView(cellDate), 2e3);
49
119
  }
50
120
  }
51
- cellDragOver(t, e, l, i) {
52
- t.preventDefault(), e.highlighted = !0, (i || i === 0) && (e.highlightedSplit = i);
121
+ /**
122
+ * On cell/split drag over, highlight the cell being hovered,
123
+ * Useful when starting to drag event on the same cell/split it's in.
124
+ * Warning: This is fired repeatedly as long as you stay over this cell/split.
125
+ *
126
+ * @param {Object} e The associated DOM event.
127
+ * @param {Object} cell The cell component's $data.
128
+ * @param {Date} cellDate The hovered cell starting date.
129
+ * @param {Number|String} split The optional split being hovered if any.
130
+ */
131
+ cellDragOver(e, cell, cellDate, split) {
132
+ e.preventDefault();
133
+ cell.highlighted = true;
134
+ if (split || split === 0) cell.highlightedSplit = split;
53
135
  }
54
- cellDragLeave(t, e) {
55
- t.preventDefault(), t.currentTarget.contains(t.relatedTarget) || (e.highlightedSplit = !1, u.cell === e && (clearTimeout(u.timeout), u = { el: null, cell: null, timeout: null }, e.highlighted = !1));
136
+ /**
137
+ * When event drag leaves a cell/split.
138
+ * Remove the cell/split highlighted state.
139
+ * Warning: cell dragleave event happens AFTER another cell dragenter!
140
+ *
141
+ * @param {Object} e The associated DOM event.
142
+ * @param {Object} cell The cell component's $data.
143
+ */
144
+ cellDragLeave(e, cell) {
145
+ e.preventDefault();
146
+ if (e.currentTarget.contains(e.relatedTarget)) return;
147
+ cell.highlightedSplit = false;
148
+ if (dragOverCell.cell === cell) {
149
+ clearTimeout(dragOverCell.timeout);
150
+ dragOverCell = { el: null, cell: null, timeout: null };
151
+ cell.highlighted = false;
152
+ }
56
153
  }
57
- cellDragDrop(t, e, l, i) {
58
- t.preventDefault(), clearTimeout(u.timeout), u = { el: null, cell: null, timeout: null };
59
- const n = JSON.parse(t.dataTransfer.getData("event") || "{}");
60
- let a, d;
61
- if (r.fromVueCal !== this._vuecal._.uid) {
62
- const { _eid: s, start: D, end: w, duration: g, ...E } = n;
63
- a = this._vuecal.utils.event.createAnEvent(l, g, { ...E, split: i });
64
- } else if (a = this._vuecal.view.events.find((s) => s._eid === r._eid), a || (a = this._vuecal.mutableEvents.find((s) => s._eid === r._eid), d = !!a), !a) {
65
- const s = n.endTimeMinutes - n.startTimeMinutes, { start: D, end: w, ...g } = n;
66
- a = this._vuecal.utils.event.createAnEvent(l, s, { ...g, split: i });
154
+ /**
155
+ * On successful event drop into a cell/split.
156
+ * Change the event start and end time and remove the event dragging state
157
+ * and cell/split highlighted state.
158
+ *
159
+ * @param {Object} e The associated DOM event.
160
+ * @param {Object} cell The cell component's $data.
161
+ * @param {Date} cellDate The hovered cell starting date.
162
+ * @param {Number|String} split The optional split being dropped into, if any.
163
+ */
164
+ cellDragDrop(e, cell, cellDate, split) {
165
+ e.preventDefault();
166
+ clearTimeout(dragOverCell.timeout);
167
+ dragOverCell = { el: null, cell: null, timeout: null };
168
+ const transferData = JSON.parse(e.dataTransfer.getData("event") || "{}");
169
+ let event, addToView;
170
+ if (dragging.fromVueCal !== this._vuecal._.uid) {
171
+ const { _eid, start, end, duration, ...cleanTransferData } = transferData;
172
+ event = this._vuecal.utils.event.createAnEvent(cellDate, duration, { ...cleanTransferData, split });
173
+ } else {
174
+ event = this._vuecal.view.events.find((evt) => evt._eid === dragging._eid);
175
+ if (!event) {
176
+ event = this._vuecal.mutableEvents.find((evt) => evt._eid === dragging._eid);
177
+ addToView = !!event;
178
+ }
179
+ if (!event) {
180
+ const duration = transferData.endTimeMinutes - transferData.startTimeMinutes;
181
+ const { start, end, ...cleanTransferData } = transferData;
182
+ event = this._vuecal.utils.event.createAnEvent(cellDate, duration, { ...cleanTransferData, split });
183
+ }
67
184
  }
68
- const { start: f, split: p } = a;
69
- this._updateEventStartEnd(t, a, n, l), d && this._vuecal.addEventsToView([a]), a.dragging = !1, (i || i === 0) && (a.split = i), e.highlighted = !1, e.highlightedSplit = null, m = !1, r.toVueCal = this._vuecal._.uid;
70
- const h = { event: this._vuecal.cleanupEvent(a), oldDate: f, newDate: a.start, ...(i || i === 0) && { oldSplit: p, newSplit: i }, originalEvent: this._vuecal.cleanupEvent(n), external: !r.fromVueCal };
71
- this._vuecal.$emit("event-drop", h), this._vuecal.$emit("event-change", { event: h.event, originalEvent: h.originalEvent }), setTimeout(() => {
72
- r._eid && this.eventDragEnd(a);
185
+ const { start: oldDate, split: oldSplit } = event;
186
+ this._updateEventStartEnd(e, event, transferData, cellDate);
187
+ if (addToView) this._vuecal.addEventsToView([event]);
188
+ event.dragging = false;
189
+ if (split || split === 0) event.split = split;
190
+ cell.highlighted = false;
191
+ cell.highlightedSplit = null;
192
+ cancelViewChange = false;
193
+ dragging.toVueCal = this._vuecal._.uid;
194
+ const params = {
195
+ event: this._vuecal.cleanupEvent(event),
196
+ oldDate,
197
+ newDate: event.start,
198
+ ...(split || split === 0) && { oldSplit, newSplit: split },
199
+ originalEvent: this._vuecal.cleanupEvent(transferData),
200
+ external: !dragging.fromVueCal
201
+ // If external event, not coming from any Vue Cal.
202
+ };
203
+ this._vuecal.$emit("event-drop", params);
204
+ this._vuecal.$emit("event-change", { event: params.event, originalEvent: params.originalEvent });
205
+ setTimeout(() => {
206
+ if (dragging._eid) this.eventDragEnd(event);
73
207
  }, 300);
74
208
  }
75
- viewSelectorDragEnter(t, e, l) {
76
- t.currentTarget.contains(t.relatedTarget) || (l.highlightedControl = e, clearTimeout(o), o = setTimeout(() => {
77
- if (["previous", "next"].includes(e))
78
- this._vuecal[e](), clearInterval(c), c = setInterval(this._vuecal[e], 800);
79
- else if (e === "today") {
80
- let i;
81
- clearInterval(c), this._vuecal.view.id.includes("year") && (i = this._vuecal.enabledViews.filter((n) => !n.includes("year"))[0]), this._vuecal.switchView(i || this._vuecal.view.id, new Date(new Date().setHours(0, 0, 0, 0)), !0);
82
- } else
83
- this._vuecal.switchView(e, null, !0);
84
- _ = !0;
85
- }, 800));
209
+ /**
210
+ * On drag enter on a view button or on today, prev & next buttons.
211
+ * Sets a highlighted state on the hovered button, and go to requested view.
212
+ *
213
+ * @param {Object} e The associated DOM event.
214
+ * @param {String} id The id of the header element being hovered. One of:
215
+ * previous, next, today, years, year, month, week, day.
216
+ * @param {Object} headerData The header component's $data.
217
+ */
218
+ viewSelectorDragEnter(e, id, headerData) {
219
+ if (e.currentTarget.contains(e.relatedTarget)) return;
220
+ headerData.highlightedControl = id;
221
+ clearTimeout(changeViewTimeout);
222
+ changeViewTimeout = setTimeout(() => {
223
+ if (["previous", "next"].includes(id)) {
224
+ this._vuecal[id]();
225
+ clearInterval(pressPrevOrNextInterval);
226
+ pressPrevOrNextInterval = setInterval(this._vuecal[id], holdOverTimeout);
227
+ } else if (id === "today") {
228
+ clearInterval(pressPrevOrNextInterval);
229
+ let viewId;
230
+ if (this._vuecal.view.id.includes("year")) {
231
+ viewId = this._vuecal.enabledViews.filter((view) => !view.includes("year"))[0];
232
+ }
233
+ this._vuecal.switchView(viewId || this._vuecal.view.id, new Date((/* @__PURE__ */ new Date()).setHours(0, 0, 0, 0)), true);
234
+ } else this._vuecal.switchView(id, null, true);
235
+ viewChanged = true;
236
+ }, holdOverTimeout);
86
237
  }
87
- viewSelectorDragLeave(t, e, l) {
88
- t.currentTarget.contains(t.relatedTarget) || l.highlightedControl === e && (l.highlightedControl = null, o && (o = clearTimeout(o)), c && (c = clearInterval(c)));
238
+ /**
239
+ * On drag leave on a view button or on today, prev & next buttons.
240
+ * Removes the highlighted state on the hovered button, and cancel the timer to
241
+ * go to the requested view.
242
+ *
243
+ * @param {Object} e The associated DOM event.
244
+ * @param {String} id The id of the header element being hovered. One of:
245
+ * previous, next, today, years, year, month, week, day.
246
+ * @param {Object} headerData The header component's $data.
247
+ */
248
+ viewSelectorDragLeave(e, id, headerData) {
249
+ if (e.currentTarget.contains(e.relatedTarget)) return;
250
+ if (headerData.highlightedControl === id) {
251
+ headerData.highlightedControl = null;
252
+ if (changeViewTimeout) changeViewTimeout = clearTimeout(changeViewTimeout);
253
+ if (pressPrevOrNextInterval) pressPrevOrNextInterval = clearInterval(pressPrevOrNextInterval);
254
+ }
89
255
  }
90
256
  };
91
257
  export {
92
- M as DragAndDrop
258
+ DragAndDrop
93
259
  };
@@ -1,5 +1,6 @@
1
1
  /**
2
- * vue-cal v4.9.0
2
+ * vue-cal v4.10.0
3
3
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
4
  * @license MIT
5
- */define(["exports"],function(e){"use strict";const t=["\u0627\u0644\u0625\u062B\u0646\u064A\u0646","\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062E\u0645\u064A\u0633","\u0627\u0644\u062C\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062A","\u0627\u0644\u0623\u062D\u062F"],n=["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631"," \u062F\u064A\u0633\u0645\u0628\u0631"],a="\u0633\u0646\u0648\u0627\u062A",o="\u0633\u0646\u0629",c="\u0634\u0647\u0631",d="\u0623\u0633\u0628\u0648\u0639",y="\u064A\u0648\u0645",l="\u0627\u0644\u064A\u0648\u0645",s="\u0644\u0627 \u062D\u062F\u062B",m="\u0637\u0648\u0627\u0644 \u0627\u0644\u064A\u0648\u0645",v="\u062D\u0630\u0641",E="\u0625\u0646\u0634\u0627\u0621 \u062D\u062F\u062B",D="dddd D MMMM YYYY",h={weekDays:t,months:n,years:a,year:o,month:c,week:d,day:y,today:l,noEvent:s,allDay:m,deleteEvent:v,createEvent:E,dateFormat:D};e.allDay=m,e.createEvent=E,e.dateFormat=D,e.day=y,e.default=h,e.deleteEvent=v,e.month=c,e.months=n,e.noEvent=s,e.today=l,e.week=d,e.weekDays=t,e.year=o,e.years=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
5
+ */
6
+ define(["exports"],(function(e){"use strict";const t=["الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"],a=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر"," ديسمبر"],n="سنوات",o="أسبوع",d="اليوم",y="لا حدث",r="طوال اليوم",l="إنشاء حدث",s="dddd D MMMM YYYY",m={weekDays:t,months:a,years:n,year:"سنة",month:"شهر",week:o,day:"يوم",today:d,noEvent:y,allDay:r,deleteEvent:"حذف",createEvent:l,dateFormat:s};e.allDay=r,e.createEvent=l,e.dateFormat=s,e.day="يوم",e.default=m,e.deleteEvent="حذف",e.month="شهر",e.months=a,e.noEvent=y,e.today=d,e.week=o,e.weekDays=t,e.year="سنة",e.years=n,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -1,5 +1,6 @@
1
- "use strict";/**
2
- * vue-cal v4.9.0
1
+ "use strict";
2
+ /**
3
+ * vue-cal v4.10.0
3
4
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
5
  * @license MIT
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["\u0627\u0644\u0625\u062B\u0646\u064A\u0646","\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062E\u0645\u064A\u0633","\u0627\u0644\u062C\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062A","\u0627\u0644\u0623\u062D\u062F"],t=["\u064A\u0646\u0627\u064A\u0631","\u0641\u0628\u0631\u0627\u064A\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064A\u0644","\u0645\u0627\u064A\u0648","\u064A\u0648\u0646\u064A\u0648","\u064A\u0648\u0644\u064A\u0648","\u0623\u063A\u0633\u0637\u0633","\u0633\u0628\u062A\u0645\u0628\u0631","\u0623\u0643\u062A\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631"," \u062F\u064A\u0633\u0645\u0628\u0631"],a="\u0633\u0646\u0648\u0627\u062A",n="\u0633\u0646\u0629",o="\u0634\u0647\u0631",s="\u0623\u0633\u0628\u0648\u0639",y="\u064A\u0648\u0645",c="\u0627\u0644\u064A\u0648\u0645",d="\u0644\u0627 \u062D\u062F\u062B",r="\u0637\u0648\u0627\u0644 \u0627\u0644\u064A\u0648\u0645",l="\u062D\u0630\u0641",m="\u0625\u0646\u0634\u0627\u0621 \u062D\u062F\u062B",v="dddd D MMMM YYYY",E={weekDays:e,months:t,years:a,year:n,month:o,week:s,day:y,today:c,noEvent:d,allDay:r,deleteEvent:l,createEvent:m,dateFormat:v};exports.allDay=r;exports.createEvent=m;exports.dateFormat=v;exports.day=y;exports.default=E;exports.deleteEvent=l;exports.month=o;exports.months=t;exports.noEvent=d;exports.today=c;exports.week=s;exports.weekDays=e;exports.year=n;exports.years=a;
6
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت","الأحد"],t=["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر"," ديسمبر"],o="سنوات",r="أسبوع",s="اليوم",a="لا حدث",p="طوال اليوم",d="إنشاء حدث",n="dddd D MMMM YYYY",x={weekDays:e,months:t,years:o,year:"سنة",month:"شهر",week:r,day:"يوم",today:s,noEvent:a,allDay:p,deleteEvent:"حذف",createEvent:d,dateFormat:n};exports.allDay=p,exports.createEvent=d,exports.dateFormat=n,exports.day="يوم",exports.default=x,exports.deleteEvent="حذف",exports.month="شهر",exports.months=t,exports.noEvent=a,exports.today=s,exports.week=r,exports.weekDays=e,exports.year="سنة",exports.years=o;
@@ -1,22 +1,70 @@
1
1
  /**
2
- * vue-cal v4.9.0
2
+ * vue-cal v4.10.0
3
3
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
4
  * @license MIT
5
5
  */
6
- const a = ["\u0627\u0644\u0625\u062B\u0646\u064A\u0646", "\u0627\u0644\u062B\u0644\u0627\u062B\u0627\u0621", "\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621", "\u0627\u0644\u062E\u0645\u064A\u0633", "\u0627\u0644\u062C\u0645\u0639\u0629", "\u0627\u0644\u0633\u0628\u062A", "\u0627\u0644\u0623\u062D\u062F"], e = ["\u064A\u0646\u0627\u064A\u0631", "\u0641\u0628\u0631\u0627\u064A\u0631", "\u0645\u0627\u0631\u0633", "\u0623\u0628\u0631\u064A\u0644", "\u0645\u0627\u064A\u0648", "\u064A\u0648\u0646\u064A\u0648", "\u064A\u0648\u0644\u064A\u0648", "\u0623\u063A\u0633\u0637\u0633", "\u0633\u0628\u062A\u0645\u0628\u0631", "\u0623\u0643\u062A\u0648\u0628\u0631", "\u0646\u0648\u0641\u0645\u0628\u0631", " \u062F\u064A\u0633\u0645\u0628\u0631"], t = "\u0633\u0646\u0648\u0627\u062A", l = "\u0633\u0646\u0629", m = "\u0634\u0647\u0631", s = "\u0623\u0633\u0628\u0648\u0639", v = "\u064A\u0648\u0645", d = "\u0627\u0644\u064A\u0648\u0645", n = "\u0644\u0627 \u062D\u062F\u062B", o = "\u0637\u0648\u0627\u0644 \u0627\u0644\u064A\u0648\u0645", E = "\u062D\u0630\u0641", y = "\u0625\u0646\u0634\u0627\u0621 \u062D\u062F\u062B", r = "dddd D MMMM YYYY", D = { weekDays: a, months: e, years: t, year: "\u0633\u0646\u0629", month: "\u0634\u0647\u0631", week: s, day: "\u064A\u0648\u0645", today: d, noEvent: n, allDay: o, deleteEvent: "\u062D\u0630\u0641", createEvent: y, dateFormat: r };
6
+ const weekDays = [
7
+ "الإثنين",
8
+ "الثلاثاء",
9
+ "الأربعاء",
10
+ "الخميس",
11
+ "الجمعة",
12
+ "السبت",
13
+ "الأحد"
14
+ ];
15
+ const months = [
16
+ "يناير",
17
+ "فبراير",
18
+ "مارس",
19
+ "أبريل",
20
+ "مايو",
21
+ "يونيو",
22
+ "يوليو",
23
+ "أغسطس",
24
+ "سبتمبر",
25
+ "أكتوبر",
26
+ "نوفمبر",
27
+ " ديسمبر"
28
+ ];
29
+ const years = "سنوات";
30
+ const year = "سنة";
31
+ const month = "شهر";
32
+ const week = "أسبوع";
33
+ const day = "يوم";
34
+ const today = "اليوم";
35
+ const noEvent = "لا حدث";
36
+ const allDay = "طوال اليوم";
37
+ const deleteEvent = "حذف";
38
+ const createEvent = "إنشاء حدث";
39
+ const dateFormat = "dddd D MMMM YYYY";
40
+ const ar = {
41
+ weekDays,
42
+ months,
43
+ years,
44
+ year,
45
+ month,
46
+ week,
47
+ day,
48
+ today,
49
+ noEvent,
50
+ allDay,
51
+ deleteEvent,
52
+ createEvent,
53
+ dateFormat
54
+ };
7
55
  export {
8
- o as allDay,
9
- y as createEvent,
10
- r as dateFormat,
11
- v as day,
12
- D as default,
13
- E as deleteEvent,
14
- m as month,
15
- e as months,
16
- n as noEvent,
17
- d as today,
18
- s as week,
19
- a as weekDays,
20
- l as year,
21
- t as years
56
+ allDay,
57
+ createEvent,
58
+ dateFormat,
59
+ day,
60
+ ar as default,
61
+ deleteEvent,
62
+ month,
63
+ months,
64
+ noEvent,
65
+ today,
66
+ week,
67
+ weekDays,
68
+ year,
69
+ years
22
70
  };
@@ -1,5 +1,6 @@
1
1
  /**
2
- * vue-cal v4.9.0
2
+ * vue-cal v4.10.0
3
3
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
4
  * @license MIT
5
- */define(["exports"],function(e){"use strict";const t=["\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u043D\u0438\u043A","\u0412\u0442\u043E\u0440\u043D\u0438\u043A","\u0421\u0440\u044F\u0434\u0430","\u0427\u0435\u0442\u0432\u044A\u0440\u0442\u044A\u043A","\u041F\u0435\u0442\u044A\u043A","\u0421\u044A\u0431\u043E\u0442\u0430","\u041D\u0435\u0434\u0435\u043B\u044F"],n=["\u042F\u043D\u0443\u0430\u0440\u0438","\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0438\u043B","\u041C\u0430\u0439","\u042E\u043D\u0438","\u042E\u043B\u0438","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043F\u0442\u0435\u043C\u0432\u0440\u0438","\u041E\u043A\u0442\u043E\u043C\u0432\u0440\u0438","\u041D\u043E\u0435\u043C\u0432\u0440\u0438","\u0414\u0435\u043A\u0435\u043C\u0432\u0440\u0438"],a="\u0413\u043E\u0434\u0438\u043D\u0438",o="\u0413\u043E\u0434\u0438\u043D\u0430",c="\u041C\u0435\u0441\u0435\u0446",d="\u0421\u0435\u0434\u043C\u0438\u0446\u0430",y="\u0414\u0435\u043D",l="\u0414\u043D\u0435\u0441",s="\u041D\u044F\u043C\u0430 \u0441\u044A\u0431\u0438\u0442\u0438\u044F",m="\u0426\u044F\u043B \u0434\u0435\u043D",v="\u0418\u0437\u0442\u0440\u0438\u0439",E="\u0421\u044A\u0437\u0434\u0430\u0439 \u0441\u044A\u0431\u0438\u0442\u0438\u0435",D="dddd D MMMM YYYY",h={weekDays:t,months:n,years:a,year:o,month:c,week:d,day:y,today:l,noEvent:s,allDay:m,deleteEvent:v,createEvent:E,dateFormat:D};e.allDay=m,e.createEvent=E,e.dateFormat=D,e.day=y,e.default=h,e.deleteEvent=v,e.month=c,e.months=n,e.noEvent=s,e.today=l,e.week=d,e.weekDays=t,e.year=o,e.years=a,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
5
+ */
6
+ define(["exports"],(function(e){"use strict";const t=["Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],a=["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],n="Години",o="Година",d="Месец",y="Седмица",r="Днес",l="Няма събития",s="Цял ден",m="Изтрий",v="Създай събитие",c="dddd D MMMM YYYY",E={weekDays:t,months:a,years:n,year:o,month:d,week:y,day:"Ден",today:r,noEvent:l,allDay:s,deleteEvent:m,createEvent:v,dateFormat:c};e.allDay=s,e.createEvent=v,e.dateFormat=c,e.day="Ден",e.default=E,e.deleteEvent=m,e.month=d,e.months=a,e.noEvent=l,e.today=r,e.week=y,e.weekDays=t,e.year=o,e.years=n,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}));
@@ -1,5 +1,6 @@
1
- "use strict";/**
2
- * vue-cal v4.9.0
1
+ "use strict";
2
+ /**
3
+ * vue-cal v4.10.0
3
4
  * (c) 2024 Antoni Andre <antoniandre.web@gmail.com>
4
5
  * @license MIT
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u043D\u0438\u043A","\u0412\u0442\u043E\u0440\u043D\u0438\u043A","\u0421\u0440\u044F\u0434\u0430","\u0427\u0435\u0442\u0432\u044A\u0440\u0442\u044A\u043A","\u041F\u0435\u0442\u044A\u043A","\u0421\u044A\u0431\u043E\u0442\u0430","\u041D\u0435\u0434\u0435\u043B\u044F"],t=["\u042F\u043D\u0443\u0430\u0440\u0438","\u0424\u0435\u0432\u0440\u0443\u0430\u0440\u0438","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0438\u043B","\u041C\u0430\u0439","\u042E\u043D\u0438","\u042E\u043B\u0438","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043F\u0442\u0435\u043C\u0432\u0440\u0438","\u041E\u043A\u0442\u043E\u043C\u0432\u0440\u0438","\u041D\u043E\u0435\u043C\u0432\u0440\u0438","\u0414\u0435\u043A\u0435\u043C\u0432\u0440\u0438"],n="\u0413\u043E\u0434\u0438\u043D\u0438",a="\u0413\u043E\u0434\u0438\u043D\u0430",o="\u041C\u0435\u0441\u0435\u0446",s="\u0421\u0435\u0434\u043C\u0438\u0446\u0430",y="\u0414\u0435\u043D",c="\u0414\u043D\u0435\u0441",d="\u041D\u044F\u043C\u0430 \u0441\u044A\u0431\u0438\u0442\u0438\u044F",r="\u0426\u044F\u043B \u0434\u0435\u043D",l="\u0418\u0437\u0442\u0440\u0438\u0439",m="\u0421\u044A\u0437\u0434\u0430\u0439 \u0441\u044A\u0431\u0438\u0442\u0438\u0435",v="dddd D MMMM YYYY",E={weekDays:e,months:t,years:n,year:a,month:o,week:s,day:y,today:c,noEvent:d,allDay:r,deleteEvent:l,createEvent:m,dateFormat:v};exports.allDay=r;exports.createEvent=m;exports.dateFormat=v;exports.day=y;exports.default=E;exports.deleteEvent=l;exports.month=o;exports.months=t;exports.noEvent=d;exports.today=c;exports.week=s;exports.weekDays=e;exports.year=a;exports.years=n;
6
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=["Понеделник","Вторник","Сряда","Четвъртък","Петък","Събота","Неделя"],t=["Януари","Февруари","Март","Април","Май","Юни","Юли","Август","Септември","Октомври","Ноември","Декември"],o="Години",r="Година",s="Месец",a="Седмица",p="Днес",d="Няма събития",n="Цял ден",x="Изтрий",y="Създай събитие",l="dddd D MMMM YYYY",m={weekDays:e,months:t,years:o,year:r,month:s,week:a,day:"Ден",today:p,noEvent:d,allDay:n,deleteEvent:x,createEvent:y,dateFormat:l};exports.allDay=n,exports.createEvent=y,exports.dateFormat=l,exports.day="Ден",exports.default=m,exports.deleteEvent=x,exports.month=s,exports.months=t,exports.noEvent=d,exports.today=p,exports.week=a,exports.weekDays=e,exports.year=r,exports.years=o;