@fullcalendar/list
Advanced tools
Comparing version 5.3.1 to 5.4.0
/*! | ||
FullCalendar v5.3.1 | ||
FullCalendar v5.3.2 | ||
Docs & License: https://fullcalendar.io/ | ||
@@ -28,3 +28,3 @@ (c) 2020 Adam Shaw | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
@@ -59,4 +59,6 @@ }; | ||
var dayMeta = common.getDateMeta(dayDate, todayRange); | ||
var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; // will ever be falsy? | ||
var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; // will ever be falsy? also, BAD NAME "alt" | ||
// will ever be falsy? | ||
var 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 navLinkData = options.navLinks | ||
@@ -81,6 +83,4 @@ ? common.buildNavLinkData(dayDate) | ||
return (common.createElement(common.Fragment, null, | ||
props.text && | ||
common.createElement("a", __assign({ className: 'fc-list-day-text' }, navLinkAttrs), props.text), | ||
props.sideText && | ||
common.createElement("a", __assign({ className: 'fc-list-day-side-text' }, navLinkAttrs), props.sideText))); | ||
props.text && (common.createElement("a", __assign({ className: "fc-list-day-text" }, navLinkAttrs), props.text)), | ||
props.sideText && (common.createElement("a", __assign({ className: "fc-list-day-side-text" }, navLinkAttrs), props.sideText)))); | ||
} | ||
@@ -91,3 +91,3 @@ | ||
minute: '2-digit', | ||
meridiem: 'short' | ||
meridiem: 'short', | ||
}); | ||
@@ -103,7 +103,8 @@ var ListViewEventRow = /** @class */ (function (_super) { | ||
var 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: renderEventInnerContent, 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 }, | ||
return (common.createElement(common.EventRoot, { seg: seg, timeText: "" // BAD. because of all-day content | ||
, disableDragging: true, disableResizing: true, defaultContent: renderEventInnerContent, 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 }, | ||
buildTimeContent(seg, timeFormat, context), | ||
common.createElement("td", { className: 'fc-list-event-graphic' }, | ||
common.createElement("span", { className: 'fc-list-event-dot', style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
common.createElement("td", { className: 'fc-list-event-title', ref: innerElRef }, innerContent))); })); | ||
common.createElement("td", { className: "fc-list-event-graphic" }, | ||
common.createElement("span", { className: "fc-list-event-dot", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
common.createElement("td", { className: "fc-list-event-title", ref: innerElRef }, innerContent))); })); | ||
}; | ||
@@ -145,9 +146,7 @@ return ListViewEventRow; | ||
text: context.options.allDayText, | ||
view: context.viewApi | ||
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", { className: ['fc-list-event-time'].concat(classNames).join(' '), ref: rootElRef }, innerContent)); })); | ||
} | ||
else { | ||
return (common.createElement("td", { className: 'fc-list-event-time' }, timeText)); | ||
} | ||
return (common.createElement("td", { className: "fc-list-event-time" }, timeText)); | ||
} | ||
@@ -172,3 +171,3 @@ return null; | ||
_this.context.registerInteractiveComponent(_this, { | ||
el: rootEl | ||
el: rootEl, | ||
}); | ||
@@ -188,3 +187,3 @@ } | ||
context.theme.getClass('table'), | ||
context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : '' | ||
context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : '', | ||
]; | ||
@@ -202,6 +201,6 @@ var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges; | ||
text: options.noEventsText, | ||
view: viewApi | ||
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))); })); | ||
common.createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))); })); | ||
}; | ||
@@ -211,5 +210,5 @@ ListView.prototype.renderSegList = function (allSegs, dayDates) { | ||
var segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (common.createElement(common.NowTimer, { unit: 'day' }, function (nowDate, todayRange) { | ||
return (common.createElement(common.NowTimer, { unit: "day" }, function (nowDate, todayRange) { | ||
var innerNodes = []; | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) { | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
var daySegs = segsByDay[dayIndex]; | ||
@@ -251,3 +250,3 @@ if (daySegs) { // sparse array, so might be undefined | ||
var segs = []; | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex++) { | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) { | ||
segRange = common.intersectRanges(range, dayRanges[dayIndex]); | ||
@@ -262,3 +261,3 @@ if (segRange) { | ||
isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(), | ||
dayIndex: dayIndex | ||
dayIndex: dayIndex, | ||
}; | ||
@@ -294,3 +293,3 @@ segs.push(seg); | ||
start: dayStart, | ||
end: common.addDays(dayStart, 1) | ||
end: common.addDays(dayStart, 1), | ||
}); | ||
@@ -306,3 +305,3 @@ dayStart = common.addDays(dayStart, 1); | ||
var seg; | ||
for (i = 0; i < segs.length; i++) { | ||
for (i = 0; i < segs.length; i += 1) { | ||
seg = segs[i]; | ||
@@ -321,4 +320,3 @@ (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = [])) | ||
noEventsDidMount: common.identity, | ||
noEventsWillUnmount: common.identity | ||
// noEventsText is defined in base options | ||
noEventsWillUnmount: common.identity, | ||
}; | ||
@@ -335,3 +333,3 @@ function createFalsableFormatter(input) { | ||
buttonTextKey: 'list', | ||
listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' } // like "January 1, 2016" | ||
listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' }, | ||
}, | ||
@@ -341,3 +339,3 @@ listDay: { | ||
duration: { days: 1 }, | ||
listDayFormat: { weekday: 'long' } // day-of-week is all we need. full date is probably in headerToolbar | ||
listDayFormat: { weekday: 'long' }, | ||
}, | ||
@@ -348,3 +346,3 @@ listWeek: { | ||
listDayFormat: { weekday: 'long' }, | ||
listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' } | ||
listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' }, | ||
}, | ||
@@ -354,3 +352,3 @@ listMonth: { | ||
duration: { month: 1 }, | ||
listDaySideFormat: { weekday: 'long' } // day-of-week is nice-to-have | ||
listDaySideFormat: { weekday: 'long' }, | ||
}, | ||
@@ -360,5 +358,5 @@ listYear: { | ||
duration: { year: 1 }, | ||
listDaySideFormat: { weekday: 'long' } // day-of-week is nice-to-have | ||
} | ||
} | ||
listDaySideFormat: { weekday: 'long' }, | ||
}, | ||
}, | ||
}); | ||
@@ -371,4 +369,6 @@ | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
return exports; | ||
}({}, FullCalendar)); |
/*! | ||
FullCalendar v5.3.1 | ||
FullCalendar v5.3.2 | ||
Docs & License: https://fullcalendar.io/ | ||
(c) 2020 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)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function a(e,t){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(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.render=function(){var e=this.props,n=e.dayDate,a=e.todayRange,i=this.context,s=i.theme,l=i.dateEnv,c=i.options,u=i.viewApi,d=t.getDateMeta(n,a),m=c.listDayFormat?l.format(n,c.listDayFormat):"",v=c.listDaySideFormat?l.format(n,c.listDaySideFormat):"",y=c.navLinks?t.buildNavLinkData(n):null,f=r({date:l.toDate(n),view:u,text:m,sideText:v,navLinkData:y},d),g=["fc-list-day"].concat(t.getDayClassNames(d,s));return t.createElement(t.RenderHook,{hookProps:f,classNames:c.dayHeaderClassNames,content:c.dayHeaderContent,defaultContent:o,didMount:c.dayHeaderDidMount,willUnmount:c.dayHeaderWillUnmount},(function(e,a,r,i){return t.createElement("tr",{ref:e,className:g.concat(a).join(" "),"data-date":t.formatDayString(n)},t.createElement("th",{colSpan:3},t.createElement("div",{className:"fc-list-day-cushion "+s.getClass("tableCellShaded"),ref:r},i)))}))},n}(t.BaseComponent);function o(e){var n=e.navLinkData?{"data-navlink":e.navLinkData,tabIndex:0}:{};return t.createElement(t.Fragment,null,e.text&&t.createElement("a",r({className:"fc-list-day-text"},n),e.text),e.sideText&&t.createElement("a",r({className:"fc-list-day-side-text"},n),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,r=n.options.eventTimeFormat||s;return t.createElement(t.EventRoot,{seg:a,timeText:"",disableDragging:!0,disableResizing:!0,defaultContent:c,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,isSelected:e.isSelected,isDragging:e.isDragging,isResizing:e.isResizing,isDateSelecting:e.isDateSelecting},(function(e,i,o,s,l){return t.createElement("tr",{className:["fc-list-event",l.event.url?"fc-event-forced-url":""].concat(i).join(" "),ref:e},function(e,n,a){var r=a.options;if(!1!==r.displayEventTime){var i=e.eventRange.def,o=e.eventRange.instance,s=!1,l=void 0;if(i.allDay?s=!0:t.isMultiDayRange(e.eventRange.range)?e.isStart?l=t.buildSegTimeText(e,n,a,null,null,o.range.start,e.end):e.isEnd?l=t.buildSegTimeText(e,n,a,null,null,e.start,o.range.end):s=!0:l=t.buildSegTimeText(e,n,a),s){var c={text:a.options.allDayText,view:a.viewApi};return t.createElement(t.RenderHook,{hookProps:c,classNames:r.allDayClassNames,content:r.allDayContent,defaultContent:u,didMount:r.allDayDidMount,willUnmount:r.allDayWillUnmount},(function(e,n,a,r){return t.createElement("td",{className:["fc-list-event-time"].concat(n).join(" "),ref:e},r)}))}return t.createElement("td",{className:"fc-list-event-time"},l)}return null}(a,r,n),t.createElement("td",{className:"fc-list-event-graphic"},t.createElement("span",{className:"fc-list-event-dot",style:{borderColor:l.borderColor||l.backgroundColor}})),t.createElement("td",{className:"fc-list-event-title",ref:o},s))}))},n}(t.BaseComponent);function c(e){var n=e.event,a=n.url,i=a?{href:a}:{};return t.createElement("a",r({},i),n.title)}function u(e){return e.text}var d=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.computeDateVars=t.memoize(v),n.eventStoreToSegs=t.memoize(n._eventStoreToSegs),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:m,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,c=function(e){var t,n,a=[];for(t=0;t<e.length;t++)n=e[t],(a[n.dayIndex]||(a[n.dayIndex]=[])).push(n);return a}(e);return t.createElement(t.NowTimer,{unit:"day"},(function(e,a){for(var u=[],d=0;d<c.length;d++){var m=c[d];if(m){var v=n[d].toISOString();u.push(t.createElement(i,{key:v,dayDate:n[d],todayRange:a}));for(var y=0,f=m=t.sortEventSegs(m,s.eventOrder);y<f.length;y++){var g=f[y];u.push(t.createElement(l,r({key:v+":"+g.eventRange.instance.instanceId,seg:g,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1},t.getSegMeta(g,a,e))))}}}return t.createElement("table",{className:"fc-list-table "+o.getClass("table")},t.createElement("tbody",null,u))}))},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,c=e.def.allDay,u=[];for(a=0;a<n.length;a++)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},u.push(i),!i.isEnd&&!c&&a+1<n.length&&l.end<o.add(n[a+1].start,s))){i.end=l.end,i.isEnd=!0;break}return u},n}(t.DateComponent);function m(e){return e.text}function v(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 y={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)}var g=t.createPlugin({optionRefiners:y,views:{list:{component:d,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(g),e.ListView=d,e.default=g,e}({},FullCalendar); | ||
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){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(){return null!==e&&e.apply(this,arguments)||this}return a(n,e),n.prototype.render=function(){var e=this.props,n=e.dayDate,a=e.todayRange,i=this.context,s=i.theme,l=i.dateEnv,c=i.options,u=i.viewApi,d=t.getDateMeta(n,a),m=c.listDayFormat?l.format(n,c.listDayFormat):"",v=c.listDaySideFormat?l.format(n,c.listDaySideFormat):"",y=c.navLinks?t.buildNavLinkData(n):null,f=r({date:l.toDate(n),view:u,text:m,sideText:v,navLinkData:y},d),g=["fc-list-day"].concat(t.getDayClassNames(d,s));return t.createElement(t.RenderHook,{hookProps:f,classNames:c.dayHeaderClassNames,content:c.dayHeaderContent,defaultContent:o,didMount:c.dayHeaderDidMount,willUnmount:c.dayHeaderWillUnmount},(function(e,a,r,i){return t.createElement("tr",{ref:e,className:g.concat(a).join(" "),"data-date":t.formatDayString(n)},t.createElement("th",{colSpan:3},t.createElement("div",{className:"fc-list-day-cushion "+s.getClass("tableCellShaded"),ref:r},i)))}))},n}(t.BaseComponent);function o(e){var n=e.navLinkData?{"data-navlink":e.navLinkData,tabIndex:0}:{};return t.createElement(t.Fragment,null,e.text&&t.createElement("a",r({className:"fc-list-day-text"},n),e.text),e.sideText&&t.createElement("a",r({className:"fc-list-day-side-text"},n),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,r=n.options.eventTimeFormat||s;return t.createElement(t.EventRoot,{seg:a,timeText:"",disableDragging:!0,disableResizing:!0,defaultContent:c,isPast:e.isPast,isFuture:e.isFuture,isToday:e.isToday,isSelected:e.isSelected,isDragging:e.isDragging,isResizing:e.isResizing,isDateSelecting:e.isDateSelecting},(function(e,i,o,s,l){return t.createElement("tr",{className:["fc-list-event",l.event.url?"fc-event-forced-url":""].concat(i).join(" "),ref:e},function(e,n,a){var r=a.options;if(!1!==r.displayEventTime){var i=e.eventRange.def,o=e.eventRange.instance,s=!1,l=void 0;if(i.allDay?s=!0:t.isMultiDayRange(e.eventRange.range)?e.isStart?l=t.buildSegTimeText(e,n,a,null,null,o.range.start,e.end):e.isEnd?l=t.buildSegTimeText(e,n,a,null,null,e.start,o.range.end):s=!0:l=t.buildSegTimeText(e,n,a),s){var c={text:a.options.allDayText,view:a.viewApi};return t.createElement(t.RenderHook,{hookProps:c,classNames:r.allDayClassNames,content:r.allDayContent,defaultContent:u,didMount:r.allDayDidMount,willUnmount:r.allDayWillUnmount},(function(e,n,a,r){return t.createElement("td",{className:["fc-list-event-time"].concat(n).join(" "),ref:e},r)}))}return t.createElement("td",{className:"fc-list-event-time"},l)}return null}(a,r,n),t.createElement("td",{className:"fc-list-event-graphic"},t.createElement("span",{className:"fc-list-event-dot",style:{borderColor:l.borderColor||l.backgroundColor}})),t.createElement("td",{className:"fc-list-event-title",ref:o},s))}))},n}(t.BaseComponent);function c(e){var n=e.event,a=n.url,i=a?{href:a}:{};return t.createElement("a",r({},i),n.title)}function u(e){return e.text}var d=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.computeDateVars=t.memoize(v),n.eventStoreToSegs=t.memoize(n._eventStoreToSegs),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:m,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,c=function(e){var 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"},(function(e,a){for(var u=[],d=0;d<c.length;d+=1){var m=c[d];if(m){var v=n[d].toISOString();u.push(t.createElement(i,{key:v,dayDate:n[d],todayRange:a}));for(var y=0,f=m=t.sortEventSegs(m,s.eventOrder);y<f.length;y++){var g=f[y];u.push(t.createElement(l,r({key:v+":"+g.eventRange.instance.instanceId,seg:g,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:!1},t.getSegMeta(g,a,e))))}}}return t.createElement("table",{className:"fc-list-table "+o.getClass("table")},t.createElement("tbody",null,u))}))},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,c=e.def.allDay,u=[];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},u.push(i),!i.isEnd&&!c&&a+1<n.length&&l.end<o.add(n[a+1].start,s))){i.end=l.end,i.isEnd=!0;break}return u},n}(t.DateComponent);function m(e){return e.text}function v(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 y={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)}var g=t.createPlugin({optionRefiners:y,views:{list:{component:d,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(g),e.ListView=d,e.default=g,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar); |
68
main.js
/*! | ||
FullCalendar v5.3.1 | ||
FullCalendar v5.3.2 | ||
Docs & License: https://fullcalendar.io/ | ||
@@ -20,4 +20,6 @@ (c) 2020 Adam Shaw | ||
var dayMeta = getDateMeta(dayDate, todayRange); | ||
var text = options.listDayFormat ? dateEnv.format(dayDate, options.listDayFormat) : ''; // will ever be falsy? | ||
var sideText = options.listDaySideFormat ? dateEnv.format(dayDate, options.listDaySideFormat) : ''; // will ever be falsy? also, BAD NAME "alt" | ||
// will ever be falsy? | ||
var 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 navLinkData = options.navLinks | ||
@@ -42,6 +44,4 @@ ? buildNavLinkData(dayDate) | ||
return (createElement(Fragment, null, | ||
props.text && | ||
createElement("a", __assign({ className: 'fc-list-day-text' }, navLinkAttrs), props.text), | ||
props.sideText && | ||
createElement("a", __assign({ className: 'fc-list-day-side-text' }, navLinkAttrs), props.sideText))); | ||
props.text && (createElement("a", __assign({ className: "fc-list-day-text" }, navLinkAttrs), props.text)), | ||
props.sideText && (createElement("a", __assign({ className: "fc-list-day-side-text" }, navLinkAttrs), props.sideText)))); | ||
} | ||
@@ -52,3 +52,3 @@ | ||
minute: '2-digit', | ||
meridiem: 'short' | ||
meridiem: 'short', | ||
}); | ||
@@ -64,7 +64,8 @@ var ListViewEventRow = /** @class */ (function (_super) { | ||
var timeFormat = context.options.eventTimeFormat || DEFAULT_TIME_FORMAT; | ||
return (createElement(EventRoot, { seg: seg, timeText: '' /* BAD. because of all-day content */, disableDragging: true, disableResizing: true, defaultContent: renderEventInnerContent, 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 }, | ||
return (createElement(EventRoot, { seg: seg, timeText: "" // BAD. because of all-day content | ||
, disableDragging: true, disableResizing: true, defaultContent: renderEventInnerContent, 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 }, | ||
buildTimeContent(seg, timeFormat, context), | ||
createElement("td", { className: 'fc-list-event-graphic' }, | ||
createElement("span", { className: 'fc-list-event-dot', style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
createElement("td", { className: 'fc-list-event-title', ref: innerElRef }, innerContent))); })); | ||
createElement("td", { className: "fc-list-event-graphic" }, | ||
createElement("span", { className: "fc-list-event-dot", style: { borderColor: hookProps.borderColor || hookProps.backgroundColor } })), | ||
createElement("td", { className: "fc-list-event-title", ref: innerElRef }, innerContent))); })); | ||
}; | ||
@@ -106,9 +107,7 @@ return ListViewEventRow; | ||
text: context.options.allDayText, | ||
view: context.viewApi | ||
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", { className: ['fc-list-event-time'].concat(classNames).join(' '), ref: rootElRef }, innerContent)); })); | ||
} | ||
else { | ||
return (createElement("td", { className: 'fc-list-event-time' }, timeText)); | ||
} | ||
return (createElement("td", { className: "fc-list-event-time" }, timeText)); | ||
} | ||
@@ -133,3 +132,3 @@ return null; | ||
_this.context.registerInteractiveComponent(_this, { | ||
el: rootEl | ||
el: rootEl, | ||
}); | ||
@@ -149,3 +148,3 @@ } | ||
context.theme.getClass('table'), | ||
context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : '' | ||
context.options.stickyHeaderDates !== false ? 'fc-list-sticky' : '', | ||
]; | ||
@@ -163,6 +162,6 @@ var _b = this.computeDateVars(props.dateProfile), dayDates = _b.dayDates, dayRanges = _b.dayRanges; | ||
text: options.noEventsText, | ||
view: viewApi | ||
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))); })); | ||
createElement("div", { className: "fc-list-empty-cushion", ref: innerElRef }, innerContent))); })); | ||
}; | ||
@@ -172,5 +171,5 @@ ListView.prototype.renderSegList = function (allSegs, dayDates) { | ||
var segsByDay = groupSegsByDay(allSegs); // sparse array | ||
return (createElement(NowTimer, { unit: 'day' }, function (nowDate, todayRange) { | ||
return (createElement(NowTimer, { unit: "day" }, function (nowDate, todayRange) { | ||
var innerNodes = []; | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) { | ||
for (var dayIndex = 0; dayIndex < segsByDay.length; dayIndex += 1) { | ||
var daySegs = segsByDay[dayIndex]; | ||
@@ -212,3 +211,3 @@ if (daySegs) { // sparse array, so might be undefined | ||
var segs = []; | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex++) { | ||
for (dayIndex = 0; dayIndex < dayRanges.length; dayIndex += 1) { | ||
segRange = intersectRanges(range, dayRanges[dayIndex]); | ||
@@ -223,3 +222,3 @@ if (segRange) { | ||
isEnd: eventRange.isEnd && segRange.end.valueOf() === range.end.valueOf(), | ||
dayIndex: dayIndex | ||
dayIndex: dayIndex, | ||
}; | ||
@@ -255,3 +254,3 @@ segs.push(seg); | ||
start: dayStart, | ||
end: addDays(dayStart, 1) | ||
end: addDays(dayStart, 1), | ||
}); | ||
@@ -267,3 +266,3 @@ dayStart = addDays(dayStart, 1); | ||
var seg; | ||
for (i = 0; i < segs.length; i++) { | ||
for (i = 0; i < segs.length; i += 1) { | ||
seg = segs[i]; | ||
@@ -282,4 +281,3 @@ (segsByDay[seg.dayIndex] || (segsByDay[seg.dayIndex] = [])) | ||
noEventsDidMount: identity, | ||
noEventsWillUnmount: identity | ||
// noEventsText is defined in base options | ||
noEventsWillUnmount: identity, | ||
}; | ||
@@ -296,3 +294,3 @@ function createFalsableFormatter(input) { | ||
buttonTextKey: 'list', | ||
listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' } // like "January 1, 2016" | ||
listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' }, | ||
}, | ||
@@ -302,3 +300,3 @@ listDay: { | ||
duration: { days: 1 }, | ||
listDayFormat: { weekday: 'long' } // day-of-week is all we need. full date is probably in headerToolbar | ||
listDayFormat: { weekday: 'long' }, | ||
}, | ||
@@ -309,3 +307,3 @@ listWeek: { | ||
listDayFormat: { weekday: 'long' }, | ||
listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' } | ||
listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' }, | ||
}, | ||
@@ -315,3 +313,3 @@ listMonth: { | ||
duration: { month: 1 }, | ||
listDaySideFormat: { weekday: 'long' } // day-of-week is nice-to-have | ||
listDaySideFormat: { weekday: 'long' }, | ||
}, | ||
@@ -321,5 +319,5 @@ listYear: { | ||
duration: { year: 1 }, | ||
listDaySideFormat: { weekday: 'long' } // day-of-week is nice-to-have | ||
} | ||
} | ||
listDaySideFormat: { weekday: 'long' }, | ||
}, | ||
}, | ||
}); | ||
@@ -326,0 +324,0 @@ |
{ | ||
"name": "@fullcalendar/list", | ||
"version": "5.3.1", | ||
"version": "5.4.0", | ||
"title": "FullCalendar List View Plugin", | ||
@@ -8,7 +8,7 @@ "description": "View your events as a bulleted list", | ||
"dependencies": { | ||
"@fullcalendar/common": "~5.3.1", | ||
"tslib": "^2.0.0" | ||
"@fullcalendar/common": "~5.4.0", | ||
"tslib": "^2.0.3" | ||
}, | ||
"type": "module", | ||
"main": "main.js", | ||
"main": "main.cjs.js", | ||
"module": "main.js", | ||
"types": "main.d.ts", | ||
@@ -29,3 +29,6 @@ "jsdelivr": "main.global.min.js", | ||
"url": "http://arshaw.com/" | ||
}, | ||
"devDependencies": { | ||
"@fullcalendar/core-preact": "5.4.0" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
94580
11
1106
1
No
+ Added@fullcalendar/common@5.4.0(transitive)
- Removed@fullcalendar/common@5.3.1(transitive)
Updated@fullcalendar/common@~5.4.0
Updatedtslib@^2.0.3