vuetify
Version:
Vue Material Component Framework
1 lines • 16.9 kB
Source Map (JSON)
{"version":3,"file":"stack.mjs","names":["getOverlapGroupHandler","getVisuals","hasOverlap","getNormalizedRange","getTimestampIdentifier","FULL_WIDTH","DEFAULT_OFFSET","WIDTH_MULTIPLIER","stack","events","firstWeekday","overlapThreshold","handler","day","dayEvents","timed","reset","dayStart","visuals","groups","getGroups","group","nodes","visual","child","getNode","index","getNextIndex","parent","getParent","sibling","start","end","addTime","children","push","getOverlappingRange","length","grand","grandNext","calculateBounds","sort","a","b","left","event","startTimestampIdentifier","node","columns","getMaxChildIndex","spaceLeft","spaceWidth","offset","Math","min","columnWidthMultiplier","getColumnWidthMultiplier","columnOffset","columnWidth","width","hasFullWidth","maxColumn","minColumn","reduce","c","getOverlappingIndices","indices","other","i","indexMin","indexMax","returnFirstColumn","overlapping","first","n","filter","added","max","childMax","identifier","minutes","removeMinutes","totalMinutes","addHours","floor","addMinutes"],"sources":["../../../../src/components/VCalendar/modes/stack.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable */\n\nimport { 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"],"mappings":"AAAA;AACA;AAAA,SAGSA,sBAAsB,EAAEC,UAAU,EAAEC,UAAU,EAAEC,kBAAkB;AAAA,SAClEC,sBAAsB;AAkB/B,MAAMC,UAAU,GAAG,GAAG;AAEtB,MAAMC,cAAc,GAAG,CAAC;AAExB,MAAMC,gBAAgB,GAAG,GAAG;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,MAAMC,KAA+B,GAAG,CAACC,MAAM,EAAEC,YAAY,EAAEC,gBAAgB,KAAK;EACzF,MAAMC,OAAO,GAAGZ,sBAAsB,CAACU,YAAY,CAAC;;EAE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