/*!FullCalendarDayGridPluginv4.4.0Docs&License:https://fullcalendar.io/(c)2019AdamShaw*/(function (global, base_factory) { typeof exports === 'object' && typeof module !== 'undefined' ? base_factory(exports, require('@fullcalendar/core')):typeofdefine==='function'&&define.amd?define(['exports','@fullcalendar/core'],base_factory):(global=global||self,base_factory(global.FullCalendarDayGrid={},global.FullCalendar));}(this,function(exports,core){'use strict';/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0THISCODEISPROVIDEDONAN*ASIS*BASIS,WITHOUTWARRANTIESORCONDITIONSOFANYKIND,EITHEREXPRESSORIMPLIED,INCLUDINGWITHOUTLIMITATIONANYIMPLIEDWARRANTIESORCONDITIONSOFTITLE,FITNESSFORAPARTICULARPURPOSE,MERCHANTABLITYORNON-INFRINGEMENT.SeetheApacheVersion2.0LicenseforspecificlanguagegoverningpermissionsandlimitationsundertheLicense.******************************************************************************/ /*globalReflect,Promise*/ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf ||({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; var DayGridDateProfileGenerator = /**@class*/ (function (_super) { __extends(DayGridDateProfileGenerator, _super); function DayGridDateProfileGenerator() { return _super !== null && _super.apply(this, arguments) || this; } //Computesthedaterangethatwillberendered.DayGridDateProfileGenerator.prototype.buildRenderRange=function(currentRange,currentRangeUnit,isRangeAllDay){vardateEnv=this.dateEnv;varrenderRange=_super.prototype.buildRenderRange.call(this,currentRange,currentRangeUnit,isRangeAllDay);varstart=renderRange.start;varend=renderRange.end;varendOfWeek;// year and month views should be aligned with weeks. this is already done for weekif(/^(year|month)$/.test(currentRangeUnit)){start=dateEnv.startOfWeek(start);// make end-of-week if not alreadyendOfWeek=dateEnv.startOfWeek(end);if(endOfWeek.valueOf()!==end.valueOf()){end=core.addWeeks(endOfWeek,1);}}// ensure 6 weeksif(this.options.monthMode&&this.options.fixedWeekCount){varrowCnt=Math.ceil(// could be partial weeks due to hiddenDayscore.diffWeeks(start,end));end=core.addWeeks(end,6-rowCnt);}return{start:start,end:end};};returnDayGridDateProfileGenerator;}(core.DateProfileGenerator));/* A rectangular panel that is absolutely positioned over other content ------------------------------------------------------------------------------------------------------------------------ Options: - className (string) - content (HTML string, element, or element array) - parentEl - top - left - right (the x coord of where the right edge should be. not a "CSS" right) - autoHide (boolean) - show (callback) - hide (callback) */varPopover=/** @class */(function(){functionPopover(options){var_this=this;this.isHidden=true;this.margin=10;// the space required between the popover and the edges of the scroll container// Triggered when the user clicks *anywhere* in the document, for the autoHide featurethis.documentMousedown=function(ev){// only hide the popover if the click happened outside the popoverif(_this.el&&!_this.el.contains(ev.target)){_this.hide();}};this.options=options;}// Shows the popover on the specified position. Renders it if not alreadyPopover.prototype.show=function(){if(this.isHidden){if(!this.el){this.render();}this.el.style.display='';this.position();this.isHidden=false;this.trigger('show');}};// Hides the popover, through CSS, but does not remove it from the DOMPopover.prototype.hide=function(){if(!this.isHidden){this.el.style.display='none';this.isHidden=true;this.trigger('hide');}};// Creates `this.el` and renders content inside of itPopover.prototype.render=function(){var_this=this;varoptions=this.options;varel=this.el=core.createElement('div',{className:'fc-popover '+(options.className||''),style:{top:'0',left:'0'}});if(typeofoptions.content==='function'){options.content(el);}options.parentEl.appendChild(el);// when a click happens on anything inside with a 'fc-close' className, hide the popovercore.listenBySelector(el,'click','.fc-close',function(ev){_this.hide();});if(options.autoHide){document.addEventListener('mousedown',this.documentMousedown);}};// Hides and unregisters any handlersPopover.prototype.destroy=function(){this.hide();if(this.el){core.removeElement(this.el);this.el=null;}document.removeEventListener('mousedown',this.documentMousedown);};// Positions the popover optimally, using the top/left/right optionsPopover.prototype.position=function(){varoptions=this.options;varel=this.el;varelDims=el.getBoundingClientRect();// only used for width,heightvarorigin=core.computeRect(el.offsetParent);varclippingRect=core.computeClippingRect(options.parentEl);vartop;// the "position" (not "offset") values for the popovervarleft;//// compute top and lefttop=options.top||0;if(options.left!==undefined){left=options.left;}elseif(options.right!==undefined){left=options.right-elDims.width;// derive the left value from the right value}else{left=0;}// constrain to the view port. if constrained by two edges, give precedence to top/lefttop=Math.min(top,clippingRect.bottom-elDims.height-this.margin);top=Math.max(top,clippingRect.top+this.margin);left=Math.min(left,clippingRect.right-elDims.width-this.margin);left=Math.max(left,clippingRect.left+this.margin);core.applyStyle(el,{top:top-origin.top,left:left-origin.left});};// Triggers a callback. Calls a function in the option hash of the same name.// Arguments beyond the first `name` are forwarded on.// TODO: better code reuse for this. Repeat code// can kill this???Popover.prototype.trigger=function(name){if(this.options[name]){this.options[name].apply(this,Array.prototype.slice.call(arguments,1));}};returnPopover;}());/* Event-rendering methods for the DayGrid class ----------------------------------------------------------------------------------------------------------------------*/// "Simple" is bad a name. has nothing to do with SimpleDayGridvarSimpleDayGridEventRenderer=/** @class */(function(_super){__extends(SimpleDayGridEventRenderer,_super);functionSimpleDayGridEventRenderer(){return_super!==null&&_super.apply(this,arguments)||this;}// Builds the HTML to be used for the default element for an individual segmentSimpleDayGridEventRenderer.prototype.renderSegHtml=function(seg,mirrorInfo){varcontext=this.context;vareventRange=seg.eventRange;vareventDef=eventRange.def;vareventUi=eventRange.ui;varallDay=eventDef.allDay;varisDraggable=core.computeEventDraggable(context,eventDef,eventUi);varisResizableFromStart=allDay&&seg.isStart&&core.computeEventStartResizable(context,eventDef,eventUi);varisResizableFromEnd=allDay&&seg.isEnd&&core.computeEventEndResizable(context,eventDef,eventUi);varclasses=this.getSegClasses(seg,isDraggable,isResizableFromStart||isResizableFromEnd,mirrorInfo);varskinCss=core.cssToStr(this.getSkinCss(eventUi));vartimeHtml='';vartimeText;vartitleHtml;classes.unshift('fc-day-grid-event','fc-h-event');// Only display a timed events time if it is the starting segmentif(seg.isStart){timeText=this.getTimeText(eventRange);if(timeText){timeHtml='<span class="fc-time">'+core.htmlEscape(timeText)+'</span>';}}titleHtml='<span class="fc-title">'+(core.htmlEscape(eventDef.title||'')||' ')+// we always want one line of height'</span>';return'<a class="'+classes.join(' ')+'"'+(eventDef.url?' href="'+core.htmlEscape(eventDef.url)+'"':'')+(skinCss?' style="'+skinCss+'"':'')+'>'+'<div class="fc-content">'+(context.options.dir==='rtl'?titleHtml+' '+timeHtml:// put a natural space in betweentimeHtml+' '+titleHtml//)+'</div>'+(isResizableFromStart?'<div class="fc-resizer fc-start-resizer"></div>':'')+(isResizableFromEnd?'<div class="fc-resizer fc-end-resizer"></div>':'')+'</a>';};// Computes a default event time formatting string if `eventTimeFormat` is not explicitly definedSimpleDayGridEventRenderer.prototype.computeEventTimeFormat=function(){return{hour:'numeric',minute:'2-digit',omitZeroMinute:true,meridiem:'narrow'};};SimpleDayGridEventRenderer.prototype.computeDisplayEventEnd=function(){returnfalse;// TODO: somehow consider the originating DayGrid's column count};returnSimpleDayGridEventRenderer;}(core.FgEventRenderer));/* Event-rendering methods for the DayGrid class ----------------------------------------------------------------------------------------------------------------------*/varDayGridEventRenderer=/** @class */(function(_super){__extends(DayGridEventRenderer,_super);functionDayGridEventRenderer(dayGrid){var_this=_super.call(this)||this;_this.dayGrid=dayGrid;return_this;}// Renders the given foreground event segments onto the gridDayGridEventRenderer.prototype.attachSegs=function(segs,mirrorInfo){varrowStructs=this.rowStructs=this.renderSegRows(segs);// append to each row's content skeletonthis.dayGrid.rowEls.forEach(function(rowNode,i){rowNode.querySelector('.fc-content-skeleton > table').appendChild(rowStructs[i].tbodyEl);});// removes the "more.." events popoverif(!mirrorInfo){this.dayGrid.removeSegPopover();}};// Unrenders all currently rendered foreground event segmentsDayGridEventRenderer.prototype.detachSegs=function(){varrowStructs=this.rowStructs||[];varrowStruct;while((rowStruct=rowStructs.pop())){core.removeElement(rowStruct.tbodyEl);}this.rowStructs=null;};// Uses the given events array to generate <tbody> elements that should be appended to each row's content skeleton.// Returns an array of rowStruct objects (see the bottom of `renderSegRow`).// PRECONDITION: each segment shoud already have a rendered and assigned `.el`DayGridEventRenderer.prototype.renderSegRows=function(segs){varrowStructs=[];varsegRows;varrow;segRows=this.groupSegRows(segs);// group into nested arrays// iterate each row of segment groupingsfor(row=0;row<segRows.length;row++){rowStructs.push(this.renderSegRow(row,segRows[row]));}returnrowStructs;};// Given a row # and an array of segments all in the same row, render a <tbody> element, a skeleton that contains// the segments. Returns object with a bunch of internal data about how the render was calculated.// NOTE: modifies rowSegsDayGridEventRenderer.prototype.renderSegRow=function(row,rowSegs){varisRtl=this.context.isRtl;vardayGrid=this.dayGrid;varcolCnt=dayGrid.colCnt;varsegLevels=this.buildSegLevels(rowSegs);// group into sub-arrays of levelsvarlevelCnt=Math.max(1,segLevels.length);// ensure at least one levelvartbody=document.createElement('tbody');varsegMatrix=[];// lookup for which segments are rendered into which level+col cellsvarcellMatrix=[];// lookup for all <td> elements of the level+col matrixvarloneCellMatrix=[];// lookup for <td> elements that only take up a single columnvari;varlevelSegs;varcol;vartr;varj;varseg;vartd;// populates empty cells from the current column (`col`) to `endCol`functionemptyCellsUntil(endCol){while(col<endCol){// try to grab a cell from the level above and extend its rowspan. otherwise, create a fresh celltd=(loneCellMatrix[i-1]||[])[col];if(td){td.rowSpan=(td.rowSpan||1)+1;}else{td=document.createElement('td');tr.appendChild(td);}cellMatrix[i][col]=td;loneCellMatrix[i][col]=td;col++;}}for(i=0;i<levelCnt;i++){// iterate through all levelslevelSegs=segLevels[i];col=0;tr=document.createElement('tr');segMatrix.push([]);cellMatrix.push([]);loneCellMatrix.push([]);// levelCnt might be 1 even though there are no actual levels. protect against this.// this single empty row is useful for styling.if(levelSegs){for(j=0;j<levelSegs.length;j++){// iterate through segments in levelseg=levelSegs[j];varleftCol=isRtl?(colCnt-1-seg.lastCol):seg.firstCol;varrightCol=isRtl?(colCnt-1-seg.firstCol):seg.lastCol;emptyCellsUntil(leftCol);// create a container that occupies or more columns. append the event element.td=core.createElement('td',{className:'fc-event-container'},seg.el);if(leftCol!==rightCol){td.colSpan=rightCol-leftCol+1;}else{// a single-column segmentloneCellMatrix[i][col]=td;}while(col<=rightCol){cellMatrix[i][col]=td;segMatrix[i][col]=seg;col++;}tr.appendChild(td);}}emptyCellsUntil(colCnt);// finish off the rowvarintroHtml=dayGrid.renderProps.renderIntroHtml();if(introHtml){if(isRtl){core.appendToElement(tr,introHtml);}else{core.prependToElement(tr,introHtml);}}tbody.appendChild(tr);}return{row:row,tbodyEl:tbody,cellMatrix:cellMatrix,segMatrix:segMatrix,segLevels:segLevels,segs:rowSegs};};// Stacks a flat array of segments, which are all assumed to be in the same row, into subarrays of vertical levels.// NOTE: modifies segsDayGridEventRenderer.prototype.buildSegLevels=function(segs){varisRtl=this.context.isRtl;varcolCnt=this.dayGrid.colCnt;varlevels=[];vari;varseg;varj;// Give preference to elements with certain criteria, so they have// a chance to be closer to the top.segs=this.sortEventSegs(segs);for(i=0;i<segs.length;i++){seg=segs[i];// loop through levels, starting with the topmost, until the segment doesn't collide with other segmentsfor(j=0;j<levels.length;j++){if(!isDaySegCollision(seg,levels[j])){break;}}// `j` now holds the desired subrow indexseg.level=j;seg.leftCol=isRtl?(colCnt-1-seg.lastCol):seg.firstCol;// for sorting onlyseg.rightCol=isRtl?(colCnt-1-seg.firstCol):seg.lastCol// for sorting only;(levels[j]||(levels[j]=[])).push(seg);}// order segments left-to-right. very important if calendar is RTLfor(j=0;j<levels.length;j++){levels[j].sort(compareDaySegCols);}returnlevels;};// Given a flat array of segments, return an array of sub-arrays, grouped by each segment's rowDayGridEventRenderer.prototype.groupSegRows=function(segs){varsegRows=[];vari;for(i=0;i<this.dayGrid.rowCnt;i++){segRows.push([]);}for(i=0;i<segs.length;i++){segRows[segs[i].row].push(segs[i]);}returnsegRows;};// Computes a default `displayEventEnd` value if one is not expliclty definedDayGridEventRenderer.prototype.computeDisplayEventEnd=function(){returnthis.dayGrid.colCnt===1;// we'll likely have space if there's only one day};returnDayGridEventRenderer;}(SimpleDayGridEventRenderer));// Computes whether two segments' columns collide. They are assumed to be in the same row.functionisDaySegCollision(seg,otherSegs){vari;varotherSeg;for(i=0;i<otherSegs.length;i++){otherSeg=otherSegs[i];if(otherSeg.firstCol<=seg.lastCol&&otherSeg.lastCol>=seg.firstCol){returntrue;}}returnfalse;}// A cmp function for determining the leftmost eventfunctioncompareDaySegCols(a,b){returna.leftCol-b.leftCol;}varDayGridMirrorRenderer=/** @class */(function(_super){__extends(DayGridMirrorRenderer,_super);functionDayGridMirrorRenderer(){return_super!==null&&_super.apply(this,arguments)||this;}DayGridMirrorRenderer.prototype.attachSegs=function(segs,mirrorInfo){varsourceSeg=mirrorInfo.sourceSeg;varrowStructs=this.rowStructs=this.renderSegRows(segs);// inject each new event skeleton into each associated rowthis.dayGrid.rowEls.forEach(function(rowNode,row){varskeletonEl=core.htmlToElement('<div class="fc-mirror-skeleton"><table></table></div>');// will be absolutely positionedvarskeletonTopEl;varskeletonTop;// If there is an original segment, match the top position. Otherwise, put it at the row's top levelif(sourceSeg&&sourceSeg.row===row){skeletonTopEl=sourceSeg.el;}else{skeletonTopEl=rowNode.querySelector('.fc-content-skeleton tbody');if(!skeletonTopEl){// when no eventsskeletonTopEl=rowNode.querySelector('.fc-content-skeleton table');}}skeletonTop=skeletonTopEl.getBoundingClientRect().top-rowNode.getBoundingClientRect().top;// the offsetParent originskeletonEl.style.top=skeletonTop+'px';skeletonEl.querySelector('table').appendChild(rowStructs[row].tbodyEl);rowNode.appendChild(skeletonEl);});};returnDayGridMirrorRenderer;}(DayGridEventRenderer));varEMPTY_CELL_HTML='<td style="pointer-events:none"></td>';varDayGridFillRenderer=/** @class */(function(_super){__extends(DayGridFillRenderer,_super);functionDayGridFillRenderer(dayGrid){var_this=_super.call(this)||this;_this.fillSegTag='td';// override the default tag name_this.dayGrid=dayGrid;return_this;}DayGridFillRenderer.prototype.renderSegs=function(type,context,segs){// don't render timed background eventsif(type==='bgEvent'){segs=segs.filter(function(seg){returnseg.eventRange.def.allDay;});}_super.prototype.renderSegs.call(this,type,context,segs);};DayGridFillRenderer.prototype.attachSegs=function(type,segs){varels=[];vari;varseg;varskeletonEl;for(i=0;i<segs.length;i++){seg=segs[i];skeletonEl=this.renderFillRow(type,seg);this.dayGrid.rowEls[seg.row].appendChild(skeletonEl);els.push(skeletonEl);}returnels;};// Generates the HTML needed for one row of a fill. Requires the seg's el to be rendered.DayGridFillRenderer.prototype.renderFillRow=function(type,seg){vardayGrid=this.dayGrid;varisRtl=this.context.isRtl;varcolCnt=dayGrid.colCnt;varleftCol=isRtl?(colCnt-1-seg.lastCol):seg.firstCol;varrightCol=isRtl?(colCnt-1-seg.firstCol):seg.lastCol;varstartCol=leftCol;varendCol=rightCol+1;varclassName;varskeletonEl;vartrEl;if(type==='businessHours'){className='bgevent';}else{className=type.toLowerCase();}skeletonEl=core.htmlToElement('<div class="fc-'+className+'-skeleton">'+'<table><tr></tr></table>'+'</div>');trEl=skeletonEl.getElementsByTagName('tr')[0];if(startCol>0){core.appendToElement(trEl,// will create (startCol + 1) td'snewArray(startCol+1).join(EMPTY_CELL_HTML));}seg.el.colSpan=endCol-startCol;trEl.appendChild(seg.el);if(endCol<colCnt){core.appendToElement(trEl,// will create (colCnt - endCol) td'snewArray(colCnt-endCol+1).join(EMPTY_CELL_HTML));}varintroHtml=dayGrid.renderProps.renderIntroHtml();if(introHtml){if(isRtl){core.appendToElement(trEl,introHtml);}else{core.prependToElement(trEl,introHtml);}}returnskeletonEl;};returnDayGridFillRenderer;}(core.FillRenderer));varDayTile=/** @class */(function(_super){__extends(DayTile,_super);functionDayTile(el){var_this=_super.call(this,el)||this;vareventRenderer=_this.eventRenderer=newDayTileEventRenderer(_this);varrenderFrame=_this.renderFrame=core.memoizeRendering(_this._renderFrame);_this.renderFgEvents=core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer),eventRenderer.unrender.bind(eventRenderer),[renderFrame]);_this.renderEventSelection=core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer),eventRenderer.unselectByInstanceId.bind(eventRenderer),[_this.renderFgEvents]);_this.renderEventDrag=core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer),eventRenderer.showByHash.bind(eventRenderer),[renderFrame]);_this.renderEventResize=core.memoizeRendering(eventRenderer.hideByHash.bind(eventRenderer),eventRenderer.showByHash.bind(eventRenderer),[renderFrame]);return_this;}DayTile.prototype.firstContext=function(context){context.calendar.registerInteractiveComponent(this,{el:this.el,useEventCenter:false});};DayTile.prototype.render=function(props,context){this.renderFrame(props.date);this.renderFgEvents(context,props.fgSegs);this.renderEventSelection(props.eventSelection);this.renderEventDrag(props.eventDragInstances);this.renderEventResize(props.eventResizeInstances);};DayTile.prototype.destroy=function(){_super.prototype.destroy.call(this);this.renderFrame.unrender();// should unrender everything elsethis.context.calendar.unregisterInteractiveComponent(this);};DayTile.prototype._renderFrame=function(date){var_a=this.context,theme=_a.theme,dateEnv=_a.dateEnv,options=_a.options;vartitle=dateEnv.format(date,core.createFormatter(options.dayPopoverFormat)// TODO: cache);this.el.innerHTML='<div class="fc-header '+theme.getClass('popoverHeader')+'">'+'<span class="fc-title">'+core.htmlEscape(title)+'</span>'+'<span class="fc-close '+theme.getIconClass('close')+'"></span>'+'</div>'+'<div class="fc-body '+theme.getClass('popoverContent')+'">'+'<div class="fc-event-container"></div>'+'</div>';this.segContainerEl=this.el.querySelector('.fc-event-container');};DayTile.prototype.queryHit=function(positionLeft,positionTop,elWidth,elHeight){vardate=this.props.date;// HACKif(positionLeft<elWidth&&positionTop<elHeight){return{component:this,dateSpan:{allDay:true,range:{start:date,end:core.addDays(date,1)}},dayEl:this.el,rect:{left:0,top:0,right:elWidth,bottom:elHeight},layer:1};}};returnDayTile;}(core.DateComponent));varDayTileEventRenderer=/** @class */(function(_super){__extends(DayTileEventRenderer,_super);functionDayTileEventRenderer(dayTile){var_this=_super.call(this)||this;_this.dayTile=dayTile;return_this;}DayTileEventRenderer.prototype.attachSegs=function(segs){for(var_i=0,segs_1=segs;_i<segs_1.length;_i++){varseg=segs_1[_i];this.dayTile.segContainerEl.appendChild(seg.el);}};DayTileEventRenderer.prototype.detachSegs=function(segs){for(var_i=0,segs_2=segs;_i<segs_2.length;_i++){varseg=segs_2[_i];core.removeElement(seg.el);}};returnDayTileEventRenderer;}(SimpleDayGridEventRenderer));varDayBgRow=/** @class */(function(){functionDayBgRow(context){this.context=context;}DayBgRow.prototype.renderHtml=function(props){varparts=[];if(props.renderIntroHtml){parts.push(props.renderIntroHtml());}for(var_i=0,_a=props.cells;_i<_a.length;_i++){varcell=_a[_i];parts.push(renderCellHtml(cell.date,props.dateProfile,this.context,cell.htmlAttrs));}if(!props.cells.length){parts.push('<td class="fc-day '+this.context.theme.getClass('widgetContent')+'"></td>');}if(this.context.options.dir==='rtl'){parts.reverse();}return'<tr>'+parts.join('')+'</tr>';};returnDayBgRow;}());functionrenderCellHtml(date,dateProfile,context,otherAttrs){vardateEnv=context.dateEnv,theme=context.theme;varisDateValid=core.rangeContainsMarker(dateProfile.activeRange,date);// TODO: called too frequently. cache somehow.varclasses=core.getDayClasses(date,dateProfile,context);classes.unshift('fc-day',theme.getClass('widgetContent'));return'<td class="'+classes.join(' ')+'"'+(isDateValid?' data-date="'+dateEnv.formatIso(date,{omitTime:true})+'"':'')+(otherAttrs?' '+otherAttrs:'')+'></td>';}varDAY_NUM_FORMAT=core.createFormatter({day:'numeric'});varWEEK_NUM_FORMAT=core.createFormatter({week:'numeric'});varDayGrid=/** @class */(function(_super){__extends(DayGrid,_super);functionDayGrid(el,renderProps){var_this=_super.call(this,el)||this;_this.bottomCoordPadding=0;// hack for extending the hit area for the last row of the coordinate grid_this.isCellSizesDirty=false;_this.renderProps=renderProps;vareventRenderer=_this.eventRenderer=newDayGridEventRenderer(_this);varfillRenderer=_this.fillRenderer=newDayGridFillRenderer(_this);_this.mirrorRenderer=newDayGridMirrorRenderer(_this);varrenderCells=_this.renderCells=core.memoizeRendering(_this._renderCells,_this._unrenderCells);_this.renderBusinessHours=core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer,'businessHours'),fillRenderer.unrender.bind(fillRenderer,'businessHours'),[renderCells]);_this.renderDateSelection=core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer,'highlight'),fillRenderer.unrender.bind(fillRenderer,'highlight'),[renderCells]);_this.renderBgEvents=core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer,'bgEvent'),fillRenderer.unrender.bind(fillRenderer,'bgEvent'),[renderCells]);_this.renderFgEvents=core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer),eventRenderer.unrender.bind(eventRenderer),[renderCells]);_this.renderEventSelection=core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer),eventRenderer.unselectByInstanceId.bind(eventRenderer),[_this.renderFgEvents]);_this.renderEventDrag=core.memoizeRendering(_this._renderEventDrag,_this._unrenderEventDrag,[renderCells]);_this.renderEventResize=core.memoizeRendering(_this._renderEventResize,_this._unrenderEventResize,[renderCells]);return_this;}DayGrid.prototype.render=function(props,context){varcells=props.cells;this.rowCnt=cells.length;this.colCnt=cells[0].length;this.renderCells(cells,props.isRigid);this.renderBusinessHours(context,props.businessHourSegs);this.renderDateSelection(context,props.dateSelectionSegs);this.renderBgEvents(context,props.bgEventSegs);this.renderFgEvents(context,props.fgEventSegs);this.renderEventSelection(props.eventSelection);this.renderEventDrag(props.eventDrag);this.renderEventResize(props.eventResize);if(this.segPopoverTile){this.updateSegPopoverTile();}};DayGrid.prototype.destroy=function(){_super.prototype.destroy.call(this);this.renderCells.unrender();// will unrender everything else};DayGrid.prototype.getCellRange=function(row,col){varstart=this.props.cells[row][col].date;varend=core.addDays(start,1);return{start:start,end:end};};DayGrid.prototype.updateSegPopoverTile=function(date,segs){varownProps=this.props;this.segPopoverTile.receiveProps({date:date||this.segPopoverTile.props.date,fgSegs:segs||this.segPopoverTile.props.fgSegs,eventSelection:ownProps.eventSelection,eventDragInstances:ownProps.eventDrag?ownProps.eventDrag.affectedInstances:null,eventResizeInstances:ownProps.eventResize?ownProps.eventResize.affectedInstances:null},this.context);};/* Date Rendering ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype._renderCells=function(cells,isRigid){var_a=this.context,calendar=_a.calendar,view=_a.view,isRtl=_a.isRtl,dateEnv=_a.dateEnv;var_b=this,rowCnt=_b.rowCnt,colCnt=_b.colCnt;varhtml='';varrow;varcol;for(row=0;row<rowCnt;row++){html+=this.renderDayRowHtml(row,isRigid);}this.el.innerHTML=html;this.rowEls=core.findElements(this.el,'.fc-row');this.cellEls=core.findElements(this.el,'.fc-day, .fc-disabled-day');if(isRtl){this.cellEls.reverse();}this.rowPositions=newcore.PositionCache(this.el,this.rowEls,false,true// vertical);this.colPositions=newcore.PositionCache(this.el,this.cellEls.slice(0,colCnt),// only the first rowtrue,false// horizontal);// trigger dayRender with each cell's elementfor(row=0;row<rowCnt;row++){for(col=0;col<colCnt;col++){calendar.publiclyTrigger('dayRender',[{date:dateEnv.toDate(cells[row][col].date),el:this.getCellEl(row,col),view:view}]);}}this.isCellSizesDirty=true;};DayGrid.prototype._unrenderCells=function(){this.removeSegPopover();};// Generates the HTML for a single row, which is a div that wraps a table.// `row` is the row number.DayGrid.prototype.renderDayRowHtml=function(row,isRigid){vartheme=this.context.theme;varclasses=['fc-row','fc-week',theme.getClass('dayRow')];if(isRigid){classes.push('fc-rigid');}varbgRow=newDayBgRow(this.context);return''+'<div class="'+classes.join(' ')+'">'+'<div class="fc-bg">'+'<table class="'+theme.getClass('tableGrid')+'">'+bgRow.renderHtml({cells:this.props.cells[row],dateProfile:this.props.dateProfile,renderIntroHtml:this.renderProps.renderBgIntroHtml})+'</table>'+'</div>'+'<div class="fc-content-skeleton">'+'<table>'+(this.getIsNumbersVisible()?'<thead>'+this.renderNumberTrHtml(row)+'</thead>':'')+'</table>'+'</div>'+'</div>';};DayGrid.prototype.getIsNumbersVisible=function(){returnthis.getIsDayNumbersVisible()||this.renderProps.cellWeekNumbersVisible||this.renderProps.colWeekNumbersVisible;};DayGrid.prototype.getIsDayNumbersVisible=function(){returnthis.rowCnt>1;};/* Grid Number Rendering ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype.renderNumberTrHtml=function(row){varisRtl=this.context.isRtl;varintro=this.renderProps.renderNumberIntroHtml(row,this);return''+'<tr>'+(isRtl?'':intro)+this.renderNumberCellsHtml(row)+(isRtl?intro:'')+'</tr>';};DayGrid.prototype.renderNumberCellsHtml=function(row){varhtmls=[];varcol;vardate;for(col=0;col<this.colCnt;col++){date=this.props.cells[row][col].date;htmls.push(this.renderNumberCellHtml(date));}if(this.context.isRtl){htmls.reverse();}returnhtmls.join('');};// Generates the HTML for the <td>s of the "number" row in the DayGrid's content skeleton.// The number row will only exist if either day numbers or week numbers are turned on.DayGrid.prototype.renderNumberCellHtml=function(date){var_a=this.context,dateEnv=_a.dateEnv,options=_a.options;varhtml='';varisDateValid=core.rangeContainsMarker(this.props.dateProfile.activeRange,date);// TODO: called too frequently. cache somehow.varisDayNumberVisible=this.getIsDayNumbersVisible()&&isDateValid;varclasses;varweekCalcFirstDow;if(!isDayNumberVisible&&!this.renderProps.cellWeekNumbersVisible){// no numbers in day cell (week number must be along the side)return'<td></td>';// will create an empty space above events :(}classes=core.getDayClasses(date,this.props.dateProfile,this.context);classes.unshift('fc-day-top');if(this.renderProps.cellWeekNumbersVisible){weekCalcFirstDow=dateEnv.weekDow;}html+='<td class="'+classes.join(' ')+'"'+(isDateValid?' data-date="'+dateEnv.formatIso(date,{omitTime:true})+'"':'')+'>';if(this.renderProps.cellWeekNumbersVisible&&(date.getUTCDay()===weekCalcFirstDow)){html+=core.buildGotoAnchorHtml(options,dateEnv,{date:date,type:'week'},{'class':'fc-week-number'},dateEnv.format(date,WEEK_NUM_FORMAT)// inner HTML);}if(isDayNumberVisible){html+=core.buildGotoAnchorHtml(options,dateEnv,date,{'class':'fc-day-number'},dateEnv.format(date,DAY_NUM_FORMAT)// inner HTML);}// -------- 农历相关代码 --------varcTerm=lunar(date).term;if(cTerm){html+="<div class='fc-day-cnTerm'>"+cTerm+"</div>";}varfes=lunar(date).festival();if(fes&&fes.length>0){html+="<div class='fc-day-cnTerm'>"+fes[0].desc+"</div>";}if(!cTerm&&(!fes||fes.length==0)){html+="<div class='fc-day-cnDate'>"+lunar(date).lMonth+"月"+lunar(date).lDate+"</div>";}// -------- 农历相关代码 --------html+='</td>';returnhtml;};/* Sizing ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype.updateSize=function(isResize){varcalendar=this.context.calendar;var_a=this,fillRenderer=_a.fillRenderer,eventRenderer=_a.eventRenderer,mirrorRenderer=_a.mirrorRenderer;if(isResize||this.isCellSizesDirty||calendar.isEventsUpdated// hack){this.buildPositionCaches();this.isCellSizesDirty=false;}fillRenderer.computeSizes(isResize);eventRenderer.computeSizes(isResize);mirrorRenderer.computeSizes(isResize);fillRenderer.assignSizes(isResize);eventRenderer.assignSizes(isResize);mirrorRenderer.assignSizes(isResize);};DayGrid.prototype.buildPositionCaches=function(){this.buildColPositions();this.buildRowPositions();};DayGrid.prototype.buildColPositions=function(){this.colPositions.build();};DayGrid.prototype.buildRowPositions=function(){this.rowPositions.build();this.rowPositions.bottoms[this.rowCnt-1]+=this.bottomCoordPadding;// hack};/* Hit System ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype.positionToHit=function(leftPosition,topPosition){var_a=this,colPositions=_a.colPositions,rowPositions=_a.rowPositions;varcol=colPositions.leftToIndex(leftPosition);varrow=rowPositions.topToIndex(topPosition);if(row!=null&&col!=null){return{row:row,col:col,dateSpan:{range:this.getCellRange(row,col),allDay:true},dayEl:this.getCellEl(row,col),relativeRect:{left:colPositions.lefts[col],right:colPositions.rights[col],top:rowPositions.tops[row],bottom:rowPositions.bottoms[row]}};}};/* Cell System ------------------------------------------------------------------------------------------------------------------*/// FYI: the first column is the leftmost column, regardless of dateDayGrid.prototype.getCellEl=function(row,col){returnthis.cellEls[row*this.colCnt+col];};/* Event Drag Visualization ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype._renderEventDrag=function(state){if(state){this.eventRenderer.hideByHash(state.affectedInstances);this.fillRenderer.renderSegs('highlight',this.context,state.segs);}};DayGrid.prototype._unrenderEventDrag=function(state){if(state){this.eventRenderer.showByHash(state.affectedInstances);this.fillRenderer.unrender('highlight',this.context);}};/* Event Resize Visualization ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype._renderEventResize=function(state){if(state){this.eventRenderer.hideByHash(state.affectedInstances);this.fillRenderer.renderSegs('highlight',this.context,state.segs);this.mirrorRenderer.renderSegs(this.context,state.segs,{isResizing:true,sourceSeg:state.sourceSeg});}};DayGrid.prototype._unrenderEventResize=function(state){if(state){this.eventRenderer.showByHash(state.affectedInstances);this.fillRenderer.unrender('highlight',this.context);this.mirrorRenderer.unrender(this.context,state.segs,{isResizing:true,sourceSeg:state.sourceSeg});}};/* More+ Link Popover ------------------------------------------------------------------------------------------------------------------*/DayGrid.prototype.removeSegPopover=function(){if(this.segPopover){this.segPopover.hide();// in handler, will call segPopover's removeElement}};// Limits the number of "levels" (vertically stacking layers of events) for each row of the grid.// `levelLimit` can be false (don't limit), a number, or true (should be computed).DayGrid.prototype.limitRows=function(levelLimit){varrowStructs=this.eventRenderer.rowStructs||[];varrow;// row #varrowLevelLimit;for(row=0;row<rowStructs.length;row++){this.unlimitRow(row);if(!levelLimit){rowLevelLimit=false;}elseif(typeoflevelLimit==='number'){rowLevelLimit=levelLimit;}else{rowLevelLimit=this.computeRowLevelLimit(row);}if(rowLevelLimit!==false){this.limitRow(row,rowLevelLimit);}}};// Computes the number of levels a row will accomodate without going outside its bounds.// Assumes the row is "rigid" (maintains a constant height regardless of what is inside).// `row` is the row number.DayGrid.prototype.computeRowLevelLimit=function(row){varrowEl=this.rowEls[row];// the containing "fake" row divvarrowBottom=rowEl.getBoundingClientRect().bottom;// relative to viewport!vartrEls=core.findChildren(this.eventRenderer.rowStructs[row].tbodyEl);vari;vartrEl;// Reveal one level <tr> at a time and stop when we find one out of boundsfor(i=0;i<trEls.length;i++){trEl=trEls[i];trEl.classList.remove('fc-limited');// reset to original state (reveal)if(trEl.getBoundingClientRect().bottom>rowBottom){returni;}}returnfalse;// should not limit at all};// Limits the given grid row to the maximum number of levels and injects "more" links if necessary.// `row` is the row number.// `levelLimit` is a number for the maximum (inclusive) number of levels allowed.DayGrid.prototype.limitRow=function(row,levelLimit){var_this=this;varcolCnt=this.colCnt;varisRtl=this.context.isRtl;varrowStruct=this.eventRenderer.rowStructs[row];varmoreNodes=[];// array of "more" <a> links and <td> DOM nodesvarcol=0;// col #, left-to-right (not chronologically)varlevelSegs;// array of segment objects in the last allowable level, ordered left-to-rightvarcellMatrix;// a matrix (by level, then column) of all <td> elements in the rowvarlimitedNodes;// array of temporarily hidden level <tr> and segment <td> DOM nodesvari;varseg;varsegsBelow;// array of segment objects below `seg` in the current `col`vartotalSegsBelow;// total number of segments below `seg` in any of the columns `seg` occupiesvarcolSegsBelow;// array of segment arrays, below seg, one for each column (offset from segs's first column)vartd;varrowSpan;varsegMoreNodes;// array of "more" <td> cells that will stand-in for the current seg's cellvarj;varmoreTd;varmoreWrap;varmoreLink;// Iterates through empty level cells and places "more" links inside if need bevaremptyCellsUntil=function(endCol){while(col<endCol){segsBelow=_this.getCellSegs(row,col,levelLimit);if(segsBelow.length){td=cellMatrix[levelLimit-1][col];moreLink=_this.renderMoreLink(row,col,segsBelow);moreWrap=core.createElement('div',null,moreLink);td.appendChild(moreWrap);moreNodes.push(moreWrap);}col++;}};if(levelLimit&&levelLimit<rowStruct.segLevels.length){// is it actually over the limit?levelSegs=rowStruct.segLevels[levelLimit-1];cellMatrix=rowStruct.cellMatrix;limitedNodes=core.findChildren(rowStruct.tbodyEl).slice(levelLimit);// get level <tr> elements past the limitlimitedNodes.forEach(function(node){node.classList.add('fc-limited');// hide elements and get a simple DOM-nodes array});// iterate though segments in the last allowable levelfor(i=0;i<levelSegs.length;i++){seg=levelSegs[i];varleftCol=isRtl?(colCnt-1-seg.lastCol):seg.firstCol;varrightCol=isRtl?(colCnt-1-seg.firstCol):seg.lastCol;emptyCellsUntil(leftCol);// process empty cells before the segment// determine *all* segments below `seg` that occupy the same columnscolSegsBelow=[];totalSegsBelow=0;while(col<=rightCol){segsBelow=this.getCellSegs(row,col,levelLimit);colSegsBelow.push(segsBelow);totalSegsBelow+=segsBelow.length;col++;}if(totalSegsBelow){// do we need to replace this segment with one or many "more" links?td=cellMatrix[levelLimit-1][leftCol];// the segment's parent cellrowSpan=td.rowSpan||1;segMoreNodes=[];// make a replacement <td> for each column the segment occupies. will be one for each colspanfor(j=0;j<colSegsBelow.length;j++){moreTd=core.createElement('td',{className:'fc-more-cell',rowSpan:rowSpan});segsBelow=colSegsBelow[j];moreLink=this.renderMoreLink(row,leftCol+j,[seg].concat(segsBelow)// count seg as hidden too);moreWrap=core.createElement('div',null,moreLink);moreTd.appendChild(moreWrap);segMoreNodes.push(moreTd);moreNodes.push(moreTd);}td.classList.add('fc-limited');core.insertAfterElement(td,segMoreNodes);limitedNodes.push(td);}}emptyCellsUntil(this.colCnt);// finish off the levelrowStruct.moreEls=moreNodes;// for easy undoing laterrowStruct.limitedEls=limitedNodes;// for easy undoing later}};// Reveals all levels and removes all "more"-related elements for a grid's row.// `row` is a row number.DayGrid.prototype.unlimitRow=function(row){varrowStruct=this.eventRenderer.rowStructs[row];if(rowStruct.moreEls){rowStruct.moreEls.forEach(core.removeElement);rowStruct.moreEls=null;}if(rowStruct.limitedEls){rowStruct.limitedEls.forEach(function(limitedEl){limitedEl.classList.remove('fc-limited');});rowStruct.limitedEls=null;}};// Renders an <a> element that represents hidden event element for a cell.// Responsible for attaching click handler as well.DayGrid.prototype.renderMoreLink=function(row,col,hiddenSegs){var_this=this;var_a=this.context,calendar=_a.calendar,view=_a.view,dateEnv=_a.dateEnv,options=_a.options,isRtl=_a.isRtl;vara=core.createElement('a',{className:'fc-more'});a.innerText=this.getMoreLinkText(hiddenSegs.length);a.addEventListener('click',function(ev){varclickOption=options.eventLimitClick;var_col=isRtl?_this.colCnt-col-1:col;// HACK: props.cells has different dir system?vardate=_this.props.cells[row][_col].date;varmoreEl=ev.currentTarget;vardayEl=_this.getCellEl(row,col);varallSegs=_this.getCellSegs(row,col);// rescope the segments to be within the cell's datevarreslicedAllSegs=_this.resliceDaySegs(allSegs,date);varreslicedHiddenSegs=_this.resliceDaySegs(hiddenSegs,date);if(typeofclickOption==='function'){// the returned value can be an atomic optionclickOption=calendar.publiclyTrigger('eventLimitClick',[{date:dateEnv.toDate(date),allDay:true,dayEl:dayEl,moreEl:moreEl,segs:reslicedAllSegs,hiddenSegs:reslicedHiddenSegs,jsEvent:ev,view:view}]);}if(clickOption==='popover'){_this.showSegPopover(row,col,moreEl,reslicedAllSegs);}elseif(typeofclickOption==='string'){// a view namecalendar.zoomTo(date,clickOption);}});returna;};// Reveals the popover that displays all events within a cellDayGrid.prototype.showSegPopover=function(row,col,moreLink,segs){var_this=this;var_a=this.context,calendar=_a.calendar,view=_a.view,theme=_a.theme,isRtl=_a.isRtl;var_col=isRtl?this.colCnt-col-1:col;// HACK: props.cells has different dir system?varmoreWrap=moreLink.parentNode;// the <div> wrapper around the <a>vartopEl;// the element we want to match the top coordinate ofvaroptions;if(this.rowCnt===1){topEl=view.el;// will cause the popover to cover any sort of header}else{topEl=this.rowEls[row];// will align with top of row}options={className:'fc-more-popover '+theme.getClass('popover'),parentEl:view.el,top:core.computeRect(topEl).top,autoHide:true,content:function(el){_this.segPopoverTile=newDayTile(el);_this.updateSegPopoverTile(_this.props.cells[row][_col].date,segs);},hide:function(){_this.segPopoverTile.destroy();_this.segPopoverTile=null;_this.segPopover.destroy();_this.segPopover=null;}};// Determine horizontal coordinate.// We use the moreWrap instead of the <td> to avoid border confusion.if(isRtl){options.right=core.computeRect(moreWrap).right+1;// +1 to be over cell border}else{options.left=core.computeRect(moreWrap).left-1;// -1 to be over cell border}this.segPopover=newPopover(options);this.segPopover.show();calendar.releaseAfterSizingTriggers();// hack for eventPositioned};// Given the events within an array of segment objects, reslice them to be in a single dayDayGrid.prototype.resliceDaySegs=function(segs,dayDate){vardayStart=dayDate;vardayEnd=core.addDays(dayStart,1);vardayRange={start:dayStart,end:dayEnd};varnewSegs=[];for(var_i=0,segs_1=segs;_i<segs_1.length;_i++){varseg=segs_1[_i];vareventRange=seg.eventRange;varorigRange=eventRange.range;varslicedRange=core.intersectRanges(origRange,dayRange);if(slicedRange){newSegs.push(__assign({},seg,{eventRange:{def:eventRange.def,ui:__assign({},eventRange.ui,{durationEditable:false}),instance:eventRange.instance,range:slicedRange},isStart:seg.isStart&&slicedRange.start.valueOf()===origRange.start.valueOf(),isEnd:seg.isEnd&&slicedRange.end.valueOf()===origRange.end.valueOf()}));}}returnnewSegs;};// Generates the text that should be inside a "more" link, given the number of events it representsDayGrid.prototype.getMoreLinkText=function(num){varopt=this.context.options.eventLimitText;if(typeofopt==='function'){returnopt(num);}else{return'+'+num+' '+opt;}};// Returns segments within a given cell.// If `startLevel` is specified, returns only events including and below that level. Otherwise returns all segs.DayGrid.prototype.getCellSegs=function(row,col,startLevel){varsegMatrix=this.eventRenderer.rowStructs[row].segMatrix;varlevel=startLevel||0;varsegs=[];varseg;while(level<segMatrix.length){seg=segMatrix[level][col];if(seg){segs.push(seg);}level++;}returnsegs;};returnDayGrid;}(core.DateComponent));varWEEK_NUM_FORMAT$1=core.createFormatter({week:'numeric'});/* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells. ----------------------------------------------------------------------------------------------------------------------*/// It is a manager for a DayGrid subcomponent, which does most of the heavy lifting.// It is responsible for managing width/height.varAbstractDayGridView=/** @class */(function(_super){__extends(AbstractDayGridView,_super);functionAbstractDayGridView(){var_this=_super!==null&&_super.apply(this,arguments)||this;_this.processOptions=core.memoize(_this._processOptions);_this.renderSkeleton=core.memoizeRendering(_this._renderSkeleton,_this._unrenderSkeleton);/* Header Rendering ------------------------------------------------------------------------------------------------------------------*/// Generates the HTML that will go before the day-of week header cells_this.renderHeadIntroHtml=function(){var_a=_this.context,theme=_a.theme,options=_a.options;if(_this.colWeekNumbersVisible){return''+'<th class="fc-week-number '+theme.getClass('widgetHeader')+'" '+_this.weekNumberStyleAttr()+'>'+'<span>'+// needed for matchCellWidthscore.htmlEscape(options.weekLabel)+'</span>'+'</th>';}return'';};/* Day Grid Rendering ------------------------------------------------------------------------------------------------------------------*/// Generates the HTML that will go before content-skeleton cells that display the day/week numbers_this.renderDayGridNumberIntroHtml=function(row,dayGrid){var_a=_this.context,options=_a.options,dateEnv=_a.dateEnv;varweekStart=dayGrid.props.cells[row][0].date;if(_this.colWeekNumbersVisible){return''+'<td class="fc-week-number" '+_this.weekNumberStyleAttr()+'>'+core.buildGotoAnchorHtml(// aside from link, important for matchCellWidthsoptions,dateEnv,{date:weekStart,type:'week',forceOff:dayGrid.colCnt===1},dateEnv.format(weekStart,WEEK_NUM_FORMAT$1)// inner HTML)+'</td>';}return'';};// Generates the HTML that goes before the day bg cells for each day-row_this.renderDayGridBgIntroHtml=function(){vartheme=_this.context.theme;if(_this.colWeekNumbersVisible){return'<td class="fc-week-number '+theme.getClass('widgetContent')+'" '+_this.weekNumberStyleAttr()+'></td>';}return'';};// Generates the HTML that goes before every other type of row generated by DayGrid.// Affects mirror-skeleton and highlight-skeleton rows._this.renderDayGridIntroHtml=function(){if(_this.colWeekNumbersVisible){return'<td class="fc-week-number" '+_this.weekNumberStyleAttr()+'></td>';}return'';};return_this;}AbstractDayGridView.prototype._processOptions=function(options){if(options.weekNumbers){if(options.weekNumbersWithinDays){this.cellWeekNumbersVisible=true;this.colWeekNumbersVisible=false;}else{this.cellWeekNumbersVisible=false;this.colWeekNumbersVisible=true;}}else{this.colWeekNumbersVisible=false;this.cellWeekNumbersVisible=false;}};AbstractDayGridView.prototype.render=function(props,context){_super.prototype.render.call(this,props,context);this.processOptions(context.options);this.renderSkeleton(context);};AbstractDayGridView.prototype.destroy=function(){_super.prototype.destroy.call(this);this.renderSkeleton.unrender();};AbstractDayGridView.prototype._renderSkeleton=function(context){this.el.classList.add('fc-dayGrid-view');this.el.innerHTML=this.renderSkeletonHtml();this.scroller=newcore.ScrollComponent('hidden',// overflow x'auto'// overflow y);vardayGridContainerEl=this.scroller.el;this.el.querySelector('.fc-body > tr > td').appendChild(dayGridContainerEl);dayGridContainerEl.classList.add('fc-day-grid-container');vardayGridEl=core.createElement('div',{className:'fc-day-grid'});dayGridContainerEl.appendChild(dayGridEl);this.dayGrid=newDayGrid(dayGridEl,{renderNumberIntroHtml:this.renderDayGridNumberIntroHtml,renderBgIntroHtml:this.renderDayGridBgIntroHtml,renderIntroHtml:this.renderDayGridIntroHtml,colWeekNumbersVisible:this.colWeekNumbersVisible,cellWeekNumbersVisible:this.cellWeekNumbersVisible});};AbstractDayGridView.prototype._unrenderSkeleton=function(){this.el.classList.remove('fc-dayGrid-view');this.dayGrid.destroy();this.scroller.destroy();};// Builds the HTML skeleton for the view.// The day-grid component will render inside of a container defined by this HTML.AbstractDayGridView.prototype.renderSkeletonHtml=function(){var_a=this.context,theme=_a.theme,options=_a.options;return''+'<table class="'+theme.getClass('tableGrid')+'">'+(options.columnHeader?'<thead class="fc-head">'+'<tr>'+'<td class="fc-head-container '+theme.getClass('widgetHeader')+'"> </td>'+'</tr>'+'</thead>':'')+'<tbody class="fc-body">'+'<tr>'+'<td class="'+theme.getClass('widgetContent')+'"></td>'+'</tr>'+'</tbody>'+'</table>';};// Generates an HTML attribute string for setting the width of the week number column, if it is knownAbstractDayGridView.prototype.weekNumberStyleAttr=function(){if(this.weekNumberWidth!=null){return'style="width:'+this.weekNumberWidth+'px"';}return'';};// Determines whether each row should have a constant heightAbstractDayGridView.prototype.hasRigidRows=function(){vareventLimit=this.context.options.eventLimit;returneventLimit&&typeofeventLimit!=='number';};/* Dimensions ------------------------------------------------------------------------------------------------------------------*/AbstractDayGridView.prototype.updateSize=function(isResize,viewHeight,isAuto){_super.prototype.updateSize.call(this,isResize,viewHeight,isAuto);// will call updateBaseSize. important that executes firstthis.dayGrid.updateSize(isResize);};// Refreshes the horizontal dimensions of the viewAbstractDayGridView.prototype.updateBaseSize=function(isResize,viewHeight,isAuto){vardayGrid=this.dayGrid;vareventLimit=this.context.options.eventLimit;varheadRowEl=this.header?this.header.el:null;// HACKvarscrollerHeight;varscrollbarWidths;// hack to give the view some height prior to dayGrid's columns being rendered// TODO: separate setting height from scroller VS dayGrid.if(!dayGrid.rowEls){if(!isAuto){scrollerHeight=this.computeScrollerHeight(viewHeight);this.scroller.setHeight(scrollerHeight);}return;}if(this.colWeekNumbersVisible){// Make sure all week number cells running down the side have the same width.this.weekNumberWidth=core.matchCellWidths(core.findElements(this.el,'.fc-week-number'));}// reset all heights to be naturalthis.scroller.clear();if(headRowEl){core.uncompensateScroll(headRowEl);}dayGrid.removeSegPopover();// kill the "more" popover if displayed// is the event limit a constant level number?if(eventLimit&&typeofeventLimit==='number'){dayGrid.limitRows(eventLimit);// limit the levels first so the height can redistribute after}// distribute the height to the rows// (viewHeight is a "recommended" value if isAuto)scrollerHeight=this.computeScrollerHeight(viewHeight);this.setGridHeight(scrollerHeight,isAuto);// is the event limit dynamically calculated?if(eventLimit&&typeofeventLimit!=='number'){dayGrid.limitRows(eventLimit);// limit the levels after the grid's row heights have been set}if(!isAuto){// should we force dimensions of the scroll container?this.scroller.setHeight(scrollerHeight);scrollbarWidths=this.scroller.getScrollbarWidths();if(scrollbarWidths.left||scrollbarWidths.right){// using scrollbars?if(headRowEl){core.compensateScroll(headRowEl,scrollbarWidths);}// doing the scrollbar compensation might have created text overflow which created more height. redoscrollerHeight=this.computeScrollerHeight(viewHeight);this.scroller.setHeight(scrollerHeight);}// guarantees the same scrollbar widthsthis.scroller.lockOverflow(scrollbarWidths);}};// given a desired total height of the view, returns what the height of the scroller should beAbstractDayGridView.prototype.computeScrollerHeight=function(viewHeight){returnviewHeight-core.subtractInnerElHeight(this.el,this.scroller.el);// everything that's NOT the scroller};// Sets the height of just the DayGrid component in this viewAbstractDayGridView.prototype.setGridHeight=function(height,isAuto){if(this.context.options.monthMode){// if auto, make the height of each row the height that it would be if there were 6 weeksif(isAuto){height*=this.dayGrid.rowCnt/6;}core.distributeHeight(this.dayGrid.rowEls,height,!isAuto);// if auto, don't compensate for height-hogging rows}else{if(isAuto){core.undistributeHeight(this.dayGrid.rowEls);// let the rows be their natural height with no expanding}else{core.distributeHeight(this.dayGrid.rowEls,height,true);// true = compensate for height-hogging rows}}};/* Scroll ------------------------------------------------------------------------------------------------------------------*/AbstractDayGridView.prototype.computeDateScroll=function(duration){return{top:0};};AbstractDayGridView.prototype.queryDateScroll=function(){return{top:this.scroller.getScrollTop()};};AbstractDayGridView.prototype.applyDateScroll=function(scroll){if(scroll.top!==undefined){this.scroller.setScrollTop(scroll.top);}};returnAbstractDayGridView;}(core.View));AbstractDayGridView.prototype.dateProfileGeneratorClass=DayGridDateProfileGenerator;varSimpleDayGrid=/** @class */(function(_super){__extends(SimpleDayGrid,_super);functionSimpleDayGrid(dayGrid){var_this=_super.call(this,dayGrid.el)||this;_this.slicer=newDayGridSlicer();_this.dayGrid=dayGrid;return_this;}SimpleDayGrid.prototype.firstContext=function(context){context.calendar.registerInteractiveComponent(this,{el:this.dayGrid.el});};SimpleDayGrid.prototype.destroy=function(){_super.prototype.destroy.call(this);this.context.calendar.unregisterInteractiveComponent(this);};SimpleDayGrid.prototype.render=function(props,context){vardayGrid=this.dayGrid;vardateProfile=props.dateProfile,dayTable=props.dayTable;dayGrid.receiveProps(__assign({},this.slicer.sliceProps(props,dateProfile,props.nextDayThreshold,context.calendar,dayGrid,dayTable),{dateProfile:dateProfile,cells:dayTable.cells,isRigid:props.isRigid}),context);};SimpleDayGrid.prototype.buildPositionCaches=function(){this.dayGrid.buildPositionCaches();};SimpleDayGrid.prototype.queryHit=function(positionLeft,positionTop){varrawHit=this.dayGrid.positionToHit(positionLeft,positionTop);if(rawHit){return{component:this.dayGrid,dateSpan:rawHit.dateSpan,dayEl:rawHit.dayEl,rect:{left:rawHit.relativeRect.left,right:rawHit.relativeRect.right,top:rawHit.relativeRect.top,bottom:rawHit.relativeRect.bottom},layer:0};}};returnSimpleDayGrid;}(core.DateComponent));varDayGridSlicer=/** @class */(function(_super){__extends(DayGridSlicer,_super);functionDayGridSlicer(){return_super!==null&&_super.apply(this,arguments)||this;}DayGridSlicer.prototype.sliceRange=function(dateRange,dayTable){returndayTable.sliceRange(dateRange);};returnDayGridSlicer;}(core.Slicer));varDayGridView=/** @class */(function(_super){__extends(DayGridView,_super);functionDayGridView(){var_this=_super!==null&&_super.apply(this,arguments)||this;_this.buildDayTable=core.memoize(buildDayTable);return_this;}DayGridView.prototype.render=function(props,context){_super.prototype.render.call(this,props,context);// will call _renderSkeleton/_unrenderSkeletonvardateProfile=this.props.dateProfile;vardayTable=this.dayTable=this.buildDayTable(dateProfile,props.dateProfileGenerator);if(this.header){this.header.receiveProps({dateProfile:dateProfile,dates:dayTable.headerDates,datesRepDistinctDays:dayTable.rowCnt===1,renderIntroHtml:this.renderHeadIntroHtml},context);}this.simpleDayGrid.receiveProps({dateProfile:dateProfile,dayTable:dayTable,businessHours:props.businessHours,dateSelection:props.dateSelection,eventStore:props.eventStore,eventUiBases:props.eventUiBases,eventSelection:props.eventSelection,eventDrag:props.eventDrag,eventResize:props.eventResize,isRigid:this.hasRigidRows(),nextDayThreshold:this.context.nextDayThreshold},context);};DayGridView.prototype._renderSkeleton=function(context){_super.prototype._renderSkeleton.call(this,context);if(context.options.columnHeader){this.header=newcore.DayHeader(this.el.querySelector('.fc-head-container'));}this.simpleDayGrid=newSimpleDayGrid(this.dayGrid);};DayGridView.prototype._unrenderSkeleton=function(){_super.prototype._unrenderSkeleton.call(this);if(this.header){this.header.destroy();}this.simpleDayGrid.destroy();};returnDayGridView;}(AbstractDayGridView));functionbuildDayTable(dateProfile,dateProfileGenerator){vardaySeries=newcore.DaySeries(dateProfile.renderRange,dateProfileGenerator);returnnewcore.DayTable(daySeries,/year|month|week/.test(dateProfile.currentRangeUnit));}varmain=core.createPlugin({defaultView:'dayGridMonth',views:{dayGrid:DayGridView,dayGridDay:{type:'dayGrid',duration:{days:1}},dayGridWeek:{type:'dayGrid',duration:{weeks:1}},dayGridMonth:{type:'dayGrid',duration:{months:1},monthMode:true,fixedWeekCount:true}}});exports.AbstractDayGridView=AbstractDayGridView;exports.DayBgRow=DayBgRow;exports.DayGrid=DayGrid;exports.DayGridSlicer=DayGridSlicer;exports.DayGridView=DayGridView;exports.SimpleDayGrid=SimpleDayGrid;exports.buildBasicDayTable=buildDayTable;exports.default=main;Object.defineProperty(exports,'__esModule',{value:true});}));