diff options
author | Mario <mario@mariovavti.com> | 2023-03-19 13:55:18 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-03-19 13:55:18 +0000 |
commit | 89285f1408d21091bb80d45b391ddcbe06ba8d0f (patch) | |
tree | b2eb07d9f3d91d77f89a4565a58e6e5231b20c1c /library/fullcalendar/packages/timegrid | |
parent | 0a679e503ef367eda3085c44af103ee53869a94f (diff) | |
parent | 17c0bb2069dcfe35d3febc5bfdb3a7295f15d49c (diff) | |
download | volse-hubzilla-8.2.tar.gz volse-hubzilla-8.2.tar.bz2 volse-hubzilla-8.2.zip |
Merge branch '8.2RC'8.2
Diffstat (limited to 'library/fullcalendar/packages/timegrid')
-rw-r--r-- | library/fullcalendar/packages/timegrid/LICENSE.txt | 20 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/README.md | 8 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/index.global.js | 1198 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/index.global.min.js | 6 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/main.css | 309 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/main.d.ts | 224 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/main.esm.js | 1391 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/main.js | 1403 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/main.min.css | 1 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/main.min.js | 6 | ||||
-rw-r--r-- | library/fullcalendar/packages/timegrid/package.json | 36 |
11 files changed, 1204 insertions, 3398 deletions
diff --git a/library/fullcalendar/packages/timegrid/LICENSE.txt b/library/fullcalendar/packages/timegrid/LICENSE.txt deleted file mode 100644 index 2149cfbef..000000000 --- a/library/fullcalendar/packages/timegrid/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2019 Adam Shaw - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/library/fullcalendar/packages/timegrid/README.md b/library/fullcalendar/packages/timegrid/README.md deleted file mode 100644 index ac13676c8..000000000 --- a/library/fullcalendar/packages/timegrid/README.md +++ /dev/null @@ -1,8 +0,0 @@ - -# FullCalendar Time Grid Plugin - -Display your events on a grid of time slots - -[View the docs »](https://fullcalendar.io/docs/timegrid-view) - -This package was created from the [FullCalendar monorepo »](https://github.com/fullcalendar/fullcalendar) diff --git a/library/fullcalendar/packages/timegrid/index.global.js b/library/fullcalendar/packages/timegrid/index.global.js new file mode 100644 index 000000000..830c7ee2c --- /dev/null +++ b/library/fullcalendar/packages/timegrid/index.global.js @@ -0,0 +1,1198 @@ +/*! +FullCalendar Time Grid Plugin v6.0.3 +Docs & License: https://fullcalendar.io/docs/timegrid-view +(c) 2022 Adam Shaw +*/ +FullCalendar.TimeGrid = (function (exports, core, internal$1, preact, internal$2) { + 'use strict'; + + class AllDaySplitter extends internal$1.Splitter { + getKeyInfo() { + return { + allDay: {}, + timed: {}, + }; + } + getKeysForDateSpan(dateSpan) { + if (dateSpan.allDay) { + return ['allDay']; + } + return ['timed']; + } + getKeysForEventDef(eventDef) { + if (!eventDef.allDay) { + return ['timed']; + } + if (internal$1.hasBgRendering(eventDef)) { + return ['timed', 'allDay']; + } + return ['allDay']; + } + } + + const DEFAULT_SLAT_LABEL_FORMAT = internal$1.createFormatter({ + hour: 'numeric', + minute: '2-digit', + omitZeroMinute: true, + meridiem: 'short', + }); + function TimeColsAxisCell(props) { + let classNames = [ + 'fc-timegrid-slot', + 'fc-timegrid-slot-label', + props.isLabeled ? 'fc-scrollgrid-shrink' : 'fc-timegrid-slot-minor', + ]; + return (preact.createElement(internal$1.ViewContextType.Consumer, null, (context) => { + if (!props.isLabeled) { + return (preact.createElement("td", { className: classNames.join(' '), "data-time": props.isoTimeStr })); + } + let { dateEnv, options, viewApi } = context; + let labelFormat = // TODO: fully pre-parse + options.slotLabelFormat == null ? DEFAULT_SLAT_LABEL_FORMAT : + Array.isArray(options.slotLabelFormat) ? internal$1.createFormatter(options.slotLabelFormat[0]) : + internal$1.createFormatter(options.slotLabelFormat); + let renderProps = { + level: 0, + time: props.time, + date: dateEnv.toDate(props.date), + view: viewApi, + text: dateEnv.format(props.date, labelFormat), + }; + return (preact.createElement(internal$1.ContentContainer, { elTag: "td", elClasses: classNames, elAttrs: { + 'data-time': props.isoTimeStr, + }, renderProps: renderProps, generatorName: "slotLabelContent", generator: options.slotLabelContent || renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (preact.createElement("div", { className: "fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame" }, + preact.createElement(InnerContent, { elTag: "div", elClasses: [ + 'fc-timegrid-slot-label-cushion', + 'fc-scrollgrid-shrink-cushion', + ] }))))); + })); + } + function renderInnerContent(props) { + return props.text; + } + + class TimeBodyAxis extends internal$1.BaseComponent { + render() { + return this.props.slatMetas.map((slatMeta) => (preact.createElement("tr", { key: slatMeta.key }, + preact.createElement(TimeColsAxisCell, Object.assign({}, slatMeta))))); + } + } + + const DEFAULT_WEEK_NUM_FORMAT = internal$1.createFormatter({ week: 'short' }); + const AUTO_ALL_DAY_MAX_EVENT_ROWS = 5; + class TimeColsView extends internal$1.DateComponent { + constructor() { + super(...arguments); + this.allDaySplitter = new AllDaySplitter(); // for use by subclasses + this.headerElRef = preact.createRef(); + this.rootElRef = preact.createRef(); + this.scrollerElRef = preact.createRef(); + this.state = { + slatCoords: null, + }; + this.handleScrollTopRequest = (scrollTop) => { + let scrollerEl = this.scrollerElRef.current; + if (scrollerEl) { // TODO: not sure how this could ever be null. weirdness with the reducer + scrollerEl.scrollTop = scrollTop; + } + }; + /* Header Render Methods + ------------------------------------------------------------------------------------------------------------------*/ + this.renderHeadAxis = (rowKey, frameHeight = '') => { + let { options } = this.context; + let { dateProfile } = this.props; + let range = dateProfile.renderRange; + let dayCnt = internal$1.diffDays(range.start, range.end); + // only do in day views (to avoid doing in week views that dont need it) + let navLinkAttrs = (dayCnt === 1) + ? internal$1.buildNavLinkAttrs(this.context, range.start, 'week') + : {}; + if (options.weekNumbers && rowKey === 'day') { + return (preact.createElement(internal$1.WeekNumberContainer, { elTag: "th", elClasses: [ + 'fc-timegrid-axis', + 'fc-scrollgrid-shrink', + ], elAttrs: { + 'aria-hidden': true, + }, date: range.start, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, (InnerContent) => (preact.createElement("div", { className: [ + 'fc-timegrid-axis-frame', + 'fc-scrollgrid-shrink-frame', + 'fc-timegrid-axis-frame-liquid', + ].join(' '), style: { height: frameHeight } }, + preact.createElement(InnerContent, { elTag: "a", elClasses: [ + 'fc-timegrid-axis-cushion', + 'fc-scrollgrid-shrink-cushion', + 'fc-scrollgrid-sync-inner', + ], elAttrs: navLinkAttrs }))))); + } + return (preact.createElement("th", { "aria-hidden": true, className: "fc-timegrid-axis" }, + preact.createElement("div", { className: "fc-timegrid-axis-frame", style: { height: frameHeight } }))); + }; + /* Table Component Render Methods + ------------------------------------------------------------------------------------------------------------------*/ + // only a one-way height sync. we don't send the axis inner-content height to the DayGrid, + // but DayGrid still needs to have classNames on inner elements in order to measure. + this.renderTableRowAxis = (rowHeight) => { + let { options, viewApi } = this.context; + let renderProps = { + text: options.allDayText, + view: viewApi, + }; + return ( + // TODO: make reusable hook. used in list view too + preact.createElement(internal$1.ContentContainer, { elTag: "td", elClasses: [ + 'fc-timegrid-axis', + 'fc-scrollgrid-shrink', + ], elAttrs: { + 'aria-hidden': true, + }, renderProps: renderProps, generatorName: "allDayContent", generator: options.allDayContent || renderAllDayInner, classNameGenerator: options.allDayClassNames, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, (InnerContent) => (preact.createElement("div", { className: [ + 'fc-timegrid-axis-frame', + 'fc-scrollgrid-shrink-frame', + rowHeight == null ? ' fc-timegrid-axis-frame-liquid' : '', + ].join(' '), style: { height: rowHeight } }, + preact.createElement(InnerContent, { elTag: "span", elClasses: [ + 'fc-timegrid-axis-cushion', + 'fc-scrollgrid-shrink-cushion', + 'fc-scrollgrid-sync-inner', + ] }))))); + }; + this.handleSlatCoords = (slatCoords) => { + this.setState({ slatCoords }); + }; + } + // rendering + // ---------------------------------------------------------------------------------------------------- + renderSimpleLayout(headerRowContent, allDayContent, timeContent) { + let { context, props } = this; + let sections = []; + let stickyHeaderDates = internal$1.getStickyHeaderDates(context.options); + if (headerRowContent) { + sections.push({ + type: 'header', + key: 'header', + isSticky: stickyHeaderDates, + chunk: { + elRef: this.headerElRef, + tableClassName: 'fc-col-header', + rowContent: headerRowContent, + }, + }); + } + if (allDayContent) { + sections.push({ + type: 'body', + key: 'all-day', + chunk: { content: allDayContent }, + }); + sections.push({ + type: 'body', + key: 'all-day-divider', + outerContent: ( // TODO: rename to cellContent so don't need to define <tr>? + preact.createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" }, + preact.createElement("td", { className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))), + }); + } + sections.push({ + type: 'body', + key: 'body', + liquid: true, + expandRows: Boolean(context.options.expandRows), + chunk: { + scrollerElRef: this.scrollerElRef, + content: timeContent, + }, + }); + return (preact.createElement(internal$1.ViewContainer, { elRef: this.rootElRef, elClasses: ['fc-timegrid'], viewSpec: context.viewSpec }, + preact.createElement(internal$1.SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [{ width: 'shrink' }], sections: sections }))); + } + renderHScrollLayout(headerRowContent, allDayContent, timeContent, colCnt, dayMinWidth, slatMetas, slatCoords) { + let ScrollGrid = this.context.pluginHooks.scrollGridImpl; + if (!ScrollGrid) { + throw new Error('No ScrollGrid implementation'); + } + let { context, props } = this; + let stickyHeaderDates = !props.forPrint && internal$1.getStickyHeaderDates(context.options); + let stickyFooterScrollbar = !props.forPrint && internal$1.getStickyFooterScrollbar(context.options); + let sections = []; + if (headerRowContent) { + sections.push({ + type: 'header', + key: 'header', + isSticky: stickyHeaderDates, + syncRowHeights: true, + chunks: [ + { + key: 'axis', + rowContent: (arg) => (preact.createElement("tr", { role: "presentation" }, this.renderHeadAxis('day', arg.rowSyncHeights[0]))), + }, + { + key: 'cols', + elRef: this.headerElRef, + tableClassName: 'fc-col-header', + rowContent: headerRowContent, + }, + ], + }); + } + if (allDayContent) { + sections.push({ + type: 'body', + key: 'all-day', + syncRowHeights: true, + chunks: [ + { + key: 'axis', + rowContent: (contentArg) => (preact.createElement("tr", { role: "presentation" }, this.renderTableRowAxis(contentArg.rowSyncHeights[0]))), + }, + { + key: 'cols', + content: allDayContent, + }, + ], + }); + sections.push({ + key: 'all-day-divider', + type: 'body', + outerContent: ( // TODO: rename to cellContent so don't need to define <tr>? + preact.createElement("tr", { role: "presentation", className: "fc-scrollgrid-section" }, + preact.createElement("td", { colSpan: 2, className: 'fc-timegrid-divider ' + context.theme.getClass('tableCellShaded') }))), + }); + } + let isNowIndicator = context.options.nowIndicator; + sections.push({ + type: 'body', + key: 'body', + liquid: true, + expandRows: Boolean(context.options.expandRows), + chunks: [ + { + key: 'axis', + content: (arg) => ( + // TODO: make this now-indicator arrow more DRY with TimeColsContent + preact.createElement("div", { className: "fc-timegrid-axis-chunk" }, + preact.createElement("table", { "aria-hidden": true, style: { height: arg.expandRows ? arg.clientHeight : '' } }, + arg.tableColGroupNode, + preact.createElement("tbody", null, + preact.createElement(TimeBodyAxis, { slatMetas: slatMetas }))), + preact.createElement("div", { className: "fc-timegrid-now-indicator-container" }, + preact.createElement(internal$1.NowTimer, { unit: isNowIndicator ? 'minute' : 'day' /* hacky */ }, (nowDate) => { + let nowIndicatorTop = isNowIndicator && + slatCoords && + slatCoords.safeComputeTop(nowDate); // might return void + if (typeof nowIndicatorTop === 'number') { + return (preact.createElement(internal$1.NowIndicatorContainer, { elClasses: ['fc-timegrid-now-indicator-arrow'], elStyle: { top: nowIndicatorTop }, isAxis: true, date: nowDate })); + } + return null; + })))), + }, + { + key: 'cols', + scrollerElRef: this.scrollerElRef, + content: timeContent, + }, + ], + }); + if (stickyFooterScrollbar) { + sections.push({ + key: 'footer', + type: 'footer', + isSticky: true, + chunks: [ + { + key: 'axis', + content: internal$1.renderScrollShim, + }, + { + key: 'cols', + content: internal$1.renderScrollShim, + }, + ], + }); + } + return (preact.createElement(internal$1.ViewContainer, { elRef: this.rootElRef, elClasses: ['fc-timegrid'], viewSpec: context.viewSpec }, + preact.createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: false, colGroups: [ + { width: 'shrink', cols: [{ width: 'shrink' }] }, + { cols: [{ span: colCnt, minWidth: dayMinWidth }] }, + ], sections: sections }))); + } + /* Dimensions + ------------------------------------------------------------------------------------------------------------------*/ + getAllDayMaxEventProps() { + let { dayMaxEvents, dayMaxEventRows } = this.context.options; + if (dayMaxEvents === true || dayMaxEventRows === true) { // is auto? + dayMaxEvents = undefined; + dayMaxEventRows = AUTO_ALL_DAY_MAX_EVENT_ROWS; // make sure "auto" goes to a real number + } + return { dayMaxEvents, dayMaxEventRows }; + } + } + function renderAllDayInner(renderProps) { + return renderProps.text; + } + + class TimeColsSlatsCoords { + constructor(positions, dateProfile, slotDuration) { + this.positions = positions; + this.dateProfile = dateProfile; + this.slotDuration = slotDuration; + } + safeComputeTop(date) { + let { dateProfile } = this; + if (internal$1.rangeContainsMarker(dateProfile.currentRange, date)) { + let startOfDayDate = internal$1.startOfDay(date); + let timeMs = date.valueOf() - startOfDayDate.valueOf(); + if (timeMs >= internal$1.asRoughMs(dateProfile.slotMinTime) && + timeMs < internal$1.asRoughMs(dateProfile.slotMaxTime)) { + return this.computeTimeTop(internal$1.createDuration(timeMs)); + } + } + return null; + } + // Computes the top coordinate, relative to the bounds of the grid, of the given date. + // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight. + computeDateTop(when, startOfDayDate) { + if (!startOfDayDate) { + startOfDayDate = internal$1.startOfDay(when); + } + return this.computeTimeTop(internal$1.createDuration(when.valueOf() - startOfDayDate.valueOf())); + } + // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). + // This is a makeshify way to compute the time-top. Assumes all slatMetas dates are uniform. + // Eventually allow computation with arbirary slat dates. + computeTimeTop(duration) { + let { positions, dateProfile } = this; + let len = positions.els.length; + // floating-point value of # of slots covered + let slatCoverage = (duration.milliseconds - internal$1.asRoughMs(dateProfile.slotMinTime)) / internal$1.asRoughMs(this.slotDuration); + let slatIndex; + let slatRemainder; + // compute a floating-point number for how many slats should be progressed through. + // from 0 to number of slats (inclusive) + // constrained because slotMinTime/slotMaxTime might be customized. + slatCoverage = Math.max(0, slatCoverage); + slatCoverage = Math.min(len, slatCoverage); + // an integer index of the furthest whole slat + // from 0 to number slats (*exclusive*, so len-1) + slatIndex = Math.floor(slatCoverage); + slatIndex = Math.min(slatIndex, len - 1); + // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition. + // could be 1.0 if slatCoverage is covering *all* the slots + slatRemainder = slatCoverage - slatIndex; + return positions.tops[slatIndex] + + positions.getHeight(slatIndex) * slatRemainder; + } + } + + class TimeColsSlatsBody extends internal$1.BaseComponent { + render() { + let { props, context } = this; + let { options } = context; + let { slatElRefs } = props; + return (preact.createElement("tbody", null, props.slatMetas.map((slatMeta, i) => { + let renderProps = { + time: slatMeta.time, + date: context.dateEnv.toDate(slatMeta.date), + view: context.viewApi, + }; + return (preact.createElement("tr", { key: slatMeta.key, ref: slatElRefs.createRef(slatMeta.key) }, + props.axis && (preact.createElement(TimeColsAxisCell, Object.assign({}, slatMeta))), + preact.createElement(internal$1.ContentContainer, { elTag: "td", elClasses: [ + 'fc-timegrid-slot', + 'fc-timegrid-slot-lane', + !slatMeta.isLabeled && 'fc-timegrid-slot-minor', + ], elAttrs: { + 'data-time': slatMeta.isoTimeStr, + }, renderProps: renderProps, generatorName: "slotLaneContent", generator: options.slotLaneContent, classNameGenerator: options.slotLaneClassNames, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }))); + }))); + } + } + + /* + for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL. + */ + class TimeColsSlats extends internal$1.BaseComponent { + constructor() { + super(...arguments); + this.rootElRef = preact.createRef(); + this.slatElRefs = new internal$1.RefMap(); + } + render() { + let { props, context } = this; + return (preact.createElement("div", { ref: this.rootElRef, className: "fc-timegrid-slots" }, + preact.createElement("table", { "aria-hidden": true, className: context.theme.getClass('table'), style: { + minWidth: props.tableMinWidth, + width: props.clientWidth, + height: props.minHeight, + } }, + props.tableColGroupNode /* relies on there only being a single <col> for the axis */, + preact.createElement(TimeColsSlatsBody, { slatElRefs: this.slatElRefs, axis: props.axis, slatMetas: props.slatMetas })))); + } + componentDidMount() { + this.updateSizing(); + } + componentDidUpdate() { + this.updateSizing(); + } + componentWillUnmount() { + if (this.props.onCoords) { + this.props.onCoords(null); + } + } + updateSizing() { + let { context, props } = this; + if (props.onCoords && + props.clientWidth !== null // means sizing has stabilized + ) { + let rootEl = this.rootElRef.current; + if (rootEl.offsetHeight) { // not hidden by css + props.onCoords(new TimeColsSlatsCoords(new internal$1.PositionCache(this.rootElRef.current, collectSlatEls(this.slatElRefs.currentMap, props.slatMetas), false, true), this.props.dateProfile, context.options.slotDuration)); + } + } + } + } + function collectSlatEls(elMap, slatMetas) { + return slatMetas.map((slatMeta) => elMap[slatMeta.key]); + } + + function splitSegsByCol(segs, colCnt) { + let segsByCol = []; + let i; + for (i = 0; i < colCnt; i += 1) { + segsByCol.push([]); + } + if (segs) { + for (i = 0; i < segs.length; i += 1) { + segsByCol[segs[i].col].push(segs[i]); + } + } + return segsByCol; + } + function splitInteractionByCol(ui, colCnt) { + let byRow = []; + if (!ui) { + for (let i = 0; i < colCnt; i += 1) { + byRow[i] = null; + } + } + else { + for (let i = 0; i < colCnt; i += 1) { + byRow[i] = { + affectedInstances: ui.affectedInstances, + isEvent: ui.isEvent, + segs: [], + }; + } + for (let seg of ui.segs) { + byRow[seg.col].segs.push(seg); + } + } + return byRow; + } + + class TimeColMoreLink extends internal$1.BaseComponent { + render() { + let { props } = this; + return (preact.createElement(internal$1.MoreLinkContainer, { elClasses: ['fc-timegrid-more-link'], elStyle: { + top: props.top, + bottom: props.bottom, + }, allDayDate: null, moreCnt: props.hiddenSegs.length, allSegs: props.hiddenSegs, hiddenSegs: props.hiddenSegs, extraDateSpan: props.extraDateSpan, dateProfile: props.dateProfile, todayRange: props.todayRange, popoverContent: () => renderPlainFgSegs(props.hiddenSegs, props), defaultGenerator: renderMoreLinkInner }, (InnerContent) => (preact.createElement(InnerContent, { elTag: "div", elClasses: ['fc-timegrid-more-link-inner', 'fc-sticky'] })))); + } + } + function renderMoreLinkInner(props) { + return props.shortText; + } + + // segInputs assumed sorted + function buildPositioning(segInputs, strictOrder, maxStackCnt) { + let hierarchy = new internal$1.SegHierarchy(); + if (strictOrder != null) { + hierarchy.strictOrder = strictOrder; + } + if (maxStackCnt != null) { + hierarchy.maxStackCnt = maxStackCnt; + } + let hiddenEntries = hierarchy.addSegs(segInputs); + let hiddenGroups = internal$1.groupIntersectingEntries(hiddenEntries); + let web = buildWeb(hierarchy); + web = stretchWeb(web, 1); // all levelCoords/thickness will have 0.0-1.0 + let segRects = webToRects(web); + return { segRects, hiddenGroups }; + } + function buildWeb(hierarchy) { + const { entriesByLevel } = hierarchy; + const buildNode = cacheable((level, lateral) => level + ':' + lateral, (level, lateral) => { + let siblingRange = findNextLevelSegs(hierarchy, level, lateral); + let nextLevelRes = buildNodes(siblingRange, buildNode); + let entry = entriesByLevel[level][lateral]; + return [ + Object.assign(Object.assign({}, entry), { nextLevelNodes: nextLevelRes[0] }), + entry.thickness + nextLevelRes[1], // the pressure builds + ]; + }); + return buildNodes(entriesByLevel.length + ? { level: 0, lateralStart: 0, lateralEnd: entriesByLevel[0].length } + : null, buildNode)[0]; + } + function buildNodes(siblingRange, buildNode) { + if (!siblingRange) { + return [[], 0]; + } + let { level, lateralStart, lateralEnd } = siblingRange; + let lateral = lateralStart; + let pairs = []; + while (lateral < lateralEnd) { + pairs.push(buildNode(level, lateral)); + lateral += 1; + } + pairs.sort(cmpDescPressures); + return [ + pairs.map(extractNode), + pairs[0][1], // first item's pressure + ]; + } + function cmpDescPressures(a, b) { + return b[1] - a[1]; + } + function extractNode(a) { + return a[0]; + } + function findNextLevelSegs(hierarchy, subjectLevel, subjectLateral) { + let { levelCoords, entriesByLevel } = hierarchy; + let subjectEntry = entriesByLevel[subjectLevel][subjectLateral]; + let afterSubject = levelCoords[subjectLevel] + subjectEntry.thickness; + let levelCnt = levelCoords.length; + let level = subjectLevel; + // skip past levels that are too high up + for (; level < levelCnt && levelCoords[level] < afterSubject; level += 1) + ; // do nothing + for (; level < levelCnt; level += 1) { + let entries = entriesByLevel[level]; + let entry; + let searchIndex = internal$1.binarySearch(entries, subjectEntry.span.start, internal$1.getEntrySpanEnd); + let lateralStart = searchIndex[0] + searchIndex[1]; // if exact match (which doesn't collide), go to next one + let lateralEnd = lateralStart; + while ( // loop through entries that horizontally intersect + (entry = entries[lateralEnd]) && // but not past the whole seg list + entry.span.start < subjectEntry.span.end) { + lateralEnd += 1; + } + if (lateralStart < lateralEnd) { + return { level, lateralStart, lateralEnd }; + } + } + return null; + } + function stretchWeb(topLevelNodes, totalThickness) { + const stretchNode = cacheable((node, startCoord, prevThickness) => internal$1.buildEntryKey(node), (node, startCoord, prevThickness) => { + let { nextLevelNodes, thickness } = node; + let allThickness = thickness + prevThickness; + let thicknessFraction = thickness / allThickness; + let endCoord; + let newChildren = []; + if (!nextLevelNodes.length) { + endCoord = totalThickness; + } + else { + for (let childNode of nextLevelNodes) { + if (endCoord === undefined) { + let res = stretchNode(childNode, startCoord, allThickness); + endCoord = res[0]; + newChildren.push(res[1]); + } + else { + let res = stretchNode(childNode, endCoord, 0); + newChildren.push(res[1]); + } + } + } + let newThickness = (endCoord - startCoord) * thicknessFraction; + return [endCoord - newThickness, Object.assign(Object.assign({}, node), { thickness: newThickness, nextLevelNodes: newChildren })]; + }); + return topLevelNodes.map((node) => stretchNode(node, 0, 0)[1]); + } + // not sorted in any particular order + function webToRects(topLevelNodes) { + let rects = []; + const processNode = cacheable((node, levelCoord, stackDepth) => internal$1.buildEntryKey(node), (node, levelCoord, stackDepth) => { + let rect = Object.assign(Object.assign({}, node), { levelCoord, + stackDepth, stackForward: 0 }); + rects.push(rect); + return (rect.stackForward = processNodes(node.nextLevelNodes, levelCoord + node.thickness, stackDepth + 1) + 1); + }); + function processNodes(nodes, levelCoord, stackDepth) { + let stackForward = 0; + for (let node of nodes) { + stackForward = Math.max(processNode(node, levelCoord, stackDepth), stackForward); + } + return stackForward; + } + processNodes(topLevelNodes, 0, 0); + return rects; // TODO: sort rects by levelCoord to be consistent with toRects? + } + // TODO: move to general util + function cacheable(keyFunc, workFunc) { + const cache = {}; + return (...args) => { + let key = keyFunc(...args); + return (key in cache) + ? cache[key] + : (cache[key] = workFunc(...args)); + }; + } + + function computeSegVCoords(segs, colDate, slatCoords = null, eventMinHeight = 0) { + let vcoords = []; + if (slatCoords) { + for (let i = 0; i < segs.length; i += 1) { + let seg = segs[i]; + let spanStart = slatCoords.computeDateTop(seg.start, colDate); + let spanEnd = Math.max(spanStart + (eventMinHeight || 0), // :( + slatCoords.computeDateTop(seg.end, colDate)); + vcoords.push({ + start: Math.round(spanStart), + end: Math.round(spanEnd), // + }); + } + } + return vcoords; + } + function computeFgSegPlacements(segs, segVCoords, // might not have for every seg + eventOrderStrict, eventMaxStack) { + let segInputs = []; + let dumbSegs = []; // segs without coords + for (let i = 0; i < segs.length; i += 1) { + let vcoords = segVCoords[i]; + if (vcoords) { + segInputs.push({ + index: i, + thickness: 1, + span: vcoords, + }); + } + else { + dumbSegs.push(segs[i]); + } + } + let { segRects, hiddenGroups } = buildPositioning(segInputs, eventOrderStrict, eventMaxStack); + let segPlacements = []; + for (let segRect of segRects) { + segPlacements.push({ + seg: segs[segRect.index], + rect: segRect, + }); + } + for (let dumbSeg of dumbSegs) { + segPlacements.push({ seg: dumbSeg, rect: null }); + } + return { segPlacements, hiddenGroups }; + } + + const DEFAULT_TIME_FORMAT = internal$1.createFormatter({ + hour: 'numeric', + minute: '2-digit', + meridiem: false, + }); + class TimeColEvent extends internal$1.BaseComponent { + render() { + return (preact.createElement(internal$1.StandardEvent, Object.assign({}, this.props, { elClasses: [ + 'fc-timegrid-event', + 'fc-v-event', + this.props.isShort && 'fc-timegrid-event-short', + ], defaultTimeFormat: DEFAULT_TIME_FORMAT }))); + } + } + + class TimeCol extends internal$1.BaseComponent { + constructor() { + super(...arguments); + this.sortEventSegs = internal$1.memoize(internal$1.sortEventSegs); + } + // TODO: memoize event-placement? + render() { + let { props, context } = this; + let { options } = context; + let isSelectMirror = options.selectMirror; + let mirrorSegs = // yuck + (props.eventDrag && props.eventDrag.segs) || + (props.eventResize && props.eventResize.segs) || + (isSelectMirror && props.dateSelectionSegs) || + []; + let interactionAffectedInstances = // TODO: messy way to compute this + (props.eventDrag && props.eventDrag.affectedInstances) || + (props.eventResize && props.eventResize.affectedInstances) || + {}; + let sortedFgSegs = this.sortEventSegs(props.fgEventSegs, options.eventOrder); + return (preact.createElement(internal$1.DayCellContainer, { elTag: "td", elRef: props.elRef, elClasses: [ + 'fc-timegrid-col', + ...(props.extraClassNames || []), + ], elAttrs: Object.assign({ role: 'gridcell' }, props.extraDataAttrs), date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, extraRenderProps: props.extraRenderProps }, (InnerContent) => (preact.createElement("div", { className: "fc-timegrid-col-frame" }, + preact.createElement("div", { className: "fc-timegrid-col-bg" }, + this.renderFillSegs(props.businessHourSegs, 'non-business'), + this.renderFillSegs(props.bgEventSegs, 'bg-event'), + this.renderFillSegs(props.dateSelectionSegs, 'highlight')), + preact.createElement("div", { className: "fc-timegrid-col-events" }, this.renderFgSegs(sortedFgSegs, interactionAffectedInstances, false, false, false)), + preact.createElement("div", { className: "fc-timegrid-col-events" }, this.renderFgSegs(mirrorSegs, {}, Boolean(props.eventDrag), Boolean(props.eventResize), Boolean(isSelectMirror))), + preact.createElement("div", { className: "fc-timegrid-now-indicator-container" }, this.renderNowIndicator(props.nowIndicatorSegs)), + internal$1.hasCustomDayCellContent(options) && (preact.createElement(InnerContent, { elTag: "div", elClasses: ['fc-timegrid-col-misc'] })))))); + } + renderFgSegs(sortedFgSegs, segIsInvisible, isDragging, isResizing, isDateSelecting) { + let { props } = this; + if (props.forPrint) { + return renderPlainFgSegs(sortedFgSegs, props); + } + return this.renderPositionedFgSegs(sortedFgSegs, segIsInvisible, isDragging, isResizing, isDateSelecting); + } + renderPositionedFgSegs(segs, // if not mirror, needs to be sorted + segIsInvisible, isDragging, isResizing, isDateSelecting) { + let { eventMaxStack, eventShortHeight, eventOrderStrict, eventMinHeight } = this.context.options; + let { date, slatCoords, eventSelection, todayRange, nowDate } = this.props; + let isMirror = isDragging || isResizing || isDateSelecting; + let segVCoords = computeSegVCoords(segs, date, slatCoords, eventMinHeight); + let { segPlacements, hiddenGroups } = computeFgSegPlacements(segs, segVCoords, eventOrderStrict, eventMaxStack); + return (preact.createElement(preact.Fragment, null, + this.renderHiddenGroups(hiddenGroups, segs), + segPlacements.map((segPlacement) => { + let { seg, rect } = segPlacement; + let instanceId = seg.eventRange.instance.instanceId; + let isVisible = isMirror || Boolean(!segIsInvisible[instanceId] && rect); + let vStyle = computeSegVStyle(rect && rect.span); + let hStyle = (!isMirror && rect) ? this.computeSegHStyle(rect) : { left: 0, right: 0 }; + let isInset = Boolean(rect) && rect.stackForward > 0; + let isShort = Boolean(rect) && (rect.span.end - rect.span.start) < eventShortHeight; // look at other places for this problem + return (preact.createElement("div", { className: 'fc-timegrid-event-harness' + + (isInset ? ' fc-timegrid-event-harness-inset' : ''), key: instanceId, style: Object.assign(Object.assign({ visibility: isVisible ? '' : 'hidden' }, vStyle), hStyle) }, + preact.createElement(TimeColEvent, Object.assign({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, isShort: isShort }, internal$1.getSegMeta(seg, todayRange, nowDate))))); + }))); + } + // will already have eventMinHeight applied because segInputs already had it + renderHiddenGroups(hiddenGroups, segs) { + let { extraDateSpan, dateProfile, todayRange, nowDate, eventSelection, eventDrag, eventResize } = this.props; + return (preact.createElement(preact.Fragment, null, hiddenGroups.map((hiddenGroup) => { + let positionCss = computeSegVStyle(hiddenGroup.span); + let hiddenSegs = compileSegsFromEntries(hiddenGroup.entries, segs); + return (preact.createElement(TimeColMoreLink, { key: internal$1.buildIsoString(internal$1.computeEarliestSegStart(hiddenSegs)), hiddenSegs: hiddenSegs, top: positionCss.top, bottom: positionCss.bottom, extraDateSpan: extraDateSpan, dateProfile: dateProfile, todayRange: todayRange, nowDate: nowDate, eventSelection: eventSelection, eventDrag: eventDrag, eventResize: eventResize })); + }))); + } + renderFillSegs(segs, fillType) { + let { props, context } = this; + let segVCoords = computeSegVCoords(segs, props.date, props.slatCoords, context.options.eventMinHeight); // don't assume all populated + let children = segVCoords.map((vcoords, i) => { + let seg = segs[i]; + return (preact.createElement("div", { key: internal$1.buildEventRangeKey(seg.eventRange), className: "fc-timegrid-bg-harness", style: computeSegVStyle(vcoords) }, fillType === 'bg-event' ? + preact.createElement(internal$1.BgEvent, Object.assign({ seg: seg }, internal$1.getSegMeta(seg, props.todayRange, props.nowDate))) : + internal$1.renderFill(fillType))); + }); + return preact.createElement(preact.Fragment, null, children); + } + renderNowIndicator(segs) { + let { slatCoords, date } = this.props; + if (!slatCoords) { + return null; + } + return segs.map((seg, i) => (preact.createElement(internal$1.NowIndicatorContainer + // key doesn't matter. will only ever be one + , { + // key doesn't matter. will only ever be one + key: i, elClasses: ['fc-timegrid-now-indicator-line'], elStyle: { + top: slatCoords.computeDateTop(seg.start, date), + }, isAxis: false, date: date }))); + } + computeSegHStyle(segHCoords) { + let { isRtl, options } = this.context; + let shouldOverlap = options.slotEventOverlap; + let nearCoord = segHCoords.levelCoord; // the left side if LTR. the right side if RTL. floating-point + let farCoord = segHCoords.levelCoord + segHCoords.thickness; // the right side if LTR. the left side if RTL. floating-point + let left; // amount of space from left edge, a fraction of the total width + let right; // amount of space from right edge, a fraction of the total width + if (shouldOverlap) { + // double the width, but don't go beyond the maximum forward coordinate (1.0) + farCoord = Math.min(1, nearCoord + (farCoord - nearCoord) * 2); + } + if (isRtl) { + left = 1 - farCoord; + right = nearCoord; + } + else { + left = nearCoord; + right = 1 - farCoord; + } + let props = { + zIndex: segHCoords.stackDepth + 1, + left: left * 100 + '%', + right: right * 100 + '%', + }; + if (shouldOverlap && !segHCoords.stackForward) { + // add padding to the edge so that forward stacked events don't cover the resizer's icon + props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width + } + return props; + } + } + function renderPlainFgSegs(sortedFgSegs, { todayRange, nowDate, eventSelection, eventDrag, eventResize }) { + let hiddenInstances = (eventDrag ? eventDrag.affectedInstances : null) || + (eventResize ? eventResize.affectedInstances : null) || + {}; + return (preact.createElement(preact.Fragment, null, sortedFgSegs.map((seg) => { + let instanceId = seg.eventRange.instance.instanceId; + return (preact.createElement("div", { key: instanceId, style: { visibility: hiddenInstances[instanceId] ? 'hidden' : '' } }, + preact.createElement(TimeColEvent, Object.assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === eventSelection, isShort: false }, internal$1.getSegMeta(seg, todayRange, nowDate))))); + }))); + } + function computeSegVStyle(segVCoords) { + if (!segVCoords) { + return { top: '', bottom: '' }; + } + return { + top: segVCoords.start, + bottom: -segVCoords.end, + }; + } + function compileSegsFromEntries(segEntries, allSegs) { + return segEntries.map((segEntry) => allSegs[segEntry.index]); + } + + class TimeColsContent extends internal$1.BaseComponent { + constructor() { + super(...arguments); + this.splitFgEventSegs = internal$1.memoize(splitSegsByCol); + this.splitBgEventSegs = internal$1.memoize(splitSegsByCol); + this.splitBusinessHourSegs = internal$1.memoize(splitSegsByCol); + this.splitNowIndicatorSegs = internal$1.memoize(splitSegsByCol); + this.splitDateSelectionSegs = internal$1.memoize(splitSegsByCol); + this.splitEventDrag = internal$1.memoize(splitInteractionByCol); + this.splitEventResize = internal$1.memoize(splitInteractionByCol); + this.rootElRef = preact.createRef(); + this.cellElRefs = new internal$1.RefMap(); + } + render() { + let { props, context } = this; + let nowIndicatorTop = context.options.nowIndicator && + props.slatCoords && + props.slatCoords.safeComputeTop(props.nowDate); // might return void + let colCnt = props.cells.length; + let fgEventSegsByRow = this.splitFgEventSegs(props.fgEventSegs, colCnt); + let bgEventSegsByRow = this.splitBgEventSegs(props.bgEventSegs, colCnt); + let businessHourSegsByRow = this.splitBusinessHourSegs(props.businessHourSegs, colCnt); + let nowIndicatorSegsByRow = this.splitNowIndicatorSegs(props.nowIndicatorSegs, colCnt); + let dateSelectionSegsByRow = this.splitDateSelectionSegs(props.dateSelectionSegs, colCnt); + let eventDragByRow = this.splitEventDrag(props.eventDrag, colCnt); + let eventResizeByRow = this.splitEventResize(props.eventResize, colCnt); + return (preact.createElement("div", { className: "fc-timegrid-cols", ref: this.rootElRef }, + preact.createElement("table", { role: "presentation", style: { + minWidth: props.tableMinWidth, + width: props.clientWidth, + } }, + props.tableColGroupNode, + preact.createElement("tbody", { role: "presentation" }, + preact.createElement("tr", { role: "row" }, + props.axis && (preact.createElement("td", { "aria-hidden": true, className: "fc-timegrid-col fc-timegrid-axis" }, + preact.createElement("div", { className: "fc-timegrid-col-frame" }, + preact.createElement("div", { className: "fc-timegrid-now-indicator-container" }, typeof nowIndicatorTop === 'number' && (preact.createElement(internal$1.NowIndicatorContainer, { elClasses: ['fc-timegrid-now-indicator-arrow'], elStyle: { top: nowIndicatorTop }, isAxis: true, date: props.nowDate })))))), + props.cells.map((cell, i) => (preact.createElement(TimeCol, { key: cell.key, elRef: this.cellElRefs.createRef(cell.key), dateProfile: props.dateProfile, date: cell.date, nowDate: props.nowDate, todayRange: props.todayRange, extraRenderProps: cell.extraRenderProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, fgEventSegs: fgEventSegsByRow[i], bgEventSegs: bgEventSegsByRow[i], businessHourSegs: businessHourSegsByRow[i], nowIndicatorSegs: nowIndicatorSegsByRow[i], dateSelectionSegs: dateSelectionSegsByRow[i], eventDrag: eventDragByRow[i], eventResize: eventResizeByRow[i], slatCoords: props.slatCoords, eventSelection: props.eventSelection, forPrint: props.forPrint })))))))); + } + componentDidMount() { + this.updateCoords(); + } + componentDidUpdate() { + this.updateCoords(); + } + updateCoords() { + let { props } = this; + if (props.onColCoords && + props.clientWidth !== null // means sizing has stabilized + ) { + props.onColCoords(new internal$1.PositionCache(this.rootElRef.current, collectCellEls(this.cellElRefs.currentMap, props.cells), true, // horizontal + false)); + } + } + } + function collectCellEls(elMap, cells) { + return cells.map((cell) => elMap[cell.key]); + } + + /* A component that renders one or more columns of vertical time slots + ----------------------------------------------------------------------------------------------------------------------*/ + class TimeCols extends internal$1.DateComponent { + constructor() { + super(...arguments); + this.processSlotOptions = internal$1.memoize(processSlotOptions); + this.state = { + slatCoords: null, + }; + this.handleRootEl = (el) => { + if (el) { + this.context.registerInteractiveComponent(this, { + el, + isHitComboAllowed: this.props.isHitComboAllowed, + }); + } + else { + this.context.unregisterInteractiveComponent(this); + } + }; + this.handleScrollRequest = (request) => { + let { onScrollTopRequest } = this.props; + let { slatCoords } = this.state; + if (onScrollTopRequest && slatCoords) { + if (request.time) { + let top = slatCoords.computeTimeTop(request.time); + top = Math.ceil(top); // zoom can give weird floating-point values. rather scroll a little bit further + if (top) { + top += 1; // to overcome top border that slots beyond the first have. looks better + } + onScrollTopRequest(top); + } + return true; + } + return false; + }; + this.handleColCoords = (colCoords) => { + this.colCoords = colCoords; + }; + this.handleSlatCoords = (slatCoords) => { + this.setState({ slatCoords }); + if (this.props.onSlatCoords) { + this.props.onSlatCoords(slatCoords); + } + }; + } + render() { + let { props, state } = this; + return (preact.createElement("div", { className: "fc-timegrid-body", ref: this.handleRootEl, style: { + // these props are important to give this wrapper correct dimensions for interactions + // TODO: if we set it here, can we avoid giving to inner tables? + width: props.clientWidth, + minWidth: props.tableMinWidth, + } }, + preact.createElement(TimeColsSlats, { axis: props.axis, dateProfile: props.dateProfile, slatMetas: props.slatMetas, clientWidth: props.clientWidth, minHeight: props.expandRows ? props.clientHeight : '', tableMinWidth: props.tableMinWidth, tableColGroupNode: props.axis ? props.tableColGroupNode : null /* axis depends on the colgroup's shrinking */, onCoords: this.handleSlatCoords }), + preact.createElement(TimeColsContent, { cells: props.cells, axis: props.axis, dateProfile: props.dateProfile, businessHourSegs: props.businessHourSegs, bgEventSegs: props.bgEventSegs, fgEventSegs: props.fgEventSegs, dateSelectionSegs: props.dateSelectionSegs, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange, nowDate: props.nowDate, nowIndicatorSegs: props.nowIndicatorSegs, clientWidth: props.clientWidth, tableMinWidth: props.tableMinWidth, tableColGroupNode: props.tableColGroupNode, slatCoords: state.slatCoords, onColCoords: this.handleColCoords, forPrint: props.forPrint }))); + } + componentDidMount() { + this.scrollResponder = this.context.createScrollResponder(this.handleScrollRequest); + } + componentDidUpdate(prevProps) { + this.scrollResponder.update(prevProps.dateProfile !== this.props.dateProfile); + } + componentWillUnmount() { + this.scrollResponder.detach(); + } + queryHit(positionLeft, positionTop) { + let { dateEnv, options } = this.context; + let { colCoords } = this; + let { dateProfile } = this.props; + let { slatCoords } = this.state; + let { snapDuration, snapsPerSlot } = this.processSlotOptions(this.props.slotDuration, options.snapDuration); + let colIndex = colCoords.leftToIndex(positionLeft); + let slatIndex = slatCoords.positions.topToIndex(positionTop); + if (colIndex != null && slatIndex != null) { + let cell = this.props.cells[colIndex]; + let slatTop = slatCoords.positions.tops[slatIndex]; + let slatHeight = slatCoords.positions.getHeight(slatIndex); + let partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1 + let localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat + let snapIndex = slatIndex * snapsPerSlot + localSnapIndex; + let dayDate = this.props.cells[colIndex].date; + let time = internal$1.addDurations(dateProfile.slotMinTime, internal$1.multiplyDuration(snapDuration, snapIndex)); + let start = dateEnv.add(dayDate, time); + let end = dateEnv.add(start, snapDuration); + return { + dateProfile, + dateSpan: Object.assign({ range: { start, end }, allDay: false }, cell.extraDateSpan), + dayEl: colCoords.els[colIndex], + rect: { + left: colCoords.lefts[colIndex], + right: colCoords.rights[colIndex], + top: slatTop, + bottom: slatTop + slatHeight, + }, + layer: 0, + }; + } + return null; + } + } + function processSlotOptions(slotDuration, snapDurationOverride) { + let snapDuration = snapDurationOverride || slotDuration; + let snapsPerSlot = internal$1.wholeDivideDurations(slotDuration, snapDuration); + if (snapsPerSlot === null) { + snapDuration = slotDuration; + snapsPerSlot = 1; + // TODO: say warning? + } + return { snapDuration, snapsPerSlot }; + } + + class DayTimeColsSlicer extends internal$1.Slicer { + sliceRange(range, dayRanges) { + let segs = []; + for (let col = 0; col < dayRanges.length; col += 1) { + let segRange = internal$1.intersectRanges(range, dayRanges[col]); + if (segRange) { + segs.push({ + start: segRange.start, + end: segRange.end, + isStart: segRange.start.valueOf() === range.start.valueOf(), + isEnd: segRange.end.valueOf() === range.end.valueOf(), + col, + }); + } + } + return segs; + } + } + + class DayTimeCols extends internal$1.DateComponent { + constructor() { + super(...arguments); + this.buildDayRanges = internal$1.memoize(buildDayRanges); + this.slicer = new DayTimeColsSlicer(); + this.timeColsRef = preact.createRef(); + } + render() { + let { props, context } = this; + let { dateProfile, dayTableModel } = props; + let isNowIndicator = context.options.nowIndicator; + let dayRanges = this.buildDayRanges(dayTableModel, dateProfile, context.dateEnv); + // give it the first row of cells + // TODO: would move this further down hierarchy, but sliceNowDate needs it + return (preact.createElement(internal$1.NowTimer, { unit: isNowIndicator ? 'minute' : 'day' }, (nowDate, todayRange) => (preact.createElement(TimeCols, Object.assign({ ref: this.timeColsRef }, this.slicer.sliceProps(props, dateProfile, null, context, dayRanges), { forPrint: props.forPrint, axis: props.axis, dateProfile: dateProfile, slatMetas: props.slatMetas, slotDuration: props.slotDuration, cells: dayTableModel.cells[0], tableColGroupNode: props.tableColGroupNode, tableMinWidth: props.tableMinWidth, clientWidth: props.clientWidth, clientHeight: props.clientHeight, expandRows: props.expandRows, nowDate: nowDate, nowIndicatorSegs: isNowIndicator && this.slicer.sliceNowDate(nowDate, context, dayRanges), todayRange: todayRange, onScrollTopRequest: props.onScrollTopRequest, onSlatCoords: props.onSlatCoords }))))); + } + } + function buildDayRanges(dayTableModel, dateProfile, dateEnv) { + let ranges = []; + for (let date of dayTableModel.headerDates) { + ranges.push({ + start: dateEnv.add(date, dateProfile.slotMinTime), + end: dateEnv.add(date, dateProfile.slotMaxTime), + }); + } + return ranges; + } + + // potential nice values for the slot-duration and interval-duration + // from largest to smallest + const STOCK_SUB_DURATIONS = [ + { hours: 1 }, + { minutes: 30 }, + { minutes: 15 }, + { seconds: 30 }, + { seconds: 15 }, + ]; + function buildSlatMetas(slotMinTime, slotMaxTime, explicitLabelInterval, slotDuration, dateEnv) { + let dayStart = new Date(0); + let slatTime = slotMinTime; + let slatIterator = internal$1.createDuration(0); + let labelInterval = explicitLabelInterval || computeLabelInterval(slotDuration); + let metas = []; + while (internal$1.asRoughMs(slatTime) < internal$1.asRoughMs(slotMaxTime)) { + let date = dateEnv.add(dayStart, slatTime); + let isLabeled = internal$1.wholeDivideDurations(slatIterator, labelInterval) !== null; + metas.push({ + date, + time: slatTime, + key: date.toISOString(), + isoTimeStr: internal$1.formatIsoTimeString(date), + isLabeled, + }); + slatTime = internal$1.addDurations(slatTime, slotDuration); + slatIterator = internal$1.addDurations(slatIterator, slotDuration); + } + return metas; + } + // Computes an automatic value for slotLabelInterval + function computeLabelInterval(slotDuration) { + let i; + let labelInterval; + let slotsPerLabel; + // find the smallest stock label interval that results in more than one slots-per-label + for (i = STOCK_SUB_DURATIONS.length - 1; i >= 0; i -= 1) { + labelInterval = internal$1.createDuration(STOCK_SUB_DURATIONS[i]); + slotsPerLabel = internal$1.wholeDivideDurations(labelInterval, slotDuration); + if (slotsPerLabel !== null && slotsPerLabel > 1) { + return labelInterval; + } + } + return slotDuration; // fall back + } + + class DayTimeColsView extends TimeColsView { + constructor() { + super(...arguments); + this.buildTimeColsModel = internal$1.memoize(buildTimeColsModel); + this.buildSlatMetas = internal$1.memoize(buildSlatMetas); + } + render() { + let { options, dateEnv, dateProfileGenerator } = this.context; + let { props } = this; + let { dateProfile } = props; + let dayTableModel = this.buildTimeColsModel(dateProfile, dateProfileGenerator); + let splitProps = this.allDaySplitter.splitProps(props); + let slatMetas = this.buildSlatMetas(dateProfile.slotMinTime, dateProfile.slotMaxTime, options.slotLabelInterval, options.slotDuration, dateEnv); + let { dayMinWidth } = options; + let hasAttachedAxis = !dayMinWidth; + let hasDetachedAxis = dayMinWidth; + let headerContent = options.dayHeaders && (preact.createElement(internal$1.DayHeader, { dates: dayTableModel.headerDates, dateProfile: dateProfile, datesRepDistinctDays: true, renderIntro: hasAttachedAxis ? this.renderHeadAxis : null })); + let allDayContent = (options.allDaySlot !== false) && ((contentArg) => (preact.createElement(internal$2.DayTable, Object.assign({}, splitProps.allDay, { dateProfile: dateProfile, dayTableModel: dayTableModel, nextDayThreshold: options.nextDayThreshold, tableMinWidth: contentArg.tableMinWidth, colGroupNode: contentArg.tableColGroupNode, renderRowIntro: hasAttachedAxis ? this.renderTableRowAxis : null, showWeekNumbers: false, expandRows: false, headerAlignElRef: this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }, this.getAllDayMaxEventProps())))); + let timeGridContent = (contentArg) => (preact.createElement(DayTimeCols, Object.assign({}, splitProps.timed, { dayTableModel: dayTableModel, dateProfile: dateProfile, axis: hasAttachedAxis, slotDuration: options.slotDuration, slatMetas: slatMetas, forPrint: props.forPrint, tableColGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, onSlatCoords: this.handleSlatCoords, expandRows: contentArg.expandRows, onScrollTopRequest: this.handleScrollTopRequest }))); + return hasDetachedAxis + ? this.renderHScrollLayout(headerContent, allDayContent, timeGridContent, dayTableModel.colCnt, dayMinWidth, slatMetas, this.state.slatCoords) + : this.renderSimpleLayout(headerContent, allDayContent, timeGridContent); + } + } + function buildTimeColsModel(dateProfile, dateProfileGenerator) { + let daySeries = new internal$1.DaySeriesModel(dateProfile.renderRange, dateProfileGenerator); + return new internal$1.DayTableModel(daySeries, false); + } + + const OPTION_REFINERS = { + allDaySlot: Boolean, + }; + + var css_248z = ".fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:\"\\00a0\"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:\"\\00a0-\\00a0\"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}"; + internal$1.injectStyles(css_248z); + + var plugin = core.createPlugin({ + name: '@fullcalendar/timegrid', + initialView: 'timeGridWeek', + optionRefiners: OPTION_REFINERS, + views: { + timeGrid: { + component: DayTimeColsView, + usesMinMaxTime: true, + allDaySlot: true, + slotDuration: '00:30:00', + slotEventOverlap: true, // a bad name. confused with overlap/constraint system + }, + timeGridDay: { + type: 'timeGrid', + duration: { days: 1 }, + }, + timeGridWeek: { + type: 'timeGrid', + duration: { weeks: 1 }, + }, + }, + }); + + var internal = { + __proto__: null, + TimeColsView: TimeColsView, + DayTimeColsView: DayTimeColsView, + buildTimeColsModel: buildTimeColsModel, + DayTimeCols: DayTimeCols, + buildDayRanges: buildDayRanges, + DayTimeColsSlicer: DayTimeColsSlicer, + TimeCols: TimeCols, + buildSlatMetas: buildSlatMetas, + TimeColsSlatsCoords: TimeColsSlatsCoords + }; + + core.globalPlugins.push(plugin); + + exports.Internal = internal; + exports["default"] = plugin; + + Object.defineProperty(exports, '__esModule', { value: true }); + + return exports; + +})({}, FullCalendar, FullCalendar.Internal, FullCalendar.Preact, FullCalendar.DayGrid.Internal); diff --git a/library/fullcalendar/packages/timegrid/index.global.min.js b/library/fullcalendar/packages/timegrid/index.global.min.js new file mode 100644 index 000000000..3d05a9b1e --- /dev/null +++ b/library/fullcalendar/packages/timegrid/index.global.min.js @@ -0,0 +1,6 @@ +/*! +FullCalendar Time Grid Plugin v6.0.3 +Docs & License: https://fullcalendar.io/docs/timegrid-view +(c) 2022 Adam Shaw +*/ +FullCalendar.TimeGrid=function(e,t,i,r,n){"use strict";class o extends i.Splitter{getKeyInfo(){return{allDay:{},timed:{}}}getKeysForDateSpan(e){return e.allDay?["allDay"]:["timed"]}getKeysForEventDef(e){return e.allDay?i.hasBgRendering(e)?["timed","allDay"]:["allDay"]:["timed"]}}const s=i.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"});function l(e){let t=["fc-timegrid-slot","fc-timegrid-slot-label",e.isLabeled?"fc-scrollgrid-shrink":"fc-timegrid-slot-minor"];return r.createElement(i.ViewContextType.Consumer,null,n=>{if(!e.isLabeled)return r.createElement("td",{className:t.join(" "),"data-time":e.isoTimeStr});let{dateEnv:o,options:l,viewApi:c}=n,d=null==l.slotLabelFormat?s:Array.isArray(l.slotLabelFormat)?i.createFormatter(l.slotLabelFormat[0]):i.createFormatter(l.slotLabelFormat),m={level:0,time:e.time,date:o.toDate(e.date),view:c,text:o.format(e.date,d)};return r.createElement(i.ContentContainer,{elTag:"td",elClasses:t,elAttrs:{"data-time":e.isoTimeStr},renderProps:m,generatorName:"slotLabelContent",generator:l.slotLabelContent||a,classNameGenerator:l.slotLabelClassNames,didMount:l.slotLabelDidMount,willUnmount:l.slotLabelWillUnmount},e=>r.createElement("div",{className:"fc-timegrid-slot-label-frame fc-scrollgrid-shrink-frame"},r.createElement(e,{elTag:"div",elClasses:["fc-timegrid-slot-label-cushion","fc-scrollgrid-shrink-cushion"]})))})}function a(e){return e.text}class c extends i.BaseComponent{render(){return this.props.slatMetas.map(e=>r.createElement("tr",{key:e.key},r.createElement(l,Object.assign({},e))))}}const d=i.createFormatter({week:"short"});class m extends i.DateComponent{constructor(){super(...arguments),this.allDaySplitter=new o,this.headerElRef=r.createRef(),this.rootElRef=r.createRef(),this.scrollerElRef=r.createRef(),this.state={slatCoords:null},this.handleScrollTopRequest=e=>{let t=this.scrollerElRef.current;t&&(t.scrollTop=e)},this.renderHeadAxis=(e,t="")=>{let{options:n}=this.context,{dateProfile:o}=this.props,s=o.renderRange,l=1===i.diffDays(s.start,s.end)?i.buildNavLinkAttrs(this.context,s.start,"week"):{};return n.weekNumbers&&"day"===e?r.createElement(i.WeekNumberContainer,{elTag:"th",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},date:s.start,defaultFormat:d},e=>r.createElement("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame","fc-timegrid-axis-frame-liquid"].join(" "),style:{height:t}},r.createElement(e,{elTag:"a",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"],elAttrs:l}))):r.createElement("th",{"aria-hidden":!0,className:"fc-timegrid-axis"},r.createElement("div",{className:"fc-timegrid-axis-frame",style:{height:t}}))},this.renderTableRowAxis=e=>{let{options:t,viewApi:n}=this.context,o={text:t.allDayText,view:n};return r.createElement(i.ContentContainer,{elTag:"td",elClasses:["fc-timegrid-axis","fc-scrollgrid-shrink"],elAttrs:{"aria-hidden":!0},renderProps:o,generatorName:"allDayContent",generator:t.allDayContent||f,classNameGenerator:t.allDayClassNames,didMount:t.allDayDidMount,willUnmount:t.allDayWillUnmount},t=>r.createElement("div",{className:["fc-timegrid-axis-frame","fc-scrollgrid-shrink-frame",null==e?" fc-timegrid-axis-frame-liquid":""].join(" "),style:{height:e}},r.createElement(t,{elTag:"span",elClasses:["fc-timegrid-axis-cushion","fc-scrollgrid-shrink-cushion","fc-scrollgrid-sync-inner"]})))},this.handleSlatCoords=e=>{this.setState({slatCoords:e})}}renderSimpleLayout(e,t,n){let{context:o,props:s}=this,l=[],a=i.getStickyHeaderDates(o.options);return e&&l.push({type:"header",key:"header",isSticky:a,chunk:{elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}}),t&&(l.push({type:"body",key:"all-day",chunk:{content:t}}),l.push({type:"body",key:"all-day-divider",outerContent:r.createElement("tr",{role:"presentation",className:"fc-scrollgrid-section"},r.createElement("td",{className:"fc-timegrid-divider "+o.theme.getClass("tableCellShaded")}))})),l.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(o.options.expandRows),chunk:{scrollerElRef:this.scrollerElRef,content:n}}),r.createElement(i.ViewContainer,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:o.viewSpec},r.createElement(i.SimpleScrollGrid,{liquid:!s.isHeightAuto&&!s.forPrint,collapsibleWidth:s.forPrint,cols:[{width:"shrink"}],sections:l}))}renderHScrollLayout(e,t,n,o,s,l,a){let d=this.context.pluginHooks.scrollGridImpl;if(!d)throw new Error("No ScrollGrid implementation");let{context:m,props:f}=this,h=!f.forPrint&&i.getStickyHeaderDates(m.options),g=!f.forPrint&&i.getStickyFooterScrollbar(m.options),p=[];e&&p.push({type:"header",key:"header",isSticky:h,syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>r.createElement("tr",{role:"presentation"},this.renderHeadAxis("day",e.rowSyncHeights[0]))},{key:"cols",elRef:this.headerElRef,tableClassName:"fc-col-header",rowContent:e}]}),t&&(p.push({type:"body",key:"all-day",syncRowHeights:!0,chunks:[{key:"axis",rowContent:e=>r.createElement("tr",{role:"presentation"},this.renderTableRowAxis(e.rowSyncHeights[0]))},{key:"cols",content:t}]}),p.push({key:"all-day-divider",type:"body",outerContent:r.createElement("tr",{role:"presentation",className:"fc-scrollgrid-section"},r.createElement("td",{colSpan:2,className:"fc-timegrid-divider "+m.theme.getClass("tableCellShaded")}))}));let u=m.options.nowIndicator;return p.push({type:"body",key:"body",liquid:!0,expandRows:Boolean(m.options.expandRows),chunks:[{key:"axis",content:e=>r.createElement("div",{className:"fc-timegrid-axis-chunk"},r.createElement("table",{"aria-hidden":!0,style:{height:e.expandRows?e.clientHeight:""}},e.tableColGroupNode,r.createElement("tbody",null,r.createElement(c,{slatMetas:l}))),r.createElement("div",{className:"fc-timegrid-now-indicator-container"},r.createElement(i.NowTimer,{unit:u?"minute":"day"},e=>{let t=u&&a&&a.safeComputeTop(e);return"number"==typeof t?r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:t},isAxis:!0,date:e}):null})))},{key:"cols",scrollerElRef:this.scrollerElRef,content:n}]}),g&&p.push({key:"footer",type:"footer",isSticky:!0,chunks:[{key:"axis",content:i.renderScrollShim},{key:"cols",content:i.renderScrollShim}]}),r.createElement(i.ViewContainer,{elRef:this.rootElRef,elClasses:["fc-timegrid"],viewSpec:m.viewSpec},r.createElement(d,{liquid:!f.isHeightAuto&&!f.forPrint,collapsibleWidth:!1,colGroups:[{width:"shrink",cols:[{width:"shrink"}]},{cols:[{span:o,minWidth:s}]}],sections:p}))}getAllDayMaxEventProps(){let{dayMaxEvents:e,dayMaxEventRows:t}=this.context.options;return!0!==e&&!0!==t||(e=void 0,t=5),{dayMaxEvents:e,dayMaxEventRows:t}}}function f(e){return e.text}class h{constructor(e,t,i){this.positions=e,this.dateProfile=t,this.slotDuration=i}safeComputeTop(e){let{dateProfile:t}=this;if(i.rangeContainsMarker(t.currentRange,e)){let r=i.startOfDay(e),n=e.valueOf()-r.valueOf();if(n>=i.asRoughMs(t.slotMinTime)&&n<i.asRoughMs(t.slotMaxTime))return this.computeTimeTop(i.createDuration(n))}return null}computeDateTop(e,t){return t||(t=i.startOfDay(e)),this.computeTimeTop(i.createDuration(e.valueOf()-t.valueOf()))}computeTimeTop(e){let t,r,{positions:n,dateProfile:o}=this,s=n.els.length,l=(e.milliseconds-i.asRoughMs(o.slotMinTime))/i.asRoughMs(this.slotDuration);return l=Math.max(0,l),l=Math.min(s,l),t=Math.floor(l),t=Math.min(t,s-1),r=l-t,n.tops[t]+n.getHeight(t)*r}}class g extends i.BaseComponent{render(){let{props:e,context:t}=this,{options:n}=t,{slatElRefs:o}=e;return r.createElement("tbody",null,e.slatMetas.map((s,a)=>{let c={time:s.time,date:t.dateEnv.toDate(s.date),view:t.viewApi};return r.createElement("tr",{key:s.key,ref:o.createRef(s.key)},e.axis&&r.createElement(l,Object.assign({},s)),r.createElement(i.ContentContainer,{elTag:"td",elClasses:["fc-timegrid-slot","fc-timegrid-slot-lane",!s.isLabeled&&"fc-timegrid-slot-minor"],elAttrs:{"data-time":s.isoTimeStr},renderProps:c,generatorName:"slotLaneContent",generator:n.slotLaneContent,classNameGenerator:n.slotLaneClassNames,didMount:n.slotLaneDidMount,willUnmount:n.slotLaneWillUnmount}))}))}}class p extends i.BaseComponent{constructor(){super(...arguments),this.rootElRef=r.createRef(),this.slatElRefs=new i.RefMap}render(){let{props:e,context:t}=this;return r.createElement("div",{ref:this.rootElRef,className:"fc-timegrid-slots"},r.createElement("table",{"aria-hidden":!0,className:t.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth,height:e.minHeight}},e.tableColGroupNode,r.createElement(g,{slatElRefs:this.slatElRefs,axis:e.axis,slatMetas:e.slatMetas})))}componentDidMount(){this.updateSizing()}componentDidUpdate(){this.updateSizing()}componentWillUnmount(){this.props.onCoords&&this.props.onCoords(null)}updateSizing(){let{context:e,props:t}=this;if(t.onCoords&&null!==t.clientWidth){this.rootElRef.current.offsetHeight&&t.onCoords(new h(new i.PositionCache(this.rootElRef.current,(r=this.slatElRefs.currentMap,t.slatMetas.map(e=>r[e.key])),!1,!0),this.props.dateProfile,e.options.slotDuration))}var r}}function u(e,t){let i,r=[];for(i=0;i<t;i+=1)r.push([]);if(e)for(i=0;i<e.length;i+=1)r[e[i].col].push(e[i]);return r}function v(e,t){let i=[];if(e){for(let r=0;r<t;r+=1)i[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(let t of e.segs)i[t.col].segs.push(t)}else for(let e=0;e<t;e+=1)i[e]=null;return i}class b extends i.BaseComponent{render(){let{props:e}=this;return r.createElement(i.MoreLinkContainer,{elClasses:["fc-timegrid-more-link"],elStyle:{top:e.top,bottom:e.bottom},allDayDate:null,moreCnt:e.hiddenSegs.length,allSegs:e.hiddenSegs,hiddenSegs:e.hiddenSegs,extraDateSpan:e.extraDateSpan,dateProfile:e.dateProfile,todayRange:e.todayRange,popoverContent:()=>T(e.hiddenSegs,e),defaultGenerator:y},e=>r.createElement(e,{elTag:"div",elClasses:["fc-timegrid-more-link-inner","fc-sticky"]}))}}function y(e){return e.shortText}function x(e,t,r){let n=new i.SegHierarchy;null!=t&&(n.strictOrder=t),null!=r&&(n.maxStackCnt=r);let o=n.addSegs(e),s=i.groupIntersectingEntries(o),l=function(e){const{entriesByLevel:t}=e,r=w((e,t)=>e+":"+t,(n,o)=>{let s=S(function(e,t,r){let{levelCoords:n,entriesByLevel:o}=e,s=o[t][r],l=n[t]+s.thickness,a=n.length,c=t;for(;c<a&&n[c]<l;c+=1);for(;c<a;c+=1){let e,t=o[c],r=i.binarySearch(t,s.span.start,i.getEntrySpanEnd),n=r[0]+r[1],l=n;for(;(e=t[l])&&e.span.start<s.span.end;)l+=1;if(n<l)return{level:c,lateralStart:n,lateralEnd:l}}return null}(e,n,o),r),l=t[n][o];return[Object.assign(Object.assign({},l),{nextLevelNodes:s[0]}),l.thickness+s[1]]});return S(t.length?{level:0,lateralStart:0,lateralEnd:t[0].length}:null,r)[0]}(n);return l=function(e,t){const r=w((e,t,r)=>i.buildEntryKey(e),(e,i,n)=>{let o,{nextLevelNodes:s,thickness:l}=e,a=l+n,c=l/a,d=[];if(s.length)for(let e of s)if(void 0===o){let t=r(e,i,a);o=t[0],d.push(t[1])}else{let t=r(e,o,0);d.push(t[1])}else o=t;let m=(o-i)*c;return[o-m,Object.assign(Object.assign({},e),{thickness:m,nextLevelNodes:d})]});return e.map(e=>r(e,0,0)[1])}(l,1),{segRects:function(e){let t=[];const r=w((e,t,r)=>i.buildEntryKey(e),(e,i,r)=>{let o=Object.assign(Object.assign({},e),{levelCoord:i,stackDepth:r,stackForward:0});return t.push(o),o.stackForward=n(e.nextLevelNodes,i+e.thickness,r+1)+1});function n(e,t,i){let n=0;for(let o of e)n=Math.max(r(o,t,i),n);return n}return n(e,0,0),t}(l),hiddenGroups:s}}function S(e,t){if(!e)return[[],0];let{level:i,lateralStart:r,lateralEnd:n}=e,o=r,s=[];for(;o<n;)s.push(t(i,o)),o+=1;return s.sort(C),[s.map(E),s[0][1]]}function C(e,t){return t[1]-e[1]}function E(e){return e[0]}function w(e,t){const i={};return(...r)=>{let n=e(...r);return n in i?i[n]:i[n]=t(...r)}}function D(e,t,i=null,r=0){let n=[];if(i)for(let o=0;o<e.length;o+=1){let s=e[o],l=i.computeDateTop(s.start,t),a=Math.max(l+(r||0),i.computeDateTop(s.end,t));n.push({start:Math.round(l),end:Math.round(a)})}return n}const R=i.createFormatter({hour:"numeric",minute:"2-digit",meridiem:!1});class k extends i.BaseComponent{render(){return r.createElement(i.StandardEvent,Object.assign({},this.props,{elClasses:["fc-timegrid-event","fc-v-event",this.props.isShort&&"fc-timegrid-event-short"],defaultTimeFormat:R}))}}class M extends i.BaseComponent{constructor(){super(...arguments),this.sortEventSegs=i.memoize(i.sortEventSegs)}render(){let{props:e,context:t}=this,{options:n}=t,o=n.selectMirror,s=e.eventDrag&&e.eventDrag.segs||e.eventResize&&e.eventResize.segs||o&&e.dateSelectionSegs||[],l=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},a=this.sortEventSegs(e.fgEventSegs,n.eventOrder);return r.createElement(i.DayCellContainer,{elTag:"td",elRef:e.elRef,elClasses:["fc-timegrid-col",...e.extraClassNames||[]],elAttrs:Object.assign({role:"gridcell"},e.extraDataAttrs),date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,extraRenderProps:e.extraRenderProps},t=>r.createElement("div",{className:"fc-timegrid-col-frame"},r.createElement("div",{className:"fc-timegrid-col-bg"},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(e.dateSelectionSegs,"highlight")),r.createElement("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(a,l,!1,!1,!1)),r.createElement("div",{className:"fc-timegrid-col-events"},this.renderFgSegs(s,{},Boolean(e.eventDrag),Boolean(e.eventResize),Boolean(o))),r.createElement("div",{className:"fc-timegrid-now-indicator-container"},this.renderNowIndicator(e.nowIndicatorSegs)),i.hasCustomDayCellContent(n)&&r.createElement(t,{elTag:"div",elClasses:["fc-timegrid-col-misc"]})))}renderFgSegs(e,t,i,r,n){let{props:o}=this;return o.forPrint?T(e,o):this.renderPositionedFgSegs(e,t,i,r,n)}renderPositionedFgSegs(e,t,n,o,s){let{eventMaxStack:l,eventShortHeight:a,eventOrderStrict:c,eventMinHeight:d}=this.context.options,{date:m,slatCoords:f,eventSelection:h,todayRange:g,nowDate:p}=this.props,u=n||o||s,v=D(e,m,f,d),{segPlacements:b,hiddenGroups:y}=function(e,t,i,r){let n=[],o=[];for(let i=0;i<e.length;i+=1){let r=t[i];r?n.push({index:i,thickness:1,span:r}):o.push(e[i])}let{segRects:s,hiddenGroups:l}=x(n,i,r),a=[];for(let t of s)a.push({seg:e[t.index],rect:t});for(let e of o)a.push({seg:e,rect:null});return{segPlacements:a,hiddenGroups:l}}(e,v,c,l);return r.createElement(r.Fragment,null,this.renderHiddenGroups(y,e),b.map(e=>{let{seg:l,rect:c}=e,d=l.eventRange.instance.instanceId,m=u||Boolean(!t[d]&&c),f=N(c&&c.span),v=!u&&c?this.computeSegHStyle(c):{left:0,right:0},b=Boolean(c)&&c.stackForward>0,y=Boolean(c)&&c.span.end-c.span.start<a;return r.createElement("div",{className:"fc-timegrid-event-harness"+(b?" fc-timegrid-event-harness-inset":""),key:d,style:Object.assign(Object.assign({visibility:m?"":"hidden"},f),v)},r.createElement(k,Object.assign({seg:l,isDragging:n,isResizing:o,isDateSelecting:s,isSelected:d===h,isShort:y},i.getSegMeta(l,g,p))))}))}renderHiddenGroups(e,t){let{extraDateSpan:n,dateProfile:o,todayRange:s,nowDate:l,eventSelection:a,eventDrag:c,eventResize:d}=this.props;return r.createElement(r.Fragment,null,e.map(e=>{let m=N(e.span),f=(h=e.entries,g=t,h.map(e=>g[e.index]));var h,g;return r.createElement(b,{key:i.buildIsoString(i.computeEarliestSegStart(f)),hiddenSegs:f,top:m.top,bottom:m.bottom,extraDateSpan:n,dateProfile:o,todayRange:s,nowDate:l,eventSelection:a,eventDrag:c,eventResize:d})}))}renderFillSegs(e,t){let{props:n,context:o}=this,s=D(e,n.date,n.slatCoords,o.options.eventMinHeight).map((o,s)=>{let l=e[s];return r.createElement("div",{key:i.buildEventRangeKey(l.eventRange),className:"fc-timegrid-bg-harness",style:N(o)},"bg-event"===t?r.createElement(i.BgEvent,Object.assign({seg:l},i.getSegMeta(l,n.todayRange,n.nowDate))):i.renderFill(t))});return r.createElement(r.Fragment,null,s)}renderNowIndicator(e){let{slatCoords:t,date:n}=this.props;return t?e.map((e,o)=>r.createElement(i.NowIndicatorContainer,{key:o,elClasses:["fc-timegrid-now-indicator-line"],elStyle:{top:t.computeDateTop(e.start,n)},isAxis:!1,date:n})):null}computeSegHStyle(e){let t,i,{isRtl:r,options:n}=this.context,o=n.slotEventOverlap,s=e.levelCoord,l=e.levelCoord+e.thickness;o&&(l=Math.min(1,s+2*(l-s))),r?(t=1-l,i=s):(t=s,i=1-l);let a={zIndex:e.stackDepth+1,left:100*t+"%",right:100*i+"%"};return o&&!e.stackForward&&(a[r?"marginLeft":"marginRight"]=20),a}}function T(e,{todayRange:t,nowDate:n,eventSelection:o,eventDrag:s,eventResize:l}){let a=(s?s.affectedInstances:null)||(l?l.affectedInstances:null)||{};return r.createElement(r.Fragment,null,e.map(e=>{let s=e.eventRange.instance.instanceId;return r.createElement("div",{key:s,style:{visibility:a[s]?"hidden":""}},r.createElement(k,Object.assign({seg:e,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:s===o,isShort:!1},i.getSegMeta(e,t,n))))}))}function N(e){return e?{top:e.start,bottom:-e.end}:{top:"",bottom:""}}class P extends i.BaseComponent{constructor(){super(...arguments),this.splitFgEventSegs=i.memoize(u),this.splitBgEventSegs=i.memoize(u),this.splitBusinessHourSegs=i.memoize(u),this.splitNowIndicatorSegs=i.memoize(u),this.splitDateSelectionSegs=i.memoize(u),this.splitEventDrag=i.memoize(v),this.splitEventResize=i.memoize(v),this.rootElRef=r.createRef(),this.cellElRefs=new i.RefMap}render(){let{props:e,context:t}=this,n=t.options.nowIndicator&&e.slatCoords&&e.slatCoords.safeComputeTop(e.nowDate),o=e.cells.length,s=this.splitFgEventSegs(e.fgEventSegs,o),l=this.splitBgEventSegs(e.bgEventSegs,o),a=this.splitBusinessHourSegs(e.businessHourSegs,o),c=this.splitNowIndicatorSegs(e.nowIndicatorSegs,o),d=this.splitDateSelectionSegs(e.dateSelectionSegs,o),m=this.splitEventDrag(e.eventDrag,o),f=this.splitEventResize(e.eventResize,o);return r.createElement("div",{className:"fc-timegrid-cols",ref:this.rootElRef},r.createElement("table",{role:"presentation",style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,r.createElement("tbody",{role:"presentation"},r.createElement("tr",{role:"row"},e.axis&&r.createElement("td",{"aria-hidden":!0,className:"fc-timegrid-col fc-timegrid-axis"},r.createElement("div",{className:"fc-timegrid-col-frame"},r.createElement("div",{className:"fc-timegrid-now-indicator-container"},"number"==typeof n&&r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timegrid-now-indicator-arrow"],elStyle:{top:n},isAxis:!0,date:e.nowDate})))),e.cells.map((t,i)=>r.createElement(M,{key:t.key,elRef:this.cellElRefs.createRef(t.key),dateProfile:e.dateProfile,date:t.date,nowDate:e.nowDate,todayRange:e.todayRange,extraRenderProps:t.extraRenderProps,extraDataAttrs:t.extraDataAttrs,extraClassNames:t.extraClassNames,extraDateSpan:t.extraDateSpan,fgEventSegs:s[i],bgEventSegs:l[i],businessHourSegs:a[i],nowIndicatorSegs:c[i],dateSelectionSegs:d[i],eventDrag:m[i],eventResize:f[i],slatCoords:e.slatCoords,eventSelection:e.eventSelection,forPrint:e.forPrint}))))))}componentDidMount(){this.updateCoords()}componentDidUpdate(){this.updateCoords()}updateCoords(){let{props:e}=this;var t;e.onColCoords&&null!==e.clientWidth&&e.onColCoords(new i.PositionCache(this.rootElRef.current,(t=this.cellElRefs.currentMap,e.cells.map(e=>t[e.key])),!0,!1))}}class z extends i.DateComponent{constructor(){super(...arguments),this.processSlotOptions=i.memoize(H),this.state={slatCoords:null},this.handleRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)},this.handleScrollRequest=e=>{let{onScrollTopRequest:t}=this.props,{slatCoords:i}=this.state;if(t&&i){if(e.time){let r=i.computeTimeTop(e.time);r=Math.ceil(r),r&&(r+=1),t(r)}return!0}return!1},this.handleColCoords=e=>{this.colCoords=e},this.handleSlatCoords=e=>{this.setState({slatCoords:e}),this.props.onSlatCoords&&this.props.onSlatCoords(e)}}render(){let{props:e,state:t}=this;return r.createElement("div",{className:"fc-timegrid-body",ref:this.handleRootEl,style:{width:e.clientWidth,minWidth:e.tableMinWidth}},r.createElement(p,{axis:e.axis,dateProfile:e.dateProfile,slatMetas:e.slatMetas,clientWidth:e.clientWidth,minHeight:e.expandRows?e.clientHeight:"",tableMinWidth:e.tableMinWidth,tableColGroupNode:e.axis?e.tableColGroupNode:null,onCoords:this.handleSlatCoords}),r.createElement(P,{cells:e.cells,axis:e.axis,dateProfile:e.dateProfile,businessHourSegs:e.businessHourSegs,bgEventSegs:e.bgEventSegs,fgEventSegs:e.fgEventSegs,dateSelectionSegs:e.dateSelectionSegs,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange,nowDate:e.nowDate,nowIndicatorSegs:e.nowIndicatorSegs,clientWidth:e.clientWidth,tableMinWidth:e.tableMinWidth,tableColGroupNode:e.tableColGroupNode,slatCoords:t.slatCoords,onColCoords:this.handleColCoords,forPrint:e.forPrint}))}componentDidMount(){this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)}componentDidUpdate(e){this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)}componentWillUnmount(){this.scrollResponder.detach()}queryHit(e,t){let{dateEnv:r,options:n}=this.context,{colCoords:o}=this,{dateProfile:s}=this.props,{slatCoords:l}=this.state,{snapDuration:a,snapsPerSlot:c}=this.processSlotOptions(this.props.slotDuration,n.snapDuration),d=o.leftToIndex(e),m=l.positions.topToIndex(t);if(null!=d&&null!=m){let e=this.props.cells[d],n=l.positions.tops[m],f=l.positions.getHeight(m),h=(t-n)/f,g=m*c+Math.floor(h*c),p=this.props.cells[d].date,u=i.addDurations(s.slotMinTime,i.multiplyDuration(a,g)),v=r.add(p,u),b=r.add(v,a);return{dateProfile:s,dateSpan:Object.assign({range:{start:v,end:b},allDay:!1},e.extraDateSpan),dayEl:o.els[d],rect:{left:o.lefts[d],right:o.rights[d],top:n,bottom:n+f},layer:0}}return null}}function H(e,t){let r=t||e,n=i.wholeDivideDurations(e,r);return null===n&&(r=e,n=1),{snapDuration:r,snapsPerSlot:n}}class W extends i.Slicer{sliceRange(e,t){let r=[];for(let n=0;n<t.length;n+=1){let o=i.intersectRanges(e,t[n]);o&&r.push({start:o.start,end:o.end,isStart:o.start.valueOf()===e.start.valueOf(),isEnd:o.end.valueOf()===e.end.valueOf(),col:n})}return r}}class I extends i.DateComponent{constructor(){super(...arguments),this.buildDayRanges=i.memoize(F),this.slicer=new W,this.timeColsRef=r.createRef()}render(){let{props:e,context:t}=this,{dateProfile:n,dayTableModel:o}=e,s=t.options.nowIndicator,l=this.buildDayRanges(o,n,t.dateEnv);return r.createElement(i.NowTimer,{unit:s?"minute":"day"},(i,a)=>r.createElement(z,Object.assign({ref:this.timeColsRef},this.slicer.sliceProps(e,n,null,t,l),{forPrint:e.forPrint,axis:e.axis,dateProfile:n,slatMetas:e.slatMetas,slotDuration:e.slotDuration,cells:o.cells[0],tableColGroupNode:e.tableColGroupNode,tableMinWidth:e.tableMinWidth,clientWidth:e.clientWidth,clientHeight:e.clientHeight,expandRows:e.expandRows,nowDate:i,nowIndicatorSegs:s&&this.slicer.sliceNowDate(i,t,l),todayRange:a,onScrollTopRequest:e.onScrollTopRequest,onSlatCoords:e.onSlatCoords})))}}function F(e,t,i){let r=[];for(let n of e.headerDates)r.push({start:i.add(n,t.slotMinTime),end:i.add(n,t.slotMaxTime)});return r}const O=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}];function G(e,t,r,n,o){let s=new Date(0),l=e,a=i.createDuration(0),c=r||function(e){let t,r,n;for(t=O.length-1;t>=0;t-=1)if(r=i.createDuration(O[t]),n=i.wholeDivideDurations(r,e),null!==n&&n>1)return r;return e}(n),d=[];for(;i.asRoughMs(l)<i.asRoughMs(t);){let e=o.add(s,l),t=null!==i.wholeDivideDurations(a,c);d.push({date:e,time:l,key:e.toISOString(),isoTimeStr:i.formatIsoTimeString(e),isLabeled:t}),l=i.addDurations(l,n),a=i.addDurations(a,n)}return d}class L extends m{constructor(){super(...arguments),this.buildTimeColsModel=i.memoize(A),this.buildSlatMetas=i.memoize(G)}render(){let{options:e,dateEnv:t,dateProfileGenerator:o}=this.context,{props:s}=this,{dateProfile:l}=s,a=this.buildTimeColsModel(l,o),c=this.allDaySplitter.splitProps(s),d=this.buildSlatMetas(l.slotMinTime,l.slotMaxTime,e.slotLabelInterval,e.slotDuration,t),{dayMinWidth:m}=e,f=!m,h=m,g=e.dayHeaders&&r.createElement(i.DayHeader,{dates:a.headerDates,dateProfile:l,datesRepDistinctDays:!0,renderIntro:f?this.renderHeadAxis:null}),p=!1!==e.allDaySlot&&(t=>r.createElement(n.DayTable,Object.assign({},c.allDay,{dateProfile:l,dayTableModel:a,nextDayThreshold:e.nextDayThreshold,tableMinWidth:t.tableMinWidth,colGroupNode:t.tableColGroupNode,renderRowIntro:f?this.renderTableRowAxis:null,showWeekNumbers:!1,expandRows:!1,headerAlignElRef:this.headerElRef,clientWidth:t.clientWidth,clientHeight:t.clientHeight,forPrint:s.forPrint},this.getAllDayMaxEventProps()))),u=t=>r.createElement(I,Object.assign({},c.timed,{dayTableModel:a,dateProfile:l,axis:f,slotDuration:e.slotDuration,slatMetas:d,forPrint:s.forPrint,tableColGroupNode:t.tableColGroupNode,tableMinWidth:t.tableMinWidth,clientWidth:t.clientWidth,clientHeight:t.clientHeight,onSlatCoords:this.handleSlatCoords,expandRows:t.expandRows,onScrollTopRequest:this.handleScrollTopRequest}));return h?this.renderHScrollLayout(g,p,u,a.colCnt,m,d,this.state.slatCoords):this.renderSimpleLayout(g,p,u)}}function A(e,t){let r=new i.DaySeriesModel(e.renderRange,t);return new i.DayTableModel(r,!1)}const j={allDaySlot:Boolean};i.injectStyles('.fc-v-event{background-color:var(--fc-event-bg-color);border:1px solid var(--fc-event-border-color);display:block}.fc-v-event .fc-event-main{color:var(--fc-event-text-color);height:100%}.fc-v-event .fc-event-main-frame{display:flex;flex-direction:column;height:100%}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{bottom:0;max-height:100%;overflow:hidden;top:0}.fc-v-event:not(.fc-event-start){border-top-left-radius:0;border-top-right-radius:0;border-top-width:0}.fc-v-event:not(.fc-event-end){border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-width:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:var(--fc-event-resizer-thickness);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-thickness)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:calc(var(--fc-event-resizer-dot-total-width)/-2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%;position:relative;z-index:1}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-slot{border-bottom:0;height:1.5em}.fc .fc-timegrid-slot:empty:before{content:"\\00a0"}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-slot-label{vertical-align:middle}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{align-items:center;display:flex;justify-content:flex-end;overflow:hidden}.fc .fc-timegrid-axis-cushion{flex-shrink:0;max-width:60px}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col.fc-day-today{background-color:var(--fc-today-bg-color)}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{bottom:0;height:auto;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols{bottom:0;left:0;position:absolute;right:0;top:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{left:0;position:absolute;right:0;top:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight{z-index:3}.fc .fc-timegrid-bg-harness{left:0;position:absolute;right:0}.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{bottom:0;left:0;position:absolute;right:0;top:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px var(--fc-page-bg-color)}.fc-timegrid-event,.fc-timegrid-more-link{border-radius:3px;font-size:var(--fc-small-font-size)}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{font-size:var(--fc-small-font-size);margin-bottom:1px;white-space:nowrap}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:"\\00a0-\\00a0"}.fc-timegrid-event-short .fc-event-title{font-size:var(--fc-small-font-size)}.fc-timegrid-more-link{background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;margin-bottom:1px;position:absolute;z-index:9999}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;border-width:1px 0 0;left:0;position:absolute;right:0;z-index:4}.fc .fc-timegrid-now-indicator-arrow{border-color:var(--fc-now-indicator-color);border-style:solid;margin-top:-5px;position:absolute;z-index:4}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 0 5px 6px;left:0}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{border-bottom-color:transparent;border-top-color:transparent;border-width:5px 6px 5px 0;right:0}');var B=t.createPlugin({name:"@fullcalendar/timegrid",initialView:"timeGridWeek",optionRefiners:j,views:{timeGrid:{component:L,usesMinMaxTime:!0,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}}),q={__proto__:null,TimeColsView:m,DayTimeColsView:L,buildTimeColsModel:A,DayTimeCols:I,buildDayRanges:F,DayTimeColsSlicer:W,TimeCols:z,buildSlatMetas:G,TimeColsSlatsCoords:h};return t.globalPlugins.push(B),e.Internal=q,e.default=B,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal,FullCalendar.Preact,FullCalendar.DayGrid.Internal);
\ No newline at end of file diff --git a/library/fullcalendar/packages/timegrid/main.css b/library/fullcalendar/packages/timegrid/main.css deleted file mode 100644 index b8ee6448a..000000000 --- a/library/fullcalendar/packages/timegrid/main.css +++ /dev/null @@ -1,309 +0,0 @@ -@charset "UTF-8"; -/* TimeGridView all-day area ---------------------------------------------------------------------------------------------------*/ -.fc-timeGrid-view .fc-day-grid { - position: relative; - z-index: 2; - /* so the "more.." popover will be over the time grid */ -} - -.fc-timeGrid-view .fc-day-grid .fc-row { - min-height: 3em; - /* all-day section will never get shorter than this */ -} - -.fc-timeGrid-view .fc-day-grid .fc-row .fc-content-skeleton { - padding-bottom: 1em; - /* give space underneath events for clicking/selecting days */ -} - -/* TimeGrid axis running down the side (for both the all-day area and the slot area) ---------------------------------------------------------------------------------------------------*/ -.fc .fc-axis { - /* .fc to overcome default cell styles */ - vertical-align: middle; - padding: 0 4px; - white-space: nowrap; -} - -.fc-ltr .fc-axis { - text-align: right; -} - -.fc-rtl .fc-axis { - text-align: left; -} - -/* TimeGrid Structure ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid-container, -.fc-time-grid { - /* so slats/bg/content/etc positions get scoped within here */ - position: relative; - z-index: 1; -} - -.fc-time-grid { - min-height: 100%; - /* so if height setting is 'auto', .fc-bg stretches to fill height */ -} - -.fc-time-grid table { - /* don't put outer borders on slats/bg/content/etc */ - border: 0 hidden transparent; -} - -.fc-time-grid > .fc-bg { - z-index: 1; -} - -.fc-time-grid .fc-slats, -.fc-time-grid > hr { - /* the <hr> TimeGridView injects when grid is shorter than scroller */ - position: relative; - z-index: 2; -} - -.fc-time-grid .fc-content-col { - position: relative; - /* because now-indicator lives directly inside */ -} - -.fc-time-grid .fc-content-skeleton { - position: absolute; - z-index: 3; - top: 0; - left: 0; - right: 0; -} - -/* divs within a cell within the fc-content-skeleton */ -.fc-time-grid .fc-business-container { - position: relative; - z-index: 1; -} - -.fc-time-grid .fc-bgevent-container { - position: relative; - z-index: 2; -} - -.fc-time-grid .fc-highlight-container { - position: relative; - z-index: 3; -} - -.fc-time-grid .fc-event-container { - position: relative; - z-index: 4; -} - -.fc-time-grid .fc-now-indicator-line { - z-index: 5; -} - -.fc-time-grid .fc-mirror-container { - /* also is fc-event-container */ - position: relative; - z-index: 6; -} - -/* TimeGrid Slats (lines that run horizontally) ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid .fc-slats td { - height: 1.5em; - border-bottom: 0; - /* each cell is responsible for its top border */ -} - -.fc-time-grid .fc-slats .fc-minor td { - border-top-style: dotted; -} - -/* TimeGrid Highlighting Slots ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid .fc-highlight-container { - /* a div within a cell within the fc-highlight-skeleton */ - position: relative; - /* scopes the left/right of the fc-highlight to be in the column */ -} - -.fc-time-grid .fc-highlight { - position: absolute; - left: 0; - right: 0; - /* top and bottom will be in by JS */ -} - -/* TimeGrid Event Containment ---------------------------------------------------------------------------------------------------*/ -.fc-ltr .fc-time-grid .fc-event-container { - /* space on the sides of events for LTR (default) */ - margin: 0 2.5% 0 2px; -} - -.fc-rtl .fc-time-grid .fc-event-container { - /* space on the sides of events for RTL */ - margin: 0 2px 0 2.5%; -} - -.fc-time-grid .fc-event, -.fc-time-grid .fc-bgevent { - position: absolute; - z-index: 1; - /* scope inner z-index's */ -} - -.fc-time-grid .fc-bgevent { - /* background events always span full width */ - left: 0; - right: 0; -} - -/* TimeGrid Event Styling ----------------------------------------------------------------------------------------------------- -We use the full "fc-time-grid-event" class instead of using descendants because the event won't -be a descendant of the grid when it is being dragged. -*/ -.fc-time-grid-event { - margin-bottom: 1px; -} - -.fc-time-grid-event-inset { - -webkit-box-shadow: 0px 0px 0px 1px #fff; - box-shadow: 0px 0px 0px 1px #fff; -} - -.fc-time-grid-event.fc-not-start { - /* events that are continuing from another day */ - /* replace space made by the top border with padding */ - border-top-width: 0; - padding-top: 1px; - /* remove top rounded corners */ - border-top-left-radius: 0; - border-top-right-radius: 0; -} - -.fc-time-grid-event.fc-not-end { - /* replace space made by the top border with padding */ - border-bottom-width: 0; - padding-bottom: 1px; - /* remove bottom rounded corners */ - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; -} - -.fc-time-grid-event .fc-content { - overflow: hidden; - max-height: 100%; -} - -.fc-time-grid-event .fc-time, -.fc-time-grid-event .fc-title { - padding: 0 1px; -} - -.fc-time-grid-event .fc-time { - font-size: 0.85em; - white-space: nowrap; -} - -/* short mode, where time and title are on the same line */ -.fc-time-grid-event.fc-short .fc-content { - /* don't wrap to second line (now that contents will be inline) */ - white-space: nowrap; -} - -.fc-time-grid-event.fc-short .fc-time, -.fc-time-grid-event.fc-short .fc-title { - /* put the time and title on the same line */ - display: inline-block; - vertical-align: top; -} - -.fc-time-grid-event.fc-short .fc-time span { - display: none; - /* don't display the full time text... */ -} - -.fc-time-grid-event.fc-short .fc-time:before { - content: attr(data-start); - /* ...instead, display only the start time */ -} - -.fc-time-grid-event.fc-short .fc-time:after { - content: " - "; - /* seperate with a dash, wrapped in nbsp's */ -} - -.fc-time-grid-event.fc-short .fc-title { - font-size: 0.85em; - /* make the title text the same size as the time */ - padding: 0; - /* undo padding from above */ -} - -/* resizer (cursor device) */ -.fc-time-grid-event.fc-allow-mouse-resize .fc-resizer { - left: 0; - right: 0; - bottom: 0; - height: 8px; - overflow: hidden; - line-height: 8px; - font-size: 11px; - font-family: monospace; - text-align: center; - cursor: s-resize; -} - -.fc-time-grid-event.fc-allow-mouse-resize .fc-resizer:after { - content: "="; -} - -/* resizer (touch device) */ -.fc-time-grid-event.fc-selected .fc-resizer { - /* 10x10 dot */ - border-radius: 5px; - border-width: 1px; - width: 8px; - height: 8px; - border-style: solid; - border-color: inherit; - background: #fff; - /* horizontally center */ - left: 50%; - margin-left: -5px; - /* center on the bottom edge */ - bottom: -5px; -} - -/* Now Indicator ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid .fc-now-indicator-line { - border-top-width: 1px; - left: 0; - right: 0; -} - -/* arrow on axis */ -.fc-time-grid .fc-now-indicator-arrow { - margin-top: -5px; - /* vertically center on top coordinate */ -} - -.fc-ltr .fc-time-grid .fc-now-indicator-arrow { - left: 0; - /* triangle pointing right... */ - border-width: 5px 0 5px 6px; - border-top-color: transparent; - border-bottom-color: transparent; -} - -.fc-rtl .fc-time-grid .fc-now-indicator-arrow { - right: 0; - /* triangle pointing left... */ - border-width: 5px 6px 5px 0; - border-top-color: transparent; - border-bottom-color: transparent; -} diff --git a/library/fullcalendar/packages/timegrid/main.d.ts b/library/fullcalendar/packages/timegrid/main.d.ts deleted file mode 100644 index 303b51672..000000000 --- a/library/fullcalendar/packages/timegrid/main.d.ts +++ /dev/null @@ -1,224 +0,0 @@ -// Generated by dts-bundle v0.7.3-fork.1 -// Dependencies for this module: -// ../../../../../@fullcalendar/core -// ../../../../../@fullcalendar/daygrid - -declare module '@fullcalendar/timegrid' { - import AbstractTimeGridView from '@fullcalendar/timegrid/AbstractTimeGridView'; - import TimeGridView, { buildDayTable } from '@fullcalendar/timegrid/TimeGridView'; - import { TimeGridSeg } from '@fullcalendar/timegrid/TimeGrid'; - import { TimeGridSlicer, buildDayRanges } from '@fullcalendar/timegrid/SimpleTimeGrid'; - export { TimeGridView, AbstractTimeGridView, buildDayTable, buildDayRanges, TimeGridSlicer, TimeGridSeg }; - export { default as TimeGrid } from '@fullcalendar/timegrid/TimeGrid'; - const _default: import("@fullcalendar/core").PluginDef; - export default _default; -} - -declare module '@fullcalendar/timegrid/AbstractTimeGridView' { - import { ScrollComponent, View, ComponentContext, Duration, ViewProps } from '@fullcalendar/core'; - import { DayGrid } from '@fullcalendar/daygrid'; - import TimeGrid from '@fullcalendar/timegrid/TimeGrid'; - import AllDaySplitter from '@fullcalendar/timegrid/AllDaySplitter'; - export { AbstractTimeGridView as default, AbstractTimeGridView }; - abstract class AbstractTimeGridView extends View { - timeGrid: TimeGrid; - dayGrid: DayGrid; - scroller: ScrollComponent; - axisWidth: any; - protected splitter: AllDaySplitter; - render(props: ViewProps, context: ComponentContext): void; - destroy(): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - renderSkeletonHtml(): string; - getNowIndicatorUnit(): string; - unrenderNowIndicator(): void; - updateSize(isResize: boolean, viewHeight: number, isAuto: boolean): void; - updateBaseSize(isResize: any, viewHeight: any, isAuto: any): void; - computeScrollerHeight(viewHeight: any): number; - computeDateScroll(duration: Duration): { - top: any; - }; - queryDateScroll(): { - top: number; - }; - applyDateScroll(scroll: any): void; - renderHeadIntroHtml: () => string; - axisStyleAttr(): string; - renderTimeGridBgIntroHtml: () => string; - renderTimeGridIntroHtml: () => string; - renderDayGridBgIntroHtml: () => string; - renderDayGridIntroHtml: () => string; - } -} - -declare module '@fullcalendar/timegrid/TimeGridView' { - import { DateProfileGenerator, DateProfile, ComponentContext, DayHeader, DayTable, ViewProps } from '@fullcalendar/core'; - import { SimpleDayGrid } from '@fullcalendar/daygrid'; - import SimpleTimeGrid from '@fullcalendar/timegrid/SimpleTimeGrid'; - import AbstractTimeGridView from '@fullcalendar/timegrid/AbstractTimeGridView'; - export { TimeGridView as default, TimeGridView }; - class TimeGridView extends AbstractTimeGridView { - header: DayHeader; - simpleDayGrid: SimpleDayGrid; - simpleTimeGrid: SimpleTimeGrid; - render(props: ViewProps, context: ComponentContext): void; - _renderSkeleton(context: ComponentContext): void; - _unrenderSkeleton(): void; - renderNowIndicator(date: any): void; - } - export function buildDayTable(dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator): DayTable; -} - -declare module '@fullcalendar/timegrid/TimeGrid' { - import { PositionCache, Duration, DateMarker, DateFormatter, ComponentContext, DateComponent, Seg, EventSegUiInteractionState, DateProfile, Theme } from '@fullcalendar/core'; - export interface RenderProps { - renderBgIntroHtml: () => string; - renderIntroHtml: () => string; - } - export interface TimeGridSeg extends Seg { - col: number; - start: DateMarker; - end: DateMarker; - } - export interface TimeGridCell { - date: DateMarker; - htmlAttrs?: string; - } - export interface TimeGridProps { - dateProfile: DateProfile; - cells: TimeGridCell[]; - businessHourSegs: TimeGridSeg[]; - bgEventSegs: TimeGridSeg[]; - fgEventSegs: TimeGridSeg[]; - dateSelectionSegs: TimeGridSeg[]; - eventSelection: string; - eventDrag: EventSegUiInteractionState | null; - eventResize: EventSegUiInteractionState | null; - } - export { TimeGrid as default, TimeGrid }; - class TimeGrid extends DateComponent<TimeGridProps> { - renderProps: RenderProps; - slotDuration: Duration; - snapDuration: Duration; - snapsPerSlot: any; - labelFormat: DateFormatter; - labelInterval: Duration; - colCnt: number; - colEls: HTMLElement[]; - slatContainerEl: HTMLElement; - slatEls: HTMLElement[]; - nowIndicatorEls: HTMLElement[]; - colPositions: PositionCache; - slatPositions: PositionCache; - isSlatSizesDirty: boolean; - isColSizesDirty: boolean; - rootBgContainerEl: HTMLElement; - bottomRuleEl: HTMLElement; - contentSkeletonEl: HTMLElement; - colContainerEls: HTMLElement[]; - fgContainerEls: HTMLElement[]; - bgContainerEls: HTMLElement[]; - mirrorContainerEls: HTMLElement[]; - highlightContainerEls: HTMLElement[]; - businessContainerEls: HTMLElement[]; - constructor(el: HTMLElement, renderProps: RenderProps); - _processOptions(options: any): void; - computeLabelInterval(slotDuration: any): any; - render(props: TimeGridProps, context: ComponentContext): void; - destroy(): void; - updateSize(isResize: boolean): void; - _renderSkeleton(theme: Theme): void; - _renderSlats(dateProfile: DateProfile): void; - renderSlatRowHtml(dateProfile: DateProfile): string; - _renderColumns(cells: TimeGridCell[], dateProfile: DateProfile): void; - _unrenderColumns(): void; - renderContentSkeleton(): void; - unrenderContentSkeleton(): void; - groupSegsByCol(segs: any): any[]; - attachSegsByCol(segsByCol: any, containerEls: HTMLElement[]): void; - getNowIndicatorUnit(): string; - renderNowIndicator(segs: TimeGridSeg[], date: any): void; - unrenderNowIndicator(): void; - getTotalSlatHeight(): number; - computeDateTop(when: DateMarker, startOfDayDate?: DateMarker): any; - computeTimeTop(duration: Duration): any; - computeSegVerticals(segs: any): void; - assignSegVerticals(segs: any): void; - generateSegVerticalCss(seg: any): { - top: any; - bottom: number; - }; - buildPositionCaches(): void; - buildColPositions(): void; - buildSlatPositions(): void; - positionToHit(positionLeft: any, positionTop: any): { - col: any; - dateSpan: { - range: { - start: Date; - end: Date; - }; - allDay: boolean; - }; - dayEl: HTMLElement; - relativeRect: { - left: any; - right: any; - top: any; - bottom: any; - }; - }; - _renderEventDrag(state: EventSegUiInteractionState): void; - _unrenderEventDrag(state: EventSegUiInteractionState): void; - _renderEventResize(state: EventSegUiInteractionState): void; - _unrenderEventResize(state: EventSegUiInteractionState): void; - _renderDateSelection(segs: Seg[]): void; - _unrenderDateSelection(segs: Seg[]): void; - } -} - -declare module '@fullcalendar/timegrid/SimpleTimeGrid' { - import { DateComponent, DateProfile, EventStore, EventUiHash, EventInteractionState, DateSpan, DateRange, DayTable, DateEnv, DateMarker, Slicer, Hit, ComponentContext } from '@fullcalendar/core'; - import TimeGrid, { TimeGridSeg } from '@fullcalendar/timegrid/TimeGrid'; - export interface SimpleTimeGridProps { - dateProfile: DateProfile | null; - dayTable: DayTable; - businessHours: EventStore; - eventStore: EventStore; - eventUiBases: EventUiHash; - dateSelection: DateSpan | null; - eventSelection: string; - eventDrag: EventInteractionState | null; - eventResize: EventInteractionState | null; - } - export { SimpleTimeGrid as default, SimpleTimeGrid }; - class SimpleTimeGrid extends DateComponent<SimpleTimeGridProps> { - timeGrid: TimeGrid; - constructor(timeGrid: TimeGrid); - firstContext(context: ComponentContext): void; - destroy(): void; - render(props: SimpleTimeGridProps, context: ComponentContext): void; - renderNowIndicator(date: DateMarker): void; - buildPositionCaches(): void; - queryHit(positionLeft: number, positionTop: number): Hit; - } - export function buildDayRanges(dayTable: DayTable, dateProfile: DateProfile, dateEnv: DateEnv): DateRange[]; - export class TimeGridSlicer extends Slicer<TimeGridSeg, [DateRange[]]> { - sliceRange(range: DateRange, dayRanges: DateRange[]): TimeGridSeg[]; - } -} - -declare module '@fullcalendar/timegrid/AllDaySplitter' { - import { Splitter, EventDef, DateSpan } from '@fullcalendar/core'; - export { AllDaySplitter as default, AllDaySplitter }; - class AllDaySplitter extends Splitter { - getKeyInfo(): { - allDay: {}; - timed: {}; - }; - getKeysForDateSpan(dateSpan: DateSpan): string[]; - getKeysForEventDef(eventDef: EventDef): string[]; - } -} - diff --git a/library/fullcalendar/packages/timegrid/main.esm.js b/library/fullcalendar/packages/timegrid/main.esm.js deleted file mode 100644 index 7038488f4..000000000 --- a/library/fullcalendar/packages/timegrid/main.esm.js +++ /dev/null @@ -1,1391 +0,0 @@ -/*! -FullCalendar Time Grid Plugin v4.4.2 -Docs & License: https://fullcalendar.io/ -(c) 2019 Adam Shaw -*/ - -import { createFormatter, removeElement, computeEventDraggable, computeEventStartResizable, computeEventEndResizable, cssToStr, isMultiDayRange, htmlEscape, compareByFieldSpecs, applyStyle, FgEventRenderer, buildSegCompareObj, FillRenderer, memoize, memoizeRendering, createDuration, wholeDivideDurations, findElements, PositionCache, startOfDay, asRoughMs, formatIsoTimeString, addDurations, htmlToElement, createElement, multiplyDuration, DateComponent, hasBgRendering, Splitter, diffDays, buildGotoAnchorHtml, getAllDayHtml, ScrollComponent, matchCellWidths, uncompensateScroll, compensateScroll, subtractInnerElHeight, View, intersectRanges, Slicer, DayHeader, DaySeries, DayTable, createPlugin } from '@fullcalendar/core'; -import { DayBgRow, DayGrid, SimpleDayGrid } from '@fullcalendar/daygrid'; - -/*! *****************************************************************************
-Copyright (c) Microsoft Corporation.
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
-REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
-INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
-LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
-PERFORMANCE OF THIS SOFTWARE.
-***************************************************************************** */
-/* global Reflect, 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);
-}; - -/* -Only handles foreground segs. -Does not own rendering. Use for low-level util methods by TimeGrid. -*/ -var TimeGridEventRenderer = /** @class */ (function (_super) { - __extends(TimeGridEventRenderer, _super); - function TimeGridEventRenderer(timeGrid) { - var _this = _super.call(this) || this; - _this.timeGrid = timeGrid; - return _this; - } - TimeGridEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) { - _super.prototype.renderSegs.call(this, context, segs, mirrorInfo); - // TODO: dont do every time. memoize - this.fullTimeFormat = createFormatter({ - hour: 'numeric', - minute: '2-digit', - separator: this.context.options.defaultRangeSeparator - }); - }; - // Given an array of foreground segments, render a DOM element for each, computes position, - // and attaches to the column inner-container elements. - TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) { - var segsByCol = this.timeGrid.groupSegsByCol(segs); - // order the segs within each column - // TODO: have groupSegsByCol do this? - for (var col = 0; col < segsByCol.length; col++) { - segsByCol[col] = this.sortEventSegs(segsByCol[col]); - } - this.segsByCol = segsByCol; - this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls); - }; - TimeGridEventRenderer.prototype.detachSegs = function (segs) { - segs.forEach(function (seg) { - removeElement(seg.el); - }); - this.segsByCol = null; - }; - TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) { - var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol; - var colCnt = timeGrid.colCnt; - timeGrid.computeSegVerticals(allSegs); // horizontals relies on this - if (segsByCol) { - for (var col = 0; col < colCnt; col++) { - this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array - } - } - }; - TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) { - var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol; - var colCnt = timeGrid.colCnt; - timeGrid.assignSegVerticals(allSegs); // horizontals relies on this - if (segsByCol) { - for (var col = 0; col < colCnt; col++) { - this.assignSegCss(segsByCol[col]); - } - } - }; - // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined - TimeGridEventRenderer.prototype.computeEventTimeFormat = function () { - return { - hour: 'numeric', - minute: '2-digit', - meridiem: false - }; - }; - // Computes a default `displayEventEnd` value if one is not expliclty defined - TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () { - return true; - }; - // Renders the HTML for a single event segment's default rendering - TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) { - var eventRange = seg.eventRange; - var eventDef = eventRange.def; - var eventUi = eventRange.ui; - var allDay = eventDef.allDay; - var isDraggable = computeEventDraggable(this.context, eventDef, eventUi); - var isResizableFromStart = seg.isStart && computeEventStartResizable(this.context, eventDef, eventUi); - var isResizableFromEnd = seg.isEnd && computeEventEndResizable(this.context, eventDef, eventUi); - var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo); - var skinCss = cssToStr(this.getSkinCss(eventUi)); - var timeText; - var fullTimeText; // more verbose time text. for the print stylesheet - var startTimeText; // just the start time text - classes.unshift('fc-time-grid-event'); - // if the event appears to span more than one day... - if (isMultiDayRange(eventRange.range)) { - // Don't display time text on segments that run entirely through a day. - // That would appear as midnight-midnight and would look dumb. - // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am) - if (seg.isStart || seg.isEnd) { - var unzonedStart = seg.start; - var unzonedEnd = seg.end; - timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones - fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat); - startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false - } - } - else { - // Display the normal time text for the *event's* times - timeText = this.getTimeText(eventRange); - fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat); - startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false - } - return '<a class="' + classes.join(' ') + '"' + - (eventDef.url ? - ' href="' + htmlEscape(eventDef.url) + '"' : - '') + - (skinCss ? - ' style="' + skinCss + '"' : - '') + - '>' + - '<div class="fc-content">' + - (timeText ? - '<div class="fc-time"' + - ' data-start="' + htmlEscape(startTimeText) + '"' + - ' data-full="' + htmlEscape(fullTimeText) + '"' + - '>' + - '<span>' + htmlEscape(timeText) + '</span>' + - '</div>' : - '') + - (eventDef.title ? - '<div class="fc-title">' + - htmlEscape(eventDef.title) + - '</div>' : - '') + - '</div>' + - /* TODO: write CSS for this - (isResizableFromStart ? - '<div class="fc-resizer fc-start-resizer"></div>' : - '' - ) + - */ - (isResizableFromEnd ? - '<div class="fc-resizer fc-end-resizer"></div>' : - '') + - '</a>'; - }; - // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each. - // Assumed the segs are already ordered. - // NOTE: Also reorders the given array by date! - TimeGridEventRenderer.prototype.computeSegHorizontals = function (segs) { - var levels; - var level0; - var i; - levels = buildSlotSegLevels(segs); - computeForwardSlotSegs(levels); - if ((level0 = levels[0])) { - for (i = 0; i < level0.length; i++) { - computeSlotSegPressures(level0[i]); - } - for (i = 0; i < level0.length; i++) { - this.computeSegForwardBack(level0[i], 0, 0); - } - } - }; - // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range - // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and - // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left. - // - // The segment might be part of a "series", which means consecutive segments with the same pressure - // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of - // segments behind this one in the current series, and `seriesBackwardCoord` is the starting - // coordinate of the first segment in the series. - TimeGridEventRenderer.prototype.computeSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) { - var forwardSegs = seg.forwardSegs; - var i; - if (seg.forwardCoord === undefined) { // not already computed - if (!forwardSegs.length) { - // if there are no forward segments, this segment should butt up against the edge - seg.forwardCoord = 1; - } - else { - // sort highest pressure first - this.sortForwardSegs(forwardSegs); - // this segment's forwardCoord will be calculated from the backwardCoord of the - // highest-pressure forward segment. - this.computeSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord); - seg.forwardCoord = forwardSegs[0].backwardCoord; - } - // calculate the backwardCoord from the forwardCoord. consider the series - seg.backwardCoord = seg.forwardCoord - - (seg.forwardCoord - seriesBackwardCoord) / // available width for series - (seriesBackwardPressure + 1); // # of segments in the series - // use this segment's coordinates to computed the coordinates of the less-pressurized - // forward segments - for (i = 0; i < forwardSegs.length; i++) { - this.computeSegForwardBack(forwardSegs[i], 0, seg.forwardCoord); - } - } - }; - TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) { - var objs = forwardSegs.map(buildTimeGridSegCompareObj); - var specs = [ - // put higher-pressure first - { field: 'forwardPressure', order: -1 }, - // put segments that are closer to initial edge first (and favor ones with no coords yet) - { field: 'backwardCoord', order: 1 } - ].concat(this.context.eventOrderSpecs); - objs.sort(function (obj0, obj1) { - return compareByFieldSpecs(obj0, obj1, specs); - }); - return objs.map(function (c) { - return c._seg; - }); - }; - // Given foreground event segments that have already had their position coordinates computed, - // assigns position-related CSS values to their elements. - TimeGridEventRenderer.prototype.assignSegCss = function (segs) { - for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) { - var seg = segs_1[_i]; - applyStyle(seg.el, this.generateSegCss(seg)); - if (seg.level > 0) { - seg.el.classList.add('fc-time-grid-event-inset'); - } - // if the event is short that the title will be cut off, - // attach a className that condenses the title into the time area. - if (seg.eventRange.def.title && seg.bottom - seg.top < 30) { - seg.el.classList.add('fc-short'); // TODO: "condensed" is a better name - } - } - }; - // Generates an object with CSS properties/values that should be applied to an event segment element. - // Contains important positioning-related properties that should be applied to any event element, customized or not. - TimeGridEventRenderer.prototype.generateSegCss = function (seg) { - var shouldOverlap = this.context.options.slotEventOverlap; - var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point - var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point - var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first - var isRtl = this.context.isRtl; - var left; // amount of space from left edge, a fraction of the total width - var right; // amount of space from right edge, a fraction of the total width - if (shouldOverlap) { - // double the width, but don't go beyond the maximum forward coordinate (1.0) - forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2); - } - if (isRtl) { - left = 1 - forwardCoord; - right = backwardCoord; - } - else { - left = backwardCoord; - right = 1 - forwardCoord; - } - props.zIndex = seg.level + 1; // convert from 0-base to 1-based - props.left = left * 100 + '%'; - props.right = right * 100 + '%'; - if (shouldOverlap && seg.forwardPressure) { - // add padding to the edge so that forward stacked events don't cover the resizer's icon - props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width - } - return props; - }; - return TimeGridEventRenderer; -}(FgEventRenderer)); -// Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is -// left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date. -function buildSlotSegLevels(segs) { - var levels = []; - var i; - var seg; - var j; - for (i = 0; i < segs.length; i++) { - seg = segs[i]; - // go through all the levels and stop on the first level where there are no collisions - for (j = 0; j < levels.length; j++) { - if (!computeSlotSegCollisions(seg, levels[j]).length) { - break; - } - } - seg.level = j; - (levels[j] || (levels[j] = [])).push(seg); - } - return levels; -} -// For every segment, figure out the other segments that are in subsequent -// levels that also occupy the same vertical space. Accumulate in seg.forwardSegs -function computeForwardSlotSegs(levels) { - var i; - var level; - var j; - var seg; - var k; - for (i = 0; i < levels.length; i++) { - level = levels[i]; - for (j = 0; j < level.length; j++) { - seg = level[j]; - seg.forwardSegs = []; - for (k = i + 1; k < levels.length; k++) { - computeSlotSegCollisions(seg, levels[k], seg.forwardSegs); - } - } - } -} -// Figure out which path forward (via seg.forwardSegs) results in the longest path until -// the furthest edge is reached. The number of segments in this path will be seg.forwardPressure -function computeSlotSegPressures(seg) { - var forwardSegs = seg.forwardSegs; - var forwardPressure = 0; - var i; - var forwardSeg; - if (seg.forwardPressure === undefined) { // not already computed - for (i = 0; i < forwardSegs.length; i++) { - forwardSeg = forwardSegs[i]; - // figure out the child's maximum forward path - computeSlotSegPressures(forwardSeg); - // either use the existing maximum, or use the child's forward pressure - // plus one (for the forwardSeg itself) - forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure); - } - seg.forwardPressure = forwardPressure; - } -} -// Find all the segments in `otherSegs` that vertically collide with `seg`. -// Append into an optionally-supplied `results` array and return. -function computeSlotSegCollisions(seg, otherSegs, results) { - if (results === void 0) { results = []; } - for (var i = 0; i < otherSegs.length; i++) { - if (isSlotSegCollision(seg, otherSegs[i])) { - results.push(otherSegs[i]); - } - } - return results; -} -// Do these segments occupy the same vertical space? -function isSlotSegCollision(seg1, seg2) { - return seg1.bottom > seg2.top && seg1.top < seg2.bottom; -} -function buildTimeGridSegCompareObj(seg) { - var obj = buildSegCompareObj(seg); - obj.forwardPressure = seg.forwardPressure; - obj.backwardCoord = seg.backwardCoord; - return obj; -} - -var TimeGridMirrorRenderer = /** @class */ (function (_super) { - __extends(TimeGridMirrorRenderer, _super); - function TimeGridMirrorRenderer() { - return _super !== null && _super.apply(this, arguments) || this; - } - TimeGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) { - this.segsByCol = this.timeGrid.groupSegsByCol(segs); - this.timeGrid.attachSegsByCol(this.segsByCol, this.timeGrid.mirrorContainerEls); - this.sourceSeg = mirrorInfo.sourceSeg; - }; - TimeGridMirrorRenderer.prototype.generateSegCss = function (seg) { - var props = _super.prototype.generateSegCss.call(this, seg); - var sourceSeg = this.sourceSeg; - if (sourceSeg && sourceSeg.col === seg.col) { - var sourceSegProps = _super.prototype.generateSegCss.call(this, sourceSeg); - props.left = sourceSegProps.left; - props.right = sourceSegProps.right; - props.marginLeft = sourceSegProps.marginLeft; - props.marginRight = sourceSegProps.marginRight; - } - return props; - }; - return TimeGridMirrorRenderer; -}(TimeGridEventRenderer)); - -var TimeGridFillRenderer = /** @class */ (function (_super) { - __extends(TimeGridFillRenderer, _super); - function TimeGridFillRenderer(timeGrid) { - var _this = _super.call(this) || this; - _this.timeGrid = timeGrid; - return _this; - } - TimeGridFillRenderer.prototype.attachSegs = function (type, segs) { - var timeGrid = this.timeGrid; - var containerEls; - // TODO: more efficient lookup - if (type === 'bgEvent') { - containerEls = timeGrid.bgContainerEls; - } - else if (type === 'businessHours') { - containerEls = timeGrid.businessContainerEls; - } - else if (type === 'highlight') { - containerEls = timeGrid.highlightContainerEls; - } - timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls); - return segs.map(function (seg) { - return seg.el; - }); - }; - TimeGridFillRenderer.prototype.computeSegSizes = function (segs) { - this.timeGrid.computeSegVerticals(segs); - }; - TimeGridFillRenderer.prototype.assignSegSizes = function (segs) { - this.timeGrid.assignSegVerticals(segs); - }; - return TimeGridFillRenderer; -}(FillRenderer)); - -/* A component that renders one or more columns of vertical time slots -----------------------------------------------------------------------------------------------------------------------*/ -// potential nice values for the slot-duration and interval-duration -// from largest to smallest -var AGENDA_STOCK_SUB_DURATIONS = [ - { hours: 1 }, - { minutes: 30 }, - { minutes: 15 }, - { seconds: 30 }, - { seconds: 15 } -]; -var TimeGrid = /** @class */ (function (_super) { - __extends(TimeGrid, _super); - function TimeGrid(el, renderProps) { - var _this = _super.call(this, el) || this; - _this.isSlatSizesDirty = false; - _this.isColSizesDirty = false; - _this.processOptions = memoize(_this._processOptions); - _this.renderSkeleton = memoizeRendering(_this._renderSkeleton); - _this.renderSlats = memoizeRendering(_this._renderSlats, null, [_this.renderSkeleton]); - _this.renderColumns = memoizeRendering(_this._renderColumns, _this._unrenderColumns, [_this.renderSkeleton]); - _this.renderProps = renderProps; - var renderColumns = _this.renderColumns; - var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this); - var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this); - _this.mirrorRenderer = new TimeGridMirrorRenderer(_this); - _this.renderBusinessHours = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]); - _this.renderDateSelection = memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]); - _this.renderFgEvents = memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]); - _this.renderBgEvents = memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderColumns]); - _this.renderEventSelection = memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]); - _this.renderEventDrag = memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]); - _this.renderEventResize = memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]); - return _this; - } - /* Options - ------------------------------------------------------------------------------------------------------------------*/ - // Parses various options into properties of this object - // MUST have context already set - TimeGrid.prototype._processOptions = function (options) { - var slotDuration = options.slotDuration, snapDuration = options.snapDuration; - var snapsPerSlot; - var input; - slotDuration = createDuration(slotDuration); - snapDuration = snapDuration ? createDuration(snapDuration) : slotDuration; - snapsPerSlot = wholeDivideDurations(slotDuration, snapDuration); - if (snapsPerSlot === null) { - snapDuration = slotDuration; - snapsPerSlot = 1; - // TODO: say warning? - } - this.slotDuration = slotDuration; - this.snapDuration = snapDuration; - this.snapsPerSlot = snapsPerSlot; - // might be an array value (for TimelineView). - // if so, getting the most granular entry (the last one probably). - input = options.slotLabelFormat; - if (Array.isArray(input)) { - input = input[input.length - 1]; - } - this.labelFormat = createFormatter(input || { - hour: 'numeric', - minute: '2-digit', - omitZeroMinute: true, - meridiem: 'short' - }); - input = options.slotLabelInterval; - this.labelInterval = input ? - createDuration(input) : - this.computeLabelInterval(slotDuration); - }; - // Computes an automatic value for slotLabelInterval - TimeGrid.prototype.computeLabelInterval = function (slotDuration) { - var i; - var labelInterval; - var slotsPerLabel; - // find the smallest stock label interval that results in more than one slots-per-label - for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) { - labelInterval = createDuration(AGENDA_STOCK_SUB_DURATIONS[i]); - slotsPerLabel = wholeDivideDurations(labelInterval, slotDuration); - if (slotsPerLabel !== null && slotsPerLabel > 1) { - return labelInterval; - } - } - return slotDuration; // fall back - }; - /* Rendering - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.render = function (props, context) { - this.processOptions(context.options); - var cells = props.cells; - this.colCnt = cells.length; - this.renderSkeleton(context.theme); - this.renderSlats(props.dateProfile); - this.renderColumns(props.cells, props.dateProfile); - this.renderBusinessHours(context, props.businessHourSegs); - this.renderDateSelection(props.dateSelectionSegs); - this.renderFgEvents(context, props.fgEventSegs); - this.renderBgEvents(context, props.bgEventSegs); - this.renderEventSelection(props.eventSelection); - this.renderEventDrag(props.eventDrag); - this.renderEventResize(props.eventResize); - }; - TimeGrid.prototype.destroy = function () { - _super.prototype.destroy.call(this); - // should unrender everything else too - this.renderSlats.unrender(); - this.renderColumns.unrender(); - this.renderSkeleton.unrender(); - }; - TimeGrid.prototype.updateSize = function (isResize) { - var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer; - if (isResize || this.isSlatSizesDirty) { - this.buildSlatPositions(); - this.isSlatSizesDirty = false; - } - if (isResize || this.isColSizesDirty) { - this.buildColPositions(); - this.isColSizesDirty = false; - } - fillRenderer.computeSizes(isResize); - eventRenderer.computeSizes(isResize); - mirrorRenderer.computeSizes(isResize); - fillRenderer.assignSizes(isResize); - eventRenderer.assignSizes(isResize); - mirrorRenderer.assignSizes(isResize); - }; - TimeGrid.prototype._renderSkeleton = function (theme) { - var el = this.el; - el.innerHTML = - '<div class="fc-bg"></div>' + - '<div class="fc-slats"></div>' + - '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" style="display:none" />'; - this.rootBgContainerEl = el.querySelector('.fc-bg'); - this.slatContainerEl = el.querySelector('.fc-slats'); - this.bottomRuleEl = el.querySelector('.fc-divider'); - }; - TimeGrid.prototype._renderSlats = function (dateProfile) { - var theme = this.context.theme; - this.slatContainerEl.innerHTML = - '<table class="' + theme.getClass('tableGrid') + '">' + - this.renderSlatRowHtml(dateProfile) + - '</table>'; - this.slatEls = findElements(this.slatContainerEl, 'tr'); - this.slatPositions = new PositionCache(this.el, this.slatEls, false, true // vertical - ); - this.isSlatSizesDirty = true; - }; - // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL. - TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) { - var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl; - var html = ''; - var dayStart = startOfDay(dateProfile.renderRange.start); - var slotTime = dateProfile.minTime; - var slotIterator = createDuration(0); - var slotDate; // will be on the view's first day, but we only care about its time - var isLabeled; - var axisHtml; - // Calculate the time for each slot - while (asRoughMs(slotTime) < asRoughMs(dateProfile.maxTime)) { - slotDate = dateEnv.add(dayStart, slotTime); - isLabeled = wholeDivideDurations(slotIterator, this.labelInterval) !== null; - axisHtml = - '<td class="fc-axis fc-time ' + theme.getClass('widgetContent') + '">' + - (isLabeled ? - '<span>' + // for matchCellWidths - htmlEscape(dateEnv.format(slotDate, this.labelFormat)) + - '</span>' : - '') + - '</td>'; - html += - '<tr data-time="' + formatIsoTimeString(slotDate) + '"' + - (isLabeled ? '' : ' class="fc-minor"') + - '>' + - (!isRtl ? axisHtml : '') + - '<td class="' + theme.getClass('widgetContent') + '"></td>' + - (isRtl ? axisHtml : '') + - '</tr>'; - slotTime = addDurations(slotTime, this.slotDuration); - slotIterator = addDurations(slotIterator, this.slotDuration); - } - return html; - }; - TimeGrid.prototype._renderColumns = function (cells, dateProfile) { - var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, theme = _a.theme, dateEnv = _a.dateEnv; - var bgRow = new DayBgRow(this.context); - this.rootBgContainerEl.innerHTML = - '<table class="' + theme.getClass('tableGrid') + '">' + - bgRow.renderHtml({ - cells: cells, - dateProfile: dateProfile, - renderIntroHtml: this.renderProps.renderBgIntroHtml - }) + - '</table>'; - this.colEls = findElements(this.el, '.fc-day, .fc-disabled-day'); - for (var col = 0; col < this.colCnt; col++) { - calendar.publiclyTrigger('dayRender', [ - { - date: dateEnv.toDate(cells[col].date), - el: this.colEls[col], - view: view - } - ]); - } - if (isRtl) { - this.colEls.reverse(); - } - this.colPositions = new PositionCache(this.el, this.colEls, true, // horizontal - false); - this.renderContentSkeleton(); - this.isColSizesDirty = true; - }; - TimeGrid.prototype._unrenderColumns = function () { - this.unrenderContentSkeleton(); - }; - /* Content Skeleton - ------------------------------------------------------------------------------------------------------------------*/ - // Renders the DOM that the view's content will live in - TimeGrid.prototype.renderContentSkeleton = function () { - var isRtl = this.context.isRtl; - var parts = []; - var skeletonEl; - parts.push(this.renderProps.renderIntroHtml()); - for (var i = 0; i < this.colCnt; i++) { - parts.push('<td>' + - '<div class="fc-content-col">' + - '<div class="fc-event-container fc-mirror-container"></div>' + - '<div class="fc-event-container"></div>' + - '<div class="fc-highlight-container"></div>' + - '<div class="fc-bgevent-container"></div>' + - '<div class="fc-business-container"></div>' + - '</div>' + - '</td>'); - } - if (isRtl) { - parts.reverse(); - } - skeletonEl = this.contentSkeletonEl = htmlToElement('<div class="fc-content-skeleton">' + - '<table>' + - '<tr>' + parts.join('') + '</tr>' + - '</table>' + - '</div>'); - this.colContainerEls = findElements(skeletonEl, '.fc-content-col'); - this.mirrorContainerEls = findElements(skeletonEl, '.fc-mirror-container'); - this.fgContainerEls = findElements(skeletonEl, '.fc-event-container:not(.fc-mirror-container)'); - this.bgContainerEls = findElements(skeletonEl, '.fc-bgevent-container'); - this.highlightContainerEls = findElements(skeletonEl, '.fc-highlight-container'); - this.businessContainerEls = findElements(skeletonEl, '.fc-business-container'); - if (isRtl) { - this.colContainerEls.reverse(); - this.mirrorContainerEls.reverse(); - this.fgContainerEls.reverse(); - this.bgContainerEls.reverse(); - this.highlightContainerEls.reverse(); - this.businessContainerEls.reverse(); - } - this.el.appendChild(skeletonEl); - }; - TimeGrid.prototype.unrenderContentSkeleton = function () { - removeElement(this.contentSkeletonEl); - }; - // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col - TimeGrid.prototype.groupSegsByCol = function (segs) { - var segsByCol = []; - var i; - for (i = 0; i < this.colCnt; i++) { - segsByCol.push([]); - } - for (i = 0; i < segs.length; i++) { - segsByCol[segs[i].col].push(segs[i]); - } - return segsByCol; - }; - // Given segments grouped by column, insert the segments' elements into a parallel array of container - // elements, each living within a column. - TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) { - var col; - var segs; - var i; - for (col = 0; col < this.colCnt; col++) { // iterate each column grouping - segs = segsByCol[col]; - for (i = 0; i < segs.length; i++) { - containerEls[col].appendChild(segs[i].el); - } - } - }; - /* Now Indicator - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.getNowIndicatorUnit = function () { - return 'minute'; // will refresh on the minute - }; - TimeGrid.prototype.renderNowIndicator = function (segs, date) { - // HACK: if date columns not ready for some reason (scheduler) - if (!this.colContainerEls) { - return; - } - var top = this.computeDateTop(date); - var nodes = []; - var i; - // render lines within the columns - for (i = 0; i < segs.length; i++) { - var lineEl = createElement('div', { className: 'fc-now-indicator fc-now-indicator-line' }); - lineEl.style.top = top + 'px'; - this.colContainerEls[segs[i].col].appendChild(lineEl); - nodes.push(lineEl); - } - // render an arrow over the axis - if (segs.length > 0) { // is the current time in view? - var arrowEl = createElement('div', { className: 'fc-now-indicator fc-now-indicator-arrow' }); - arrowEl.style.top = top + 'px'; - this.contentSkeletonEl.appendChild(arrowEl); - nodes.push(arrowEl); - } - this.nowIndicatorEls = nodes; - }; - TimeGrid.prototype.unrenderNowIndicator = function () { - if (this.nowIndicatorEls) { - this.nowIndicatorEls.forEach(removeElement); - this.nowIndicatorEls = null; - } - }; - /* Coordinates - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.getTotalSlatHeight = function () { - return this.slatContainerEl.getBoundingClientRect().height; - }; - // Computes the top coordinate, relative to the bounds of the grid, of the given date. - // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight. - TimeGrid.prototype.computeDateTop = function (when, startOfDayDate) { - if (!startOfDayDate) { - startOfDayDate = startOfDay(when); - } - return this.computeTimeTop(createDuration(when.valueOf() - startOfDayDate.valueOf())); - }; - // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). - TimeGrid.prototype.computeTimeTop = function (duration) { - var len = this.slatEls.length; - var dateProfile = this.props.dateProfile; - var slatCoverage = (duration.milliseconds - asRoughMs(dateProfile.minTime)) / asRoughMs(this.slotDuration); // floating-point value of # of slots covered - var slatIndex; - var slatRemainder; - // compute a floating-point number for how many slats should be progressed through. - // from 0 to number of slats (inclusive) - // constrained because minTime/maxTime might be customized. - slatCoverage = Math.max(0, slatCoverage); - slatCoverage = Math.min(len, slatCoverage); - // an integer index of the furthest whole slat - // from 0 to number slats (*exclusive*, so len-1) - slatIndex = Math.floor(slatCoverage); - slatIndex = Math.min(slatIndex, len - 1); - // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition. - // could be 1.0 if slatCoverage is covering *all* the slots - slatRemainder = slatCoverage - slatIndex; - return this.slatPositions.tops[slatIndex] + - this.slatPositions.getHeight(slatIndex) * slatRemainder; - }; - // For each segment in an array, computes and assigns its top and bottom properties - TimeGrid.prototype.computeSegVerticals = function (segs) { - var options = this.context.options; - var eventMinHeight = options.timeGridEventMinHeight; - var i; - var seg; - var dayDate; - for (i = 0; i < segs.length; i++) { - seg = segs[i]; - dayDate = this.props.cells[seg.col].date; - seg.top = this.computeDateTop(seg.start, dayDate); - seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.end, dayDate)); - } - }; - // Given segments that already have their top/bottom properties computed, applies those values to - // the segments' elements. - TimeGrid.prototype.assignSegVerticals = function (segs) { - var i; - var seg; - for (i = 0; i < segs.length; i++) { - seg = segs[i]; - applyStyle(seg.el, this.generateSegVerticalCss(seg)); - } - }; - // Generates an object with CSS properties for the top/bottom coordinates of a segment element - TimeGrid.prototype.generateSegVerticalCss = function (seg) { - return { - top: seg.top, - bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container - }; - }; - /* Sizing - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.buildPositionCaches = function () { - this.buildColPositions(); - this.buildSlatPositions(); - }; - TimeGrid.prototype.buildColPositions = function () { - this.colPositions.build(); - }; - TimeGrid.prototype.buildSlatPositions = function () { - this.slatPositions.build(); - }; - /* Hit System - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) { - var dateEnv = this.context.dateEnv; - var _a = this, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions; - var colIndex = colPositions.leftToIndex(positionLeft); - var slatIndex = slatPositions.topToIndex(positionTop); - if (colIndex != null && slatIndex != null) { - var slatTop = slatPositions.tops[slatIndex]; - var slatHeight = slatPositions.getHeight(slatIndex); - var partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1 - var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat - var snapIndex = slatIndex * snapsPerSlot + localSnapIndex; - var dayDate = this.props.cells[colIndex].date; - var time = addDurations(this.props.dateProfile.minTime, multiplyDuration(this.snapDuration, snapIndex)); - var start = dateEnv.add(dayDate, time); - var end = dateEnv.add(start, this.snapDuration); - return { - col: colIndex, - dateSpan: { - range: { start: start, end: end }, - allDay: false - }, - dayEl: this.colEls[colIndex], - relativeRect: { - left: colPositions.lefts[colIndex], - right: colPositions.rights[colIndex], - top: slatTop, - bottom: slatTop + slatHeight - } - }; - } - }; - /* Event Drag Visualization - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype._renderEventDrag = function (state) { - if (state) { - this.eventRenderer.hideByHash(state.affectedInstances); - if (state.isEvent) { - this.mirrorRenderer.renderSegs(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg }); - } - else { - this.fillRenderer.renderSegs('highlight', this.context, state.segs); - } - } - }; - TimeGrid.prototype._unrenderEventDrag = function (state) { - if (state) { - this.eventRenderer.showByHash(state.affectedInstances); - if (state.isEvent) { - this.mirrorRenderer.unrender(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg }); - } - else { - this.fillRenderer.unrender('highlight', this.context); - } - } - }; - /* Event Resize Visualization - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype._renderEventResize = function (state) { - if (state) { - this.eventRenderer.hideByHash(state.affectedInstances); - this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg }); - } - }; - TimeGrid.prototype._unrenderEventResize = function (state) { - if (state) { - this.eventRenderer.showByHash(state.affectedInstances); - this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg }); - } - }; - /* Selection - ------------------------------------------------------------------------------------------------------------------*/ - // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight. - TimeGrid.prototype._renderDateSelection = function (segs) { - if (segs) { - if (this.context.options.selectMirror) { - this.mirrorRenderer.renderSegs(this.context, segs, { isSelecting: true }); - } - else { - this.fillRenderer.renderSegs('highlight', this.context, segs); - } - } - }; - TimeGrid.prototype._unrenderDateSelection = function (segs) { - if (segs) { - if (this.context.options.selectMirror) { - this.mirrorRenderer.unrender(this.context, segs, { isSelecting: true }); - } - else { - this.fillRenderer.unrender('highlight', this.context); - } - } - }; - return TimeGrid; -}(DateComponent)); - -var AllDaySplitter = /** @class */ (function (_super) { - __extends(AllDaySplitter, _super); - function AllDaySplitter() { - return _super !== null && _super.apply(this, arguments) || this; - } - AllDaySplitter.prototype.getKeyInfo = function () { - return { - allDay: {}, - timed: {} - }; - }; - AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) { - if (dateSpan.allDay) { - return ['allDay']; - } - else { - return ['timed']; - } - }; - AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) { - if (!eventDef.allDay) { - return ['timed']; - } - else if (hasBgRendering(eventDef)) { - return ['timed', 'allDay']; - } - else { - return ['allDay']; - } - }; - return AllDaySplitter; -}(Splitter)); - -var TIMEGRID_ALL_DAY_EVENT_LIMIT = 5; -var WEEK_HEADER_FORMAT = createFormatter({ week: 'short' }); -/* An abstract class for all timegrid-related views. Displays one more columns with time slots running vertically. -----------------------------------------------------------------------------------------------------------------------*/ -// Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on). -// Responsible for managing width/height. -var AbstractTimeGridView = /** @class */ (function (_super) { - __extends(AbstractTimeGridView, _super); - function AbstractTimeGridView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.splitter = new AllDaySplitter(); - _this.renderSkeleton = memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton); - /* Header Render Methods - ------------------------------------------------------------------------------------------------------------------*/ - // Generates the HTML that will go before the day-of week header cells - _this.renderHeadIntroHtml = function () { - var _a = _this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options; - var range = _this.props.dateProfile.renderRange; - var dayCnt = diffDays(range.start, range.end); - var weekText; - if (options.weekNumbers) { - weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT); - return '' + - '<th class="fc-axis fc-week-number ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '>' + - buildGotoAnchorHtml(// aside from link, important for matchCellWidths - options, dateEnv, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, htmlEscape(weekText) // inner HTML - ) + - '</th>'; - } - else { - return '<th class="fc-axis ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '></th>'; - } - }; - /* Time Grid Render Methods - ------------------------------------------------------------------------------------------------------------------*/ - // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column. - _this.renderTimeGridBgIntroHtml = function () { - var theme = _this.context.theme; - return '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '></td>'; - }; - // Generates the HTML that goes before all other types of cells. - // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid. - _this.renderTimeGridIntroHtml = function () { - return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>'; - }; - /* Day Grid Render Methods - ------------------------------------------------------------------------------------------------------------------*/ - // Generates the HTML that goes before the all-day cells - _this.renderDayGridBgIntroHtml = function () { - var _a = _this.context, theme = _a.theme, options = _a.options; - return '' + - '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '>' + - '<span>' + // needed for matchCellWidths - getAllDayHtml(options) + - '</span>' + - '</td>'; - }; - // Generates the HTML that goes before all other types of cells. - // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid. - _this.renderDayGridIntroHtml = function () { - return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>'; - }; - return _this; - } - AbstractTimeGridView.prototype.render = function (props, context) { - _super.prototype.render.call(this, props, context); - this.renderSkeleton(context); - }; - AbstractTimeGridView.prototype.destroy = function () { - _super.prototype.destroy.call(this); - this.renderSkeleton.unrender(); - }; - AbstractTimeGridView.prototype._renderSkeleton = function (context) { - this.el.classList.add('fc-timeGrid-view'); - this.el.innerHTML = this.renderSkeletonHtml(); - this.scroller = new ScrollComponent('hidden', // overflow x - 'auto' // overflow y - ); - var timeGridWrapEl = this.scroller.el; - this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl); - timeGridWrapEl.classList.add('fc-time-grid-container'); - var timeGridEl = createElement('div', { className: 'fc-time-grid' }); - timeGridWrapEl.appendChild(timeGridEl); - this.timeGrid = new TimeGrid(timeGridEl, { - renderBgIntroHtml: this.renderTimeGridBgIntroHtml, - renderIntroHtml: this.renderTimeGridIntroHtml - }); - if (context.options.allDaySlot) { // should we display the "all-day" area? - this.dayGrid = new DayGrid(// the all-day subcomponent of this view - this.el.querySelector('.fc-day-grid'), { - renderNumberIntroHtml: this.renderDayGridIntroHtml, - renderBgIntroHtml: this.renderDayGridBgIntroHtml, - renderIntroHtml: this.renderDayGridIntroHtml, - colWeekNumbersVisible: false, - cellWeekNumbersVisible: false - }); - // have the day-grid extend it's coordinate area over the <hr> dividing the two grids - var dividerEl = this.el.querySelector('.fc-divider'); - this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height; - } - }; - AbstractTimeGridView.prototype._unrenderSkeleton = function () { - this.el.classList.remove('fc-timeGrid-view'); - this.timeGrid.destroy(); - if (this.dayGrid) { - this.dayGrid.destroy(); - } - this.scroller.destroy(); - }; - /* Rendering - ------------------------------------------------------------------------------------------------------------------*/ - // Builds the HTML skeleton for the view. - // The day-grid and time-grid components will render inside containers defined by this HTML. - AbstractTimeGridView.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') + '">' + - (options.allDaySlot ? - '<div class="fc-day-grid"></div>' + - '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" />' : - '') + - '</td>' + - '</tr>' + - '</tbody>' + - '</table>'; - }; - /* Now Indicator - ------------------------------------------------------------------------------------------------------------------*/ - AbstractTimeGridView.prototype.getNowIndicatorUnit = function () { - return this.timeGrid.getNowIndicatorUnit(); - }; - // subclasses should implement - // renderNowIndicator(date: DateMarker) { - // } - AbstractTimeGridView.prototype.unrenderNowIndicator = function () { - this.timeGrid.unrenderNowIndicator(); - }; - /* Dimensions - ------------------------------------------------------------------------------------------------------------------*/ - AbstractTimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) { - _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first - this.timeGrid.updateSize(isResize); - if (this.dayGrid) { - this.dayGrid.updateSize(isResize); - } - }; - // Adjusts the vertical dimensions of the view to the specified values - AbstractTimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) { - var _this = this; - var eventLimit; - var scrollerHeight; - var scrollbarWidths; - // make all axis cells line up - this.axisWidth = matchCellWidths(findElements(this.el, '.fc-axis')); - // hack to give the view some height prior to timeGrid's columns being rendered - // TODO: separate setting height from scroller VS timeGrid. - if (!this.timeGrid.colEls) { - if (!isAuto) { - scrollerHeight = this.computeScrollerHeight(viewHeight); - this.scroller.setHeight(scrollerHeight); - } - return; - } - // set of fake row elements that must compensate when scroller has scrollbars - var noScrollRowEls = findElements(this.el, '.fc-row').filter(function (node) { - return !_this.scroller.el.contains(node); - }); - // reset all dimensions back to the original state - this.timeGrid.bottomRuleEl.style.display = 'none'; // will be shown later if this <hr> is necessary - this.scroller.clear(); // sets height to 'auto' and clears overflow - noScrollRowEls.forEach(uncompensateScroll); - // limit number of events in the all-day area - if (this.dayGrid) { - this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed - eventLimit = this.context.options.eventLimit; - if (eventLimit && typeof eventLimit !== 'number') { - eventLimit = TIMEGRID_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number - } - if (eventLimit) { - this.dayGrid.limitRows(eventLimit); - } - } - if (!isAuto) { // should we force dimensions of the scroll container? - scrollerHeight = this.computeScrollerHeight(viewHeight); - this.scroller.setHeight(scrollerHeight); - scrollbarWidths = this.scroller.getScrollbarWidths(); - if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars? - // make the all-day and header rows lines up - noScrollRowEls.forEach(function (rowEl) { - compensateScroll(rowEl, scrollbarWidths); - }); - // the scrollbar compensation might have changed text flow, which might affect height, so recalculate - // and reapply the desired height to the scroller. - scrollerHeight = this.computeScrollerHeight(viewHeight); - this.scroller.setHeight(scrollerHeight); - } - // guarantees the same scrollbar widths - this.scroller.lockOverflow(scrollbarWidths); - // if there's any space below the slats, show the horizontal rule. - // this won't cause any new overflow, because lockOverflow already called. - if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) { - this.timeGrid.bottomRuleEl.style.display = ''; - } - } - }; - // given a desired total height of the view, returns what the height of the scroller should be - AbstractTimeGridView.prototype.computeScrollerHeight = function (viewHeight) { - return viewHeight - - subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller - }; - /* Scroll - ------------------------------------------------------------------------------------------------------------------*/ - // Computes the initial pre-configured scroll state prior to allowing the user to change it - AbstractTimeGridView.prototype.computeDateScroll = function (duration) { - var top = this.timeGrid.computeTimeTop(duration); - // zoom can give weird floating-point values. rather scroll a little bit further - top = Math.ceil(top); - if (top) { - top++; // to overcome top border that slots beyond the first have. looks better - } - return { top: top }; - }; - AbstractTimeGridView.prototype.queryDateScroll = function () { - return { top: this.scroller.getScrollTop() }; - }; - AbstractTimeGridView.prototype.applyDateScroll = function (scroll) { - if (scroll.top !== undefined) { - this.scroller.setScrollTop(scroll.top); - } - }; - // Generates an HTML attribute string for setting the width of the axis, if it is known - AbstractTimeGridView.prototype.axisStyleAttr = function () { - if (this.axisWidth != null) { - return 'style="width:' + this.axisWidth + 'px"'; - } - return ''; - }; - return AbstractTimeGridView; -}(View)); -AbstractTimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering - -var SimpleTimeGrid = /** @class */ (function (_super) { - __extends(SimpleTimeGrid, _super); - function SimpleTimeGrid(timeGrid) { - var _this = _super.call(this, timeGrid.el) || this; - _this.buildDayRanges = memoize(buildDayRanges); - _this.slicer = new TimeGridSlicer(); - _this.timeGrid = timeGrid; - return _this; - } - SimpleTimeGrid.prototype.firstContext = function (context) { - context.calendar.registerInteractiveComponent(this, { - el: this.timeGrid.el - }); - }; - SimpleTimeGrid.prototype.destroy = function () { - _super.prototype.destroy.call(this); - this.context.calendar.unregisterInteractiveComponent(this); - }; - SimpleTimeGrid.prototype.render = function (props, context) { - var dateEnv = this.context.dateEnv; - var dateProfile = props.dateProfile, dayTable = props.dayTable; - var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, dateEnv); - var timeGrid = this.timeGrid; - timeGrid.receiveContext(context); // hack because context is used in sliceProps - timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, context.calendar, timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }), context); - }; - SimpleTimeGrid.prototype.renderNowIndicator = function (date) { - this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(date, this.timeGrid, this.dayRanges), date); - }; - SimpleTimeGrid.prototype.buildPositionCaches = function () { - this.timeGrid.buildPositionCaches(); - }; - SimpleTimeGrid.prototype.queryHit = function (positionLeft, positionTop) { - var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop); - if (rawHit) { - return { - component: this.timeGrid, - 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 - }; - } - }; - return SimpleTimeGrid; -}(DateComponent)); -function buildDayRanges(dayTable, dateProfile, dateEnv) { - var ranges = []; - for (var _i = 0, _a = dayTable.headerDates; _i < _a.length; _i++) { - var date = _a[_i]; - ranges.push({ - start: dateEnv.add(date, dateProfile.minTime), - end: dateEnv.add(date, dateProfile.maxTime) - }); - } - return ranges; -} -var TimeGridSlicer = /** @class */ (function (_super) { - __extends(TimeGridSlicer, _super); - function TimeGridSlicer() { - return _super !== null && _super.apply(this, arguments) || this; - } - TimeGridSlicer.prototype.sliceRange = function (range, dayRanges) { - var segs = []; - for (var col = 0; col < dayRanges.length; col++) { - var segRange = intersectRanges(range, dayRanges[col]); - if (segRange) { - segs.push({ - start: segRange.start, - end: segRange.end, - isStart: segRange.start.valueOf() === range.start.valueOf(), - isEnd: segRange.end.valueOf() === range.end.valueOf(), - col: col - }); - } - } - return segs; - }; - return TimeGridSlicer; -}(Slicer)); - -var TimeGridView = /** @class */ (function (_super) { - __extends(TimeGridView, _super); - function TimeGridView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.buildDayTable = memoize(buildDayTable); - return _this; - } - TimeGridView.prototype.render = function (props, context) { - _super.prototype.render.call(this, props, context); // for flags for updateSize. also _renderSkeleton/_unrenderSkeleton - var _a = this.props, dateProfile = _a.dateProfile, dateProfileGenerator = _a.dateProfileGenerator; - var nextDayThreshold = context.nextDayThreshold; - var dayTable = this.buildDayTable(dateProfile, dateProfileGenerator); - var splitProps = this.splitter.splitProps(props); - if (this.header) { - this.header.receiveProps({ - dateProfile: dateProfile, - dates: dayTable.headerDates, - datesRepDistinctDays: true, - renderIntroHtml: this.renderHeadIntroHtml - }, context); - } - this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile, - dayTable: dayTable }), context); - if (this.simpleDayGrid) { - this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile, - dayTable: dayTable, - nextDayThreshold: nextDayThreshold, isRigid: false }), context); - } - this.startNowIndicator(dateProfile, dateProfileGenerator); - }; - TimeGridView.prototype._renderSkeleton = function (context) { - _super.prototype._renderSkeleton.call(this, context); - if (context.options.columnHeader) { - this.header = new DayHeader(this.el.querySelector('.fc-head-container')); - } - this.simpleTimeGrid = new SimpleTimeGrid(this.timeGrid); - if (this.dayGrid) { - this.simpleDayGrid = new SimpleDayGrid(this.dayGrid); - } - }; - TimeGridView.prototype._unrenderSkeleton = function () { - _super.prototype._unrenderSkeleton.call(this); - if (this.header) { - this.header.destroy(); - } - this.simpleTimeGrid.destroy(); - if (this.simpleDayGrid) { - this.simpleDayGrid.destroy(); - } - }; - TimeGridView.prototype.renderNowIndicator = function (date) { - this.simpleTimeGrid.renderNowIndicator(date); - }; - return TimeGridView; -}(AbstractTimeGridView)); -function buildDayTable(dateProfile, dateProfileGenerator) { - var daySeries = new DaySeries(dateProfile.renderRange, dateProfileGenerator); - return new DayTable(daySeries, false); -} - -var main = createPlugin({ - defaultView: 'timeGridWeek', - views: { - timeGrid: { - class: TimeGridView, - allDaySlot: true, - slotDuration: '00:30:00', - slotEventOverlap: true // a bad name. confused with overlap/constraint system - }, - timeGridDay: { - type: 'timeGrid', - duration: { days: 1 } - }, - timeGridWeek: { - type: 'timeGrid', - duration: { weeks: 1 } - } - } -}); - -export default main; -export { AbstractTimeGridView, TimeGrid, TimeGridSlicer, TimeGridView, buildDayRanges, buildDayTable }; diff --git a/library/fullcalendar/packages/timegrid/main.js b/library/fullcalendar/packages/timegrid/main.js deleted file mode 100644 index d64a8a2ea..000000000 --- a/library/fullcalendar/packages/timegrid/main.js +++ /dev/null @@ -1,1403 +0,0 @@ -/*! -FullCalendar Time Grid Plugin v4.4.2 -Docs & License: https://fullcalendar.io/ -(c) 2019 Adam Shaw -*/ - -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@fullcalendar/core'), require('@fullcalendar/daygrid')) : - typeof define === 'function' && define.amd ? define(['exports', '@fullcalendar/core', '@fullcalendar/daygrid'], factory) : - (global = global || self, factory(global.FullCalendarTimeGrid = {}, global.FullCalendar, global.FullCalendarDayGrid)); -}(this, function (exports, core, daygrid) { 'use strict'; - - /*! *****************************************************************************
- Copyright (c) Microsoft Corporation.
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
- ***************************************************************************** */
- /* global Reflect, 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);
- }; - - /* - Only handles foreground segs. - Does not own rendering. Use for low-level util methods by TimeGrid. - */ - var TimeGridEventRenderer = /** @class */ (function (_super) { - __extends(TimeGridEventRenderer, _super); - function TimeGridEventRenderer(timeGrid) { - var _this = _super.call(this) || this; - _this.timeGrid = timeGrid; - return _this; - } - TimeGridEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) { - _super.prototype.renderSegs.call(this, context, segs, mirrorInfo); - // TODO: dont do every time. memoize - this.fullTimeFormat = core.createFormatter({ - hour: 'numeric', - minute: '2-digit', - separator: this.context.options.defaultRangeSeparator - }); - }; - // Given an array of foreground segments, render a DOM element for each, computes position, - // and attaches to the column inner-container elements. - TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) { - var segsByCol = this.timeGrid.groupSegsByCol(segs); - // order the segs within each column - // TODO: have groupSegsByCol do this? - for (var col = 0; col < segsByCol.length; col++) { - segsByCol[col] = this.sortEventSegs(segsByCol[col]); - } - this.segsByCol = segsByCol; - this.timeGrid.attachSegsByCol(segsByCol, this.timeGrid.fgContainerEls); - }; - TimeGridEventRenderer.prototype.detachSegs = function (segs) { - segs.forEach(function (seg) { - core.removeElement(seg.el); - }); - this.segsByCol = null; - }; - TimeGridEventRenderer.prototype.computeSegSizes = function (allSegs) { - var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol; - var colCnt = timeGrid.colCnt; - timeGrid.computeSegVerticals(allSegs); // horizontals relies on this - if (segsByCol) { - for (var col = 0; col < colCnt; col++) { - this.computeSegHorizontals(segsByCol[col]); // compute horizontal coordinates, z-index's, and reorder the array - } - } - }; - TimeGridEventRenderer.prototype.assignSegSizes = function (allSegs) { - var _a = this, timeGrid = _a.timeGrid, segsByCol = _a.segsByCol; - var colCnt = timeGrid.colCnt; - timeGrid.assignSegVerticals(allSegs); // horizontals relies on this - if (segsByCol) { - for (var col = 0; col < colCnt; col++) { - this.assignSegCss(segsByCol[col]); - } - } - }; - // Computes a default event time formatting string if `eventTimeFormat` is not explicitly defined - TimeGridEventRenderer.prototype.computeEventTimeFormat = function () { - return { - hour: 'numeric', - minute: '2-digit', - meridiem: false - }; - }; - // Computes a default `displayEventEnd` value if one is not expliclty defined - TimeGridEventRenderer.prototype.computeDisplayEventEnd = function () { - return true; - }; - // Renders the HTML for a single event segment's default rendering - TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) { - var eventRange = seg.eventRange; - var eventDef = eventRange.def; - var eventUi = eventRange.ui; - var allDay = eventDef.allDay; - var isDraggable = core.computeEventDraggable(this.context, eventDef, eventUi); - var isResizableFromStart = seg.isStart && core.computeEventStartResizable(this.context, eventDef, eventUi); - var isResizableFromEnd = seg.isEnd && core.computeEventEndResizable(this.context, eventDef, eventUi); - var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo); - var skinCss = core.cssToStr(this.getSkinCss(eventUi)); - var timeText; - var fullTimeText; // more verbose time text. for the print stylesheet - var startTimeText; // just the start time text - classes.unshift('fc-time-grid-event'); - // if the event appears to span more than one day... - if (core.isMultiDayRange(eventRange.range)) { - // Don't display time text on segments that run entirely through a day. - // That would appear as midnight-midnight and would look dumb. - // Otherwise, display the time text for the *segment's* times (like 6pm-midnight or midnight-10am) - if (seg.isStart || seg.isEnd) { - var unzonedStart = seg.start; - var unzonedEnd = seg.end; - timeText = this._getTimeText(unzonedStart, unzonedEnd, allDay); // TODO: give the timezones - fullTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, this.fullTimeFormat); - startTimeText = this._getTimeText(unzonedStart, unzonedEnd, allDay, null, false); // displayEnd=false - } - } - else { - // Display the normal time text for the *event's* times - timeText = this.getTimeText(eventRange); - fullTimeText = this.getTimeText(eventRange, this.fullTimeFormat); - startTimeText = this.getTimeText(eventRange, null, false); // displayEnd=false - } - return '<a class="' + classes.join(' ') + '"' + - (eventDef.url ? - ' href="' + core.htmlEscape(eventDef.url) + '"' : - '') + - (skinCss ? - ' style="' + skinCss + '"' : - '') + - '>' + - '<div class="fc-content">' + - (timeText ? - '<div class="fc-time"' + - ' data-start="' + core.htmlEscape(startTimeText) + '"' + - ' data-full="' + core.htmlEscape(fullTimeText) + '"' + - '>' + - '<span>' + core.htmlEscape(timeText) + '</span>' + - '</div>' : - '') + - (eventDef.title ? - '<div class="fc-title">' + - core.htmlEscape(eventDef.title) + - '</div>' : - '') + - '</div>' + - /* TODO: write CSS for this - (isResizableFromStart ? - '<div class="fc-resizer fc-start-resizer"></div>' : - '' - ) + - */ - (isResizableFromEnd ? - '<div class="fc-resizer fc-end-resizer"></div>' : - '') + - '</a>'; - }; - // Given an array of segments that are all in the same column, sets the backwardCoord and forwardCoord on each. - // Assumed the segs are already ordered. - // NOTE: Also reorders the given array by date! - TimeGridEventRenderer.prototype.computeSegHorizontals = function (segs) { - var levels; - var level0; - var i; - levels = buildSlotSegLevels(segs); - computeForwardSlotSegs(levels); - if ((level0 = levels[0])) { - for (i = 0; i < level0.length; i++) { - computeSlotSegPressures(level0[i]); - } - for (i = 0; i < level0.length; i++) { - this.computeSegForwardBack(level0[i], 0, 0); - } - } - }; - // Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range - // from 0 to 1. If the calendar is left-to-right, the seg.backwardCoord maps to "left" and - // seg.forwardCoord maps to "right" (via percentage). Vice-versa if the calendar is right-to-left. - // - // The segment might be part of a "series", which means consecutive segments with the same pressure - // who's width is unknown until an edge has been hit. `seriesBackwardPressure` is the number of - // segments behind this one in the current series, and `seriesBackwardCoord` is the starting - // coordinate of the first segment in the series. - TimeGridEventRenderer.prototype.computeSegForwardBack = function (seg, seriesBackwardPressure, seriesBackwardCoord) { - var forwardSegs = seg.forwardSegs; - var i; - if (seg.forwardCoord === undefined) { // not already computed - if (!forwardSegs.length) { - // if there are no forward segments, this segment should butt up against the edge - seg.forwardCoord = 1; - } - else { - // sort highest pressure first - this.sortForwardSegs(forwardSegs); - // this segment's forwardCoord will be calculated from the backwardCoord of the - // highest-pressure forward segment. - this.computeSegForwardBack(forwardSegs[0], seriesBackwardPressure + 1, seriesBackwardCoord); - seg.forwardCoord = forwardSegs[0].backwardCoord; - } - // calculate the backwardCoord from the forwardCoord. consider the series - seg.backwardCoord = seg.forwardCoord - - (seg.forwardCoord - seriesBackwardCoord) / // available width for series - (seriesBackwardPressure + 1); // # of segments in the series - // use this segment's coordinates to computed the coordinates of the less-pressurized - // forward segments - for (i = 0; i < forwardSegs.length; i++) { - this.computeSegForwardBack(forwardSegs[i], 0, seg.forwardCoord); - } - } - }; - TimeGridEventRenderer.prototype.sortForwardSegs = function (forwardSegs) { - var objs = forwardSegs.map(buildTimeGridSegCompareObj); - var specs = [ - // put higher-pressure first - { field: 'forwardPressure', order: -1 }, - // put segments that are closer to initial edge first (and favor ones with no coords yet) - { field: 'backwardCoord', order: 1 } - ].concat(this.context.eventOrderSpecs); - objs.sort(function (obj0, obj1) { - return core.compareByFieldSpecs(obj0, obj1, specs); - }); - return objs.map(function (c) { - return c._seg; - }); - }; - // Given foreground event segments that have already had their position coordinates computed, - // assigns position-related CSS values to their elements. - TimeGridEventRenderer.prototype.assignSegCss = function (segs) { - for (var _i = 0, segs_1 = segs; _i < segs_1.length; _i++) { - var seg = segs_1[_i]; - core.applyStyle(seg.el, this.generateSegCss(seg)); - if (seg.level > 0) { - seg.el.classList.add('fc-time-grid-event-inset'); - } - // if the event is short that the title will be cut off, - // attach a className that condenses the title into the time area. - if (seg.eventRange.def.title && seg.bottom - seg.top < 30) { - seg.el.classList.add('fc-short'); // TODO: "condensed" is a better name - } - } - }; - // Generates an object with CSS properties/values that should be applied to an event segment element. - // Contains important positioning-related properties that should be applied to any event element, customized or not. - TimeGridEventRenderer.prototype.generateSegCss = function (seg) { - var shouldOverlap = this.context.options.slotEventOverlap; - var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point - var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point - var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first - var isRtl = this.context.isRtl; - var left; // amount of space from left edge, a fraction of the total width - var right; // amount of space from right edge, a fraction of the total width - if (shouldOverlap) { - // double the width, but don't go beyond the maximum forward coordinate (1.0) - forwardCoord = Math.min(1, backwardCoord + (forwardCoord - backwardCoord) * 2); - } - if (isRtl) { - left = 1 - forwardCoord; - right = backwardCoord; - } - else { - left = backwardCoord; - right = 1 - forwardCoord; - } - props.zIndex = seg.level + 1; // convert from 0-base to 1-based - props.left = left * 100 + '%'; - props.right = right * 100 + '%'; - if (shouldOverlap && seg.forwardPressure) { - // add padding to the edge so that forward stacked events don't cover the resizer's icon - props[isRtl ? 'marginLeft' : 'marginRight'] = 10 * 2; // 10 is a guesstimate of the icon's width - } - return props; - }; - return TimeGridEventRenderer; - }(core.FgEventRenderer)); - // Builds an array of segments "levels". The first level will be the leftmost tier of segments if the calendar is - // left-to-right, or the rightmost if the calendar is right-to-left. Assumes the segments are already ordered by date. - function buildSlotSegLevels(segs) { - var levels = []; - var i; - var seg; - var j; - for (i = 0; i < segs.length; i++) { - seg = segs[i]; - // go through all the levels and stop on the first level where there are no collisions - for (j = 0; j < levels.length; j++) { - if (!computeSlotSegCollisions(seg, levels[j]).length) { - break; - } - } - seg.level = j; - (levels[j] || (levels[j] = [])).push(seg); - } - return levels; - } - // For every segment, figure out the other segments that are in subsequent - // levels that also occupy the same vertical space. Accumulate in seg.forwardSegs - function computeForwardSlotSegs(levels) { - var i; - var level; - var j; - var seg; - var k; - for (i = 0; i < levels.length; i++) { - level = levels[i]; - for (j = 0; j < level.length; j++) { - seg = level[j]; - seg.forwardSegs = []; - for (k = i + 1; k < levels.length; k++) { - computeSlotSegCollisions(seg, levels[k], seg.forwardSegs); - } - } - } - } - // Figure out which path forward (via seg.forwardSegs) results in the longest path until - // the furthest edge is reached. The number of segments in this path will be seg.forwardPressure - function computeSlotSegPressures(seg) { - var forwardSegs = seg.forwardSegs; - var forwardPressure = 0; - var i; - var forwardSeg; - if (seg.forwardPressure === undefined) { // not already computed - for (i = 0; i < forwardSegs.length; i++) { - forwardSeg = forwardSegs[i]; - // figure out the child's maximum forward path - computeSlotSegPressures(forwardSeg); - // either use the existing maximum, or use the child's forward pressure - // plus one (for the forwardSeg itself) - forwardPressure = Math.max(forwardPressure, 1 + forwardSeg.forwardPressure); - } - seg.forwardPressure = forwardPressure; - } - } - // Find all the segments in `otherSegs` that vertically collide with `seg`. - // Append into an optionally-supplied `results` array and return. - function computeSlotSegCollisions(seg, otherSegs, results) { - if (results === void 0) { results = []; } - for (var i = 0; i < otherSegs.length; i++) { - if (isSlotSegCollision(seg, otherSegs[i])) { - results.push(otherSegs[i]); - } - } - return results; - } - // Do these segments occupy the same vertical space? - function isSlotSegCollision(seg1, seg2) { - return seg1.bottom > seg2.top && seg1.top < seg2.bottom; - } - function buildTimeGridSegCompareObj(seg) { - var obj = core.buildSegCompareObj(seg); - obj.forwardPressure = seg.forwardPressure; - obj.backwardCoord = seg.backwardCoord; - return obj; - } - - var TimeGridMirrorRenderer = /** @class */ (function (_super) { - __extends(TimeGridMirrorRenderer, _super); - function TimeGridMirrorRenderer() { - return _super !== null && _super.apply(this, arguments) || this; - } - TimeGridMirrorRenderer.prototype.attachSegs = function (segs, mirrorInfo) { - this.segsByCol = this.timeGrid.groupSegsByCol(segs); - this.timeGrid.attachSegsByCol(this.segsByCol, this.timeGrid.mirrorContainerEls); - this.sourceSeg = mirrorInfo.sourceSeg; - }; - TimeGridMirrorRenderer.prototype.generateSegCss = function (seg) { - var props = _super.prototype.generateSegCss.call(this, seg); - var sourceSeg = this.sourceSeg; - if (sourceSeg && sourceSeg.col === seg.col) { - var sourceSegProps = _super.prototype.generateSegCss.call(this, sourceSeg); - props.left = sourceSegProps.left; - props.right = sourceSegProps.right; - props.marginLeft = sourceSegProps.marginLeft; - props.marginRight = sourceSegProps.marginRight; - } - return props; - }; - return TimeGridMirrorRenderer; - }(TimeGridEventRenderer)); - - var TimeGridFillRenderer = /** @class */ (function (_super) { - __extends(TimeGridFillRenderer, _super); - function TimeGridFillRenderer(timeGrid) { - var _this = _super.call(this) || this; - _this.timeGrid = timeGrid; - return _this; - } - TimeGridFillRenderer.prototype.attachSegs = function (type, segs) { - var timeGrid = this.timeGrid; - var containerEls; - // TODO: more efficient lookup - if (type === 'bgEvent') { - containerEls = timeGrid.bgContainerEls; - } - else if (type === 'businessHours') { - containerEls = timeGrid.businessContainerEls; - } - else if (type === 'highlight') { - containerEls = timeGrid.highlightContainerEls; - } - timeGrid.attachSegsByCol(timeGrid.groupSegsByCol(segs), containerEls); - return segs.map(function (seg) { - return seg.el; - }); - }; - TimeGridFillRenderer.prototype.computeSegSizes = function (segs) { - this.timeGrid.computeSegVerticals(segs); - }; - TimeGridFillRenderer.prototype.assignSegSizes = function (segs) { - this.timeGrid.assignSegVerticals(segs); - }; - return TimeGridFillRenderer; - }(core.FillRenderer)); - - /* A component that renders one or more columns of vertical time slots - ----------------------------------------------------------------------------------------------------------------------*/ - // potential nice values for the slot-duration and interval-duration - // from largest to smallest - var AGENDA_STOCK_SUB_DURATIONS = [ - { hours: 1 }, - { minutes: 30 }, - { minutes: 15 }, - { seconds: 30 }, - { seconds: 15 } - ]; - var TimeGrid = /** @class */ (function (_super) { - __extends(TimeGrid, _super); - function TimeGrid(el, renderProps) { - var _this = _super.call(this, el) || this; - _this.isSlatSizesDirty = false; - _this.isColSizesDirty = false; - _this.processOptions = core.memoize(_this._processOptions); - _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton); - _this.renderSlats = core.memoizeRendering(_this._renderSlats, null, [_this.renderSkeleton]); - _this.renderColumns = core.memoizeRendering(_this._renderColumns, _this._unrenderColumns, [_this.renderSkeleton]); - _this.renderProps = renderProps; - var renderColumns = _this.renderColumns; - var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this); - var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this); - _this.mirrorRenderer = new TimeGridMirrorRenderer(_this); - _this.renderBusinessHours = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]); - _this.renderDateSelection = core.memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]); - _this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]); - _this.renderBgEvents = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'bgEvent'), fillRenderer.unrender.bind(fillRenderer, 'bgEvent'), [renderColumns]); - _this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]); - _this.renderEventDrag = core.memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]); - _this.renderEventResize = core.memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]); - return _this; - } - /* Options - ------------------------------------------------------------------------------------------------------------------*/ - // Parses various options into properties of this object - // MUST have context already set - TimeGrid.prototype._processOptions = function (options) { - var slotDuration = options.slotDuration, snapDuration = options.snapDuration; - var snapsPerSlot; - var input; - slotDuration = core.createDuration(slotDuration); - snapDuration = snapDuration ? core.createDuration(snapDuration) : slotDuration; - snapsPerSlot = core.wholeDivideDurations(slotDuration, snapDuration); - if (snapsPerSlot === null) { - snapDuration = slotDuration; - snapsPerSlot = 1; - // TODO: say warning? - } - this.slotDuration = slotDuration; - this.snapDuration = snapDuration; - this.snapsPerSlot = snapsPerSlot; - // might be an array value (for TimelineView). - // if so, getting the most granular entry (the last one probably). - input = options.slotLabelFormat; - if (Array.isArray(input)) { - input = input[input.length - 1]; - } - this.labelFormat = core.createFormatter(input || { - hour: 'numeric', - minute: '2-digit', - omitZeroMinute: true, - meridiem: 'short' - }); - input = options.slotLabelInterval; - this.labelInterval = input ? - core.createDuration(input) : - this.computeLabelInterval(slotDuration); - }; - // Computes an automatic value for slotLabelInterval - TimeGrid.prototype.computeLabelInterval = function (slotDuration) { - var i; - var labelInterval; - var slotsPerLabel; - // find the smallest stock label interval that results in more than one slots-per-label - for (i = AGENDA_STOCK_SUB_DURATIONS.length - 1; i >= 0; i--) { - labelInterval = core.createDuration(AGENDA_STOCK_SUB_DURATIONS[i]); - slotsPerLabel = core.wholeDivideDurations(labelInterval, slotDuration); - if (slotsPerLabel !== null && slotsPerLabel > 1) { - return labelInterval; - } - } - return slotDuration; // fall back - }; - /* Rendering - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.render = function (props, context) { - this.processOptions(context.options); - var cells = props.cells; - this.colCnt = cells.length; - this.renderSkeleton(context.theme); - this.renderSlats(props.dateProfile); - this.renderColumns(props.cells, props.dateProfile); - this.renderBusinessHours(context, props.businessHourSegs); - this.renderDateSelection(props.dateSelectionSegs); - this.renderFgEvents(context, props.fgEventSegs); - this.renderBgEvents(context, props.bgEventSegs); - this.renderEventSelection(props.eventSelection); - this.renderEventDrag(props.eventDrag); - this.renderEventResize(props.eventResize); - }; - TimeGrid.prototype.destroy = function () { - _super.prototype.destroy.call(this); - // should unrender everything else too - this.renderSlats.unrender(); - this.renderColumns.unrender(); - this.renderSkeleton.unrender(); - }; - TimeGrid.prototype.updateSize = function (isResize) { - var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer; - if (isResize || this.isSlatSizesDirty) { - this.buildSlatPositions(); - this.isSlatSizesDirty = false; - } - if (isResize || this.isColSizesDirty) { - this.buildColPositions(); - this.isColSizesDirty = false; - } - fillRenderer.computeSizes(isResize); - eventRenderer.computeSizes(isResize); - mirrorRenderer.computeSizes(isResize); - fillRenderer.assignSizes(isResize); - eventRenderer.assignSizes(isResize); - mirrorRenderer.assignSizes(isResize); - }; - TimeGrid.prototype._renderSkeleton = function (theme) { - var el = this.el; - el.innerHTML = - '<div class="fc-bg"></div>' + - '<div class="fc-slats"></div>' + - '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" style="display:none" />'; - this.rootBgContainerEl = el.querySelector('.fc-bg'); - this.slatContainerEl = el.querySelector('.fc-slats'); - this.bottomRuleEl = el.querySelector('.fc-divider'); - }; - TimeGrid.prototype._renderSlats = function (dateProfile) { - var theme = this.context.theme; - this.slatContainerEl.innerHTML = - '<table class="' + theme.getClass('tableGrid') + '">' + - this.renderSlatRowHtml(dateProfile) + - '</table>'; - this.slatEls = core.findElements(this.slatContainerEl, 'tr'); - this.slatPositions = new core.PositionCache(this.el, this.slatEls, false, true // vertical - ); - this.isSlatSizesDirty = true; - }; - // Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL. - TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) { - var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl; - var html = ''; - var dayStart = core.startOfDay(dateProfile.renderRange.start); - var slotTime = dateProfile.minTime; - var slotIterator = core.createDuration(0); - var slotDate; // will be on the view's first day, but we only care about its time - var isLabeled; - var axisHtml; - // Calculate the time for each slot - while (core.asRoughMs(slotTime) < core.asRoughMs(dateProfile.maxTime)) { - slotDate = dateEnv.add(dayStart, slotTime); - isLabeled = core.wholeDivideDurations(slotIterator, this.labelInterval) !== null; - axisHtml = - '<td class="fc-axis fc-time ' + theme.getClass('widgetContent') + '">' + - (isLabeled ? - '<span>' + // for matchCellWidths - core.htmlEscape(dateEnv.format(slotDate, this.labelFormat)) + - '</span>' : - '') + - '</td>'; - html += - '<tr data-time="' + core.formatIsoTimeString(slotDate) + '"' + - (isLabeled ? '' : ' class="fc-minor"') + - '>' + - (!isRtl ? axisHtml : '') + - '<td class="' + theme.getClass('widgetContent') + '"></td>' + - (isRtl ? axisHtml : '') + - '</tr>'; - slotTime = core.addDurations(slotTime, this.slotDuration); - slotIterator = core.addDurations(slotIterator, this.slotDuration); - } - return html; - }; - TimeGrid.prototype._renderColumns = function (cells, dateProfile) { - var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, theme = _a.theme, dateEnv = _a.dateEnv; - var bgRow = new daygrid.DayBgRow(this.context); - this.rootBgContainerEl.innerHTML = - '<table class="' + theme.getClass('tableGrid') + '">' + - bgRow.renderHtml({ - cells: cells, - dateProfile: dateProfile, - renderIntroHtml: this.renderProps.renderBgIntroHtml - }) + - '</table>'; - this.colEls = core.findElements(this.el, '.fc-day, .fc-disabled-day'); - for (var col = 0; col < this.colCnt; col++) { - calendar.publiclyTrigger('dayRender', [ - { - date: dateEnv.toDate(cells[col].date), - el: this.colEls[col], - view: view - } - ]); - } - if (isRtl) { - this.colEls.reverse(); - } - this.colPositions = new core.PositionCache(this.el, this.colEls, true, // horizontal - false); - this.renderContentSkeleton(); - this.isColSizesDirty = true; - }; - TimeGrid.prototype._unrenderColumns = function () { - this.unrenderContentSkeleton(); - }; - /* Content Skeleton - ------------------------------------------------------------------------------------------------------------------*/ - // Renders the DOM that the view's content will live in - TimeGrid.prototype.renderContentSkeleton = function () { - var isRtl = this.context.isRtl; - var parts = []; - var skeletonEl; - parts.push(this.renderProps.renderIntroHtml()); - for (var i = 0; i < this.colCnt; i++) { - parts.push('<td>' + - '<div class="fc-content-col">' + - '<div class="fc-event-container fc-mirror-container"></div>' + - '<div class="fc-event-container"></div>' + - '<div class="fc-highlight-container"></div>' + - '<div class="fc-bgevent-container"></div>' + - '<div class="fc-business-container"></div>' + - '</div>' + - '</td>'); - } - if (isRtl) { - parts.reverse(); - } - skeletonEl = this.contentSkeletonEl = core.htmlToElement('<div class="fc-content-skeleton">' + - '<table>' + - '<tr>' + parts.join('') + '</tr>' + - '</table>' + - '</div>'); - this.colContainerEls = core.findElements(skeletonEl, '.fc-content-col'); - this.mirrorContainerEls = core.findElements(skeletonEl, '.fc-mirror-container'); - this.fgContainerEls = core.findElements(skeletonEl, '.fc-event-container:not(.fc-mirror-container)'); - this.bgContainerEls = core.findElements(skeletonEl, '.fc-bgevent-container'); - this.highlightContainerEls = core.findElements(skeletonEl, '.fc-highlight-container'); - this.businessContainerEls = core.findElements(skeletonEl, '.fc-business-container'); - if (isRtl) { - this.colContainerEls.reverse(); - this.mirrorContainerEls.reverse(); - this.fgContainerEls.reverse(); - this.bgContainerEls.reverse(); - this.highlightContainerEls.reverse(); - this.businessContainerEls.reverse(); - } - this.el.appendChild(skeletonEl); - }; - TimeGrid.prototype.unrenderContentSkeleton = function () { - core.removeElement(this.contentSkeletonEl); - }; - // Given a flat array of segments, return an array of sub-arrays, grouped by each segment's col - TimeGrid.prototype.groupSegsByCol = function (segs) { - var segsByCol = []; - var i; - for (i = 0; i < this.colCnt; i++) { - segsByCol.push([]); - } - for (i = 0; i < segs.length; i++) { - segsByCol[segs[i].col].push(segs[i]); - } - return segsByCol; - }; - // Given segments grouped by column, insert the segments' elements into a parallel array of container - // elements, each living within a column. - TimeGrid.prototype.attachSegsByCol = function (segsByCol, containerEls) { - var col; - var segs; - var i; - for (col = 0; col < this.colCnt; col++) { // iterate each column grouping - segs = segsByCol[col]; - for (i = 0; i < segs.length; i++) { - containerEls[col].appendChild(segs[i].el); - } - } - }; - /* Now Indicator - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.getNowIndicatorUnit = function () { - return 'minute'; // will refresh on the minute - }; - TimeGrid.prototype.renderNowIndicator = function (segs, date) { - // HACK: if date columns not ready for some reason (scheduler) - if (!this.colContainerEls) { - return; - } - var top = this.computeDateTop(date); - var nodes = []; - var i; - // render lines within the columns - for (i = 0; i < segs.length; i++) { - var lineEl = core.createElement('div', { className: 'fc-now-indicator fc-now-indicator-line' }); - lineEl.style.top = top + 'px'; - this.colContainerEls[segs[i].col].appendChild(lineEl); - nodes.push(lineEl); - } - // render an arrow over the axis - if (segs.length > 0) { // is the current time in view? - var arrowEl = core.createElement('div', { className: 'fc-now-indicator fc-now-indicator-arrow' }); - arrowEl.style.top = top + 'px'; - this.contentSkeletonEl.appendChild(arrowEl); - nodes.push(arrowEl); - } - this.nowIndicatorEls = nodes; - }; - TimeGrid.prototype.unrenderNowIndicator = function () { - if (this.nowIndicatorEls) { - this.nowIndicatorEls.forEach(core.removeElement); - this.nowIndicatorEls = null; - } - }; - /* Coordinates - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.getTotalSlatHeight = function () { - return this.slatContainerEl.getBoundingClientRect().height; - }; - // Computes the top coordinate, relative to the bounds of the grid, of the given date. - // A `startOfDayDate` must be given for avoiding ambiguity over how to treat midnight. - TimeGrid.prototype.computeDateTop = function (when, startOfDayDate) { - if (!startOfDayDate) { - startOfDayDate = core.startOfDay(when); - } - return this.computeTimeTop(core.createDuration(when.valueOf() - startOfDayDate.valueOf())); - }; - // Computes the top coordinate, relative to the bounds of the grid, of the given time (a Duration). - TimeGrid.prototype.computeTimeTop = function (duration) { - var len = this.slatEls.length; - var dateProfile = this.props.dateProfile; - var slatCoverage = (duration.milliseconds - core.asRoughMs(dateProfile.minTime)) / core.asRoughMs(this.slotDuration); // floating-point value of # of slots covered - var slatIndex; - var slatRemainder; - // compute a floating-point number for how many slats should be progressed through. - // from 0 to number of slats (inclusive) - // constrained because minTime/maxTime might be customized. - slatCoverage = Math.max(0, slatCoverage); - slatCoverage = Math.min(len, slatCoverage); - // an integer index of the furthest whole slat - // from 0 to number slats (*exclusive*, so len-1) - slatIndex = Math.floor(slatCoverage); - slatIndex = Math.min(slatIndex, len - 1); - // how much further through the slatIndex slat (from 0.0-1.0) must be covered in addition. - // could be 1.0 if slatCoverage is covering *all* the slots - slatRemainder = slatCoverage - slatIndex; - return this.slatPositions.tops[slatIndex] + - this.slatPositions.getHeight(slatIndex) * slatRemainder; - }; - // For each segment in an array, computes and assigns its top and bottom properties - TimeGrid.prototype.computeSegVerticals = function (segs) { - var options = this.context.options; - var eventMinHeight = options.timeGridEventMinHeight; - var i; - var seg; - var dayDate; - for (i = 0; i < segs.length; i++) { - seg = segs[i]; - dayDate = this.props.cells[seg.col].date; - seg.top = this.computeDateTop(seg.start, dayDate); - seg.bottom = Math.max(seg.top + eventMinHeight, this.computeDateTop(seg.end, dayDate)); - } - }; - // Given segments that already have their top/bottom properties computed, applies those values to - // the segments' elements. - TimeGrid.prototype.assignSegVerticals = function (segs) { - var i; - var seg; - for (i = 0; i < segs.length; i++) { - seg = segs[i]; - core.applyStyle(seg.el, this.generateSegVerticalCss(seg)); - } - }; - // Generates an object with CSS properties for the top/bottom coordinates of a segment element - TimeGrid.prototype.generateSegVerticalCss = function (seg) { - return { - top: seg.top, - bottom: -seg.bottom // flipped because needs to be space beyond bottom edge of event container - }; - }; - /* Sizing - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.buildPositionCaches = function () { - this.buildColPositions(); - this.buildSlatPositions(); - }; - TimeGrid.prototype.buildColPositions = function () { - this.colPositions.build(); - }; - TimeGrid.prototype.buildSlatPositions = function () { - this.slatPositions.build(); - }; - /* Hit System - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) { - var dateEnv = this.context.dateEnv; - var _a = this, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions; - var colIndex = colPositions.leftToIndex(positionLeft); - var slatIndex = slatPositions.topToIndex(positionTop); - if (colIndex != null && slatIndex != null) { - var slatTop = slatPositions.tops[slatIndex]; - var slatHeight = slatPositions.getHeight(slatIndex); - var partial = (positionTop - slatTop) / slatHeight; // floating point number between 0 and 1 - var localSnapIndex = Math.floor(partial * snapsPerSlot); // the snap # relative to start of slat - var snapIndex = slatIndex * snapsPerSlot + localSnapIndex; - var dayDate = this.props.cells[colIndex].date; - var time = core.addDurations(this.props.dateProfile.minTime, core.multiplyDuration(this.snapDuration, snapIndex)); - var start = dateEnv.add(dayDate, time); - var end = dateEnv.add(start, this.snapDuration); - return { - col: colIndex, - dateSpan: { - range: { start: start, end: end }, - allDay: false - }, - dayEl: this.colEls[colIndex], - relativeRect: { - left: colPositions.lefts[colIndex], - right: colPositions.rights[colIndex], - top: slatTop, - bottom: slatTop + slatHeight - } - }; - } - }; - /* Event Drag Visualization - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype._renderEventDrag = function (state) { - if (state) { - this.eventRenderer.hideByHash(state.affectedInstances); - if (state.isEvent) { - this.mirrorRenderer.renderSegs(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg }); - } - else { - this.fillRenderer.renderSegs('highlight', this.context, state.segs); - } - } - }; - TimeGrid.prototype._unrenderEventDrag = function (state) { - if (state) { - this.eventRenderer.showByHash(state.affectedInstances); - if (state.isEvent) { - this.mirrorRenderer.unrender(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg }); - } - else { - this.fillRenderer.unrender('highlight', this.context); - } - } - }; - /* Event Resize Visualization - ------------------------------------------------------------------------------------------------------------------*/ - TimeGrid.prototype._renderEventResize = function (state) { - if (state) { - this.eventRenderer.hideByHash(state.affectedInstances); - this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg }); - } - }; - TimeGrid.prototype._unrenderEventResize = function (state) { - if (state) { - this.eventRenderer.showByHash(state.affectedInstances); - this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg }); - } - }; - /* Selection - ------------------------------------------------------------------------------------------------------------------*/ - // Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight. - TimeGrid.prototype._renderDateSelection = function (segs) { - if (segs) { - if (this.context.options.selectMirror) { - this.mirrorRenderer.renderSegs(this.context, segs, { isSelecting: true }); - } - else { - this.fillRenderer.renderSegs('highlight', this.context, segs); - } - } - }; - TimeGrid.prototype._unrenderDateSelection = function (segs) { - if (segs) { - if (this.context.options.selectMirror) { - this.mirrorRenderer.unrender(this.context, segs, { isSelecting: true }); - } - else { - this.fillRenderer.unrender('highlight', this.context); - } - } - }; - return TimeGrid; - }(core.DateComponent)); - - var AllDaySplitter = /** @class */ (function (_super) { - __extends(AllDaySplitter, _super); - function AllDaySplitter() { - return _super !== null && _super.apply(this, arguments) || this; - } - AllDaySplitter.prototype.getKeyInfo = function () { - return { - allDay: {}, - timed: {} - }; - }; - AllDaySplitter.prototype.getKeysForDateSpan = function (dateSpan) { - if (dateSpan.allDay) { - return ['allDay']; - } - else { - return ['timed']; - } - }; - AllDaySplitter.prototype.getKeysForEventDef = function (eventDef) { - if (!eventDef.allDay) { - return ['timed']; - } - else if (core.hasBgRendering(eventDef)) { - return ['timed', 'allDay']; - } - else { - return ['allDay']; - } - }; - return AllDaySplitter; - }(core.Splitter)); - - var TIMEGRID_ALL_DAY_EVENT_LIMIT = 5; - var WEEK_HEADER_FORMAT = core.createFormatter({ week: 'short' }); - /* An abstract class for all timegrid-related views. Displays one more columns with time slots running vertically. - ----------------------------------------------------------------------------------------------------------------------*/ - // Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on). - // Responsible for managing width/height. - var AbstractTimeGridView = /** @class */ (function (_super) { - __extends(AbstractTimeGridView, _super); - function AbstractTimeGridView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.splitter = new AllDaySplitter(); - _this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton); - /* Header Render Methods - ------------------------------------------------------------------------------------------------------------------*/ - // Generates the HTML that will go before the day-of week header cells - _this.renderHeadIntroHtml = function () { - var _a = _this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options; - var range = _this.props.dateProfile.renderRange; - var dayCnt = core.diffDays(range.start, range.end); - var weekText; - if (options.weekNumbers) { - weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT); - return '' + - '<th class="fc-axis fc-week-number ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '>' + - core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths - options, dateEnv, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, core.htmlEscape(weekText) // inner HTML - ) + - '</th>'; - } - else { - return '<th class="fc-axis ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '></th>'; - } - }; - /* Time Grid Render Methods - ------------------------------------------------------------------------------------------------------------------*/ - // Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column. - _this.renderTimeGridBgIntroHtml = function () { - var theme = _this.context.theme; - return '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '></td>'; - }; - // Generates the HTML that goes before all other types of cells. - // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid. - _this.renderTimeGridIntroHtml = function () { - return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>'; - }; - /* Day Grid Render Methods - ------------------------------------------------------------------------------------------------------------------*/ - // Generates the HTML that goes before the all-day cells - _this.renderDayGridBgIntroHtml = function () { - var _a = _this.context, theme = _a.theme, options = _a.options; - return '' + - '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '>' + - '<span>' + // needed for matchCellWidths - core.getAllDayHtml(options) + - '</span>' + - '</td>'; - }; - // Generates the HTML that goes before all other types of cells. - // Affects content-skeleton, mirror-skeleton, highlight-skeleton for both the time-grid and day-grid. - _this.renderDayGridIntroHtml = function () { - return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>'; - }; - return _this; - } - AbstractTimeGridView.prototype.render = function (props, context) { - _super.prototype.render.call(this, props, context); - this.renderSkeleton(context); - }; - AbstractTimeGridView.prototype.destroy = function () { - _super.prototype.destroy.call(this); - this.renderSkeleton.unrender(); - }; - AbstractTimeGridView.prototype._renderSkeleton = function (context) { - this.el.classList.add('fc-timeGrid-view'); - this.el.innerHTML = this.renderSkeletonHtml(); - this.scroller = new core.ScrollComponent('hidden', // overflow x - 'auto' // overflow y - ); - var timeGridWrapEl = this.scroller.el; - this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl); - timeGridWrapEl.classList.add('fc-time-grid-container'); - var timeGridEl = core.createElement('div', { className: 'fc-time-grid' }); - timeGridWrapEl.appendChild(timeGridEl); - this.timeGrid = new TimeGrid(timeGridEl, { - renderBgIntroHtml: this.renderTimeGridBgIntroHtml, - renderIntroHtml: this.renderTimeGridIntroHtml - }); - if (context.options.allDaySlot) { // should we display the "all-day" area? - this.dayGrid = new daygrid.DayGrid(// the all-day subcomponent of this view - this.el.querySelector('.fc-day-grid'), { - renderNumberIntroHtml: this.renderDayGridIntroHtml, - renderBgIntroHtml: this.renderDayGridBgIntroHtml, - renderIntroHtml: this.renderDayGridIntroHtml, - colWeekNumbersVisible: false, - cellWeekNumbersVisible: false - }); - // have the day-grid extend it's coordinate area over the <hr> dividing the two grids - var dividerEl = this.el.querySelector('.fc-divider'); - this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height; - } - }; - AbstractTimeGridView.prototype._unrenderSkeleton = function () { - this.el.classList.remove('fc-timeGrid-view'); - this.timeGrid.destroy(); - if (this.dayGrid) { - this.dayGrid.destroy(); - } - this.scroller.destroy(); - }; - /* Rendering - ------------------------------------------------------------------------------------------------------------------*/ - // Builds the HTML skeleton for the view. - // The day-grid and time-grid components will render inside containers defined by this HTML. - AbstractTimeGridView.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') + '">' + - (options.allDaySlot ? - '<div class="fc-day-grid"></div>' + - '<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" />' : - '') + - '</td>' + - '</tr>' + - '</tbody>' + - '</table>'; - }; - /* Now Indicator - ------------------------------------------------------------------------------------------------------------------*/ - AbstractTimeGridView.prototype.getNowIndicatorUnit = function () { - return this.timeGrid.getNowIndicatorUnit(); - }; - // subclasses should implement - // renderNowIndicator(date: DateMarker) { - // } - AbstractTimeGridView.prototype.unrenderNowIndicator = function () { - this.timeGrid.unrenderNowIndicator(); - }; - /* Dimensions - ------------------------------------------------------------------------------------------------------------------*/ - AbstractTimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) { - _super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first - this.timeGrid.updateSize(isResize); - if (this.dayGrid) { - this.dayGrid.updateSize(isResize); - } - }; - // Adjusts the vertical dimensions of the view to the specified values - AbstractTimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) { - var _this = this; - var eventLimit; - var scrollerHeight; - var scrollbarWidths; - // make all axis cells line up - this.axisWidth = core.matchCellWidths(core.findElements(this.el, '.fc-axis')); - // hack to give the view some height prior to timeGrid's columns being rendered - // TODO: separate setting height from scroller VS timeGrid. - if (!this.timeGrid.colEls) { - if (!isAuto) { - scrollerHeight = this.computeScrollerHeight(viewHeight); - this.scroller.setHeight(scrollerHeight); - } - return; - } - // set of fake row elements that must compensate when scroller has scrollbars - var noScrollRowEls = core.findElements(this.el, '.fc-row').filter(function (node) { - return !_this.scroller.el.contains(node); - }); - // reset all dimensions back to the original state - this.timeGrid.bottomRuleEl.style.display = 'none'; // will be shown later if this <hr> is necessary - this.scroller.clear(); // sets height to 'auto' and clears overflow - noScrollRowEls.forEach(core.uncompensateScroll); - // limit number of events in the all-day area - if (this.dayGrid) { - this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed - eventLimit = this.context.options.eventLimit; - if (eventLimit && typeof eventLimit !== 'number') { - eventLimit = TIMEGRID_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number - } - if (eventLimit) { - this.dayGrid.limitRows(eventLimit); - } - } - if (!isAuto) { // should we force dimensions of the scroll container? - scrollerHeight = this.computeScrollerHeight(viewHeight); - this.scroller.setHeight(scrollerHeight); - scrollbarWidths = this.scroller.getScrollbarWidths(); - if (scrollbarWidths.left || scrollbarWidths.right) { // using scrollbars? - // make the all-day and header rows lines up - noScrollRowEls.forEach(function (rowEl) { - core.compensateScroll(rowEl, scrollbarWidths); - }); - // the scrollbar compensation might have changed text flow, which might affect height, so recalculate - // and reapply the desired height to the scroller. - scrollerHeight = this.computeScrollerHeight(viewHeight); - this.scroller.setHeight(scrollerHeight); - } - // guarantees the same scrollbar widths - this.scroller.lockOverflow(scrollbarWidths); - // if there's any space below the slats, show the horizontal rule. - // this won't cause any new overflow, because lockOverflow already called. - if (this.timeGrid.getTotalSlatHeight() < scrollerHeight) { - this.timeGrid.bottomRuleEl.style.display = ''; - } - } - }; - // given a desired total height of the view, returns what the height of the scroller should be - AbstractTimeGridView.prototype.computeScrollerHeight = function (viewHeight) { - return viewHeight - - core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller - }; - /* Scroll - ------------------------------------------------------------------------------------------------------------------*/ - // Computes the initial pre-configured scroll state prior to allowing the user to change it - AbstractTimeGridView.prototype.computeDateScroll = function (duration) { - var top = this.timeGrid.computeTimeTop(duration); - // zoom can give weird floating-point values. rather scroll a little bit further - top = Math.ceil(top); - if (top) { - top++; // to overcome top border that slots beyond the first have. looks better - } - return { top: top }; - }; - AbstractTimeGridView.prototype.queryDateScroll = function () { - return { top: this.scroller.getScrollTop() }; - }; - AbstractTimeGridView.prototype.applyDateScroll = function (scroll) { - if (scroll.top !== undefined) { - this.scroller.setScrollTop(scroll.top); - } - }; - // Generates an HTML attribute string for setting the width of the axis, if it is known - AbstractTimeGridView.prototype.axisStyleAttr = function () { - if (this.axisWidth != null) { - return 'style="width:' + this.axisWidth + 'px"'; - } - return ''; - }; - return AbstractTimeGridView; - }(core.View)); - AbstractTimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering - - var SimpleTimeGrid = /** @class */ (function (_super) { - __extends(SimpleTimeGrid, _super); - function SimpleTimeGrid(timeGrid) { - var _this = _super.call(this, timeGrid.el) || this; - _this.buildDayRanges = core.memoize(buildDayRanges); - _this.slicer = new TimeGridSlicer(); - _this.timeGrid = timeGrid; - return _this; - } - SimpleTimeGrid.prototype.firstContext = function (context) { - context.calendar.registerInteractiveComponent(this, { - el: this.timeGrid.el - }); - }; - SimpleTimeGrid.prototype.destroy = function () { - _super.prototype.destroy.call(this); - this.context.calendar.unregisterInteractiveComponent(this); - }; - SimpleTimeGrid.prototype.render = function (props, context) { - var dateEnv = this.context.dateEnv; - var dateProfile = props.dateProfile, dayTable = props.dayTable; - var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, dateEnv); - var timeGrid = this.timeGrid; - timeGrid.receiveContext(context); // hack because context is used in sliceProps - timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, context.calendar, timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }), context); - }; - SimpleTimeGrid.prototype.renderNowIndicator = function (date) { - this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(date, this.timeGrid, this.dayRanges), date); - }; - SimpleTimeGrid.prototype.buildPositionCaches = function () { - this.timeGrid.buildPositionCaches(); - }; - SimpleTimeGrid.prototype.queryHit = function (positionLeft, positionTop) { - var rawHit = this.timeGrid.positionToHit(positionLeft, positionTop); - if (rawHit) { - return { - component: this.timeGrid, - 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 - }; - } - }; - return SimpleTimeGrid; - }(core.DateComponent)); - function buildDayRanges(dayTable, dateProfile, dateEnv) { - var ranges = []; - for (var _i = 0, _a = dayTable.headerDates; _i < _a.length; _i++) { - var date = _a[_i]; - ranges.push({ - start: dateEnv.add(date, dateProfile.minTime), - end: dateEnv.add(date, dateProfile.maxTime) - }); - } - return ranges; - } - var TimeGridSlicer = /** @class */ (function (_super) { - __extends(TimeGridSlicer, _super); - function TimeGridSlicer() { - return _super !== null && _super.apply(this, arguments) || this; - } - TimeGridSlicer.prototype.sliceRange = function (range, dayRanges) { - var segs = []; - for (var col = 0; col < dayRanges.length; col++) { - var segRange = core.intersectRanges(range, dayRanges[col]); - if (segRange) { - segs.push({ - start: segRange.start, - end: segRange.end, - isStart: segRange.start.valueOf() === range.start.valueOf(), - isEnd: segRange.end.valueOf() === range.end.valueOf(), - col: col - }); - } - } - return segs; - }; - return TimeGridSlicer; - }(core.Slicer)); - - var TimeGridView = /** @class */ (function (_super) { - __extends(TimeGridView, _super); - function TimeGridView() { - var _this = _super !== null && _super.apply(this, arguments) || this; - _this.buildDayTable = core.memoize(buildDayTable); - return _this; - } - TimeGridView.prototype.render = function (props, context) { - _super.prototype.render.call(this, props, context); // for flags for updateSize. also _renderSkeleton/_unrenderSkeleton - var _a = this.props, dateProfile = _a.dateProfile, dateProfileGenerator = _a.dateProfileGenerator; - var nextDayThreshold = context.nextDayThreshold; - var dayTable = this.buildDayTable(dateProfile, dateProfileGenerator); - var splitProps = this.splitter.splitProps(props); - if (this.header) { - this.header.receiveProps({ - dateProfile: dateProfile, - dates: dayTable.headerDates, - datesRepDistinctDays: true, - renderIntroHtml: this.renderHeadIntroHtml - }, context); - } - this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile, - dayTable: dayTable }), context); - if (this.simpleDayGrid) { - this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile, - dayTable: dayTable, - nextDayThreshold: nextDayThreshold, isRigid: false }), context); - } - this.startNowIndicator(dateProfile, dateProfileGenerator); - }; - TimeGridView.prototype._renderSkeleton = function (context) { - _super.prototype._renderSkeleton.call(this, context); - if (context.options.columnHeader) { - this.header = new core.DayHeader(this.el.querySelector('.fc-head-container')); - } - this.simpleTimeGrid = new SimpleTimeGrid(this.timeGrid); - if (this.dayGrid) { - this.simpleDayGrid = new daygrid.SimpleDayGrid(this.dayGrid); - } - }; - TimeGridView.prototype._unrenderSkeleton = function () { - _super.prototype._unrenderSkeleton.call(this); - if (this.header) { - this.header.destroy(); - } - this.simpleTimeGrid.destroy(); - if (this.simpleDayGrid) { - this.simpleDayGrid.destroy(); - } - }; - TimeGridView.prototype.renderNowIndicator = function (date) { - this.simpleTimeGrid.renderNowIndicator(date); - }; - return TimeGridView; - }(AbstractTimeGridView)); - function buildDayTable(dateProfile, dateProfileGenerator) { - var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator); - return new core.DayTable(daySeries, false); - } - - var main = core.createPlugin({ - defaultView: 'timeGridWeek', - views: { - timeGrid: { - class: TimeGridView, - allDaySlot: true, - slotDuration: '00:30:00', - slotEventOverlap: true // a bad name. confused with overlap/constraint system - }, - timeGridDay: { - type: 'timeGrid', - duration: { days: 1 } - }, - timeGridWeek: { - type: 'timeGrid', - duration: { weeks: 1 } - } - } - }); - - exports.AbstractTimeGridView = AbstractTimeGridView; - exports.TimeGrid = TimeGrid; - exports.TimeGridSlicer = TimeGridSlicer; - exports.TimeGridView = TimeGridView; - exports.buildDayRanges = buildDayRanges; - exports.buildDayTable = buildDayTable; - exports.default = main; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/library/fullcalendar/packages/timegrid/main.min.css b/library/fullcalendar/packages/timegrid/main.min.css deleted file mode 100644 index a1abf91f5..000000000 --- a/library/fullcalendar/packages/timegrid/main.min.css +++ /dev/null @@ -1 +0,0 @@ -@charset "UTF-8";.fc-timeGrid-view .fc-day-grid{position:relative;z-index:2}.fc-timeGrid-view .fc-day-grid .fc-row{min-height:3em}.fc-timeGrid-view .fc-day-grid .fc-row .fc-content-skeleton{padding-bottom:1em}.fc .fc-axis{vertical-align:middle;padding:0 4px;white-space:nowrap}.fc-ltr .fc-axis{text-align:right}.fc-rtl .fc-axis{text-align:left}.fc-time-grid,.fc-time-grid-container{position:relative;z-index:1}.fc-time-grid{min-height:100%}.fc-time-grid table{border:0 hidden transparent}.fc-time-grid>.fc-bg{z-index:1}.fc-time-grid .fc-slats,.fc-time-grid>hr{position:relative;z-index:2}.fc-time-grid .fc-content-col{position:relative}.fc-time-grid .fc-content-skeleton{position:absolute;z-index:3;top:0;left:0;right:0}.fc-time-grid .fc-business-container{position:relative;z-index:1}.fc-time-grid .fc-bgevent-container{position:relative;z-index:2}.fc-time-grid .fc-highlight-container{z-index:3;position:relative}.fc-time-grid .fc-event-container{position:relative;z-index:4}.fc-time-grid .fc-now-indicator-line{z-index:5}.fc-time-grid .fc-mirror-container{position:relative;z-index:6}.fc-time-grid .fc-slats td{height:1.5em;border-bottom:0}.fc-time-grid .fc-slats .fc-minor td{border-top-style:dotted}.fc-time-grid .fc-highlight{position:absolute;left:0;right:0}.fc-ltr .fc-time-grid .fc-event-container{margin:0 2.5% 0 2px}.fc-rtl .fc-time-grid .fc-event-container{margin:0 2px 0 2.5%}.fc-time-grid .fc-bgevent,.fc-time-grid .fc-event{position:absolute;z-index:1}.fc-time-grid .fc-bgevent{left:0;right:0}.fc-time-grid-event{margin-bottom:1px}.fc-time-grid-event-inset{-webkit-box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px #fff}.fc-time-grid-event.fc-not-start{border-top-width:0;padding-top:1px;border-top-left-radius:0;border-top-right-radius:0}.fc-time-grid-event.fc-not-end{border-bottom-width:0;padding-bottom:1px;border-bottom-left-radius:0;border-bottom-right-radius:0}.fc-time-grid-event .fc-content{overflow:hidden;max-height:100%}.fc-time-grid-event .fc-time,.fc-time-grid-event .fc-title{padding:0 1px}.fc-time-grid-event .fc-time{font-size:.85em;white-space:nowrap}.fc-time-grid-event.fc-short .fc-content{white-space:nowrap}.fc-time-grid-event.fc-short .fc-time,.fc-time-grid-event.fc-short .fc-title{display:inline-block;vertical-align:top}.fc-time-grid-event.fc-short .fc-time span{display:none}.fc-time-grid-event.fc-short .fc-time:before{content:attr(data-start)}.fc-time-grid-event.fc-short .fc-time:after{content:" - "}.fc-time-grid-event.fc-short .fc-title{font-size:.85em;padding:0}.fc-time-grid-event.fc-allow-mouse-resize .fc-resizer{left:0;right:0;bottom:0;height:8px;overflow:hidden;line-height:8px;font-size:11px;font-family:monospace;text-align:center;cursor:s-resize}.fc-time-grid-event.fc-allow-mouse-resize .fc-resizer:after{content:"="}.fc-time-grid-event.fc-selected .fc-resizer{border-radius:5px;border-width:1px;width:8px;height:8px;border-style:solid;border-color:inherit;background:#fff;left:50%;margin-left:-5px;bottom:-5px}.fc-time-grid .fc-now-indicator-line{border-top-width:1px;left:0;right:0}.fc-time-grid .fc-now-indicator-arrow{margin-top:-5px}.fc-ltr .fc-time-grid .fc-now-indicator-arrow{left:0;border-width:5px 0 5px 6px;border-top-color:transparent;border-bottom-color:transparent}.fc-rtl .fc-time-grid .fc-now-indicator-arrow{right:0;border-width:5px 6px 5px 0;border-top-color:transparent;border-bottom-color:transparent}
\ No newline at end of file diff --git a/library/fullcalendar/packages/timegrid/main.min.js b/library/fullcalendar/packages/timegrid/main.min.js deleted file mode 100644 index 106940ffa..000000000 --- a/library/fullcalendar/packages/timegrid/main.min.js +++ /dev/null @@ -1,6 +0,0 @@ -/*! -FullCalendar Time Grid Plugin v4.4.2 -Docs & License: https://fullcalendar.io/ -(c) 2019 Adam Shaw -*/ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@fullcalendar/core"),require("@fullcalendar/daygrid")):"function"==typeof define&&define.amd?define(["exports","@fullcalendar/core","@fullcalendar/daygrid"],t):t((e=e||self).FullCalendarTimeGrid={},e.FullCalendar,e.FullCalendarDayGrid)}(this,(function(e,t,r){"use strict";var i=function(e,t){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function n(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)},s=function(e){function r(t){var r=e.call(this)||this;return r.timeGrid=t,r}return n(r,e),r.prototype.renderSegs=function(r,i,n){e.prototype.renderSegs.call(this,r,i,n),this.fullTimeFormat=t.createFormatter({hour:"numeric",minute:"2-digit",separator:this.context.options.defaultRangeSeparator})},r.prototype.attachSegs=function(e,t){for(var r=this.timeGrid.groupSegsByCol(e),i=0;i<r.length;i++)r[i]=this.sortEventSegs(r[i]);this.segsByCol=r,this.timeGrid.attachSegsByCol(r,this.timeGrid.fgContainerEls)},r.prototype.detachSegs=function(e){e.forEach((function(e){t.removeElement(e.el)})),this.segsByCol=null},r.prototype.computeSegSizes=function(e){var t=this.timeGrid,r=this.segsByCol,i=t.colCnt;if(t.computeSegVerticals(e),r)for(var n=0;n<i;n++)this.computeSegHorizontals(r[n])},r.prototype.assignSegSizes=function(e){var t=this.timeGrid,r=this.segsByCol,i=t.colCnt;if(t.assignSegVerticals(e),r)for(var n=0;n<i;n++)this.assignSegCss(r[n])},r.prototype.computeEventTimeFormat=function(){return{hour:"numeric",minute:"2-digit",meridiem:!1}},r.prototype.computeDisplayEventEnd=function(){return!0},r.prototype.renderSegHtml=function(e,r){var i,n,o,s=e.eventRange,a=s.def,l=s.ui,d=a.allDay,c=t.computeEventDraggable(this.context,a,l),h=e.isStart&&t.computeEventStartResizable(this.context,a,l),u=e.isEnd&&t.computeEventEndResizable(this.context,a,l),p=this.getSegClasses(e,c,h||u,r),f=t.cssToStr(this.getSkinCss(l));if(p.unshift("fc-time-grid-event"),t.isMultiDayRange(s.range)){if(e.isStart||e.isEnd){var g=e.start,m=e.end;i=this._getTimeText(g,m,d),n=this._getTimeText(g,m,d,this.fullTimeFormat),o=this._getTimeText(g,m,d,null,!1)}}else i=this.getTimeText(s),n=this.getTimeText(s,this.fullTimeFormat),o=this.getTimeText(s,null,!1);return'<a class="'+p.join(" ")+'"'+(a.url?' href="'+t.htmlEscape(a.url)+'"':"")+(f?' style="'+f+'"':"")+'><div class="fc-content">'+(i?'<div class="fc-time" data-start="'+t.htmlEscape(o)+'" data-full="'+t.htmlEscape(n)+'"><span>'+t.htmlEscape(i)+"</span></div>":"")+(a.title?'<div class="fc-title">'+t.htmlEscape(a.title)+"</div>":"")+"</div>"+(u?'<div class="fc-resizer fc-end-resizer"></div>':"")+"</a>"},r.prototype.computeSegHorizontals=function(e){var t,r,i;if(function(e){var t,r,i,n,o;for(t=0;t<e.length;t++)for(r=e[t],i=0;i<r.length;i++)for((n=r[i]).forwardSegs=[],o=t+1;o<e.length;o++)l(n,e[o],n.forwardSegs)}(t=function(e){var t,r,i,n=[];for(t=0;t<e.length;t++){for(r=e[t],i=0;i<n.length&&l(r,n[i]).length;i++);r.level=i,(n[i]||(n[i]=[])).push(r)}return n}(e)),r=t[0]){for(i=0;i<r.length;i++)a(r[i]);for(i=0;i<r.length;i++)this.computeSegForwardBack(r[i],0,0)}},r.prototype.computeSegForwardBack=function(e,t,r){var i,n=e.forwardSegs;if(void 0===e.forwardCoord)for(n.length?(this.sortForwardSegs(n),this.computeSegForwardBack(n[0],t+1,r),e.forwardCoord=n[0].backwardCoord):e.forwardCoord=1,e.backwardCoord=e.forwardCoord-(e.forwardCoord-r)/(t+1),i=0;i<n.length;i++)this.computeSegForwardBack(n[i],0,e.forwardCoord)},r.prototype.sortForwardSegs=function(e){var r=e.map(d),i=[{field:"forwardPressure",order:-1},{field:"backwardCoord",order:1}].concat(this.context.eventOrderSpecs);return r.sort((function(e,r){return t.compareByFieldSpecs(e,r,i)})),r.map((function(e){return e._seg}))},r.prototype.assignSegCss=function(e){for(var r=0,i=e;r<i.length;r++){var n=i[r];t.applyStyle(n.el,this.generateSegCss(n)),n.level>0&&n.el.classList.add("fc-time-grid-event-inset"),n.eventRange.def.title&&n.bottom-n.top<30&&n.el.classList.add("fc-short")}},r.prototype.generateSegCss=function(e){var t,r,i=this.context.options.slotEventOverlap,n=e.backwardCoord,o=e.forwardCoord,s=this.timeGrid.generateSegVerticalCss(e),a=this.context.isRtl;return i&&(o=Math.min(1,n+2*(o-n))),a?(t=1-o,r=n):(t=n,r=1-o),s.zIndex=e.level+1,s.left=100*t+"%",s.right=100*r+"%",i&&e.forwardPressure&&(s[a?"marginLeft":"marginRight"]=20),s},r}(t.FgEventRenderer);function a(e){var t,r,i=e.forwardSegs,n=0;if(void 0===e.forwardPressure){for(t=0;t<i.length;t++)a(r=i[t]),n=Math.max(n,1+r.forwardPressure);e.forwardPressure=n}}function l(e,t,r){void 0===r&&(r=[]);for(var i=0;i<t.length;i++)n=e,o=t[i],n.bottom>o.top&&n.top<o.bottom&&r.push(t[i]);var n,o;return r}function d(e){var r=t.buildSegCompareObj(e);return r.forwardPressure=e.forwardPressure,r.backwardCoord=e.backwardCoord,r}var c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.attachSegs=function(e,t){this.segsByCol=this.timeGrid.groupSegsByCol(e),this.timeGrid.attachSegsByCol(this.segsByCol,this.timeGrid.mirrorContainerEls),this.sourceSeg=t.sourceSeg},t.prototype.generateSegCss=function(t){var r=e.prototype.generateSegCss.call(this,t),i=this.sourceSeg;if(i&&i.col===t.col){var n=e.prototype.generateSegCss.call(this,i);r.left=n.left,r.right=n.right,r.marginLeft=n.marginLeft,r.marginRight=n.marginRight}return r},t}(s),h=function(e){function t(t){var r=e.call(this)||this;return r.timeGrid=t,r}return n(t,e),t.prototype.attachSegs=function(e,t){var r,i=this.timeGrid;return"bgEvent"===e?r=i.bgContainerEls:"businessHours"===e?r=i.businessContainerEls:"highlight"===e&&(r=i.highlightContainerEls),i.attachSegsByCol(i.groupSegsByCol(t),r),t.map((function(e){return e.el}))},t.prototype.computeSegSizes=function(e){this.timeGrid.computeSegVerticals(e)},t.prototype.assignSegSizes=function(e){this.timeGrid.assignSegVerticals(e)},t}(t.FillRenderer),u=[{hours:1},{minutes:30},{minutes:15},{seconds:30},{seconds:15}],p=function(e){function i(r,i){var n=e.call(this,r)||this;n.isSlatSizesDirty=!1,n.isColSizesDirty=!1,n.processOptions=t.memoize(n._processOptions),n.renderSkeleton=t.memoizeRendering(n._renderSkeleton),n.renderSlats=t.memoizeRendering(n._renderSlats,null,[n.renderSkeleton]),n.renderColumns=t.memoizeRendering(n._renderColumns,n._unrenderColumns,[n.renderSkeleton]),n.renderProps=i;var o=n.renderColumns,a=n.eventRenderer=new s(n),l=n.fillRenderer=new h(n);return n.mirrorRenderer=new c(n),n.renderBusinessHours=t.memoizeRendering(l.renderSegs.bind(l,"businessHours"),l.unrender.bind(l,"businessHours"),[o]),n.renderDateSelection=t.memoizeRendering(n._renderDateSelection,n._unrenderDateSelection,[o]),n.renderFgEvents=t.memoizeRendering(a.renderSegs.bind(a),a.unrender.bind(a),[o]),n.renderBgEvents=t.memoizeRendering(l.renderSegs.bind(l,"bgEvent"),l.unrender.bind(l,"bgEvent"),[o]),n.renderEventSelection=t.memoizeRendering(a.selectByInstanceId.bind(a),a.unselectByInstanceId.bind(a),[n.renderFgEvents]),n.renderEventDrag=t.memoizeRendering(n._renderEventDrag,n._unrenderEventDrag,[o]),n.renderEventResize=t.memoizeRendering(n._renderEventResize,n._unrenderEventResize,[o]),n}return n(i,e),i.prototype._processOptions=function(e){var r,i,n=e.slotDuration,o=e.snapDuration;n=t.createDuration(n),o=o?t.createDuration(o):n,null===(r=t.wholeDivideDurations(n,o))&&(o=n,r=1),this.slotDuration=n,this.snapDuration=o,this.snapsPerSlot=r,i=e.slotLabelFormat,Array.isArray(i)&&(i=i[i.length-1]),this.labelFormat=t.createFormatter(i||{hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"}),i=e.slotLabelInterval,this.labelInterval=i?t.createDuration(i):this.computeLabelInterval(n)},i.prototype.computeLabelInterval=function(e){var r,i,n;for(r=u.length-1;r>=0;r--)if(i=t.createDuration(u[r]),null!==(n=t.wholeDivideDurations(i,e))&&n>1)return i;return e},i.prototype.render=function(e,t){this.processOptions(t.options);var r=e.cells;this.colCnt=r.length,this.renderSkeleton(t.theme),this.renderSlats(e.dateProfile),this.renderColumns(e.cells,e.dateProfile),this.renderBusinessHours(t,e.businessHourSegs),this.renderDateSelection(e.dateSelectionSegs),this.renderFgEvents(t,e.fgEventSegs),this.renderBgEvents(t,e.bgEventSegs),this.renderEventSelection(e.eventSelection),this.renderEventDrag(e.eventDrag),this.renderEventResize(e.eventResize)},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.renderSlats.unrender(),this.renderColumns.unrender(),this.renderSkeleton.unrender()},i.prototype.updateSize=function(e){var t=this.fillRenderer,r=this.eventRenderer,i=this.mirrorRenderer;(e||this.isSlatSizesDirty)&&(this.buildSlatPositions(),this.isSlatSizesDirty=!1),(e||this.isColSizesDirty)&&(this.buildColPositions(),this.isColSizesDirty=!1),t.computeSizes(e),r.computeSizes(e),i.computeSizes(e),t.assignSizes(e),r.assignSizes(e),i.assignSizes(e)},i.prototype._renderSkeleton=function(e){var t=this.el;t.innerHTML='<div class="fc-bg"></div><div class="fc-slats"></div><hr class="fc-divider '+e.getClass("widgetHeader")+'" style="display:none" />',this.rootBgContainerEl=t.querySelector(".fc-bg"),this.slatContainerEl=t.querySelector(".fc-slats"),this.bottomRuleEl=t.querySelector(".fc-divider")},i.prototype._renderSlats=function(e){var r=this.context.theme;this.slatContainerEl.innerHTML='<table class="'+r.getClass("tableGrid")+'">'+this.renderSlatRowHtml(e)+"</table>",this.slatEls=t.findElements(this.slatContainerEl,"tr"),this.slatPositions=new t.PositionCache(this.el,this.slatEls,!1,!0),this.isSlatSizesDirty=!0},i.prototype.renderSlatRowHtml=function(e){for(var r,i,n,o=this.context,s=o.dateEnv,a=o.theme,l=o.isRtl,d="",c=t.startOfDay(e.renderRange.start),h=e.minTime,u=t.createDuration(0);t.asRoughMs(h)<t.asRoughMs(e.maxTime);)r=s.add(c,h),i=null!==t.wholeDivideDurations(u,this.labelInterval),n='<td class="fc-axis fc-time '+a.getClass("widgetContent")+'">'+(i?"<span>"+t.htmlEscape(s.format(r,this.labelFormat))+"</span>":"")+"</td>",d+='<tr data-time="'+t.formatIsoTimeString(r)+'"'+(i?"":' class="fc-minor"')+">"+(l?"":n)+'<td class="'+a.getClass("widgetContent")+'"></td>'+(l?n:"")+"</tr>",h=t.addDurations(h,this.slotDuration),u=t.addDurations(u,this.slotDuration);return d},i.prototype._renderColumns=function(e,i){var n=this.context,o=n.calendar,s=n.view,a=n.isRtl,l=n.theme,d=n.dateEnv,c=new r.DayBgRow(this.context);this.rootBgContainerEl.innerHTML='<table class="'+l.getClass("tableGrid")+'">'+c.renderHtml({cells:e,dateProfile:i,renderIntroHtml:this.renderProps.renderBgIntroHtml})+"</table>",this.colEls=t.findElements(this.el,".fc-day, .fc-disabled-day");for(var h=0;h<this.colCnt;h++)o.publiclyTrigger("dayRender",[{date:d.toDate(e[h].date),el:this.colEls[h],view:s}]);a&&this.colEls.reverse(),this.colPositions=new t.PositionCache(this.el,this.colEls,!0,!1),this.renderContentSkeleton(),this.isColSizesDirty=!0},i.prototype._unrenderColumns=function(){this.unrenderContentSkeleton()},i.prototype.renderContentSkeleton=function(){var e,r=this.context.isRtl,i=[];i.push(this.renderProps.renderIntroHtml());for(var n=0;n<this.colCnt;n++)i.push('<td><div class="fc-content-col"><div class="fc-event-container fc-mirror-container"></div><div class="fc-event-container"></div><div class="fc-highlight-container"></div><div class="fc-bgevent-container"></div><div class="fc-business-container"></div></div></td>');r&&i.reverse(),e=this.contentSkeletonEl=t.htmlToElement('<div class="fc-content-skeleton"><table><tr>'+i.join("")+"</tr></table></div>"),this.colContainerEls=t.findElements(e,".fc-content-col"),this.mirrorContainerEls=t.findElements(e,".fc-mirror-container"),this.fgContainerEls=t.findElements(e,".fc-event-container:not(.fc-mirror-container)"),this.bgContainerEls=t.findElements(e,".fc-bgevent-container"),this.highlightContainerEls=t.findElements(e,".fc-highlight-container"),this.businessContainerEls=t.findElements(e,".fc-business-container"),r&&(this.colContainerEls.reverse(),this.mirrorContainerEls.reverse(),this.fgContainerEls.reverse(),this.bgContainerEls.reverse(),this.highlightContainerEls.reverse(),this.businessContainerEls.reverse()),this.el.appendChild(e)},i.prototype.unrenderContentSkeleton=function(){t.removeElement(this.contentSkeletonEl)},i.prototype.groupSegsByCol=function(e){var t,r=[];for(t=0;t<this.colCnt;t++)r.push([]);for(t=0;t<e.length;t++)r[e[t].col].push(e[t]);return r},i.prototype.attachSegsByCol=function(e,t){var r,i,n;for(r=0;r<this.colCnt;r++)for(i=e[r],n=0;n<i.length;n++)t[r].appendChild(i[n].el)},i.prototype.getNowIndicatorUnit=function(){return"minute"},i.prototype.renderNowIndicator=function(e,r){if(this.colContainerEls){var i,n=this.computeDateTop(r),o=[];for(i=0;i<e.length;i++){var s=t.createElement("div",{className:"fc-now-indicator fc-now-indicator-line"});s.style.top=n+"px",this.colContainerEls[e[i].col].appendChild(s),o.push(s)}if(e.length>0){var a=t.createElement("div",{className:"fc-now-indicator fc-now-indicator-arrow"});a.style.top=n+"px",this.contentSkeletonEl.appendChild(a),o.push(a)}this.nowIndicatorEls=o}},i.prototype.unrenderNowIndicator=function(){this.nowIndicatorEls&&(this.nowIndicatorEls.forEach(t.removeElement),this.nowIndicatorEls=null)},i.prototype.getTotalSlatHeight=function(){return this.slatContainerEl.getBoundingClientRect().height},i.prototype.computeDateTop=function(e,r){return r||(r=t.startOfDay(e)),this.computeTimeTop(t.createDuration(e.valueOf()-r.valueOf()))},i.prototype.computeTimeTop=function(e){var r,i,n=this.slatEls.length,o=this.props.dateProfile,s=(e.milliseconds-t.asRoughMs(o.minTime))/t.asRoughMs(this.slotDuration);return s=Math.max(0,s),s=Math.min(n,s),r=Math.floor(s),i=s-(r=Math.min(r,n-1)),this.slatPositions.tops[r]+this.slatPositions.getHeight(r)*i},i.prototype.computeSegVerticals=function(e){var t,r,i,n=this.context.options.timeGridEventMinHeight;for(t=0;t<e.length;t++)r=e[t],i=this.props.cells[r.col].date,r.top=this.computeDateTop(r.start,i),r.bottom=Math.max(r.top+n,this.computeDateTop(r.end,i))},i.prototype.assignSegVerticals=function(e){var r,i;for(r=0;r<e.length;r++)i=e[r],t.applyStyle(i.el,this.generateSegVerticalCss(i))},i.prototype.generateSegVerticalCss=function(e){return{top:e.top,bottom:-e.bottom}},i.prototype.buildPositionCaches=function(){this.buildColPositions(),this.buildSlatPositions()},i.prototype.buildColPositions=function(){this.colPositions.build()},i.prototype.buildSlatPositions=function(){this.slatPositions.build()},i.prototype.positionToHit=function(e,r){var i=this.context.dateEnv,n=this.snapsPerSlot,o=this.slatPositions,s=this.colPositions,a=s.leftToIndex(e),l=o.topToIndex(r);if(null!=a&&null!=l){var d=o.tops[l],c=o.getHeight(l),h=(r-d)/c,u=l*n+Math.floor(h*n),p=this.props.cells[a].date,f=t.addDurations(this.props.dateProfile.minTime,t.multiplyDuration(this.snapDuration,u)),g=i.add(p,f);return{col:a,dateSpan:{range:{start:g,end:i.add(g,this.snapDuration)},allDay:!1},dayEl:this.colEls[a],relativeRect:{left:s.lefts[a],right:s.rights[a],top:d,bottom:d+c}}}},i.prototype._renderEventDrag=function(e){e&&(this.eventRenderer.hideByHash(e.affectedInstances),e.isEvent?this.mirrorRenderer.renderSegs(this.context,e.segs,{isDragging:!0,sourceSeg:e.sourceSeg}):this.fillRenderer.renderSegs("highlight",this.context,e.segs))},i.prototype._unrenderEventDrag=function(e){e&&(this.eventRenderer.showByHash(e.affectedInstances),e.isEvent?this.mirrorRenderer.unrender(this.context,e.segs,{isDragging:!0,sourceSeg:e.sourceSeg}):this.fillRenderer.unrender("highlight",this.context))},i.prototype._renderEventResize=function(e){e&&(this.eventRenderer.hideByHash(e.affectedInstances),this.mirrorRenderer.renderSegs(this.context,e.segs,{isResizing:!0,sourceSeg:e.sourceSeg}))},i.prototype._unrenderEventResize=function(e){e&&(this.eventRenderer.showByHash(e.affectedInstances),this.mirrorRenderer.unrender(this.context,e.segs,{isResizing:!0,sourceSeg:e.sourceSeg}))},i.prototype._renderDateSelection=function(e){e&&(this.context.options.selectMirror?this.mirrorRenderer.renderSegs(this.context,e,{isSelecting:!0}):this.fillRenderer.renderSegs("highlight",this.context,e))},i.prototype._unrenderDateSelection=function(e){e&&(this.context.options.selectMirror?this.mirrorRenderer.unrender(this.context,e,{isSelecting:!0}):this.fillRenderer.unrender("highlight",this.context))},i}(t.DateComponent),f=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.getKeyInfo=function(){return{allDay:{},timed:{}}},r.prototype.getKeysForDateSpan=function(e){return e.allDay?["allDay"]:["timed"]},r.prototype.getKeysForEventDef=function(e){return e.allDay?t.hasBgRendering(e)?["timed","allDay"]:["allDay"]:["timed"]},r}(t.Splitter),g=t.createFormatter({week:"short"}),m=function(e){function i(){var r=null!==e&&e.apply(this,arguments)||this;return r.splitter=new f,r.renderSkeleton=t.memoizeRendering(r._renderSkeleton,r._unrenderSkeleton),r.renderHeadIntroHtml=function(){var e,i=r.context,n=i.theme,o=i.dateEnv,s=i.options,a=r.props.dateProfile.renderRange,l=t.diffDays(a.start,a.end);return s.weekNumbers?(e=o.format(a.start,g),'<th class="fc-axis fc-week-number '+n.getClass("widgetHeader")+'" '+r.axisStyleAttr()+">"+t.buildGotoAnchorHtml(s,o,{date:a.start,type:"week",forceOff:l>1},t.htmlEscape(e))+"</th>"):'<th class="fc-axis '+n.getClass("widgetHeader")+'" '+r.axisStyleAttr()+"></th>"},r.renderTimeGridBgIntroHtml=function(){return'<td class="fc-axis '+r.context.theme.getClass("widgetContent")+'" '+r.axisStyleAttr()+"></td>"},r.renderTimeGridIntroHtml=function(){return'<td class="fc-axis" '+r.axisStyleAttr()+"></td>"},r.renderDayGridBgIntroHtml=function(){var e=r.context,i=e.theme,n=e.options;return'<td class="fc-axis '+i.getClass("widgetContent")+'" '+r.axisStyleAttr()+"><span>"+t.getAllDayHtml(n)+"</span></td>"},r.renderDayGridIntroHtml=function(){return'<td class="fc-axis" '+r.axisStyleAttr()+"></td>"},r}return n(i,e),i.prototype.render=function(t,r){e.prototype.render.call(this,t,r),this.renderSkeleton(r)},i.prototype.destroy=function(){e.prototype.destroy.call(this),this.renderSkeleton.unrender()},i.prototype._renderSkeleton=function(e){this.el.classList.add("fc-timeGrid-view"),this.el.innerHTML=this.renderSkeletonHtml(),this.scroller=new t.ScrollComponent("hidden","auto");var i=this.scroller.el;this.el.querySelector(".fc-body > tr > td").appendChild(i),i.classList.add("fc-time-grid-container");var n=t.createElement("div",{className:"fc-time-grid"});if(i.appendChild(n),this.timeGrid=new p(n,{renderBgIntroHtml:this.renderTimeGridBgIntroHtml,renderIntroHtml:this.renderTimeGridIntroHtml}),e.options.allDaySlot){this.dayGrid=new r.DayGrid(this.el.querySelector(".fc-day-grid"),{renderNumberIntroHtml:this.renderDayGridIntroHtml,renderBgIntroHtml:this.renderDayGridBgIntroHtml,renderIntroHtml:this.renderDayGridIntroHtml,colWeekNumbersVisible:!1,cellWeekNumbersVisible:!1});var o=this.el.querySelector(".fc-divider");this.dayGrid.bottomCoordPadding=o.getBoundingClientRect().height}},i.prototype._unrenderSkeleton=function(){this.el.classList.remove("fc-timeGrid-view"),this.timeGrid.destroy(),this.dayGrid&&this.dayGrid.destroy(),this.scroller.destroy()},i.prototype.renderSkeletonHtml=function(){var e=this.context,t=e.theme,r=e.options;return'<table class="'+t.getClass("tableGrid")+'">'+(r.columnHeader?'<thead class="fc-head"><tr><td class="fc-head-container '+t.getClass("widgetHeader")+'"> </td></tr></thead>':"")+'<tbody class="fc-body"><tr><td class="'+t.getClass("widgetContent")+'">'+(r.allDaySlot?'<div class="fc-day-grid"></div><hr class="fc-divider '+t.getClass("widgetHeader")+'" />':"")+"</td></tr></tbody></table>"},i.prototype.getNowIndicatorUnit=function(){return this.timeGrid.getNowIndicatorUnit()},i.prototype.unrenderNowIndicator=function(){this.timeGrid.unrenderNowIndicator()},i.prototype.updateSize=function(t,r,i){e.prototype.updateSize.call(this,t,r,i),this.timeGrid.updateSize(t),this.dayGrid&&this.dayGrid.updateSize(t)},i.prototype.updateBaseSize=function(e,r,i){var n,o,s,a=this;if(this.axisWidth=t.matchCellWidths(t.findElements(this.el,".fc-axis")),this.timeGrid.colEls){var l=t.findElements(this.el,".fc-row").filter((function(e){return!a.scroller.el.contains(e)}));this.timeGrid.bottomRuleEl.style.display="none",this.scroller.clear(),l.forEach(t.uncompensateScroll),this.dayGrid&&(this.dayGrid.removeSegPopover(),(n=this.context.options.eventLimit)&&"number"!=typeof n&&(n=5),n&&this.dayGrid.limitRows(n)),i||(o=this.computeScrollerHeight(r),this.scroller.setHeight(o),((s=this.scroller.getScrollbarWidths()).left||s.right)&&(l.forEach((function(e){t.compensateScroll(e,s)})),o=this.computeScrollerHeight(r),this.scroller.setHeight(o)),this.scroller.lockOverflow(s),this.timeGrid.getTotalSlatHeight()<o&&(this.timeGrid.bottomRuleEl.style.display=""))}else i||(o=this.computeScrollerHeight(r),this.scroller.setHeight(o))},i.prototype.computeScrollerHeight=function(e){return e-t.subtractInnerElHeight(this.el,this.scroller.el)},i.prototype.computeDateScroll=function(e){var t=this.timeGrid.computeTimeTop(e);return(t=Math.ceil(t))&&t++,{top:t}},i.prototype.queryDateScroll=function(){return{top:this.scroller.getScrollTop()}},i.prototype.applyDateScroll=function(e){void 0!==e.top&&this.scroller.setScrollTop(e.top)},i.prototype.axisStyleAttr=function(){return null!=this.axisWidth?'style="width:'+this.axisWidth+'px"':""},i}(t.View);m.prototype.usesMinMaxTime=!0;var y=function(e){function r(r){var i=e.call(this,r.el)||this;return i.buildDayRanges=t.memoize(v),i.slicer=new S,i.timeGrid=r,i}return n(r,e),r.prototype.firstContext=function(e){e.calendar.registerInteractiveComponent(this,{el:this.timeGrid.el})},r.prototype.destroy=function(){e.prototype.destroy.call(this),this.context.calendar.unregisterInteractiveComponent(this)},r.prototype.render=function(e,t){var r=this.context.dateEnv,i=e.dateProfile,n=e.dayTable,s=this.dayRanges=this.buildDayRanges(n,i,r),a=this.timeGrid;a.receiveContext(t),a.receiveProps(o({},this.slicer.sliceProps(e,i,null,t.calendar,a,s),{dateProfile:i,cells:n.cells[0]}),t)},r.prototype.renderNowIndicator=function(e){this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(e,this.timeGrid,this.dayRanges),e)},r.prototype.buildPositionCaches=function(){this.timeGrid.buildPositionCaches()},r.prototype.queryHit=function(e,t){var r=this.timeGrid.positionToHit(e,t);if(r)return{component:this.timeGrid,dateSpan:r.dateSpan,dayEl:r.dayEl,rect:{left:r.relativeRect.left,right:r.relativeRect.right,top:r.relativeRect.top,bottom:r.relativeRect.bottom},layer:0}},r}(t.DateComponent);function v(e,t,r){for(var i=[],n=0,o=e.headerDates;n<o.length;n++){var s=o[n];i.push({start:r.add(s,t.minTime),end:r.add(s,t.maxTime)})}return i}var S=function(e){function r(){return null!==e&&e.apply(this,arguments)||this}return n(r,e),r.prototype.sliceRange=function(e,r){for(var i=[],n=0;n<r.length;n++){var o=t.intersectRanges(e,r[n]);o&&i.push({start:o.start,end:o.end,isStart:o.start.valueOf()===e.start.valueOf(),isEnd:o.end.valueOf()===e.end.valueOf(),col:n})}return i},r}(t.Slicer),C=function(e){function i(){var r=null!==e&&e.apply(this,arguments)||this;return r.buildDayTable=t.memoize(E),r}return n(i,e),i.prototype.render=function(t,r){e.prototype.render.call(this,t,r);var i=this.props,n=i.dateProfile,s=i.dateProfileGenerator,a=r.nextDayThreshold,l=this.buildDayTable(n,s),d=this.splitter.splitProps(t);this.header&&this.header.receiveProps({dateProfile:n,dates:l.headerDates,datesRepDistinctDays:!0,renderIntroHtml:this.renderHeadIntroHtml},r),this.simpleTimeGrid.receiveProps(o({},d.timed,{dateProfile:n,dayTable:l}),r),this.simpleDayGrid&&this.simpleDayGrid.receiveProps(o({},d.allDay,{dateProfile:n,dayTable:l,nextDayThreshold:a,isRigid:!1}),r),this.startNowIndicator(n,s)},i.prototype._renderSkeleton=function(i){e.prototype._renderSkeleton.call(this,i),i.options.columnHeader&&(this.header=new t.DayHeader(this.el.querySelector(".fc-head-container"))),this.simpleTimeGrid=new y(this.timeGrid),this.dayGrid&&(this.simpleDayGrid=new r.SimpleDayGrid(this.dayGrid))},i.prototype._unrenderSkeleton=function(){e.prototype._unrenderSkeleton.call(this),this.header&&this.header.destroy(),this.simpleTimeGrid.destroy(),this.simpleDayGrid&&this.simpleDayGrid.destroy()},i.prototype.renderNowIndicator=function(e){this.simpleTimeGrid.renderNowIndicator(e)},i}(m);function E(e,r){var i=new t.DaySeries(e.renderRange,r);return new t.DayTable(i,!1)}var b=t.createPlugin({defaultView:"timeGridWeek",views:{timeGrid:{class:C,allDaySlot:!0,slotDuration:"00:30:00",slotEventOverlap:!0},timeGridDay:{type:"timeGrid",duration:{days:1}},timeGridWeek:{type:"timeGrid",duration:{weeks:1}}}});e.AbstractTimeGridView=m,e.TimeGrid=p,e.TimeGridSlicer=S,e.TimeGridView=C,e.buildDayRanges=v,e.buildDayTable=E,e.default=b,Object.defineProperty(e,"__esModule",{value:!0})}));
\ No newline at end of file diff --git a/library/fullcalendar/packages/timegrid/package.json b/library/fullcalendar/packages/timegrid/package.json deleted file mode 100644 index 3d92bcf78..000000000 --- a/library/fullcalendar/packages/timegrid/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@fullcalendar/timegrid", - "version": "4.4.2", - "title": "FullCalendar Time Grid Plugin", - "description": "Display your events on a grid of time slots", - "keywords": [ - "calendar", - "event", - "full-sized" - ], - "homepage": "https://fullcalendar.io/", - "docs": "https://fullcalendar.io/docs/timegrid-view", - "bugs": "https://fullcalendar.io/reporting-bugs", - "repository": { - "type": "git", - "url": "https://github.com/fullcalendar/fullcalendar.git", - "homepage": "https://github.com/fullcalendar/fullcalendar" - }, - "license": "MIT", - "author": { - "name": "Adam Shaw", - "email": "arshaw@arshaw.com", - "url": "http://arshaw.com/" - }, - "copyright": "2019 Adam Shaw", - "dependencies": { - "@fullcalendar/daygrid": "~4.4.0" - }, - "peerDependencies": { - "@fullcalendar/core": "~4.4.0" - }, - "main": "main.js", - "module": "main.esm.js", - "unpkg": "main.min.js", - "types": "main.d.ts" -} |