@quasar/quasar-ui-qcalendar
Version:
QCalendar - Day/Month/Week Calendars, Popups, Date Pickers, Schedules, Agendas, Planners and Tasks for your Vue Apps
6 lines • 42.9 kB
JavaScript
/*!
* @quasar/quasar-ui-qcalendar v4.1.2
* (c) 2025 Jeff Galbraith <jeff@quasar.dev>
* Released under the MIT License.
*/
var vue=require("vue");const PARSE_DATETIME=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?([^\d]+(\d{1,2}))?(:(\d{1,2}))?(:(\d{1,2}))?(.(\d{1,3}))?$/,PARSE_DATE=/^(\d{4})-(\d{1,2})(-(\d{1,2}))?/,PARSE_TIME=/(\d\d?)(:(\d\d?)|)(:(\d\d?)|)/,DAYS_IN_MONTH=[0,31,28,31,30,31,30,31,31,30,31,30,31],DAYS_IN_MONTH_LEAP=[0,31,29,31,30,31,30,31,31,30,31,30,31],TIME_CONSTANTS={MILLISECONDS_IN:{SECOND:1e3,MINUTE:6e4,HOUR:36e5,DAY:864e5,WEEK:6048e5},SECONDS_IN:{MINUTE:60,HOUR:3600,DAY:86400,WEEK:604800},MINUTES_IN:{MINUTE:1,HOUR:60,DAY:1440,WEEK:10080},HOURS_IN:{DAY:24,WEEK:168},DAYS_IN:{WEEK:7}},DAYS_IN_MONTH_MIN=28,DAYS_IN_MONTH_MAX=31,MONTH_MAX=12,MONTH_MIN=1,DAY_MIN=1,FIRST_HOUR=0;function validateTimestamp(e){return"string"===typeof e&&PARSE_DATETIME.test(e)}function parsed(e){if("string"!==typeof e)return null;const t=PARSE_DATETIME.exec(e);if(!t||!t[1]||!t[2])return null;const a=parseInt(t[1],10),n=parseInt(t[2],10),r=parseInt(t[4]||"1",10),o=parseInt(t[6]||"0",10),d=parseInt(t[8]||"0",10);return{date:e,time:o.toString().padStart(2,"0")+":"+d.toString().padStart(2,"0"),year:a,month:n,day:r,hour:o,minute:d,hasDay:!!t[4],hasTime:!0,past:!1,current:!1,future:!1,disabled:!1,weekday:0,doy:0,workweek:0}}function parseDate(e,t=!1){if(!(e instanceof Date))return null;const a=t?"UTC":"";return updateFormatted({date:padNumber(e[`get${a}FullYear`](),4)+"-"+padNumber(e[`get${a}Month`]()+1,2)+"-"+padNumber(e[`get${a}Date`](),2),time:padNumber(e[`get${a}Hours`]()||0,2)+":"+padNumber(e[`get${a}Minutes`]()||0,2),year:e[`get${a}FullYear`](),month:e[`get${a}Month`]()+1,day:e[`get${a}Date`](),hour:e[`get${a}Hours`](),minute:e[`get${a}Minutes`](),weekday:0,doy:0,workweek:0,hasDay:!0,hasTime:!0,past:!1,current:!1,future:!1,disabled:!1})}function padNumber(e,t){let a=String(e);while(a.length<t)a="0"+a;return a}function isLeapYear(e){return e%4===0&&e%100!==0||e%400===0}function daysInMonth(e,t){return(isLeapYear(e)?DAYS_IN_MONTH_LEAP:DAYS_IN_MONTH)[t]}function nextDay(e){const t=new Date(e.year,e.month-1,e.day+1);return updateFormatted(normalizeTimestamp({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function prevDay(e){const t=new Date(e.year,e.month-1,e.day-1);return updateFormatted(normalizeTimestamp({...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate()}))}function today(){const e=new Date,t=e.getMonth()+1,a=e.getDate(),n=e.getFullYear();return[n,padNumber(t,2),padNumber(a,2)].join("-")}function isToday(e){return e===today()}function getStartOfWeek(e,t,a){let n=copyTimestamp(e);if(t){if(1===n.day||0===n.weekday)while(!t.includes(Number(n.weekday)))n=nextDay(n);n=findWeekday(n,t[0],prevDay),n=updateFormatted(n),a&&(n=updateRelative(n,a,n.hasTime))}return n}function getEndOfWeek(e,t,a){let n=copyTimestamp(e);if(t&&Array.isArray(t)){const r=daysInMonth(n.year,n.month);if(r===n.day||n.weekday===t[t.length-1])while(!t.includes(Number(n.weekday)))n=prevDay(n);n=findWeekday(n,t[t.length-1],nextDay),n=updateFormatted(n),a&&(n=updateRelative(n,a,n.hasTime))}return n}function getStartOfMonth(e){let t=copyTimestamp(e);return t.day=DAY_MIN,t=updateFormatted(t),t}function getEndOfMonth(e){let t=copyTimestamp(e);return t.day=daysInMonth(t.year,t.month),t=updateFormatted(t),t}function parseTime(e){const t=Object.prototype.toString.call(e);switch(t){case"[object Number]":return e;case"[object String]":{const a=PARSE_TIME.exec(e);return a?60*parseInt(a[1],10)+parseInt(a[3]||"0",10):!1}case"[object Object]":return"object"!==typeof e||"number"!==typeof e.hour||"number"!==typeof e.minute?!1:"object"===typeof e&&"hour"in e&&"minute"in e&&60*e.hour+e.minute}return!1}function compareTimestamps(e,t){return!(!e||!t)&&e.year===t.year&&e.month===t.month&&e.day===t.day&&e.hour===t.hour&&e.minute===t.minute}function compareDate(e,t){return getDate(e)===getDate(t)}function compareTime(e,t){return getTime(e)===getTime(t)}function compareDateTime(e,t){return getDateTime(e)===getDateTime(t)}function parseTimestamp(e,t=null){let a=parsed(e);return a?(a=updateFormatted(a),t&&(a=updateRelative(a,t,a.hasTime)),a):null}function getDayIdentifier(e){return 1e8*(e.year??0)+1e6*(e.month??0)+1e4*(e.day??0)}function getTimeIdentifier(e){return 100*(e.hour??0)+(e.minute??0)}function getDayTimeIdentifier(e){return getDayIdentifier(e)+getTimeIdentifier(e)}function diffTimestamp(e,t,a=!1){const n=Date.UTC(e.year??0,(e.month??1)-1,e.day??1,e.hour??0,e.minute??0),r=Date.UTC(t.year??0,(t.month??1)-1,t.day??1,t.hour??0,t.minute??0);return!0===a&&r<n?0:r-n}function updateRelative(e,t,a=!1){let n=copyTimestamp(e),r=getDayIdentifier(t),o=getDayIdentifier(n),d=r===o;return n.hasTime&&a&&d&&(r=getTimeIdentifier(t),o=getTimeIdentifier(n),d=r===o),n.past=o<r,n.current=d,n.future=o>r,n.currentWeekday=n.weekday===t.weekday,n}function updateMinutes(e,t,a=null){let n=copyTimestamp(e);return n.hasTime=!0,n.hour=Math.floor(t/TIME_CONSTANTS.MINUTES_IN.HOUR),n.minute=t%TIME_CONSTANTS.MINUTES_IN.HOUR,n.time=getTime(n),a&&(n=updateRelative(n,a,!0)),n}function updateWeekday(e){let t=copyTimestamp(e);return t.weekday=getWeekday(t),t}function updateDayOfYear(e){let t=copyTimestamp(e);return t.doy=getDayOfYear(t)||0,t}function updateWorkWeek(e){let t=copyTimestamp(e);return t.workweek=getWorkWeek(t),t}function updateDisabled(e,t,a,n,r){let o=copyTimestamp(e);const d=getDayIdentifier(o);if(void 0!==t){const l=parsed(t);if(l){const c=getDayIdentifier(l);d<=c&&(o.disabled=!0)}}if(!0!==o.disabled&&void 0!==a){const m=parsed(a);if(m){const v=getDayIdentifier(m);d>=v&&(o.disabled=!0)}}if(!0!==o.disabled&&Array.isArray(n)&&n.length>0)for(var i in n)if(n[i]===o.weekday){o.disabled=!0;break}if(!0!==o.disabled&&Array.isArray(r)&&r.length>0)for(var u in r)if(Array.isArray(r[u])&&2===r[u].length&&r[u][0]&&r[u][1]){const y=parsed(r[u][0]),p=parsed(r[u][1]);if(y&&p&&isBetweenDates(o,y,p)){o.disabled=!0;break}}else{const f=r[u];if(Array.isArray(f))for(var s of f){const h=parseTimestamp(s);if(h){const g=getDayIdentifier(h);if(g===d){o.disabled=!0;break}}}else if(f){const D=parseTimestamp(f);if(D){const k=getDayIdentifier(D);k===d&&(o.disabled=!0)}}}return o}function updateFormatted(e){let t=copyTimestamp(e);return t.hasTime=!0,t.time=getTime(t),t.date=getDate(t),t.weekday=getWeekday(t),t.doy=getDayOfYear(t)||0,t.workweek=getWorkWeek(t),t}function getDayOfYear(e){if(0!==e.year)return(Date.UTC(e.year,e.month-1,e.day)-Date.UTC(e.year,0,0))/24/60/60/1e3}function getWorkWeek(e){let t=copyTimestamp(e);if(0===t.year){const r=parseTimestamp(today());r&&(t=r)}const a=new Date(Date.UTC(t.year,t.month-1,t.day)),n=4;a.setUTCDate(a.getUTCDate()-(a.getUTCDay()+6)%7+n),a.setUTCDate(a.getUTCDate()+n-(a.getUTCDay()||7));e=new Date(Date.UTC(a.getUTCFullYear(),0,1)),e=Math.ceil(((a.valueOf()-e.valueOf())/864e5+1)/7);return e}function getWeekday(e){let t=e.weekday;if(e.hasDay){const a=Math.floor,n=e.day,r=(e.month+9)%MONTH_MAX+1,o=a(e.year/100),d=e.year%100-(e.month<=2?1:0);t=((n+a(2.6*r-.2)-2*o+d+a(d/4)+a(o/4))%7+7)%7}return t??0}function copyTimestamp(e){return{...e}}function getDate(e){let t=padNumber(e.year,4)+"-"+padNumber(e.month,2);return e.hasDay&&(t+="-"+padNumber(e.day,2)),t}function getTime(e){return e.hasTime?padNumber(e.hour,2)+":"+padNumber(e.minute,2):""}function getDateTime(e){return getDate(e)+" "+(e.hasTime?getTime(e):"00:00")}function moveRelativeDays(e,t=nextDay,a=1,n=[0,1,2,3,4,5,6]){const r=copyTimestamp(e);return relativeDays(r,t,a,n)}function relativeDays(e,t=nextDay,a=1,n=[0,1,2,3,4,5,6]){let r=copyTimestamp(e);n.includes(Number(r.weekday))||0!==r.weekday||t!==nextDay||++a;while(--a>=0)r=t(r),n.length<7&&!n.includes(Number(r.weekday))&&++a;return r}function findWeekday(e,t,a=nextDay,n=6){let r=copyTimestamp(e);while(r.weekday!==t&&--n>=0)r=a(r);return r}function createDayList(e,t,a,n=[0,1,2,3,4,5,6],r=void 0,o=void 0,d=[],i=[],u=42,s=0){const l=getDayIdentifier(e),c=getDayIdentifier(t),m=[];let v=copyTimestamp(e),y=0,p=y===c;if(!(c<l))while((!p||m.length<s)&&m.length<u){if(y=getDayIdentifier(v),p=p||y>c&&m.length>=s,p)break;if(n.includes(Number(v.weekday))){let e=copyTimestamp(v);e=updateFormatted(e),e=updateRelative(e,a),e=updateDisabled(e,r,o,d,i),m.push(e)}v=relativeDays(v,nextDay)}return m}function createIntervalList(t,a,n,r,o){const d=[];for(let e=0;e<r;++e){const i=(a+e)*n,u=copyTimestamp(t);d.push(updateMinutes(u,i,o))}return d}function createNativeLocaleFormatter(n,r){const e=()=>"";return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:(t,e)=>{try{const a=new Intl.DateTimeFormat(n||void 0,r(t,e));return a.format(makeDateTime(t))}catch(e){return console.error(`Intl.DateTimeFormat: ${e.message} -> `+getDateTime(t)),""}}}function makeDate(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,0,0)):new Date(e.year,e.month-1,e.day,0,0)}function makeDateTime(e,t=!0){return t?new Date(Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute)):new Date(e.year,e.month-1,e.day,e.hour,e.minute)}function validateNumber(e){return isFinite(Number(e))}function maxTimestamp(e,t=!1){const a=!0===t?getDayTimeIdentifier:getDayIdentifier;return e.reduce((e,t)=>{return Math.max(a(e),a(t))===a(e)?e:t})}function minTimestamp(e,t=!1){const a=!0===t?getDayTimeIdentifier:getDayIdentifier;return e.reduce((e,t)=>{return Math.min(a(e),a(t))===a(e)?e:t})}function isBetweenDates(e,t,a,n=!1){const r=getDayIdentifier(e)+(!0===n?getTimeIdentifier(e):0),o=getDayIdentifier(t)+(!0===n?getTimeIdentifier(t):0),d=getDayIdentifier(a)+(!0===n?getTimeIdentifier(a):0);return r>=o&&r<=d}function isOverlappingDates(e,t,a,n){const r=getDayIdentifier(e),o=getDayIdentifier(t),d=getDayIdentifier(a),i=getDayIdentifier(n);return r>=d&&r<=i||o>=d&&o<=i||d>=r&&o>=i}function addToDate(e,t){const a=copyTimestamp(e);return t.year&&(a.year+=t.year),t.month&&(a.month+=t.month),t.day&&(a.day+=t.day),t.hour&&(a.hour+=t.hour),t.minute&&(a.minute+=t.minute),updateFormatted(normalizeTimestamp(a))}function normalizeTimestamp(e){const t=new Date(e.year,e.month-1,e.day,e.hour,e.minute);return{...e,year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes()}}function daysBetween(e,t){const a=diffTimestamp(e,t,!0);return Math.floor(a/TIME_CONSTANTS.MILLISECONDS_IN.DAY)}function weeksBetween(e,t){let a=copyTimestamp(e),n=copyTimestamp(t);return a=findWeekday(a,0),n=findWeekday(n,6),Math.ceil(daysBetween(a,n)/TIME_CONSTANTS.DAYS_IN.WEEK)}const weekdayDateMap={Sun:new Date("2020-01-05T00:00:00.000Z"),Mon:new Date("2020-01-06T00:00:00.000Z"),Tue:new Date("2020-01-07T00:00:00.000Z"),Wed:new Date("2020-01-08T00:00:00.000Z"),Thu:new Date("2020-01-09T00:00:00.000Z"),Fri:new Date("2020-01-10T00:00:00.000Z"),Sat:new Date("2020-01-11T00:00:00.000Z")};function getWeekdayFormatter(){const e=()=>"",r={long:{timeZone:"UTC",weekday:"long"},short:{timeZone:"UTC",weekday:"short"},narrow:{timeZone:"UTC",weekday:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,r[e]||r["long"]);return n.format(weekdayDateMap[t])}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> day of week: `+t),""}}}function getWeekdayNames(t,a){const e=Object.keys(weekdayDateMap),n=getWeekdayFormatter();return e.map(e=>String(n(e,t,a)))}function getMonthFormatter(){const e=()=>"",o={long:{timeZone:"UTC",month:"long"},short:{timeZone:"UTC",month:"short"},narrow:{timeZone:"UTC",month:"narrow"}};return"undefined"===typeof Intl||"undefined"===typeof Intl.DateTimeFormat?e:t;function t(t,e,a){try{const n=new Intl.DateTimeFormat(a||void 0,o[e]||o["long"]),r=new Date;return r.setDate(1),r.setMonth(t),n.format(r)}catch(e){return e instanceof Error&&console.error(`Intl.DateTimeFormat: ${e.message} -> month: `+t),""}}}function getMonthNames(t,a){const n=getMonthFormatter();return[...Array(12).keys()].map(e=>n(e,t,a))}function convertToUnit(e,t="px"){if(e)return isNaN(e)?String(e):"auto"===e?e:""+Number(e)+t}function indexOf(t,a){for(let e=0;e<t.length;e++)if(!0===a(t[e],e))return e;return-1}function minCharWidth(e,t){return 0===t?e:e.slice(0,t)}const toCamelCase=e=>e.replace(/(-\w)/g,e=>e[1].toUpperCase());function getMouseEventHandlers(t,e,a,n){const r={};for(const o in a){const d=a[o],i=toCamelCase("on-"+o);if(!e.value)return console.warn("$listeners has not been set up"),{};if(void 0!==e.value[i]){const u="on"+d.event.charAt(0).toUpperCase()+d.event.slice(1),s=e=>{return(void 0===d.button||"buttons"in e&&e.buttons>0&&e.button===d.button)&&(d.prevent&&e.preventDefault(),d.stop&&e.stopPropagation(),t(o,n(e,o))),d.result};u in r?Array.isArray(r[u])?r[u].push(s):r[u]=[r[u],s]:r[u]=s}}return r}function getDefaultMouseEventHandlers(e,t,a,n){return getMouseEventHandlers(e,t,getMouseEventName(a),n)}function getMouseEventName(e){return{["click"+e]:{event:"click"},["contextmenu"+e]:{event:"contextmenu",prevent:!0,result:!1},["mousedown"+e]:{event:"mousedown"},["mousemove"+e]:{event:"mousemove"},["mouseup"+e]:{event:"mouseup"},["mouseenter"+e]:{event:"mouseenter"},["mouseleave"+e]:{event:"mouseleave"},["touchstart"+e]:{event:"touchstart"},["touchmove"+e]:{event:"touchmove"},["touchend"+e]:{event:"touchend"}}}function getRawMouseEvents(e){return Object.keys(getMouseEventName(e))}function useMouseEvents(a,n){return{getMouseEventHandlers:(e,t)=>getMouseEventHandlers(a,n,e,t),getDefaultMouseEventHandlers:(e,t)=>getDefaultMouseEventHandlers(a,n,e,t),getMouseEventName:getMouseEventName,getRawMouseEvents:getRawMouseEvents}}const ResizeObserverDirective={mounted(e,t){if("function"===typeof t.value){const a=t.value,n={callback:a,size:{width:0,height:0},observer:new ResizeObserver(e=>{const t=e[0].contentRect;t.width===n.size.width&&t.height===n.size.height||(n.size.width=t.width,n.size.height=t.height,n.debounceTimeout&&clearTimeout(n.debounceTimeout),n.debounceTimeout=setTimeout(()=>{n.callback(n.size),n.debounceTimeout=void 0},100))})};n.observer.observe(e),e.__onResizeObserver=n}},beforeUnmount(e){if(e.__onResizeObserver){const{observer:t,debounceTimeout:a}=e.__onResizeObserver;a&&clearTimeout(a),t.unobserve(e),delete e.__onResizeObserver}}};function useCalendar(t,a,{scrollArea:e,pane:n}){if(!a){const l="[error: renderCalendar] no renderFunc has been supplied to useCalendar";throw console.error(l),new Error(l)}const r=vue.reactive({width:0,height:0}),o=vue.ref(null);function d({width:e,height:t}){r.width=e,r.height=t}const i=vue.computed(()=>{return!0!==t.noScroll&&e.value&&n.value&&r.height?e.value.offsetWidth-n.value.offsetWidth:0});function u(){}function s(){const e={ref:o,role:"complementary",lang:t.locale,class:`q-calendar ${t.dark?"q-calendar--dark":""} `+(t.bordered?"q-calendar__bordered":"")};return vue.withDirectives(vue.h("div",{...e},[a()]),[[ResizeObserverDirective,d]])}return{rootRef:o,scrollWidth:i,__initCalendar:u,__renderCalendar:s}}const isValidFocusType=e=>e.every(e=>["day","date","weekday","interval","time","resource","task"].includes(e)),useCommonProps={modelValue:{type:String,default:today(),validator:e=>""===e||validateTimestamp(e)},weekdays:{type:Array,default:()=>[0,1,2,3,4,5,6]},dateType:{type:String,default:"round",validator:e=>["round","rounded","square"].includes(e)},weekdayAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},dateAlign:{type:String,default:"center",validator:e=>["left","center","right"].includes(e)},bordered:Boolean,dark:Boolean,noAria:Boolean,noActiveDate:Boolean,noHeader:Boolean,noScroll:Boolean,shortWeekdayLabel:Boolean,noDefaultHeaderText:Boolean,noDefaultHeaderBtn:Boolean,minWeekdayLabel:{type:[Number,String],default:1},weekdayBreakpoints:{type:Array,default:()=>[75,35],validator:e=>2===e.length},locale:{type:String,default:"en-US"},animated:Boolean,transitionPrev:{type:String,default:"slide-right"},transitionNext:{type:String,default:"slide-left"},disabledDays:Array,disabledBefore:String,disabledAfter:String,disabledWeekdays:{type:Array,default:()=>[]},dragEnterFunc:Function,dragOverFunc:Function,dragLeaveFunc:Function,dropFunc:Function,selectedDates:{type:[Array,Set],default:()=>[]},selectedStartEndDates:{type:Array,default:()=>[]},hoverable:Boolean,focusable:Boolean,focusType:{type:Array,default:()=>["date"],validator:isValidFocusType}};function useCommon(t,{startDate:e,endDate:a,times:n}){const r=vue.computed(()=>parseTimestamp(e.value)),o=vue.computed(()=>{return"0000-00-00"===a.value?getEndOfWeek(r.value,t.weekdays,n.today):parseTimestamp(a.value)||r.value}),d=vue.computed(()=>createNativeLocaleFormatter(t.locale,()=>({timeZone:"UTC",day:"numeric"}))),i=vue.computed(()=>createNativeLocaleFormatter(t.locale,(e,t)=>({timeZone:"UTC",weekday:t?"short":"long"}))),u=vue.computed(()=>createNativeLocaleFormatter(t.locale,()=>({timeZone:"UTC",dateStyle:"full"})));function s(e,t){return e&&e.length>0&&e.includes(t.date)}function l(e,t){const a={firstDay:!1,betweenDays:!1,lastDay:!1};if(2===e.length){const n=getDayIdentifier(t),r=getDayIdentifier(parsed(e[0])),o=getDayIdentifier(parsed(e[1]));a.firstDay=r===n,a.lastDay=o===n,a.betweenDays=r<n&&o>n}return a}function c(e,t=!1,a=[],n=[],r=!1){const o=s(a,e),{firstDay:d,lastDay:i,betweenDays:u}=l(n,e);return{"q-past-day":!d&&!u&&!i&&!o&&!t&&!!e.past,"q-future-day":!d&&!u&&!i&&!o&&!t&&!!e.future,"q-outside":t,"q-current-day":!!e.current,"q-selected":o,"q-range-first":d,"q-range":u,"q-range-last":i,"q-range-hover":r&&(d||i||u),"q-disabled-day disabled":!0===e.disabled}}function m(e){return getStartOfWeek(e,t.weekdays,n.today)}function v(e){return getEndOfWeek(e,t.weekdays,n.today)}function y(){return{}}return{parsedStart:r,parsedEnd:o,dayFormatter:d,weekdayFormatter:i,ariaDateFormatter:u,arrayHasDate:s,checkDays:l,getRelativeClasses:c,startOfWeek:m,endOfWeek:v,dayStyleDefault:y}}const useMonthProps={dayHeight:{type:[Number,String],default:0,validator:e=>validateNumber(e)},dayMinHeight:{type:[Number,String],default:0,validator:e=>validateNumber(e)},dayStyle:Function,dayClass:Function,weekdayStyle:Function,weekdayClass:Function,dayPadding:String,minWeeks:{type:[Number,String],default:1,validator:e=>validateNumber(e)},shortMonthLabel:Boolean,showWorkWeeks:Boolean,showMonthLabel:{type:Boolean,default:!0},showDayOfYearLabel:Boolean,enableOutsideDays:Boolean,noOutsideDays:Boolean,hover:Boolean,miniMode:{type:[Boolean,String],validator:e=>[!0,!1,"auto"].includes(e)},breakpoint:{type:[Number,String],default:"md",validator:e=>["xs","sm","md","lg","xl"].includes(e)||validateNumber(e)},monthLabelSize:{type:String,default:"sm",validator:e=>["xxs","xs","sm","md","lg","xl","xxl"].includes(e)||!!e&&e.length>0}};function useMonth(n,t,{times:r,parsedStart:a,parsedEnd:o,size:d,headerColumnRef:i}){const e=vue.computed(()=>parseInt(n.minWeeks,10)),u=vue.computed(()=>e.value*n.weekdays.length),s=vue.computed(()=>D(w(a.value))),l=vue.computed(()=>k(T(o.value))),c=vue.computed(()=>{let e=0;return n.cellWidth?e=Number(n.cellWidth):d.width>0&&i.value&&(e=i.value.offsetWidth/n.weekdays.length),e}),m=vue.computed(()=>createDayList(s.value,l.value,r.today,n.weekdays,n.disabledBefore,n.disabledAfter,n.disabledWeekdays,n.disabledDays,Number.MAX_SAFE_INTEGER,u.value)),v=vue.computed(()=>{const e=r.today,t=D(e),a=k(e);return createDayList(t,a,e,n.weekdays,n.disabledBefore,n.disabledAfter,n.disabledWeekdays,n.disabledDays,n.weekdays.length,n.weekdays.length)}),y=vue.computed(()=>createNativeLocaleFormatter(n.locale,(e,t)=>({timeZone:"UTC",month:t?"short":"long"}))),p=vue.computed(()=>{switch(n.breakpoint){case"xs":return 300;case"sm":return 350;case"md":return 400;case"lg":return 450;case"xl":return 500;default:return parseInt(n.breakpoint,10)}}),f=vue.computed(()=>{switch(n.monthLabelSize){case"xxs":return".4em";case"xs":return".6em";case"sm":return".8em";case"md":return"1.0em";case"lg":return"1.2em";case"xl":return"1.4em";case"xxl":return"1.6em";default:return n.monthLabelSize}});let h=!0;const g=vue.computed(()=>{const e=!0===n.miniMode||"auto"===n.miniMode&&void 0!==n.breakpoint&&d.width<p.value;return h&&(h=!1,t("mini-mode",e)),e});function D(e){return getStartOfWeek(e,n.weekdays,r.today)}function k(e){return getEndOfWeek(e,n.weekdays,r.today)}function w(e){return getStartOfMonth(e)}function T(e){return getEndOfMonth(e)}function b(e){const t=getDayIdentifier(e);return t<getDayIdentifier(a.value)||t>getDayIdentifier(o.value)}return vue.watch(g,e=>{t("mini-mode",e)}),{parsedCellWidth:c,parsedMinWeeks:e,parsedMinDays:u,parsedMonthStart:s,parsedMonthEnd:l,parsedBreakpoint:p,parsedMonthLabelSize:f,days:m,todayWeek:v,isMiniMode:g,monthFormatter:y,isOutside:b}}const useTimesProps={now:{type:String,validator:e=>""===e||validateTimestamp(e),default:""}};function useTimes(e){const t=vue.reactive({now:parseTimestamp("0000-00-00 00:00"),today:parseTimestamp("0000-00-00")}),a=vue.computed(()=>e.now?parseTimestamp(e.now):o());function n(){t.now&&t.today&&(t.now.current=t.today.current=!0,t.now.past=t.today.past=!1,t.now.future=t.today.future=!1)}function r(){const e=a.value||o();d(e,t.now),i(e,t.now),d(e,t.today)}function o(){return parseDate(new Date)}function d(e,t){e.date!==t.date&&(t.year=e.year,t.month=e.month,t.day=e.day,t.weekday=e.weekday,t.date=e.date)}function i(e,t){e.time!==t.time&&(t.hour=e.hour,t.minute=e.minute,t.time=e.time)}return vue.watch(a,()=>r()),{times:t,parsedNow:a,setCurrent:n,updateCurrent:r,getNow:o,updateDay:d,updateTime:i}}function useRenderValues(r,{parsedView:o,parsedValue:d,times:i}){const e=vue.computed(()=>{const e=d.value;let t=r.maxDays,a=e,n=e;switch(o.value){case"month":a=getStartOfMonth(e),n=getEndOfMonth(e),t=daysInMonth(a.year,a.month);break;case"week":case"week-agenda":case"week-scheduler":a=getStartOfWeek(e,r.weekdays,i.today),n=getEndOfWeek(a,r.weekdays,i.today),t=r.weekdays.length;break;case"day":case"scheduler":case"agenda":n=moveRelativeDays(copyTimestamp(n),nextDay,t>1?t-1:t,r.weekdays),n=updateFormatted(n);break;case"month-interval":case"month-scheduler":case"month-agenda":a=getStartOfMonth(e),n=getEndOfMonth(e),n=updateFormatted(n),t=daysInMonth(a.year,a.month);break;case"resource":t=1,n=moveRelativeDays(copyTimestamp(n),nextDay,t,r.weekdays),n=updateFormatted(n);break}return{start:a,end:n,maxDays:t}});return{renderValues:e}}const useMoveEmits=["moved"];function useMove(u,{parsedView:s,parsedValue:l,direction:c,maxDays:m,times:v,emittedValue:y,emit:p}){function e(a=1){if(0===a)y.value=today();else{let e=copyTimestamp(l.value);const n=getEndOfMonth(e),r=a>0,o=r?nextDay:prevDay,d=r?n.day:1;let t=r?a:-a;c.value=r?"next":"prev";const i=u.weekdays.length;while(--t>=0)switch(s.value){case"month":e.day=d,e=o(e),e=updateWeekday(e);while(!u.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:r?1:-1});break;case"week":case"week-agenda":case"week-scheduler":e=relativeDays(e,o,i,u.weekdays);break;case"day":case"scheduler":case"agenda":e=relativeDays(e,o,m.value,u.weekdays);break;case"month-interval":case"month-agenda":case"month-scheduler":e.day=d,e=o(e);break;case"resource":e=relativeDays(e,o,m.value,u.weekdays);break}e=updateWeekday(e),e=updateFormatted(e),e=updateDayOfYear(e),e=updateRelative(e,v.now),y.value=e.date,p("moved",e)}}return{move:e}}const listenerRE=/^on[A-Z]/;function useEmitListeners(e=vue.getCurrentInstance()){return{emitListeners:vue.computed(()=>{const t={};return e?.vnode?.props&&Object.keys(e.vnode.props).forEach(e=>{listenerRE.test(e)&&(t[e]=!0)}),t})}}function useFocusHelper(){const e={"aria-hidden":"true",class:"q-calendar__focus-helper"};return[vue.h("span",e)]}function useButton(){function e({focusable:e,focusType:t},a,n){const r=e&&t.includes("date");return vue.h("button",{...a,tabindex:r?0:-1},[n,r&&useFocusHelper()])}return{renderButton:e}}const useCellWidthProps={cellWidth:[Number,String]};function useCellWidth(e){const t=vue.computed(()=>void 0!==e.cellWidth);return{isSticky:t}}const useCheckChangeEmits=["change"];function useCheckChange(n,{days:r,lastStart:o,lastEnd:d}){function e(){const e=r.value;if(0===e.length)return!1;const t=e[0].date,a=e[e.length-1].date;return(!o.value||!d.value||t!==o.value||a!==d.value)&&(o.value=t,d.value=a,n("change",{start:t,end:a,days:e}),!0)}return{checkChange:e}}function useEventUtils(){function e(e,t){return(Array.isArray(t)?t:[t]).includes(e.keyCode)}return{isKeyCode:e}}const isKeyCode=useEventUtils().isKeyCode,useNavigationProps={useNavigation:Boolean};function useNavigation(t,{rootRef:a,focusRef:n,focusValue:r,datesRef:o,parsedView:d,emittedValue:i,direction:u,times:s}){let e=!1;function l(){e||document&&(e=!0,document.addEventListener("keyup",p),document.addEventListener("keydown",y))}function c(){document&&(document.removeEventListener("keyup",p),document.removeEventListener("keydown",y),e=!1)}function m(e){if(e&&document){const t=document.activeElement;if(t!==document.body&&a.value?.contains(t))return!0}return!1}function v(){let t=0;const a=window.setInterval(()=>{const e=o.value[n.value];e&&(e.focus(),50!==++t)&&document.activeElement!==e||window.clearInterval(a)},250)}function y(e){m(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])&&(e.stopPropagation(),e.preventDefault())}function p(e){if(m(e)&&isKeyCode(e,[33,34,35,36,37,38,39,40])){const t={33:k,34:w,35:b,36:T,37:g,38:f,39:D,40:h};t[e.keyCode]?.()}}function f(){let e=copyTimestamp(r.value);if("month"===d.value){if(e=addToDate(e,{day:-7}),r.value.month!==e.month)return u.value="prev",void(i.value=e.date)}else e=addToDate(e,{minute:Number(t.intervalMinutes)});u.value="prev",n.value=e.date}function h(){let e=copyTimestamp(r.value);if("month"===d.value){if(e=addToDate(e,{day:7}),r.value.month!==e.month)return u.value="next",void(i.value=e.date)}else e=addToDate(e,{minute:Number(t.intervalMinutes)});u.value="next",n.value=e.date}function g(){let e=copyTimestamp(r.value);u.value="prev";do{e=addToDate(e,{day:-1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function D(){let e=copyTimestamp(r.value);u.value="next";do{e=addToDate(e,{day:1})}while(!t.weekdays.includes(Number(e.weekday)));n.value=e.date}function k(){let e=copyTimestamp(r.value);e="month"===d.value?addToDate(e,{month:-1}):addToDate(e,{day:-7}),u.value="prev",n.value=e.date}function w(){let e=copyTimestamp(r.value);e="month"===d.value?addToDate(e,{month:1}):addToDate(e,{day:7}),u.value="next",n.value=e.date}function T(){let e=copyTimestamp(r.value);e="month"===d.value?getStartOfMonth(e):getStartOfWeek(e,t.weekdays||[],s.today);while(!t.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:-1});n.value=e.date}function b(){let e=copyTimestamp(r.value);e="month"===d.value?getEndOfMonth(e):getEndOfWeek(e,t.weekdays||[],s.today);while(!t.weekdays.includes(Number(e.weekday)))e=addToDate(e,{day:-1});n.value=e.date}return vue.onBeforeUnmount(()=>{c()}),vue.watch(()=>t.useNavigation,e=>{(!0===e?l:c)()}),!0===t.useNavigation&&l(),{startNavigation:l,endNavigation:c,tryFocus:v}}const renderButton=useButton().renderButton;var QCalendarMonth=vue.defineComponent({name:"QCalendarMonth",directives:{ResizeObserver:ResizeObserverDirective},props:{...useCommonProps,...useMonthProps,...useTimesProps,...useCellWidthProps,...useNavigationProps},emits:["update:model-value",...useCheckChangeEmits,...useMoveEmits,"mini-mode",...getRawMouseEvents("-date"),...getRawMouseEvents("-day"),...getRawMouseEvents("-head-workweek"),...getRawMouseEvents("-head-day"),...getRawMouseEvents("-workweek")],setup(v,{slots:y,emit:c,expose:R}){const L=vue.ref(null),H=vue.ref(null),e=vue.ref(null),p=vue.ref(v.modelValue||today()),t=vue.ref(parsed(v.modelValue||today())),m=vue.ref({}),s=vue.ref([]),l=vue.ref([]),o=vue.ref("next"),d=vue.ref(v.modelValue||today()),i=vue.ref("0000-00-00"),q=vue.ref(0),f=vue.ref(v.modelValue),u=vue.reactive({width:0,height:0}),h=vue.ref(),g=vue.ref(""),U=vue.ref(null),B=vue.ref(null),a=vue.computed(()=>{return"month"}),n=vue.getCurrentInstance();if(null===n)throw new Error("current instance is null");const D=useEmitListeners(n).emitListeners,Y=useCellWidth(v).isSticky,{times:r,setCurrent:P,updateCurrent:k}=(vue.watch(Y,()=>{}),useTimes(v)),{parsedStart:w,parsedEnd:T,dayFormatter:V,weekdayFormatter:z,ariaDateFormatter:Z,dayStyleDefault:b,getRelativeClasses:K}=(k(),P(),useCommon(v,{startDate:d,endDate:i,times:r})),M=vue.computed(()=>{return parseTimestamp(v.modelValue,r.now)||w.value||r.today}),$=(t.value=M.value,p.value=M.value.date,vue.computed(()=>{const e={};return void 0!==v.dayPadding&&(e.padding=v.dayPadding),e.minWidth=W.value,e.maxWidth=W.value,e.width=W.value,e})),j=useRenderValues(v,{parsedView:a,times:r,parsedValue:M}).renderValues,{rootRef:_,__renderCalendar:X}=useCalendar(v,Ie,{scrollArea:L,pane:H}),{days:N,todayWeek:Q,isMiniMode:I,parsedCellWidth:G,parsedMonthLabelSize:J,isOutside:ee,monthFormatter:te}=useMonth(v,c,{times:r,parsedStart:w,parsedEnd:T,size:u,headerColumnRef:e}),x=useMove(v,{parsedView:a,parsedValue:M,direction:o,maxDays:q,times:r,emittedValue:f,emit:c}).move,E=useMouseEvents(c,D).getDefaultMouseEventHandlers,ae=useCheckChange(c,{days:N,lastStart:U,lastEnd:B}).checkChange,S=useEventUtils().isKeyCode,ne=useNavigation(v,{rootRef:_,focusRef:p,focusValue:t,datesRef:m,parsedView:a,emittedValue:f,direction:o,times:r}).tryFocus,re=vue.computed(()=>{return _.value&&!0===v.showWorkWeeks?parseInt(window.getComputedStyle(_.value).getPropertyValue(!0===I.value?"--calendar-mini-work-week-width":"--calendar-work-week-width"),10):0}),O=vue.computed(()=>{return v.weekdays.length}),W=vue.computed(()=>{if(_.value){const e=u.width||_.value.getBoundingClientRect().width;if(e&&O.value)return(e-re.value)/O.value+"px"}return 100/O.value+"%"}),F=vue.computed(()=>{return!0===v.focusable&&v.focusType.includes("day")&&!0!==I.value}),A=vue.computed(()=>{return!0===v.focusable&&v.focusType.includes("date")&&!0!==F.value});function oe(){f.value=today()}function de(e=1){x(e)}function ie(e=1){x(-e)}function ue({width:e,height:t}){u.width=e,u.height=t}function C(e){return e.date===f.value}function se(t){for(let e=0;e<t.length;++e)if(!0===t[e].current)return{timestamp:t[e]};return{timestamp:!1}}function le(){if(!0!==I.value&&0===v.dayHeight){const t=y.week;if(void 0!==t&&window)for(var e in s.value){const a=s.value[e];if(void 0!==a){const n=l.value[e];if(void 0!==n){const r=window.getComputedStyle(a),o=parseFloat(r.marginTop)+parseFloat(r.marginBottom);n.clientHeight+o>n.clientHeight&&(n.style.height=a.clientHeight+o+"px")}}}}}function ce(){return vue.h("div",{class:"q-calendar-month__body"},[...De()])}function me(){return vue.h("div",{role:"presentation",class:"q-calendar-month__head"},[!0===v.showWorkWeeks&&ye(),vue.h("div",{class:"q-calendar-month__head--wrapper"},[ve()])])}function ve(){return vue.h("div",{ref:e,class:{"q-calendar-month__head--weekdays":!0}},[...pe()])}function ye(){const e=y["head-workweek"],t={start:w.value,end:T.value,miniMode:I.value};return vue.h("div",{class:"q-calendar-month__head--workweek",...E("-head-workweek",e=>{return{scope:t,event:e}})},e?e({scope:t}):"#")}function pe(){return Q.value.map((e,t)=>fe(e,t))}function fe(t,e){const a=y["head-day"],n=N.value.filter(e=>e.weekday===t.weekday),r=n[0].weekday,o=!0!==v.noActiveDate&&C(t),d={activeDate:o,weekday:r,timestamp:t,days:n,index:e,miniMode:I.value,droppable:h.value===Number(t.weekday),disabled:!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(t.weekday))},i="function"===typeof v.weekdayClass?v.weekdayClass({scope:d}):{},u=!0===v.focusable&&v.focusType.includes("weekday"),s=W.value,l=v.weekdayStyle||b,c={width:s,maxWidth:s,minWidth:s,...l({scope:d})},m={key:t.date+(void 0!==e?"-"+e:""),tabindex:!0===u?0:-1,class:{"q-calendar-month__head--weekday":!0,...i,"q-disabled-day disabled":!0===d.disabled,["q-calendar__"+v.weekdayAlign]:!0,"q-calendar__ellipsis":!0,"q-calendar__focusable":!0===u},style:c,onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"head-day",{scope:d})?h.value=Number(t.weekday):h.value=-1)},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"head-day",{scope:d})?h.value=Number(t.weekday):h.value=-1)},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"head-day",{scope:d})?h.value=Number(t.weekday):h.value=-1)},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"head-day",{scope:d})?h.value=Number(t.weekday):h.value=-1)},onFocus:()=>{!0===u&&(p.value=t.date)},...E("-head-day",e=>{return{scope:d,event:e}})};return!0!==v.noAria&&(m.ariaLabel=z.value(t,!1)),vue.h("div",m,[void 0===a&&ge(t,v.shortWeekdayLabel||I.value),void 0!==a&&a({scope:d}),he(t,e),!0===u&&useFocusHelper()])}function he(t,e){const a=y["head-day-event"],n=!0!==v.noActiveDate&&C(t),r=N.value.filter(e=>e.weekday===t.weekday),o=r[0].weekday,d={weekday:o,timestamp:t,days:r,index:e,miniMode:I.value,activeDate:n,disabled:!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(t.weekday))},i=W.value,u=v.weekdayStyle||b,s={width:i,maxWidth:i,minWidth:i,...u({scope:d})};return vue.h("div",{key:"event-"+t.date+(void 0!==e?"-"+e:""),class:{"q-calendar-month__head--event":!0},style:s},[void 0!==a&&a({scope:d})])}function ge(e,t){const a=z.value(e,t||v.weekdayBreakpoints[0]>0&&G.value<=v.weekdayBreakpoints[0]);return vue.h("span",{class:"q-calendar__ellipsis"},!0===I.value&&!0===v.shortWeekdayLabel||v.weekdayBreakpoints[1]>0&&G.value<=v.weekdayBreakpoints[1]?minCharWidth(a,Number(v.minWeekdayLabel)):a)}function De(){const t=v.weekdays.length,a=[];for(let e=0;e<N.value.length;e+=t)a.push(ke(N.value.slice(e,e+t),e/t));return a}function ke(e,t){const a=y.week,n=v.weekdays,r={week:e,weekdays:n,miniMode:I.value},o={},d=parseInt(String(v.dayHeight),10),i=parseInt(String(v.dayMinHeight),10),u=(o.height=d>0&&!0!==I.value?convertToUnit(d):"auto",i>0&&!0!==I.value&&(o.minHeight=convertToUnit(i)),0===d&&0===i);return vue.h("div",{key:e[0].date,ref:e=>{l.value[t]=e},class:{"q-calendar-month__week--wrapper":!0,"q-calendar-month__week--auto-height":u},style:o},[!0===v.showWorkWeeks?we(e):void 0,vue.h("div",{class:"q-calendar-month__week"},[vue.h("div",{class:"q-calendar-month__week--days"},e.map(e=>Te(e))),!0!==I.value&&void 0!==a?vue.h("div",{ref:e=>{s.value[t]=e},class:"q-calendar-month__week--events"},a({scope:r})):void 0])])}function we(e){const t=y.workweek,a=e.length>2?e[2]:e[0],n=se(e).timestamp,r=Number(a.workweek).toLocaleString(v.locale),o={workweekLabel:r,week:e,miniMode:I.value};return vue.h("div",{key:a.workweek,class:{"q-calendar-month__workweek":!0,...K(!1!==n?n:a,!1)},...E("-workweek",e=>{return{scope:o,event:e}})},t?t({scope:o}):r)}function Te(t){const e=y.day,a=v.dayStyle||b,n=ee(t),r=!0!==v.noActiveDate&&M.value.date===t.date,o=!1===n&&!0===v.showMonthLabel&&N.value.find(e=>e.month===t.month)?.day===t.day,d={outside:n,timestamp:t,miniMode:I.value,activeDate:r,hasMonth:o,droppable:g.value===t.date,disabled:!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(t.weekday))},i=Object.assign({...$.value},a({scope:d})),u="function"===typeof v.dayClass?v.dayClass({scope:d}):{},s={key:t.date,ref:e=>{!0===F.value&&(m.value[t.date]=e)},tabindex:!0===F.value?0:-1,class:{"q-calendar-month__day":!0,...u,...K(t,n,Array.from(v.selectedDates),v.selectedStartEndDates,v.hover),"q-active-date":!0===r,disabled:!0!==v.enableOutsideDays&&!0===n,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===F.value},style:i,onFocus:()=>{!0===F.value&&(p.value=t.date)},onKeydown:e=>{!0!==n&&!0!==t.disabled&&S(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0!==n&&!0!==t.disabled&&S(e,[13,32])&&(e.stopPropagation(),e.preventDefault(),void 0!==D.value.onClickDay)&&!0!==I.value&&c("click-day",{scope:d,e:e})},...E("-day",e=>{return{scope:d,event:e}})},l={onDragenter:e=>{void 0!==v.dragEnterFunc&&"function"===typeof v.dragEnterFunc&&(!0===v.dragEnterFunc(e,"day",{scope:d})?g.value=t.date:g.value="")},onDragover:e=>{void 0!==v.dragOverFunc&&"function"===typeof v.dragOverFunc&&(!0===v.dragOverFunc(e,"day",{scope:d})?g.value=t.date:g.value="")},onDragleave:e=>{void 0!==v.dragLeaveFunc&&"function"===typeof v.dragLeaveFunc&&(!0===v.dragLeaveFunc(e,"day",{scope:d})?g.value=t.date:g.value="")},onDrop:e=>{void 0!==v.dropFunc&&"function"===typeof v.dropFunc&&(!0===v.dropFunc(e,"day",{scope:d})?g.value=t.date:g.value="")}};return!0!==n&&Object.assign(s,l),!0!==v.noAria&&(s.ariaLabel=Z.value(t,!1)),vue.h("div",s,[be(t,n,o),vue.h("div",{class:{"q-calendar-month__day--content":!0}},e?e({scope:d}):void 0),!0===F.value&&useFocusHelper()])}function be(e,t,a){let n,r;const o=[Me(e,t)],d=(!0!==I.value&&!0===a&&u.width>340&&(r=Ne(e,t)),!0!==I.value&&!0===v.showDayOfYearLabel&&void 0===r&&u.width>300&&(n=_e(e,t)),"left"===v.dateAlign?(void 0!==n&&o.push(n),void 0!==r&&o.push(r)):"right"===v.dateAlign?(void 0!==n&&o.unshift(n),void 0!==r&&o.unshift(r)):(n=void 0,r=void 0),{class:{"q-calendar-month__day--label__wrapper":!0,"q-calendar__ellipsis":!0,["q-calendar__"+v.dateAlign]:void 0===n&&void 0===r,"q-calendar__justify":void 0!==n||void 0!==r}});return vue.h("div",d,o)}function Me(a,t){if(!0!==t||!0!==v.noOutsideDays){const e=V.value(a,!1),n=y["head-day-label"],r=y["head-day-button"],o=v.selectedDates&&Array.from(v.selectedDates).length>0&&Array.from(v.selectedDates).includes(a.date),d=!0!==v.noActiveDate&&C(a),i={dayLabel:e,timestamp:a,outside:t,activeDate:d,selectedDate:o,miniMode:I.value,disabled:!!v.disabledWeekdays&&v.disabledWeekdays.includes(Number(a.weekday))},u={key:a.date,ref:e=>{!0===A.value&&(m.value[a.date]=e)},tabindex:!0===A.value?0:-1,class:{"q-calendar-month__day--label":!0,"q-calendar__button":!0,"q-calendar__button--round":"round"===v.dateType,"q-calendar__button--rounded":"rounded"===v.dateType,"q-calendar__button--bordered":!0===a.current,"q-calendar__hoverable":!0===v.hoverable,"q-calendar__focusable":!0===A.value},disabled:!0===a.disabled||!0!==v.enableOutsideDays&&!0===t,onFocus:()=>{!0===A.value&&(p.value=a.date)},onKeydown:e=>{!0!==t&&!0!==a.disabled&&S(e,[13,32])&&(e.stopPropagation(),e.preventDefault())},onKeyup:e=>{!0===A.value&&!0!==t&&!0!==a.disabled&&S(e,[13,32])&&(e.stopPropagation(),e.preventDefault(),f.value=a.date,void 0!==D.value.onClickDate)&&c("click-date",{scope:i,event:e})},...E("-date",(e,t)=>{return e.stopPropagation(),"click-date"!==t&&"contextmenu-date"!==t||(f.value=a.date),{scope:i,event:e}})};return!0!==v.noAria&&(u.ariaLabel=Z.value(a,!1)),[r?r({scope:i}):renderButton(v,u,n?n({scope:i}):e),!0===A.value&&useFocusHelper()].filter(e=>!1!==e)}}function _e(e,t){if(!0!==t||!0!==v.noOutsideDays){const a=y["day-of-year"],n={timestamp:e};return vue.h("span",{class:{"q-calendar-month__day--day-of-year":!0,"q-calendar__ellipsis":!0}},a?a({scope:n}):e.doy)}}function Ne(e,t){if(!0!==t||!0!==v.noOutsideDays){const a=y["month-label"],n=te.value(e,v.shortMonthLabel||u.width<500),r={monthLabel:n,timestamp:e,miniMode:I.value},o={};return!0!==I.value&&void 0!==J.value&&(o.fontSize=J.value),vue.h("span",{class:"q-calendar-month__day--month q-calendar__ellipsis",style:o},[a?a({scope:r}):!0!==I.value?n:void 0])}}function Ie(){const{start:e,end:t}=j.value,a=(d.value=e.date,i.value=t.date,u.width>0),n=vue.withDirectives(vue.h("div",{class:{"q-calendar-mini":!0===I.value,"q-calendar-month":!0},key:d.value},[!0===a&&!0!==v.noHeader&&me(),!0===a&&ce()]),[[ResizeObserverDirective,ue]]);if(!0!==v.animated)return n;{const r="q-calendar--"+("prev"===o.value?v.transitionPrev:v.transitionNext);return vue.h(vue.Transition,{name:r,appear:!0},()=>n)}}return vue.watch([N],ae,{deep:!0,immediate:!0}),vue.watch(()=>v.modelValue,(e,t)=>{if(f.value!==e){if(!0===v.animated){const a=getDayIdentifier(parsed(e)),n=getDayIdentifier(parsed(t));o.value=a>=n?"next":"prev"}f.value=e}p.value=e}),vue.watch(f,(e,t)=>{if(f.value!==v.modelValue){if(!0===v.animated){const a=getDayIdentifier(parsed(e)),n=getDayIdentifier(parsed(t));o.value=a>=n?"next":"prev"}c("update:model-value",e)}}),vue.watch(p,e=>{e&&(t.value=parseTimestamp(e),f.value!==e)&&(f.value=e)}),vue.watch(t,()=>{m.value[p.value]?m.value[p.value].focus():ne()}),vue.onBeforeUpdate(()=>{m.value={},s.value=[],l.value=[],vue.nextTick(()=>{le()})}),vue.onMounted(()=>{le()}),R({prev:ie,next:de,move:x,moveToToday:oe,updateCurrent:k}),()=>X()}});const version="4.1.2";exports.DAYS_IN_MONTH=DAYS_IN_MONTH,exports.DAYS_IN_MONTH_LEAP=DAYS_IN_MONTH_LEAP,exports.DAYS_IN_MONTH_MAX=DAYS_IN_MONTH_MAX,exports.DAYS_IN_MONTH_MIN=DAYS_IN_MONTH_MIN,exports.DAY_MIN=DAY_MIN,exports.FIRST_HOUR=FIRST_HOUR,exports.MONTH_MAX=MONTH_MAX,exports.MONTH_MIN=MONTH_MIN,exports.PARSE_DATE=PARSE_DATE,exports.PARSE_DATETIME=PARSE_DATETIME,exports.PARSE_TIME=PARSE_TIME,exports.QCalendarMonth=QCalendarMonth,exports.TIME_CONSTANTS=TIME_CONSTANTS,exports.addToDate=addToDate,exports.compareDate=compareDate,exports.compareDateTime=compareDateTime,exports.compareTime=compareTime,exports.compareTimestamps=compareTimestamps,exports.convertToUnit=convertToUnit,exports.copyTimestamp=copyTimestamp,exports.createDayList=createDayList,exports.createIntervalList=createIntervalList,exports.createNativeLocaleFormatter=createNativeLocaleFormatter,exports.daysBetween=daysBetween,exports.daysInMonth=daysInMonth,exports.diffTimestamp=diffTimestamp,exports.findWeekday=findWeekday,exports.getDate=getDate,exports.getDateTime=getDateTime,exports.getDayIdentifier=getDayIdentifier,exports.getDayOfYear=getDayOfYear,exports.getDayTimeIdentifier=getDayTimeIdentifier,exports.getEndOfMonth=getEndOfMonth,exports.getEndOfWeek=getEndOfWeek,exports.getMonthFormatter=getMonthFormatter,exports.getMonthNames=getMonthNames,exports.getStartOfMonth=getStartOfMonth,exports.getStartOfWeek=getStartOfWeek,exports.getTime=getTime,exports.getTimeIdentifier=getTimeIdentifier,exports.getWeekday=getWeekday,exports.getWeekdayFormatter=getWeekdayFormatter,exports.getWeekdayNames=getWeekdayNames,exports.getWorkWeek=getWorkWeek,exports.indexOf=indexOf,exports.isBetweenDates=isBetweenDates,exports.isLeapYear=isLeapYear,exports.isOverlappingDates=isOverlappingDates,exports.isToday=isToday,exports.makeDate=makeDate,exports.makeDateTime=makeDateTime,exports.maxTimestamp=maxTimestamp,exports.minCharWidth=minCharWidth,exports.minTimestamp=minTimestamp,exports.moveRelativeDays=moveRelativeDays,exports.nextDay=nextDay,exports.padNumber=padNumber,exports.parseDate=parseDate,exports.parseTime=parseTime,exports.parseTimestamp=parseTimestamp,exports.parsed=parsed,exports.prevDay=prevDay,exports.relativeDays=relativeDays,exports.today=today,exports.updateDayOfYear=updateDayOfYear,exports.updateDisabled=updateDisabled,exports.updateFormatted=updateFormatted,exports.updateMinutes=updateMinutes,exports.updateRelative=updateRelative,exports.updateWeekday=updateWeekday,exports.updateWorkWeek=updateWorkWeek,exports.validateNumber=validateNumber,exports.validateTimestamp=validateTimestamp,exports.version=version,exports.weeksBetween=weeksBetween;