{"version":3,"file":"main.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/daygrid/DayGridDateProfileGenerator.ts","../../src/daygrid/Popover.ts","../../src/daygrid/SimpleDayGridEventRenderer.ts","../../src/daygrid/DayGridEventRenderer.ts","../../src/daygrid/DayGridMirrorRenderer.ts","../../src/daygrid/DayGridFillRenderer.ts","../../src/daygrid/DayTile.ts","../../src/daygrid/DayBgRow.ts","../../src/daygrid/DayGrid.ts","../../src/daygrid/AbstractDayGridView.ts","../../src/daygrid/SimpleDayGrid.ts","../../src/daygrid/DayGridView.ts","../../src/daygrid/main.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","import {\n DateProfileGenerator,\n addWeeks, diffWeeks,\n DateRange\n} from '@fullcalendar/core'\n\nexport default class DayGridDateProfileGenerator extends DateProfileGenerator {\n\n // Computes the date range that will be rendered.\n buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay): DateRange {\n let { dateEnv } = this\n let renderRange = super.buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay)\n let start = renderRange.start\n let end = renderRange.end\n let endOfWeek\n\n // year and month views should be aligned with weeks. this is already done for week\n if (/^(year|month)$/.test(currentRangeUnit)) {\n start = dateEnv.startOfWeek(start)\n\n // make end-of-week if not already\n endOfWeek = dateEnv.startOfWeek(end)\n if (endOfWeek.valueOf() !== end.valueOf()) {\n end = addWeeks(endOfWeek, 1)\n }\n }\n\n // ensure 6 weeks\n if (\n this.options.monthMode &&\n this.options.fixedWeekCount\n ) {\n let rowCnt = Math.ceil( // could be partial weeks due to hiddenDays\n diffWeeks(start, end)\n )\n end = addWeeks(end, 6 - rowCnt)\n }\n\n return { start, end }\n }\n\n}\n","\n/* A rectangular panel that is absolutely positioned over other content\n------------------------------------------------------------------------------------------------------------------------\nOptions:\n - className (string)\n - content (HTML string, element, or element array)\n - parentEl\n - top\n - left\n - right (the x coord of where the right edge should be. not a \"CSS\" right)\n - autoHide (boolean)\n - show (callback)\n - hide (callback)\n*/\n\nimport {\n removeElement, createElement, applyStyle,\n listenBySelector,\n computeClippingRect, computeRect\n} from '@fullcalendar/core'\n\nexport interface PopoverOptions {\n className?: string\n content?: (el: HTMLElement) => void\n parentEl: HTMLElement\n autoHide?: boolean\n top?: number\n left?: number\n right?: number\n viewportConstrain?: boolean\n}\n\nexport default class Popover {\n\n isHidden: boolean = true\n options: PopoverOptions\n el: HTMLElement // the container element for the popover. generated by this object\n margin: number = 10 // the space required between the popover and the edges of the scroll container\n\n\n constructor(options: PopoverOptions) {\n this.options = options\n }\n\n\n // Shows the popover on the specified position. Renders it if not already\n show() {\n if (this.isHidden) {\n if (!this.el) {\n this.render()\n }\n this.el.style.display = ''\n this.position()\n this.isHidden = false\n this.trigger('show')\n }\n }\n\n\n // Hides the popover, through CSS, but does not remove it from the DOM\n hide() {\n if (!this.isHidden) {\n this.el.style.display = 'none'\n this.isHidden = true\n this.trigger('hide')\n }\n }\n\n\n // Creates `this.el` and renders content inside of it\n render() {\n let options = this.options\n let el = this.el = createElement('div', {\n className: 'fc-popover ' + (options.className || ''),\n style: {\n top: '0',\n left: '0'\n }\n })\n\n if (typeof options.content === 'function') {\n options.content(el)\n }\n\n options.parentEl.appendChild(el)\n\n // when a click happens on anything inside with a 'fc-close' className, hide the popover\n listenBySelector(el, 'click', '.fc-close', (ev) => {\n this.hide()\n })\n\n if (options.autoHide) {\n document.addEventListener('mousedown', this.documentMousedown)\n }\n }\n\n\n // Triggered when the user clicks *anywhere* in the document, for the autoHide feature\n documentMousedown = (ev) => {\n // only hide the popover if the click happened outside the popover\n if (this.el && !this.el.contains(ev.target)) {\n this.hide()\n }\n }\n\n\n // Hides and unregisters any handlers\n destroy() {\n this.hide()\n\n if (this.el) {\n removeElement(this.el)\n this.el = null\n }\n\n document.removeEventListener('mousedown', this.documentMousedown)\n }\n\n\n // Positions the popover optimally, using the top/left/right options\n position() {\n let options = this.options\n let el = this.el\n let elDims = el.getBoundingClientRect() // only used for width,height\n let origin = computeRect(el.offsetParent)\n let clippingRect = computeClippingRect(options.parentEl)\n let top // the \"position\" (not \"offset\") values for the popover\n let left //\n\n // compute top and left\n top = options.top || 0\n if (options.left !== undefined) {\n left = options.left\n } else if (options.right !== undefined) {\n left = options.right - elDims.width // derive the left value from the right value\n } else {\n left = 0\n }\n\n // constrain to the view port. if constrained by two edges, give precedence to top/left\n top = Math.min(top, clippingRect.bottom - elDims.height - this.margin)\n top = Math.max(top, clippingRect.top + this.margin)\n left = Math.min(left, clippingRect.right - elDims.width - this.margin)\n left = Math.max(left, clippingRect.left + this.margin)\n\n applyStyle(el, {\n top: top - origin.top,\n left: left - origin.left\n })\n }\n\n\n // Triggers a callback. Calls a function in the option hash of the same name.\n // Arguments beyond the first `name` are forwarded on.\n // TODO: better code reuse for this. Repeat code\n // can kill this???\n trigger(name) {\n if (this.options[name]) {\n this.options[name].apply(this, Array.prototype.slice.call(arguments, 1))\n }\n }\n\n}\n","import {\n htmlEscape, cssToStr,\n FgEventRenderer,\n Seg\n} from '@fullcalendar/core'\n\n\n/* Event-rendering methods for the DayGrid class\n----------------------------------------------------------------------------------------------------------------------*/\n\n// \"Simple\" is bad a name. has nothing to do with SimpleDayGrid\nexport default abstract class SimpleDayGridEventRenderer extends FgEventRenderer {\n\n\n // Builds the HTML to be used for the default element for an individual segment\n renderSegHtml(seg: Seg, mirrorInfo) {\n let { options } = this.context\n let eventRange = seg.eventRange\n let eventDef = eventRange.def\n let eventUi = eventRange.ui\n let allDay = eventDef.allDay\n let isDraggable = eventUi.startEditable\n let isResizableFromStart = allDay && seg.isStart && eventUi.durationEditable && options.eventResizableFromStart\n let isResizableFromEnd = allDay && seg.isEnd && eventUi.durationEditable\n let classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo)\n let skinCss = cssToStr(this.getSkinCss(eventUi))\n let timeHtml = ''\n let timeText\n let titleHtml\n\n classes.unshift('fc-day-grid-event', 'fc-h-event')\n\n // Only display a timed events time if it is the starting segment\n if (seg.isStart) {\n timeText = this.getTimeText(eventRange)\n if (timeText) {\n timeHtml = '' + htmlEscape(timeText) + ''\n }\n }\n\n titleHtml =\n '' +\n (htmlEscape(eventDef.title || '') || ' ') + // we always want one line of height\n ''\n\n return '' +\n '
' +\n ' |
' +\n ' |