\r\n \r\n \r\n \r\n \r\n \r\n \r\n Today \r\n \r\n mdi-chevron-left\r\n \r\n \r\n {{ $refs.calendar.title }}\r\n \r\n \r\n mdi-chevron-right\r\n \r\n \r\n \r\n \r\n \r\n {{ typeToLabel[type] }}\r\n mdi-menu-down\r\n \r\n \r\n \r\n \r\n Week\r\n \r\n \r\n Month\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {{ selectedEvent.name }}\r\n
\r\n \r\n \r\n \r\n \r\n \r\n
\r\n \r\n \r\n \r\n \r\n \r\n mdi-pencilEdit\r\n \r\n \r\n \r\n \r\n \r\n \r\n mdi-closeClose\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n mdi-plusAdd Event\r\n \r\n \r\n \r\n \r\n \r\n Delete the selected
calendar event?\r\n {{ title }}\r\n \r\n \r\n No\r\n Yes\r\n \r\n \r\n \r\n \r\n \r\n
\r\n\r\n\r\n\r\n\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calendar.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--12-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calendar.vue?vue&type=script&lang=js&\"","import Vue from 'vue'\n\nimport {\n validateTimestamp,\n parseTimestamp,\n parseDate,\n} from '../util/timestamp'\nimport { CalendarTimestamp } from 'vuetify/types'\n\nexport default Vue.extend({\n name: 'times',\n\n props: {\n now: {\n type: String,\n validator: validateTimestamp,\n },\n },\n\n data: () => ({\n times: {\n now: parseTimestamp('0000-00-00 00:00', true),\n today: parseTimestamp('0000-00-00', true),\n },\n }),\n\n computed: {\n parsedNow (): CalendarTimestamp | null {\n return this.now ? parseTimestamp(this.now, true) : null\n },\n },\n\n watch: {\n parsedNow: 'updateTimes',\n },\n\n created () {\n this.updateTimes()\n this.setPresent()\n },\n\n methods: {\n setPresent (): void {\n this.times.now.present = this.times.today.present = true\n this.times.now.past = this.times.today.past = false\n this.times.now.future = this.times.today.future = false\n },\n updateTimes (): void {\n const now: CalendarTimestamp = this.parsedNow || this.getNow()\n this.updateDay(now, this.times.now)\n this.updateTime(now, this.times.now)\n this.updateDay(now, this.times.today)\n },\n getNow (): CalendarTimestamp {\n return parseDate(new Date())\n },\n updateDay (now: CalendarTimestamp, target: CalendarTimestamp): void {\n if (now.date !== target.date) {\n target.year = now.year\n target.month = now.month\n target.day = now.day\n target.weekday = now.weekday\n target.date = now.date\n }\n },\n updateTime (now: CalendarTimestamp, target: CalendarTimestamp): void {\n if (now.time !== target.time) {\n target.hour = now.hour\n target.minute = now.minute\n target.time = now.time\n }\n },\n },\n})\n","import { CalendarEventParsed, CalendarEventVisual, CalendarTimestamp } from 'vuetify/types'\nimport { getTimestampIdentifier } from '../util/timestamp'\n\nconst MILLIS_IN_DAY = 86400000\n\nexport type GetRange = (event: CalendarEventParsed) => [number, number]\n\nexport function getVisuals (events: CalendarEventParsed[], minStart = 0): CalendarEventVisual[] {\n const visuals = events.map(event => ({\n event,\n columnCount: 0,\n column: 0,\n left: 0,\n width: 100,\n }))\n\n visuals.sort((a, b) => {\n return (Math.max(minStart, a.event.startTimestampIdentifier) - Math.max(minStart, b.event.startTimestampIdentifier)) ||\n (b.event.endTimestampIdentifier - a.event.endTimestampIdentifier)\n })\n\n return visuals\n}\n\nexport interface ColumnGroup {\n start: number\n end: number\n visuals: CalendarEventVisual[]\n}\n\nexport function hasOverlap (s0: number, e0: number, s1: number, e1: number, exclude = true): boolean {\n return exclude ? !(s0 >= e1 || e0 <= s1) : !(s0 > e1 || e0 < s1)\n}\n\nexport function setColumnCount (groups: ColumnGroup[]) {\n groups.forEach(group => {\n group.visuals.forEach(groupVisual => {\n groupVisual.columnCount = groups.length\n })\n })\n}\n\nexport function getRange (event: CalendarEventParsed): [number, number] {\n return [event.startTimestampIdentifier, event.endTimestampIdentifier]\n}\n\nexport function getDayRange (event: CalendarEventParsed): [number, number] {\n return [event.startIdentifier, event.endIdentifier]\n}\n\nexport function getNormalizedRange (event: CalendarEventParsed, dayStart: number): [number, number] {\n return [Math.max(dayStart, event.startTimestampIdentifier), Math.min(dayStart + MILLIS_IN_DAY, event.endTimestampIdentifier)]\n}\n\nexport function getOpenGroup (groups: ColumnGroup[], start: number, end: number, timed: boolean) {\n for (let i = 0; i < groups.length; i++) {\n const group = groups[i]\n let intersected = false\n\n if (hasOverlap(start, end, group.start, group.end, timed)) {\n for (let k = 0; k < group.visuals.length; k++) {\n const groupVisual = group.visuals[k]\n const [groupStart, groupEnd] = timed ? getRange(groupVisual.event) : getDayRange(groupVisual.event)\n\n if (hasOverlap(start, end, groupStart, groupEnd, timed)) {\n intersected = true\n break\n }\n }\n }\n\n if (!intersected) {\n return i\n }\n }\n\n return -1\n}\n\nexport function getOverlapGroupHandler (firstWeekday: number) {\n const handler = {\n groups: [] as ColumnGroup[],\n min: -1,\n max: -1,\n reset: () => {\n handler.groups = []\n handler.min = handler.max = -1\n },\n getVisuals: (day: CalendarTimestamp, dayEvents: CalendarEventParsed[], timed: boolean, reset = false) => {\n if (day.weekday === firstWeekday || reset) {\n handler.reset()\n }\n\n const dayStart = getTimestampIdentifier(day)\n const visuals = getVisuals(dayEvents, dayStart)\n\n visuals.forEach(visual => {\n const [start, end] = timed ? getRange(visual.event) : getDayRange(visual.event)\n\n if (handler.groups.length > 0 && !hasOverlap(start, end, handler.min, handler.max, timed)) {\n setColumnCount(handler.groups)\n handler.reset()\n }\n\n let targetGroup = getOpenGroup(handler.groups, start, end, timed)\n\n if (targetGroup === -1) {\n targetGroup = handler.groups.length\n\n handler.groups.push({ start, end, visuals: [] })\n }\n\n const target = handler.groups[targetGroup]\n target.visuals.push(visual)\n target.start = Math.min(target.start, start)\n target.end = Math.max(target.end, end)\n\n visual.column = targetGroup\n\n if (handler.min === -1) {\n handler.min = start\n handler.max = end\n } else {\n handler.min = Math.min(handler.min, start)\n handler.max = Math.max(handler.max, end)\n }\n })\n\n setColumnCount(handler.groups)\n\n if (timed) {\n handler.reset()\n }\n\n return visuals\n },\n }\n\n return handler\n}\n","import { CalendarEventOverlapMode, CalendarEventVisual } from 'vuetify/types'\nimport { getOverlapGroupHandler, getVisuals, hasOverlap, getNormalizedRange } from './common'\nimport { getTimestampIdentifier } from '../util/timestamp'\n\ninterface Group {\n start: number\n end: number\n visuals: CalendarEventVisual[]\n}\n\ninterface Node {\n parent: Node | null\n sibling: boolean\n index: number\n visual: CalendarEventVisual\n start: number\n end: number\n children: Node[]\n}\n\nconst FULL_WIDTH = 100\n\nconst DEFAULT_OFFSET = 5\n\nconst WIDTH_MULTIPLIER = 1.7\n\n/**\n * Variation of column mode where events can be stacked. The priority of this\n * mode is to stack events together taking up the least amount of space while\n * trying to ensure the content of the event is always visible as well as its\n * start and end. A sibling column has intersecting event content and must be\n * placed beside each other. Non-sibling columns are offset by 5% from the\n * previous column. The width is scaled by 1.7 so the events overlap and\n * whitespace is reduced. If there is a hole in columns the event width is\n * scaled up so it intersects with the next column. The columns have equal\n * width in the space they are given. If the event doesn't have any to the\n * right of it that intersect with it's content it's right side is extended\n * to the right side.\n */\n\nexport const stack: CalendarEventOverlapMode = (events, firstWeekday, overlapThreshold) => {\n const handler = getOverlapGroupHandler(firstWeekday)\n\n // eslint-disable-next-line max-statements\n return (day, dayEvents, timed, reset) => {\n if (!timed) {\n return handler.getVisuals(day, dayEvents, timed, reset)\n }\n\n const dayStart = getTimestampIdentifier(day)\n const visuals = getVisuals(dayEvents, dayStart)\n const groups = getGroups(visuals, dayStart)\n\n for (const group of groups) {\n const nodes: Node[] = []\n\n for (const visual of group.visuals) {\n const child = getNode(visual, dayStart)\n const index = getNextIndex(child, nodes)\n\n if (index === false) {\n const parent = getParent(child, nodes)\n if (parent) {\n child.parent = parent\n child.sibling = hasOverlap(child.start, child.end, parent.start, addTime(parent.start, overlapThreshold))\n child.index = parent.index + 1\n parent.children.push(child)\n }\n } else {\n const [parent] = getOverlappingRange(child, nodes, index - 1, index - 1)\n const children = getOverlappingRange(child, nodes, index + 1, index + nodes.length, true)\n\n child.children = children\n child.index = index\n\n if (parent) {\n child.parent = parent\n child.sibling = hasOverlap(child.start, child.end, parent.start, addTime(parent.start, overlapThreshold))\n parent.children.push(child)\n }\n\n for (const grand of children) {\n if (grand.parent === parent) {\n grand.parent = child\n }\n\n const grandNext = grand.index - child.index <= 1\n if (grandNext && child.sibling &&\n hasOverlap(child.start, addTime(child.start, overlapThreshold), grand.start, grand.end)) {\n grand.sibling = true\n }\n }\n }\n\n nodes.push(child)\n }\n\n calculateBounds(nodes, overlapThreshold)\n }\n\n visuals.sort((a, b) => (a.left - b.left) || (a.event.startTimestampIdentifier - b.event.startTimestampIdentifier))\n\n return visuals\n }\n}\n\nfunction calculateBounds (nodes: Node[], overlapThreshold: number) {\n for (const node of nodes) {\n const { visual, parent } = node\n const columns = getMaxChildIndex(node) + 1\n const spaceLeft = parent ? parent.visual.left : 0\n const spaceWidth = FULL_WIDTH - spaceLeft\n const offset = Math.min(DEFAULT_OFFSET, FULL_WIDTH / columns)\n const columnWidthMultiplier = getColumnWidthMultiplier(node, nodes)\n const columnOffset = spaceWidth / (columns - node.index + 1)\n const columnWidth = spaceWidth / (columns - node.index + (node.sibling ? 1 : 0)) * columnWidthMultiplier\n\n if (parent) {\n visual.left = node.sibling\n ? spaceLeft + columnOffset\n : spaceLeft + offset\n }\n\n visual.width = hasFullWidth(node, nodes, overlapThreshold)\n ? FULL_WIDTH - visual.left\n : Math.min(FULL_WIDTH - visual.left, columnWidth * WIDTH_MULTIPLIER)\n }\n}\n\nfunction getColumnWidthMultiplier (node: Node, nodes: Node[]): number {\n if (!node.children.length) {\n return 1\n }\n\n const maxColumn = node.index + nodes.length\n const minColumn = node.children.reduce((min, c) => Math.min(min, c.index), maxColumn)\n\n return minColumn - node.index\n}\n\nfunction getOverlappingIndices (node: Node, nodes: Node[]): number[] {\n const indices: number[] = []\n for (const other of nodes) {\n if (hasOverlap(node.start, node.end, other.start, other.end)) {\n indices.push(other.index)\n }\n }\n return indices\n}\n\nfunction getNextIndex (node: Node, nodes: Node[]): number | false {\n const indices = getOverlappingIndices(node, nodes)\n indices.sort()\n\n for (let i = 0; i < indices.length; i++) {\n if (i < indices[i]) {\n return i\n }\n }\n return false\n}\n\nfunction getOverlappingRange (node: Node, nodes: Node[], indexMin: number, indexMax: number, returnFirstColumn = false): Node[] {\n const overlapping: Node[] = []\n for (const other of nodes) {\n if (other.index >= indexMin && other.index <= indexMax && hasOverlap(node.start, node.end, other.start, other.end)) {\n overlapping.push(other)\n }\n }\n if (returnFirstColumn && overlapping.length > 0) {\n const first = overlapping.reduce((min, n) => Math.min(min, n.index), overlapping[0].index)\n return overlapping.filter(n => n.index === first)\n }\n return overlapping\n}\n\nfunction getParent (node: Node, nodes: Node[]): Node | null {\n let parent: Node | null = null\n for (const other of nodes) {\n if (hasOverlap(node.start, node.end, other.start, other.end) && (parent === null || other.index > parent.index)) {\n parent = other\n }\n }\n return parent\n}\n\nfunction hasFullWidth (node: Node, nodes: Node[], overlapThreshold: number): boolean {\n for (const other of nodes) {\n if (other !== node &&\n other.index > node.index &&\n hasOverlap(node.start, addTime(node.start, overlapThreshold), other.start, other.end)) {\n return false\n }\n }\n\n return true\n}\n\nfunction getGroups (visuals: CalendarEventVisual[], dayStart: number): Group[] {\n const groups: Group[] = []\n\n for (const visual of visuals) {\n const [start, end] = getNormalizedRange(visual.event, dayStart)\n let added = false\n\n for (const group of groups) {\n if (hasOverlap(start, end, group.start, group.end)) {\n group.visuals.push(visual)\n group.end = Math.max(group.end, end)\n added = true\n break\n }\n }\n\n if (!added) {\n groups.push({ start, end, visuals: [visual] })\n }\n }\n\n return groups\n}\n\nfunction getNode (visual: CalendarEventVisual, dayStart: number): Node {\n const [start, end] = getNormalizedRange(visual.event, dayStart)\n\n return {\n parent: null,\n sibling: true,\n index: 0,\n visual,\n start,\n end,\n children: [],\n }\n}\n\nfunction getMaxChildIndex (node: Node): number {\n let max = node.index\n for (const child of node.children) {\n const childMax = getMaxChildIndex(child)\n if (childMax > max) {\n max = childMax\n }\n }\n return max\n}\n\nfunction addTime (identifier: number, minutes: number): number {\n const removeMinutes = identifier % 100\n const totalMinutes = removeMinutes + minutes\n const addHours = Math.floor(totalMinutes / 60)\n const addMinutes = totalMinutes % 60\n\n return identifier - removeMinutes + addHours * 100 + addMinutes\n}\n","import { CalendarEventOverlapMode } from 'vuetify/types'\nimport { getOverlapGroupHandler } from './common'\n\nconst FULL_WIDTH = 100\n\nexport const column: CalendarEventOverlapMode = (events, firstWeekday, overlapThreshold) => {\n const handler = getOverlapGroupHandler(firstWeekday)\n\n return (day, dayEvents, timed, reset) => {\n const visuals = handler.getVisuals(day, dayEvents, timed, reset)\n\n if (timed) {\n visuals.forEach(visual => {\n visual.left = visual.column * FULL_WIDTH / visual.columnCount\n visual.width = FULL_WIDTH / visual.columnCount\n })\n }\n\n return visuals\n }\n}\n","import { CalendarEventOverlapMode } from 'vuetify/types'\nimport { stack } from './stack'\nimport { column } from './column'\n\nexport const CalendarEventOverlapModes: Record