{"version":3,"file":"main.js","sources":["../../../tmp/tsc-output/packages/timegrid/src/TimeGridEventRenderer.js","../../../tmp/tsc-output/packages/timegrid/src/TimeGridMirrorRenderer.js","../../../tmp/tsc-output/packages/timegrid/src/TimeGridFillRenderer.js","../../../tmp/tsc-output/packages/timegrid/src/TimeGrid.js","../../../tmp/tsc-output/packages/timegrid/src/AllDaySplitter.js","../../../tmp/tsc-output/packages/timegrid/src/AbstractTimeGridView.js","../../../tmp/tsc-output/packages/timegrid/src/SimpleTimeGrid.js","../../../tmp/tsc-output/packages/timegrid/src/TimeGridView.js","../../../tmp/tsc-output/packages/timegrid/src/main.js"],"sourcesContent":["import * as tslib_1 from \"tslib\";\nimport { htmlEscape, cssToStr, removeElement, applyStyle, createFormatter, FgEventRenderer, buildSegCompareObj, isMultiDayRange, compareByFieldSpecs, computeEventDraggable, computeEventStartResizable, computeEventEndResizable } from '@fullcalendar/core';\n/*\nOnly handles foreground segs.\nDoes not own rendering. Use for low-level util methods by TimeGrid.\n*/\nvar TimeGridEventRenderer = /** @class */ (function (_super) {\n tslib_1.__extends(TimeGridEventRenderer, _super);\n function TimeGridEventRenderer(timeGrid) {\n var _this = _super.call(this) || this;\n _this.timeGrid = timeGrid;\n return _this;\n }\n TimeGridEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {\n _super.prototype.renderSegs.call(this, context, segs, mirrorInfo);\n // TODO: dont do every time. memoize\n this.fullTimeFormat = createFormatter({\n hour: 'numeric',\n minute: '2-digit',\n separator: this.context.options.defaultRangeSeparator\n });\n };\n // Given an array of foreground segments, render a DOM element for each, computes position,\n // and attaches to the column inner-container elements.\n TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {\n var segsByCol = this.timeGrid.groupSegsByCol(segs);\n // order the segs within each column\n // TODO: have groupSegsByCol do this?\n for (var col = 0; col < segsByCol.length; col++) {\n segsByCol[col] = this.sortEventSegs(segsByCol[col]);\n }\n this.segsByCol = segsByCol;\n this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls);\n };\n TimeGridEventRenderer.prototype.detachSegs = function (segs) {\n segs.forEach(function (seg) {\n removeElement(seg.el);\n });\n this.segsByCol = null;\n };\n TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.computeSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array\n }\n }\n };\n TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) {\n var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol;\n var colCnt = timeGrid.colCnt;\n timeGrid.assignSegVerticals(allSegs); // horizontals relies on this\n if (segsByCol) {\n for (var col = 0; col < colCnt; col++) {\n this.assignSegCss(segsByCol[col]);\n }\n }\n };\n // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined\n TimeGridEventRenderer.prototype.computeEventTimeFormat = function () {\n return {\n hour: 'numeric',\n minute: '2-digit',\n meridiem: false\n };\n };\n // Computes a default `displayEventEnd` value if one is not expliclty defined\n TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () {\n return true;\n };\n // Renders the HTML for a single event segment's default rendering\n TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {\n var eventRange = seg.eventRange;\n var eventDef = eventRange.def;\n var eventUi = eventRange.ui;\n var allDay = eventDef.allDay;\n var isDraggable = computeEventDraggable(this.context, eventDef, eventUi);\n var isResizableFromStart = seg.isStart && computeEventStartResizable(this.context, eventDef, eventUi);\n var isResizableFromEnd = seg.isEnd && computeEventEndResizable(this.context, eventDef, eventUi);\n var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);\n var skinCss = cssToStr(this.getSkinCss(eventUi));\n var timeText;\n var fullTimeText; // more verbose time text. for the print stylesheet\n var startTimeText; // just the start time text\n classes.unshift('fc-time-grid-event');\n // if the event appears to span more than one day...\n if (isMultiDayRange(eventRange.range)) {\n // Don't display time text on segments that run entirely through a day.\n // That would appear as midnight-midnight and would look dumb.\n // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am)\n if (seg.isStart || seg.isEnd) {\n var unzonedStart = seg.start;\n var unzonedEnd = seg.end;\n timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones\n fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat);\n startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false\n }\n }\n else {\n // Display the normal time text for the *event's* times\n timeText = this.getTimeText(eventRange);\n fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat);\n startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false\n }\n return '' +\n '
' +\n ' |
' +\n (options.allDaySlot ?\n '' +\n ' ' :\n '') +\n ' | ' +\n '