@fullcalendar/list
Advanced tools
Comparing version 5.11.2 to 6.0.0-beta.1
260
main.cjs.js
/*! | ||
FullCalendar v5.11.2 | ||
FullCalendar v6.0.0-beta.1 | ||
Docs & License: https://fullcalendar.io/ | ||
@@ -11,41 +11,36 @@ (c) 2022 Adam Shaw | ||
var common = require('@fullcalendar/common'); | ||
var tslib = require('tslib'); | ||
; | ||
var ListViewHeaderRow = /** @class */ (function (_super) { | ||
tslib.__extends(ListViewHeaderRow, _super); | ||
function ListViewHeaderRow() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.state = { | ||
class ListViewHeaderRow extends common.BaseComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.state = { | ||
textId: common.getUniqueDomId(), | ||
}; | ||
return _this; | ||
} | ||
ListViewHeaderRow.prototype.render = function () { | ||
var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options, viewApi = _a.viewApi; | ||
var _b = this.props, cellId = _b.cellId, dayDate = _b.dayDate, todayRange = _b.todayRange; | ||
var textId = this.state.textId; | ||
var dayMeta = common.getDateMeta(dayDate, todayRange); | ||
render() { | ||
let { theme, dateEnv, options, viewApi } = this.context; | ||
let { cellId, dayDate, todayRange } = this.props; | ||
let { textId } = this.state; | ||
let dayMeta = common.getDateMeta(dayDate, todayRange); | ||
// will ever be falsy? | ||
var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; | ||
let text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; | ||
// will ever be falsy? also, BAD NAME "alt" | ||
var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; | ||
var hookProps = tslib.__assign({ date: dateEnv.toDate(dayDate), view: viewApi, textId: textId, | ||
text: text, | ||
sideText: sideText, navLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate), sideNavLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate, 'day', false) }, dayMeta); | ||
var classNames = ['fc-list-day'].concat(common.getDayClassNames(dayMeta, theme)); | ||
let sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; | ||
let hookProps = Object.assign({ date: dateEnv.toDate(dayDate), view: viewApi, textId, | ||
text, | ||
sideText, navLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate), sideNavLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate, 'day', false) }, dayMeta); | ||
let classNames = ['fc-list-day'].concat(common.getDayClassNames(dayMeta, theme)); | ||
// TODO: make a reusable HOC for dayHeader (used in daygrid/timegrid too) | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (common.createElement("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": common.formatDayString(dayDate) }, | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, (rootElRef, customClassNames, innerElRef, innerContent) => (common.createElement("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": common.formatDayString(dayDate) }, | ||
common.createElement("th", { scope: "colgroup", colSpan: 3, id: cellId, "aria-labelledby": textId }, | ||
common.createElement("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))); })); | ||
}; | ||
return ListViewHeaderRow; | ||
}(common.BaseComponent)); | ||
common.createElement("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))))); | ||
} | ||
} | ||
function renderInnerContent(props) { | ||
return (common.createElement(common.Fragment, null, | ||
props.text && (common.createElement("a", tslib.__assign({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), | ||
props.sideText && ( /* not keyboard tabbable */common.createElement("a", tslib.__assign({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); | ||
props.text && (common.createElement("a", Object.assign({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), | ||
props.sideText && ( /* not keyboard tabbable */common.createElement("a", Object.assign({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); | ||
} | ||
var DEFAULT_TIME_FORMAT = common.createFormatter({ | ||
const DEFAULT_TIME_FORMAT = common.createFormatter({ | ||
hour: 'numeric', | ||
@@ -55,31 +50,26 @@ minute: '2-digit', | ||
}); | ||
var ListViewEventRow = /** @class */ (function (_super) { | ||
tslib.__extends(ListViewEventRow, _super); | ||
function ListViewEventRow() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ListViewEventRow.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var seg = props.seg, timeHeaderId = props.timeHeaderId, eventHeaderId = props.eventHeaderId, dateHeaderId = props.dateHeaderId; | ||
var timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
class ListViewEventRow extends common.BaseComponent { | ||
render() { | ||
let { props, context } = this; | ||
let { seg, timeHeaderId, eventHeaderId, dateHeaderId } = props; | ||
let timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
return (common.createElement(common.EventRoot, { seg: seg, timeText: "" // BAD. because of all-day content | ||
, disableDragging: true, disableResizing: true, defaultContent: function () { return renderEventInnerContent(seg, context); } /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (common.createElement("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, | ||
, disableDragging: true, disableResizing: true, defaultContent: () => renderEventInnerContent(seg, context) /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, (rootElRef, classNames, innerElRef, innerContent, hookProps) => (common.createElement("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, | ||
buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId), | ||
common.createElement("td", { "aria-hidden": true, className: "fc-list-event-graphic" }, | ||
common.createElement("span", { className: "fc-list-event-dot", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
common.createElement("td", { ref: innerElRef, headers: eventHeaderId + " " + dateHeaderId, className: "fc-list-event-title" }, innerContent))); })); | ||
}; | ||
return ListViewEventRow; | ||
}(common.BaseComponent)); | ||
common.createElement("td", { ref: innerElRef, headers: `${eventHeaderId} ${dateHeaderId}`, className: "fc-list-event-title" }, innerContent))))); | ||
} | ||
} | ||
function renderEventInnerContent(seg, context) { | ||
var interactiveAttrs = common.getSegAnchorAttrs(seg, context); | ||
return (common.createElement("a", tslib.__assign({}, interactiveAttrs), seg.eventRange.def.title)); | ||
let interactiveAttrs = common.getSegAnchorAttrs(seg, context); | ||
return (common.createElement("a", Object.assign({}, interactiveAttrs), seg.eventRange.def.title)); | ||
} | ||
function buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId) { | ||
var options = context.options; | ||
let { options } = context; | ||
if (options.displayEventTime !== false) { | ||
var eventDef = seg.eventRange.def; | ||
var eventInstance = seg.eventRange.instance; | ||
var doAllDay = false; | ||
var timeText = void 0; | ||
let eventDef = seg.eventRange.def; | ||
let eventInstance = seg.eventRange.instance; | ||
let doAllDay = false; | ||
let timeText; | ||
if (eventDef.allDay) { | ||
@@ -103,7 +93,7 @@ doAllDay = true; | ||
if (doAllDay) { | ||
var hookProps = { | ||
let hookProps = { | ||
text: context.options.allDayText, | ||
view: context.viewApi, | ||
}; | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (common.createElement("td", { ref: rootElRef, headers: timeHeaderId + " " + dateHeaderId, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)); })); | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, (rootElRef, classNames, innerElRef, innerContent) => (common.createElement("td", { ref: rootElRef, headers: `${timeHeaderId} ${dateHeaderId}`, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)))); | ||
} | ||
@@ -121,9 +111,8 @@ return (common.createElement("td", { className: "fc-list-event-time" }, timeText)); | ||
*/ | ||
var ListView = /** @class */ (function (_super) { | ||
tslib.__extends(ListView, _super); | ||
function ListView() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.computeDateVars = common.memoize(computeDateVars); | ||
_this.eventStoreToSegs = common.memoize(_this._eventStoreToSegs); | ||
_this.state = { | ||
class ListView extends common.DateComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.computeDateVars = common.memoize(computeDateVars); | ||
this.eventStoreToSegs = common.memoize(this._eventStoreToSegs); | ||
this.state = { | ||
timeHeaderId: common.getUniqueDomId(), | ||
@@ -133,5 +122,5 @@ eventHeaderId: common.getUniqueDomId(), | ||
}; | ||
_this.setRootEl = function (rootEl) { | ||
this.setRootEl = (rootEl) => { | ||
if (rootEl) { | ||
_this.context.registerInteractiveComponent(_this, { | ||
this.context.registerInteractiveComponent(this, { | ||
el: rootEl, | ||
@@ -141,11 +130,9 @@ }); | ||
else { | ||
_this.context.unregisterInteractiveComponent(_this); | ||
this.context.unregisterInteractiveComponent(this); | ||
} | ||
}; | ||
return _this; | ||
} | ||
ListView.prototype.render = function () { | ||
var _this = this; | ||
var _a = this, props = _a.props, context = _a.context; | ||
var extraClassNames = [ | ||
render() { | ||
let { props, context } = this; | ||
let extraClassNames = [ | ||
'fc-list', | ||
@@ -155,35 +142,34 @@ context.theme.getClass('table'), | ||
]; | ||
var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges; | ||
var eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); | ||
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, function (rootElRef, classNames) { return (common.createElement("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, | ||
let { dayDates, dayRanges } = this.computeDateVars(props.dateProfile); | ||
let eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); | ||
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, (rootElRef, classNames) => (common.createElement("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, | ||
common.createElement(common.Scroller, { liquid: !props.isHeightAuto, overflowX: props.isHeightAuto ? 'visible' : 'hidden', overflowY: props.isHeightAuto ? 'visible' : 'auto' }, eventSegs.length > 0 ? | ||
_this.renderSegList(eventSegs, dayDates) : | ||
_this.renderEmptyMessage()))); })); | ||
}; | ||
ListView.prototype.renderEmptyMessage = function () { | ||
var _a = this.context, options = _a.options, viewApi = _a.viewApi; | ||
var hookProps = { | ||
this.renderSegList(eventSegs, dayDates) : | ||
this.renderEmptyMessage()))))); | ||
} | ||
renderEmptyMessage() { | ||
let { options, viewApi } = this.context; | ||
let hookProps = { | ||
text: options.noEventsText, | ||
view: viewApi, | ||
}; | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (common.createElement("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, | ||
common.createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))); })); | ||
}; | ||
ListView.prototype.renderSegList = function (allSegs, dayDates) { | ||
var _a = this.context, theme = _a.theme, options = _a.options; | ||
var _b = this.state, timeHeaderId = _b.timeHeaderId, eventHeaderId = _b.eventHeaderId, dateHeaderIdRoot = _b.dateHeaderIdRoot; | ||
var segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (common.createElement(common.NowTimer, { unit: "day" }, function (nowDate, todayRange) { | ||
var innerNodes = []; | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
var daySegs = segsByDay[dayIndex]; | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, (rootElRef, classNames, innerElRef, innerContent) => (common.createElement("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, | ||
common.createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))))); | ||
} | ||
renderSegList(allSegs, dayDates) { | ||
let { theme, options } = this.context; | ||
let { timeHeaderId, eventHeaderId, dateHeaderIdRoot } = this.state; | ||
let segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (common.createElement(common.NowTimer, { unit: "day" }, (nowDate, todayRange) => { | ||
let innerNodes = []; | ||
for (let dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
let daySegs = segsByDay[dayIndex]; | ||
if (daySegs) { // sparse array, so might be undefined | ||
var dayStr = common.formatDayString(dayDates[dayIndex]); | ||
var dateHeaderId = dateHeaderIdRoot + '-' + dayStr; | ||
let dayStr = common.formatDayString(dayDates[dayIndex]); | ||
let dateHeaderId = dateHeaderIdRoot + '-' + dayStr; | ||
// append a day header | ||
innerNodes.push(common.createElement(ListViewHeaderRow, { key: dayStr, cellId: dateHeaderId, dayDate: dayDates[dayIndex], todayRange: todayRange })); | ||
daySegs = common.sortEventSegs(daySegs, options.eventOrder); | ||
for (var _i = 0, daySegs_1 = daySegs; _i < daySegs_1.length; _i++) { | ||
var seg = daySegs_1[_i]; | ||
innerNodes.push(common.createElement(ListViewEventRow, tslib.__assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, common.getSegMeta(seg, todayRange, nowDate)))); | ||
for (let seg of daySegs) { | ||
innerNodes.push(common.createElement(ListViewEventRow, Object.assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, common.getSegMeta(seg, todayRange, nowDate)))); | ||
} | ||
@@ -200,23 +186,22 @@ } | ||
})); | ||
}; | ||
ListView.prototype._eventStoreToSegs = function (eventStore, eventUiBases, dayRanges) { | ||
} | ||
_eventStoreToSegs(eventStore, eventUiBases, dayRanges) { | ||
return this.eventRangesToSegs(common.sliceEventStore(eventStore, eventUiBases, this.props.dateProfile.activeRange, this.context.options.nextDayThreshold).fg, dayRanges); | ||
}; | ||
ListView.prototype.eventRangesToSegs = function (eventRanges, dayRanges) { | ||
var segs = []; | ||
for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) { | ||
var eventRange = eventRanges_1[_i]; | ||
segs.push.apply(segs, this.eventRangeToSegs(eventRange, dayRanges)); | ||
} | ||
eventRangesToSegs(eventRanges, dayRanges) { | ||
let segs = []; | ||
for (let eventRange of eventRanges) { | ||
segs.push(...this.eventRangeToSegs(eventRange, dayRanges)); | ||
} | ||
return segs; | ||
}; | ||
ListView.prototype.eventRangeToSegs = function (eventRange, dayRanges) { | ||
var dateEnv = this.context.dateEnv; | ||
var nextDayThreshold = this.context.options.nextDayThreshold; | ||
var range = eventRange.range; | ||
var allDay = eventRange.def.allDay; | ||
var dayIndex; | ||
var segRange; | ||
var seg; | ||
var segs = []; | ||
} | ||
eventRangeToSegs(eventRange, dayRanges) { | ||
let { dateEnv } = this.context; | ||
let { nextDayThreshold } = this.context.options; | ||
let range = eventRange.range; | ||
let allDay = eventRange.def.allDay; | ||
let dayIndex; | ||
let segRange; | ||
let seg; | ||
let segs = []; | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) { | ||
@@ -227,3 +212,3 @@ segRange = common.intersectRanges(range, dayRanges[dayIndex]); | ||
component: this, | ||
eventRange: eventRange, | ||
eventRange, | ||
start: segRange.start, | ||
@@ -233,3 +218,3 @@ end: segRange.end, | ||
isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(), | ||
dayIndex: dayIndex, | ||
dayIndex, | ||
}; | ||
@@ -250,5 +235,4 @@ segs.push(seg); | ||
return segs; | ||
}; | ||
return ListView; | ||
}(common.DateComponent)); | ||
} | ||
} | ||
function renderNoEventsInner(hookProps) { | ||
@@ -258,6 +242,6 @@ return hookProps.text; | ||
function computeDateVars(dateProfile) { | ||
var dayStart = common.startOfDay(dateProfile.renderRange.start); | ||
var viewEnd = dateProfile.renderRange.end; | ||
var dayDates = []; | ||
var dayRanges = []; | ||
let dayStart = common.startOfDay(dateProfile.renderRange.start); | ||
let viewEnd = dateProfile.renderRange.end; | ||
let dayDates = []; | ||
let dayRanges = []; | ||
while (dayStart < viewEnd) { | ||
@@ -271,9 +255,9 @@ dayDates.push(dayStart); | ||
} | ||
return { dayDates: dayDates, dayRanges: dayRanges }; | ||
return { dayDates, dayRanges }; | ||
} | ||
// Returns a sparse array of arrays, segs grouped by their dayIndex | ||
function groupSegsByDay(segs) { | ||
var segsByDay = []; // sparse array | ||
var i; | ||
var seg; | ||
let segsByDay = []; // sparse array | ||
let i; | ||
let seg; | ||
for (i = 0; i < segs.length; i += 1) { | ||
@@ -287,3 +271,3 @@ seg = segs[i]; | ||
var OPTION_REFINERS = { | ||
const OPTION_REFINERS = { | ||
listDayFormat: createFalsableFormatter, | ||
@@ -301,2 +285,32 @@ listDaySideFormat: createFalsableFormatter, | ||
function styleInject(css, ref) { | ||
if ( ref === void 0 ) ref = {}; | ||
var insertAt = ref.insertAt; | ||
if (!css || typeof document === 'undefined') { return; } | ||
var head = document.head || document.getElementsByTagName('head')[0]; | ||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
if (insertAt === 'top') { | ||
if (head.firstChild) { | ||
head.insertBefore(style, head.firstChild); | ||
} else { | ||
head.appendChild(style); | ||
} | ||
} else { | ||
head.appendChild(style); | ||
} | ||
if (style.styleSheet) { | ||
style.styleSheet.cssText = css; | ||
} else { | ||
style.appendChild(document.createTextNode(css)); | ||
} | ||
} | ||
var css_248z = "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n.fc-theme-standard .fc-list {\n border: 1px solid #ddd;\n border: 1px solid var(--fc-border-color, #ddd);\n }\n.fc {\n\n /* message when no events */\n\n}\n.fc .fc-list-empty {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: #fff;\n background: var(--fc-page-bg-color, #fff); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: #f5f5f5;\n background-color: var(--fc-list-event-hover-bg-color, #f5f5f5);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 5px solid #3788d8;\n border: calc(var(--fc-list-event-dot-width, 10px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 5px;\n border-radius: calc(var(--fc-list-event-dot-width, 10px) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n"; | ||
styleInject(css_248z); | ||
var main = common.createPlugin({ | ||
@@ -303,0 +317,0 @@ optionRefiners: OPTION_REFINERS, |
/*! | ||
FullCalendar v5.11.2 | ||
FullCalendar v6.0.0-beta.1 | ||
Docs & License: https://fullcalendar.io/ | ||
@@ -9,80 +9,35 @@ (c) 2022 Adam Shaw | ||
/*! ***************************************************************************** | ||
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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
function __extends(d, b) { | ||
if (typeof b !== "function" && b !== null) | ||
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | ||
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); | ||
}; | ||
var ListViewHeaderRow = /** @class */ (function (_super) { | ||
__extends(ListViewHeaderRow, _super); | ||
function ListViewHeaderRow() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.state = { | ||
class ListViewHeaderRow extends common.BaseComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.state = { | ||
textId: common.getUniqueDomId(), | ||
}; | ||
return _this; | ||
} | ||
ListViewHeaderRow.prototype.render = function () { | ||
var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options, viewApi = _a.viewApi; | ||
var _b = this.props, cellId = _b.cellId, dayDate = _b.dayDate, todayRange = _b.todayRange; | ||
var textId = this.state.textId; | ||
var dayMeta = common.getDateMeta(dayDate, todayRange); | ||
render() { | ||
let { theme, dateEnv, options, viewApi } = this.context; | ||
let { cellId, dayDate, todayRange } = this.props; | ||
let { textId } = this.state; | ||
let dayMeta = common.getDateMeta(dayDate, todayRange); | ||
// will ever be falsy? | ||
var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; | ||
let text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; | ||
// will ever be falsy? also, BAD NAME "alt" | ||
var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; | ||
var hookProps = __assign({ date: dateEnv.toDate(dayDate), view: viewApi, textId: textId, | ||
text: text, | ||
sideText: sideText, navLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate), sideNavLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate, 'day', false) }, dayMeta); | ||
var classNames = ['fc-list-day'].concat(common.getDayClassNames(dayMeta, theme)); | ||
let sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; | ||
let hookProps = Object.assign({ date: dateEnv.toDate(dayDate), view: viewApi, textId, | ||
text, | ||
sideText, navLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate), sideNavLinkAttrs: common.buildNavLinkAttrs(this.context, dayDate, 'day', false) }, dayMeta); | ||
let classNames = ['fc-list-day'].concat(common.getDayClassNames(dayMeta, theme)); | ||
// TODO: make a reusable HOC for dayHeader (used in daygrid/timegrid too) | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (common.createElement("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": common.formatDayString(dayDate) }, | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, (rootElRef, customClassNames, innerElRef, innerContent) => (common.createElement("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": common.formatDayString(dayDate) }, | ||
common.createElement("th", { scope: "colgroup", colSpan: 3, id: cellId, "aria-labelledby": textId }, | ||
common.createElement("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))); })); | ||
}; | ||
return ListViewHeaderRow; | ||
}(common.BaseComponent)); | ||
common.createElement("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))))); | ||
} | ||
} | ||
function renderInnerContent(props) { | ||
return (common.createElement(common.Fragment, null, | ||
props.text && (common.createElement("a", __assign({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), | ||
props.sideText && ( /* not keyboard tabbable */common.createElement("a", __assign({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); | ||
props.text && (common.createElement("a", Object.assign({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), | ||
props.sideText && ( /* not keyboard tabbable */common.createElement("a", Object.assign({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); | ||
} | ||
var DEFAULT_TIME_FORMAT = common.createFormatter({ | ||
const DEFAULT_TIME_FORMAT = common.createFormatter({ | ||
hour: 'numeric', | ||
@@ -92,31 +47,26 @@ minute: '2-digit', | ||
}); | ||
var ListViewEventRow = /** @class */ (function (_super) { | ||
__extends(ListViewEventRow, _super); | ||
function ListViewEventRow() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ListViewEventRow.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var seg = props.seg, timeHeaderId = props.timeHeaderId, eventHeaderId = props.eventHeaderId, dateHeaderId = props.dateHeaderId; | ||
var timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
class ListViewEventRow extends common.BaseComponent { | ||
render() { | ||
let { props, context } = this; | ||
let { seg, timeHeaderId, eventHeaderId, dateHeaderId } = props; | ||
let timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
return (common.createElement(common.EventRoot, { seg: seg, timeText: "" // BAD. because of all-day content | ||
, disableDragging: true, disableResizing: true, defaultContent: function () { return renderEventInnerContent(seg, context); } /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (common.createElement("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, | ||
, disableDragging: true, disableResizing: true, defaultContent: () => renderEventInnerContent(seg, context) /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, (rootElRef, classNames, innerElRef, innerContent, hookProps) => (common.createElement("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, | ||
buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId), | ||
common.createElement("td", { "aria-hidden": true, className: "fc-list-event-graphic" }, | ||
common.createElement("span", { className: "fc-list-event-dot", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
common.createElement("td", { ref: innerElRef, headers: eventHeaderId + " " + dateHeaderId, className: "fc-list-event-title" }, innerContent))); })); | ||
}; | ||
return ListViewEventRow; | ||
}(common.BaseComponent)); | ||
common.createElement("td", { ref: innerElRef, headers: `${eventHeaderId} ${dateHeaderId}`, className: "fc-list-event-title" }, innerContent))))); | ||
} | ||
} | ||
function renderEventInnerContent(seg, context) { | ||
var interactiveAttrs = common.getSegAnchorAttrs(seg, context); | ||
return (common.createElement("a", __assign({}, interactiveAttrs), seg.eventRange.def.title)); | ||
let interactiveAttrs = common.getSegAnchorAttrs(seg, context); | ||
return (common.createElement("a", Object.assign({}, interactiveAttrs), seg.eventRange.def.title)); | ||
} | ||
function buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId) { | ||
var options = context.options; | ||
let { options } = context; | ||
if (options.displayEventTime !== false) { | ||
var eventDef = seg.eventRange.def; | ||
var eventInstance = seg.eventRange.instance; | ||
var doAllDay = false; | ||
var timeText = void 0; | ||
let eventDef = seg.eventRange.def; | ||
let eventInstance = seg.eventRange.instance; | ||
let doAllDay = false; | ||
let timeText; | ||
if (eventDef.allDay) { | ||
@@ -140,7 +90,7 @@ doAllDay = true; | ||
if (doAllDay) { | ||
var hookProps = { | ||
let hookProps = { | ||
text: context.options.allDayText, | ||
view: context.viewApi, | ||
}; | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (common.createElement("td", { ref: rootElRef, headers: timeHeaderId + " " + dateHeaderId, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)); })); | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, (rootElRef, classNames, innerElRef, innerContent) => (common.createElement("td", { ref: rootElRef, headers: `${timeHeaderId} ${dateHeaderId}`, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)))); | ||
} | ||
@@ -158,9 +108,8 @@ return (common.createElement("td", { className: "fc-list-event-time" }, timeText)); | ||
*/ | ||
var ListView = /** @class */ (function (_super) { | ||
__extends(ListView, _super); | ||
function ListView() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.computeDateVars = common.memoize(computeDateVars); | ||
_this.eventStoreToSegs = common.memoize(_this._eventStoreToSegs); | ||
_this.state = { | ||
class ListView extends common.DateComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.computeDateVars = common.memoize(computeDateVars); | ||
this.eventStoreToSegs = common.memoize(this._eventStoreToSegs); | ||
this.state = { | ||
timeHeaderId: common.getUniqueDomId(), | ||
@@ -170,5 +119,5 @@ eventHeaderId: common.getUniqueDomId(), | ||
}; | ||
_this.setRootEl = function (rootEl) { | ||
this.setRootEl = (rootEl) => { | ||
if (rootEl) { | ||
_this.context.registerInteractiveComponent(_this, { | ||
this.context.registerInteractiveComponent(this, { | ||
el: rootEl, | ||
@@ -178,11 +127,9 @@ }); | ||
else { | ||
_this.context.unregisterInteractiveComponent(_this); | ||
this.context.unregisterInteractiveComponent(this); | ||
} | ||
}; | ||
return _this; | ||
} | ||
ListView.prototype.render = function () { | ||
var _this = this; | ||
var _a = this, props = _a.props, context = _a.context; | ||
var extraClassNames = [ | ||
render() { | ||
let { props, context } = this; | ||
let extraClassNames = [ | ||
'fc-list', | ||
@@ -192,35 +139,34 @@ context.theme.getClass('table'), | ||
]; | ||
var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges; | ||
var eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); | ||
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, function (rootElRef, classNames) { return (common.createElement("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, | ||
let { dayDates, dayRanges } = this.computeDateVars(props.dateProfile); | ||
let eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); | ||
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, (rootElRef, classNames) => (common.createElement("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, | ||
common.createElement(common.Scroller, { liquid: !props.isHeightAuto, overflowX: props.isHeightAuto ? 'visible' : 'hidden', overflowY: props.isHeightAuto ? 'visible' : 'auto' }, eventSegs.length > 0 ? | ||
_this.renderSegList(eventSegs, dayDates) : | ||
_this.renderEmptyMessage()))); })); | ||
}; | ||
ListView.prototype.renderEmptyMessage = function () { | ||
var _a = this.context, options = _a.options, viewApi = _a.viewApi; | ||
var hookProps = { | ||
this.renderSegList(eventSegs, dayDates) : | ||
this.renderEmptyMessage()))))); | ||
} | ||
renderEmptyMessage() { | ||
let { options, viewApi } = this.context; | ||
let hookProps = { | ||
text: options.noEventsText, | ||
view: viewApi, | ||
}; | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (common.createElement("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, | ||
common.createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))); })); | ||
}; | ||
ListView.prototype.renderSegList = function (allSegs, dayDates) { | ||
var _a = this.context, theme = _a.theme, options = _a.options; | ||
var _b = this.state, timeHeaderId = _b.timeHeaderId, eventHeaderId = _b.eventHeaderId, dateHeaderIdRoot = _b.dateHeaderIdRoot; | ||
var segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (common.createElement(common.NowTimer, { unit: "day" }, function (nowDate, todayRange) { | ||
var innerNodes = []; | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
var daySegs = segsByDay[dayIndex]; | ||
return (common.createElement(common.RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, (rootElRef, classNames, innerElRef, innerContent) => (common.createElement("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, | ||
common.createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))))); | ||
} | ||
renderSegList(allSegs, dayDates) { | ||
let { theme, options } = this.context; | ||
let { timeHeaderId, eventHeaderId, dateHeaderIdRoot } = this.state; | ||
let segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (common.createElement(common.NowTimer, { unit: "day" }, (nowDate, todayRange) => { | ||
let innerNodes = []; | ||
for (let dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
let daySegs = segsByDay[dayIndex]; | ||
if (daySegs) { // sparse array, so might be undefined | ||
var dayStr = common.formatDayString(dayDates[dayIndex]); | ||
var dateHeaderId = dateHeaderIdRoot + '-' + dayStr; | ||
let dayStr = common.formatDayString(dayDates[dayIndex]); | ||
let dateHeaderId = dateHeaderIdRoot + '-' + dayStr; | ||
// append a day header | ||
innerNodes.push(common.createElement(ListViewHeaderRow, { key: dayStr, cellId: dateHeaderId, dayDate: dayDates[dayIndex], todayRange: todayRange })); | ||
daySegs = common.sortEventSegs(daySegs, options.eventOrder); | ||
for (var _i = 0, daySegs_1 = daySegs; _i < daySegs_1.length; _i++) { | ||
var seg = daySegs_1[_i]; | ||
innerNodes.push(common.createElement(ListViewEventRow, __assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, common.getSegMeta(seg, todayRange, nowDate)))); | ||
for (let seg of daySegs) { | ||
innerNodes.push(common.createElement(ListViewEventRow, Object.assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, common.getSegMeta(seg, todayRange, nowDate)))); | ||
} | ||
@@ -237,23 +183,22 @@ } | ||
})); | ||
}; | ||
ListView.prototype._eventStoreToSegs = function (eventStore, eventUiBases, dayRanges) { | ||
} | ||
_eventStoreToSegs(eventStore, eventUiBases, dayRanges) { | ||
return this.eventRangesToSegs(common.sliceEventStore(eventStore, eventUiBases, this.props.dateProfile.activeRange, this.context.options.nextDayThreshold).fg, dayRanges); | ||
}; | ||
ListView.prototype.eventRangesToSegs = function (eventRanges, dayRanges) { | ||
var segs = []; | ||
for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) { | ||
var eventRange = eventRanges_1[_i]; | ||
segs.push.apply(segs, this.eventRangeToSegs(eventRange, dayRanges)); | ||
} | ||
eventRangesToSegs(eventRanges, dayRanges) { | ||
let segs = []; | ||
for (let eventRange of eventRanges) { | ||
segs.push(...this.eventRangeToSegs(eventRange, dayRanges)); | ||
} | ||
return segs; | ||
}; | ||
ListView.prototype.eventRangeToSegs = function (eventRange, dayRanges) { | ||
var dateEnv = this.context.dateEnv; | ||
var nextDayThreshold = this.context.options.nextDayThreshold; | ||
var range = eventRange.range; | ||
var allDay = eventRange.def.allDay; | ||
var dayIndex; | ||
var segRange; | ||
var seg; | ||
var segs = []; | ||
} | ||
eventRangeToSegs(eventRange, dayRanges) { | ||
let { dateEnv } = this.context; | ||
let { nextDayThreshold } = this.context.options; | ||
let range = eventRange.range; | ||
let allDay = eventRange.def.allDay; | ||
let dayIndex; | ||
let segRange; | ||
let seg; | ||
let segs = []; | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) { | ||
@@ -264,3 +209,3 @@ segRange = common.intersectRanges(range, dayRanges[dayIndex]); | ||
component: this, | ||
eventRange: eventRange, | ||
eventRange, | ||
start: segRange.start, | ||
@@ -270,3 +215,3 @@ end: segRange.end, | ||
isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(), | ||
dayIndex: dayIndex, | ||
dayIndex, | ||
}; | ||
@@ -287,5 +232,4 @@ segs.push(seg); | ||
return segs; | ||
}; | ||
return ListView; | ||
}(common.DateComponent)); | ||
} | ||
} | ||
function renderNoEventsInner(hookProps) { | ||
@@ -295,6 +239,6 @@ return hookProps.text; | ||
function computeDateVars(dateProfile) { | ||
var dayStart = common.startOfDay(dateProfile.renderRange.start); | ||
var viewEnd = dateProfile.renderRange.end; | ||
var dayDates = []; | ||
var dayRanges = []; | ||
let dayStart = common.startOfDay(dateProfile.renderRange.start); | ||
let viewEnd = dateProfile.renderRange.end; | ||
let dayDates = []; | ||
let dayRanges = []; | ||
while (dayStart < viewEnd) { | ||
@@ -308,9 +252,9 @@ dayDates.push(dayStart); | ||
} | ||
return { dayDates: dayDates, dayRanges: dayRanges }; | ||
return { dayDates, dayRanges }; | ||
} | ||
// Returns a sparse array of arrays, segs grouped by their dayIndex | ||
function groupSegsByDay(segs) { | ||
var segsByDay = []; // sparse array | ||
var i; | ||
var seg; | ||
let segsByDay = []; // sparse array | ||
let i; | ||
let seg; | ||
for (i = 0; i < segs.length; i += 1) { | ||
@@ -324,3 +268,3 @@ seg = segs[i]; | ||
var OPTION_REFINERS = { | ||
const OPTION_REFINERS = { | ||
listDayFormat: createFalsableFormatter, | ||
@@ -338,2 +282,32 @@ listDaySideFormat: createFalsableFormatter, | ||
function styleInject(css, ref) { | ||
if ( ref === void 0 ) ref = {}; | ||
var insertAt = ref.insertAt; | ||
if (!css || typeof document === 'undefined') { return; } | ||
var head = document.head || document.getElementsByTagName('head')[0]; | ||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
if (insertAt === 'top') { | ||
if (head.firstChild) { | ||
head.insertBefore(style, head.firstChild); | ||
} else { | ||
head.appendChild(style); | ||
} | ||
} else { | ||
head.appendChild(style); | ||
} | ||
if (style.styleSheet) { | ||
style.styleSheet.cssText = css; | ||
} else { | ||
style.appendChild(document.createTextNode(css)); | ||
} | ||
} | ||
var css_248z = "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n.fc-theme-standard .fc-list {\n border: 1px solid #ddd;\n border: 1px solid var(--fc-border-color, #ddd);\n }\n.fc {\n\n /* message when no events */\n\n}\n.fc .fc-list-empty {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: #fff;\n background: var(--fc-page-bg-color, #fff); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: #f5f5f5;\n background-color: var(--fc-list-event-hover-bg-color, #f5f5f5);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 5px solid #3788d8;\n border: calc(var(--fc-list-event-dot-width, 10px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 5px;\n border-radius: calc(var(--fc-list-event-dot-width, 10px) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n"; | ||
styleInject(css_248z); | ||
var plugin = common.createPlugin({ | ||
@@ -340,0 +314,0 @@ optionRefiners: OPTION_REFINERS, |
/*! | ||
FullCalendar v5.11.2 | ||
FullCalendar v6.0.0-beta.1 | ||
Docs & License: https://fullcalendar.io/ | ||
(c) 2022 Adam Shaw | ||
*/ | ||
var FullCalendarList=function(e,t){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}var r=function(){return(r=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.state={textId:t.getUniqueDomId()},n}return a(n,e),n.prototype.render=function(){var e=this.context,n=e.theme,a=e.dateEnv,i=e.options,s=e.viewApi,l=this.props,d=l.cellId,c=l.dayDate,u=l.todayRange,m=this.state.textId,v=t.getDateMeta(c,u),y=i.listDayFormat?a.format(c,i.listDayFormat):"",f=i.listDaySideFormat?a.format(c,i.listDaySideFormat):"",g=r({date:a.toDate(c),view:s,textId:m,text:y,sideText:f,navLinkAttrs:t.buildNavLinkAttrs(this.context,c),sideNavLinkAttrs:t.buildNavLinkAttrs(this.context,c,"day",!1)},v),p=["fc-list-day"].concat(t.getDayClassNames(v,n));return t.createElement(t.RenderHook,{hookProps:g,classNames:i.dayHeaderClassNames,content:i.dayHeaderContent,defaultContent:o,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},(function(e,a,r,i){return t.createElement("tr",{ref:e,className:p.concat(a).join(" "),"data-date":t.formatDayString(c)},t.createElement("th",{scope:"colgroup",colSpan:3,id:d,"aria-labelledby":m},t.createElement("div",{className:"fc-list-day-cushion "+n.getClass("tableCellShaded"),ref:r},i)))}))},n}(t.BaseComponent);function o(e){return t.createElement(t.Fragment,null,e.text&&t.createElement("a",r({id:e.textId,className:"fc-list-day-text"},e.navLinkAttrs),e.text),e.sideText&&t.createElement("a",r({"aria-hidden":!0,className:"fc-list-day-side-text"},e.sideNavLinkAttrs),e.sideText))}var s=t.createFormatter({hour:"numeric",minute:"2-digit",meridiem:"short"}),l=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.render=function(){var e=this.props,n=this.context,a=e.seg,i=e.timeHeaderId,o=e.eventHeaderId,l=e.dateHeaderId,c=n.options.eventTimeFormat||s;return t.createElement(t.EventRoot,{seg:a,timeText:"",disableDragging:!0,disableResizing:!0,defaultContent:function(){return function(e,n){var a=t.getSegAnchorAttrs(e,n);return t.createElement("a",r({},a),e.eventRange.def.title)}(a,n)},isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,isSelected:e.isSelected,isDragging:e.isDragging,isResizing:e.isResizing,isDateSelecting:e.isDateSelecting},(function(e,r,s,u,m){return t.createElement("tr",{className:["fc-list-event",m.event.url?"fc-event-forced-url":""].concat(r).join(" "),ref:e},function(e,n,a,r,i){var o=a.options;if(!1!==o.displayEventTime){var s=e.eventRange.def,l=e.eventRange.instance,c=!1,u=void 0;if(s.allDay?c=!0:t.isMultiDayRange(e.eventRange.range)?e.isStart?u=t.buildSegTimeText(e,n,a,null,null,l.range.start,e.end):e.isEnd?u=t.buildSegTimeText(e,n,a,null,null,e.start,l.range.end):c=!0:u=t.buildSegTimeText(e,n,a),c){var m={text:a.options.allDayText,view:a.viewApi};return t.createElement(t.RenderHook,{hookProps:m,classNames:o.allDayClassNames,content:o.allDayContent,defaultContent:d,didMount:o.allDayDidMount,willUnmount:o.allDayWillUnmount},(function(e,n,a,o){return t.createElement("td",{ref:e,headers:r+" "+i,className:["fc-list-event-time"].concat(n).join(" ")},o)}))}return t.createElement("td",{className:"fc-list-event-time"},u)}return null}(a,c,n,i,l),t.createElement("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},t.createElement("span",{className:"fc-list-event-dot",style:{borderColor:m.borderColor||m.backgroundColor}})),t.createElement("td",{ref:s,headers:o+" "+l,className:"fc-list-event-title"},u))}))},n}(t.BaseComponent);function d(e){return e.text}var c=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.computeDateVars=t.memoize(m),n.eventStoreToSegs=t.memoize(n._eventStoreToSegs),n.state={timeHeaderId:t.getUniqueDomId(),eventHeaderId:t.getUniqueDomId(),dateHeaderIdRoot:t.getUniqueDomId()},n.setRootEl=function(e){e?n.context.registerInteractiveComponent(n,{el:e}):n.context.unregisterInteractiveComponent(n)},n}return a(n,e),n.prototype.render=function(){var e=this,n=this.props,a=this.context,r=["fc-list",a.theme.getClass("table"),!1!==a.options.stickyHeaderDates?"fc-list-sticky":""],i=this.computeDateVars(n.dateProfile),o=i.dayDates,s=i.dayRanges,l=this.eventStoreToSegs(n.eventStore,n.eventUiBases,s);return t.createElement(t.ViewRoot,{viewSpec:a.viewSpec,elRef:this.setRootEl},(function(a,i){return t.createElement("div",{ref:a,className:r.concat(i).join(" ")},t.createElement(t.Scroller,{liquid:!n.isHeightAuto,overflowX:n.isHeightAuto?"visible":"hidden",overflowY:n.isHeightAuto?"visible":"auto"},l.length>0?e.renderSegList(l,o):e.renderEmptyMessage()))}))},n.prototype.renderEmptyMessage=function(){var e=this.context,n=e.options,a=e.viewApi,r={text:n.noEventsText,view:a};return t.createElement(t.RenderHook,{hookProps:r,classNames:n.noEventsClassNames,content:n.noEventsContent,defaultContent:u,didMount:n.noEventsDidMount,willUnmount:n.noEventsWillUnmount},(function(e,n,a,r){return t.createElement("div",{className:["fc-list-empty"].concat(n).join(" "),ref:e},t.createElement("div",{className:"fc-list-empty-cushion",ref:a},r))}))},n.prototype.renderSegList=function(e,n){var a=this.context,o=a.theme,s=a.options,d=this.state,c=d.timeHeaderId,u=d.eventHeaderId,m=d.dateHeaderIdRoot,v=function(e){var t,n,a=[];for(t=0;t<e.length;t+=1)(a[(n=e[t]).dayIndex]||(a[n.dayIndex]=[])).push(n);return a}(e);return t.createElement(t.NowTimer,{unit:"day"},(function(e,a){for(var d=[],y=0;y<v.length;y+=1){var f=v[y];if(f){var g=t.formatDayString(n[y]),p=m+"-"+g;d.push(t.createElement(i,{key:g,cellId:p,dayDate:n[y],todayRange:a}));for(var h=0,E=f=t.sortEventSegs(f,s.eventOrder);h<E.length;h++){var D=E[h];d.push(t.createElement(l,r({key:g+":"+D.eventRange.instance.instanceId,seg:D,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:c,eventHeaderId:u,dateHeaderId:p},t.getSegMeta(D,a,e))))}}}return t.createElement("table",{className:"fc-list-table "+o.getClass("table")},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",{scope:"col",id:c},s.timeHint),t.createElement("th",{scope:"col","aria-hidden":!0}),t.createElement("th",{scope:"col",id:u},s.eventHint))),t.createElement("tbody",null,d))}))},n.prototype._eventStoreToSegs=function(e,n,a){return this.eventRangesToSegs(t.sliceEventStore(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,a)},n.prototype.eventRangesToSegs=function(e,t){for(var n=[],a=0,r=e;a<r.length;a++){var i=r[a];n.push.apply(n,this.eventRangeToSegs(i,t))}return n},n.prototype.eventRangeToSegs=function(e,n){var a,r,i,o=this.context.dateEnv,s=this.context.options.nextDayThreshold,l=e.range,d=e.def.allDay,c=[];for(a=0;a<n.length;a+=1)if((r=t.intersectRanges(l,n[a]))&&(i={component:this,eventRange:e,start:r.start,end:r.end,isStart:e.isStart&&r.start.valueOf()===l.start.valueOf(),isEnd:e.isEnd&&r.end.valueOf()===l.end.valueOf(),dayIndex:a},c.push(i),!i.isEnd&&!d&&a+1<n.length&&l.end<o.add(n[a+1].start,s))){i.end=l.end,i.isEnd=!0;break}return c},n}(t.DateComponent);function u(e){return e.text}function m(e){for(var n=t.startOfDay(e.renderRange.start),a=e.renderRange.end,r=[],i=[];n<a;)r.push(n),i.push({start:n,end:t.addDays(n,1)}),n=t.addDays(n,1);return{dayDates:r,dayRanges:i}}var v={listDayFormat:y,listDaySideFormat:y,noEventsClassNames:t.identity,noEventsContent:t.identity,noEventsDidMount:t.identity,noEventsWillUnmount:t.identity};function y(e){return!1===e?null:t.createFormatter(e)}var f=t.createPlugin({optionRefiners:v,views:{list:{component:c,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}});return t.globalPlugins.push(f),e.ListView=c,e.default=f,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar); | ||
var FullCalendarList=function(e,t){"use strict";class n extends t.BaseComponent{constructor(){super(...arguments),this.state={textId:t.getUniqueDomId()}}render(){let{theme:e,dateEnv:n,options:i,viewApi:s}=this.context,{cellId:r,dayDate:o,todayRange:l}=this.props,{textId:d}=this.state,c=t.getDateMeta(o,l),f=i.listDayFormat?n.format(o,i.listDayFormat):"",u=i.listDaySideFormat?n.format(o,i.listDaySideFormat):"",m=Object.assign({date:n.toDate(o),view:s,textId:d,text:f,sideText:u,navLinkAttrs:t.buildNavLinkAttrs(this.context,o),sideNavLinkAttrs:t.buildNavLinkAttrs(this.context,o,"day",!1)},c),g=["fc-list-day"].concat(t.getDayClassNames(c,e));return t.createElement(t.RenderHook,{hookProps:m,classNames:i.dayHeaderClassNames,content:i.dayHeaderContent,defaultContent:a,didMount:i.dayHeaderDidMount,willUnmount:i.dayHeaderWillUnmount},((n,a,i,s)=>t.createElement("tr",{ref:n,className:g.concat(a).join(" "),"data-date":t.formatDayString(o)},t.createElement("th",{scope:"colgroup",colSpan:3,id:r,"aria-labelledby":d},t.createElement("div",{className:"fc-list-day-cushion "+e.getClass("tableCellShaded"),ref:i},s)))))}}function a(e){return t.createElement(t.Fragment,null,e.text&&t.createElement("a",Object.assign({id:e.textId,className:"fc-list-day-text"},e.navLinkAttrs),e.text),e.sideText&&t.createElement("a",Object.assign({"aria-hidden":!0,className:"fc-list-day-side-text"},e.sideNavLinkAttrs),e.sideText))}const i=t.createFormatter({hour:"numeric",minute:"2-digit",meridiem:"short"});class s extends t.BaseComponent{render(){let{props:e,context:n}=this,{seg:a,timeHeaderId:s,eventHeaderId:o,dateHeaderId:l}=e,d=n.options.eventTimeFormat||i;return t.createElement(t.EventRoot,{seg:a,timeText:"",disableDragging:!0,disableResizing:!0,defaultContent:()=>function(e,n){let a=t.getSegAnchorAttrs(e,n);return t.createElement("a",Object.assign({},a),e.eventRange.def.title)}(a,n),isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,isSelected:e.isSelected,isDragging:e.isDragging,isResizing:e.isResizing,isDateSelecting:e.isDateSelecting},((e,i,c,f,u)=>t.createElement("tr",{className:["fc-list-event",u.event.url?"fc-event-forced-url":""].concat(i).join(" "),ref:e},function(e,n,a,i,s){let{options:o}=a;if(!1!==o.displayEventTime){let l,d=e.eventRange.def,c=e.eventRange.instance,f=!1;if(d.allDay?f=!0:t.isMultiDayRange(e.eventRange.range)?e.isStart?l=t.buildSegTimeText(e,n,a,null,null,c.range.start,e.end):e.isEnd?l=t.buildSegTimeText(e,n,a,null,null,e.start,c.range.end):f=!0:l=t.buildSegTimeText(e,n,a),f){let e={text:a.options.allDayText,view:a.viewApi};return t.createElement(t.RenderHook,{hookProps:e,classNames:o.allDayClassNames,content:o.allDayContent,defaultContent:r,didMount:o.allDayDidMount,willUnmount:o.allDayWillUnmount},((e,n,a,r)=>t.createElement("td",{ref:e,headers:`${i} ${s}`,className:["fc-list-event-time"].concat(n).join(" ")},r)))}return t.createElement("td",{className:"fc-list-event-time"},l)}return null}(a,d,n,s,l),t.createElement("td",{"aria-hidden":!0,className:"fc-list-event-graphic"},t.createElement("span",{className:"fc-list-event-dot",style:{borderColor:u.borderColor||u.backgroundColor}})),t.createElement("td",{ref:c,headers:`${o} ${l}`,className:"fc-list-event-title"},f))))}}function r(e){return e.text}class o extends t.DateComponent{constructor(){super(...arguments),this.computeDateVars=t.memoize(d),this.eventStoreToSegs=t.memoize(this._eventStoreToSegs),this.state={timeHeaderId:t.getUniqueDomId(),eventHeaderId:t.getUniqueDomId(),dateHeaderIdRoot:t.getUniqueDomId()},this.setRootEl=e=>{e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:n}=this,a=["fc-list",n.theme.getClass("table"),!1!==n.options.stickyHeaderDates?"fc-list-sticky":""],{dayDates:i,dayRanges:s}=this.computeDateVars(e.dateProfile),r=this.eventStoreToSegs(e.eventStore,e.eventUiBases,s);return t.createElement(t.ViewRoot,{viewSpec:n.viewSpec,elRef:this.setRootEl},((n,s)=>t.createElement("div",{ref:n,className:a.concat(s).join(" ")},t.createElement(t.Scroller,{liquid:!e.isHeightAuto,overflowX:e.isHeightAuto?"visible":"hidden",overflowY:e.isHeightAuto?"visible":"auto"},r.length>0?this.renderSegList(r,i):this.renderEmptyMessage()))))}renderEmptyMessage(){let{options:e,viewApi:n}=this.context,a={text:e.noEventsText,view:n};return t.createElement(t.RenderHook,{hookProps:a,classNames:e.noEventsClassNames,content:e.noEventsContent,defaultContent:l,didMount:e.noEventsDidMount,willUnmount:e.noEventsWillUnmount},((e,n,a,i)=>t.createElement("div",{className:["fc-list-empty"].concat(n).join(" "),ref:e},t.createElement("div",{className:"fc-list-empty-cushion",ref:a},i))))}renderSegList(e,a){let{theme:i,options:r}=this.context,{timeHeaderId:o,eventHeaderId:l,dateHeaderIdRoot:d}=this.state,c=function(e){let t,n,a=[];for(t=0;t<e.length;t+=1)n=e[t],(a[n.dayIndex]||(a[n.dayIndex]=[])).push(n);return a}(e);return t.createElement(t.NowTimer,{unit:"day"},((e,f)=>{let u=[];for(let i=0;i<c.length;i+=1){let m=c[i];if(m){let c=t.formatDayString(a[i]),g=d+"-"+c;u.push(t.createElement(n,{key:c,cellId:g,dayDate:a[i],todayRange:f})),m=t.sortEventSegs(m,r.eventOrder);for(let n of m)u.push(t.createElement(s,Object.assign({key:c+":"+n.eventRange.instance.instanceId,seg:n,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1,timeHeaderId:o,eventHeaderId:l,dateHeaderId:g},t.getSegMeta(n,f,e))))}}return t.createElement("table",{className:"fc-list-table "+i.getClass("table")},t.createElement("thead",null,t.createElement("tr",null,t.createElement("th",{scope:"col",id:o},r.timeHint),t.createElement("th",{scope:"col","aria-hidden":!0}),t.createElement("th",{scope:"col",id:l},r.eventHint))),t.createElement("tbody",null,u))}))}_eventStoreToSegs(e,n,a){return this.eventRangesToSegs(t.sliceEventStore(e,n,this.props.dateProfile.activeRange,this.context.options.nextDayThreshold).fg,a)}eventRangesToSegs(e,t){let n=[];for(let a of e)n.push(...this.eventRangeToSegs(a,t));return n}eventRangeToSegs(e,n){let a,i,s,{dateEnv:r}=this.context,{nextDayThreshold:o}=this.context.options,l=e.range,d=e.def.allDay,c=[];for(a=0;a<n.length;a+=1)if(i=t.intersectRanges(l,n[a]),i&&(s={component:this,eventRange:e,start:i.start,end:i.end,isStart:e.isStart&&i.start.valueOf()===l.start.valueOf(),isEnd:e.isEnd&&i.end.valueOf()===l.end.valueOf(),dayIndex:a},c.push(s),!s.isEnd&&!d&&a+1<n.length&&l.end<r.add(n[a+1].start,o))){s.end=l.end,s.isEnd=!0;break}return c}}function l(e){return e.text}function d(e){let n=t.startOfDay(e.renderRange.start),a=e.renderRange.end,i=[],s=[];for(;n<a;)i.push(n),s.push({start:n,end:t.addDays(n,1)}),n=t.addDays(n,1);return{dayDates:i,dayRanges:s}}const c={listDayFormat:f,listDaySideFormat:f,noEventsClassNames:t.identity,noEventsContent:t.identity,noEventsDidMount:t.identity,noEventsWillUnmount:t.identity};function f(e){return!1===e?null:t.createFormatter(e)}!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===n&&a.firstChild?a.insertBefore(i,a.firstChild):a.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}('\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n.fc-theme-standard .fc-list {\n border: 1px solid #ddd;\n border: 1px solid var(--fc-border-color, #ddd);\n }\n.fc {\n\n /* message when no events */\n\n}\n.fc .fc-list-empty {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: #fff;\n background: var(--fc-page-bg-color, #fff); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table\'s border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: "";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: #f5f5f5;\n background-color: var(--fc-list-event-hover-bg-color, #f5f5f5);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 5px solid #3788d8;\n border: calc(var(--fc-list-event-dot-width, 10px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 5px;\n border-radius: calc(var(--fc-list-event-dot-width, 10px) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n');var u=t.createPlugin({optionRefiners:c,views:{list:{component:o,buttonTextKey:"list",listDayFormat:{month:"long",day:"numeric",year:"numeric"}},listDay:{type:"list",duration:{days:1},listDayFormat:{weekday:"long"}},listWeek:{type:"list",duration:{weeks:1},listDayFormat:{weekday:"long"},listDaySideFormat:{month:"long",day:"numeric",year:"numeric"}},listMonth:{type:"list",duration:{month:1},listDaySideFormat:{weekday:"long"}},listYear:{type:"list",duration:{year:1},listDaySideFormat:{weekday:"long"}}}});return t.globalPlugins.push(u),e.ListView=o,e.default=u,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar); |
263
main.js
/*! | ||
FullCalendar v5.11.2 | ||
FullCalendar v6.0.0-beta.1 | ||
Docs & License: https://fullcalendar.io/ | ||
(c) 2022 Adam Shaw | ||
*/ | ||
import './main.css'; | ||
import { BaseComponent, getUniqueDomId, getDateMeta, buildNavLinkAttrs, getDayClassNames, createElement, RenderHook, formatDayString, Fragment, createFormatter, EventRoot, getSegAnchorAttrs, isMultiDayRange, buildSegTimeText, DateComponent, memoize, ViewRoot, Scroller, NowTimer, sortEventSegs, getSegMeta, sliceEventStore, intersectRanges, startOfDay, addDays, identity, createPlugin } from '@fullcalendar/common'; | ||
import { getUniqueDomId, getDateMeta, buildNavLinkAttrs, getDayClassNames, createElement, RenderHook, formatDayString, BaseComponent, Fragment, createFormatter, EventRoot, getSegAnchorAttrs, isMultiDayRange, buildSegTimeText, memoize, ViewRoot, Scroller, NowTimer, sortEventSegs, getSegMeta, sliceEventStore, intersectRanges, DateComponent, startOfDay, addDays, identity, createPlugin } from '@fullcalendar/common'; | ||
import { __extends, __assign } from 'tslib'; | ||
var ListViewHeaderRow = /** @class */ (function (_super) { | ||
__extends(ListViewHeaderRow, _super); | ||
function ListViewHeaderRow() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.state = { | ||
class ListViewHeaderRow extends BaseComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.state = { | ||
textId: getUniqueDomId(), | ||
}; | ||
return _this; | ||
} | ||
ListViewHeaderRow.prototype.render = function () { | ||
var _a = this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options, viewApi = _a.viewApi; | ||
var _b = this.props, cellId = _b.cellId, dayDate = _b.dayDate, todayRange = _b.todayRange; | ||
var textId = this.state.textId; | ||
var dayMeta = getDateMeta(dayDate, todayRange); | ||
render() { | ||
let { theme, dateEnv, options, viewApi } = this.context; | ||
let { cellId, dayDate, todayRange } = this.props; | ||
let { textId } = this.state; | ||
let dayMeta = getDateMeta(dayDate, todayRange); | ||
// will ever be falsy? | ||
var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; | ||
let text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; | ||
// will ever be falsy? also, BAD NAME "alt" | ||
var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; | ||
var hookProps = __assign({ date: dateEnv.toDate(dayDate), view: viewApi, textId: textId, | ||
text: text, | ||
sideText: sideText, navLinkAttrs: buildNavLinkAttrs(this.context, dayDate), sideNavLinkAttrs: buildNavLinkAttrs(this.context, dayDate, 'day', false) }, dayMeta); | ||
var classNames = ['fc-list-day'].concat(getDayClassNames(dayMeta, theme)); | ||
let sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; | ||
let hookProps = Object.assign({ date: dateEnv.toDate(dayDate), view: viewApi, textId, | ||
text, | ||
sideText, navLinkAttrs: buildNavLinkAttrs(this.context, dayDate), sideNavLinkAttrs: buildNavLinkAttrs(this.context, dayDate, 'day', false) }, dayMeta); | ||
let classNames = ['fc-list-day'].concat(getDayClassNames(dayMeta, theme)); | ||
// TODO: make a reusable HOC for dayHeader (used in daygrid/timegrid too) | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": formatDayString(dayDate) }, | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.dayHeaderClassNames, content: options.dayHeaderContent, defaultContent: renderInnerContent, didMount: options.dayHeaderDidMount, willUnmount: options.dayHeaderWillUnmount }, (rootElRef, customClassNames, innerElRef, innerContent) => (createElement("tr", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": formatDayString(dayDate) }, | ||
createElement("th", { scope: "colgroup", colSpan: 3, id: cellId, "aria-labelledby": textId }, | ||
createElement("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))); })); | ||
}; | ||
return ListViewHeaderRow; | ||
}(BaseComponent)); | ||
createElement("div", { className: 'fc-list-day-cushion ' + theme.getClass('tableCellShaded'), ref: innerElRef }, innerContent)))))); | ||
} | ||
} | ||
function renderInnerContent(props) { | ||
return (createElement(Fragment, null, | ||
props.text && (createElement("a", __assign({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), | ||
props.sideText && ( /* not keyboard tabbable */createElement("a", __assign({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); | ||
props.text && (createElement("a", Object.assign({ id: props.textId, className: "fc-list-day-text" }, props.navLinkAttrs), props.text)), | ||
props.sideText && ( /* not keyboard tabbable */createElement("a", Object.assign({ "aria-hidden": true, className: "fc-list-day-side-text" }, props.sideNavLinkAttrs), props.sideText)))); | ||
} | ||
var DEFAULT_TIME_FORMAT = createFormatter({ | ||
const DEFAULT_TIME_FORMAT = createFormatter({ | ||
hour: 'numeric', | ||
@@ -51,31 +45,26 @@ minute: '2-digit', | ||
}); | ||
var ListViewEventRow = /** @class */ (function (_super) { | ||
__extends(ListViewEventRow, _super); | ||
function ListViewEventRow() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
ListViewEventRow.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var seg = props.seg, timeHeaderId = props.timeHeaderId, eventHeaderId = props.eventHeaderId, dateHeaderId = props.dateHeaderId; | ||
var timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
class ListViewEventRow extends BaseComponent { | ||
render() { | ||
let { props, context } = this; | ||
let { seg, timeHeaderId, eventHeaderId, dateHeaderId } = props; | ||
let timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
return (createElement(EventRoot, { seg: seg, timeText: "" // BAD. because of all-day content | ||
, disableDragging: true, disableResizing: true, defaultContent: function () { return renderEventInnerContent(seg, context); } /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, function (rootElRef, classNames, innerElRef, innerContent, hookProps) { return (createElement("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, | ||
, disableDragging: true, disableResizing: true, defaultContent: () => renderEventInnerContent(seg, context) /* weird */, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday, isSelected: props.isSelected, isDragging: props.isDragging, isResizing: props.isResizing, isDateSelecting: props.isDateSelecting }, (rootElRef, classNames, innerElRef, innerContent, hookProps) => (createElement("tr", { className: ['fc-list-event', hookProps.event.url ? 'fc-event-forced-url' : ''].concat(classNames).join(' '), ref: rootElRef }, | ||
buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId), | ||
createElement("td", { "aria-hidden": true, className: "fc-list-event-graphic" }, | ||
createElement("span", { className: "fc-list-event-dot", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
createElement("td", { ref: innerElRef, headers: eventHeaderId + " " + dateHeaderId, className: "fc-list-event-title" }, innerContent))); })); | ||
}; | ||
return ListViewEventRow; | ||
}(BaseComponent)); | ||
createElement("td", { ref: innerElRef, headers: `${eventHeaderId} ${dateHeaderId}`, className: "fc-list-event-title" }, innerContent))))); | ||
} | ||
} | ||
function renderEventInnerContent(seg, context) { | ||
var interactiveAttrs = getSegAnchorAttrs(seg, context); | ||
return (createElement("a", __assign({}, interactiveAttrs), seg.eventRange.def.title)); | ||
let interactiveAttrs = getSegAnchorAttrs(seg, context); | ||
return (createElement("a", Object.assign({}, interactiveAttrs), seg.eventRange.def.title)); | ||
} | ||
function buildTimeContent(seg, timeFormat, context, timeHeaderId, dateHeaderId) { | ||
var options = context.options; | ||
let { options } = context; | ||
if (options.displayEventTime !== false) { | ||
var eventDef = seg.eventRange.def; | ||
var eventInstance = seg.eventRange.instance; | ||
var doAllDay = false; | ||
var timeText = void 0; | ||
let eventDef = seg.eventRange.def; | ||
let eventInstance = seg.eventRange.instance; | ||
let doAllDay = false; | ||
let timeText; | ||
if (eventDef.allDay) { | ||
@@ -99,7 +88,7 @@ doAllDay = true; | ||
if (doAllDay) { | ||
var hookProps = { | ||
let hookProps = { | ||
text: context.options.allDayText, | ||
view: context.viewApi, | ||
}; | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("td", { ref: rootElRef, headers: timeHeaderId + " " + dateHeaderId, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)); })); | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.allDayClassNames, content: options.allDayContent, defaultContent: renderAllDayInner, didMount: options.allDayDidMount, willUnmount: options.allDayWillUnmount }, (rootElRef, classNames, innerElRef, innerContent) => (createElement("td", { ref: rootElRef, headers: `${timeHeaderId} ${dateHeaderId}`, className: ['fc-list-event-time'].concat(classNames).join(' ') }, innerContent)))); | ||
} | ||
@@ -117,9 +106,8 @@ return (createElement("td", { className: "fc-list-event-time" }, timeText)); | ||
*/ | ||
var ListView = /** @class */ (function (_super) { | ||
__extends(ListView, _super); | ||
function ListView() { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.computeDateVars = memoize(computeDateVars); | ||
_this.eventStoreToSegs = memoize(_this._eventStoreToSegs); | ||
_this.state = { | ||
class ListView extends DateComponent { | ||
constructor() { | ||
super(...arguments); | ||
this.computeDateVars = memoize(computeDateVars); | ||
this.eventStoreToSegs = memoize(this._eventStoreToSegs); | ||
this.state = { | ||
timeHeaderId: getUniqueDomId(), | ||
@@ -129,5 +117,5 @@ eventHeaderId: getUniqueDomId(), | ||
}; | ||
_this.setRootEl = function (rootEl) { | ||
this.setRootEl = (rootEl) => { | ||
if (rootEl) { | ||
_this.context.registerInteractiveComponent(_this, { | ||
this.context.registerInteractiveComponent(this, { | ||
el: rootEl, | ||
@@ -137,11 +125,9 @@ }); | ||
else { | ||
_this.context.unregisterInteractiveComponent(_this); | ||
this.context.unregisterInteractiveComponent(this); | ||
} | ||
}; | ||
return _this; | ||
} | ||
ListView.prototype.render = function () { | ||
var _this = this; | ||
var _a = this, props = _a.props, context = _a.context; | ||
var extraClassNames = [ | ||
render() { | ||
let { props, context } = this; | ||
let extraClassNames = [ | ||
'fc-list', | ||
@@ -151,35 +137,34 @@ context.theme.getClass('table'), | ||
]; | ||
var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges; | ||
var eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); | ||
return (createElement(ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, function (rootElRef, classNames) { return (createElement("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, | ||
let { dayDates, dayRanges } = this.computeDateVars(props.dateProfile); | ||
let eventSegs = this.eventStoreToSegs(props.eventStore, props.eventUiBases, dayRanges); | ||
return (createElement(ViewRoot, { viewSpec: context.viewSpec, elRef: this.setRootEl }, (rootElRef, classNames) => (createElement("div", { ref: rootElRef, className: extraClassNames.concat(classNames).join(' ') }, | ||
createElement(Scroller, { liquid: !props.isHeightAuto, overflowX: props.isHeightAuto ? 'visible' : 'hidden', overflowY: props.isHeightAuto ? 'visible' : 'auto' }, eventSegs.length > 0 ? | ||
_this.renderSegList(eventSegs, dayDates) : | ||
_this.renderEmptyMessage()))); })); | ||
}; | ||
ListView.prototype.renderEmptyMessage = function () { | ||
var _a = this.context, options = _a.options, viewApi = _a.viewApi; | ||
var hookProps = { | ||
this.renderSegList(eventSegs, dayDates) : | ||
this.renderEmptyMessage()))))); | ||
} | ||
renderEmptyMessage() { | ||
let { options, viewApi } = this.context; | ||
let hookProps = { | ||
text: options.noEventsText, | ||
view: viewApi, | ||
}; | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, | ||
createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))); })); | ||
}; | ||
ListView.prototype.renderSegList = function (allSegs, dayDates) { | ||
var _a = this.context, theme = _a.theme, options = _a.options; | ||
var _b = this.state, timeHeaderId = _b.timeHeaderId, eventHeaderId = _b.eventHeaderId, dateHeaderIdRoot = _b.dateHeaderIdRoot; | ||
var segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (createElement(NowTimer, { unit: "day" }, function (nowDate, todayRange) { | ||
var innerNodes = []; | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
var daySegs = segsByDay[dayIndex]; | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.noEventsClassNames, content: options.noEventsContent, defaultContent: renderNoEventsInner, didMount: options.noEventsDidMount, willUnmount: options.noEventsWillUnmount }, (rootElRef, classNames, innerElRef, innerContent) => (createElement("div", { className: ['fc-list-empty'].concat(classNames).join(' '), ref: rootElRef }, | ||
createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))))); | ||
} | ||
renderSegList(allSegs, dayDates) { | ||
let { theme, options } = this.context; | ||
let { timeHeaderId, eventHeaderId, dateHeaderIdRoot } = this.state; | ||
let segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (createElement(NowTimer, { unit: "day" }, (nowDate, todayRange) => { | ||
let innerNodes = []; | ||
for (let dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
let daySegs = segsByDay[dayIndex]; | ||
if (daySegs) { // sparse array, so might be undefined | ||
var dayStr = formatDayString(dayDates[dayIndex]); | ||
var dateHeaderId = dateHeaderIdRoot + '-' + dayStr; | ||
let dayStr = formatDayString(dayDates[dayIndex]); | ||
let dateHeaderId = dateHeaderIdRoot + '-' + dayStr; | ||
// append a day header | ||
innerNodes.push(createElement(ListViewHeaderRow, { key: dayStr, cellId: dateHeaderId, dayDate: dayDates[dayIndex], todayRange: todayRange })); | ||
daySegs = sortEventSegs(daySegs, options.eventOrder); | ||
for (var _i = 0, daySegs_1 = daySegs; _i < daySegs_1.length; _i++) { | ||
var seg = daySegs_1[_i]; | ||
innerNodes.push(createElement(ListViewEventRow, __assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, getSegMeta(seg, todayRange, nowDate)))); | ||
for (let seg of daySegs) { | ||
innerNodes.push(createElement(ListViewEventRow, Object.assign({ key: dayStr + ':' + seg.eventRange.instance.instanceId /* are multiple segs for an instanceId */, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: false, timeHeaderId: timeHeaderId, eventHeaderId: eventHeaderId, dateHeaderId: dateHeaderId }, getSegMeta(seg, todayRange, nowDate)))); | ||
} | ||
@@ -196,23 +181,22 @@ } | ||
})); | ||
}; | ||
ListView.prototype._eventStoreToSegs = function (eventStore, eventUiBases, dayRanges) { | ||
} | ||
_eventStoreToSegs(eventStore, eventUiBases, dayRanges) { | ||
return this.eventRangesToSegs(sliceEventStore(eventStore, eventUiBases, this.props.dateProfile.activeRange, this.context.options.nextDayThreshold).fg, dayRanges); | ||
}; | ||
ListView.prototype.eventRangesToSegs = function (eventRanges, dayRanges) { | ||
var segs = []; | ||
for (var _i = 0, eventRanges_1 = eventRanges; _i < eventRanges_1.length; _i++) { | ||
var eventRange = eventRanges_1[_i]; | ||
segs.push.apply(segs, this.eventRangeToSegs(eventRange, dayRanges)); | ||
} | ||
eventRangesToSegs(eventRanges, dayRanges) { | ||
let segs = []; | ||
for (let eventRange of eventRanges) { | ||
segs.push(...this.eventRangeToSegs(eventRange, dayRanges)); | ||
} | ||
return segs; | ||
}; | ||
ListView.prototype.eventRangeToSegs = function (eventRange, dayRanges) { | ||
var dateEnv = this.context.dateEnv; | ||
var nextDayThreshold = this.context.options.nextDayThreshold; | ||
var range = eventRange.range; | ||
var allDay = eventRange.def.allDay; | ||
var dayIndex; | ||
var segRange; | ||
var seg; | ||
var segs = []; | ||
} | ||
eventRangeToSegs(eventRange, dayRanges) { | ||
let { dateEnv } = this.context; | ||
let { nextDayThreshold } = this.context.options; | ||
let range = eventRange.range; | ||
let allDay = eventRange.def.allDay; | ||
let dayIndex; | ||
let segRange; | ||
let seg; | ||
let segs = []; | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) { | ||
@@ -223,3 +207,3 @@ segRange = intersectRanges(range, dayRanges[dayIndex]); | ||
component: this, | ||
eventRange: eventRange, | ||
eventRange, | ||
start: segRange.start, | ||
@@ -229,3 +213,3 @@ end: segRange.end, | ||
isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(), | ||
dayIndex: dayIndex, | ||
dayIndex, | ||
}; | ||
@@ -246,5 +230,4 @@ segs.push(seg); | ||
return segs; | ||
}; | ||
return ListView; | ||
}(DateComponent)); | ||
} | ||
} | ||
function renderNoEventsInner(hookProps) { | ||
@@ -254,6 +237,6 @@ return hookProps.text; | ||
function computeDateVars(dateProfile) { | ||
var dayStart = startOfDay(dateProfile.renderRange.start); | ||
var viewEnd = dateProfile.renderRange.end; | ||
var dayDates = []; | ||
var dayRanges = []; | ||
let dayStart = startOfDay(dateProfile.renderRange.start); | ||
let viewEnd = dateProfile.renderRange.end; | ||
let dayDates = []; | ||
let dayRanges = []; | ||
while (dayStart < viewEnd) { | ||
@@ -267,9 +250,9 @@ dayDates.push(dayStart); | ||
} | ||
return { dayDates: dayDates, dayRanges: dayRanges }; | ||
return { dayDates, dayRanges }; | ||
} | ||
// Returns a sparse array of arrays, segs grouped by their dayIndex | ||
function groupSegsByDay(segs) { | ||
var segsByDay = []; // sparse array | ||
var i; | ||
var seg; | ||
let segsByDay = []; // sparse array | ||
let i; | ||
let seg; | ||
for (i = 0; i < segs.length; i += 1) { | ||
@@ -283,3 +266,3 @@ seg = segs[i]; | ||
var OPTION_REFINERS = { | ||
const OPTION_REFINERS = { | ||
listDayFormat: createFalsableFormatter, | ||
@@ -297,2 +280,32 @@ listDaySideFormat: createFalsableFormatter, | ||
function styleInject(css, ref) { | ||
if ( ref === void 0 ) ref = {}; | ||
var insertAt = ref.insertAt; | ||
if (!css || typeof document === 'undefined') { return; } | ||
var head = document.head || document.getElementsByTagName('head')[0]; | ||
var style = document.createElement('style'); | ||
style.type = 'text/css'; | ||
if (insertAt === 'top') { | ||
if (head.firstChild) { | ||
head.insertBefore(style, head.firstChild); | ||
} else { | ||
head.appendChild(style); | ||
} | ||
} else { | ||
head.appendChild(style); | ||
} | ||
if (style.styleSheet) { | ||
style.styleSheet.cssText = css; | ||
} else { | ||
style.appendChild(document.createTextNode(css)); | ||
} | ||
} | ||
var css_248z = "\n:root {\n --fc-list-event-dot-width: 10px;\n --fc-list-event-hover-bg-color: #f5f5f5;\n}\n.fc-theme-standard .fc-list {\n border: 1px solid #ddd;\n border: 1px solid var(--fc-border-color, #ddd);\n }\n.fc {\n\n /* message when no events */\n\n}\n.fc .fc-list-empty {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n height: 100%;\n display: flex;\n justify-content: center;\n align-items: center; /* vertically aligns fc-list-empty-inner */\n }\n.fc .fc-list-empty-cushion {\n margin: 5em 0;\n }\n.fc {\n\n /* table within the scroller */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-table {\n width: 100%;\n border-style: hidden; /* kill outer border on theme */\n }\n.fc .fc-list-table tr > * {\n border-left: 0;\n border-right: 0;\n }\n.fc .fc-list-sticky .fc-list-day > * { /* the cells */\n position: sticky;\n top: 0;\n background: #fff;\n background: var(--fc-page-bg-color, #fff); /* for when headers are styled to be transparent and sticky */\n }\n.fc {\n\n /* only exists for aria reasons, hide for non-screen-readers */\n\n}\n.fc .fc-list-table thead {\n position: absolute;\n left: -10000px;\n }\n.fc {\n\n /* the table's border-style:hidden gets confused by hidden thead. force-hide top border of first cell */\n\n}\n.fc .fc-list-table tbody > tr:first-child th {\n border-top: 0;\n }\n.fc .fc-list-table th {\n padding: 0; /* uses an inner-wrapper instead... */\n }\n.fc .fc-list-table td,\n .fc .fc-list-day-cushion {\n padding: 8px 14px;\n }\n.fc {\n\n\n /* date heading rows */\n /* ---------------------------------------------------------------------------------------------------- */\n\n}\n.fc .fc-list-day-cushion:after {\n content: \"\";\n clear: both;\n display: table; /* clear floating */\n }\n.fc-theme-standard .fc-list-day-cushion {\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n }\n.fc-direction-ltr .fc-list-day-text,\n.fc-direction-rtl .fc-list-day-side-text {\n float: left;\n}\n.fc-direction-ltr .fc-list-day-side-text,\n.fc-direction-rtl .fc-list-day-text {\n float: right;\n}\n/* make the dot closer to the event title */\n.fc-direction-ltr .fc-list-table .fc-list-event-graphic { padding-right: 0 }\n.fc-direction-rtl .fc-list-table .fc-list-event-graphic { padding-left: 0 }\n.fc .fc-list-event.fc-event-forced-url {\n cursor: pointer; /* whole row will seem clickable */\n }\n.fc .fc-list-event:hover td {\n background-color: #f5f5f5;\n background-color: var(--fc-list-event-hover-bg-color, #f5f5f5);\n }\n.fc {\n\n /* shrink certain cols */\n\n}\n.fc .fc-list-event-graphic,\n .fc .fc-list-event-time {\n white-space: nowrap;\n width: 1px;\n }\n.fc .fc-list-event-dot {\n display: inline-block;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 5px solid #3788d8;\n border: calc(var(--fc-list-event-dot-width, 10px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 5px;\n border-radius: calc(var(--fc-list-event-dot-width, 10px) / 2);\n }\n.fc {\n\n /* reset <a> styling */\n\n}\n.fc .fc-list-event-title a {\n color: inherit;\n text-decoration: none;\n }\n.fc {\n\n /* underline link when hovering over any part of row */\n\n}\n.fc .fc-list-event.fc-event-forced-url:hover a {\n text-decoration: underline;\n }\n"; | ||
styleInject(css_248z); | ||
var main = createPlugin({ | ||
@@ -299,0 +312,0 @@ optionRefiners: OPTION_REFINERS, |
{ | ||
"name": "@fullcalendar/list", | ||
"version": "5.11.2", | ||
"version": "6.0.0-beta.1", | ||
"title": "FullCalendar List View Plugin", | ||
@@ -8,3 +8,3 @@ "description": "View your events as a bulleted list", | ||
"dependencies": { | ||
"@fullcalendar/common": "~5.11.2", | ||
"@fullcalendar/common": "6.0.0-beta.1", | ||
"tslib": "^2.1.0" | ||
@@ -31,4 +31,4 @@ }, | ||
"devDependencies": { | ||
"@fullcalendar/core-preact": "5.11.2" | ||
"@fullcalendar/core-preact": "6.0.0-beta.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108092
9
1059
1
2
+ Added@fullcalendar/common@6.0.0-beta.1(transitive)
- Removed@fullcalendar/common@5.11.5(transitive)