diff --git a/config/nova-calendar.php b/config/nova-calendar.php index 362c3b7..f05777c 100644 --- a/config/nova-calendar.php +++ b/config/nova-calendar.php @@ -42,6 +42,22 @@ */ 'windowTitle' => 'Nova Calendar', + /* + * Define if week numbers should be displayed on the Month view. + This key is optional. + If you remove it or set, week numbers will be displayed on the Month view by default. + */ + 'shouldShowWeekNumbers' => true, + + /* + * Define what calendar views should be rendered and visible to the end user. + Array order determines sequence of views selector on frontend. + This key is optional. if not set, all NovaCalendar views will be rendered. + */ + 'calendarViews' => [ + 'month', + 'week' + ] ], // 'calendar2' => [ diff --git a/dist/css/tool.css b/dist/css/tool.css index cb85d1b..b7691ed 100644 --- a/dist/css/tool.css +++ b/dist/css/tool.css @@ -1 +1 @@ -:root{--nc-transparent:hsla(0,0%,100%,0);--nc-highlight-bg:rgba(var(--colors-primary-500),0.02);--nc-highlight-border:rgba(var(--colors-primary-500),0.4);--nc-weekend-border:rgba(var(--colors-gray-500),0.2);--nc-weekend-bg:rgba(var(--colors-gray-900),0);--nc-event-height-multi-day:2.2em;--nc-event-border:hsla(0,0%,4%,.3);--nc-event-border-radius:7px}.nova-calendar.noselect{-webkit-touch-callout:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.noscrollbar::-webkit-scrollbar{display:none}.noscrollbar{-ms-overflow-style:none;scrollbar-width:none}#nc-control{border:0 solid #555;display:flex;height:3em;justify-content:space-between;margin-bottom:1rem;position:relative}#nc-control .center-items,#nc-control .left-items,#nc-control .right-items{align-items:center;display:flex;gap:8px;justify-content:center}#nc-control a.disabled{opacity:.2;pointer-events:none}#nc-control>a,#nc-control>h1{display:block;left:0;margin-left:auto;margin-right:auto;position:absolute;right:0;text-align:center}#nc-control h1 span{cursor:pointer;margin-left:1rem}#nc-control a.button{border:1px solid rgba(var(--colors-gray-500),.2);border-radius:6px;padding:.5rem}div.nova-calendar{width:100%}div.nova-calendar div.nc-header{display:grid;grid-template-columns:repeat(7,1fr);width:100%}div.nova-calendar div.nc-header div{font-weight:700;padding:.6em .6em .5em;text-align:left;word-break:break-all}div.nova-calendar .week{display:grid;grid-template-columns:repeat(7,1fr);width:100%}div.nova-calendar .nc-col-1{grid-column:1/2}div.nova-calendar .nc-col-2{grid-column:2/3}div.nova-calendar .nc-col-3{grid-column:3/4}div.nova-calendar .nc-col-4{grid-column:4/5}div.nova-calendar .nc-col-5{grid-column:5/6}div.nova-calendar .nc-col-6{grid-column:6/7}div.nova-calendar .nc-col-7{grid-column:7/-1}div.nova-calendar .nc-event.multi.span-1{grid-column-end:span 1}div.nova-calendar .nc-event.multi.span-2{grid-column-end:span 2}div.nova-calendar .nc-event.multi.span-3{grid-column-end:span 3}div.nova-calendar .nc-event.multi.span-4{grid-column-end:span 4}div.nova-calendar .nc-event.multi.span-5{grid-column-end:span 5}div.nova-calendar .nc-event.multi.span-6{grid-column-end:span 6}div.nova-calendar .nc-event.multi.span-7{grid-column-end:span 7}div.nova-calendar .day{border-color:rgba(var(--colors-gray-500),.15);border-width:.5px;grid-row:1/-1;min-height:9em;z-index:0}div.nova-calendar .day:not(.withinRange){background:repeating-linear-gradient(-45deg,rgba(225,225,255,.1),rgba(225,225,255,.1) 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 6px);opacity:.5}div.nova-calendar .dayheader{padding:.4em;z-index:1}div.nova-calendar .day .dayheader .daylabel{font-size:9pt;opacity:.84}div.nova-calendar .day.today .dayheader .daylabel{background-color:rgba(var(--colors-primary-500),.2);border-radius:100%;font-size:10pt;font-weight:700;opacity:1;padding:.2em .5em}div.nova-calendar .dayheader .badges{float:right;max-width:80%}div.nova-calendar .dayheader span.badge{font-size:10pt;line-height:12pt;min-width:22px;opacity:.8;padding:.25em;text-align:center}div.nova-calendar .week-events{display:grid;grid-auto-flow:column dense;grid-column:1/-1;grid-row:1;grid-template-columns:repeat(7,1fr);margin-top:2.2em;z-index:2}div.nova-calendar .single-day-events{border:0 solid red;grid-row-start:span 9000;margin-bottom:1em;min-height:2px}div.nova-calendar .nc-event{align-items:center;border-bottom:1px solid var(--nc-event-border);display:grid;font-size:10pt;grid-template-columns:1fr auto;grid-template-rows:auto auto;margin:.1em;min-height:var(--nc-event-height-multi-day);opacity:.92;overflow:hidden;padding:.2em;text-align:left;transition:opacity .25s}div.nova-calendar .nc-event:not(.withinRange){opacity:.6}div.nova-calendar .nc-event:hover{opacity:1}div.nova-calendar .nc-event.starts{border-bottom-left-radius:var(--nc-event-border-radius);border-top-left-radius:var(--nc-event-border-radius)}div.nova-calendar .nc-event.ends{border-bottom-right-radius:var(--nc-event-border-radius);border-top-right-radius:var(--nc-event-border-radius)}div.nova-calendar div.nc-event.clickable{cursor:pointer}div.nova-calendar div.nc-event div.name{border:0 dashed #fff;font-weight:700;grid-column:1/2;grid-row:1/2;margin-left:.2em;margin-right:.2em;overflow:scroll;white-space:nowrap}div.nova-calendar div.nc-event:not(.starts) div.name{font-size:9pt;font-weight:400;opacity:.8;padding-top:.1em}div.nova-calendar div.nc-event div.badges{border:0 solid #0f0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;grid-column:2/-1;grid-row:1/2;text-align:right}div.nova-calendar div.nc-event div.badges span.badge-bg{background-color:rgba(50,50,64,.5);border-bottom:1px solid rgba(var(--colors-primary-500),.5);border-radius:4px;display:inline-block;margin-left:.5px;margin-right:.5px}div.nova-calendar div.nc-event div.badges span.badge{font-size:9pt;line-height:12pt;min-width:22px;opacity:1;padding:.25em;text-align:center}div.nova-calendar .nc-event div.content{border:0 dashed red;grid-column:1/span 2;grid-row:2/3;overflow:scroll;padding-left:.2em}div.nova-calendar div.nc-event span.time{display:inline-block;font-size:9pt;margin-right:.2em;opacity:.8}div.nova-calendar div.nc-event span.notes{font-size:9pt;line-height:10pt}div.nova-calendar .nc-event.multi{align-items:top;grid-template-columns:auto 1fr auto;grid-template-rows:auto;max-height:var(--nc-event-height-multi-day);overflow:hidden}div.nova-calendar .nc-event:not(.starts){border-left:1px dashed hsla(0,0%,89%,.6);opacity:.8}div.nova-calendar .nc-event:not(.ends){border-right:1px dashed hsla(0,0%,89%,.6)}div.nova-calendar div.nc-event.multi div.name{grid-column:1/2;grid-row:1/-1;overflow:scroll;white-space:nowrap}div.nova-calendar div.nc-event.multi div.badges{grid-column:3/-1;grid-row:1/-1;overflow:scroll;white-space:nowrap}div.nova-calendar div.nc-event.multi div.content{grid-column:2/3;grid-row:1/-1;overflow:scroll;white-space:nowrap} +:root{--nc-transparent:hsla(0,0%,100%,0);--nc-highlight-bg:rgba(var(--colors-primary-500),0.02);--nc-highlight-border:rgba(var(--colors-primary-500),0.4);--nc-weekend-border:rgba(var(--colors-gray-500),0.2);--nc-weekend-bg:rgba(var(--colors-gray-900),0);--nc-event-height-multi-day:2em;--nc-event-border:hsla(0,0%,4%,.3);--nc-event-border-radius:7px}.nova-calendar.noselect{-webkit-touch-callout:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none}.noscrollbar::-webkit-scrollbar{display:none}.noscrollbar{-ms-overflow-style:none;scrollbar-width:none}#nc-control{border:0 solid #555;display:flex;height:3em;justify-content:space-between;margin-bottom:1rem;position:relative}#nc-control .center-items,#nc-control .left-items,#nc-control .right-items{align-items:center;display:flex;gap:8px;justify-content:center}#nc-control a.disabled{opacity:.2;pointer-events:none}#nc-control>a,#nc-control>h1{display:block;left:0;margin-left:auto;margin-right:auto;position:absolute;right:0;text-align:center}#nc-control h1 span{cursor:pointer;margin-left:1rem}#nc-control a.button{border:1px solid rgba(var(--colors-gray-500),.2);border-radius:6px;padding:.5rem}div.nova-calendar{width:100%}div.nova-calendar div.nc-header div{font-weight:700;padding:.6em .6em .5em;text-align:left;word-break:break-all}div.nova-calendar.month-view .week,div.nova-calendar.month-view div.nc-header{display:grid;grid-template-columns:repeat(7,1fr);width:100%}div.nova-calendar.month-view .nc-col-1{grid-column:1/2}div.nova-calendar.month-view .nc-col-2{grid-column:2/3}div.nova-calendar.month-view .nc-col-3{grid-column:3/4}div.nova-calendar.month-view .nc-col-4{grid-column:4/5}div.nova-calendar.month-view .nc-col-5{grid-column:5/6}div.nova-calendar.month-view .nc-col-6{grid-column:6/7}div.nova-calendar.month-view .nc-col-7{grid-column:7/-1}div.nova-calendar.month-view .nc-event.multi.span-1{grid-column-end:span 1}div.nova-calendar.month-view .nc-event.multi.span-2{grid-column-end:span 2}div.nova-calendar.month-view .nc-event.multi.span-3{grid-column-end:span 3}div.nova-calendar.month-view .nc-event.multi.span-4{grid-column-end:span 4}div.nova-calendar.month-view .nc-event.multi.span-5{grid-column-end:span 5}div.nova-calendar.month-view .nc-event.multi.span-6{grid-column-end:span 6}div.nova-calendar.month-view .nc-event.multi.span-7{grid-column-end:span 7}div.nova-calendar.month-view .shouldShowWeekNumbers{display:grid;grid-template-columns:2em 1fr;width:100%}div.nova-calendar.month-view .weeknumber{border-color:rgba(var(--colors-gray-500),.15);border-width:.5px;grid-row:1/-1;z-index:0}div.nova-calendar.month-view .weeknumberheader{z-index:1}div.nova-calendar.month-view .weeknumberlabel{font-size:8pt;transform:rotate(270deg);transform-origin:75% 80%}div.nova-calendar.month-view .week-events{display:grid;grid-auto-flow:column dense;grid-column:1/-1;grid-row:1;grid-template-columns:repeat(7,1fr);margin-top:2.2em;z-index:2}div.nova-calendar.week-view .week{display:grid;grid-template-columns:4em repeat(7,1fr);width:100%}div.nova-calendar.week-view div.nc-header{display:grid;grid-row:1/2;grid-template-columns:4em repeat(7,1fr);width:100%}div.nova-calendar.week-view .nc-col-0{grid-column:1/2}div.nova-calendar.week-view .nc-col-1{grid-column:2/3}div.nova-calendar.week-view .nc-col-2{grid-column:3/4}div.nova-calendar.week-view .nc-col-3{grid-column:4/5}div.nova-calendar.week-view .nc-col-4{grid-column:5/6}div.nova-calendar.week-view .nc-col-5{grid-column:6/7}div.nova-calendar.week-view .nc-col-6{grid-column:7/8}div.nova-calendar.week-view .nc-col-7{grid-column:8/-1}div.nova-calendar.week-view .nc-event.multi.span-1{grid-column-end:span 1}div.nova-calendar.week-view .nc-event.multi.span-2{grid-column-end:span 2}div.nova-calendar.week-view .nc-event.multi.span-3{grid-column-end:span 3}div.nova-calendar.week-view .nc-event.multi.span-4{grid-column-end:span 4}div.nova-calendar.week-view .nc-event.multi.span-5{grid-column-end:span 5}div.nova-calendar.week-view .nc-event.multi.span-6{grid-column-end:span 6}div.nova-calendar.week-view .nc-event.multi.span-7{grid-column-end:span 7}div.nova-calendar.week-view .nc-event.multi.span-8{grid-column-end:span 8}div.nova-calendar.week-view .rotated{border-color:rgba(var(--colors-gray-500),.15);z-index:0}div.nova-calendar.week-view .rotated-header{z-index:1}div.nova-calendar.week-view .rotated-label{font-size:8pt;transform:rotate(270deg);transform-origin:75% 80%}div.nova-calendar.week-view .hour-label{border:none;font-size:.6rem;opacity:.84;padding-right:.5rem;text-align:right}div.nova-calendar.week-view .hour-label div{margin-top:-1em}div.nova-calendar.week-view .day-events-container{display:grid;grid-column:2;grid-template-rows:1fr auto}div.nova-calendar.week-view .week-events{display:grid;grid-auto-flow:column dense;grid-column:1/-1;grid-row:2;grid-template-columns:4em repeat(7,1fr);margin-top:0;min-height:6em;z-index:0}div.nova-calendar .day{border-color:rgba(var(--colors-gray-500),.15);border-width:.5px;grid-row:1/-1;min-height:9em;z-index:0}div.nova-calendar .day.multi{border-bottom:none;min-height:0}div.nova-calendar .day:not(.withinRange){background:repeating-linear-gradient(-45deg,rgba(225,225,255,.1),rgba(225,225,255,.1) 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 6px);opacity:.5}div.nova-calendar .dayheader{padding:.4em;z-index:1}div.nova-calendar .day .dayheader .daylabel{font-size:9pt;opacity:.84}div.nova-calendar .today .dayheader .daylabel{background-color:rgba(var(--colors-primary-500),.2);border-radius:100%;font-size:10pt;font-weight:700;opacity:1;padding:.2em .5em}div.nova-calendar .slot{border-color:rgba(var(--colors-gray-500),.15);border-width:.5px}div.nova-calendar .slot:not(.withinRange){background:repeating-linear-gradient(-45deg,rgba(225,225,255,.1),rgba(225,225,255,.1) 4px,hsla(0,0%,39%,.1) 0,hsla(0,0%,39%,.1) 6px);opacity:.5}div.nova-calendar .day-events-container{display:grid;grid-column:2;grid-template-rows:1fr auto}div.nova-calendar .dayheader .badges{float:right;max-width:80%}div.nova-calendar .dayheader span.badge{font-size:10pt;line-height:12pt;min-width:22px;opacity:.8;padding:.25em;text-align:center}div.nova-calendar .single-day-events{border:0 solid red;grid-row-start:span 9000;margin-bottom:1em;min-height:2px}div.nova-calendar .nc-event{align-items:start;border-bottom:1px solid var(--nc-event-border);display:grid;font-size:10pt;grid-template-columns:1fr auto;grid-template-rows:max-content auto;margin:.1em;min-height:var(--nc-event-height-multi-day);opacity:.92;overflow:hidden;padding:.2em;text-align:left;transition:opacity .25s}div.nova-calendar .nc-event:not(.withinRange){opacity:.6}div.nova-calendar .nc-event:hover{opacity:1}div.nova-calendar div.nc-event.clickable{cursor:pointer}div.nova-calendar.month-view .nc-event.starts{border-bottom-left-radius:var(--nc-event-border-radius);border-top-left-radius:var(--nc-event-border-radius)}div.nova-calendar.month-view .nc-event.ends{border-bottom-right-radius:var(--nc-event-border-radius);border-top-right-radius:var(--nc-event-border-radius)}div.nova-calendar.week-view .nc-event.starts{border-top-left-radius:var(--nc-event-border-radius);border-top-right-radius:var(--nc-event-border-radius)}div.nova-calendar.week-view .nc-event.ends,div.nova-calendar.week-view .nc-event:not(.starts):not(.ends){border-bottom-left-radius:var(--nc-event-border-radius);border-bottom-right-radius:var(--nc-event-border-radius)}div.nova-calendar.week-view .nc-event:not(.starts):not(.ends){border-top-left-radius:var(--nc-event-border-radius);border-top-right-radius:var(--nc-event-border-radius)}div.nova-calendar.week-view .nc-event:not(.starts):not(.ends) div.name{font-size:9pt;font-weight:400;opacity:.8;padding-top:.1em}div.nova-calendar .nc-event div.content{align-items:start;border:0 dashed red;grid-column:1/span 2;grid-row:2/3;overflow:scroll;padding-left:.2em}div.nova-calendar div.nc-event span.time{display:inline-block;font-size:9pt;margin-right:.2em;opacity:.8}div.nova-calendar div.nc-event span.notes{font-size:9pt;line-height:10pt}div.nova-calendar div.nc-event div.name{border:0 dashed #fff;font-weight:700;grid-column:1/2;grid-row:1/2;margin-left:.2em;margin-right:.2em;overflow:scroll;white-space:nowrap}div.nova-calendar .week.events div.nc-event:not(.starts) div.name{font-size:9pt;font-weight:400;opacity:.8;padding-top:.1em}div.nova-calendar div.nc-event div.badges{border:0 solid #0f0;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;grid-column:2/-1;grid-row:1/2;text-align:right}div.nova-calendar div.nc-event div.badges span.badge-bg{background-color:rgba(50,50,64,.5);border-bottom:1px solid rgba(var(--colors-primary-500),.5);border-radius:4px;display:inline-block;margin-left:.5px;margin-right:.5px}div.nova-calendar div.nc-event div.badges span.badge{font-size:9pt;line-height:12pt;min-width:22px;opacity:1;padding:.25em;text-align:center}div.nova-calendar .nc-event.multi{align-items:top;grid-template-columns:auto 1fr auto;grid-template-rows:auto;max-height:var(--nc-event-height-multi-day);overflow:hidden}div.nova-calendar div.nc-event.multi div.name{grid-column:1/2;grid-row:1/-1;overflow:scroll;white-space:nowrap}div.nova-calendar div.nc-event.multi div.badges{grid-column:3/-1;grid-row:1/-1;overflow:scroll;white-space:nowrap}div.nova-calendar div.nc-event.multi div.content{grid-column:2/3;grid-row:1/-1;overflow:scroll;white-space:nowrap}div.nova-calendar.month-view .nc-event:not(.starts){border-left:1px dashed hsla(0,0%,89%,.6);opacity:.8}div.nova-calendar.month-view .nc-event:not(.ends){border-right:1px dashed hsla(0,0%,89%,.6)}div.nova-calendar.week-view .nc-event:not(.starts){border-top:1px dashed hsla(0,0%,89%,.6)}div.nova-calendar.week-view .nc-event:not(.ends){border-bottom:1px dashed hsla(0,0%,89%,.6)} diff --git a/dist/js/tool.js b/dist/js/tool.js index 0e3e7cc..00dbe00 100644 --- a/dist/js/tool.js +++ b/dist/js/tool.js @@ -1 +1 @@ -(()=>{"use strict";var e,t={210:(e,t,n)=>{const r=Vue;var l={id:"nc-control"},o={class:"left-items"},a=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})],-1)],i=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})],-1)],s=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})],-1)],c=(0,r.createElementVNode)("div",{class:"center-items"},null,-1),d={class:"right-items"},u=["innerHTML"],m={ref:"theForm",class:"divide-y divide-gray-200 dark:divide-gray-800 divide-solid"},v={key:0,class:"bg-gray-100"},h=["innerHTML"],f=["innerHTML","onClick"],g={style:{width:"100%",overflow:"scroll"}},p={key:0,class:"nova-calendar noselect"},y={class:"nc-header"},k={class:"border-gray-200 dark:border-gray-900 dark:text-gray-300"},b={class:"nc-content"},w={class:"week"},E={class:"dayheader text-gray-400 noselect"},B={class:"daylabel"},N={class:"badges"},C={class:"badge-bg text-gray-200"},F=["innerHTML"],x=["innerHTML"],V={class:"week-events"},L=["onClick"],M={class:"name noscrollbar"},T={class:"badges noscrollbar"},S={class:"badge-bg text-gray-200"},K=["innerHTML"],H={class:"content noscrollbar"},O={key:0,class:"time"},D=["innerHTML"],j=["onClick"],_={class:"name noscrollbar"},A={key:0,class:"badges"},z={class:"badge-bg text-gray-200"},R=["innerHTML"],I={class:"content noscrollbar"},$={key:0,class:"time"},U={key:1,class:"time"},Z=["innerHTML"];const W={mounted:function(){var e=this;this.init(),Nova.addShortcut("alt+right",(function(t){e.nextMonth()})),Nova.addShortcut("alt+left",(function(t){e.prevMonth()})),Nova.addShortcut("alt+h",(function(t){e.reset()}))},methods:{reset:function(){this.month=null,this.year=null,this.reload()},init:function(){this.hasStoredSettings()?(this.restoreSettings(),this.reload(!1)):this.reload(!0)},prevMonth:function(){this.month-=1,this.reload()},nextMonth:function(){this.month+=1,this.reload()},reload:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;n.loading=!0;var r="/nova-vendor/wdelfuego/nova-calendar"+this.calendarUrl()+"/month?y="+n.year+"&m="+n.month;n.activeFilterKey?r+="&filter="+n.activeFilterKey:t&&(r+="&isInitRequest=1"),Nova.request().get(r).then((function(t){n.styles=t.data.styles,n.year=t.data.year,n.month=t.data.month,n.windowTitle=t.data.windowTitle,n.resetFiltersLabel=t.data.resetFiltersLabel,n.availableFilters=t.data.filters,n.activeFilterKey=t.data.activeFilterKey,n.title=t.data.title,n.columns=t.data.columns,n.weeks=t.data.weeks,e.setFilter(n.activeFilterKey),n.loading=!1,e.storeSettings()}))},open:function(e,t){e.metaKey||e.ctrlKey?window.open(Nova.url(t)):Nova.visit(t)},stylesForEvent:function(e){var t=this;if(e.options.styles){var n=[this.styles.default];return e.options.styles.forEach((function(e){void 0===t.styles[e]?console.log("[nova-calendar] Unknown custom style name '"+e+"'; does the eventStyles method of your CalendarDataProvider define it properly?"):n.push(t.styles[e])})),n}return this.styles.default},chooseFilter:function(e){this.setFilter(e),this.reload()},setFilter:function(e){for(var e in this.activeFilterKey=e,this.availableFilters)this.activeFilterKey==e&&(this.activeFilterLabel=this.availableFilters[e])},calendarUrl:function(){return window.location.pathname.substring(Nova.url("").length)},storageKey:function(){return"wdelfuego-nova-calendar-"+this.calendarUrl()},hasStoredSettings:function(){return null!==localStorage.getItem(this.storageKey())},storeSettings:function(){localStorage.setItem(this.storageKey(),JSON.stringify({year:this.year,month:this.month,activeFilterKey:this.activeFilterKey}))},restoreSettings:function(){var e=JSON.parse(localStorage.getItem(this.storageKey()));e&&(this.year=e.year,this.month=e.month,this.activeFilterKey=e.activeFilterKey)}},props:{},data:function(){return{loading:!0,resetFiltersLabel:"All events",availableFilters:{},activeFilterKey:null,activeFilterLabel:null,year:null,month:null,windowTitle:"",title:"",columns:Array(7).fill("-"),weeks:Array(6).fill(Array(7).fill({})),styles:{default:{color:"#fff","background-color":"rgba(var(--colors-primary-500), 0.9)"}}}}};var q=n(379),J=n.n(q),P=n(594),G={insert:"head",singleton:!1};J()(P.Z,G);P.Z.locals;const Q=(0,n(744).Z)(W,[["render",function(e,t,n,W,q,J){var P=this,G=(0,r.resolveComponent)("Head"),Q=(0,r.resolveComponent)("Icon"),X=(0,r.resolveComponent)("DropdownTrigger"),Y=(0,r.resolveComponent)("ScrollWrap"),ee=(0,r.resolveComponent)("DropdownMenu"),te=(0,r.resolveComponent)("Dropdown"),ne=(0,r.resolveComponent)("Tooltip"),re=(0,r.resolveComponent)("Card");return(0,r.openBlock)(),(0,r.createElementBlock)("div",null,[(0,r.createVNode)(G,{title:e.$data.windowTitle||e.$data.title},null,8,["title"]),(0,r.createElementVNode)("div",l,[(0,r.createElementVNode)("div",o,[(0,r.createElementVNode)("a",{onClick:t[0]||(t[0]=function(){return J.prevMonth&&J.prevMonth.apply(J,arguments)}),href:"#",class:"button hover:bg-gray-100 dark:hover:bg-gray-700",title:"Alt + ←"},a),(0,r.createElementVNode)("a",{onClick:t[1]||(t[1]=function(){return J.reset&&J.reset.apply(J,arguments)}),href:"#",class:"button hover:bg-gray-100 dark:hover:bg-gray-700",title:"Alt + H"},i),(0,r.createElementVNode)("a",{onClick:t[2]||(t[2]=function(){return J.nextMonth&&J.nextMonth.apply(J,arguments)}),href:"#",class:"button hover:bg-gray-100 dark:hover:bg-gray-700",title:"Alt + →"},s),(0,r.createElementVNode)("h1",{onClick:t[3]||(t[3]=function(){return J.reset&&J.reset.apply(J,arguments)}),class:"text-90 font-normal text-xl md:text-2xl noselect"},[(0,r.createElementVNode)("span",null,(0,r.toDisplayString)(e.$data.title),1)])]),c,(0,r.createElementVNode)("div",d,[Object.keys(q.availableFilters).length?((0,r.openBlock)(),(0,r.createBlock)(te,{key:0,"handle-internal-clicks":!0,class:(0,r.normalizeClass)([{"bg-primary-500 hover:bg-primary-600 border-primary-500":null!=q.activeFilterKey,"dark:bg-primary-500 dark:hover:bg-primary-600 dark:border-primary-500":null!=q.activeFilterKey},"flex h-9 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"]),dusk:"filter-selector"},{menu:(0,r.withCtx)((function(){return[(0,r.createVNode)(ee,{width:"260"},{default:(0,r.withCtx)((function(){return[(0,r.createVNode)(Y,{height:350,class:"bg-white dark:bg-gray-900"},{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",m,[null!=q.activeFilterKey?((0,r.openBlock)(),(0,r.createElementBlock)("div",v,[(0,r.createElementVNode)("button",{class:"py-2 w-full block tracking-wide text-center text-gray-500 dark:bg-gray-800 dark:hover:bg-gray-700 focus:outline-none",onClick:t[4]||(t[4]=function(e){return J.chooseFilter(null)}),innerHTML:e.$data.resetFiltersLabel},null,8,h)])):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.availableFilters,(function(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)("button",{class:(0,r.normalizeClass)(["py-2 w-full block dark:bg-gray-800 dark:hover:bg-gray-700 hover:bg-gray-200",{"font-bold":q.activeFilterKey==t}]),innerHTML:e,onClick:function(e){return J.chooseFilter(t)}},null,10,f)})),256))])],512)]})),_:1})]})),_:1})]})),default:(0,r.withCtx)((function(){return[(0,r.createVNode)(X,{class:(0,r.normalizeClass)([{"text-white hover:text-white dark:text-gray-800 dark:hover:text-gray-800":null!=q.activeFilterKey},"toolbar-button px-2"])},{default:(0,r.withCtx)((function(){return[(0,r.createVNode)(Q,{type:"filter"}),null!=q.activeFilterKey?((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:0,class:(0,r.normalizeClass)([{"text-white dark:text-gray-800":null!=q.activeFilterKey},"ml-2 font-bold"]),innerHTML:q.activeFilterLabel},null,10,u)):(0,r.createCommentVNode)("",!0)]})),_:1},8,["class"])]})),_:1},8,["class"])):(0,r.createCommentVNode)("",!0)])]),(0,r.createElementVNode)("div",g,[(0,r.createVNode)(re,{class:"flex flex-col items-center justify-center dark:bg-gray-800",style:{"min-height":"300px","min-width":"800px","background-color":"var(--bg-gray-800)"}},{default:(0,r.withCtx)((function(){return[q.title.length?((0,r.openBlock)(),(0,r.createElementBlock)("div",p,[(0,r.createElementVNode)("div",y,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.columns,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",k,[(0,r.createElementVNode)("span",null,(0,r.toDisplayString)(e),1)])})),256))]),(0,r.createElementVNode)("div",b,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.weeks,(function(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)("div",w,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["day dark:bg-gray-900 dark:border-gray-800",["nc-col-"+e.weekdayColumn],{withinRange:e.isWithinRange,today:e.isToday}])},[(0,r.createElementVNode)("div",E,[(0,r.createElementVNode)("span",B,(0,r.toDisplayString)(e.label),1),(0,r.createElementVNode)("div",N,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",C,[(0,r.createVNode)(ne,null,{content:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{innerHTML:e.tooltip},null,8,F)]})),default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e.badge},null,8,x)]})),_:2},1024)])})),256))])])],2)})),256)),(0,r.createElementVNode)("div",V,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.eventsMultiDay,(function(t){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)([["nc-event","multi","nc-col-"+e.weekdayColumn,"span-"+t.spansDaysN],{clickable:t.url,starts:t.startsEvent,ends:t.endsEvent,withinRange:t.isWithinRange}]),onClick:function(e){return J.open(e,t.url)},style:(0,r.normalizeStyle)(P.stylesForEvent(t))},[(0,r.createElementVNode)("div",M,(0,r.toDisplayString)(t.name),1),(0,r.createElementVNode)("div",T,[t.startsEvent?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)(t.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",S,[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e},null,8,K)])})),256)):(0,r.createCommentVNode)("",!0)]),(0,r.createElementVNode)("div",H,[t.startsEvent&&t.options.displayTime?((0,r.openBlock)(),(0,r.createElementBlock)("span",O,(0,r.toDisplayString)(t.startTime),1)):(0,r.createCommentVNode)("",!0),t.startsEvent?((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:1,class:"notes",innerHTML:t.notes},null,8,D)):(0,r.createCommentVNode)("",!0)])],14,L)})),256))],64)})),256)),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["single-day-events","nc-col-"+e.weekdayColumn])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.eventsSingleDay,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)([["nc-event"],{clickable:e.url,starts:e.startsEvent,ends:e.endsEvent,withinRange:e.isWithinRange}]),onClick:function(t){return J.open(t,e.url)},style:(0,r.normalizeStyle)(P.stylesForEvent(e))},[(0,r.createElementVNode)("div",_,(0,r.toDisplayString)(e.name),1),e.badges.length>0?((0,r.openBlock)(),(0,r.createElementBlock)("div",A,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",z,[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e},null,8,R)])})),256))])):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",I,[e.options.displayTime?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[e.endTime?((0,r.openBlock)(),(0,r.createElementBlock)("span",$,(0,r.toDisplayString)(e.startTime)+" - "+(0,r.toDisplayString)(e.endTime),1)):((0,r.openBlock)(),(0,r.createElementBlock)("span",U,(0,r.toDisplayString)(e.startTime),1))],64)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("span",{class:"notes",innerHTML:e.notes},null,8,Z)])],14,j)})),256))],2)})),256))])])})),256))])])):(0,r.createCommentVNode)("",!0)]})),_:1})])])}]]);Nova.booting((function(e,t){Nova.inertia("NovaCalendar",Q)}))},594:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(645),l=n.n(r)()((function(e){return e[1]}));l.push([e.id,"",""]);const o=l},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var l={};if(r)for(var o=0;o{},379:(e,t,n)=>{var r,l=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function i(e){for(var t=-1,n=0;n{t.Z=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}}},n={};function r(e){var l=n[e];if(void 0!==l)return l.exports;var o=n[e]={id:e,exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=(t,n,l,o)=>{if(!n){var a=1/0;for(d=0;d=o)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(i=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,l,o]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={103:0,990:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var l,o,[a,i,s]=n,c=0;if(a.some((t=>0!==e[t]))){for(l in i)r.o(i,l)&&(r.m[l]=i[l]);if(s)var d=s(r)}for(t&&t(n);cr(210)));var l=r.O(void 0,[990],(()=>r(762)));l=r.O(l)})(); \ No newline at end of file +(()=>{"use strict";var e,t={335:(e,t,n)=>{const r=Vue;var l={id:"nc-control"},o={class:"left-items"},a=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})],-1)],i=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})],-1)],s=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})],-1)],c=(0,r.createElementVNode)("div",{class:"center-items"},null,-1),d={class:"right-items"},u=["innerHTML"],m={ref:"theForm",class:"divide-y divide-gray-200 dark:divide-gray-800 divide-solid"},g={key:0,class:"bg-gray-100"},h=["innerHTML"],v=["innerHTML","onClick"],k={key:1},y=["onClick"],p={class:"font-bold capitalize"},f={style:{width:"100%",overflow:"scroll"}},w={key:0,class:"nova-calendar month-view noselect"},b={key:0,class:"border-gray-200 dark:border-gray-900 dark:text-gray-300"},E={class:"nc-header"},B={class:"border-gray-200 dark:border-gray-900 dark:text-gray-300"},N={class:"nc-content"},V={key:0,class:"weeknumber dark:bg-gray-900 dark:border-gray-800 nc-col-0"},C=["onClick"],F={class:"weeknumberheader text-gray-400 button relative"},S={class:"weeknumberlabel absolute w-full text-right"},x={key:1,class:"weeknumberheader text-gray-400 noselect relative"},T={class:"weeknumberlabel absolute w-full text-right"},L={class:"week"},M={class:"dayheader text-gray-400 noselect"},D={class:"daylabel"},K={class:"badges"},H={class:"badge-bg text-gray-200"},O=["innerHTML"],_=["innerHTML"],z={class:"week-events"},W=["onClick"],R={class:"name noscrollbar"},A={class:"badges noscrollbar"},I={class:"badge-bg text-gray-200"},$=["innerHTML"],j={class:"content noscrollbar"},U={key:0,class:"time"},Z=["innerHTML"],J=["onClick"],q={class:"name noscrollbar"},P={key:0,class:"badges"},G={class:"badge-bg text-gray-200"},Q=["innerHTML"],X={class:"content noscrollbar"},Y={key:0,class:"time"},ee={key:1,class:"time"},te=["innerHTML"];const ne={props:["calendarViews"],emits:["set-active-view"],mounted:function(){var e=this;this.init(),Nova.addShortcut("alt+right",(function(t){e.nextMonth()})),Nova.addShortcut("alt+left",(function(t){e.prevMonth()})),Nova.addShortcut("alt+h",(function(t){e.reset()}))},methods:{reset:function(){this.month=null,this.year=null,this.week=null,this.reload()},init:function(){this.hasStoredSettings()?(this.restoreSettings(),this.reload(!1)):this.reload(!0)},prevMonth:function(){this.month-=1,this.reload()},nextMonth:function(){this.month+=1,this.reload()},chooseWeek:function(e){this.week=e,this.$emit("set-active-view","week")},reload:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;n.loading=!0;var r="/nova-vendor/wdelfuego/nova-calendar"+this.calendarUrl()+"/month?y="+n.year+"&m="+n.month;n.activeFilterKey?r+="&filter="+n.activeFilterKey:t&&(r+="&isInitRequest=1"),Nova.request().get(r).then((function(t){n.styles=t.data.styles,n.year=t.data.year,n.month=t.data.month,n.week=t.data.week,n.resetFiltersLabel=t.data.resetFiltersLabel,n.availableFilters=t.data.filters,n.activeFilterKey=t.data.activeFilterKey,n.shouldShowWeekNumbers=t.data.shouldShowWeekNumbers,n.title=t.data.title,n.columns=t.data.columns,n.weeks=t.data.weeks,e.setFilter(n.activeFilterKey),n.loading=!1,e.storeSettings()}))},open:function(e,t){e.metaKey||e.ctrlKey?window.open(Nova.url(t)):Nova.visit(t)},stylesForEvent:function(e){var t=this;if(e.options.styles){var n=[this.styles.default];return e.options.styles.forEach((function(e){void 0===t.styles[e]?console.log("[nova-calendar] Unknown custom style name '"+e+"'; does the eventStyles method of your CalendarDataProvider define it properly?"):n.push(t.styles[e])})),n}return this.styles.default},chooseFilter:function(e){this.setFilter(e),this.reload()},setFilter:function(e){for(var e in this.activeFilterKey=e,this.availableFilters)this.activeFilterKey==e&&(this.activeFilterLabel=this.availableFilters[e])},calendarUrl:function(){return window.location.pathname.substring(Nova.url("").length)},storageKey:function(){return"wdelfuego-nova-calendar-"+this.calendarUrl()},hasStoredSettings:function(){return null!==localStorage.getItem(this.storageKey())},storeSettings:function(){localStorage.setItem(this.storageKey(),JSON.stringify({year:this.year,month:this.month,week:this.week,activeFilterKey:this.activeFilterKey}))},restoreSettings:function(){var e=JSON.parse(localStorage.getItem(this.storageKey()));e&&(this.year=e.year,this.month=e.month,this.week=e.week,this.activeFilterKey=e.activeFilterKey)}},data:function(){return{loading:!0,resetFiltersLabel:"All events",availableFilters:{},activeFilterKey:null,activeFilterLabel:null,shouldShowWeekNumbers:!1,title:"",year:null,month:null,week:null,columns:Array(7).fill("-"),weeks:Array(6).fill(Array(7).fill({})),styles:{default:{color:"#fff","background-color":"rgba(var(--colors-primary-500), 0.9)"}}}},computed:{weekViewEnabled:function(){return this.calendarViews.includes("week")}}};var re=n(379),le=n.n(re),oe=n(100),ae={insert:"head",singleton:!1};le()(oe.Z,ae);oe.Z.locals;var ie=n(744);const se=(0,ie.Z)(ne,[["render",function(e,t,n,ne,re,le){var oe=this,ae=(0,r.resolveComponent)("Icon"),ie=(0,r.resolveComponent)("DropdownTrigger"),se=(0,r.resolveComponent)("ScrollWrap"),ce=(0,r.resolveComponent)("DropdownMenu"),de=(0,r.resolveComponent)("Dropdown"),ue=(0,r.resolveComponent)("Tooltip"),me=(0,r.resolveComponent)("Card");return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)("div",l,[(0,r.createElementVNode)("div",o,[(0,r.createElementVNode)("a",{onClick:t[0]||(t[0]=function(){return le.prevMonth&&le.prevMonth.apply(le,arguments)}),href:"#",class:"button hover:bg-gray-100 dark:hover:bg-gray-700",title:"Alt + ←"},a),(0,r.createElementVNode)("a",{onClick:t[1]||(t[1]=function(){return le.reset&&le.reset.apply(le,arguments)}),href:"#",class:"button hover:bg-gray-100 dark:hover:bg-gray-700",title:"Alt + H"},i),(0,r.createElementVNode)("a",{onClick:t[2]||(t[2]=function(){return le.nextMonth&&le.nextMonth.apply(le,arguments)}),href:"#",class:"button hover:bg-gray-100 dark:hover:bg-gray-700",title:"Alt + →"},s),(0,r.createElementVNode)("h1",{onClick:t[3]||(t[3]=function(){return le.reset&&le.reset.apply(le,arguments)}),class:"text-90 font-normal text-xl md:text-2xl noselect"},[(0,r.createElementVNode)("span",null,(0,r.toDisplayString)(e.$data.title),1)])]),c,(0,r.createElementVNode)("div",d,[Object.keys(re.availableFilters).length?((0,r.openBlock)(),(0,r.createBlock)(de,{key:0,"handle-internal-clicks":!0,class:(0,r.normalizeClass)([{"bg-primary-500 hover:bg-primary-600 border-primary-500":null!=re.activeFilterKey,"dark:bg-primary-500 dark:hover:bg-primary-600 dark:border-primary-500":null!=re.activeFilterKey},"flex h-9 hover:bg-gray-100 dark:hover:bg-gray-700 rounded"]),dusk:"filter-selector"},{menu:(0,r.withCtx)((function(){return[(0,r.createVNode)(ce,{width:"260"},{default:(0,r.withCtx)((function(){return[(0,r.createVNode)(se,{height:350,class:"bg-white dark:bg-gray-900"},{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",m,[null!=re.activeFilterKey?((0,r.openBlock)(),(0,r.createElementBlock)("div",g,[(0,r.createElementVNode)("button",{class:"py-2 w-full block tracking-wide text-center text-gray-500 dark:bg-gray-800 dark:hover:bg-gray-700 focus:outline-none",onClick:t[4]||(t[4]=function(e){return le.chooseFilter(null)}),innerHTML:e.$data.resetFiltersLabel},null,8,h)])):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.availableFilters,(function(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)("button",{class:(0,r.normalizeClass)(["py-2 w-full block dark:bg-gray-800 dark:hover:bg-gray-700 hover:bg-gray-200",{"font-bold":re.activeFilterKey==t}]),innerHTML:e,onClick:function(e){return le.chooseFilter(t)}},null,10,v)})),256))])],512)]})),_:1})]})),_:1})]})),default:(0,r.withCtx)((function(){return[(0,r.createVNode)(ie,{class:(0,r.normalizeClass)([{"text-white hover:text-white dark:text-gray-800 dark:hover:text-gray-800":null!=re.activeFilterKey},"toolbar-button px-2"])},{default:(0,r.withCtx)((function(){return[(0,r.createVNode)(ae,{type:"filter"}),null!=re.activeFilterKey?((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:0,class:(0,r.normalizeClass)([{"text-white dark:text-gray-800":null!=re.activeFilterKey},"ml-2 font-bold"]),innerHTML:re.activeFilterLabel},null,10,u)):(0,r.createCommentVNode)("",!0)]})),_:1},8,["class"])]})),_:1},8,["class"])):(0,r.createCommentVNode)("",!0),n.calendarViews.length>1?((0,r.openBlock)(),(0,r.createElementBlock)("div",k,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.calendarViews,(function(t){return(0,r.openBlock)(),(0,r.createElementBlock)("a",{href:"#",onClick:function(n){return e.$emit("set-active-view",t)},class:(0,r.normalizeClass)(["button hover:bg-gray-100 dark:hover:bg-gray-700 ml-2",[{"bg-primary-500 text-white":"month"===t}]])},[(0,r.createElementVNode)("span",p,(0,r.toDisplayString)(e.__(t)),1)],10,y)})),256))])):(0,r.createCommentVNode)("",!0)])]),(0,r.createElementVNode)("div",f,[(0,r.createVNode)(me,{class:"flex flex-col items-center justify-center dark:bg-gray-800",style:{"min-height":"300px","min-width":"800px","background-color":"var(--bg-gray-800)"}},{default:(0,r.withCtx)((function(){return[re.title.length?((0,r.openBlock)(),(0,r.createElementBlock)("div",w,[(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)({shouldShowWeekNumbers:re.shouldShowWeekNumbers})},[re.shouldShowWeekNumbers?((0,r.openBlock)(),(0,r.createElementBlock)("div",b)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",E,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.columns,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",B,[(0,r.createElementVNode)("span",null,(0,r.toDisplayString)(e),1)])})),256))])],2),(0,r.createElementVNode)("div",N,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.weeks,(function(t,n){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)({shouldShowWeekNumbers:re.shouldShowWeekNumbers})},[re.shouldShowWeekNumbers?((0,r.openBlock)(),(0,r.createElementBlock)("div",V,[oe.weekViewEnabled?((0,r.openBlock)(),(0,r.createElementBlock)("a",{key:0,href:"#",onClick:function(e){return le.chooseWeek(t.number)}},[(0,r.createElementVNode)("div",F,[(0,r.createElementVNode)("div",S,(0,r.toDisplayString)(e.__("W"))+(0,r.toDisplayString)(t.number),1)])],8,C)):((0,r.openBlock)(),(0,r.createElementBlock)("div",x,[(0,r.createElementVNode)("div",T,(0,r.toDisplayString)(e.__("W"))+(0,r.toDisplayString)(t.number),1)]))])):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",L,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.days,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["day dark:bg-gray-900 dark:border-gray-800",["nc-col-"+e.weekdayColumn],{withinRange:e.isWithinRange,today:e.isToday}])},[(0,r.createElementVNode)("div",M,[(0,r.createElementVNode)("span",D,(0,r.toDisplayString)(e.label),1),(0,r.createElementVNode)("div",K,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",H,[(0,r.createVNode)(ue,null,{content:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{innerHTML:e.tooltip},null,8,O)]})),default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e.badge},null,8,_)]})),_:2},1024)])})),256))])])],2)})),256)),(0,r.createElementVNode)("div",z,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.days,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.eventsMultiDay,(function(t){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)([["nc-event","multi","nc-col-"+e.weekdayColumn,"span-"+t.spansDaysN],{clickable:t.url,starts:t.startsEvent,ends:t.endsEvent,withinRange:t.isWithinRange}]),onClick:function(e){return le.open(e,t.url)},style:(0,r.normalizeStyle)(oe.stylesForEvent(t))},[(0,r.createElementVNode)("div",R,(0,r.toDisplayString)(t.name),1),(0,r.createElementVNode)("div",A,[t.startsEvent?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)(t.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",I,[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e},null,8,$)])})),256)):(0,r.createCommentVNode)("",!0)]),(0,r.createElementVNode)("div",j,[t.startsEvent&&t.options.displayTime?((0,r.openBlock)(),(0,r.createElementBlock)("span",U,(0,r.toDisplayString)(t.startTime),1)):(0,r.createCommentVNode)("",!0),t.startsEvent?((0,r.openBlock)(),(0,r.createElementBlock)("span",{key:1,class:"notes",innerHTML:t.notes},null,8,Z)):(0,r.createCommentVNode)("",!0)])],14,W)})),256))],64)})),256)),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.days,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["single-day-events","nc-col-"+e.weekdayColumn])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.eventsSingleDay,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)([["nc-event"],{clickable:e.url,starts:e.startsEvent,ends:e.endsEvent,withinRange:e.isWithinRange}]),onClick:function(t){return le.open(t,e.url)},style:(0,r.normalizeStyle)(oe.stylesForEvent(e))},[(0,r.createElementVNode)("div",q,(0,r.toDisplayString)(e.name),1),e.badges.length>0?((0,r.openBlock)(),(0,r.createElementBlock)("div",P,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",G,[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e},null,8,Q)])})),256))])):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("div",X,[e.options.displayTime?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[e.endTime?((0,r.openBlock)(),(0,r.createElementBlock)("span",Y,(0,r.toDisplayString)(e.startTime)+" - "+(0,r.toDisplayString)(e.endTime),1)):((0,r.openBlock)(),(0,r.createElementBlock)("span",ee,(0,r.toDisplayString)(e.startTime),1))],64)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("span",{class:"notes",innerHTML:e.notes},null,8,te)])],14,J)})),256))],2)})),256))])])],2)})),256))])])):(0,r.createCommentVNode)("",!0)]})),_:1})])],64)}]]);var ce={id:"nc-control"},de={class:"left-items"},ue=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11 19l-7-7 7-7m8 14l-7-7 7-7"})],-1)],me=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"})],-1)],ge=[(0,r.createElementVNode)("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[(0,r.createElementVNode)("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13 5l7 7-7 7M5 5l7 7-7 7"})],-1)],he=(0,r.createElementVNode)("div",{class:"center-items"},null,-1),ve={class:"right-items"},ke=["innerHTML"],ye={ref:"theForm",class:"divide-y divide-gray-200 dark:divide-gray-800 divide-solid"},pe={key:0,class:"bg-gray-100"},fe=["innerHTML"],we=["innerHTML","onClick"],be={key:1},Ee=["onClick"],Be={class:"font-bold capitalize"},Ne={style:{width:"100%",overflow:"scroll"}},Ve={class:"nova-calendar week-view noselect"},Ce={class:"nc-header"},Fe={class:"border-gray-200 dark:border-gray-900 dark:text-gray-300 nc-col-0"},Se={class:"week"},xe={class:"week-events"},Te={class:"rotated dark:bg-gray-900 nc-col-0"},Le={class:"rotated-header text-gray-400 noselect relative"},Me={class:"rotated-label dark:bg-gray-900 nc-col-0"},De={class:"dayheader text-gray-400 noselect"},Ke={class:"daylabel"},He={class:"badges noscrollbar"},Oe={class:"badge-bg text-gray-200"},_e=["innerHTML"],ze=["innerHTML"],We={key:1,class:"dayheader text-gray-400 noselect"},Re={class:"daylabel"},Ae={class:"badges"},Ie={class:"badge-bg text-gray-200"},$e=["innerHTML"],je=["innerHTML"],Ue=["onClick"],Ze={class:"name noscrollbar"},Je={class:"badges noscrollbar"},qe={class:"badge-bg text-gray-200"},Pe=["innerHTML"],Ge={class:"content noscrollbar"},Qe={key:0,class:"time"},Xe={class:"notes"},Ye={key:0},et=["onClick"],tt={class:"name noscrollbar"},nt={class:"badges"},rt={class:"badge-bg text-gray-200"},lt=["innerHTML"],ot={class:"content noscrollbar"},at={key:0,class:"time"},it={key:1,class:"time"},st={class:"notes"};const ct={props:["calendarViews"],emits:["set-active-view"],mounted:function(){var e=this;this.init(),Nova.addShortcut("alt+right",(function(t){e.nextWeek()})),Nova.addShortcut("alt+left",(function(t){e.prevWeek()})),Nova.addShortcut("alt+h",(function(t){e.reset()}))},methods:{reset:function(){this.year=null,this.month=null,this.week=null,this.reload()},init:function(){this.hasStoredSettings()?(this.restoreSettings(),this.reload(!1)):this.reload(!0)},prevWeek:function(){this.week-=1,this.reload()},nextWeek:function(){this.week+=1,this.reload()},reload:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;n.loading=!0;var r="/nova-vendor/wdelfuego/nova-calendar"+this.calendarUrl()+"/week?y="+n.year+"&w="+n.week;n.activeFilterKey?r+="&filter="+n.activeFilterKey:t&&(r+="&isInitRequest=1"),Nova.request().get(r).then((function(t){n.styles=t.data.styles,n.year=t.data.year,n.month=t.data.month,n.week=t.data.week,n.resetFiltersLabel=t.data.resetFiltersLabel,n.availableFilters=t.data.filters,n.activeFilterKey=t.data.activeFilterKey,n.shouldShowWeekNumbers=t.data.shouldShowWeekNumbers,n.title=t.data.title,n.columns=t.data.columns,n.layout=t.data.layout,n.weekData=t.data.weekData,n.timeline=t.data.timeline,e.setFilter(n.activeFilterKey),n.loading=!1,e.storeSettings()}))},open:function(e,t){e.metaKey||e.ctrlKey?window.open(Nova.url(t)):Nova.visit(t)},stylesForEvent:function(e){var t=this;if(e.options.styles){var n=[this.styles.default];return e.options.styles.forEach((function(e){void 0===t.styles[e]?console.log("[nova-calendar] Unknown custom style name '"+e+"'; does the eventStyles method of your CalendarDataProvider define it properly?"):n.push(t.styles[e])})),n}return this.styles.default},chooseFilter:function(e){this.setFilter(e),this.reload()},setFilter:function(e){for(var e in this.activeFilterKey=e,this.availableFilters)this.activeFilterKey==e&&(this.activeFilterLabel=this.availableFilters[e])},calendarUrl:function(){return window.location.pathname.substring(Nova.url("").length)},storageKey:function(){return"wdelfuego-nova-calendar-"+this.calendarUrl()},hasStoredSettings:function(){return null!==localStorage.getItem(this.storageKey())},storeSettings:function(){localStorage.setItem(this.storageKey(),JSON.stringify({year:this.year,month:this.month,week:this.week,activeFilterKey:this.activeFilterKey}))},restoreSettings:function(){var e=JSON.parse(localStorage.getItem(this.storageKey()));e&&(this.year=e.year,this.month=e.month,this.week=e.week,this.activeFilterKey=e.activeFilterKey)},minuteForTime:function(e,t){return 60*e+t},rowForTime:function(e,t){return Math.round(this.minuteForTime(e,t)/10)-this.morningOffsetRow+1},eventStartRow:function(e,t){var n=this.rowForTime(e,t);return n<1?1:n>this.gridRows-2?this.gridRows-2:n},eventEndRow:function(e,t){var n=this.rowForTime(e,t);return n<3?3:n>this.gridRows?-1:n},withinTimeline:function(e,t){return this.minuteForTime(e,t)>=this.openingMinute&&this.minuteForTime(e,t)<=this.closingMinute},withinView:function(e,t){return this.minuteForTime(e,t)>this.morningOffset&&this.minuteForTime(e,t)=this.morningOffset&&n1?((0,r.openBlock)(),(0,r.createElementBlock)("div",be,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.calendarViews,(function(t){return(0,r.openBlock)(),(0,r.createElementBlock)("a",{href:"#",onClick:function(n){return e.$emit("set-active-view",t)},class:(0,r.normalizeClass)(["button hover:bg-gray-100 dark:hover:bg-gray-700 ml-2",[{"bg-primary-500 text-white":"week"===t}]])},[(0,r.createElementVNode)("span",Be,(0,r.toDisplayString)(e.__(t)),1)],10,Ee)})),256))])):(0,r.createCommentVNode)("",!0)])]),(0,r.createElementVNode)("div",Ne,[(0,r.createVNode)(h,{class:"flex flex-col items-center justify-center dark:bg-gray-800",style:{"min-height":"100px","min-width":"800px","background-color":"var(--bg-gray-800)"}},{default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("div",Ve,[(0,r.createElementVNode)("div",Ce,[(0,r.createElementVNode)("div",Fe,[(0,r.createElementVNode)("span",null,(0,r.toDisplayString)(e.__("W"))+(0,r.toDisplayString)(i.week),1)]),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.columns,(function(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["border-gray-200 dark:border-gray-900 dark:text-gray-300",["nc-col-"+(t+1)]])},[(0,r.createElementVNode)("span",null,(0,r.toDisplayString)(e),1)],2)})),256))]),(0,r.createElementVNode)("div",Se,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.weekData,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)(["day multi dark:border-gray-800 withinRange",["nc-col-"+e.weekdayColumn],{today:e.isToday}])},null,2)})),256)),(0,r.createElementVNode)("div",xe,[(0,r.createElementVNode)("div",Te,[(0,r.createElementVNode)("div",Le,[(0,r.createElementVNode)("div",Me,(0,r.toDisplayString)(e.__("All day")),1)])]),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.weekData,(function(n){return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)([["nc-col-"+n.weekdayColumn],{today:n.isToday}])},[i.dayViewEnabled?((0,r.openBlock)(),(0,r.createElementBlock)("button",{key:0,onClick:t[5]||(t[5]=function(t){return e.$emit("set-active-view","day")})},[(0,r.createElementVNode)("div",De,[(0,r.createElementVNode)("span",Ke,(0,r.toDisplayString)(n.label),1),(0,r.createElementVNode)("div",He,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",Oe,[(0,r.createVNode)(g,null,{content:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{innerHTML:e.tooltip},null,8,_e)]})),default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e.badge},null,8,ze)]})),_:2},1024)])})),256))])])])):((0,r.openBlock)(),(0,r.createElementBlock)("div",We,[(0,r.createElementVNode)("span",Re,(0,r.toDisplayString)(n.label),1),(0,r.createElementVNode)("div",Ae,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",Ie,[(0,r.createVNode)(g,null,{content:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{innerHTML:e.tooltip},null,8,$e)]})),default:(0,r.withCtx)((function(){return[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e.badge},null,8,je)]})),_:2},1024)])})),256))])]))],2),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(n.eventsMultiDay,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)([["nc-event","multi","nc-col-"+n.weekdayColumn,"span-"+e.spansDaysN],{clickable:e.url,starts:e.startsEvent,ends:e.endsEvent,withinRange:e.isWithinRange}]),onClick:function(t){return a.open(t,e.url)},style:(0,r.normalizeStyle)(i.stylesForEvent(e))},[(0,r.createElementVNode)("div",Ze,(0,r.toDisplayString)(e.name),1),(0,r.createElementVNode)("div",Je,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",qe,[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e},null,8,Pe)])})),256))]),(0,r.createElementVNode)("div",Ge,[e.options.displayTime?((0,r.openBlock)(),(0,r.createElementBlock)("span",Qe,(0,r.toDisplayString)(e.startDate)+" "+(0,r.toDisplayString)(e.startTime),1)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("span",Xe,(0,r.toDisplayString)(e.notes),1)])],14,Ue)})),256))],64)})),256))])]),(0,r.createElementVNode)("div",{class:"week",style:(0,r.normalizeStyle)(["grid-template-rows: repeat("+i.gridRows+", 10px);"])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.timeline,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[a.slotIsShown(e.hour,e.minute)?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:"hour-label dark:bg-gray-900 dark:border-gray-800 nc-col-0",style:(0,r.normalizeStyle)(["grid-row: "+a.rowForTime(e.hour,e.minute)+" / "+a.rowForTime(e.hour,e.minute+i.layout.timelineInterval)+";"])},[a.withinTimeline(e.hour,e.minute)?((0,r.openBlock)(),(0,r.createElementBlock)("div",Ye,(0,r.toDisplayString)(e.hour_minute),1)):(0,r.createCommentVNode)("",!0)],4)):(0,r.createCommentVNode)("",!0)],64)})),256)),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.weekData,(function(t){return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.$data.timeline,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[a.slotIsShown(e.hour,e.minute)?((0,r.openBlock)(),(0,r.createElementBlock)("div",{key:0,class:(0,r.normalizeClass)(["slot dark:border-gray-800 dark:bg-gray-900",["nc-col-"+t.weekdayColumn],{withinRange:e.is_open}]),style:(0,r.normalizeStyle)(["grid-row: "+a.rowForTime(e.hour,e.minute)+" / "+a.rowForTime(e.hour,e.minute+i.layout.timelineInterval)+";"])},null,6)):(0,r.createCommentVNode)("",!0)],64)})),256)),(0,r.createElementVNode)("div",{class:(0,r.normalizeClass)(["nc-col-"+t.weekdayColumn]),style:(0,r.normalizeStyle)(["grid-row: 1 / span "+i.gridRows+";","display: grid;","grid-template-rows: repeat("+i.gridRows+", 10px);"])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.eventsSingleDay,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("div",{class:(0,r.normalizeClass)([["nc-event"],{clickable:e.url,starts:a.withinView(e.startHour,e.startMinute),ends:a.withinView(e.startHour,e.startMinute+e.durationInMinutes),withinRange:e.isWithinRange}]),onClick:function(t){return a.open(t,e.url)},style:(0,r.normalizeStyle)([i.stylesForEvent(e),"grid-row-start: "+a.eventStartRow(e.startHour,e.startMinute)+";","grid-row-end: "+a.eventEndRow(e.startHour,e.startMinute+e.durationInMinutes)+";"])},[(0,r.createElementVNode)("div",tt,(0,r.toDisplayString)(e.name),1),(0,r.createElementVNode)("div",nt,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.badges,(function(e){return(0,r.openBlock)(),(0,r.createElementBlock)("span",rt,[(0,r.createElementVNode)("span",{class:"badge",innerHTML:e},null,8,lt)])})),256))]),(0,r.createElementVNode)("div",ot,[e.options.displayTime?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[e.endTime?((0,r.openBlock)(),(0,r.createElementBlock)("span",at,(0,r.toDisplayString)(e.startTime)+"-"+(0,r.toDisplayString)(e.endTime),1)):((0,r.openBlock)(),(0,r.createElementBlock)("span",it,(0,r.toDisplayString)(e.startTime),1))],64)):(0,r.createCommentVNode)("",!0),(0,r.createElementVNode)("span",st,(0,r.toDisplayString)(e.notes),1)])],14,et)})),256))],6)],64)})),256))],4)])]})),_:1})])],64)}]])},data:function(){return{loading:!0,calendarViews:Array(),windowTitle:"",activeView:null}},mounted:function(){this.init()},methods:{init:function(){this.hasStoredSettings()?(this.restoreSettings(),this.reload(!1)):this.reload(!0)},reload:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],n=this;n.loading=!0;var r="/nova-vendor/wdelfuego/nova-calendar"+this.calendarUrl()+"/calendar-views/";Nova.request().get(r).then((function(r){n.calendarViews=r.data.calendar_views,n.windowTitle=r.data.windowTitle,t?e.setActiveView(n.calendarViews[0]):e.setActiveView(e.activeView),n.loading=!1}))},setActiveView:function(e){this.activeView=e,this.storeSettings()},calendarUrl:function(){return window.location.pathname.substring(Nova.url("").length)},storageKey:function(){return"wdelfuego-nova-calendar-"+this.calendarUrl()+"-views"},hasStoredSettings:function(){return null!==localStorage.getItem(this.storageKey())},storeSettings:function(){localStorage.setItem(this.storageKey(),JSON.stringify({activeView:this.activeView}))},restoreSettings:function(){var e=JSON.parse(localStorage.getItem(this.storageKey()));e&&(this.activeView=e.activeView)}}};var gt=n(195),ht={insert:"head",singleton:!1};le()(gt.Z,ht);gt.Z.locals;const vt=(0,ie.Z)(mt,[["render",function(e,t,n,l,o,a){var i=(0,r.resolveComponent)("Head"),s=(0,r.resolveComponent)("LoadingView");return(0,r.openBlock)(),(0,r.createBlock)(s,{loading:o.loading},{default:(0,r.withCtx)((function(){return[(0,r.createVNode)(i,{title:e.$data.windowTitle},null,8,["title"]),((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(o.activeView),{"calendar-views":o.calendarViews,onSetActiveView:a.setActiveView},null,40,["calendar-views","onSetActiveView"]))]})),_:1},8,["loading"])}]]);Nova.booting((function(e,t){Nova.inertia("NovaCalendar",vt)}))},100:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(645),l=n.n(r)()((function(e){return e[1]}));l.push([e.id,"",""]);const o=l},188:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(645),l=n.n(r)()((function(e){return e[1]}));l.push([e.id,"",""]);const o=l},195:(e,t,n)=>{n.d(t,{Z:()=>o});var r=n(645),l=n.n(r)()((function(e){return e[1]}));l.push([e.id,"",""]);const o=l},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n=e(t);return t[2]?"@media ".concat(t[2]," {").concat(n,"}"):n})).join("")},t.i=function(e,n,r){"string"==typeof e&&(e=[[null,e,""]]);var l={};if(r)for(var o=0;o{},379:(e,t,n)=>{var r,l=function(){return void 0===r&&(r=Boolean(window&&document&&document.all&&!window.atob)),r},o=function(){var e={};return function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}e[t]=n}return e[t]}}(),a=[];function i(e){for(var t=-1,n=0;n{t.Z=(e,t)=>{const n=e.__vccOpts||e;for(const[e,r]of t)n[e]=r;return n}}},n={};function r(e){var l=n[e];if(void 0!==l)return l.exports;var o=n[e]={id:e,exports:{}};return t[e](o,o.exports,r),o.exports}r.m=t,e=[],r.O=(t,n,l,o)=>{if(!n){var a=1/0;for(d=0;d=o)&&Object.keys(r.O).every((e=>r.O[e](n[s])))?n.splice(s--,1):(i=!1,o0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,l,o]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={103:0,990:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var l,o,[a,i,s]=n,c=0;if(a.some((t=>0!==e[t]))){for(l in i)r.o(i,l)&&(r.m[l]=i[l]);if(s)var d=s(r)}for(t&&t(n);cr(335)));var l=r.O(void 0,[990],(()=>r(762)));l=r.O(l)})(); \ No newline at end of file diff --git a/docs/customizing-the-calendar.md b/docs/customizing-the-calendar.md index 6a01c17..fa27027 100644 --- a/docs/customizing-the-calendar.md +++ b/docs/customizing-the-calendar.md @@ -55,7 +55,7 @@ You can add tooltips to calendar day badges to show more details to the user. Simply supply a second string argument to the `addBadge` method: ```php -protected function customizeCalendarDay(CalendarDay $day) : CalendarDay +public function customizeCalendarDay(CalendarDay $day) : CalendarDay { if($day->start->format('d') % 2 == 0) { diff --git a/resources/css/tool.css b/resources/css/tool.css index 0ab680b..fc22647 100644 --- a/resources/css/tool.css +++ b/resources/css/tool.css @@ -23,7 +23,7 @@ --nc-highlight-border: rgba(var(--colors-primary-500), 0.4); --nc-weekend-border: rgba(var(--colors-gray-500), 0.2); --nc-weekend-bg: rgba(var(--colors-gray-900), 0); - --nc-event-height-multi-day: 2.2em; + --nc-event-height-multi-day: 2em; --nc-event-border: rgba(10, 10, 10, 0.3); --nc-event-border-radius: 7px; } @@ -108,12 +108,6 @@ div.nova-calendar { width: 100%; } -div.nova-calendar div.nc-header { - display: grid; - width: 100%; - grid-template-columns: repeat(7, 1fr); -} - div.nova-calendar div.nc-header div { padding: 0.6em 0.6em 0.5em 0.6em; text-align: left; @@ -121,28 +115,150 @@ div.nova-calendar div.nc-header div { word-break: break-all; } -div.nova-calendar .week { +/* + * Month View + */ + +div.nova-calendar.month-view div.nc-header { + display: grid; + width: 100%; + grid-template-columns: repeat(7, 1fr); +} + +div.nova-calendar.month-view .week { width: 100%; display: grid; grid-template-columns: repeat(7, 1fr); } -div.nova-calendar .nc-col-1 { grid-column: 1 / 2; } -div.nova-calendar .nc-col-2 { grid-column: 2 / 3; } -div.nova-calendar .nc-col-3 { grid-column: 3 / 4; } -div.nova-calendar .nc-col-4 { grid-column: 4 / 5; } -div.nova-calendar .nc-col-5 { grid-column: 5 / 6; } -div.nova-calendar .nc-col-6 { grid-column: 6 / 7; } -div.nova-calendar .nc-col-7 { grid-column: 7 / -1; } +div.nova-calendar.month-view .nc-col-1 { grid-column: 1 / 2; } +div.nova-calendar.month-view .nc-col-2 { grid-column: 2 / 3; } +div.nova-calendar.month-view .nc-col-3 { grid-column: 3 / 4; } +div.nova-calendar.month-view .nc-col-4 { grid-column: 4 / 5; } +div.nova-calendar.month-view .nc-col-5 { grid-column: 5 / 6; } +div.nova-calendar.month-view .nc-col-6 { grid-column: 6 / 7; } +div.nova-calendar.month-view .nc-col-7 { grid-column: 7 / -1; } + +div.nova-calendar.month-view .nc-event.multi.span-1 { grid-column-end: span 1; } +div.nova-calendar.month-view .nc-event.multi.span-2 { grid-column-end: span 2; } +div.nova-calendar.month-view .nc-event.multi.span-3 { grid-column-end: span 3; } +div.nova-calendar.month-view .nc-event.multi.span-4 { grid-column-end: span 4; } +div.nova-calendar.month-view .nc-event.multi.span-5 { grid-column-end: span 5; } +div.nova-calendar.month-view .nc-event.multi.span-6 { grid-column-end: span 6; } +div.nova-calendar.month-view .nc-event.multi.span-7 { grid-column-end: span 7; } + +div.nova-calendar.month-view .shouldShowWeekNumbers { + width: 100%; + display: grid; + grid-template-columns: 2em 1fr; +} + +div.nova-calendar.month-view .weeknumber { + z-index: 0; + grid-row: 1/-1; + border-width: 0.5px; + border-color: rgba(var(--colors-gray-500), 0.15); +} + +div.nova-calendar.month-view .weeknumberheader { + z-index: 1; +} + +div.nova-calendar.month-view .weeknumberlabel { + font-size: 8pt; + transform-origin: 75% 80%; + transform: rotate(270deg); +} + +div.nova-calendar.month-view .week-events { + z-index: 2; + margin-top: 2.2em; + grid-column: 1 / -1; + grid-row: 1; + display: grid; + grid-template-columns: repeat(7, 1fr); + grid-auto-flow: column dense; +} + +/* + * Week View + */ + +div.nova-calendar.week-view .week { + width: 100%; + display: grid; + grid-template-columns: 4em repeat(7, 1fr); +} + +div.nova-calendar.week-view div.nc-header { + display: grid; + grid-row: 1 / 2; + width: 100%; + grid-template-columns: 4em repeat(7, 1fr); +} + +div.nova-calendar.week-view .nc-col-0 { grid-column: 1 / 2; } +div.nova-calendar.week-view .nc-col-1 { grid-column: 2 / 3; } +div.nova-calendar.week-view .nc-col-2 { grid-column: 3 / 4; } +div.nova-calendar.week-view .nc-col-3 { grid-column: 4 / 5; } +div.nova-calendar.week-view .nc-col-4 { grid-column: 5 / 6; } +div.nova-calendar.week-view .nc-col-5 { grid-column: 6 / 7; } +div.nova-calendar.week-view .nc-col-6 { grid-column: 7 / 8; } +div.nova-calendar.week-view .nc-col-7 { grid-column: 8 / -1; } + +div.nova-calendar.week-view .nc-event.multi.span-1 { grid-column-end: span 1; } +div.nova-calendar.week-view .nc-event.multi.span-2 { grid-column-end: span 2; } +div.nova-calendar.week-view .nc-event.multi.span-3 { grid-column-end: span 3; } +div.nova-calendar.week-view .nc-event.multi.span-4 { grid-column-end: span 4; } +div.nova-calendar.week-view .nc-event.multi.span-5 { grid-column-end: span 5; } +div.nova-calendar.week-view .nc-event.multi.span-6 { grid-column-end: span 6; } +div.nova-calendar.week-view .nc-event.multi.span-7 { grid-column-end: span 7; } +div.nova-calendar.week-view .nc-event.multi.span-8 { grid-column-end: span 8; } + +div.nova-calendar.week-view .rotated { + z-index: 0; + + border-color: rgba(var(--colors-gray-500), 0.15); +} + +div.nova-calendar.week-view .rotated-header { + z-index: 1; +} -div.nova-calendar .nc-event.multi.span-1 { grid-column-end: span 1; } -div.nova-calendar .nc-event.multi.span-2 { grid-column-end: span 2; } -div.nova-calendar .nc-event.multi.span-3 { grid-column-end: span 3; } -div.nova-calendar .nc-event.multi.span-4 { grid-column-end: span 4; } -div.nova-calendar .nc-event.multi.span-5 { grid-column-end: span 5; } -div.nova-calendar .nc-event.multi.span-6 { grid-column-end: span 6; } -div.nova-calendar .nc-event.multi.span-7 { grid-column-end: span 7; } +div.nova-calendar.week-view .rotated-label { + font-size: 8pt; + transform-origin: 75% 80%; + transform: rotate(270deg); +} + +div.nova-calendar.week-view .hour-label { + font-size: 0.6rem; + opacity: 0.84; + text-align: right; + border: none; + padding-right: 0.5rem; +} + +div.nova-calendar.week-view .hour-label div { + margin-top: -1em; +} + +div.nova-calendar.week-view .day-events-container { + grid-column: 2; + display: grid; + grid-template-rows: 1fr auto; +} +div.nova-calendar.week-view .week-events { + z-index: 0; + margin-top: 0; + min-height: 6em; + grid-column: 1 / -1; + grid-row: 2; + display: grid; + grid-template-columns: 4em repeat(7, 1fr); + grid-auto-flow: column dense; +} /* * Day cells @@ -156,6 +272,11 @@ div.nova-calendar .day { border-color: rgba(var(--colors-gray-500), 0.15); } +div.nova-calendar .day.multi { + border-bottom: none; + min-height: 0; +} + div.nova-calendar .day:not(.withinRange) { opacity: 0.5; background: repeating-linear-gradient( @@ -181,7 +302,7 @@ div.nova-calendar .day .dayheader .daylabel { opacity: 0.84; } -div.nova-calendar .day.today .dayheader .daylabel { +div.nova-calendar .today .dayheader .daylabel { font-size: 10pt; font-weight: bold; opacity: 1.0; @@ -190,6 +311,31 @@ div.nova-calendar .day.today .dayheader .daylabel { border-radius: 100%; } +/* + * Hour cells + */ + +div.nova-calendar .slot { + border-width: 0.5px; + border-color: rgba(var(--colors-gray-500), 0.15); +} + +div.nova-calendar .slot:not(.withinRange) { + opacity: 0.5; + background: repeating-linear-gradient( + -45deg, + rgba(225,225,255, 0.1), + rgba(225,225,255, 0.1) 4px, + rgba(100,100,100, 0.1) 4px, + rgba(100,100,100, 0.1) 6px + ); +} + +div.nova-calendar .day-events-container { + grid-column: 2; + display: grid; + grid-template-rows: 1fr auto; +} /* * Day Badges @@ -213,16 +359,6 @@ div.nova-calendar .dayheader span.badge { * Events, general */ -div.nova-calendar .week-events { - z-index: 2; - margin-top: 2.2em; - grid-column: 1 / -1; - grid-row: 1; - display: grid; - grid-template-columns: repeat(7, 1fr); - grid-auto-flow: column dense; -} - div.nova-calendar .single-day-events { border: 0px #f00 solid; grid-row-start: span 9000; @@ -230,14 +366,14 @@ div.nova-calendar .single-day-events { margin-bottom: 1em; } -div.nova-calendar .nc-event { + div.nova-calendar .nc-event { transition: opacity 0.25s; opacity: 0.92; overflow: hidden; display: grid; grid-template-columns: 1fr auto; - grid-template-rows: auto auto; - align-items: center; + grid-template-rows: max-content auto; + align-items: start; min-height: var(--nc-event-height-multi-day); margin: 0.1em 0.1em; padding: 0.2em; @@ -254,20 +390,76 @@ div.nova-calendar .nc-event:hover { opacity: 1.0; } -div.nova-calendar .nc-event.starts { +div.nova-calendar div.nc-event.clickable { + cursor: pointer; +} + +/* + * Event content - month view + */ + +div.nova-calendar.month-view .nc-event.starts { border-top-left-radius: var(--nc-event-border-radius); border-bottom-left-radius: var(--nc-event-border-radius); } -div.nova-calendar .nc-event.ends { +div.nova-calendar.month-view .nc-event.ends { border-top-right-radius: var(--nc-event-border-radius); border-bottom-right-radius: var(--nc-event-border-radius); } -div.nova-calendar div.nc-event.clickable { - cursor: pointer; +/* + * Event content - week view + */ + +div.nova-calendar.week-view .nc-event.starts { + border-top-left-radius: var(--nc-event-border-radius); + border-top-right-radius: var(--nc-event-border-radius); +} + +div.nova-calendar.week-view .nc-event.ends { + border-bottom-left-radius: var(--nc-event-border-radius); + border-bottom-right-radius: var(--nc-event-border-radius); } +div.nova-calendar.week-view .nc-event:not(.starts):not(.ends) { + border-top-left-radius: var(--nc-event-border-radius); + border-top-right-radius: var(--nc-event-border-radius); + border-bottom-left-radius: var(--nc-event-border-radius); + border-bottom-right-radius: var(--nc-event-border-radius); +} + +div.nova-calendar.week-view .nc-event:not(.starts):not(.ends) div.name { + font-weight: normal; + font-size: 9pt; + opacity: 0.8; + padding-top: 0.1em; +} + +/* + * Event content + */ + +div.nova-calendar .nc-event div.content { + grid-row: 2 / 3; + grid-column: 1 / span 2; + align-items: start; + overflow: scroll; + border: 0px #f00 dashed; + padding-left: 0.2em; +} + +div.nova-calendar div.nc-event span.time { + display: inline-block; + font-size: 9pt; + opacity: 0.8; + margin-right: 0.2em; +} + +div.nova-calendar div.nc-event span.notes { + font-size: 9pt; + line-height: 10pt; +} /* * Events, single day @@ -284,7 +476,7 @@ div.nova-calendar div.nc-event div.name { margin-left: 0.2em; } -div.nova-calendar div.nc-event:not(.starts) div.name { +div.nova-calendar .week.events div.nc-event:not(.starts) div.name { font-weight: normal; font-size: 9pt; opacity: 0.8; @@ -324,31 +516,6 @@ div.nova-calendar div.nc-event div.badges span.badge { } -/* - * Event content - */ - -div.nova-calendar .nc-event div.content { - grid-row: 2 / 3; - grid-column: 1 / span 2; - overflow: scroll; - border: 0px #f00 dashed; - padding-left: 0.2em; -} - -div.nova-calendar div.nc-event span.time { - display: inline-block; - font-size: 9pt; - opacity: 0.8; - margin-right: 0.2em; -} - -div.nova-calendar div.nc-event span.notes { - font-size: 9pt; - line-height: 10pt; -} - - /* * Events, multi day */ @@ -361,15 +528,6 @@ div.nova-calendar .nc-event.multi { grid-template-rows: auto; } -div.nova-calendar .nc-event:not(.starts) { - border-left: 1px rgba(228,228,228,0.6) dashed; - opacity: 0.8; -} - -div.nova-calendar .nc-event:not(.ends) { - border-right: 1px rgba(228,228,228,0.6) dashed; -} - div.nova-calendar div.nc-event.multi div.name { white-space: nowrap; overflow: scroll; @@ -389,4 +547,29 @@ div.nova-calendar div.nc-event.multi div.content { overflow: scroll; grid-row: 1 / -1; grid-column: 2 / 3; -} \ No newline at end of file +} + +/* + * Events, multi day - month view + */ + +div.nova-calendar.month-view .nc-event:not(.starts) { + border-left: 1px rgba(228,228,228,0.6) dashed; + opacity: 0.8; +} + +div.nova-calendar.month-view .nc-event:not(.ends) { + border-right: 1px rgba(228,228,228,0.6) dashed; +} + +/* + * Events, multi day - week view + */ + +div.nova-calendar.week-view .nc-event:not(.starts) { + border-top: 1px rgba(228,228,228,0.6) dashed; +} + +div.nova-calendar.week-view .nc-event:not(.ends) { + border-bottom: 1px rgba(228,228,228,0.6) dashed; +} diff --git a/resources/js/components/Month.vue b/resources/js/components/Month.vue new file mode 100644 index 0000000..dc8f014 --- /dev/null +++ b/resources/js/components/Month.vue @@ -0,0 +1,431 @@ +/* + * © Copyright 2022 · Willem Vervuurt, Studio Delfuego + * + * You can modify, use and distribute this package under one of two licenses: + * 1. GNU AGPLv3 + * 2. A perpetual, non-revocable and 100% free (as in beer) do-what-you-want + * license that allows both non-commercial and commercial use, under conditions. + * See LICENSE.md for details. + * + * (it boils down to: do what you want as long as you're building and/or + * using calendar views, but don't embed this package or a modified version + * of it in free or paid-for software libraries and packages aimed at developers). + */ + + + + + + \ No newline at end of file diff --git a/resources/js/components/Week.vue b/resources/js/components/Week.vue new file mode 100644 index 0000000..ea9f2f6 --- /dev/null +++ b/resources/js/components/Week.vue @@ -0,0 +1,516 @@ +/* + * © Copyright 2022 · Willem Vervuurt, Studio Delfuego + * + * You can modify, use and distribute this package under one of two licenses: + * 1. GNU AGPLv3 + * 2. A perpetual, non-revocable and 100% free (as in beer) do-what-you-want + * license that allows both non-commercial and commercial use, under conditions. + * See LICENSE.md for details. + * + * (it boils down to: do what you want as long as you're building and/or + * using calendar views, but don't embed this package or a modified version + * of it in free or paid-for software libraries and packages aimed at developers). + */ + + + + + + \ No newline at end of file diff --git a/resources/js/pages/Tool.vue b/resources/js/pages/Tool.vue index 9d1e8ca..46bfbe7 100644 --- a/resources/js/pages/Tool.vue +++ b/resources/js/pages/Tool.vue @@ -13,364 +13,105 @@ */ - - - - -
- - - - - - - -
+