hisonvue 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{HAccordion-DXNoziwY.mjs → HAccordion-CrCXK2YM.mjs} +2 -2
- package/dist/{HAccordion-FatqOgy2.js → HAccordion-DleNf4M-.js} +1 -1
- package/dist/{HBaggie-DWSes7QC.js → HBaggie-CtDuqAan.js} +1 -1
- package/dist/{HBaggie-C4qcuGl9.mjs → HBaggie-DR86wX0x.mjs} +2 -2
- package/dist/{HBanner-D2IVlykU.js → HBanner-BDv5sYCa.js} +1 -1
- package/dist/{HBanner-DNOhDRli.mjs → HBanner-D4j3o022.mjs} +2 -2
- package/dist/{HButton-Dhyb_Apz.mjs → HButton-BeKvR0cC.mjs} +2 -2
- package/dist/{HButton-D3aVYVY3.js → HButton-CkHZhjwN.js} +1 -1
- package/dist/{HCalendar-BB0XyvZV.js → HCalendar-BbVDcV_g.js} +1 -1
- package/dist/{HCalendar-Bv1mZ6DG.mjs → HCalendar-vI0VJJUJ.mjs} +1 -1
- package/dist/{HCaption-BKJlg7ZH.mjs → HCaption-Cf3dj2IG.mjs} +1 -1
- package/dist/{HCaption-2Wpf8L9R.js → HCaption-DbjKugnx.js} +1 -1
- package/dist/{HChart-H5M0gQB0.mjs → HChart-BITDUWsH.mjs} +1 -1
- package/dist/{HChart-BEe_bo5V.js → HChart-CTa5zLah.js} +1 -1
- package/dist/{HDrawer-CWkLJyMS.js → HDrawer-BdhP3EDS.js} +1 -1
- package/dist/{HDrawer-BYrUd-eA.mjs → HDrawer-vEgPHlwE.mjs} +1 -1
- package/dist/{HDropdown-DTaeDC5I.js → HDropdown-BfZUh6z-.js} +1 -1
- package/dist/{HDropdown-Dpba4jMR.mjs → HDropdown-BojM0eHC.mjs} +2 -2
- package/dist/{HFileset-Qo0JIgMJ.mjs → HFileset-BG5l_qx4.mjs} +1 -1
- package/dist/{HFileset-CWDMfYdY.js → HFileset-Cb7WvJLf.js} +1 -1
- package/dist/{HGap-B5lrnzJ6.mjs → HGap-CNKNrbB5.mjs} +1 -1
- package/dist/{HGap-Bcl_WYxa.js → HGap-CZfD94Bb.js} +1 -1
- package/dist/{HGrid-59dIVp9V.mjs → HGrid-BudEkfCU.mjs} +8 -8
- package/dist/HGrid-CbxqCD5t.js +1 -0
- package/dist/{HImagebox-G-LvB26S.mjs → HImagebox--UAgOadx.mjs} +1 -1
- package/dist/{HImagebox-DIYXXh95.js → HImagebox-BPvmvGWb.js} +1 -1
- package/dist/{HInput-C9rOBXqc.mjs → HInput-C5otOYZ7.mjs} +1 -1
- package/dist/{HInput-PgalO88P.js → HInput-CpbGKZg2.js} +1 -1
- package/dist/{HInputGroup-XryXR-6k.js → HInputGroup-BRYFCJDS.js} +1 -1
- package/dist/{HInputGroup-BaK14hkQ.mjs → HInputGroup-CV595p3t.mjs} +1 -1
- package/dist/{HLabel-jbc0_u5J.mjs → HLabel-DSOf8CAF.mjs} +2 -2
- package/dist/{HLabel-CbQeG2R3.js → HLabel-buiY-oWY.js} +1 -1
- package/dist/{HLayout-DmTQQmLs.mjs → HLayout-0PWr0ybN.mjs} +1 -1
- package/dist/{HLayout-CUwfApcb.js → HLayout-Bu0hB8wf.js} +1 -1
- package/dist/{HList-DCupvbju.js → HList-BIKaUFs1.js} +1 -1
- package/dist/{HList-rD5kL7cI.mjs → HList-CAYpxvpT.mjs} +2 -2
- package/dist/{HModal-eniLW2gp.js → HModal-DDL-MrHu.js} +1 -1
- package/dist/{HModal-XDNcukop.mjs → HModal-FqJbINTG.mjs} +1 -1
- package/dist/{HNote-BA3umb5e.mjs → HNote-CQVkY196.mjs} +1 -1
- package/dist/{HNote-DzeszCEe.js → HNote-Dwbr1_V2.js} +1 -1
- package/dist/{HPagination-BS4l4xGP.js → HPagination-DFnrZYhq.js} +1 -1
- package/dist/{HPagination-CgufEtL4.mjs → HPagination-DwYSg0IX.mjs} +2 -2
- package/dist/{HParagraph-DPFx64UD.js → HParagraph-BFQ0qCCP.js} +1 -1
- package/dist/{HParagraph-hCHZmj-4.mjs → HParagraph-DCTkBsye.mjs} +1 -1
- package/dist/{HPopup-BfPYzBy6.mjs → HPopup-DNzBPmHh.mjs} +1 -1
- package/dist/{HPopup-NBwn8RA4.js → HPopup-hBOpdf7v.js} +1 -1
- package/dist/{HSpinner-1UQgVEve.mjs → HSpinner-DN8JhipU.mjs} +1 -1
- package/dist/{HSpinner-CMsmFVOv.js → HSpinner-Zl3b9VKW.js} +1 -1
- package/dist/{HTable-Dweedemn.js → HTable-8jwoguW_.js} +1 -1
- package/dist/{HTable-BUIKSXIR.mjs → HTable-Ci4lTwPm.mjs} +1 -1
- package/dist/hisonvue.cjs.js +1 -1
- package/dist/hisonvue.es.js +2 -2
- package/dist/{index-p1EBArRP.mjs → index-0mmn7cpg.mjs} +2 -2
- package/dist/{index-CKU70ocu.js → index-DON-Hfjr.js} +2 -2
- package/dist/{setButtonCssEvent-CB-7jMmJ.mjs → setButtonCssEvent-BNLo78yX.mjs} +1 -1
- package/dist/{setButtonCssEvent-BoBQS2-T.js → setButtonCssEvent-Dl2nV55A.js} +1 -1
- package/package.json +1 -1
- package/dist/HGrid-f8xHSk9C.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),v=require("./index-CKU70ocu.js"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.js");var Fe=Object.defineProperty,Pe=(t,e,l)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l,N=(t,e,l)=>Pe(t,typeof e!="symbol"?e+"":e,l);const Le=(t,e,l)=>{const a=t[e];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((o,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==l?". Note that variables only represent file names one level deep.":""))))})};let oe,ke,Ce,B,ue={},R={};class je{constructor(e,l=!1){N(this,"texts",{}),N(this,"dateToMinutes",a=>a.getHours()*60+a.getMinutes()),B=this,this._texts=e,!l&&Date&&!Date.prototype.addDays&&this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return B.addDays(this,e)},Date.prototype.subtractDays=function(e){return B.subtractDays(this,e)},Date.prototype.addHours=function(e){return B.addHours(this,e)},Date.prototype.subtractHours=function(e){return B.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return B.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return B.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return B.getWeek(this)},Date.prototype.isToday=function(){return B.isToday(this)},Date.prototype.isLeapYear=function(){return B.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return B.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return B.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return ke!==new Date().getDate()&&(oe=new Date,ke=oe.getDate(),Ce=`${oe.getFullYear()}-${oe.getMonth()}-${oe.getDate()}`),Ce}addDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()+l),a}subtractDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()-l),a}addHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()+l),a}subtractHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()-l),a}addMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()+l),a}subtractMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()-l),a}getWeek(e){const l=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),a=l.getUTCDay()||7;l.setUTCDate(l.getUTCDate()+4-a);const o=new Date(Date.UTC(l.getUTCFullYear(),0,1));return Math.ceil(((l-o)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const l=e.getFullYear();return!(l%400)||l%100&&!(l%4)}getPreviousFirstDayOfWeek(e=null,l){const a=e&&new Date(e.valueOf())||new Date,o=l?7:6;return a.setDate(a.getDate()-(a.getDay()+o)%7),a}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,l){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof l=="string"&&(l=l.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),l=new Date(l).setHours(0,0,1,0);const a=(new Date(l).getTimezoneOffset()-new Date(e).getTimezoneOffset())*60*1e3;return Math.ceil((l-e-a)/(24*3600*1e3))}datesInSameTimeStep(e,l,a){return Math.abs(e.getTime()-l.getTime())<=a*60*1e3}formatDate(e,l="YYYY-MM-DD",a=null){if(a||(a=this._texts),l||(l="YYYY-MM-DD"),l==="YYYY-MM-DD")return this.formatDateLite(e);ue={},R={};const o={YYYY:()=>this._hydrateDateObject(e,a).YYYY,YY:()=>this._hydrateDateObject(e,a).YY(),M:()=>this._hydrateDateObject(e,a).M,MM:()=>this._hydrateDateObject(e,a).MM(),MMM:()=>this._hydrateDateObject(e,a).MMM(),MMMM:()=>this._hydrateDateObject(e,a).MMMM(),MMMMG:()=>this._hydrateDateObject(e,a).MMMMG(),D:()=>this._hydrateDateObject(e,a).D,DD:()=>this._hydrateDateObject(e,a).DD(),S:()=>this._hydrateDateObject(e,a).S(),d:()=>this._hydrateDateObject(e,a).d,dd:()=>this._hydrateDateObject(e,a).dd(),ddd:()=>this._hydrateDateObject(e,a).ddd(),dddd:()=>this._hydrateDateObject(e,a).dddd(),HH:()=>this._hydrateTimeObject(e,a).HH,H:()=>this._hydrateTimeObject(e,a).H,hh:()=>this._hydrateTimeObject(e,a).hh,h:()=>this._hydrateTimeObject(e,a).h,am:()=>this._hydrateTimeObject(e,a).am,AM:()=>this._hydrateTimeObject(e,a).AM,mm:()=>this._hydrateTimeObject(e,a).mm,m:()=>this._hydrateTimeObject(e,a).m};return l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(s,u)=>{const r=o[u.replace(/\{|\}/g,"")];return r!==void 0?r():u})}formatDateLite(e){const l=e.getMonth()+1,a=e.getDate();return`${e.getFullYear()}-${l<10?"0":""}${l}-${a<10?"0":""}${a}`}formatTime(e,l="HH:mm",a=null,o=!1){let s=!1;if(o){const[m,c,h]=[e.getHours(),e.getMinutes(),e.getSeconds()];m+c+h===141&&(s=!0)}if(e instanceof Date&&l==="HH:mm")return s?"24:00":this.formatTimeLite(e);R={},a||(a=this._texts);const u=this._hydrateTimeObject(e,a),r=l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(m,c)=>{const h=u[c.replace(/\{|\}/g,"")];return h!==void 0?h:c});return s?r.replace("23:59","24:00"):r}formatTimeLite(e){const l=e.getHours(),a=e.getMinutes();return`${(l<10?"0":"")+l}:${(a<10?"0":"")+a}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,l){if(ue.D)return ue;const a=e.getFullYear(),o=e.getMonth()+1,s=e.getDate(),r=(e.getDay()-1+7)%7;return ue={YYYY:a,YY:()=>a.toString().substring(2),M:o,MM:()=>(o<10?"0":"")+o,MMM:()=>l.months[o-1].substring(0,3),MMMM:()=>l.months[o-1],MMMMG:()=>(l.monthsGenitive||l.months)[o-1],D:s,DD:()=>(s<10?"0":"")+s,S:()=>this._nth(s),d:r+1,dd:()=>l.weekDays[r][0],ddd:()=>l.weekDays[r].substr(0,3),dddd:()=>l.weekDays[r]},ue}_hydrateTimeObject(e,l){if(R.am)return R;let a,o;e instanceof Date?(a=e.getHours(),o=e.getMinutes()):(a=Math.floor(e/60),o=Math.floor(e%60));const s=a%12?a%12:12,u=(l||{am:"am",pm:"pm"})[a===24||a<12?"am":"pm"];return R={H:a,h:s,HH:(a<10?"0":"")+a,hh:(s<10?"0":"")+s,am:u,AM:u.toUpperCase(),m:o,mm:(o<10?"0":"")+o},R}}const xe=1440;class ze{constructor(e){N(this,"_vuecal",null),N(this,"selectCell",(l=!1,a,o)=>{this._vuecal.$emit("cell-click",o?{date:a,split:o}:a),this._vuecal.clickToNavigate||l?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",o?{date:a,split:o}:a)))}),N(this,"keyPressEnterCell",(l,a)=>{this._vuecal.$emit("cell-keypress-enter",a?{date:l,split:a}:l),this._vuecal.switchToNarrowerView()}),N(this,"getPosition",l=>{const{left:a,top:o}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:s,clientY:u}="ontouchstart"in window&&l.touches?l.touches[0]:l;return{x:s-a,y:u-o}}),N(this,"minutesAtCursor",l=>{let a=0,o={x:0,y:0};const{timeStep:s,timeCellHeight:u,timeFrom:r}=this._vuecal.$props;return typeof l=="number"?a=l:typeof l=="object"&&(o=this.getPosition(l),a=Math.round(o.y*s/parseInt(u)+r)),{minutes:Math.max(Math.min(a,xe),0),cursorCoords:o}}),this._vuecal=e}}const Ye=2,me=1440;let p,k,ye;class Ie{constructor(e,l){N(this,"_vuecal",null),N(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=e,p=l}createAnEvent(e,l,a){if(typeof e=="string"&&(e=p.stringToDate(e)),!(e instanceof Date))return!1;const o=p.dateToMinutes(e);l=l*1||Ye*60;const s=o+l,u=p.addMinutes(new Date(e),l);a.end&&(typeof a.end=="string"&&(a.end=p.stringToDate(a.end)),a.endTimeMinutes=p.dateToMinutes(a.end));const r={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:o,end:u,endTimeMinutes:s,segments:null,...a};if(!(typeof this._vuecal.onEventCreate=="function"&&!this._vuecal.onEventCreate(r,()=>this.deleteAnEvent(r))))return r.startDateF!==r.endDateF&&(r.daysCount=p.countDays(r.start,r.end)),this._vuecal.mutableEvents.push(r),this._vuecal.addEventsToView([r]),this._vuecal.emitWithEvent("event-create",r),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(r),originalEvent:null}),r}addEventSegment(e){e.segments||(e.segments={},e.segments[p.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:me,isFirstDay:!0,isLastDay:!1});const l=e.segments[p.formatDateLite(e.end)];l&&(l.isLastDay=!1,l.endTimeMinutes=me);const a=p.addDays(e.end,1),o=p.formatDateLite(a);return a.setHours(0,0,0,0),e.segments[o]={start:a,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=p.addMinutes(a,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,o}removeEventSegment(e){let l=Object.keys(e.segments).length;if(l<=1)return p.formatDateLite(e.end);delete e.segments[p.formatDateLite(e.end)],l--;const a=p.subtractDays(e.end,1),o=p.formatDateLite(a),s=e.segments[o];return l?s&&(s.isLastDay=!0,s.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=l||1,e.end=a,o}createEventSegments(e,l,a){const o=l.getTime(),s=a.getTime();let u=e.start.getTime(),r=e.end.getTime(),m=!1,c,h,y;for(!e.end.getHours()&&!e.end.getMinutes()&&(r-=1e3),e.segments={},e.repeat?(c=o,h=Math.min(s,e.repeat.until?p.stringToDate(e.repeat.until).getTime():s)):(c=Math.max(o,u),h=Math.min(s,r));c<=h;){let w=!1;const T=p.addDays(new Date(c),1).setHours(0,0,0,0);let g,_,E,D;if(e.repeat){const M=new Date(c),C=p.formatDateLite(M);(m||e.occurrences&&e.occurrences[C])&&(m||(u=e.occurrences[C].start,y=new Date(u).setHours(0,0,0,0),r=e.occurrences[C].end),m=!0,w=!0),g=c===y,_=C===p.formatDateLite(new Date(r)),E=new Date(g?u:c),D=p.formatDateLite(E),_&&(m=!1)}else w=!0,g=c===u,_=h===r&&T>h,E=g?e.start:new Date(c),D=p.formatDateLite(g?e.start:E);w&&(e.segments[D]={start:E,startTimeMinutes:g?e.startTimeMinutes:0,endTimeMinutes:_?e.endTimeMinutes:me,isFirstDay:g,isLastDay:_}),c=T}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(l=>l._eid!==e._eid),this._vuecal.view.events=this._vuecal.view.events.filter(l=>l._eid!==e._eid)}checkCellOverlappingEvents(e,l){ye=e.slice(0),k={},e.forEach(o=>{ye.shift(),k[o._eid]||(k[o._eid]={overlaps:[],start:o.start,position:0}),k[o._eid].position=0,ye.forEach(s=>{k[s._eid]||(k[s._eid]={overlaps:[],start:s.start,position:0});const u=this.eventInRange(s,o.start,o.end),r=l.overlapsPerTimeStep?p.datesInSameTimeStep(o.start,s.start,l.timeStep):1;if(!o.background&&!o.allDay&&!s.background&&!s.allDay&&u&&r)k[o._eid].overlaps.push(s._eid),k[o._eid].overlaps=[...new Set(k[o._eid].overlaps)],k[s._eid].overlaps.push(o._eid),k[s._eid].overlaps=[...new Set(k[s._eid].overlaps)],k[s._eid].position++;else{let m,c;(m=(k[o._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&k[o._eid].overlaps.splice(m,1),(c=(k[s._eid]||{overlaps:[]}).overlaps.indexOf(o._eid))>-1&&k[s._eid].overlaps.splice(c,1),k[s._eid].position--}})});let a=0;for(const o in k){const s=k[o],u=s.overlaps.map(r=>({id:r,start:k[r].start}));u.push({id:o,start:s.start}),u.sort((r,m)=>r.start<m.start?-1:r.start>m.start?1:r.id>m.id?-1:1),s.position=u.findIndex(r=>r.id===o),a=Math.max(this.getOverlapsStreak(s,k),a)}return[k,a]}getOverlapsStreak(e,l={}){let a=e.overlaps.length+1,o=[];return e.overlaps.forEach(s=>{o.includes(s)||e.overlaps.filter(r=>r!==s).forEach(r=>{l[r].overlaps.includes(s)||o.push(r)})}),o=[...new Set(o)],a-=o.length,a}eventInRange(e,l,a){if(e.allDay||!this._vuecal.time){const u=new Date(e.start).setHours(0,0,0,0);return new Date(e.end).setHours(23,59,0,0)>=new Date(l).setHours(0,0,0,0)&&u<=new Date(a).setHours(0,0,0,0)}const o=e.start.getTime(),s=e.end.getTime();return o<a.getTime()&&s>l.getTime()}}const qe={class:"vuecal__flex vuecal__weekdays-headings"},Re=["onClick"],Ue={class:"vuecal__flex weekday-label",grow:""},Ke={class:"full"},Ge={class:"small"},Xe={class:"xsmall"},Je={key:0},Ze={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function Qe(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",qe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.headings,(u,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:r},[u.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["vuecal__flex vuecal__heading",{today:u.today,clickable:s.cellHeadingsClickable}]),style:i.normalizeStyle(s.weekdayCellStyles),onClick:m=>s.view.id==="week"&&s.selectCell(u.date,m),onDblclick:e[0]||(e[0]=m=>s.view.id==="week"&&s.vuecal.dblclickToNavigate&&l.switchToNarrowerView())},[i.createVNode(i.Transition,{name:`slide-fade--${l.transitionDirection}`,appear:s.vuecal.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",column:"",key:s.vuecal.transitions?`${r}-${u.dayOfMonth}`:!1},[i.createElementVNode("div",Ue,[i.renderSlot(t.$slots,"weekday-heading",{heading:s.cleanupHeading(u),view:s.view},()=>[i.createElementVNode("span",Ke,i.toDisplayString(u.full),1),i.createElementVNode("span",Ge,i.toDisplayString(u.small),1),i.createElementVNode("span",Xe,i.toDisplayString(u.xsmall),1),u.dayOfMonth?(i.openBlock(),i.createElementBlock("span",Je," "+i.toDisplayString(u.dayOfMonth),1)):i.createCommentVNode("",!0)])]),s.vuecal.hasSplits&&s.vuecal.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",Ze,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.daySplits,(m,c)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",m.class||!1]),key:c},[i.renderSlot(t.$slots,"split-label",{split:m,view:s.view},()=>[i.createTextVNode(i.toDisplayString(m.label),1)])],2))),128))])):i.createCommentVNode("",!0)]))]),_:2},1032,["name","appear"])],46,Re))],64))),128))])}const U=(t,e)=>{const l=t.__vccOpts||t;for(const[a,o]of e)l[a]=o;return l},$e={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(t,e){t.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=t),this.utils.cell.selectCell(!1,t,e)},cleanupHeading:t=>({label:t.full,date:t.date,...t.today?{today:t.today}:{}})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let t=!1;return this.weekDays.map((l,a)=>{const o=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday&&this.vuecal.hideWeekends?a-1:a);return{hide:l.hide,full:l.label,small:l.short||l.label.substr(0,3),xsmall:l.short||l.label.substr(0,1),...this.view.id==="week"?{dayOfMonth:o.getDate(),date:o,today:!t&&this.utils.date.isToday(o)&&!t++}:{}}})},cellWidth(){return 100/(7-this.weekDays.reduce((t,e)=>t+e.hide,0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}},Se=U($e,[["render",Qe]]),et={class:"vuecal__header"},tt={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},it=["onDragenter","onDragleave","onClick","aria-label"],st={key:1,class:"vuecal__title-bar"},lt=["aria-label"],at={class:"vuecal__flex vuecal__title",grow:""},nt=["aria-label"],rt={key:0,class:"vuecal__flex vuecal__split-days-headers"};function ot(t,e,l,a,o,s){const u=i.resolveComponent("weekdays-headings");return i.openBlock(),i.createElementBlock("div",et,[l.options.hideViewSelector?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",tt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.viewProps.views,(r,m)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:m},[r.enabled?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__view-btn",{"vuecal__view-btn--active":s.view.id===m,"vuecal__view-btn--highlighted":t.highlightedControl===m}]),type:"button",onDragenter:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(c,m,t.$data),onDragleave:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(c,m,t.$data),onClick:c=>s.switchView(m,null,!0),"aria-label":`${r.label} view`},i.toDisplayString(r.label),43,it)):i.createCommentVNode("",!0)],64))),128))])),l.options.hideTitleBar?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",st,[i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":t.highlightedControl==="previous"}]),type:"button",onClick:e[0]||(e[0]=(...r)=>s.previous&&s.previous(...r)),onDragenter:e[1]||(e[1]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"previous",t.$data)),onDragleave:e[2]||(e[2]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"previous",t.$data)),"aria-label":`Previous ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-prev")],42,lt),i.createElementVNode("div",at,[i.createVNode(i.Transition,{name:l.options.transitions?`slide-fade--${s.transitionDirection}`:""},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.broaderView?"button":"span"),{type:!!s.broaderView&&"button",key:`${s.view.id}${s.view.startDate.toString()}`,onClick:e[3]||(e[3]=r=>!!s.broaderView&&s.switchToBroaderView()),"aria-label":!!s.broaderView&&`Go to ${s.broaderView} view`},{default:i.withCtx(()=>[i.renderSlot(t.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),l.options.todayButton?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__today-btn",{"vuecal__today-btn--highlighted":t.highlightedControl==="today"}]),type:"button",onClick:e[4]||(e[4]=(...r)=>s.goToToday&&s.goToToday(...r)),onDragenter:e[5]||(e[5]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"today",t.$data)),onDragleave:e[6]||(e[6]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"today",t.$data)),"aria-label":"Today"},[i.renderSlot(t.$slots,"today-button")],34)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":t.highlightedControl==="next"}]),type:"button",onClick:e[7]||(e[7]=(...r)=>s.next&&s.next(...r)),onDragenter:e[8]||(e[8]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"next",t.$data)),onDragleave:e[9]||(e[9]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"next",t.$data)),"aria-label":`Next ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-next")],42,nt)])),l.viewProps.weekDaysInHeader?(i.openBlock(),i.createBlock(u,{key:2,"week-days":l.weekDays,"transition-direction":s.transitionDirection,"switch-to-narrower-view":l.switchToNarrowerView},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:r,view:m})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:r,view:m})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:r})=>[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view})]),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):i.createCommentVNode("",!0),i.createVNode(i.Transition,{name:`slide-fade--${s.transitionDirection}`},{default:i.withCtx(()=>[s.showDaySplits?(i.openBlock(),i.createElementBlock("div",rt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.daySplits,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",r.class||!1]),key:m},[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view.id},()=>[i.createTextVNode(i.toDisplayString(r.label),1)])],2))),128))])):i.createCommentVNode("",!0)]),_:3},8,["name"])])}const ut={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:Se},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(t){this.vuecal.transitionDirection=t}},broaderView(){const{enabledViews:t}=this.vuecal;return t[t.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}},dt=U(ut,[["render",ot]]),ct=["draggable"];function ht(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__event",s.eventClasses]),style:i.normalizeStyle(s.eventStyles),tabindex:"0",onFocus:e[4]||(e[4]=(...u)=>s.focusEvent&&s.focusEvent(...u)),onKeypress:e[5]||(e[5]=i.withKeys(i.withModifiers((...u)=>s.onEnterKeypress&&s.onEnterKeypress(...u),["stop"]),["enter"])),onMouseenter:e[6]||(e[6]=(...u)=>s.onMouseEnter&&s.onMouseEnter(...u)),onMouseleave:e[7]||(e[7]=(...u)=>s.onMouseLeave&&s.onMouseLeave(...u)),onTouchstart:e[8]||(e[8]=i.withModifiers((...u)=>s.onTouchStart&&s.onTouchStart(...u),["stop"])),onMousedown:e[9]||(e[9]=u=>s.onMouseDown(u)),onMouseup:e[10]||(e[10]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchend:e[11]||(e[11]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchmove:e[12]||(e[12]=(...u)=>s.onTouchMove&&s.onTouchMove(...u)),onDblclick:e[13]||(e[13]=(...u)=>s.onDblClick&&s.onDblClick(...u)),draggable:s.draggable,onDragstart:e[14]||(e[14]=u=>s.draggable&&s.onDragStart(u)),onDragend:e[15]||(e[15]=u=>s.draggable&&s.onDragEnd())},[s.vuecal.editEvents.delete&&l.event.deletable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:e[0]||(e[0]=i.withModifiers((...u)=>s.deleteEvent&&s.deleteEvent(...u),["stop"])),onTouchstart:e[1]||(e[1]=i.withModifiers((...u)=>s.touchDeleteEvent&&s.touchDeleteEvent(...u),["stop"]))},i.toDisplayString(s.vuecal.texts.deleteEvent),33)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"event",{event:l.event,view:s.view.id}),s.resizable?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:e[2]||(e[2]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"])),onTouchstart:e[3]||(e[3]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"]))},null,32)):i.createCommentVNode("",!0)],46,ct)}const vt={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(t,e=!1){if("ontouchstart"in window&&!e)return!1;const{clickHoldAnEvent:l,focusAnEvent:a,resizeAnEvent:o,dragAnEvent:s}=this.domEvents;if(a._eid===this.event._eid&&l._eid===this.event._eid)return!0;this.focusEvent(),l._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(l.timeoutId=setTimeout(()=>{!o._eid&&!s._eid&&(l._eid=this.event._eid,this.event.deleting=!0)},l.timeout))},onMouseUp(t){this.domEvents.focusAnEvent._eid===this.event._eid&&!this.touch.dragged&&(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(t){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:e,clientY:l}=t.touches[0],{startX:a,startY:o,dragThreshold:s}=this.touch;(Math.abs(e-a)>s||Math.abs(l-o)>s)&&(this.touch.dragged=!0)},onTouchStart(t){this.touch.startX=t.touches[0].clientX,this.touch.startY=t.touches[0].clientY,this.onMouseDown(t,!0)},onEnterKeypress(t){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,t)},onDblClick(t){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,t)},onDragStart(t){this.dnd&&this.dnd.eventDragStart(t,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(t=!1){if("ontouchstart"in window&&!t)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(t){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:t}=this.domEvents,e=t._eid;if(e!==this.event._eid){if(e){const l=this.view.events.find(a=>a._eid===e);l&&(l.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),t._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:t,endTimeMinutes:e}=this.segment||this.event;let l=t-this.vuecal.timeFrom;const a=Math.max(Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);l=Math.min(e,this.vuecal.timeTo)-this.vuecal.timeFrom;const o=Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),s=Math.max(o-a,5);return{top:a,height:s}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let t=100/Math.min(this.overlaps.length+1,this.overlapsStreak),e=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&t<this.vuecal.minEventWidth&&(t=this.vuecal.minEventWidth,e=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:l,height:a}=this.eventDimensions;return{top:`${l}px`,height:`${a}px`,width:`${t}%`,left:this.event.left&&`${this.event.left}px`||`${e}%`}},eventClasses(){const{isFirstDay:t,isLastDay:e}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&t&&!e,"event-middle":this.segment&&!t&&!e,"event-end":this.segment&&e&&!t}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:t,background:e,daysCount:l}=this.event;return this.vuecal.editEvents.drag&&t&&!e&&l===1},resizable(){const{editEvents:t,time:e}=this.vuecal;return t.resize&&this.event.resizable&&e&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}},mt=U(vt,[["render",ht]]),yt=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],ft={key:0,class:"cell-time-labels"},wt=["innerHTML"],gt={key:2,class:"vuecal__cell-events"},Dt=["title"];function pt(t,e,l,a,o,s){const u=i.resolveComponent("event");return i.openBlock(),i.createBlock(i.TransitionGroup,{class:i.normalizeClass(["vuecal__cell",s.cellClasses]),name:`slide-fade--${s.transitionDirection}`,tag:"div",appear:l.options.transitions,style:i.normalizeStyle(s.cellStyles)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?s.splits:1,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal__cell-content",s.splitsCount&&s.splitClasses(r)]),key:l.options.transitions?`${s.view.id}-${l.data.content}-${m}`:m,"data-split":s.splitsCount?r.id:!1,column:"",tabindex:"0","aria-label":l.data.content,onFocus:e[0]||(e[0]=c=>s.onCellFocus(c)),onKeypress:e[1]||(e[1]=i.withKeys(c=>s.onCellkeyPressEnter(c),["enter"])),onTouchstart:c=>!s.isDisabled&&s.onCellTouchStart(c,s.splitsCount?r.id:null),onMousedown:c=>!s.isDisabled&&s.onCellMouseDown(c,s.splitsCount?r.id:null),onClick:e[2]||(e[2]=c=>!s.isDisabled&&s.onCellClick(c)),onDblclick:e[3]||(e[3]=c=>!s.isDisabled&&s.onCellDblClick(c)),onContextmenu:e[4]||(e[4]=c=>!s.isDisabled&&l.options.cellContextmenu&&s.onCellContextMenu(c)),onDragenter:e[5]||(e[5]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragEnter(c,t.$data,l.data.startDate)),onDragover:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragOver(c,t.$data,l.data.startDate,s.splitsCount?r.id:null),onDragleave:e[6]||(e[6]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragLeave(c,t.$data,l.data.startDate)),onDrop:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragDrop(c,t.$data,l.data.startDate,s.splitsCount?r.id:null)},[l.options.showTimeInCells&&l.options.time&&s.isWeekOrDayView&&!l.allDay?(i.openBlock(),i.createElementBlock("div",ft,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.timeCells,(c,h)=>(i.openBlock(),i.createElementBlock("span",{class:"cell-time-label",key:h},i.toDisplayString(c.label),1))),128))])):i.createCommentVNode("",!0),s.isWeekOrDayView&&!l.allDay&&s.specialHours.length?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(s.specialHours,(c,h)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__special-hours",`vuecal__special-hours--day${c.day} ${c.class}`]),style:i.normalizeStyle(`height: ${c.height}px;top: ${c.top}px`)},[c.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"special-hours-label",innerHTML:c.label},null,8,wt)):i.createCommentVNode("",!0)],6))),256)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"cell-content",{events:s.events,selectCell:c=>s.selectCell(c,!0),split:s.splitsCount?r:!1}),s.eventsCount&&(s.isWeekOrDayView||s.view.id==="month"&&l.options.eventsOnMonthView)?(i.openBlock(),i.createElementBlock("div",gt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?r.events:s.events,(c,h)=>(i.openBlock(),i.createBlock(u,{key:h,"cell-formatted-date":l.data.formattedDate,event:c,"all-day":l.allDay,"cell-events":s.splitsCount?r.events:s.events,overlaps:((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).overlaps,"event-position":((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).position,"overlaps-streak":s.splitsCount?r.overlapsStreak:t.cellOverlapsStreak},{event:i.withCtx(({event:y,view:w})=>[i.renderSlot(t.$slots,"event",{view:w,event:y})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):i.createCommentVNode("",!0)],42,yt))),128)),s.timelineVisible?(i.openBlock(),i.createElementBlock("div",{class:"vuecal__now-line",style:i.normalizeStyle(`top: ${s.todaysTimePosition}px`),key:l.options.transitions?`${s.view.id}-now-line`:"now-line",title:s.utils.date.formatTime(s.vuecal.now)},null,12,Dt)):i.createCommentVNode("",!0)]),_:3},8,["class","name","appear","style"])}const kt={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:mt},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:t}){let l=t.classList.contains("vuecal__cell-split")?t:this.vuecal.findAncestor(t,"vuecal__cell-split");return l&&(l=l.attributes["data-split"].value,parseInt(l).toString()===l.toString()&&(l=parseInt(l))),l||null},splitClasses(t){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===t.id,[t.class]:!!t.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(t){return this.vuecal.isDOMElementAnEvent(t)},selectCell(t,e=!1){const l=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.selectCell(e,this.timeAtCursor,l),this.timeAtCursor=null},onCellkeyPressEnter(t){this.isSelected||this.onCellFocus(t);const e=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,e),this.timeAtCursor=null},onCellFocus(t){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const e=this.splitsCount?this.getSplitAtCursor(t):null,l=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",e?{date:l,split:e}:l)}},onCellMouseDown(t,e=null,l=!1){if("ontouchstart"in window&&!l)return!1;this.isSelected||this.onCellFocus(t);const{clickHoldACell:a,focusAnEvent:o}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:s,cursorCoords:{y:u}}=this.vuecal.minutesAtCursor(t);this.timeAtCursor.setMinutes(s);const r=this.isDOMElementAnEvent(t.target);!r&&o._eid&&((this.view.events.find(m=>m._eid===o._eid)||{}).focused=!1),this.editEvents.create&&!r&&this.setUpEventCreation(t,u)},setUpEventCreation(t,e){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:l}=this.domEvents;if(l.startCursorY=e,l.split=this.splitsCount?this.getSplitAtCursor(t):null,l.start=this.timeAtCursor,this.options.snapToTime){let a=this.timeAtCursor.getHours()*60+this.timeAtCursor.getMinutes();const o=a+this.options.snapToTime/2;a=o-o%this.options.snapToTime,l.start.setHours(0,a,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(t)},setUpCellHoldTimer(t){const{clickHoldACell:e}=this.domEvents;e.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,e.split=this.splitsCount?this.getSplitAtCursor(t):null,e.timeoutId=setTimeout(()=>{if(e.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:l}=this.utils.event.createAnEvent(this.timeAtCursor,null,e.split?{split:e.split}:{});e.eventCreated=l}},e.timeout)},onCellTouchStart(t,e=null){this.onCellMouseDown(t,e,!0)},onCellClick(t){this.isDOMElementAnEvent(t.target)||this.selectCell(t)},onCellDblClick(t){const e=new Date(this.data.startDate);e.setMinutes(this.vuecal.minutesAtCursor(t).minutes);const l=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-dblclick",l?{date:e,split:l}:e),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(t){t.stopPropagation(),t.preventDefault();const e=new Date(this.data.startDate),{cursorCoords:l,minutes:a}=this.vuecal.minutesAtCursor(t);e.setMinutes(a);const o=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-contextmenu",{date:e,...l,...o||{},e:t})}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:t}=this.options,{isYearsOrYearView:e}=this.vuecal;return t.length&&t.includes(this.data.formattedDate)&&!e?!0:this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let t=!1;const{selectedDate:e}=this.view;return this.view.id==="years"?t=e.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t=e.getFullYear()===this.data.startDate.getFullYear()&&e.getMonth()===this.data.startDate.getMonth():t=e.getTime()===this.data.startDate.getTime(),t},set(t){this.view.selectedDate=t,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(t=>{let{from:e,to:l}=t;return e=Math.max(e,this.options.timeFrom),l=Math.min(l,this.options.timeTo),{...t,height:(l-e)*this.timeScale,top:(e-this.options.timeFrom)*this.timeScale}})},events(){const{startDate:t,endDate:e}=this.data;let l=[];if(!(["years","year"].includes(this.view.id)&&!this.options.eventsCountOnYearView)){if(l=this.view.events.slice(0),this.view.id==="month"&&l.push(...this.view.outOfScopeEvents),l=l.filter(a=>this.utils.event.eventInRange(a,t,e)),this.options.showAllDayEvents&&this.view.id!=="month"&&(l=l.filter(a=>!!a.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:a,timeTo:o}=this.options;l=l.filter(s=>{const u=s.daysCount>1&&s.segments[this.data.formattedDate]||{},r=s.daysCount===1&&s.startTimeMinutes<o&&s.endTimeMinutes>a,m=s.daysCount>1&&u.startTimeMinutes<o&&u.endTimeMinutes>a;return s.allDay||r||m||!1})}this.options.time&&this.isWeekOrDayView&&!(this.options.showAllDayEvents&&this.allDay)&&l.sort((a,o)=>a.start<o.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return l},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((t,e)=>{const l=this.events.filter(s=>s.split===t.id),[a,o]=this.utils.event.checkCellOverlappingEvents(l.filter(s=>!s.background&&!s.allDay),this.options);return{...t,overlaps:a,overlapsStreak:o,events:l}})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:t,timeTo:e}=this.options;return this.data.today&&this.isWeekOrDayView&&t&&!this.allDay&&this.nowInMinutes<=e},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const t=this.nowInMinutes-this.options.timeFrom;return Math.round(t*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}},_e=U(kt,[["render",pt]]),Ct={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function bt(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex vuecal__all-day",style:i.normalizeStyle(l.cellOrSplitMinWidth&&{height:l.height})},[l.cellOrSplitMinWidth?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ct,[i.createElementVNode("span",null,i.toDisplayString(l.label),1)])),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${s.view.id}-view`]),grow:"",style:i.normalizeStyle(l.cellOrSplitMinWidth?`min-width: ${l.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.cells,(r,m)=>(i.openBlock(),i.createBlock(u,{key:m,options:l.options,"edit-events":s.editEvents,data:r,"all-day":!0,"cell-width":l.options.hideWeekdays.length&&(s.vuecal.isWeekView||s.vuecal.isMonthView)&&s.vuecal.cellWidth,"min-timestamp":l.options.minTimestamp,"max-timestamp":l.options.maxTimestamp,"cell-splits":l.daySplits},{event:i.withCtx(({event:c,view:h})=>[i.renderSlot(t.$slots,"event",{view:h,event:c})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}const Tt={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":_e},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}},Et=U(Tt,[["render",bt]]),St=["lang"],_t={class:"default"},Mt={key:0,class:"vuecal__flex vuecal__body",grow:""},Vt=["onBlur","innerHTML"],Bt=["innerHTML"],Ot=["innerHTML"],Ht={class:"vuecal__flex",row:"",grow:""},Wt={key:0,class:"vuecal__time-column"},At={class:"vuecal__time-cell-label"},Nt={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},Ft=["wrap","column"],Pt=["onBlur","innerHTML"],Lt=["innerHTML"],jt=["innerHTML"],xt=["wrap"],zt=["innerHTML"],Yt=["innerHTML"],It={key:2,class:"vuecal__cell-events-count"},qt={key:3,class:"vuecal__no-event"},Rt=["onBlur","innerHTML"],Ut=["innerHTML"],Kt={key:2,class:"vuecal__event-time"},Gt={key:0},Xt={key:1,class:"days-to-end"},Jt=["innerHTML"],Zt={key:0,class:"vuecal__scrollbar-check"};function Qt(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-header"),r=i.resolveComponent("all-day-bar"),m=i.resolveComponent("weekdays-headings"),c=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal",s.cssClasses]),column:"",ref:"vuecal",lang:l.locale},[i.createVNode(u,{options:t.$props,"edit-events":s.editEvents,"view-props":{views:s.views,weekDaysInHeader:s.weekDaysInHeader},"week-days":s.weekDays,"has-splits":s.hasSplits,"day-splits":s.daySplits,"switch-to-narrower-view":s.switchToNarrowerView},i.createSlots({"arrow-prev":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-prev",{},()=>[e[0]||(e[0]=i.createTextVNode(" ")),e[1]||(e[1]=i.createElementVNode("i",{class:"angle"},null,-1)),e[2]||(e[2]=i.createTextVNode(" "))])]),"arrow-next":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-next",{},()=>[e[3]||(e[3]=i.createTextVNode(" ")),e[4]||(e[4]=i.createElementVNode("i",{class:"angle"},null,-1)),e[5]||(e[5]=i.createTextVNode(" "))])]),"today-button":i.withCtx(()=>[i.renderSlot(t.$slots,"today-button",{},()=>[i.createElementVNode("span",_t,i.toDisplayString(o.texts.today),1)])]),title:i.withCtx(()=>[i.renderSlot(t.$slots,"title",{title:s.viewTitle,view:o.view},()=>[i.createTextVNode(i.toDisplayString(s.viewTitle),1)])]),_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:h,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:h,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:h})=>[i.renderSlot(t.$slots,"split-label",{split:h,view:o.view.id})]),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),l.hideBody?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Mt,[i.createVNode(i.Transition,{name:`slide-fade--${o.transitionDirection}`,appear:l.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:l.transitions?o.view.id:!1,column:""},[l.showAllDayEvents&&s.hasTimeColumn&&(!s.cellOrSplitMinWidth||s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:0},s.allDayBar)),{event:i.withCtx(({event:h,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:h},()=>[s.editEvents.title&&h.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,h),innerHTML:h.title},null,40,Vt)):h.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,Bt)):i.createCommentVNode("",!0),h.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:h.content},null,8,Ot)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__bg",{vuecal__flex:!s.hasTimeColumn}]),column:""},[i.createElementVNode("div",Ht,[s.hasTimeColumn?(i.openBlock(),i.createElementBlock("div",Wt,[l.showAllDayEvents&&s.cellOrSplitMinWidth&&!(s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__all-day-text",style:i.normalizeStyle({height:s.allDayBar.height})},[i.createElementVNode("span",null,i.toDisplayString(o.texts.allDay),1)],4)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.timeCells,(h,y)=>(i.openBlock(),i.createElementBlock("div",{class:"vuecal__time-cell",key:y,style:i.normalizeStyle(`height: ${l.timeCellHeight}px`)},[i.renderSlot(t.$slots,"time-cell",{hours:h.hours,minutes:h.minutes},()=>[e[6]||(e[6]=i.createElementVNode("span",{class:"vuecal__time-cell-line"},null,-1)),i.createElementVNode("span",At,i.toDisplayString(h.label),1)])],4))),128))])):i.createCommentVNode("",!0),l.showWeekNumbers&&s.isMonthView?(i.openBlock(),i.createElementBlock("div",Nt,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(6,h=>i.createElementVNode("div",{class:"vuecal__flex vuecal__week-number-cell",key:h,grow:""},[i.renderSlot(t.$slots,"week-number-cell",{week:s.getWeekNumber(h-1)},()=>[i.createTextVNode(i.toDisplayString(s.getWeekNumber(h-1)),1)])])),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${o.view.id}-view`]),grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,column:!!s.cellOrSplitMinWidth},[s.cellOrSplitMinWidth&&s.isWeekView?(i.openBlock(),i.createBlock(m,{key:0,"transition-direction":o.transitionDirection,"week-days":s.weekDays,"switch-to-narrower-view":s.switchToNarrowerView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:h,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:h,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:h})=>[i.renderSlot(t.$slots,"split-label",{split:h,view:o.view.id})]),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):s.hasSplits&&l.stickySplitLabels&&l.minSplitWidth?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.daySplits,(h,y)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",h.class||!1]),key:y},[i.renderSlot(t.$slots,"split-label",{split:h,view:o.view.id},()=>[i.createTextVNode(i.toDisplayString(h.label),1)])],2))),128))],4)):i.createCommentVNode("",!0),l.showAllDayEvents&&s.hasTimeColumn&&(s.isWeekView&&s.cellOrSplitMinWidth||s.isDayView&&s.hasSplits&&l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:2},s.allDayBar)),{event:i.withCtx(({event:h,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:h},()=>[s.editEvents.title&&h.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,h),innerHTML:h.title},null,40,Pt)):h.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,Lt)):i.createCommentVNode("",!0),h.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:h.content},null,8,jt)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"vuecal__flex",ref:h=>o.cellsEl=h,grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.viewCells,(h,y)=>(i.openBlock(),i.createBlock(c,{key:y,options:t.$props,"edit-events":s.editEvents,data:h,"cell-width":l.hideWeekdays.length&&(s.isWeekView||s.isMonthView)&&s.cellWidth,"min-timestamp":s.minTimestamp,"max-timestamp":s.maxTimestamp,"cell-splits":s.hasSplits&&s.daySplits||[]},{"cell-content":i.withCtx(({events:w,split:T,selectCell:g})=>[i.renderSlot(t.$slots,"cell-content",{cell:h,view:o.view,goNarrower:g,events:w},()=>[T&&!l.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",{key:0,class:"split-label",innerHTML:T.label},null,8,zt)):i.createCommentVNode("",!0),h.content?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__cell-date",innerHTML:h.content},null,8,Yt)):i.createCommentVNode("",!0),(s.isMonthView&&!l.eventsOnMonthView||s.isYearsOrYearView&&l.eventsCountOnYearView)&&w.length?(i.openBlock(),i.createElementBlock("div",It,[i.renderSlot(t.$slots,"events-count",{view:o.view,events:w},()=>[i.createTextVNode(i.toDisplayString(w.length),1)])])):i.createCommentVNode("",!0),!s.cellOrSplitHasEvents(w,T)&&s.isWeekOrDayView?(i.openBlock(),i.createElementBlock("div",qt,[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])])):i.createCommentVNode("",!0)])]),event:i.withCtx(({event:w,view:T})=>[i.renderSlot(t.$slots,"event",{view:T,event:w},()=>[s.editEvents.title&&w.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:g=>s.onEventTitleBlur(g,w),innerHTML:w.title},null,40,Rt)):w.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:w.title},null,8,Ut)):i.createCommentVNode("",!0),l.time&&!w.allDay&&!(s.isMonthView&&(w.allDay||l.showAllDayEvents==="short"))&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",Kt,[i.createTextVNode(i.toDisplayString(o.utils.date.formatTime(w.start,s.TimeFormat)),1),w.endTimeMinutes?(i.openBlock(),i.createElementBlock("span",Gt," - "+i.toDisplayString(o.utils.date.formatTime(w.end,s.TimeFormat,null,!0)),1)):i.createCommentVNode("",!0),w.daysCount>1&&(w.segments[h.formattedDate]||{}).isFirstDay?(i.openBlock(),i.createElementBlock("small",Xt," +"+i.toDisplayString(w.daysCount-1)+i.toDisplayString((o.texts.day[0]||"").toLowerCase()),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),w.content&&!(s.isMonthView&&w.allDay&&l.showAllDayEvents==="short")&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:3,class:"vuecal__event-content",innerHTML:w.content},null,8,Jt)):i.createCommentVNode("",!0)])]),"no-event":i.withCtx(()=>[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,xt)],10,Ft)])],2)]))]),_:3},8,["name","appear"]),o.ready?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Zt,e[7]||(e[7]=[i.createElementVNode("div",null,null,-1)])))]))],10,St)}const de=1440,ce={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},be=["years","year","month","week","day"],Te=new je(ce),$t={name:"vue-cal",components:{"vuecal-cell":_e,"vuecal-header":dt,WeekdaysHeadings:Se,AllDayBar:Et},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:de},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...ce},utils:{date:(this.disableDatePrototypes?Te.removePrototypes():!1)||Te,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(t){if(typeof this.locale=="object"){this.texts=Object.assign({},ce,t),this.utils.date.updateTexts(this.texts);return}const e=await Le(Object.assign({"./i18n/ar.json":()=>Promise.resolve().then(()=>require("./ar.es-CKau4tBl.js")),"./i18n/bg.json":()=>Promise.resolve().then(()=>require("./bg.es-Melqx1M5.js")),"./i18n/bn.json":()=>Promise.resolve().then(()=>require("./bn.es-ClbAZ4WP.js")),"./i18n/bs.json":()=>Promise.resolve().then(()=>require("./bs.es-KjOcbE96.js")),"./i18n/ca.json":()=>Promise.resolve().then(()=>require("./ca.es-BaGTENcW.js")),"./i18n/cs.json":()=>Promise.resolve().then(()=>require("./cs.es-ChOlHqBr.js")),"./i18n/da.json":()=>Promise.resolve().then(()=>require("./da.es-DOFXbf8-.js")),"./i18n/de.json":()=>Promise.resolve().then(()=>require("./de.es-DwE82Kaw.js")),"./i18n/el.json":()=>Promise.resolve().then(()=>require("./el.es-CNrCgzYI.js")),"./i18n/en.json":()=>Promise.resolve().then(()=>require("./en.es-CgL601qd.js")),"./i18n/es.json":()=>Promise.resolve().then(()=>require("./es.es-IdFGKY7Q.js")),"./i18n/et.json":()=>Promise.resolve().then(()=>require("./et.es-BygWmV3P.js")),"./i18n/fa.json":()=>Promise.resolve().then(()=>require("./fa.es-DW_0SmsT.js")),"./i18n/fi.json":()=>Promise.resolve().then(()=>require("./fi.es-pgfJlZ8i.js")),"./i18n/fr.json":()=>Promise.resolve().then(()=>require("./fr.es-OENguFuM.js")),"./i18n/he.json":()=>Promise.resolve().then(()=>require("./he.es-bixEnAeH.js")),"./i18n/hr.json":()=>Promise.resolve().then(()=>require("./hr.es-CkRAP94O.js")),"./i18n/hu.json":()=>Promise.resolve().then(()=>require("./hu.es-DG6HeiQJ.js")),"./i18n/id.json":()=>Promise.resolve().then(()=>require("./id.es-D4tPi6wP.js")),"./i18n/is.json":()=>Promise.resolve().then(()=>require("./is.es-CDFqLYCV.js")),"./i18n/it.json":()=>Promise.resolve().then(()=>require("./it.es-BHgrw_C6.js")),"./i18n/ja.json":()=>Promise.resolve().then(()=>require("./ja.es-D-lxWwyb.js")),"./i18n/ka.json":()=>Promise.resolve().then(()=>require("./ka.es-CnnB6q4A.js")),"./i18n/ko.json":()=>Promise.resolve().then(()=>require("./ko.es-b18aaB3V.js")),"./i18n/lt.json":()=>Promise.resolve().then(()=>require("./lt.es-BY9UQ6wZ.js")),"./i18n/mn.json":()=>Promise.resolve().then(()=>require("./mn.es-YFS7gSdf.js")),"./i18n/nl.json":()=>Promise.resolve().then(()=>require("./nl.es-BEx-4hnj.js")),"./i18n/no.json":()=>Promise.resolve().then(()=>require("./no.es-BQnRWlWR.js")),"./i18n/pl.json":()=>Promise.resolve().then(()=>require("./pl.es-CKCsZ_02.js")),"./i18n/pt-br.json":()=>Promise.resolve().then(()=>require("./pt-br.es-oH7qh6Fd.js")),"./i18n/pt-pt.json":()=>Promise.resolve().then(()=>require("./pt-pt.es-DLk5I0ej.js")),"./i18n/ro.json":()=>Promise.resolve().then(()=>require("./ro.es-DgTen1Dh.js")),"./i18n/ru.json":()=>Promise.resolve().then(()=>require("./ru.es-jGIQfREl.js")),"./i18n/sk.json":()=>Promise.resolve().then(()=>require("./sk.es-D2bhVb26.js")),"./i18n/sl.json":()=>Promise.resolve().then(()=>require("./sl.es-TV8Uraa1.js")),"./i18n/sq.json":()=>Promise.resolve().then(()=>require("./sq.es-Cc65zxbr.js")),"./i18n/sr.json":()=>Promise.resolve().then(()=>require("./sr.es-D5VNA_GW.js")),"./i18n/sv.json":()=>Promise.resolve().then(()=>require("./sv.es-dBeK_DZs.js")),"./i18n/tr.json":()=>Promise.resolve().then(()=>require("./tr.es-BUz4S13G.js")),"./i18n/uk.json":()=>Promise.resolve().then(()=>require("./uk.es-B8uaeLcK.js")),"./i18n/vi.json":()=>Promise.resolve().then(()=>require("./vi.es-2OFMtbQI.js")),"./i18n/zh-cn.json":()=>Promise.resolve().then(()=>require("./zh-cn.es-fDHCbCIg.js")),"./i18n/zh-hk.json":()=>Promise.resolve().then(()=>require("./zh-hk.es-COzeh5F8.js"))}),`./i18n/${t}.json`,3);this.texts=Object.assign({},ce,e),this.utils.date.updateTexts(this.texts)},loadDragAndDrop(){Promise.resolve().then(()=>require("./drag-and-drop.es-DWn92Mem.js")).then(t=>{const{DragAndDrop:e}=t;this.modules.dnd=new e(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(t){return be.includes(t)||(console.error(`Vue Cal: invalid active-view parameter provided: "${t}".
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),v=require("./index-DON-Hfjr.js"),Ne=require("./_plugin-vue_export-helper-BHFhmbuH.js");var Fe=Object.defineProperty,Pe=(t,e,l)=>e in t?Fe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[e]=l,N=(t,e,l)=>Pe(t,typeof e!="symbol"?e+"":e,l);const Le=(t,e,l)=>{const a=t[e];return a?typeof a=="function"?a():Promise.resolve(a):new Promise((o,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==l?". Note that variables only represent file names one level deep.":""))))})};let oe,ke,Ce,B,ue={},R={};class je{constructor(e,l=!1){N(this,"texts",{}),N(this,"dateToMinutes",a=>a.getHours()*60+a.getMinutes()),B=this,this._texts=e,!l&&Date&&!Date.prototype.addDays&&this._initDatePrototypes()}_initDatePrototypes(){Date.prototype.addDays=function(e){return B.addDays(this,e)},Date.prototype.subtractDays=function(e){return B.subtractDays(this,e)},Date.prototype.addHours=function(e){return B.addHours(this,e)},Date.prototype.subtractHours=function(e){return B.subtractHours(this,e)},Date.prototype.addMinutes=function(e){return B.addMinutes(this,e)},Date.prototype.subtractMinutes=function(e){return B.subtractMinutes(this,e)},Date.prototype.getWeek=function(){return B.getWeek(this)},Date.prototype.isToday=function(){return B.isToday(this)},Date.prototype.isLeapYear=function(){return B.isLeapYear(this)},Date.prototype.format=function(e="YYYY-MM-DD"){return B.formatDate(this,e)},Date.prototype.formatTime=function(e="HH:mm"){return B.formatTime(this,e)}}removePrototypes(){delete Date.prototype.addDays,delete Date.prototype.subtractDays,delete Date.prototype.addHours,delete Date.prototype.subtractHours,delete Date.prototype.addMinutes,delete Date.prototype.subtractMinutes,delete Date.prototype.getWeek,delete Date.prototype.isToday,delete Date.prototype.isLeapYear,delete Date.prototype.format,delete Date.prototype.formatTime}updateTexts(e){this._texts=e}_todayFormatted(){return ke!==new Date().getDate()&&(oe=new Date,ke=oe.getDate(),Ce=`${oe.getFullYear()}-${oe.getMonth()}-${oe.getDate()}`),Ce}addDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()+l),a}subtractDays(e,l){const a=new Date(e.valueOf());return a.setDate(a.getDate()-l),a}addHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()+l),a}subtractHours(e,l){const a=new Date(e.valueOf());return a.setHours(a.getHours()-l),a}addMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()+l),a}subtractMinutes(e,l){const a=new Date(e.valueOf());return a.setMinutes(a.getMinutes()-l),a}getWeek(e){const l=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())),a=l.getUTCDay()||7;l.setUTCDate(l.getUTCDate()+4-a);const o=new Date(Date.UTC(l.getUTCFullYear(),0,1));return Math.ceil(((l-o)/864e5+1)/7)}isToday(e){return`${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`===this._todayFormatted()}isLeapYear(e){const l=e.getFullYear();return!(l%400)||l%100&&!(l%4)}getPreviousFirstDayOfWeek(e=null,l){const a=e&&new Date(e.valueOf())||new Date,o=l?7:6;return a.setDate(a.getDate()-(a.getDay()+o)%7),a}stringToDate(e){return e instanceof Date?e:(e.length===10&&(e+=" 00:00"),new Date(e.replace(/-/g,"/")))}countDays(e,l){typeof e=="string"&&(e=e.replace(/-/g,"/")),typeof l=="string"&&(l=l.replace(/-/g,"/")),e=new Date(e).setHours(0,0,0,0),l=new Date(l).setHours(0,0,1,0);const a=(new Date(l).getTimezoneOffset()-new Date(e).getTimezoneOffset())*60*1e3;return Math.ceil((l-e-a)/(24*3600*1e3))}datesInSameTimeStep(e,l,a){return Math.abs(e.getTime()-l.getTime())<=a*60*1e3}formatDate(e,l="YYYY-MM-DD",a=null){if(a||(a=this._texts),l||(l="YYYY-MM-DD"),l==="YYYY-MM-DD")return this.formatDateLite(e);ue={},R={};const o={YYYY:()=>this._hydrateDateObject(e,a).YYYY,YY:()=>this._hydrateDateObject(e,a).YY(),M:()=>this._hydrateDateObject(e,a).M,MM:()=>this._hydrateDateObject(e,a).MM(),MMM:()=>this._hydrateDateObject(e,a).MMM(),MMMM:()=>this._hydrateDateObject(e,a).MMMM(),MMMMG:()=>this._hydrateDateObject(e,a).MMMMG(),D:()=>this._hydrateDateObject(e,a).D,DD:()=>this._hydrateDateObject(e,a).DD(),S:()=>this._hydrateDateObject(e,a).S(),d:()=>this._hydrateDateObject(e,a).d,dd:()=>this._hydrateDateObject(e,a).dd(),ddd:()=>this._hydrateDateObject(e,a).ddd(),dddd:()=>this._hydrateDateObject(e,a).dddd(),HH:()=>this._hydrateTimeObject(e,a).HH,H:()=>this._hydrateTimeObject(e,a).H,hh:()=>this._hydrateTimeObject(e,a).hh,h:()=>this._hydrateTimeObject(e,a).h,am:()=>this._hydrateTimeObject(e,a).am,AM:()=>this._hydrateTimeObject(e,a).AM,mm:()=>this._hydrateTimeObject(e,a).mm,m:()=>this._hydrateTimeObject(e,a).m};return l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(s,u)=>{const r=o[u.replace(/\{|\}/g,"")];return r!==void 0?r():u})}formatDateLite(e){const l=e.getMonth()+1,a=e.getDate();return`${e.getFullYear()}-${l<10?"0":""}${l}-${a<10?"0":""}${a}`}formatTime(e,l="HH:mm",a=null,o=!1){let s=!1;if(o){const[m,c,h]=[e.getHours(),e.getMinutes(),e.getSeconds()];m+c+h===141&&(s=!0)}if(e instanceof Date&&l==="HH:mm")return s?"24:00":this.formatTimeLite(e);R={},a||(a=this._texts);const u=this._hydrateTimeObject(e,a),r=l.replace(/(\{[a-zA-Z]+\}|[a-zA-Z]+)/g,(m,c)=>{const h=u[c.replace(/\{|\}/g,"")];return h!==void 0?h:c});return s?r.replace("23:59","24:00"):r}formatTimeLite(e){const l=e.getHours(),a=e.getMinutes();return`${(l<10?"0":"")+l}:${(a<10?"0":"")+a}`}_nth(e){if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}_hydrateDateObject(e,l){if(ue.D)return ue;const a=e.getFullYear(),o=e.getMonth()+1,s=e.getDate(),r=(e.getDay()-1+7)%7;return ue={YYYY:a,YY:()=>a.toString().substring(2),M:o,MM:()=>(o<10?"0":"")+o,MMM:()=>l.months[o-1].substring(0,3),MMMM:()=>l.months[o-1],MMMMG:()=>(l.monthsGenitive||l.months)[o-1],D:s,DD:()=>(s<10?"0":"")+s,S:()=>this._nth(s),d:r+1,dd:()=>l.weekDays[r][0],ddd:()=>l.weekDays[r].substr(0,3),dddd:()=>l.weekDays[r]},ue}_hydrateTimeObject(e,l){if(R.am)return R;let a,o;e instanceof Date?(a=e.getHours(),o=e.getMinutes()):(a=Math.floor(e/60),o=Math.floor(e%60));const s=a%12?a%12:12,u=(l||{am:"am",pm:"pm"})[a===24||a<12?"am":"pm"];return R={H:a,h:s,HH:(a<10?"0":"")+a,hh:(s<10?"0":"")+s,am:u,AM:u.toUpperCase(),m:o,mm:(o<10?"0":"")+o},R}}const xe=1440;class ze{constructor(e){N(this,"_vuecal",null),N(this,"selectCell",(l=!1,a,o)=>{this._vuecal.$emit("cell-click",o?{date:a,split:o}:a),this._vuecal.clickToNavigate||l?this._vuecal.switchToNarrowerView():this._vuecal.dblclickToNavigate&&"ontouchstart"in window&&(this._vuecal.domEvents.dblTapACell.taps++,setTimeout(()=>this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.domEvents.dblTapACell.timeout),this._vuecal.domEvents.dblTapACell.taps>=2&&(this._vuecal.domEvents.dblTapACell.taps=0,this._vuecal.switchToNarrowerView(),this._vuecal.$emit("cell-dblclick",o?{date:a,split:o}:a)))}),N(this,"keyPressEnterCell",(l,a)=>{this._vuecal.$emit("cell-keypress-enter",a?{date:l,split:a}:l),this._vuecal.switchToNarrowerView()}),N(this,"getPosition",l=>{const{left:a,top:o}=this._vuecal.cellsEl.getBoundingClientRect(),{clientX:s,clientY:u}="ontouchstart"in window&&l.touches?l.touches[0]:l;return{x:s-a,y:u-o}}),N(this,"minutesAtCursor",l=>{let a=0,o={x:0,y:0};const{timeStep:s,timeCellHeight:u,timeFrom:r}=this._vuecal.$props;return typeof l=="number"?a=l:typeof l=="object"&&(o=this.getPosition(l),a=Math.round(o.y*s/parseInt(u)+r)),{minutes:Math.max(Math.min(a,xe),0),cursorCoords:o}}),this._vuecal=e}}const Ye=2,me=1440;let p,k,ye;class Ie{constructor(e,l){N(this,"_vuecal",null),N(this,"eventDefaults",{_eid:null,start:"",startTimeMinutes:0,end:"",endTimeMinutes:0,title:"",content:"",background:!1,allDay:!1,segments:null,repeat:null,daysCount:1,deletable:!0,deleting:!1,titleEditable:!0,resizable:!0,resizing:!1,draggable:!0,dragging:!1,draggingStatic:!1,focused:!1,class:""}),this._vuecal=e,p=l}createAnEvent(e,l,a){if(typeof e=="string"&&(e=p.stringToDate(e)),!(e instanceof Date))return!1;const o=p.dateToMinutes(e);l=l*1||Ye*60;const s=o+l,u=p.addMinutes(new Date(e),l);a.end&&(typeof a.end=="string"&&(a.end=p.stringToDate(a.end)),a.endTimeMinutes=p.dateToMinutes(a.end));const r={...this.eventDefaults,_eid:`${this._vuecal._.uid}_${this._vuecal.eventIdIncrement++}`,start:e,startTimeMinutes:o,end:u,endTimeMinutes:s,segments:null,...a};if(!(typeof this._vuecal.onEventCreate=="function"&&!this._vuecal.onEventCreate(r,()=>this.deleteAnEvent(r))))return r.startDateF!==r.endDateF&&(r.daysCount=p.countDays(r.start,r.end)),this._vuecal.mutableEvents.push(r),this._vuecal.addEventsToView([r]),this._vuecal.emitWithEvent("event-create",r),this._vuecal.$emit("event-change",{event:this._vuecal.cleanupEvent(r),originalEvent:null}),r}addEventSegment(e){e.segments||(e.segments={},e.segments[p.formatDateLite(e.start)]={start:e.start,startTimeMinutes:e.startTimeMinutes,endTimeMinutes:me,isFirstDay:!0,isLastDay:!1});const l=e.segments[p.formatDateLite(e.end)];l&&(l.isLastDay=!1,l.endTimeMinutes=me);const a=p.addDays(e.end,1),o=p.formatDateLite(a);return a.setHours(0,0,0,0),e.segments[o]={start:a,startTimeMinutes:0,endTimeMinutes:e.endTimeMinutes,isFirstDay:!1,isLastDay:!0},e.end=p.addMinutes(a,e.endTimeMinutes),e.daysCount=Object.keys(e.segments).length,o}removeEventSegment(e){let l=Object.keys(e.segments).length;if(l<=1)return p.formatDateLite(e.end);delete e.segments[p.formatDateLite(e.end)],l--;const a=p.subtractDays(e.end,1),o=p.formatDateLite(a),s=e.segments[o];return l?s&&(s.isLastDay=!0,s.endTimeMinutes=e.endTimeMinutes):e.segments=null,e.daysCount=l||1,e.end=a,o}createEventSegments(e,l,a){const o=l.getTime(),s=a.getTime();let u=e.start.getTime(),r=e.end.getTime(),m=!1,c,h,y;for(!e.end.getHours()&&!e.end.getMinutes()&&(r-=1e3),e.segments={},e.repeat?(c=o,h=Math.min(s,e.repeat.until?p.stringToDate(e.repeat.until).getTime():s)):(c=Math.max(o,u),h=Math.min(s,r));c<=h;){let w=!1;const T=p.addDays(new Date(c),1).setHours(0,0,0,0);let g,_,E,D;if(e.repeat){const M=new Date(c),C=p.formatDateLite(M);(m||e.occurrences&&e.occurrences[C])&&(m||(u=e.occurrences[C].start,y=new Date(u).setHours(0,0,0,0),r=e.occurrences[C].end),m=!0,w=!0),g=c===y,_=C===p.formatDateLite(new Date(r)),E=new Date(g?u:c),D=p.formatDateLite(E),_&&(m=!1)}else w=!0,g=c===u,_=h===r&&T>h,E=g?e.start:new Date(c),D=p.formatDateLite(g?e.start:E);w&&(e.segments[D]={start:E,startTimeMinutes:g?e.startTimeMinutes:0,endTimeMinutes:_?e.endTimeMinutes:me,isFirstDay:g,isLastDay:_}),c=T}return e}deleteAnEvent(e){this._vuecal.emitWithEvent("event-delete",e),this._vuecal.mutableEvents=this._vuecal.mutableEvents.filter(l=>l._eid!==e._eid),this._vuecal.view.events=this._vuecal.view.events.filter(l=>l._eid!==e._eid)}checkCellOverlappingEvents(e,l){ye=e.slice(0),k={},e.forEach(o=>{ye.shift(),k[o._eid]||(k[o._eid]={overlaps:[],start:o.start,position:0}),k[o._eid].position=0,ye.forEach(s=>{k[s._eid]||(k[s._eid]={overlaps:[],start:s.start,position:0});const u=this.eventInRange(s,o.start,o.end),r=l.overlapsPerTimeStep?p.datesInSameTimeStep(o.start,s.start,l.timeStep):1;if(!o.background&&!o.allDay&&!s.background&&!s.allDay&&u&&r)k[o._eid].overlaps.push(s._eid),k[o._eid].overlaps=[...new Set(k[o._eid].overlaps)],k[s._eid].overlaps.push(o._eid),k[s._eid].overlaps=[...new Set(k[s._eid].overlaps)],k[s._eid].position++;else{let m,c;(m=(k[o._eid]||{overlaps:[]}).overlaps.indexOf(s._eid))>-1&&k[o._eid].overlaps.splice(m,1),(c=(k[s._eid]||{overlaps:[]}).overlaps.indexOf(o._eid))>-1&&k[s._eid].overlaps.splice(c,1),k[s._eid].position--}})});let a=0;for(const o in k){const s=k[o],u=s.overlaps.map(r=>({id:r,start:k[r].start}));u.push({id:o,start:s.start}),u.sort((r,m)=>r.start<m.start?-1:r.start>m.start?1:r.id>m.id?-1:1),s.position=u.findIndex(r=>r.id===o),a=Math.max(this.getOverlapsStreak(s,k),a)}return[k,a]}getOverlapsStreak(e,l={}){let a=e.overlaps.length+1,o=[];return e.overlaps.forEach(s=>{o.includes(s)||e.overlaps.filter(r=>r!==s).forEach(r=>{l[r].overlaps.includes(s)||o.push(r)})}),o=[...new Set(o)],a-=o.length,a}eventInRange(e,l,a){if(e.allDay||!this._vuecal.time){const u=new Date(e.start).setHours(0,0,0,0);return new Date(e.end).setHours(23,59,0,0)>=new Date(l).setHours(0,0,0,0)&&u<=new Date(a).setHours(0,0,0,0)}const o=e.start.getTime(),s=e.end.getTime();return o<a.getTime()&&s>l.getTime()}}const qe={class:"vuecal__flex vuecal__weekdays-headings"},Re=["onClick"],Ue={class:"vuecal__flex weekday-label",grow:""},Ke={class:"full"},Ge={class:"small"},Xe={class:"xsmall"},Je={key:0},Ze={key:0,class:"vuecal__flex vuecal__split-days-headers",grow:""};function Qe(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",qe,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.headings,(u,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:r},[u.hide?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["vuecal__flex vuecal__heading",{today:u.today,clickable:s.cellHeadingsClickable}]),style:i.normalizeStyle(s.weekdayCellStyles),onClick:m=>s.view.id==="week"&&s.selectCell(u.date,m),onDblclick:e[0]||(e[0]=m=>s.view.id==="week"&&s.vuecal.dblclickToNavigate&&l.switchToNarrowerView())},[i.createVNode(i.Transition,{name:`slide-fade--${l.transitionDirection}`,appear:s.vuecal.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",column:"",key:s.vuecal.transitions?`${r}-${u.dayOfMonth}`:!1},[i.createElementVNode("div",Ue,[i.renderSlot(t.$slots,"weekday-heading",{heading:s.cleanupHeading(u),view:s.view},()=>[i.createElementVNode("span",Ke,i.toDisplayString(u.full),1),i.createElementVNode("span",Ge,i.toDisplayString(u.small),1),i.createElementVNode("span",Xe,i.toDisplayString(u.xsmall),1),u.dayOfMonth?(i.openBlock(),i.createElementBlock("span",Je," "+i.toDisplayString(u.dayOfMonth),1)):i.createCommentVNode("",!0)])]),s.vuecal.hasSplits&&s.vuecal.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",Ze,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.daySplits,(m,c)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",m.class||!1]),key:c},[i.renderSlot(t.$slots,"split-label",{split:m,view:s.view},()=>[i.createTextVNode(i.toDisplayString(m.label),1)])],2))),128))])):i.createCommentVNode("",!0)]))]),_:2},1032,["name","appear"])],46,Re))],64))),128))])}const U=(t,e)=>{const l=t.__vccOpts||t;for(const[a,o]of e)l[a]=o;return l},$e={inject:["vuecal","utils","view"],props:{transitionDirection:{type:String,default:"right"},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},methods:{selectCell(t,e){t.getTime()!==this.view.selectedDate.getTime()&&(this.view.selectedDate=t),this.utils.cell.selectCell(!1,t,e)},cleanupHeading:t=>({label:t.full,date:t.date,...t.today?{today:t.today}:{}})},computed:{headings(){if(!["month","week"].includes(this.view.id))return[];let t=!1;return this.weekDays.map((l,a)=>{const o=this.utils.date.addDays(this.view.startDate,this.vuecal.startWeekOnSunday&&this.vuecal.hideWeekends?a-1:a);return{hide:l.hide,full:l.label,small:l.short||l.label.substr(0,3),xsmall:l.short||l.label.substr(0,1),...this.view.id==="week"?{dayOfMonth:o.getDate(),date:o,today:!t&&this.utils.date.isToday(o)&&!t++}:{}}})},cellWidth(){return 100/(7-this.weekDays.reduce((t,e)=>t+e.hide,0))},weekdayCellStyles(){return{...this.vuecal.hideWeekdays.length?{width:`${this.cellWidth}%`}:{}}},cellHeadingsClickable(){return this.view.id==="week"&&(this.vuecal.clickToNavigate||this.vuecal.dblclickToNavigate)}}},Se=U($e,[["render",Qe]]),et={class:"vuecal__header"},tt={key:0,class:"vuecal__flex vuecal__menu",role:"tablist","aria-label":"Calendar views navigation"},it=["onDragenter","onDragleave","onClick","aria-label"],st={key:1,class:"vuecal__title-bar"},lt=["aria-label"],at={class:"vuecal__flex vuecal__title",grow:""},nt=["aria-label"],rt={key:0,class:"vuecal__flex vuecal__split-days-headers"};function ot(t,e,l,a,o,s){const u=i.resolveComponent("weekdays-headings");return i.openBlock(),i.createElementBlock("div",et,[l.options.hideViewSelector?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",tt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.viewProps.views,(r,m)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:m},[r.enabled?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__view-btn",{"vuecal__view-btn--active":s.view.id===m,"vuecal__view-btn--highlighted":t.highlightedControl===m}]),type:"button",onDragenter:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(c,m,t.$data),onDragleave:c=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(c,m,t.$data),onClick:c=>s.switchView(m,null,!0),"aria-label":`${r.label} view`},i.toDisplayString(r.label),43,it)):i.createCommentVNode("",!0)],64))),128))])),l.options.hideTitleBar?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",st,[i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--prev",{"vuecal__arrow--highlighted":t.highlightedControl==="previous"}]),type:"button",onClick:e[0]||(e[0]=(...r)=>s.previous&&s.previous(...r)),onDragenter:e[1]||(e[1]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"previous",t.$data)),onDragleave:e[2]||(e[2]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"previous",t.$data)),"aria-label":`Previous ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-prev")],42,lt),i.createElementVNode("div",at,[i.createVNode(i.Transition,{name:l.options.transitions?`slide-fade--${s.transitionDirection}`:""},{default:i.withCtx(()=>[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(s.broaderView?"button":"span"),{type:!!s.broaderView&&"button",key:`${s.view.id}${s.view.startDate.toString()}`,onClick:e[3]||(e[3]=r=>!!s.broaderView&&s.switchToBroaderView()),"aria-label":!!s.broaderView&&`Go to ${s.broaderView} view`},{default:i.withCtx(()=>[i.renderSlot(t.$slots,"title")]),_:3},8,["type","aria-label"]))]),_:3},8,["name"])]),l.options.todayButton?(i.openBlock(),i.createElementBlock("button",{key:0,class:i.normalizeClass(["vuecal__today-btn",{"vuecal__today-btn--highlighted":t.highlightedControl==="today"}]),type:"button",onClick:e[4]||(e[4]=(...r)=>s.goToToday&&s.goToToday(...r)),onDragenter:e[5]||(e[5]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"today",t.$data)),onDragleave:e[6]||(e[6]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"today",t.$data)),"aria-label":"Today"},[i.renderSlot(t.$slots,"today-button")],34)):i.createCommentVNode("",!0),i.createElementVNode("button",{class:i.normalizeClass(["vuecal__arrow vuecal__arrow--next",{"vuecal__arrow--highlighted":t.highlightedControl==="next"}]),type:"button",onClick:e[7]||(e[7]=(...r)=>s.next&&s.next(...r)),onDragenter:e[8]||(e[8]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragEnter(r,"next",t.$data)),onDragleave:e[9]||(e[9]=r=>l.editEvents.drag&&s.dnd&&s.dnd.viewSelectorDragLeave(r,"next",t.$data)),"aria-label":`Next ${s.view.id}`},[i.renderSlot(t.$slots,"arrow-next")],42,nt)])),l.viewProps.weekDaysInHeader?(i.openBlock(),i.createBlock(u,{key:2,"week-days":l.weekDays,"transition-direction":s.transitionDirection,"switch-to-narrower-view":l.switchToNarrowerView},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:r,view:m})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:r,view:m})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:r})=>[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view})]),key:"1"}:void 0]),1032,["week-days","transition-direction","switch-to-narrower-view"])):i.createCommentVNode("",!0),i.createVNode(i.Transition,{name:`slide-fade--${s.transitionDirection}`},{default:i.withCtx(()=>[s.showDaySplits?(i.openBlock(),i.createElementBlock("div",rt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.daySplits,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",r.class||!1]),key:m},[i.renderSlot(t.$slots,"split-label",{split:r,view:s.view.id},()=>[i.createTextVNode(i.toDisplayString(r.label),1)])],2))),128))])):i.createCommentVNode("",!0)]),_:3},8,["name"])])}const ut={inject:["vuecal","previous","next","switchView","updateSelectedDate","modules","view"],components:{WeekdaysHeadings:Se},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},hasSplits:{type:[Boolean,Number],default:!1},daySplits:{type:Array,default:()=>[]},viewProps:{type:Object,default:()=>({})},weekDays:{type:Array,default:()=>[]},switchToNarrowerView:{type:Function,default:()=>{}}},data:()=>({highlightedControl:null}),methods:{goToToday(){this.updateSelectedDate(new Date(new Date().setHours(0,0,0,0)))},switchToBroaderView(){this.transitionDirection="left",this.broaderView&&this.switchView(this.broaderView)}},computed:{transitionDirection:{get(){return this.vuecal.transitionDirection},set(t){this.vuecal.transitionDirection=t}},broaderView(){const{enabledViews:t}=this.vuecal;return t[t.indexOf(this.view.id)-1]},showDaySplits(){return this.view.id==="day"&&this.hasSplits&&this.options.stickySplitLabels&&!this.options.minSplitWidth},dnd(){return this.modules.dnd}}},dt=U(ut,[["render",ot]]),ct=["draggable"];function ht(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__event",s.eventClasses]),style:i.normalizeStyle(s.eventStyles),tabindex:"0",onFocus:e[4]||(e[4]=(...u)=>s.focusEvent&&s.focusEvent(...u)),onKeypress:e[5]||(e[5]=i.withKeys(i.withModifiers((...u)=>s.onEnterKeypress&&s.onEnterKeypress(...u),["stop"]),["enter"])),onMouseenter:e[6]||(e[6]=(...u)=>s.onMouseEnter&&s.onMouseEnter(...u)),onMouseleave:e[7]||(e[7]=(...u)=>s.onMouseLeave&&s.onMouseLeave(...u)),onTouchstart:e[8]||(e[8]=i.withModifiers((...u)=>s.onTouchStart&&s.onTouchStart(...u),["stop"])),onMousedown:e[9]||(e[9]=u=>s.onMouseDown(u)),onMouseup:e[10]||(e[10]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchend:e[11]||(e[11]=(...u)=>s.onMouseUp&&s.onMouseUp(...u)),onTouchmove:e[12]||(e[12]=(...u)=>s.onTouchMove&&s.onTouchMove(...u)),onDblclick:e[13]||(e[13]=(...u)=>s.onDblClick&&s.onDblClick(...u)),draggable:s.draggable,onDragstart:e[14]||(e[14]=u=>s.draggable&&s.onDragStart(u)),onDragend:e[15]||(e[15]=u=>s.draggable&&s.onDragEnd())},[s.vuecal.editEvents.delete&&l.event.deletable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-delete",onClick:e[0]||(e[0]=i.withModifiers((...u)=>s.deleteEvent&&s.deleteEvent(...u),["stop"])),onTouchstart:e[1]||(e[1]=i.withModifiers((...u)=>s.touchDeleteEvent&&s.touchDeleteEvent(...u),["stop"]))},i.toDisplayString(s.vuecal.texts.deleteEvent),33)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"event",{event:l.event,view:s.view.id}),s.resizable?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-resize-handle",contenteditable:"false",onMousedown:e[2]||(e[2]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"])),onTouchstart:e[3]||(e[3]=i.withModifiers((...u)=>s.onResizeHandleMouseDown&&s.onResizeHandleMouseDown(...u),["stop","prevent"]))},null,32)):i.createCommentVNode("",!0)],46,ct)}const vt={inject:["vuecal","utils","modules","view","domEvents","editEvents"],props:{cellFormattedDate:{type:String,default:""},event:{type:Object,default:()=>({})},cellEvents:{type:Array,default:()=>[]},overlaps:{type:Array,default:()=>[]},eventPosition:{type:Number,default:0},overlapsStreak:{type:Number,default:0},allDay:{type:Boolean,default:!1}},data:()=>({touch:{dragThreshold:30,startX:0,startY:0,dragged:!1}}),methods:{onMouseDown(t,e=!1){if("ontouchstart"in window&&!e)return!1;const{clickHoldAnEvent:l,focusAnEvent:a,resizeAnEvent:o,dragAnEvent:s}=this.domEvents;if(a._eid===this.event._eid&&l._eid===this.event._eid)return!0;this.focusEvent(),l._eid=null,this.vuecal.editEvents.delete&&this.event.deletable&&(l.timeoutId=setTimeout(()=>{!o._eid&&!s._eid&&(l._eid=this.event._eid,this.event.deleting=!0)},l.timeout))},onMouseUp(t){this.domEvents.focusAnEvent._eid===this.event._eid&&!this.touch.dragged&&(this.domEvents.focusAnEvent.mousedUp=!0),this.touch.dragged=!1},onMouseEnter(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-enter",this.event)},onMouseLeave(t){t.preventDefault(),this.vuecal.emitWithEvent("event-mouse-leave",this.event)},onTouchMove(t){if(typeof this.vuecal.onEventClick!="function")return;const{clientX:e,clientY:l}=t.touches[0],{startX:a,startY:o,dragThreshold:s}=this.touch;(Math.abs(e-a)>s||Math.abs(l-o)>s)&&(this.touch.dragged=!0)},onTouchStart(t){this.touch.startX=t.touches[0].clientX,this.touch.startY=t.touches[0].clientY,this.onMouseDown(t,!0)},onEnterKeypress(t){if(typeof this.vuecal.onEventClick=="function")return this.vuecal.onEventClick(this.event,t)},onDblClick(t){if(typeof this.vuecal.onEventDblclick=="function")return this.vuecal.onEventDblclick(this.event,t)},onDragStart(t){this.dnd&&this.dnd.eventDragStart(t,this.event)},onDragEnd(){this.dnd&&this.dnd.eventDragEnd(this.event)},onResizeHandleMouseDown(){this.focusEvent(),this.domEvents.dragAnEvent._eid=null,this.domEvents.resizeAnEvent=Object.assign(this.domEvents.resizeAnEvent,{_eid:this.event._eid,start:(this.segment||this.event).start,split:this.event.split||null,segment:!!this.segment&&this.utils.date.formatDateLite(this.segment.start),originalEnd:new Date((this.segment||this.event).end),originalEndTimeMinutes:this.event.endTimeMinutes}),this.event.resizing=!0},deleteEvent(t=!1){if("ontouchstart"in window&&!t)return!1;this.utils.event.deleteAnEvent(this.event)},touchDeleteEvent(t){this.deleteEvent(!0)},cancelDeleteEvent(){this.event.deleting=!1},focusEvent(){const{focusAnEvent:t}=this.domEvents,e=t._eid;if(e!==this.event._eid){if(e){const l=this.view.events.find(a=>a._eid===e);l&&(l.focused=!1)}this.vuecal.cancelDelete(),this.vuecal.emitWithEvent("event-focus",this.event),t._eid=this.event._eid,this.event.focused=!0}}},computed:{eventDimensions(){const{startTimeMinutes:t,endTimeMinutes:e}=this.segment||this.event;let l=t-this.vuecal.timeFrom;const a=Math.max(Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),0);l=Math.min(e,this.vuecal.timeTo)-this.vuecal.timeFrom;const o=Math.round(l*this.vuecal.timeCellHeight/this.vuecal.timeStep),s=Math.max(o-a,5);return{top:a,height:s}},eventStyles(){if(this.event.allDay||!this.vuecal.time||!this.event.endTimeMinutes||this.view.id==="month"||this.allDay)return{};let t=100/Math.min(this.overlaps.length+1,this.overlapsStreak),e=100/(this.overlaps.length+1)*this.eventPosition;this.vuecal.minEventWidth&&t<this.vuecal.minEventWidth&&(t=this.vuecal.minEventWidth,e=(100-this.vuecal.minEventWidth)/this.overlaps.length*this.eventPosition);const{top:l,height:a}=this.eventDimensions;return{top:`${l}px`,height:`${a}px`,width:`${t}%`,left:this.event.left&&`${this.event.left}px`||`${e}%`}},eventClasses(){const{isFirstDay:t,isLastDay:e}=this.segment||{};return{[this.event.class]:!!this.event.class,"vuecal__event--focus":this.event.focused,"vuecal__event--resizing":this.event.resizing,"vuecal__event--background":this.event.background,"vuecal__event--deletable":this.event.deleting,"vuecal__event--all-day":this.event.allDay,"vuecal__event--dragging":!this.event.draggingStatic&&this.event.dragging,"vuecal__event--static":this.event.dragging&&this.event.draggingStatic,"vuecal__event--multiple-days":!!this.segment,"event-start":this.segment&&t&&!e,"event-middle":this.segment&&!t&&!e,"event-end":this.segment&&e&&!t}},segment(){return this.event.segments&&this.event.segments[this.cellFormattedDate]||null},draggable(){const{draggable:t,background:e,daysCount:l}=this.event;return this.vuecal.editEvents.drag&&t&&!e&&l===1},resizable(){const{editEvents:t,time:e}=this.vuecal;return t.resize&&this.event.resizable&&e&&!this.allDay&&(!this.segment||this.segment&&this.segment.isLastDay)&&this.view.id!=="month"},dnd(){return this.modules.dnd}}},mt=U(vt,[["render",ht]]),yt=["data-split","aria-label","onTouchstart","onMousedown","onDragover","onDrop"],ft={key:0,class:"cell-time-labels"},wt=["innerHTML"],gt={key:2,class:"vuecal__cell-events"},Dt=["title"];function pt(t,e,l,a,o,s){const u=i.resolveComponent("event");return i.openBlock(),i.createBlock(i.TransitionGroup,{class:i.normalizeClass(["vuecal__cell",s.cellClasses]),name:`slide-fade--${s.transitionDirection}`,tag:"div",appear:l.options.transitions,style:i.normalizeStyle(s.cellStyles)},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?s.splits:1,(r,m)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal__cell-content",s.splitsCount&&s.splitClasses(r)]),key:l.options.transitions?`${s.view.id}-${l.data.content}-${m}`:m,"data-split":s.splitsCount?r.id:!1,column:"",tabindex:"0","aria-label":l.data.content,onFocus:e[0]||(e[0]=c=>s.onCellFocus(c)),onKeypress:e[1]||(e[1]=i.withKeys(c=>s.onCellkeyPressEnter(c),["enter"])),onTouchstart:c=>!s.isDisabled&&s.onCellTouchStart(c,s.splitsCount?r.id:null),onMousedown:c=>!s.isDisabled&&s.onCellMouseDown(c,s.splitsCount?r.id:null),onClick:e[2]||(e[2]=c=>!s.isDisabled&&s.onCellClick(c)),onDblclick:e[3]||(e[3]=c=>!s.isDisabled&&s.onCellDblClick(c)),onContextmenu:e[4]||(e[4]=c=>!s.isDisabled&&l.options.cellContextmenu&&s.onCellContextMenu(c)),onDragenter:e[5]||(e[5]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragEnter(c,t.$data,l.data.startDate)),onDragover:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragOver(c,t.$data,l.data.startDate,s.splitsCount?r.id:null),onDragleave:e[6]||(e[6]=c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragLeave(c,t.$data,l.data.startDate)),onDrop:c=>!s.isDisabled&&l.editEvents.drag&&s.dnd&&s.dnd.cellDragDrop(c,t.$data,l.data.startDate,s.splitsCount?r.id:null)},[l.options.showTimeInCells&&l.options.time&&s.isWeekOrDayView&&!l.allDay?(i.openBlock(),i.createElementBlock("div",ft,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.vuecal.timeCells,(c,h)=>(i.openBlock(),i.createElementBlock("span",{class:"cell-time-label",key:h},i.toDisplayString(c.label),1))),128))])):i.createCommentVNode("",!0),s.isWeekOrDayView&&!l.allDay&&s.specialHours.length?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(s.specialHours,(c,h)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__special-hours",`vuecal__special-hours--day${c.day} ${c.class}`]),style:i.normalizeStyle(`height: ${c.height}px;top: ${c.top}px`)},[c.label?(i.openBlock(),i.createElementBlock("div",{key:0,class:"special-hours-label",innerHTML:c.label},null,8,wt)):i.createCommentVNode("",!0)],6))),256)):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"cell-content",{events:s.events,selectCell:c=>s.selectCell(c,!0),split:s.splitsCount?r:!1}),s.eventsCount&&(s.isWeekOrDayView||s.view.id==="month"&&l.options.eventsOnMonthView)?(i.openBlock(),i.createElementBlock("div",gt,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.splitsCount?r.events:s.events,(c,h)=>(i.openBlock(),i.createBlock(u,{key:h,"cell-formatted-date":l.data.formattedDate,event:c,"all-day":l.allDay,"cell-events":s.splitsCount?r.events:s.events,overlaps:((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).overlaps,"event-position":((s.splitsCount?r.overlaps[c._eid]:t.cellOverlaps[c._eid])||[]).position,"overlaps-streak":s.splitsCount?r.overlapsStreak:t.cellOverlapsStreak},{event:i.withCtx(({event:y,view:w})=>[i.renderSlot(t.$slots,"event",{view:w,event:y})]),_:2},1032,["cell-formatted-date","event","all-day","cell-events","overlaps","event-position","overlaps-streak"]))),128))])):i.createCommentVNode("",!0)],42,yt))),128)),s.timelineVisible?(i.openBlock(),i.createElementBlock("div",{class:"vuecal__now-line",style:i.normalizeStyle(`top: ${s.todaysTimePosition}px`),key:l.options.transitions?`${s.view.id}-now-line`:"now-line",title:s.utils.date.formatTime(s.vuecal.now)},null,12,Dt)):i.createCommentVNode("",!0)]),_:3},8,["class","name","appear","style"])}const kt={inject:["vuecal","utils","modules","view","domEvents"],components:{Event:mt},props:{options:{type:Object,default:()=>({})},editEvents:{type:Object,required:!0},data:{type:Object,required:!0},cellSplits:{type:Array,default:()=>[]},minTimestamp:{type:[Number,null],default:null},maxTimestamp:{type:[Number,null],default:null},cellWidth:{type:[Number,Boolean],default:!1},allDay:{type:Boolean,default:!1}},data:()=>({cellOverlaps:{},cellOverlapsStreak:1,timeAtCursor:null,highlighted:!1,highlightedSplit:null}),methods:{getSplitAtCursor({target:t}){let l=t.classList.contains("vuecal__cell-split")?t:this.vuecal.findAncestor(t,"vuecal__cell-split");return l&&(l=l.attributes["data-split"].value,parseInt(l).toString()===l.toString()&&(l=parseInt(l))),l||null},splitClasses(t){return{"vuecal__cell-split":!0,"vuecal__cell-split--highlighted":this.highlightedSplit===t.id,[t.class]:!!t.class}},checkCellOverlappingEvents(){this.options.time&&this.eventsCount&&!this.splitsCount&&(this.eventsCount===1?(this.cellOverlaps=[],this.cellOverlapsStreak=1):[this.cellOverlaps,this.cellOverlapsStreak]=this.utils.event.checkCellOverlappingEvents(this.events,this.options))},isDOMElementAnEvent(t){return this.vuecal.isDOMElementAnEvent(t)},selectCell(t,e=!1){const l=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.selectCell(e,this.timeAtCursor,l),this.timeAtCursor=null},onCellkeyPressEnter(t){this.isSelected||this.onCellFocus(t);const e=this.splitsCount?this.getSplitAtCursor(t):null;this.utils.cell.keyPressEnterCell(this.timeAtCursor,e),this.timeAtCursor=null},onCellFocus(t){if(!this.isSelected&&!this.isDisabled){this.isSelected=this.data.startDate;const e=this.splitsCount?this.getSplitAtCursor(t):null,l=this.timeAtCursor||this.data.startDate;this.vuecal.$emit("cell-focus",e?{date:l,split:e}:l)}},onCellMouseDown(t,e=null,l=!1){if("ontouchstart"in window&&!l)return!1;this.isSelected||this.onCellFocus(t);const{clickHoldACell:a,focusAnEvent:o}=this.domEvents;this.domEvents.cancelClickEventCreation=!1,a.eventCreated=!1,this.timeAtCursor=new Date(this.data.startDate);const{minutes:s,cursorCoords:{y:u}}=this.vuecal.minutesAtCursor(t);this.timeAtCursor.setMinutes(s);const r=this.isDOMElementAnEvent(t.target);!r&&o._eid&&((this.view.events.find(m=>m._eid===o._eid)||{}).focused=!1),this.editEvents.create&&!r&&this.setUpEventCreation(t,u)},setUpEventCreation(t,e){if(this.options.dragToCreateEvent&&["week","day"].includes(this.view.id)){const{dragCreateAnEvent:l}=this.domEvents;if(l.startCursorY=e,l.split=this.splitsCount?this.getSplitAtCursor(t):null,l.start=this.timeAtCursor,this.options.snapToTime){let a=this.timeAtCursor.getHours()*60+this.timeAtCursor.getMinutes();const o=a+this.options.snapToTime/2;a=o-o%this.options.snapToTime,l.start.setHours(0,a,0,0)}}else this.options.cellClickHold&&["month","week","day"].includes(this.view.id)&&this.setUpCellHoldTimer(t)},setUpCellHoldTimer(t){const{clickHoldACell:e}=this.domEvents;e.cellId=`${this.vuecal._.uid}_${this.data.formattedDate}`,e.split=this.splitsCount?this.getSplitAtCursor(t):null,e.timeoutId=setTimeout(()=>{if(e.cellId&&!this.domEvents.cancelClickEventCreation){const{_eid:l}=this.utils.event.createAnEvent(this.timeAtCursor,null,e.split?{split:e.split}:{});e.eventCreated=l}},e.timeout)},onCellTouchStart(t,e=null){this.onCellMouseDown(t,e,!0)},onCellClick(t){this.isDOMElementAnEvent(t.target)||this.selectCell(t)},onCellDblClick(t){const e=new Date(this.data.startDate);e.setMinutes(this.vuecal.minutesAtCursor(t).minutes);const l=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-dblclick",l?{date:e,split:l}:e),this.options.dblclickToNavigate&&this.vuecal.switchToNarrowerView()},onCellContextMenu(t){t.stopPropagation(),t.preventDefault();const e=new Date(this.data.startDate),{cursorCoords:l,minutes:a}=this.vuecal.minutesAtCursor(t);e.setMinutes(a);const o=this.splitsCount?this.getSplitAtCursor(t):null;this.vuecal.$emit("cell-contextmenu",{date:e,...l,...o||{},e:t})}},computed:{dnd(){return this.modules.dnd},nowInMinutes(){return this.utils.date.dateToMinutes(this.vuecal.now)},isBeforeMinDate(){return this.minTimestamp!==null&&this.minTimestamp>this.data.endDate.getTime()},isAfterMaxDate(){return this.maxTimestamp&&this.maxTimestamp<this.data.startDate.getTime()},isDisabled(){const{disableDays:t}=this.options,{isYearsOrYearView:e}=this.vuecal;return t.length&&t.includes(this.data.formattedDate)&&!e?!0:this.isBeforeMinDate||this.isAfterMaxDate},isSelected:{get(){let t=!1;const{selectedDate:e}=this.view;return this.view.id==="years"?t=e.getFullYear()===this.data.startDate.getFullYear():this.view.id==="year"?t=e.getFullYear()===this.data.startDate.getFullYear()&&e.getMonth()===this.data.startDate.getMonth():t=e.getTime()===this.data.startDate.getTime(),t},set(t){this.view.selectedDate=t,this.vuecal.$emit("update:selected-date",this.view.selectedDate)}},isWeekOrDayView(){return["week","day"].includes(this.view.id)},transitionDirection(){return this.vuecal.transitionDirection},specialHours(){return this.data.specialHours.map(t=>{let{from:e,to:l}=t;return e=Math.max(e,this.options.timeFrom),l=Math.min(l,this.options.timeTo),{...t,height:(l-e)*this.timeScale,top:(e-this.options.timeFrom)*this.timeScale}})},events(){const{startDate:t,endDate:e}=this.data;let l=[];if(!(["years","year"].includes(this.view.id)&&!this.options.eventsCountOnYearView)){if(l=this.view.events.slice(0),this.view.id==="month"&&l.push(...this.view.outOfScopeEvents),l=l.filter(a=>this.utils.event.eventInRange(a,t,e)),this.options.showAllDayEvents&&this.view.id!=="month"&&(l=l.filter(a=>!!a.allDay===this.allDay)),this.options.time&&this.isWeekOrDayView&&!this.allDay){const{timeFrom:a,timeTo:o}=this.options;l=l.filter(s=>{const u=s.daysCount>1&&s.segments[this.data.formattedDate]||{},r=s.daysCount===1&&s.startTimeMinutes<o&&s.endTimeMinutes>a,m=s.daysCount>1&&u.startTimeMinutes<o&&u.endTimeMinutes>a;return s.allDay||r||m||!1})}this.options.time&&this.isWeekOrDayView&&!(this.options.showAllDayEvents&&this.allDay)&&l.sort((a,o)=>a.start<o.start?-1:1),this.cellSplits.length||this.$nextTick(this.checkCellOverlappingEvents)}return l},eventsCount(){return this.events.length},splits(){return this.cellSplits.map((t,e)=>{const l=this.events.filter(s=>s.split===t.id),[a,o]=this.utils.event.checkCellOverlappingEvents(l.filter(s=>!s.background&&!s.allDay),this.options);return{...t,overlaps:a,overlapsStreak:o,events:l}})},splitsCount(){return this.splits.length},cellClasses(){return{[this.data.class]:!!this.data.class,"vuecal__cell--current":this.data.current,"vuecal__cell--today":this.data.today,"vuecal__cell--out-of-scope":this.data.outOfScope,"vuecal__cell--before-min":this.isDisabled&&this.isBeforeMinDate,"vuecal__cell--after-max":this.isDisabled&&this.isAfterMaxDate,"vuecal__cell--disabled":this.isDisabled,"vuecal__cell--selected":this.isSelected,"vuecal__cell--highlighted":this.highlighted,"vuecal__cell--has-splits":this.splitsCount,"vuecal__cell--has-events":this.eventsCount}},cellStyles(){return{...this.cellWidth?{width:`${this.cellWidth}%`}:{}}},timelineVisible(){const{time:t,timeTo:e}=this.options;return this.data.today&&this.isWeekOrDayView&&t&&!this.allDay&&this.nowInMinutes<=e},todaysTimePosition(){if(!this.data.today||!this.options.time)return;const t=this.nowInMinutes-this.options.timeFrom;return Math.round(t*this.timeScale)},timeScale(){return this.options.timeCellHeight/this.options.timeStep}}},_e=U(kt,[["render",pt]]),Ct={key:0,class:"vuecal__all-day-text",style:{width:"3em"}};function bt(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex vuecal__all-day",style:i.normalizeStyle(l.cellOrSplitMinWidth&&{height:l.height})},[l.cellOrSplitMinWidth?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ct,[i.createElementVNode("span",null,i.toDisplayString(l.label),1)])),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${s.view.id}-view`]),grow:"",style:i.normalizeStyle(l.cellOrSplitMinWidth?`min-width: ${l.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.cells,(r,m)=>(i.openBlock(),i.createBlock(u,{key:m,options:l.options,"edit-events":s.editEvents,data:r,"all-day":!0,"cell-width":l.options.hideWeekdays.length&&(s.vuecal.isWeekView||s.vuecal.isMonthView)&&s.vuecal.cellWidth,"min-timestamp":l.options.minTimestamp,"max-timestamp":l.options.maxTimestamp,"cell-splits":l.daySplits},{event:i.withCtx(({event:c,view:h})=>[i.renderSlot(t.$slots,"event",{view:h,event:c})]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],6)],4)}const Tt={inject:["vuecal","view","editEvents"],components:{"vuecal-cell":_e},props:{options:{type:Object,required:!0},cells:{type:Array,required:!0},label:{type:String,required:!0},daySplits:{type:Array,default:()=>[]},shortEvents:{type:Boolean,default:!0},height:{type:String,default:""},cellOrSplitMinWidth:{type:Number,default:null}},computed:{hasCellOrSplitWidth(){return!!(this.options.minCellWidth||this.daySplits.length&&this.options.minSplitWidth)}}},Et=U(Tt,[["render",bt]]),St=["lang"],_t={class:"default"},Mt={key:0,class:"vuecal__flex vuecal__body",grow:""},Vt=["onBlur","innerHTML"],Bt=["innerHTML"],Ot=["innerHTML"],Ht={class:"vuecal__flex",row:"",grow:""},Wt={key:0,class:"vuecal__time-column"},At={class:"vuecal__time-cell-label"},Nt={key:1,class:"vuecal__flex vuecal__week-numbers",column:""},Ft=["wrap","column"],Pt=["onBlur","innerHTML"],Lt=["innerHTML"],jt=["innerHTML"],xt=["wrap"],zt=["innerHTML"],Yt=["innerHTML"],It={key:2,class:"vuecal__cell-events-count"},qt={key:3,class:"vuecal__no-event"},Rt=["onBlur","innerHTML"],Ut=["innerHTML"],Kt={key:2,class:"vuecal__event-time"},Gt={key:0},Xt={key:1,class:"days-to-end"},Jt=["innerHTML"],Zt={key:0,class:"vuecal__scrollbar-check"};function Qt(t,e,l,a,o,s){const u=i.resolveComponent("vuecal-header"),r=i.resolveComponent("all-day-bar"),m=i.resolveComponent("weekdays-headings"),c=i.resolveComponent("vuecal-cell");return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["vuecal__flex vuecal",s.cssClasses]),column:"",ref:"vuecal",lang:l.locale},[i.createVNode(u,{options:t.$props,"edit-events":s.editEvents,"view-props":{views:s.views,weekDaysInHeader:s.weekDaysInHeader},"week-days":s.weekDays,"has-splits":s.hasSplits,"day-splits":s.daySplits,"switch-to-narrower-view":s.switchToNarrowerView},i.createSlots({"arrow-prev":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-prev",{},()=>[e[0]||(e[0]=i.createTextVNode(" ")),e[1]||(e[1]=i.createElementVNode("i",{class:"angle"},null,-1)),e[2]||(e[2]=i.createTextVNode(" "))])]),"arrow-next":i.withCtx(()=>[i.renderSlot(t.$slots,"arrow-next",{},()=>[e[3]||(e[3]=i.createTextVNode(" ")),e[4]||(e[4]=i.createElementVNode("i",{class:"angle"},null,-1)),e[5]||(e[5]=i.createTextVNode(" "))])]),"today-button":i.withCtx(()=>[i.renderSlot(t.$slots,"today-button",{},()=>[i.createElementVNode("span",_t,i.toDisplayString(o.texts.today),1)])]),title:i.withCtx(()=>[i.renderSlot(t.$slots,"title",{title:s.viewTitle,view:o.view},()=>[i.createTextVNode(i.toDisplayString(s.viewTitle),1)])]),_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:h,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:h,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:h})=>[i.renderSlot(t.$slots,"split-label",{split:h,view:o.view.id})]),key:"1"}:void 0]),1032,["options","edit-events","view-props","week-days","has-splits","day-splits","switch-to-narrower-view"]),l.hideBody?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Mt,[i.createVNode(i.Transition,{name:`slide-fade--${o.transitionDirection}`,appear:l.transitions},{default:i.withCtx(()=>[(i.openBlock(),i.createElementBlock("div",{class:"vuecal__flex",style:{"min-width":"100%"},key:l.transitions?o.view.id:!1,column:""},[l.showAllDayEvents&&s.hasTimeColumn&&(!s.cellOrSplitMinWidth||s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:0},s.allDayBar)),{event:i.withCtx(({event:h,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:h},()=>[s.editEvents.title&&h.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,h),innerHTML:h.title},null,40,Vt)):h.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,Bt)):i.createCommentVNode("",!0),h.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:h.content},null,8,Ot)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__bg",{vuecal__flex:!s.hasTimeColumn}]),column:""},[i.createElementVNode("div",Ht,[s.hasTimeColumn?(i.openBlock(),i.createElementBlock("div",Wt,[l.showAllDayEvents&&s.cellOrSplitMinWidth&&!(s.isDayView&&!l.minSplitWidth)?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__all-day-text",style:i.normalizeStyle({height:s.allDayBar.height})},[i.createElementVNode("span",null,i.toDisplayString(o.texts.allDay),1)],4)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.timeCells,(h,y)=>(i.openBlock(),i.createElementBlock("div",{class:"vuecal__time-cell",key:y,style:i.normalizeStyle(`height: ${l.timeCellHeight}px`)},[i.renderSlot(t.$slots,"time-cell",{hours:h.hours,minutes:h.minutes},()=>[e[6]||(e[6]=i.createElementVNode("span",{class:"vuecal__time-cell-line"},null,-1)),i.createElementVNode("span",At,i.toDisplayString(h.label),1)])],4))),128))])):i.createCommentVNode("",!0),l.showWeekNumbers&&s.isMonthView?(i.openBlock(),i.createElementBlock("div",Nt,[(i.openBlock(),i.createElementBlock(i.Fragment,null,i.renderList(6,h=>i.createElementVNode("div",{class:"vuecal__flex vuecal__week-number-cell",key:h,grow:""},[i.renderSlot(t.$slots,"week-number-cell",{week:s.getWeekNumber(h-1)},()=>[i.createTextVNode(i.toDisplayString(s.getWeekNumber(h-1)),1)])])),64))])):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["vuecal__flex vuecal__cells",`${o.view.id}-view`]),grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,column:!!s.cellOrSplitMinWidth},[s.cellOrSplitMinWidth&&s.isWeekView?(i.openBlock(),i.createBlock(m,{key:0,"transition-direction":o.transitionDirection,"week-days":s.weekDays,"switch-to-narrower-view":s.switchToNarrowerView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},i.createSlots({_:2},[t.$slots["weekday-heading"]?{name:"weekday-heading",fn:i.withCtx(({heading:h,view:y})=>[i.renderSlot(t.$slots,"weekday-heading",{heading:h,view:y})]),key:"0"}:void 0,t.$slots["split-label"]?{name:"split-label",fn:i.withCtx(({split:h})=>[i.renderSlot(t.$slots,"split-label",{split:h,view:o.view.id})]),key:"1"}:void 0]),1032,["transition-direction","week-days","switch-to-narrower-view","style"])):s.hasSplits&&l.stickySplitLabels&&l.minSplitWidth?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__flex vuecal__split-days-headers",style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.daySplits,(h,y)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["day-split-header",h.class||!1]),key:y},[i.renderSlot(t.$slots,"split-label",{split:h,view:o.view.id},()=>[i.createTextVNode(i.toDisplayString(h.label),1)])],2))),128))],4)):i.createCommentVNode("",!0),l.showAllDayEvents&&s.hasTimeColumn&&(s.isWeekView&&s.cellOrSplitMinWidth||s.isDayView&&s.hasSplits&&l.minSplitWidth)?(i.openBlock(),i.createBlock(r,i.normalizeProps(i.mergeProps({key:2},s.allDayBar)),{event:i.withCtx(({event:h,view:y})=>[i.renderSlot(t.$slots,"event",{view:y,event:h},()=>[s.editEvents.title&&h.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:w=>s.onEventTitleBlur(w,h),innerHTML:h.title},null,40,Pt)):h.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:h.title},null,8,Lt)):i.createCommentVNode("",!0),h.content&&!s.hasShortEvents&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:2,class:"vuecal__event-content",innerHTML:h.content},null,8,jt)):i.createCommentVNode("",!0)])]),_:3},16)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:"vuecal__flex",ref:h=>o.cellsEl=h,grow:"",wrap:!s.cellOrSplitMinWidth||!s.isWeekView,style:i.normalizeStyle(s.cellOrSplitMinWidth?`min-width: ${s.cellOrSplitMinWidth}px`:"")},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.viewCells,(h,y)=>(i.openBlock(),i.createBlock(c,{key:y,options:t.$props,"edit-events":s.editEvents,data:h,"cell-width":l.hideWeekdays.length&&(s.isWeekView||s.isMonthView)&&s.cellWidth,"min-timestamp":s.minTimestamp,"max-timestamp":s.maxTimestamp,"cell-splits":s.hasSplits&&s.daySplits||[]},{"cell-content":i.withCtx(({events:w,split:T,selectCell:g})=>[i.renderSlot(t.$slots,"cell-content",{cell:h,view:o.view,goNarrower:g,events:w},()=>[T&&!l.stickySplitLabels?(i.openBlock(),i.createElementBlock("div",{key:0,class:"split-label",innerHTML:T.label},null,8,zt)):i.createCommentVNode("",!0),h.content?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__cell-date",innerHTML:h.content},null,8,Yt)):i.createCommentVNode("",!0),(s.isMonthView&&!l.eventsOnMonthView||s.isYearsOrYearView&&l.eventsCountOnYearView)&&w.length?(i.openBlock(),i.createElementBlock("div",It,[i.renderSlot(t.$slots,"events-count",{view:o.view,events:w},()=>[i.createTextVNode(i.toDisplayString(w.length),1)])])):i.createCommentVNode("",!0),!s.cellOrSplitHasEvents(w,T)&&s.isWeekOrDayView?(i.openBlock(),i.createElementBlock("div",qt,[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])])):i.createCommentVNode("",!0)])]),event:i.withCtx(({event:w,view:T})=>[i.renderSlot(t.$slots,"event",{view:T,event:w},()=>[s.editEvents.title&&w.titleEditable?(i.openBlock(),i.createElementBlock("div",{key:0,class:"vuecal__event-title vuecal__event-title--edit",contenteditable:"",onBlur:g=>s.onEventTitleBlur(g,w),innerHTML:w.title},null,40,Rt)):w.title?(i.openBlock(),i.createElementBlock("div",{key:1,class:"vuecal__event-title",innerHTML:w.title},null,8,Ut)):i.createCommentVNode("",!0),l.time&&!w.allDay&&!(s.isMonthView&&(w.allDay||l.showAllDayEvents==="short"))&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",Kt,[i.createTextVNode(i.toDisplayString(o.utils.date.formatTime(w.start,s.TimeFormat)),1),w.endTimeMinutes?(i.openBlock(),i.createElementBlock("span",Gt," - "+i.toDisplayString(o.utils.date.formatTime(w.end,s.TimeFormat,null,!0)),1)):i.createCommentVNode("",!0),w.daysCount>1&&(w.segments[h.formattedDate]||{}).isFirstDay?(i.openBlock(),i.createElementBlock("small",Xt," +"+i.toDisplayString(w.daysCount-1)+i.toDisplayString((o.texts.day[0]||"").toLowerCase()),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),w.content&&!(s.isMonthView&&w.allDay&&l.showAllDayEvents==="short")&&!s.isShortMonthView?(i.openBlock(),i.createElementBlock("div",{key:3,class:"vuecal__event-content",innerHTML:w.content},null,8,Jt)):i.createCommentVNode("",!0)])]),"no-event":i.withCtx(()=>[i.renderSlot(t.$slots,"no-event",{},()=>[i.createTextVNode(i.toDisplayString(o.texts.noEvent),1)])]),_:2},1032,["options","edit-events","data","cell-width","min-timestamp","max-timestamp","cell-splits"]))),128))],12,xt)],10,Ft)])],2)]))]),_:3},8,["name","appear"]),o.ready?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Zt,e[7]||(e[7]=[i.createElementVNode("div",null,null,-1)])))]))],10,St)}const de=1440,ce={weekDays:Array(7).fill(""),weekDaysShort:[],months:Array(12).fill(""),years:"",year:"",month:"",week:"",day:"",today:"",noEvent:"",allDay:"",deleteEvent:"",createEvent:"",dateFormat:"dddd MMMM D, YYYY",am:"am",pm:"pm"},be=["years","year","month","week","day"],Te=new je(ce),$t={name:"vue-cal",components:{"vuecal-cell":_e,"vuecal-header":dt,WeekdaysHeadings:Se,AllDayBar:Et},provide(){return{vuecal:this,utils:this.utils,modules:this.modules,previous:this.previous,next:this.next,switchView:this.switchView,updateSelectedDate:this.updateSelectedDate,editEvents:this.editEvents,view:this.view,domEvents:this.domEvents}},props:{activeView:{type:String,default:"week"},allDayBarHeight:{type:[String,Number],default:"25px"},cellClickHold:{type:Boolean,default:!0},cellContextmenu:{type:Boolean,default:!1},clickToNavigate:{type:Boolean,default:!1},dblclickToNavigate:{type:Boolean,default:!0},disableDatePrototypes:{type:Boolean,default:!1},disableDays:{type:Array,default:()=>[]},disableViews:{type:Array,default:()=>[]},dragToCreateEvent:{type:Boolean,default:!0},dragToCreateThreshold:{type:Number,default:15},editableEvents:{type:[Boolean,Object],default:!1},events:{type:Array,default:()=>[]},eventsCountOnYearView:{type:Boolean,default:!1},eventsOnMonthView:{type:[Boolean,String],default:!1},hideBody:{type:Boolean,default:!1},hideTitleBar:{type:Boolean,default:!1},hideViewSelector:{type:Boolean,default:!1},hideWeekdays:{type:Array,default:()=>[]},hideWeekends:{type:Boolean,default:!1},locale:{type:[String,Object],default:"en"},maxDate:{type:[String,Date],default:""},minCellWidth:{type:Number,default:0},minDate:{type:[String,Date],default:""},minEventWidth:{type:Number,default:0},minSplitWidth:{type:Number,default:0},onEventClick:{type:[Function,null],default:null},onEventCreate:{type:[Function,null],default:null},onEventDblclick:{type:[Function,null],default:null},overlapsPerTimeStep:{type:Boolean,default:!1},resizeX:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:""},showAllDayEvents:{type:[Boolean,String],default:!1},showTimeInCells:{type:Boolean,default:!1},showWeekNumbers:{type:[Boolean,String],default:!1},snapToTime:{type:Number,default:0},small:{type:Boolean,default:!1},specialHours:{type:Object,default:()=>({})},splitDays:{type:Array,default:()=>[]},startWeekOnSunday:{type:Boolean,default:!1},stickySplitLabels:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,default:40},timeFormat:{type:String,default:""},timeFrom:{type:Number,default:0},timeStep:{type:Number,default:60},timeTo:{type:Number,default:de},todayButton:{type:Boolean,default:!1},transitions:{type:Boolean,default:!0},twelveHour:{type:Boolean,default:!1},watchRealTime:{type:Boolean,default:!1},xsmall:{type:Boolean,default:!1}},data(){return{ready:!1,texts:{...ce},utils:{date:(this.disableDatePrototypes?Te.removePrototypes():!1)||Te,cell:null,event:null},modules:{dnd:null},cellsEl:null,view:{id:"",title:"",startDate:null,endDate:null,firstCellDate:null,lastCellDate:null,selectedDate:null,events:[]},eventIdIncrement:1,now:new Date,timeTickerIds:[null,null],domEvents:{resizeAnEvent:{_eid:null,start:null,split:null,segment:null,originalEndTimeMinutes:0,originalEnd:null,end:null,startCell:null,endCell:null},dragAnEvent:{_eid:null},dragCreateAnEvent:{startCursorY:null,start:null,split:null,event:null},focusAnEvent:{_eid:null,mousedUp:!1},clickHoldAnEvent:{_eid:null,timeout:1200,timeoutId:null},dblTapACell:{taps:0,timeout:500},clickHoldACell:{cellId:null,split:null,timeout:1200,timeoutId:null,eventCreated:!1},cancelClickEventCreation:!1},mutableEvents:[],transitionDirection:"right"}},methods:{async loadLocale(t){if(typeof this.locale=="object"){this.texts=Object.assign({},ce,t),this.utils.date.updateTexts(this.texts);return}const e=await Le(Object.assign({"./i18n/ar.json":()=>Promise.resolve().then(()=>require("./ar.es-CKau4tBl.js")),"./i18n/bg.json":()=>Promise.resolve().then(()=>require("./bg.es-Melqx1M5.js")),"./i18n/bn.json":()=>Promise.resolve().then(()=>require("./bn.es-ClbAZ4WP.js")),"./i18n/bs.json":()=>Promise.resolve().then(()=>require("./bs.es-KjOcbE96.js")),"./i18n/ca.json":()=>Promise.resolve().then(()=>require("./ca.es-BaGTENcW.js")),"./i18n/cs.json":()=>Promise.resolve().then(()=>require("./cs.es-ChOlHqBr.js")),"./i18n/da.json":()=>Promise.resolve().then(()=>require("./da.es-DOFXbf8-.js")),"./i18n/de.json":()=>Promise.resolve().then(()=>require("./de.es-DwE82Kaw.js")),"./i18n/el.json":()=>Promise.resolve().then(()=>require("./el.es-CNrCgzYI.js")),"./i18n/en.json":()=>Promise.resolve().then(()=>require("./en.es-CgL601qd.js")),"./i18n/es.json":()=>Promise.resolve().then(()=>require("./es.es-IdFGKY7Q.js")),"./i18n/et.json":()=>Promise.resolve().then(()=>require("./et.es-BygWmV3P.js")),"./i18n/fa.json":()=>Promise.resolve().then(()=>require("./fa.es-DW_0SmsT.js")),"./i18n/fi.json":()=>Promise.resolve().then(()=>require("./fi.es-pgfJlZ8i.js")),"./i18n/fr.json":()=>Promise.resolve().then(()=>require("./fr.es-OENguFuM.js")),"./i18n/he.json":()=>Promise.resolve().then(()=>require("./he.es-bixEnAeH.js")),"./i18n/hr.json":()=>Promise.resolve().then(()=>require("./hr.es-CkRAP94O.js")),"./i18n/hu.json":()=>Promise.resolve().then(()=>require("./hu.es-DG6HeiQJ.js")),"./i18n/id.json":()=>Promise.resolve().then(()=>require("./id.es-D4tPi6wP.js")),"./i18n/is.json":()=>Promise.resolve().then(()=>require("./is.es-CDFqLYCV.js")),"./i18n/it.json":()=>Promise.resolve().then(()=>require("./it.es-BHgrw_C6.js")),"./i18n/ja.json":()=>Promise.resolve().then(()=>require("./ja.es-D-lxWwyb.js")),"./i18n/ka.json":()=>Promise.resolve().then(()=>require("./ka.es-CnnB6q4A.js")),"./i18n/ko.json":()=>Promise.resolve().then(()=>require("./ko.es-b18aaB3V.js")),"./i18n/lt.json":()=>Promise.resolve().then(()=>require("./lt.es-BY9UQ6wZ.js")),"./i18n/mn.json":()=>Promise.resolve().then(()=>require("./mn.es-YFS7gSdf.js")),"./i18n/nl.json":()=>Promise.resolve().then(()=>require("./nl.es-BEx-4hnj.js")),"./i18n/no.json":()=>Promise.resolve().then(()=>require("./no.es-BQnRWlWR.js")),"./i18n/pl.json":()=>Promise.resolve().then(()=>require("./pl.es-CKCsZ_02.js")),"./i18n/pt-br.json":()=>Promise.resolve().then(()=>require("./pt-br.es-oH7qh6Fd.js")),"./i18n/pt-pt.json":()=>Promise.resolve().then(()=>require("./pt-pt.es-DLk5I0ej.js")),"./i18n/ro.json":()=>Promise.resolve().then(()=>require("./ro.es-DgTen1Dh.js")),"./i18n/ru.json":()=>Promise.resolve().then(()=>require("./ru.es-jGIQfREl.js")),"./i18n/sk.json":()=>Promise.resolve().then(()=>require("./sk.es-D2bhVb26.js")),"./i18n/sl.json":()=>Promise.resolve().then(()=>require("./sl.es-TV8Uraa1.js")),"./i18n/sq.json":()=>Promise.resolve().then(()=>require("./sq.es-Cc65zxbr.js")),"./i18n/sr.json":()=>Promise.resolve().then(()=>require("./sr.es-D5VNA_GW.js")),"./i18n/sv.json":()=>Promise.resolve().then(()=>require("./sv.es-dBeK_DZs.js")),"./i18n/tr.json":()=>Promise.resolve().then(()=>require("./tr.es-BUz4S13G.js")),"./i18n/uk.json":()=>Promise.resolve().then(()=>require("./uk.es-B8uaeLcK.js")),"./i18n/vi.json":()=>Promise.resolve().then(()=>require("./vi.es-2OFMtbQI.js")),"./i18n/zh-cn.json":()=>Promise.resolve().then(()=>require("./zh-cn.es-fDHCbCIg.js")),"./i18n/zh-hk.json":()=>Promise.resolve().then(()=>require("./zh-hk.es-COzeh5F8.js"))}),`./i18n/${t}.json`,3);this.texts=Object.assign({},ce,e),this.utils.date.updateTexts(this.texts)},loadDragAndDrop(){Promise.resolve().then(()=>require("./drag-and-drop.es-DWn92Mem.js")).then(t=>{const{DragAndDrop:e}=t;this.modules.dnd=new e(this)}).catch(()=>console.warn("Vue Cal: Missing drag & drop module."))},validateView(t){return be.includes(t)||(console.error(`Vue Cal: invalid active-view parameter provided: "${t}".
|
|
2
2
|
A valid view must be one of: ${be.join(", ")}.`),t="week"),this.enabledViews.includes(t)||(console.warn(`Vue Cal: the provided active-view "${t}" is disabled. Using the "${this.enabledViews[0]}" view instead.`),t=this.enabledViews[0]),t},switchToNarrowerView(t=null){this.transitionDirection="right";const e=this.enabledViews[this.enabledViews.indexOf(this.view.id)+1];e&&this.switchView(e,t)},switchView(t,e=null,l=!1){t=this.validateView(t);const a=this.utils.date,o=this.view.startDate&&this.view.startDate.getTime();if(this.transitions&&l){if(this.view.id===t)return;const r=this.enabledViews;this.transitionDirection=r.indexOf(this.view.id)>r.indexOf(t)?"left":"right"}const s=this.view.id;switch(this.view.events=[],this.view.id=t,this.view.firstCellDate=null,this.view.lastCellDate=null,e||(e=this.view.selectedDate||this.view.startDate),t){case"years":{this.view.startDate=new Date(Math.floor(e.getFullYear()/25)*25||2e3,0,1),this.view.endDate=new Date(this.view.startDate.getFullYear()+25,0,1),this.view.endDate.setSeconds(-1);break}case"year":{this.view.startDate=new Date(e.getFullYear(),0,1),this.view.endDate=new Date(e.getFullYear()+1,0,1),this.view.endDate.setSeconds(-1);break}case"month":{this.view.startDate=new Date(e.getFullYear(),e.getMonth(),1),this.view.endDate=new Date(e.getFullYear(),e.getMonth()+1,1),this.view.endDate.setSeconds(-1);let r=new Date(this.view.startDate);if(r.getDay()!==(this.startWeekOnSunday?0:1)&&(r=a.getPreviousFirstDayOfWeek(r,this.startWeekOnSunday)),this.view.firstCellDate=r,this.view.lastCellDate=a.addDays(r,41),this.view.lastCellDate.setHours(23,59,59,0),this.hideWeekends){if([0,6].includes(this.view.firstCellDate.getDay())){const m=this.view.firstCellDate.getDay()===6&&!this.startWeekOnSunday?2:1;this.view.firstCellDate=a.addDays(this.view.firstCellDate,m)}if([0,6].includes(this.view.startDate.getDay())){const m=this.view.startDate.getDay()===6?2:1;this.view.startDate=a.addDays(this.view.startDate,m)}if([0,6].includes(this.view.lastCellDate.getDay())){const m=this.view.lastCellDate.getDay()===0&&!this.startWeekOnSunday?2:1;this.view.lastCellDate=a.subtractDays(this.view.lastCellDate,m)}if([0,6].includes(this.view.endDate.getDay())){const m=this.view.endDate.getDay()===0?2:1;this.view.endDate=a.subtractDays(this.view.endDate,m)}}break}case"week":{e=a.getPreviousFirstDayOfWeek(e,this.startWeekOnSunday);const r=this.hideWeekends?5:7;this.view.startDate=this.hideWeekends&&this.startWeekOnSunday?a.addDays(e,1):e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=a.addDays(e,r),this.view.endDate.setSeconds(-1);break}case"day":{this.view.startDate=e,this.view.startDate.setHours(0,0,0,0),this.view.endDate=new Date(e),this.view.endDate.setHours(23,59,59,0);break}}this.addEventsToView();const u=this.view.startDate&&this.view.startDate.getTime();if(!(s===t&&u===o)&&(this.$emit("update:activeView",t),this.ready)){const r=this.view.startDate,m={view:t,startDate:r,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate,outOfScopeEvents:this.view.outOfScopeEvents.map(this.cleanupEvent)}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:a.getWeek(this.startWeekOnSunday?a.addDays(r,1):r)}:{}};this.$emit("view-change",m)}},previous(){this.previousNext(!1)},next(){this.previousNext()},previousNext(t=!0){const e=this.utils.date;this.transitionDirection=t?"right":"left";const l=t?1:-1;let a=null;const{startDate:o,id:s}=this.view;switch(s){case"years":a=new Date(o.getFullYear()+25*l,0,1);break;case"year":a=new Date(o.getFullYear()+1*l,1,1);break;case"month":a=new Date(o.getFullYear(),o.getMonth()+1*l,1);break;case"week":a=e[t?"addDays":"subtractDays"](e.getPreviousFirstDayOfWeek(o,this.startWeekOnSunday),7);break;case"day":a=e[t?"addDays":"subtractDays"](o,1);const u=a.getDay(),r=this.startWeekOnSunday?u:(u||7)-1;if(this.weekDays[r].hide){const c=this.weekDays.map((y,w)=>({...y,i:w}));let h=0;t?([...c.slice(r),...c].find(y=>(h++,!y.hide)).i,h--):[...c,...c.slice(0,r)].reverse().find(y=>(h++,!y.hide)).i,a=e[t?"addDays":"subtractDays"](a,h)}break}a&&this.switchView(s,a)},addEventsToView(t=[]){const e=this.utils.event,{startDate:l,endDate:a,firstCellDate:o,lastCellDate:s}=this.view;if(t.length||(this.view.events=[]),t=t.length?t:[...this.mutableEvents],!t||this.isYearsOrYearView&&!this.eventsCountOnYearView)return;let u=t.filter(r=>e.eventInRange(r,l,a));!this.isYearsOrYearView&&!(this.isMonthView&&!this.eventsOnMonthView)&&(u=u.map(r=>r.daysCount>1?e.createEventSegments(r,o||l,s||a):r)),this.view.events.push(...u),this.isMonthView&&(this.view.outOfScopeEvents=[],t.forEach(r=>{(e.eventInRange(r,o,l)||e.eventInRange(r,a,s))&&(this.view.events.some(m=>m._eid===r._eid)||this.view.outOfScopeEvents.push(r))}))},findAncestor(t,e){for(;(t=t.parentElement)&&!t.classList.contains(e););return t},isDOMElementAnEvent(t){return t.classList.contains("vuecal__event")||this.findAncestor(t,"vuecal__event")},onMouseMove(t){const{resizeAnEvent:e,dragAnEvent:l,dragCreateAnEvent:a}=this.domEvents;e._eid===null&&l._eid===null&&!a.start||(t.preventDefault(),e._eid?this.eventResizing(t):this.dragToCreateEvent&&a.start&&this.eventDragCreation(t))},onMouseUp(t){const{focusAnEvent:e,resizeAnEvent:l,clickHoldAnEvent:a,clickHoldACell:o,dragCreateAnEvent:s}=this.domEvents,{_eid:u}=a,{_eid:r}=l;let m=!1;const{event:c,start:h}=s,y=this.isDOMElementAnEvent(t.target),w=e.mousedUp;if(e.mousedUp=!1,y&&(this.domEvents.cancelClickEventCreation=!0),o.eventCreated)return;if(r){const{originalEnd:g,originalEndTimeMinutes:_,endTimeMinutes:E}=l,D=this.view.events.find(M=>M._eid===l._eid);if(m=E&&E!==_,D&&D.end.getTime()!==g.getTime()){const M=this.mutableEvents.find(F=>F._eid===l._eid);M.endTimeMinutes=D.endTimeMinutes,M.end=D.end;const C=this.cleanupEvent(D),O={...this.cleanupEvent(D),end:g,endTimeMinutes:D.originalEndTimeMinutes};this.$emit("event-duration-change",{event:C,oldDate:l.originalEnd,originalEvent:O}),this.$emit("event-change",{event:C,originalEvent:O})}D&&(D.resizing=!1),l._eid=null,l.start=null,l.split=null,l.segment=null,l.originalEndTimeMinutes=null,l.originalEnd=null,l.endTimeMinutes=null,l.startCell=null,l.endCell=null}else h&&(c&&(this.emitWithEvent("event-drag-create",c),s.event.resizing=!1),s.start=null,s.split=null,s.event=null);!y&&!r&&this.unfocusEvent(),a.timeoutId&&!u&&(clearTimeout(a.timeoutId),a.timeoutId=null),o.timeoutId&&(clearTimeout(o.timeoutId),o.timeoutId=null);const T=typeof this.onEventClick=="function";if(w&&!m&&!u&&!c&&T){let g=this.view.events.find(_=>_._eid===e._eid);return!g&&this.isMonthView&&(g=this.view.outOfScopeEvents.find(_=>_._eid===e._eid)),g&&this.onEventClick(g,t)}},onKeyUp(t){t.keyCode===27&&this.cancelDelete()},eventResizing(t){const{resizeAnEvent:e}=this.domEvents,l=this.view.events.find(c=>c._eid===e._eid)||{segments:{}},{minutes:a,cursorCoords:o}=this.minutesAtCursor(t),s=l.segments&&l.segments[e.segment],{date:u,event:r}=this.utils,m=Math.max(a,this.timeFrom+1,(s||l).startTimeMinutes+1);if(l.endTimeMinutes=e.endTimeMinutes=m,this.snapToTime){const c=l.endTimeMinutes+this.snapToTime/2;l.endTimeMinutes=c-c%this.snapToTime}if(s&&(s.endTimeMinutes=l.endTimeMinutes),l.end.setHours(0,l.endTimeMinutes,l.endTimeMinutes===de?-1:0,0),this.resizeX&&this.isWeekView){l.daysCount=u.countDays(l.start,l.end);const c=this.cellsEl,h=c.offsetWidth/c.childElementCount,y=Math.floor(o.x/h);if(e.startCell===null&&(e.startCell=y-(l.daysCount-1)),e.endCell!==y){e.endCell=y;const w=u.addDays(l.start,y-e.startCell),T=Math.max(u.countDays(l.start,w),1);if(T!==l.daysCount){let g=null;T>l.daysCount?g=r.addEventSegment(l):g=r.removeEventSegment(l),e.segment=g,l.endTimeMinutes+=.001}}}this.$emit("event-resizing",{_eid:l._eid,end:l.end,endTimeMinutes:l.endTimeMinutes})},eventDragCreation(t){const{dragCreateAnEvent:e}=this.domEvents,{start:l,startCursorY:a,split:o}=e,s=new Date(l),{minutes:u,cursorCoords:{y:r}}=this.minutesAtCursor(t);if(!(!e.event&&Math.abs(a-r)<this.dragToCreateThreshold))if(e.event){if(s.setHours(0,u,u===de?-1:0,0),this.snapToTime){let h=s.getHours()*60+s.getMinutes();const y=h+this.snapToTime/2;h=y-y%this.snapToTime,s.setHours(0,h,0,0)}const m=l<s,{event:c}=e;c.start=m?l:s,c.end=m?s:l,c.startTimeMinutes=c.start.getHours()*60+c.start.getMinutes(),c.endTimeMinutes=c.end.getHours()*60+c.end.getMinutes()}else{if(e.event=this.utils.event.createAnEvent(l,1,{split:o}),!e.event){e.start=null,e.split=null,e.event=null;return}e.event.resizing=!0}},unfocusEvent(){const{focusAnEvent:t,clickHoldAnEvent:e}=this.domEvents,l=this.view.events.find(a=>a._eid===(t._eid||e._eid));t._eid=null,e._eid=null,l&&(l.focused=!1,l.deleting=!1)},cancelDelete(){const{clickHoldAnEvent:t}=this.domEvents;if(t._eid){const e=this.view.events.find(l=>l._eid===t._eid);e&&(e.deleting=!1),t._eid=null,t.timeoutId=null}},onEventTitleBlur(t,e){if(e.title===t.target.innerHTML)return;const l=e.title;e.title=t.target.innerHTML;const a=this.cleanupEvent(e);this.$emit("event-title-change",{event:a,oldTitle:l}),this.$emit("event-change",{event:a,originalEvent:{...a,title:l}})},updateMutableEvents(){const t=this.utils.date;this.mutableEvents=[],this.events.forEach(e=>{const l=typeof e.start=="string"?t.stringToDate(e.start):e.start,a=t.formatDateLite(l),o=t.dateToMinutes(l);let s=null;typeof e.end=="string"&&e.end.includes("24:00")?(s=new Date(e.end.replace(" 24:00","")),s.setHours(23,59,59,0)):s=typeof e.end=="string"?t.stringToDate(e.end):e.end;let u=t.formatDateLite(s),r=t.dateToMinutes(s);(!r||r===de)&&(!this.time||typeof e.end=="string"&&e.end.length===10?s.setHours(23,59,59,0):s.setSeconds(s.getSeconds()-1),u=t.formatDateLite(s),r=de);const m=a!==u;e=Object.assign({...this.utils.event.eventDefaults},e,{_eid:`${this._.uid}_${this.eventIdIncrement++}`,segments:m?{}:null,start:l,startTimeMinutes:o,end:s,endTimeMinutes:r,daysCount:m?t.countDays(l,s):1,class:e.class}),this.mutableEvents.push(e)})},minutesAtCursor(t){return this.utils.cell.minutesAtCursor(t)},createEvent(t,e,l={}){return this.utils.event.createAnEvent(t,e,l)},cleanupEvent(t){return t={...t},["segments","deletable","deleting","titleEditable","resizable","resizing","draggable","dragging","draggingStatic","focused"].forEach(l=>{l in t&&delete t[l]}),t.repeat||delete t.repeat,t},emitWithEvent(t,e){this.$emit(t,this.cleanupEvent(e))},updateSelectedDate(t){if(t&&typeof t=="string"?t=this.utils.date.stringToDate(t):t=new Date(t),t&&t instanceof Date){const{selectedDate:e}=this.view;e&&(this.transitionDirection=e.getTime()>t.getTime()?"left":"right"),t.setHours(0,0,0,0),(!e||e.getTime()!==t.getTime())&&(this.view.selectedDate=t),this.switchView(this.view.id)}this.$emit("update:selected-date",this.view.selectedDate)},getWeekNumber(t){const e=this.utils.date,a=this.firstCellDateWeekNumber+t,o=this.startWeekOnSunday?1:0;return a>52?e.getWeek(e.addDays(this.view.firstCellDate,7*t+o)):a},timeTick(){this.now=new Date,this.timeTickerIds[1]=setTimeout(this.timeTick,60*1e3)},updateDateTexts(){this.utils.date.updateTexts(this.texts)},alignWithScrollbar(){if(document.getElementById("vuecal-align-with-scrollbar"))return;const t=this.$refs.vuecal.getElementsByClassName("vuecal__scrollbar-check")[0],e=t.offsetWidth-t.children[0].offsetWidth;if(e){const l=document.createElement("style");l.id="vuecal-align-with-scrollbar",l.type="text/css",l.innerHTML=`.vuecal--view-with-time .vuecal__weekdays-headings,.vuecal--view-with-time .vuecal__all-day {padding-right: ${e}px}`,document.head.appendChild(l)}},cellOrSplitHasEvents(t,e=null){return t.length&&(!e&&t.length||e&&t.some(l=>l.split===e.id))}},created(){this.utils.cell=new ze(this),this.utils.event=new Ie(this,this.utils.date),this.loadLocale(this.locale),this.editEvents.drag&&this.loadDragAndDrop(),this.updateMutableEvents(this.events),this.view.id=this.currentView,this.selectedDate?this.updateSelectedDate(this.selectedDate):(this.view.selectedDate=new Date,this.switchView(this.currentView)),this.time&&this.watchRealTime&&(this.timeTickerIds[0]=setTimeout(this.timeTick,(60-this.now.getSeconds())*1e3))},mounted(){const t=this.utils.date,e="ontouchstart"in window,{resize:l,drag:a,create:o,delete:s,title:u}=this.editEvents,r=this.onEventClick&&typeof this.onEventClick=="function";(l||a||o||s||u||r)&&window.addEventListener(e?"touchend":"mouseup",this.onMouseUp),(l||a||o&&this.dragToCreateEvent)&&window.addEventListener(e?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),u&&window.addEventListener("keyup",this.onKeyUp),e&&(this.$refs.vuecal.oncontextmenu=function(h){h.preventDefault(),h.stopPropagation()}),this.hideBody||this.alignWithScrollbar();const m=this.view.startDate,c={view:this.view.id,startDate:m,endDate:this.view.endDate,...this.isMonthView?{firstCellDate:this.view.firstCellDate,lastCellDate:this.view.lastCellDate}:{},events:this.view.events.map(this.cleanupEvent),...this.isWeekView?{week:t.getWeek(this.startWeekOnSunday?t.addDays(m,1):m)}:{}};this.$emit("ready",c),this.ready=!0},beforeUnmount(){const t="ontouchstart"in window;window.removeEventListener(t?"touchmove":"mousemove",this.onMouseMove,{passive:!1}),window.removeEventListener(t?"touchend":"mouseup",this.onMouseUp),window.removeEventListener("keyup",this.onKeyUp),this.timeTickerIds[0]&&clearTimeout(this.timeTickerIds[0]),this.timeTickerIds[1]&&clearTimeout(this.timeTickerIds[1]),this.timeTickerIds=[null,null]},computed:{editEvents(){return this.editableEvents&&typeof this.editableEvents=="object"?{title:!!this.editableEvents.title,drag:!!this.editableEvents.drag,resize:!!this.editableEvents.resize,create:!!this.editableEvents.create,delete:!!this.editableEvents.delete}:{title:!!this.editableEvents,drag:!!this.editableEvents,resize:!!this.editableEvents,create:!!this.editableEvents,delete:!!this.editableEvents}},views(){return{years:{label:this.texts.years,enabled:!this.disableViews.includes("years")},year:{label:this.texts.year,enabled:!this.disableViews.includes("year")},month:{label:this.texts.month,enabled:!this.disableViews.includes("month")},week:{label:this.texts.week,enabled:!this.disableViews.includes("week")},day:{label:this.texts.day,enabled:!this.disableViews.includes("day")}}},currentView(){return this.validateView(this.activeView)},enabledViews(){return Object.keys(this.views).filter(t=>this.views[t].enabled)},hasTimeColumn(){return this.time&&this.isWeekOrDayView},isShortMonthView(){return this.isMonthView&&this.eventsOnMonthView==="short"},firstCellDateWeekNumber(){const t=this.utils.date,e=this.view.firstCellDate;return t.getWeek(this.startWeekOnSunday?t.addDays(e,1):e)},timeCells(){const t=[];for(let e=this.timeFrom,l=this.timeTo;e<l;e+=this.timeStep)t.push({hours:Math.floor(e/60),minutes:e%60,label:this.utils.date.formatTime(e,this.TimeFormat),value:e});return t},TimeFormat(){return this.timeFormat||(this.twelveHour?"h:mm{am}":"HH:mm")},daySplits(){return(this.splitDays.filter(t=>!t.hide)||[]).map((t,e)=>({...t,id:t.id||e+1}))},hasSplits(){return this.daySplits.length&&this.isWeekOrDayView},hasShortEvents(){return this.showAllDayEvents==="short"},cellOrSplitMinWidth(){let t=null;return this.hasSplits&&this.minSplitWidth?t=this.visibleDaysCount*this.minSplitWidth*this.daySplits.length:this.minCellWidth&&this.isWeekView&&(t=this.visibleDaysCount*this.minCellWidth),t},allDayBar(){let t=this.allDayBarHeight||null;return t&&!isNaN(t)&&(t+="px"),{cells:this.viewCells,options:this.$props,label:this.texts.allDay,shortEvents:this.hasShortEvents,daySplits:this.hasSplits&&this.daySplits||[],cellOrSplitMinWidth:this.cellOrSplitMinWidth,height:t}},minTimestamp(){let t=null;return this.minDate&&typeof this.minDate=="string"?t=this.utils.date.stringToDate(this.minDate):this.minDate&&this.minDate instanceof Date&&(t=this.minDate),t?t.getTime():null},maxTimestamp(){let t=null;return this.maxDate&&typeof this.maxDate=="string"?t=this.utils.date.stringToDate(this.maxDate):this.maxDate&&this.maxDate instanceof Date&&(t=this.maxDate),t?t.getTime():null},weekDays(){let{weekDays:t,weekDaysShort:e=[]}=this.texts;return t=t.slice(0).map((l,a)=>({label:l,...e.length?{short:e[a]}:{},hide:this.hideWeekends&&a>=5||this.hideWeekdays.length&&this.hideWeekdays.includes(a+1)})),this.startWeekOnSunday&&t.unshift(t.pop()),t},weekDaysInHeader(){return this.isMonthView||this.isWeekView&&!this.minCellWidth&&!(this.hasSplits&&this.minSplitWidth)},months(){return this.texts.months.map(t=>({label:t}))},specialDayHours(){return!this.specialHours||!Object.keys(this.specialHours).length?{}:Array(7).fill("").map((t,e)=>{let l=this.specialHours[e+1]||[];return Array.isArray(l)||(l=[l]),t=[],l.forEach(({from:a,to:o,class:s,label:u},r)=>{t[r]={day:e+1,from:[null,void 0].includes(a)?null:a*1,to:[null,void 0].includes(o)?null:o*1,class:s||"",label:u||""}}),t})},viewTitle(){const t=this.utils.date;let e="";const l=this.view.startDate,a=l.getFullYear(),o=l.getMonth();switch(this.view.id){case"years":{e=this.texts.years;break}case"year":{e=a;break}case"month":{e=`${this.months[o].label} ${a}`;break}case"week":{const s=this.view.endDate,u=l.getFullYear();let r=this.texts.months[l.getMonth()];this.xsmall&&(r=r.substring(0,3));let m=`${r} ${u}`;if(s.getMonth()!==l.getMonth()){const c=s.getFullYear();let h=this.texts.months[s.getMonth()];this.xsmall&&(h=h.substring(0,3)),u===c?m=`${r} - ${h} ${u}`:this.small?m=`${r.substring(0,3)} ${u} - ${h.substring(0,3)} ${c}`:m=`${r} ${u} - ${h} ${c}`}e=`${this.texts.week} ${t.getWeek(this.startWeekOnSunday?t.addDays(l,1):l)} (${m})`;break}case"day":{e=this.utils.date.formatDate(l,this.texts.dateFormat,this.texts);break}}return e},viewCells(){const t=this.utils.date;let e=[],l=null,a=!1;this.watchRealTime||(this.now=new Date);const o=this.now;switch(this.view.id){case"years":{l=this.view.startDate.getFullYear(),e=Array.apply(null,Array(25)).map((s,u)=>{const r=new Date(l+u,0,1),m=new Date(l+u+1,0,1);return m.setSeconds(-1),{startDate:r,formattedDate:t.formatDateLite(r),endDate:m,content:l+u,current:l+u===o.getFullYear()}});break}case"year":{l=this.view.startDate.getFullYear(),e=Array.apply(null,Array(12)).map((s,u)=>{const r=new Date(l,u,1),m=new Date(l,u+1,1);return m.setSeconds(-1),{startDate:r,formattedDate:t.formatDateLite(r),endDate:m,content:this.xsmall?this.months[u].label.substr(0,3):this.months[u].label,current:u===o.getMonth()&&l===o.getFullYear()}});break}case"month":{const s=this.view.startDate.getMonth(),u=new Date(this.view.firstCellDate);a=!1,e=Array.apply(null,Array(42)).map((r,m)=>{const c=t.addDays(u,m),h=new Date(c);h.setHours(23,59,59,0);const y=!a&&t.isToday(c)&&!a++;return{startDate:c,formattedDate:t.formatDateLite(c),endDate:h,content:c.getDate(),today:y,outOfScope:c.getMonth()!==s,class:`vuecal__cell--day${c.getDay()||7}`}}),(this.hideWeekends||this.hideWeekdays.length)&&(e=e.filter(r=>{const m=r.startDate.getDay()||7;return!(this.hideWeekends&&m>=6||this.hideWeekdays.length&&this.hideWeekdays.includes(m))}));break}case"week":{a=!1;const s=this.view.startDate,u=this.weekDays;e=u.map((r,m)=>{const c=t.addDays(s,this.startWeekOnSunday&&this.hideWeekends?m-1:m),h=new Date(c);h.setHours(23,59,59,0);const y=(c.getDay()||7)-1;return{startDate:c,formattedDate:t.formatDateLite(c),endDate:h,today:!a&&t.isToday(c)&&!a++,specialHours:this.specialDayHours[y]||[]}}).filter((r,m)=>!u[m].hide);break}case"day":{const s=this.view.startDate,u=new Date(this.view.startDate);u.setHours(23,59,59,0);const r=(s.getDay()||7)-1;e=[{startDate:s,formattedDate:t.formatDateLite(s),endDate:u,today:t.isToday(s),specialHours:this.specialDayHours[r]||[]}];break}}return e},visibleDaysCount(){return this.isDayView?1:7-this.weekDays.reduce((t,e)=>t+e.hide,0)},cellWidth(){return 100/this.visibleDaysCount},cssClasses(){const{resizeAnEvent:t,dragAnEvent:e,dragCreateAnEvent:l}=this.domEvents;return{[`vuecal--${this.view.id}-view`]:!0,[`vuecal--${this.locale}`]:this.locale,"vuecal--no-time":!this.time,"vuecal--view-with-time":this.hasTimeColumn,"vuecal--week-numbers":this.showWeekNumbers&&this.isMonthView,"vuecal--twelve-hour":this.twelveHour,"vuecal--click-to-navigate":this.clickToNavigate,"vuecal--hide-weekends":this.hideWeekends,"vuecal--split-days":this.hasSplits,"vuecal--sticky-split-labels":this.hasSplits&&this.stickySplitLabels,"vuecal--overflow-x":this.minCellWidth&&this.isWeekView||this.hasSplits&&this.minSplitWidth,"vuecal--small":this.small,"vuecal--xsmall":this.xsmall,"vuecal--resizing-event":t._eid,"vuecal--drag-creating-event":l.event,"vuecal--dragging-event":e._eid,"vuecal--events-on-month-view":this.eventsOnMonthView,"vuecal--short-events":this.isMonthView&&this.eventsOnMonthView==="short","vuecal--has-touch":typeof window<"u"&&"ontouchstart"in window}},isYearsOrYearView(){return["years","year"].includes(this.view.id)},isYearsView(){return this.view.id==="years"},isYearView(){return this.view.id==="year"},isMonthView(){return this.view.id==="month"},isWeekOrDayView(){return["week","day"].includes(this.view.id)},isWeekView(){return this.view.id==="week"},isDayView(){return this.view.id==="day"}},watch:{events:{handler(t,e){this.updateMutableEvents(t),this.addEventsToView()},deep:!0},locale(t){this.loadLocale(t)},selectedDate(t){this.updateSelectedDate(t)},activeView(t){this.switchView(t)}}},Ee=U($t,[["render",Qt]]),ei={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},disable:{type:Boolean,default:!1},selectedDate:{type:[String,Date],default:()=>new Date},events:{type:Array,default:()=>[]},weekendColor:{type:String,required:!1},weekendDays:{type:Array,required:!1,validator:t=>Array.isArray(t)&&t.every(e=>Number.isInteger(e)&&e>=0&&e<=6)},showTodayColor:{type:Boolean,default:!0},selectedColor:{type:String,required:!1},specialTime:{type:Object,required:!1},dateCellMinHeight:{type:Number,required:!1},dateCellMaxHeight:{type:Number,required:!1},disableDays:{type:Array,required:!1,default:void 0},eventsOnMonthView:{type:[String,Boolean],default:!1},hideWeekdays:{type:Array,required:!1,validator:t=>Array.isArray(t)&&t.every(e=>Number.isInteger(e)&&e>=0&&e<=6)},hideWeekends:{type:Boolean,default:!1},locale:{type:String,default:"en"},maxDate:{type:[String,Date],required:!1},minDate:{type:[String,Date],required:!1},startWeekOnSunday:{type:Boolean,default:!1},time:{type:Boolean,default:!0},timeCellHeight:{type:Number,required:!1},timeFormat:{type:String,required:!1,validator:t=>t==null||v.H_CALENDAR_TIME_FORMAT_VALUES.includes(t)},timeFrom:{type:Number,required:!1,validator:t=>t==null||Number.isFinite(t)&&t>=0&&t<=1440},timeStep:{type:Number,required:!1,validator:t=>t==null||Number.isFinite(t)&&t>0&&t<=1440},timeTo:{type:Number,required:!1,validator:t=>t==null||Number.isFinite(t)&&t>=0&&t<=1440},hideTitleBar:{type:Boolean,default:!1},twelveHour:{type:Boolean,default:!1},activeView:{type:String,required:!1,validator:t=>t==null||v.H_CALENDAR_VIEW_VALUES.includes(t)},disableViews:{type:Array,required:!1,validator:t=>t==null||Array.isArray(t)&&t.every(e=>v.H_CALENDAR_VIEW_VALUES.includes(e))}},ti=i.defineComponent({name:"HCalendar",components:{VueCal:Ee},props:ei,emits:["responsive-change","cell-click","view-change","mounted"],setup(t,{emit:e,attrs:l}){const a=t.id||v.getUUID(),o=`hcalendar:${a}`,s=i.ref(null),u=i.ref(null),r=v.useDevice(),m=i.useSlots(),c=i.computed(()=>Object.keys(m)),h=i.ref(t.visible),y=i.ref(t.disable),w=i.computed(()=>h.value?"":"hison-display-none"),T=i.computed(()=>y.value?"hison-disable-calendar":""),g=i.ref(v.hison.utils.getJSDateObject(t.selectedDate)??new Date),_=g.value,E=i.ref(t.events??[]),D=i.ref(t.weekendColor?v.normalizeToRgba(t.weekendColor):void 0),M=i.ref(t.weekendDays),C=i.ref(t.selectedColor?v.normalizeToRgba(t.selectedColor):void 0),O=i.ref(t.showTodayColor),F=i.ref(t.specialTime??{}),I=i.ref(t.dateCellMinHeight),L=i.ref(t.dateCellMaxHeight),K=i.ref(t.disableDays),G=i.ref(t.eventsOnMonthView),X=i.ref(t.hideWeekdays),J=i.ref(t.hideWeekends),Z=i.ref(t.locale),H=i.ref(y.value?"100-01-01":t.maxDate),j=i.ref(t.minDate),q=i.ref(t.startWeekOnSunday),Q=i.ref(t.time),$=i.ref(t.timeCellHeight),ee=i.ref(t.timeFormat),te=i.ref(t.timeFrom),ie=i.ref(t.timeStep),se=i.ref(t.timeTo),le=i.ref(t.hideTitleBar),ae=i.ref(t.twelveHour),he=i.ref(t.activeView),ne=i.ref(t.disableViews),W=i.ref([]),x=()=>{var n;if(W.value=v.extractResponsiveClasses(v.toClassString(t.class)||"",r.value),v.getIndexSpecificClassNameFromClassList(W.value,"col")===-1&&W.value.push("hison-col-12"),v.addComponentNameToClass(W.value,"size",v.hisonCloser.componentStyle.size),v.addComponentNameToClass(W.value,"color","primary"),(n=s.value)!=null&&n.$el){const d=s.value.$el;let f=v.getSpecificClassValueFromClassList(W.value,"color");const b=v.getSpecificClassValueFromClassList(W.value,"size");switch((!f||!v.getRGBAFromColorText(f))&&(f="primary"),d.style.setProperty("--vuecal-filled-back-color",v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor),d.style.setProperty("--vuecal-filled-font-color",v.hisonCloser.componentStyle.componentColor[`${f}`].filledTextColor),v.hisonCloser.componentStyle.invertColor?(d.style.setProperty("--vuecal-empty-back-color",v.hisonCloser.componentStyle.emptyInvertColor),d.style.setProperty("--vuecal-empty-font-color",v.hisonCloser.componentStyle.emptyTextInvertColor),d.style.setProperty("--vuecal-empty-disabled-color",v.applyOpacityToRgba(v.hisonCloser.componentStyle.emptyTextInvertColor,.3)),d.style.setProperty("--vuecal-empty-out-of-scope-font-color",v.applyOpacityToRgba(v.hisonCloser.componentStyle.emptyTextInvertColor,.5)),d.style.setProperty("--vuecal-selected-back-color",C.value?v.getInvertColor(C.value):v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5)),d.style.setProperty("--vuecal-weekend-back-color",D.value?v.getInvertColor(D.value):null),d.style.setProperty("--vuecal-today-back-color",O.value?v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):v.hisonCloser.componentStyle.emptyInvertColor)):(d.style.setProperty("--vuecal-empty-back-color",v.hisonCloser.componentStyle.emptyColor),d.style.setProperty("--vuecal-empty-font-color",v.hisonCloser.componentStyle.emptyTextColor),d.style.setProperty("--vuecal-empty-disabled-color",v.applyOpacityToRgba(v.hisonCloser.componentStyle.emptyTextColor,.3)),d.style.setProperty("--vuecal-empty-out-of-scope-font-color",v.applyOpacityToRgba(v.hisonCloser.componentStyle.emptyTextColor,.5)),d.style.setProperty("--vuecal-selected-back-color",C.value?C.value:v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5)),d.style.setProperty("--vuecal-weekend-back-color",D.value?D.value:null),d.style.setProperty("--vuecal-today-back-color",O.value?v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):v.hisonCloser.componentStyle.emptyColor)),b){case v.Size.xl:d.style.setProperty("--vuecal-header-font-size","0.9em"),d.style.setProperty("--vuecal-title-button-font-size","1em"),d.style.setProperty("--vuecal-body-font-size","0.9em"),d.style.setProperty("--vuecal-no-event-font-size","0.8em");break;case v.Size.l:d.style.setProperty("--vuecal-header-font-size","0.75em"),d.style.setProperty("--vuecal-title-button-font-size","1em"),d.style.setProperty("--vuecal-body-font-size","0.9em"),d.style.setProperty("--vuecal-no-event-font-size","0.8em");break;case v.Size.m:d.style.setProperty("--vuecal-header-font-size","0.7em"),d.style.setProperty("--vuecal-title-button-font-size","0.6em"),d.style.setProperty("--vuecal-body-font-size","0.8em"),d.style.setProperty("--vuecal-no-event-font-size","0.7em");break;case v.Size.s:d.style.setProperty("--vuecal-header-font-size","0.6em"),d.style.setProperty("--vuecal-title-button-font-size","0.5em"),d.style.setProperty("--vuecal-body-font-size","0.8em"),d.style.setProperty("--vuecal-no-event-font-size","0.7em");break}d.style.setProperty("--calendar-clickable-cursor",y.value?"not-allowed":null)}},Me=n=>{const d=/pm/i.test(n),f=/am/i.test(n),b=n.replace(/[^\d:]/g,"").trim();let S=0,A=0;if(b.includes(":")){const[V,Y]=b.split(":");S=parseInt(V,10),A=parseInt(Y,10)}else{const V=parseInt(b,10);V<=12&&(f||d)||V<=23?S=V:A=V}return d&&S<12&&(S+=12),f&&S===12&&(S=0),S*60+A},P=n=>{if(!s.value)return;const d=s.value.$el,f=n??v.hison.utils.getJSDateObject(g.value);if(F.value&&f){const b=f.getDay(),S=F.value[b],A=d.querySelectorAll(".vuecal__time-cell");A.length>0&&S&&Array.isArray(S)?A.forEach(V=>{const Y=V.querySelector(".vuecal__time-cell-label");if(Y){const Oe=Y.textContent,De=Me(Oe);let ve="";S.some(({from:He,to:We,className:Ae})=>{const pe=He<=De&&De<=We;return pe&&(ve=Ae??""),pe})&&V.classList.add(ve||"special_time")}}):A.forEach(V=>{V.classList.forEach(Y=>{Y!=="vuecal__time-cell"&&V.classList.remove(Y)})})}},z=n=>{if(n===v.HCalendarView.month||n===v.HCalendarView.week){const d=s.value.$el,f=M.value?M.value:q.value?[0,6]:[5,6],b=d.querySelectorAll(".vuecal__heading");b.length>0&&b.forEach((S,A)=>{f.includes(A)?S.classList.add("weekend"):S.classList.remove("weekend")})}},re=n=>{const d=s.value.$el;d.style.setProperty("--vuecal-cell-content-min_heihgt",n==="month"&&I.value?I.value+"px":null),d.style.setProperty("--vuecal-cell-content-max_heihgt",n==="month"&&L.value?L.value+"px":null),d.style.setProperty("--vuecal-cell-content-overflow",n==="month"&&L.value?"auto":null)},fe=n=>{if(!s.value)return;const d=n??s.value.view.id;D.value&&i.nextTick(()=>z(d)),re(d)},Ve=n=>{fe(n.view),n.view===v.HCalendarView.day?P(n.startDate):n.view===v.HCalendarView.week&&P(),he.value=n.view,e("view-change",n)},Be=n=>{var f;const d=n instanceof Date?n:n.date;y.value?(g.value=_,(f=s.value)==null||f.updateSelectedDate(_)):(g.value=d,e("cell-click",d))},we=()=>{v.hisonCloser.component.calendarList[a]&&v.hisonCloser.component.calendarList[a].isHisonvueComponent&&console.warn(`[Hisonvue] The calendar ID is at risk of being duplicated. ${a}`),v.registerReloadable(o,()=>{ge(),i.nextTick(we)}),s.value&&(x(),P(),fe(),u.value={isHisonvueComponent:!0,getId:()=>a,getType:()=>"calendar",isDisable:()=>y.value,setDisable:n=>{y.value=n,y.value?H.value="100-01-01":H.value=t.maxDate},isVisible:()=>h.value,setVisible:n=>{h.value=n},getSelectedDate:(n,d)=>n?g.value:v.hison.utils.getDateWithFormat(g.value,d??v.hison.getDatetimeFormat()),setSelectedDate:n=>{const d=v.hison.utils.getJSDateObject(n);d&&(g.value=d)},getEvents:()=>E.value,setEvents:n=>{E.value=n},getSpecialTime:()=>F.value,setSpecialTime:n=>{F.value=n},getWeekendColor:()=>D.value,setWeekendColor:n=>{if(D.value=v.normalizeToRgba(n),!s.value)return;const d=s.value.$el;d&&(v.hisonCloser.componentStyle.invertColor?d.style.setProperty("--vuecal-weekend-back-color",D.value?v.getInvertColor(D.value):null):d.style.setProperty("--vuecal-weekend-back-color",D.value?D.value:null),z(s.value.view.id))},getWeekendDays:()=>M.value,setWeekendDays:n=>{M.value=n,z(s.value.view.id)},isShowTodayColor:()=>O.value,setShowTodayColor:n=>{if(O.value=n,!s.value)return;const d=s.value.$el;if(!d)return;let f=v.getSpecificClassValueFromClassList(W.value,"color");(!f||!v.getRGBAFromColorText(f))&&(f="primary"),v.hisonCloser.componentStyle.invertColor?d.style.setProperty("--vuecal-today-back-color",O.value?v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):v.hisonCloser.componentStyle.emptyInvertColor):d.style.setProperty("--vuecal-today-back-color",O.value?v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.3):v.hisonCloser.componentStyle.emptyColor)},getSelectedColor:()=>C.value,setSelectedColor:n=>{if(C.value=v.normalizeToRgba(n),!s.value)return;const d=s.value.$el;if(!d)return;let f=v.getSpecificClassValueFromClassList(W.value,"color");v.hisonCloser.componentStyle.invertColor?d.style.setProperty("--vuecal-selected-back-color",C.value?v.getInvertColor(C.value):v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5)):d.style.setProperty("--vuecal-selected-back-color",C.value?C.value:v.applyOpacityToRgba(v.hisonCloser.componentStyle.componentColor[`${f}`].buttonColor,.5))},getDateCellMinHeight:()=>I.value,setDateCellMinHeight:n=>{I.value=n,re(s.value.view.id)},getDateCellMaxHeight:()=>L.value,setDateCellMaxHeight:n=>{L.value=n,re(s.value.view.id)},getDisableDays:()=>K.value,setDisableDays:n=>{K.value=n},getEventsOnMonthView:()=>G.value,setEventsOnMonthView:n=>{G.value=n},getHideWeekdays:()=>X.value,setHideWeekdays:n=>{X.value=n},getHideWeekends:()=>J.value,setHideWeekends:n=>{J.value=n},getLocale:()=>Z.value,setLocale:n=>{Z.value=n},getMaxDate:n=>{if(H.value)return n?y.value?new Date(100,0,1):v.hison.utils.getJSDateObject(H.value):y.value?"100-01-01":v.hison.utils.getDateWithFormat(H.value,v.hison.getDateFormat())},setMaxDate:n=>{H.value=n},getMinDate:n=>{if(j.value)return n?v.hison.utils.getJSDateObject(j.value):v.hison.utils.getDateWithFormat(j.value,v.hison.getDateFormat())},setMinDate:n=>{j.value=n},isStartWeekOnSunday:()=>q.value,setStartWeekOnSunday:n=>{q.value=n,z(s.value.view.id)},isShowTimeCell:()=>Q.value,setShowTimeCell:n=>{Q.value=n},getTimeCellHeight:()=>$.value,setTimeCellHeight:n=>{$.value=n},getTimeFormat:()=>ee.value,setTimeFormat:n=>{ee.value=n},getTimeFrom:()=>te.value,setTimeFrom:n=>{te.value=n},getTimeStep:()=>ie.value,setTimeStep:n=>{ie.value=n},getTimeTo:()=>se.value,setTimeTo:n=>{se.value=n},isHideTitleBar:()=>le.value,setHideTitleBar:n=>{le.value=n},isTwelveHour:()=>ae.value,setTwelveHour:n=>{ae.value=n},getActiveView:()=>s.value.view.id,setActiveView:n=>{s.value.switchView(n)},getDisableViews:()=>ne.value,setDisableViews:n=>{if(ne.value=n,n.includes(s.value.view.id)){const d=["years","year","month","week","day"].filter(f=>!n.includes(f));s.value.switchView(d[0])}},reload:()=>v.reloadHisonComponent(o)},v.hisonCloser.component.calendarList[a]=u.value,e("mounted",u.value))},ge=()=>{v.unregisterReloadable(o),delete v.hisonCloser.component.calendarList[a]};return i.onMounted(we),i.onBeforeUnmount(ge),i.watch(r,n=>{x(),e("responsive-change",n)}),i.watch(()=>g.value,()=>{P()}),i.watch(()=>t.selectedDate,n=>{g.value=v.hison.utils.getJSDateObject(n)??new Date,P()}),i.watch(()=>t.events,n=>{E.value=n}),i.watch(()=>t.visible,n=>{n!==h.value&&(h.value=!!n)}),i.watch(()=>t.disable,n=>{const d=!!n;d!==y.value&&(y.value=d,H.value=d?"100-01-01":t.maxDate,x())}),i.watch(()=>g.value,()=>P()),i.watch(()=>t.selectedDate,n=>{const d=v.hison.utils.getJSDateObject(n)??new Date;+d!=+g.value&&(g.value=d,P())}),i.watch(()=>t.events,n=>{n!==E.value&&(E.value=n??[])}),i.watch(()=>t.weekendColor,n=>{var f,b;const d=n?v.normalizeToRgba(n):void 0;d!==D.value&&(D.value=d,x(),(b=(f=s.value)==null?void 0:f.view)!=null&&b.id&&z(s.value.view.id))}),i.watch(()=>t.weekendDays,n=>{var d,f;n&&n!==M.value&&(M.value=n,(f=(d=s.value)==null?void 0:d.view)!=null&&f.id&&z(s.value.view.id))}),i.watch(()=>t.selectedColor,n=>{const d=n?v.normalizeToRgba(n):void 0;d!==C.value&&(C.value=d,x())}),i.watch(()=>t.showTodayColor,n=>{const d=!!n;d!==O.value&&(O.value=d,x())}),i.watch(()=>t.specialTime,n=>{n!==F.value&&(F.value=n??{},P())}),i.watch(()=>t.dateCellMinHeight,n=>{var d,f;n!==I.value&&(I.value=n,re(((f=(d=s.value)==null?void 0:d.view)==null?void 0:f.id)||v.HCalendarView.month))}),i.watch(()=>t.dateCellMaxHeight,n=>{var d,f;n!==L.value&&(L.value=n,re(((f=(d=s.value)==null?void 0:d.view)==null?void 0:f.id)||v.HCalendarView.month))}),i.watch(()=>t.disableDays,n=>{n!==K.value&&(K.value=n)}),i.watch(()=>t.eventsOnMonthView,n=>{n!==G.value&&(G.value=n)}),i.watch(()=>t.hideWeekdays,n=>{n!==X.value&&(X.value=n)}),i.watch(()=>t.hideWeekends,n=>{const d=!!n;d!==J.value&&(J.value=d)}),i.watch(()=>t.locale,n=>{n&&n!==Z.value&&(Z.value=n)}),i.watch(()=>t.maxDate,n=>{!y.value&&n!==H.value&&(H.value=n)}),i.watch(()=>t.minDate,n=>{n!==j.value&&(j.value=n)}),i.watch(()=>t.startWeekOnSunday,n=>{var f,b;const d=!!n;d!==q.value&&(q.value=d,(b=(f=s.value)==null?void 0:f.view)!=null&&b.id&&z(s.value.view.id))}),i.watch(()=>t.time,n=>{const d=!!n;d!==Q.value&&(Q.value=d)}),i.watch(()=>t.timeCellHeight,n=>{n!==$.value&&($.value=n)}),i.watch(()=>t.timeFormat,n=>{n&&n!==ee.value&&(ee.value=n)}),i.watch(()=>t.timeFrom,n=>{const d=Number(n);(n==null||Number.isFinite(d)&&d>=0&&d<=1440)&&n!==te.value&&(te.value=n)}),i.watch(()=>t.timeStep,n=>{const d=Number(n);(n==null||Number.isFinite(d)&&d>0&&d<=1440)&&n!==ie.value&&(ie.value=n)}),i.watch(()=>t.timeTo,n=>{const d=Number(n);(n==null||Number.isFinite(d)&&d>=0&&d<=1440)&&n!==se.value&&(se.value=n)}),i.watch(()=>t.hideTitleBar,n=>{const d=!!n;d!==le.value&&(le.value=d)}),i.watch(()=>t.twelveHour,n=>{const d=!!n;d!==ae.value&&(ae.value=d)}),i.watch(()=>t.activeView,n=>{var d,f,b;n&&n!==((f=(d=s.value)==null?void 0:d.view)==null?void 0:f.id)&&(he.value=n,(b=s.value)==null||b.switchView(n))}),i.watch(()=>t.disableViews,n=>{if(n!==ne.value&&(ne.value=n,s.value&&Array.isArray(n)&&n.includes(s.value.view.id))){const d=["years","year","month","week","day"].find(f=>!n.includes(f));d&&s.value.switchView(d)}}),i.watch(()=>t.class,()=>x()),{VueCal:Ee,attrs:l,props:t,calendarRef:s,visibleClass:w,disableClass:T,responsiveClassList:W,slotNames:c,selectedDate:g,events:E,disableDays:K,eventsOnMonthView:G,hideWeekdays:X,hideWeekends:J,locale:Z,maxDate:H,minDate:j,startWeekOnSunday:q,time:Q,timeCellHeight:$,timeFormat:ee,timeFrom:te,timeStep:ie,timeTo:se,hideTitleBar:le,twelveHour:ae,activeView:he,disableViews:ne,onViewChange:Ve,onCellClick:Be}}});function ii(t,e,l,a,o,s){return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["hison-calendar","hison-wrapper",...t.responsiveClassList,t.visibleClass,t.disableClass]),style:i.normalizeStyle(t.props.style)},[(i.openBlock(),i.createBlock(i.resolveDynamicComponent(t.VueCal),i.mergeProps({ref:"calendarRef"},t.attrs,{"selected-date":t.selectedDate,events:t.events,"dblclick-to-create":!1,"editable-events":!1,"disable-days":t.disableDays,"events-on-month-view":t.eventsOnMonthView,"hide-weekdays":t.hideWeekdays,"hide-weekends":t.hideWeekends,locale:t.locale,"max-date":t.maxDate,"min-date":t.minDate,"start-week-on-sunday":t.startWeekOnSunday,time:t.time,"time-cell-height":t.timeCellHeight,"time-format":t.timeFormat,"time-from":t.timeFrom,"time-step":t.timeStep,"time-to":t.timeTo,"hide-title-bar":t.hideTitleBar,"twelve-hour":t.twelveHour,"active-view":t.activeView,"disable-views":t.disableViews,onViewChange:t.onViewChange,onCellClick:t.onCellClick}),i.createSlots({_:2},[i.renderList(t.slotNames,u=>({name:u,fn:i.withCtx(r=>[i.renderSlot(t.$slots,u,i.normalizeProps(i.guardReactiveProps(r)),void 0,!0)])}))]),1040,["selected-date","events","disable-days","events-on-month-view","hide-weekdays","hide-weekends","locale","max-date","min-date","start-week-on-sunday","time","time-cell-height","time-format","time-from","time-step","time-to","hide-title-bar","twelve-hour","active-view","disable-views","onViewChange","onCellClick"]))],6)}const si=Ne._export_sfc(ti,[["render",ii],["__scopeId","data-v-ed3de0ad"]]);exports.default=si;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveComponent as ae, createElementBlock as m, openBlock as v, normalizeClass as V, createVNode as We, createCommentVNode as D, createSlots as Le, withCtx as T, renderSlot as k, createTextVNode as x, toDisplayString as E, createElementVNode as H, Transition as Ye, createBlock as G, normalizeProps as ze, mergeProps as Re, normalizeStyle as z, Fragment as L, renderList as N, resolveDynamicComponent as at, TransitionGroup as ft, withKeys as nt, withModifiers as oe, defineComponent as wt, ref as b, useSlots as Dt, computed as Ie, onMounted as gt, onBeforeUnmount as pt, watch as p, nextTick as Je, guardReactiveProps as bt } from "vue";
|
|
2
|
-
import { H as Ze, k as kt, g as Ct, u as _t, l as P, n as ue, m as de, e as Tt, t as Mt, a as St, b as Qe, h as C, o as Ve, p as $e, q as R, s as Ae, v as je, r as Et, c as Ht, d as Ot } from "./index-
|
|
2
|
+
import { H as Ze, k as kt, g as Ct, u as _t, l as P, n as ue, m as de, e as Tt, t as Mt, a as St, b as Qe, h as C, o as Ve, p as $e, q as R, s as Ae, v as je, r as Et, c as Ht, d as Ot } from "./index-0mmn7cpg.mjs";
|
|
3
3
|
import { _ as Wt } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
var Vt = Object.defineProperty, At = (t, e, s) => e in t ? Vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s, Z = (t, e, s) => At(t, typeof e != "symbol" ? e + "" : e, s);
|
|
5
5
|
const jt = (t, e, s) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as J, ref as l, useSlots as Q, computed as o, Text as W, onMounted as R, onBeforeUnmount as Z, watch as a, unref as _, nextTick as ee, createElementBlock as x, openBlock as $, normalizeClass as D, createBlock as te, resolveDynamicComponent as ne, normalizeStyle as le, withCtx as oe, renderSlot as ae, Fragment as se, createTextVNode as ie, toDisplayString as ue } from "vue";
|
|
2
|
-
import { B as re, f as M, T as de, g as ce, u as ve, w as A, e as fe, t as me, b as H, h as C, r as ge, c as ye, d as he } from "./index-
|
|
2
|
+
import { B as re, f as M, T as de, g as ce, u as ve, w as A, e as fe, t as me, b as H, h as C, r as ge, c as ye, d as he } from "./index-0mmn7cpg.mjs";
|
|
3
3
|
import { _ as pe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const Te = {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DON-Hfjr.js"),V=require("./_plugin-vue_export-helper-BHFhmbuH.js"),z={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!0},title:{type:String,required:!1},text:{type:String,required:!1},level:{type:Number,default:3,validator:t=>Number.isFinite(t)&&t>=1&&t<=6},fontBold:{type:Boolean,default:!0},fontItalic:{type:Boolean,default:!1},fontThruline:{type:Boolean,default:!1},fontUnderline:{type:Boolean,default:!1},textAlign:{type:String,default:null,validator:t=>t==null||o.TEXT_ALIGN_VALUES.includes(t)},border:{type:Boolean,default:!1},backgroundType:{type:String,default:o.BackgroundType.empty,validator:t=>o.BACKGROUND_TYPE_VALUES.includes(t)}},O=e.defineComponent({name:"HCaption",props:z,inheritAttrs:!1,emits:["mounted","responsive-change","click","mousedown","mouseup","mouseover","mouseout"],setup(t,{emit:a}){const A=e.ref(null),u=e.ref(null),i=t.id?t.id:o.getUUID(),C=`hcaption:${i}`,s=o.useDevice(),k=e.useSlots(),c=e.ref(t.visible),d=e.ref(t.title||""),f=e.ref(t.textAlign??o.TextAlign.left),L=e.computed(()=>({textAlign:f.value})),v=e.ref(t.level??3),$=e.computed(()=>`h${Math.min(6,Math.max(1,Number(v.value||3)))}`),m=e.ref(t.fontBold),p=e.ref(t.fontItalic),g=e.ref(t.fontThruline),h=e.ref(t.fontUnderline),y=e.ref(t.border??!1),T=e.ref(t.backgroundType??o.BackgroundType.empty),N=e.computed(()=>c.value?"":"hison-display-none"),x=e.computed(()=>y.value?"hison-border":""),F=e.computed(()=>{switch(T.value){case o.BackgroundType.empty:return"hison-bg-empty";case o.BackgroundType.transparent:return"hison-bg-transparent";default:return"hison-bg-filled"}}),q=e.computed(()=>m.value?"hison-font-bold-important":null),E=e.computed(()=>p.value?"hison-font-italic":null),H=e.computed(()=>g.value?"hison-font-thruline":null),R=e.computed(()=>h.value?"hison-font-underline":null),S=e.computed(()=>k.default?k.default():[]),M=e.computed(()=>S.value.length>0&&S.value.every(n=>n.type===e.Text)),b=e.computed(()=>!!k.default&&!M.value),r=e.ref(t.text||"");e.onMounted(()=>{if(M.value){const n=S.value.map(l=>String(l.children??"")).join("");r.value=n}});const B=e.ref([]),w=()=>{B.value=o.extractResponsiveClasses(o.toClassString(t.class)||"",s.value),o.addComponentNameToClass(B.value,"size",o.hisonCloser.componentStyle.size),o.addComponentNameToClass(B.value,"color","primary")},D=n=>{a("click",n,u.value)},U=()=>{o.hisonCloser.component.captionList[i]&&o.hisonCloser.component.captionList[i].isHisonvueComponent&&console.warn(`[Hisonvue] The caption ID is at risk of being duplicated. ${i}`),o.registerReloadable(C,()=>{I(),e.nextTick(U)}),w(),u.value={isHisonvueComponent:!0,getId:()=>i,getType:()=>"caption",isVisible:()=>c.value,setVisible:n=>{c.value=n},getTitle:()=>d.value,setTitle:n=>{d.value=n},getText:()=>b.value?"":r.value,setText:n=>{b.value||(r.value=n)},getLevel:()=>v.value,setLevel:n=>{const l=Math.min(6,Math.max(1,Number(n)));v.value=l},getTextAlign:()=>f.value,setTextAlign:n=>{(n===o.TextAlign.left||n===o.TextAlign.center||n===o.TextAlign.right)&&(f.value=n)},isFontBold:()=>m.value,setFontBold:n=>{m.value=n},isFontItalic:()=>p.value,setFontItalic:n=>{p.value=n},isFontThruline:()=>g.value,setFontThruline:n=>{g.value=n},isFontUnderline:()=>h.value,setFontUnderline:n=>{h.value=n},isBorder:()=>y.value,setBorder:n=>{y.value=n},getBackgroundType:()=>T.value,setBackgroundType:n=>{T.value=n},reload:()=>o.reloadHisonComponent(C)},o.hisonCloser.component.captionList[i]=u.value,a("mounted",u.value)},I=()=>{o.unregisterReloadable(C),delete o.hisonCloser.component.captionList[i]};return e.onMounted(U),e.onBeforeUnmount(I),e.watch(s,()=>{w(),a("responsive-change",s.value)}),e.watch(()=>t.visible,n=>{n!==c.value&&(c.value=!!n)}),e.watch(()=>t.title,n=>{const l=n??"";l!==d.value&&(d.value=l)}),e.watch(()=>t.text,n=>{if(!b.value){const l=n??"";l!==r.value&&(r.value=l)}}),e.watch(()=>t.level,n=>{const l=Math.min(6,Math.max(1,Number(n??3)));l!==v.value&&(v.value=l)}),e.watch(()=>t.textAlign,n=>{(n==="left"||n==="center"||n==="right")&&n!==f.value&&(f.value=n)}),e.watch(()=>t.fontBold,n=>{const l=!!n;l!==m.value&&(m.value=l)}),e.watch(()=>t.fontItalic,n=>{const l=!!n;l!==p.value&&(p.value=l)}),e.watch(()=>t.fontThruline,n=>{const l=!!n;l!==g.value&&(g.value=l)}),e.watch(()=>t.fontUnderline,n=>{const l=!!n;l!==h.value&&(h.value=l)}),e.watch(()=>t.border,n=>{const l=!!n;l!==y.value&&(y.value=l)}),e.watch(()=>t.backgroundType,n=>{n&&n!==T.value&&(T.value=n)}),e.watch(()=>t.class,()=>w()),{captionRef:A,captionMethods:e.computed(()=>e.unref(u)),props:t,visibleClass:N,fontBoldClass:q,fontItalicClass:E,fontThrulineClass:H,fontUnderlineClass:R,borderClass:x,backgroundTypeClass:F,textAlignStyle:L,renderTag:$,hasElementSlot:b,internalText:r,responsiveClassList:B,onClick:D,title:d}}});function j(t,a,A,u,i,C){return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["hison-wrapper",...t.responsiveClassList,t.visibleClass])},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.renderTag),{ref:"captionRef",class:e.normalizeClass(["hison-caption",t.fontBoldClass,t.fontItalicClass,t.fontThrulineClass,t.fontUnderlineClass,t.borderClass,t.backgroundTypeClass]),style:e.normalizeStyle([t.textAlignStyle,t.props.style]),title:t.title||void 0,onClick:t.onClick,onMousedown:a[0]||(a[0]=s=>t.$emit("mousedown",s,t.captionMethods)),onMouseup:a[1]||(a[1]=s=>t.$emit("mouseup",s,t.captionMethods)),onMouseover:a[2]||(a[2]=s=>t.$emit("mouseover",s,t.captionMethods)),onMouseout:a[3]||(a[3]=s=>t.$emit("mouseout",s,t.captionMethods))},{default:e.withCtx(()=>[t.hasElementSlot?e.renderSlot(t.$slots,"default",{key:0}):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createTextVNode(e.toDisplayString(t.internalText),1)],64))]),_:3},40,["class","style","title","onClick"]))],2)}const P=V._export_sfc(O,[["render",j]]);exports.default=P;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as B, ref as d, computed as P, onMounted as U, nextTick as L, onBeforeUnmount as _, watch as i, toRaw as g, markRaw as x, createElementBlock as I, openBlock as k, normalizeStyle as V, normalizeClass as E, createCommentVNode as G, mergeProps as M } from "vue";
|
|
2
|
-
import { g as J, u as K, r as Q, d as W, c as F, e as X, t as Y, a as Z, b as H, h as v, p as N, C as ee } from "./index-
|
|
2
|
+
import { g as J, u as K, r as Q, d as W, c as F, e as X, t as Y, a as Z, b as H, h as v, p as N, C as ee } from "./index-0mmn7cpg.mjs";
|
|
3
3
|
import { _ as te } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
4
4
|
const ae = {
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),s=require("./index-DON-Hfjr.js"),D=require("./_plugin-vue_export-helper-BHFhmbuH.js"),B={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},type:{type:String,required:!0},modelValue:{type:Object,required:!0},options:{type:Object,required:!1},visible:{type:Boolean,default:!0},loadDelay:{type:Number,default:500}},F=t.defineComponent({name:"HChart",props:B,emits:["update:modelValue","mounted","responsive-change"],setup(n,{emit:g,attrs:A}){const r=n.id||s.getUUID(),v=`hchart:${r}`,h=t.ref(null),o=t.ref(null),m=t.ref(n.visible),S=t.computed(()=>m.value?"":"hison-display-none"),b=s.useDevice(),c=t.ref([]),u=t.ref(!1),f=t.ref(n.loadDelay??500);let i=null,y=!0,l=!1;const w=()=>{c.value=s.extractResponsiveClasses(s.toClassString(n.class)||"",b.value),s.getIndexSpecificClassNameFromClassList(c.value,"col")===-1&&c.value.push("hison-col-12"),s.addComponentNameToClass(c.value,"size",s.hisonCloser.componentStyle.size),s.addComponentNameToClass(c.value,"color","primary")},d=e=>{if(Array.isArray(e))return e.map(a=>typeof a=="string"?s.getRGBAFromColorText(a)||a:typeof a=="object"&&a!==null?d(a):a);if(typeof e=="object"&&e!==null){const a={};for(const[p,C]of Object.entries(e))if(typeof C=="string"&&/color/i.test(p)){const L=s.getRGBAFromColorText(C);a[p]=L||C}else a[p]=d(C);return a}return e};function R(e){return!e||typeof e!="object"||!Array.isArray(e.datasets)?{datasets:[]}:{...e,datasets:e.datasets.filter(a=>!!a)}}function T(e){return!e||typeof e!="object"?{}:e}function q(){if(!y||l)return;if(!h.value){console.warn("[mountChart] canvasRef.value is null");return}w(),o.value=t.markRaw(new s.Chart(h.value,{type:n.type,data:R(d(t.toRaw(n.modelValue))),options:T(d(t.toRaw(n.options)))}));const e=o.value;e.isHisonvueComponent=!0,e.getId=()=>r,e.getType=()=>"chart",e.isVisible=()=>m.value,e.setVisible=a=>{m.value=a},e.getLoadDelay=()=>f.value,e.setLoadDelay=a=>{f.value=a},e.reload=()=>s.reloadHisonComponent(v),s.hisonCloser.component.chartList[r]&&s.hisonCloser.component.chartList[r].isHisonvueComponent&&console.warn(`[Hisonvue] The chart ID is at risk of being duplicated. ${r}`),s.hisonCloser.component.chartList[r]=e,g("mounted",s.hisonCloser.component.chartList[r])}const j=async()=>{var a;l=!0,i!==null&&(clearTimeout(i),i=null);const e=o.value;if(e)try{try{(a=e.stop)==null||a.call(e)}catch{}e.destroy()}catch{}finally{o.value=null}delete s.hisonCloser.component.chartList[r],u.value=!0,await t.nextTick()},k=async()=>{u.value&&(!y||l||(u.value=!1,await t.nextTick(),i=window.setTimeout(()=>{!y||l||requestAnimationFrame(()=>{requestAnimationFrame(()=>{q()})})},f.value)))};return s.registerReloadable(v,async()=>{await j(),await k()}),t.onMounted(async()=>{u.value=!1,await t.nextTick(),i=window.setTimeout(()=>{!y||l||requestAnimationFrame(()=>{requestAnimationFrame(()=>{q()})})},f.value)}),t.onBeforeUnmount(async()=>{y=!1,i!==null&&(clearTimeout(i),i=null),await j(),s.unregisterReloadable(v)}),t.watch(b,()=>{var e;l||(w(),(e=o.value)==null||e.resize(),g("responsive-change",b.value))}),t.watch(()=>n.modelValue,e=>{u.value||l||!o.value||!e||typeof e!="object"||!Array.isArray(e.datasets)||(o.value.data=R(d(t.toRaw(e))),o.value.update("none"))},{deep:!0}),t.watch(()=>n.options,e=>{u.value||l||!o.value||!e||typeof e!="object"||(o.value.options=T(d(t.toRaw(e))),o.value.update("none"))},{deep:!0}),t.watch(()=>n.visible,e=>{e!==m.value&&(m.value=!!e)}),t.watch(()=>n.loadDelay,e=>{const a=Number(e);Number.isFinite(a)&&a>=0&&a!==f.value&&(f.value=a)}),t.watch(()=>n.class,()=>w()),t.watch(()=>n.type,()=>{l||s.reloadHisonComponent(v)}),{canvasRef:h,props:n,attrs:A,visibleClass:S,responsiveClassList:c,isPending:u}}});function H(n,g,A,r,v,h){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-chart","hison-wrapper",...n.responsiveClassList,n.visibleClass]),style:t.normalizeStyle(n.props.style)},[n.isPending?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("canvas",t.mergeProps({key:0,ref:"canvasRef"},n.attrs),null,16))],6)}const I=D._export_sfc(F,[["render",H]]);exports.default=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),a=require("./index-CKU70ocu.js"),J=require("./scrollManager-CEEWQwoK.js"),be=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ge=["top","bottom","left","right"],pe={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!1},border:{type:Boolean,default:!0},zIndex:{type:Number,default:1100},position:{type:String,default:"bottom",validator:l=>ge.includes(l)},width:{type:Number,default:null},height:{type:Number,default:null},closeButtonVisible:{type:Boolean,default:!0},closeButtonText:{type:String,default:"X"},closeButtonTitle:{type:String,default:"close"},swipeClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeClickOverlay:{type:Boolean,default:!0},overlayStyle:{type:[String,Object,Array],required:!1},scrollLock:{type:Boolean,default:!0},enterAnimationClass:{type:String,required:!1},leaveAnimationClass:{type:String,required:!1}},Se=t.defineComponent({name:"HDrawer",props:pe,inheritAttrs:!1,emits:["mounted","responsive-change","open","close"],setup(l,{emit:f,slots:K}){const u=l.id||a.getUUID(),L=`hdrawer:${u}`,N=a.useDevice(),P=t.ref(null),h=t.ref(null),r=t.ref(l.visible),b=t.ref(l.zIndex??1050),w=t.ref(l.border),S=t.ref(l.showOverlay),k=t.ref(l.closeClickOverlay),g=t.ref(l.scrollLock),s=t.ref(l.position),c=t.ref(l.width??null),v=t.ref(l.height??null),B=t.ref(l.closeButtonVisible),Q=t.computed(()=>w.value),x=t.computed(()=>w.value?"filled":"empty"),H=t.ref(l.closeButtonText||"X"),R=t.ref(l.closeButtonTitle||"Close"),T=t.ref(l.swipeClose),O={top:"hison-drawer-enter-top",bottom:"hison-drawer-enter-bottom",left:"hison-drawer-enter-left",right:"hison-drawer-enter-right"},A={top:"hison-drawer-leave-top",bottom:"hison-drawer-leave-bottom",left:"hison-drawer-leave-left",right:"hison-drawer-leave-right"},m=t.ref(l.enterAnimationClass||O[s.value]),y=t.ref(l.leaveAnimationClass||A[s.value]),_=t.computed(()=>"hison-bg-empty"),ee=t.computed(()=>w.value?"hison-border":""),te=t.computed(()=>r.value?"":"hison-display-none"),$=t.ref([]),D=()=>{var e;$.value=a.extractResponsiveClasses(a.toClassString(l.class)||"",N.value),a.addComponentNameToClass($.value,"size",((e=a.hisonCloser.componentStyle)==null?void 0:e.size)||"m"),a.addComponentNameToClass($.value,"color","primary")},le=t.computed(()=>[...a.extractPrefixedClasses(a.toClassString(l.class)||"","color")]),oe=t.computed(()=>r.value&&S.value),se=t.computed(()=>{const o={zIndex:(b.value??1050)-1},n=l.overlayStyle;return n?Array.isArray(n)?[{...o},...n]:typeof n=="string"?[o,n]:{...o,...n}:o}),ne=()=>{k.value&&d()},ae=t.computed(()=>{const e={zIndex:b.value,position:"fixed",inset:"auto"};switch(e.left="",e.right="",e.top="",e.bottom="",s.value){case"top":e.left="0",e.right="0",e.top="0";break;case"bottom":e.left="0",e.right="0",e.bottom="0";break;case"left":e.left="0",e.top="0",e.bottom="0";break;case"right":e.right="0",e.top="0",e.bottom="0";break}return e}),ie=t.computed(()=>{const e={};return s.value==="top"||s.value==="bottom"?(e.width="100vw",v.value!=null&&(e.height=`${v.value}px`),c.value!=null&&(e.width=`${c.value}px`)):(e.height="100vh",c.value!=null&&(e.width=`${c.value}px`),v.value!=null&&(e.height=`${v.value}px`)),e}),z=()=>{g.value&&J.acquireScrollLock(u)},V=()=>{g.value&&J.releaseScrollLock(u)},M=async()=>{const e=h.value;!e||!m.value||(e.classList.remove(y.value),e.offsetWidth,e.classList.add(m.value))},re=async()=>{const e=h.value;!e||!y.value||(e.classList.remove(m.value),e.offsetWidth,e.classList.add(y.value),await new Promise(o=>setTimeout(o,200)))},E=async()=>{r.value||(r.value=!0,z(),await t.nextTick(),M(),f("open",t.unref(p)))},d=async()=>{if(r.value)try{await re()}finally{r.value=!1,V(),f("close",t.unref(p))}},ue=async()=>r.value?d():E(),ce=()=>d();let q=!1,U=0,X=0;const I=40,ve=e=>{T.value&&(q=!0,U=e.clientX,X=e.clientY,window.addEventListener("pointerup",de,{once:!0,capture:!0}))},de=e=>{if(!q)return;q=!1;const o=e.clientX-U,n=e.clientY-X,i=Math.abs(o),C=Math.abs(n);(s.value==="top"&&C>i&&n>I||s.value==="bottom"&&C>i&&n<-I||s.value==="left"&&i>C&&o<-I||s.value==="right"&&i>C&&o>I)&&d()},fe=200,he="ease";function Z(e,o,n,i,C=fe,we=he){return new Promise(Ce=>{e.style.transition="none",e.style[o]=`${n}px`,e.offsetWidth,e.style.transition=`${o} ${C}ms ${we}`,e.style[o]=`${i}px`;const W=()=>{e.removeEventListener("transitionend",W),e.style.transition="",Ce()};e.addEventListener("transitionend",W),setTimeout(W,C+50)})}const me=t.computed(()=>s.value==="left"||s.value==="right"),ye=t.computed(()=>s.value==="top"||s.value==="bottom");async function j(e,o=!0){const n=h.value;if(!n){c.value=e;return}const i=n.getBoundingClientRect().width;if((e??i)===i){c.value=e;return}if(!o||e==null||!me.value){c.value=e;return}c.value=e,await t.nextTick(),await Z(n,"width",i,e)}async function Y(e,o=!0){const n=h.value;if(!n){v.value=e;return}const i=n.getBoundingClientRect().height;if((e??i)===i){v.value=e;return}if(!o||e==null||!ye.value){v.value=e;return}v.value=e,await t.nextTick(),await Z(n,"height",i,e)}const p=t.ref(null),F=()=>{a.hisonCloser.component.drawerList[u]&&a.hisonCloser.component.drawerList[u].isHisonvueComponent&&console.warn(`[Hisonvue] The drawer ID is at risk of being duplicated. ${u}`),a.registerReloadable(L,()=>{G(),t.nextTick(F)}),D(),r.value&&(z(),t.nextTick(M)),p.value={isHisonvueComponent:!0,getId:()=>u,getType:()=>"drawer",isVisible:()=>r.value,open:E,close:d,toggle:ue,setVisible:e=>e?E():d(),getZIndex:()=>b.value,setZIndex:e=>{b.value=e},getPosition:()=>s.value,setPosition:e=>{s.value=e,l.enterAnimationClass||(m.value=O[s.value]),l.leaveAnimationClass||(y.value=A[s.value])},getWidth:()=>c.value,setWidth:(e,o=!0)=>j(e,o),getHeight:()=>v.value,setHeight:(e,o=!0)=>Y(e,o),isSwipeCloseEnabled:()=>T.value,setSwipeCloseEnabled:e=>{T.value=e},isCloseButtonVisible:()=>B.value,setCloseButtonVisible:e=>{B.value=e},isOverlayShown:()=>S.value,setOverlayShown:e=>{S.value=e},isCloseClickOverlay:()=>k.value,setCloseClickOverlay:e=>{k.value=e},isScrollLocked:()=>g.value,setScrollLock:e=>{g.value=e,r.value&&(e?z():V())},isBorder:()=>w.value,setBorder:e=>{w.value=e},getAnimationClasses:()=>({enter:m.value,leave:y.value}),setAnimationClasses:e=>{"enter"in e&&(m.value=e.enter||""),"leave"in e&&(y.value=e.leave||"")},reload:()=>a.reloadHisonComponent(L)},a.hisonCloser.component.drawerList[u]=p.value,f("mounted",p.value)},G=()=>{a.unregisterReloadable(L),delete a.hisonCloser.component.drawerList[u],r.value&&V()};return t.onMounted(F),t.onBeforeUnmount(G),t.watch(N,e=>{D(),f("responsive-change",e)}),t.watch(()=>l.visible,e=>{!!e!==r.value&&(e?E():d())}),t.watch(()=>l.zIndex,e=>{const o=Number(e);Number.isFinite(o)&&o!==b.value&&(b.value=o)}),t.watch(()=>l.border,e=>{const o=!!e;o!==w.value&&(w.value=o)}),t.watch(()=>l.showOverlay,e=>{const o=!!e;o!==S.value&&(S.value=o)}),t.watch(()=>l.closeClickOverlay,e=>{const o=!!e;o!==k.value&&(k.value=o)}),t.watch(()=>l.scrollLock,e=>{const o=!!e;o!==g.value&&(g.value=o,r.value&&(o?z():V()))}),t.watch(()=>l.position,e=>{e&&e!==s.value&&(s.value=e,l.enterAnimationClass||(m.value=O[s.value]),l.leaveAnimationClass||(y.value=A[s.value]))}),t.watch(()=>l.width,e=>{const o=e==null?null:Number(e);o!==c.value&&j(o,!1)}),t.watch(()=>l.height,e=>{const o=e==null?null:Number(e);o!==v.value&&Y(o,!1)}),t.watch(()=>l.closeButtonVisible,e=>{const o=!!e;o!==B.value&&(B.value=o)}),t.watch(()=>l.closeButtonText,e=>{const o=e??"X";o!==H.value&&(H.value=o)}),t.watch(()=>l.closeButtonTitle,e=>{const o=e??"Close";o!==R.value&&(R.value=o)}),t.watch(()=>l.swipeClose,e=>{const o=!!e;o!==T.value&&(T.value=o)}),t.watch(()=>l.enterAnimationClass,e=>{const o=e||O[s.value];o!==m.value&&(m.value=o)}),t.watch(()=>l.leaveAnimationClass,e=>{const o=e||A[s.value];o!==y.value&&(y.value=o)}),t.watch(()=>l.class,()=>D()),{id:u,props:l,wrapperRef:P,drawerRef:h,position:s,visibleClass:te,responsiveClassList:$,childClassList:le,borderClass:ee,backgroundTypeClass:_,wrapperStyle:ae,overlayStyleWithZ:se,isOverlayVisible:oe,sizeStyle:ie,closeButtonVisible:B,closeButtonBorder:Q,closeButtonBackgroundType:x,closeButtonText:H,closeButtonTitle:R,onOverlayClick:ne,onClickClose:ce,onSwipePointerDown:ve,drawerMethods:t.computed(()=>t.unref(p))}}}),ke={class:"hison-drawer-body"};function Be(l,f,K,u,L,N){const P=t.resolveComponent("HButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-layer-host",l.visibleClass])},[l.isOverlayVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-drawer-overlay",style:t.normalizeStyle(l.overlayStyleWithZ),onClick:f[0]||(f[0]=(...h)=>l.onOverlayClick&&l.onOverlayClick(...h))},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"wrapperRef",class:t.normalizeClass(["hison-drawer-wrapper",`hison-pos-${l.position}`,...l.responsiveClassList]),style:t.normalizeStyle(l.wrapperStyle)},[t.createElementVNode("div",{ref:"drawerRef",class:t.normalizeClass(["hison-drawer",l.borderClass,l.backgroundTypeClass]),style:t.normalizeStyle([l.sizeStyle,l.props.style]),role:"dialog",onPointerdown:f[1]||(f[1]=(...h)=>l.onSwipePointerDown&&l.onSwipePointerDown(...h))},[l.closeButtonVisible?t.renderSlot(l.$slots,"close-button",{key:0,onClick:l.onClickClose,text:l.closeButtonText,title:l.closeButtonTitle||"Close"},()=>[t.createVNode(P,{id:`hison_drawer_close_${l.id}`,class:t.normalizeClass(["hison-drawer-close-btn","hison-pos-right","hison-pos-top","hison-size-s",...l.childClassList]),text:l.closeButtonText,title:l.closeButtonTitle||"Close",border:l.closeButtonBorder,"background-type":l.closeButtonBackgroundType,onClick:l.onClickClose},t.createSlots({default:t.withCtx(()=>[l.$slots["close-label"]?t.renderSlot(l.$slots,"close-label",{key:0}):t.createCommentVNode("",!0)]),_:2},[l.$slots["close-icon"]?{name:"icon",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"close-icon")]),key:"0"}:void 0]),1032,["id","class","text","title","border","background-type","onClick"])]):t.createCommentVNode("",!0),t.createElementVNode("div",ke,[t.renderSlot(l.$slots,"default")])],38)],6)],2)}const Te=be._export_sfc(Se,[["render",Be]]);exports.default=Te;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),a=require("./index-DON-Hfjr.js"),J=require("./scrollManager-CEEWQwoK.js"),be=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ge=["top","bottom","left","right"],pe={id:{type:String,required:!1},class:{type:[String,Array,Object],required:!1},style:{type:[String,Object,Array],required:!1},visible:{type:Boolean,default:!1},border:{type:Boolean,default:!0},zIndex:{type:Number,default:1100},position:{type:String,default:"bottom",validator:l=>ge.includes(l)},width:{type:Number,default:null},height:{type:Number,default:null},closeButtonVisible:{type:Boolean,default:!0},closeButtonText:{type:String,default:"X"},closeButtonTitle:{type:String,default:"close"},swipeClose:{type:Boolean,default:!0},showOverlay:{type:Boolean,default:!0},closeClickOverlay:{type:Boolean,default:!0},overlayStyle:{type:[String,Object,Array],required:!1},scrollLock:{type:Boolean,default:!0},enterAnimationClass:{type:String,required:!1},leaveAnimationClass:{type:String,required:!1}},Se=t.defineComponent({name:"HDrawer",props:pe,inheritAttrs:!1,emits:["mounted","responsive-change","open","close"],setup(l,{emit:f,slots:K}){const u=l.id||a.getUUID(),L=`hdrawer:${u}`,N=a.useDevice(),P=t.ref(null),h=t.ref(null),r=t.ref(l.visible),b=t.ref(l.zIndex??1050),w=t.ref(l.border),S=t.ref(l.showOverlay),k=t.ref(l.closeClickOverlay),g=t.ref(l.scrollLock),s=t.ref(l.position),c=t.ref(l.width??null),v=t.ref(l.height??null),B=t.ref(l.closeButtonVisible),Q=t.computed(()=>w.value),x=t.computed(()=>w.value?"filled":"empty"),H=t.ref(l.closeButtonText||"X"),R=t.ref(l.closeButtonTitle||"Close"),T=t.ref(l.swipeClose),O={top:"hison-drawer-enter-top",bottom:"hison-drawer-enter-bottom",left:"hison-drawer-enter-left",right:"hison-drawer-enter-right"},A={top:"hison-drawer-leave-top",bottom:"hison-drawer-leave-bottom",left:"hison-drawer-leave-left",right:"hison-drawer-leave-right"},m=t.ref(l.enterAnimationClass||O[s.value]),y=t.ref(l.leaveAnimationClass||A[s.value]),_=t.computed(()=>"hison-bg-empty"),ee=t.computed(()=>w.value?"hison-border":""),te=t.computed(()=>r.value?"":"hison-display-none"),$=t.ref([]),D=()=>{var e;$.value=a.extractResponsiveClasses(a.toClassString(l.class)||"",N.value),a.addComponentNameToClass($.value,"size",((e=a.hisonCloser.componentStyle)==null?void 0:e.size)||"m"),a.addComponentNameToClass($.value,"color","primary")},le=t.computed(()=>[...a.extractPrefixedClasses(a.toClassString(l.class)||"","color")]),oe=t.computed(()=>r.value&&S.value),se=t.computed(()=>{const o={zIndex:(b.value??1050)-1},n=l.overlayStyle;return n?Array.isArray(n)?[{...o},...n]:typeof n=="string"?[o,n]:{...o,...n}:o}),ne=()=>{k.value&&d()},ae=t.computed(()=>{const e={zIndex:b.value,position:"fixed",inset:"auto"};switch(e.left="",e.right="",e.top="",e.bottom="",s.value){case"top":e.left="0",e.right="0",e.top="0";break;case"bottom":e.left="0",e.right="0",e.bottom="0";break;case"left":e.left="0",e.top="0",e.bottom="0";break;case"right":e.right="0",e.top="0",e.bottom="0";break}return e}),ie=t.computed(()=>{const e={};return s.value==="top"||s.value==="bottom"?(e.width="100vw",v.value!=null&&(e.height=`${v.value}px`),c.value!=null&&(e.width=`${c.value}px`)):(e.height="100vh",c.value!=null&&(e.width=`${c.value}px`),v.value!=null&&(e.height=`${v.value}px`)),e}),z=()=>{g.value&&J.acquireScrollLock(u)},V=()=>{g.value&&J.releaseScrollLock(u)},M=async()=>{const e=h.value;!e||!m.value||(e.classList.remove(y.value),e.offsetWidth,e.classList.add(m.value))},re=async()=>{const e=h.value;!e||!y.value||(e.classList.remove(m.value),e.offsetWidth,e.classList.add(y.value),await new Promise(o=>setTimeout(o,200)))},E=async()=>{r.value||(r.value=!0,z(),await t.nextTick(),M(),f("open",t.unref(p)))},d=async()=>{if(r.value)try{await re()}finally{r.value=!1,V(),f("close",t.unref(p))}},ue=async()=>r.value?d():E(),ce=()=>d();let q=!1,U=0,X=0;const I=40,ve=e=>{T.value&&(q=!0,U=e.clientX,X=e.clientY,window.addEventListener("pointerup",de,{once:!0,capture:!0}))},de=e=>{if(!q)return;q=!1;const o=e.clientX-U,n=e.clientY-X,i=Math.abs(o),C=Math.abs(n);(s.value==="top"&&C>i&&n>I||s.value==="bottom"&&C>i&&n<-I||s.value==="left"&&i>C&&o<-I||s.value==="right"&&i>C&&o>I)&&d()},fe=200,he="ease";function Z(e,o,n,i,C=fe,we=he){return new Promise(Ce=>{e.style.transition="none",e.style[o]=`${n}px`,e.offsetWidth,e.style.transition=`${o} ${C}ms ${we}`,e.style[o]=`${i}px`;const W=()=>{e.removeEventListener("transitionend",W),e.style.transition="",Ce()};e.addEventListener("transitionend",W),setTimeout(W,C+50)})}const me=t.computed(()=>s.value==="left"||s.value==="right"),ye=t.computed(()=>s.value==="top"||s.value==="bottom");async function j(e,o=!0){const n=h.value;if(!n){c.value=e;return}const i=n.getBoundingClientRect().width;if((e??i)===i){c.value=e;return}if(!o||e==null||!me.value){c.value=e;return}c.value=e,await t.nextTick(),await Z(n,"width",i,e)}async function Y(e,o=!0){const n=h.value;if(!n){v.value=e;return}const i=n.getBoundingClientRect().height;if((e??i)===i){v.value=e;return}if(!o||e==null||!ye.value){v.value=e;return}v.value=e,await t.nextTick(),await Z(n,"height",i,e)}const p=t.ref(null),F=()=>{a.hisonCloser.component.drawerList[u]&&a.hisonCloser.component.drawerList[u].isHisonvueComponent&&console.warn(`[Hisonvue] The drawer ID is at risk of being duplicated. ${u}`),a.registerReloadable(L,()=>{G(),t.nextTick(F)}),D(),r.value&&(z(),t.nextTick(M)),p.value={isHisonvueComponent:!0,getId:()=>u,getType:()=>"drawer",isVisible:()=>r.value,open:E,close:d,toggle:ue,setVisible:e=>e?E():d(),getZIndex:()=>b.value,setZIndex:e=>{b.value=e},getPosition:()=>s.value,setPosition:e=>{s.value=e,l.enterAnimationClass||(m.value=O[s.value]),l.leaveAnimationClass||(y.value=A[s.value])},getWidth:()=>c.value,setWidth:(e,o=!0)=>j(e,o),getHeight:()=>v.value,setHeight:(e,o=!0)=>Y(e,o),isSwipeCloseEnabled:()=>T.value,setSwipeCloseEnabled:e=>{T.value=e},isCloseButtonVisible:()=>B.value,setCloseButtonVisible:e=>{B.value=e},isOverlayShown:()=>S.value,setOverlayShown:e=>{S.value=e},isCloseClickOverlay:()=>k.value,setCloseClickOverlay:e=>{k.value=e},isScrollLocked:()=>g.value,setScrollLock:e=>{g.value=e,r.value&&(e?z():V())},isBorder:()=>w.value,setBorder:e=>{w.value=e},getAnimationClasses:()=>({enter:m.value,leave:y.value}),setAnimationClasses:e=>{"enter"in e&&(m.value=e.enter||""),"leave"in e&&(y.value=e.leave||"")},reload:()=>a.reloadHisonComponent(L)},a.hisonCloser.component.drawerList[u]=p.value,f("mounted",p.value)},G=()=>{a.unregisterReloadable(L),delete a.hisonCloser.component.drawerList[u],r.value&&V()};return t.onMounted(F),t.onBeforeUnmount(G),t.watch(N,e=>{D(),f("responsive-change",e)}),t.watch(()=>l.visible,e=>{!!e!==r.value&&(e?E():d())}),t.watch(()=>l.zIndex,e=>{const o=Number(e);Number.isFinite(o)&&o!==b.value&&(b.value=o)}),t.watch(()=>l.border,e=>{const o=!!e;o!==w.value&&(w.value=o)}),t.watch(()=>l.showOverlay,e=>{const o=!!e;o!==S.value&&(S.value=o)}),t.watch(()=>l.closeClickOverlay,e=>{const o=!!e;o!==k.value&&(k.value=o)}),t.watch(()=>l.scrollLock,e=>{const o=!!e;o!==g.value&&(g.value=o,r.value&&(o?z():V()))}),t.watch(()=>l.position,e=>{e&&e!==s.value&&(s.value=e,l.enterAnimationClass||(m.value=O[s.value]),l.leaveAnimationClass||(y.value=A[s.value]))}),t.watch(()=>l.width,e=>{const o=e==null?null:Number(e);o!==c.value&&j(o,!1)}),t.watch(()=>l.height,e=>{const o=e==null?null:Number(e);o!==v.value&&Y(o,!1)}),t.watch(()=>l.closeButtonVisible,e=>{const o=!!e;o!==B.value&&(B.value=o)}),t.watch(()=>l.closeButtonText,e=>{const o=e??"X";o!==H.value&&(H.value=o)}),t.watch(()=>l.closeButtonTitle,e=>{const o=e??"Close";o!==R.value&&(R.value=o)}),t.watch(()=>l.swipeClose,e=>{const o=!!e;o!==T.value&&(T.value=o)}),t.watch(()=>l.enterAnimationClass,e=>{const o=e||O[s.value];o!==m.value&&(m.value=o)}),t.watch(()=>l.leaveAnimationClass,e=>{const o=e||A[s.value];o!==y.value&&(y.value=o)}),t.watch(()=>l.class,()=>D()),{id:u,props:l,wrapperRef:P,drawerRef:h,position:s,visibleClass:te,responsiveClassList:$,childClassList:le,borderClass:ee,backgroundTypeClass:_,wrapperStyle:ae,overlayStyleWithZ:se,isOverlayVisible:oe,sizeStyle:ie,closeButtonVisible:B,closeButtonBorder:Q,closeButtonBackgroundType:x,closeButtonText:H,closeButtonTitle:R,onOverlayClick:ne,onClickClose:ce,onSwipePointerDown:ve,drawerMethods:t.computed(()=>t.unref(p))}}}),ke={class:"hison-drawer-body"};function Be(l,f,K,u,L,N){const P=t.resolveComponent("HButton");return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["hison-layer-host",l.visibleClass])},[l.isOverlayVisible?(t.openBlock(),t.createElementBlock("div",{key:0,class:"hison-drawer-overlay",style:t.normalizeStyle(l.overlayStyleWithZ),onClick:f[0]||(f[0]=(...h)=>l.onOverlayClick&&l.onOverlayClick(...h))},null,4)):t.createCommentVNode("",!0),t.createElementVNode("div",{ref:"wrapperRef",class:t.normalizeClass(["hison-drawer-wrapper",`hison-pos-${l.position}`,...l.responsiveClassList]),style:t.normalizeStyle(l.wrapperStyle)},[t.createElementVNode("div",{ref:"drawerRef",class:t.normalizeClass(["hison-drawer",l.borderClass,l.backgroundTypeClass]),style:t.normalizeStyle([l.sizeStyle,l.props.style]),role:"dialog",onPointerdown:f[1]||(f[1]=(...h)=>l.onSwipePointerDown&&l.onSwipePointerDown(...h))},[l.closeButtonVisible?t.renderSlot(l.$slots,"close-button",{key:0,onClick:l.onClickClose,text:l.closeButtonText,title:l.closeButtonTitle||"Close"},()=>[t.createVNode(P,{id:`hison_drawer_close_${l.id}`,class:t.normalizeClass(["hison-drawer-close-btn","hison-pos-right","hison-pos-top","hison-size-s",...l.childClassList]),text:l.closeButtonText,title:l.closeButtonTitle||"Close",border:l.closeButtonBorder,"background-type":l.closeButtonBackgroundType,onClick:l.onClickClose},t.createSlots({default:t.withCtx(()=>[l.$slots["close-label"]?t.renderSlot(l.$slots,"close-label",{key:0}):t.createCommentVNode("",!0)]),_:2},[l.$slots["close-icon"]?{name:"icon",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"close-icon")]),key:"0"}:void 0]),1032,["id","class","text","title","border","background-type","onClick"])]):t.createCommentVNode("",!0),t.createElementVNode("div",ke,[t.renderSlot(l.$slots,"default")])],38)],6)],2)}const Te=be._export_sfc(Se,[["render",Be]]);exports.default=Te;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ze, ref as n, computed as u, onMounted as Ve, onBeforeUnmount as Pe, watch as a, unref as Y, nextTick as A, resolveComponent as He, createElementBlock as se, openBlock as ne, normalizeClass as D, createCommentVNode as F, createElementVNode as G, normalizeStyle as J, renderSlot as N, createVNode as Re, createSlots as De, withCtx as ae } from "vue";
|
|
2
|
-
import { g as Ne, u as We, j as qe, t as ie, e as Ue, b as re, h as O, r as Xe, c as Ze, d as Me } from "./index-
|
|
2
|
+
import { g as Ne, u as We, j as qe, t as ie, e as Ue, b as re, h as O, r as Xe, c as Ze, d as Me } from "./index-0mmn7cpg.mjs";
|
|
3
3
|
import { a as je, r as Ye } from "./scrollManager-BGnq4wyt.mjs";
|
|
4
4
|
import { _ as Fe } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
5
5
|
const Ge = ["top", "bottom", "left", "right"], Je = {
|