@fullcalendar/timeline
Advanced tools
Comparing version 5.3.1 to 5.4.0
@@ -80,3 +80,8 @@ | ||
} | ||
declare class TimelineLaneSlicer extends Slicer<TimelineLaneSeg, [DateProfile, DateProfileGenerator, TimelineDateProfile, DateEnv]> { | ||
declare class TimelineLaneSlicer extends Slicer<TimelineLaneSeg, [ | ||
DateProfile, | ||
DateProfileGenerator, | ||
TimelineDateProfile, | ||
DateEnv | ||
]> { | ||
sliceRange(origRange: DateRange, dateProfile: DateProfile, dateProfileGenerator: DateProfileGenerator, tDateProfile: TimelineDateProfile, dateEnv: DateEnv): TimelineLaneSeg[]; | ||
@@ -167,2 +172,9 @@ } | ||
interface TimelineSlatsContentProps { | ||
dateProfile: DateProfile; | ||
tDateProfile: TimelineDateProfile; | ||
nowDate: DateMarker; | ||
todayRange: DateRange; | ||
} | ||
interface TimelineSlatsProps extends TimelineSlatsContentProps { | ||
@@ -175,8 +187,2 @@ clientWidth: number | null; | ||
} | ||
interface TimelineSlatsContentProps { | ||
dateProfile: DateProfile; | ||
tDateProfile: TimelineDateProfile; | ||
nowDate: DateMarker; | ||
todayRange: DateRange; | ||
} | ||
declare class TimelineSlats extends BaseComponent<TimelineSlatsProps> { | ||
@@ -207,2 +213,3 @@ private rootElRef; | ||
interface TimelineHeaderRowsProps { | ||
@@ -209,0 +216,0 @@ dateProfile: DateProfile; |
/*! | ||
FullCalendar Scheduler v5.3.1 | ||
FullCalendar Scheduler v5.3.2 | ||
Docs & License: https://fullcalendar.io/scheduler | ||
(c) 2020 Adam Shaw | ||
*/ | ||
var FullCalendarTimeline=function(e,t,n,i){"use strict";n=n&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n;var o=function(e,t){return(o=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 r(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return(a=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};t.config.MAX_TIMELINE_SLOTS=1e3;var s=[{years:1},{months:1},{days:1},{hours:1},{minutes:30},{minutes:15},{minutes:10},{minutes:5},{minutes:1},{seconds:30},{seconds:15},{seconds:10},{seconds:5},{seconds:1},{milliseconds:500},{milliseconds:100},{milliseconds:10},{milliseconds:1}];function l(e,n,i,o){var r={labelInterval:i.slotLabelInterval,slotDuration:i.slotDuration};!function(e,n,i){var o=n.currentRange;if(e.labelInterval){i.countDurationsBetween(o.start,o.end,e.labelInterval)>t.config.MAX_TIMELINE_SLOTS&&(console.warn("slotLabelInterval results in too many cells"),e.labelInterval=null)}if(e.slotDuration){i.countDurationsBetween(o.start,o.end,e.slotDuration)>t.config.MAX_TIMELINE_SLOTS&&(console.warn("slotDuration results in too many cells"),e.slotDuration=null)}if(e.labelInterval&&e.slotDuration){var r=t.wholeDivideDurations(e.labelInterval,e.slotDuration);(null===r||r<1)&&(console.warn("slotLabelInterval must be a multiple of slotDuration"),e.slotDuration=null)}}(r,e,n),d(r,e,n),function(e,n,i){var o=n.currentRange,r=e.slotDuration;if(!r){for(var a=d(e,n,i),l=0,u=s;l<u.length;l++){var c=u[l],h=t.createDuration(c),f=t.wholeDivideDurations(a,h);if(null!==f&&f>1&&f<=6){r=h;break}}if(r)i.countDurationsBetween(o.start,o.end,r)>200&&(r=null);r||(r=a),e.slotDuration=r}}(r,e,n);var a=i.slotLabelFormat,l=Array.isArray(a)?a:null!=a?[a]:function(e,n,i,o){var r,a,s=e.labelInterval,l=t.greatestDurationDenominator(s).unit,u=o.weekNumbers,c=r=a=null;"week"!==l||u||(l="day");switch(l){case"year":c={year:"numeric"};break;case"month":h("years",n,i)>1&&(c={year:"numeric"}),r={month:"short"};break;case"week":h("years",n,i)>1&&(c={year:"numeric"}),r={week:"narrow"};break;case"day":h("years",n,i)>1?c={year:"numeric",month:"long"}:h("months",n,i)>1&&(c={month:"long"}),u&&(r={week:"short"}),a={weekday:"narrow",day:"numeric"};break;case"hour":u&&(c={week:"short"}),h("days",n,i)>1&&(r={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),a={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":t.asRoughMinutes(s)/60>=6?(c={hour:"numeric",meridiem:"short"},r=function(e){return":"+t.padStart(e.date.minute,2)}):c={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":t.asRoughSeconds(s)/60>=6?(c={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},r=function(e){return":"+t.padStart(e.date.second,2)}):c={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"};break;case"millisecond":c={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"},r=function(e){return"."+t.padStart(e.millisecond,3)}}return[].concat(c||[],r||[],a||[])}(r,e,n,i);r.headerFormats=l.map((function(e){return t.createFormatter(e)})),r.isTimeScale=Boolean(r.slotDuration.milliseconds);var m=null;if(!r.isTimeScale){var p=t.greatestDurationDenominator(r.slotDuration).unit;/year|month|week/.test(p)&&(m=p)}r.largeUnit=m,r.emphasizeWeeks=1===t.asCleanDays(r.slotDuration)&&h("weeks",e,n)>=2&&!i.businessHours;var g,v,y=i.snapDuration;y&&(g=t.createDuration(y),v=t.wholeDivideDurations(r.slotDuration,g)),null==v&&(g=r.slotDuration,v=1),r.snapDuration=g,r.snapsPerSlot=v;var D=t.asRoughMs(e.slotMaxTime)-t.asRoughMs(e.slotMinTime),S=u(e.renderRange.start,r,n),C=u(e.renderRange.end,r,n);r.isTimeScale&&(S=n.add(S,e.slotMinTime),C=n.add(t.addDays(C,-1),e.slotMaxTime)),r.timeWindowMs=D,r.normalizedRange={start:S,end:C};for(var R=[],w=S;w<C;)c(w,r,e,o)&&R.push(w),w=n.add(w,r.slotDuration);r.slotDates=R;var E=-1,b=0,P=[],k=[];for(w=S;w<C;)c(w,r,e,o)?(E++,P.push(E),k.push(b)):P.push(E+.5),w=n.add(w,r.snapDuration),b++;return r.snapDiffToIndex=P,r.snapIndexToDiff=k,r.snapCnt=E+1,r.slotCnt=r.snapCnt/r.snapsPerSlot,r.isWeekStarts=function(e,t){for(var n=e.slotDates,i=e.emphasizeWeeks,o=null,r=[],a=0,s=n;a<s.length;a++){var l=s[a],u=t.computeWeekNumber(l),c=i&&null!==o&&o!==u;o=u,r.push(c)}return r}(r,n),r.cellRows=function(e,n){for(var i=e.slotDates,o=e.headerFormats,r=o.map((function(){return[]})),a=t.asCleanDays(e.slotDuration),s=7===a?"week":1===a?"day":null,l=o.map((function(e){return e.getLargestUnit?e.getLargestUnit():null})),u=0;u<i.length;u++)for(var c=i[u],d=e.isWeekStarts[u],h=0;h<o.length;h++){var m=o[h],p=r[h],g=p[p.length-1],v=h===o.length-1,y=o.length>1&&!v,D=null,S=l[h]||(v?s:null);if(y){var C=n.format(c,m);g&&g.text===C?g.colspan+=1:D=f(c,C,S)}else if(!g||t.isInt(n.countDurationsBetween(e.normalizedRange.start,c,e.labelInterval))){C=n.format(c,m);D=f(c,C,S)}else g.colspan+=1;D&&(D.weekStart=d,p.push(D))}return r}(r,n),r.slotsPerLabel=t.wholeDivideDurations(r.labelInterval,r.slotDuration),r}function u(e,n,i){var o=e;return n.isTimeScale||(o=t.startOfDay(o),n.largeUnit&&(o=i.startOf(o,n.largeUnit))),o}function c(e,n,i,o){if(o.isHiddenDay(e))return!1;if(n.isTimeScale){var r=t.startOfDay(e),a=e.valueOf()-r.valueOf()-t.asRoughMs(i.slotMinTime);return(a=(a%864e5+864e5)%864e5)<n.timeWindowMs}return!0}function d(e,n,i){var o=n.currentRange,r=e.labelInterval;if(!r){var a=void 0;if(e.slotDuration){for(var l=0,u=s;l<u.length;l++){a=u[l];var c=t.createDuration(a),d=t.wholeDivideDurations(c,e.slotDuration);if(null!==d&&d<=6){r=c;break}}r||(r=e.slotDuration)}else for(var h=0,f=s;h<f.length;h++){if(a=f[h],r=t.createDuration(a),i.countDurationsBetween(o.start,o.end,r)>=18)break}e.labelInterval=r}return r}function h(e,n,i){var o=n.currentRange,r=null;return"years"===e?r=i.diffWholeYears(o.start,o.end):"months"===e||"weeks"===e?r=i.diffWholeMonths(o.start,o.end):"days"===e&&(r=t.diffWholeDays(o.start,o.end)),r||0}function f(e,t,n){return{date:e,text:t,rowUnit:n,colspan:1,isWeekStart:!1}}var m=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.refineHookProps=t.memoizeObjArg(v),n.normalizeClassNames=t.buildClassNameNormalizer(),n}return r(n,e),n.prototype.render=function(){var e=this.props,n=this.context,i=n.dateEnv,o=n.options,r=e.cell,a=e.dateProfile,s=e.tDateProfile,l=t.getDateMeta(r.date,e.todayRange,e.nowDate,a),u=["fc-timeline-slot","fc-timeline-slot-label"].concat("time"===r.rowUnit?t.getSlotClassNames(l,n.theme):t.getDayClassNames(l,n.theme));r.isWeekStart&&u.push("fc-timeline-slot-em");var c=o.navLinks&&r.rowUnit&&"time"!==r.rowUnit?t.buildNavLinkData(r.date,r.rowUnit):null,d=this.refineHookProps({level:e.rowLevel,dateMarker:r.date,text:r.text,dateEnv:n.dateEnv,viewApi:n.viewApi}),h=this.normalizeClassNames(o.slotLabelClassNames,d);return t.createElement(t.MountHook,{hookProps:d,didMount:o.slotLabelDidMount,willUnmount:o.slotLabelWillUnmount},(function(n){return t.createElement("th",{ref:n,className:u.concat(h).join(" "),"data-date":i.formatIso(r.date,{omitTime:!s.isTimeScale,omitTimeZoneOffset:!0}),colSpan:r.colspan},t.createElement("div",{className:"fc-timeline-slot-frame",style:{height:e.rowInnerHeight}},t.createElement(p,{hookProps:d,isSticky:e.isSticky,navLinkData:c})))}))},n}(t.BaseComponent),p=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.render=function(){var e=this.props,n=this.context,i=e.navLinkData?{"data-navlink":e.navLinkData,tabIndex:0}:{};return t.createElement(t.ContentHook,{hookProps:e.hookProps,content:n.options.slotLabelContent,defaultContent:g},(function(n,o){return t.createElement("a",a({ref:n,className:"fc-timeline-slot-cushion fc-scrollgrid-sync-inner"+(e.isSticky?" fc-sticky":"")},i),o)}))},n}(t.BaseComponent);function g(e){return e.text}function v(e){return{level:e.level,date:e.dateEnv.toDate(e.dateMarker),view:e.viewApi,text:e.text}}var y=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.render=function(){var e=this.props,n=e.dateProfile,i=e.tDateProfile,o=e.rowInnerHeights,r=e.todayRange,a=e.nowDate,s=i.cellRows;return t.createElement(t.Fragment,null,s.map((function(e,l){var u=l===s.length-1,c=["fc-timeline-header-row",i.isTimeScale&&u?"fc-timeline-header-row-chrono":""];return t.createElement("tr",{key:l,className:c.join(" ")},e.map((function(e){return t.createElement(m,{key:e.date.toISOString(),cell:e,rowLevel:l,dateProfile:n,tDateProfile:i,todayRange:r,nowDate:a,rowInnerHeight:o&&o[l],isSticky:!u})})))})))},n}(t.BaseComponent),D=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.rootElRef=t.createRef(),n}return r(n,e),n.prototype.render=function(){var e=this,n=this.props,i=this.context,o=t.greatestDurationDenominator(n.tDateProfile.slotDuration).unit,r=n.slatCoords&&n.slatCoords.dateProfile===n.dateProfile?n.slatCoords:null;return t.createElement(t.NowTimer,{unit:o},(function(o,a){return t.createElement("div",{className:"fc-timeline-header",ref:e.rootElRef},t.createElement("table",{className:"fc-scrollgrid-sync-table",style:{minWidth:n.tableMinWidth,width:n.clientWidth}},n.tableColGroupNode,t.createElement("tbody",null,t.createElement(y,{dateProfile:n.dateProfile,tDateProfile:n.tDateProfile,nowDate:o,todayRange:a,rowInnerHeights:n.rowInnerHeights}))),i.options.nowIndicator&&t.createElement("div",{className:"fc-timeline-now-indicator-container"},r&&r.isDateInRange(o)&&t.createElement(t.NowIndicatorRoot,{isAxis:!0,date:o},(function(e,n,i,a){return t.createElement("div",{ref:e,className:["fc-timeline-now-indicator-arrow"].concat(n).join(" "),style:{left:r.dateToCoord(o)}},a)}))))}))},n.prototype.componentDidMount=function(){this.updateSize()},n.prototype.componentDidUpdate=function(){this.updateSize()},n.prototype.updateSize=function(){this.props.onMaxCushionWidth&&this.props.onMaxCushionWidth(this.computeMaxCushionWidth())},n.prototype.computeMaxCushionWidth=function(){return Math.max.apply(Math,t.findElements(this.rootElRef.current,".fc-timeline-header-row:last-child .fc-timeline-slot-cushion").map((function(e){return e.getBoundingClientRect().width})))},n}(t.BaseComponent),S=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.render=function(){var e=this.props,n=this.context,i=n.dateEnv,o=n.options,r=n.theme,s=e.date,l=e.tDateProfile,u=e.isEm,c=t.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),d=["fc-timeline-slot","fc-timeline-slot-lane"],h={"data-date":i.formatIso(s,{omitTimeZoneOffset:!0,omitTime:!l.isTimeScale})},f=a(a({date:i.toDate(e.date)},c),{view:n.viewApi});return u&&d.push("fc-timeline-slot-em"),l.isTimeScale&&d.push(t.isInt(i.countDurationsBetween(l.normalizedRange.start,e.date,l.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor"),d.push.apply(d,e.isDay?t.getDayClassNames(c,r):t.getSlotClassNames(c,r)),t.createElement(t.RenderHook,{hookProps:f,classNames:o.slotLaneClassNames,content:o.slotLaneContent,didMount:o.slotLaneDidMount,willUnmount:o.slotLaneWillUnmount,elRef:e.elRef},(function(e,n,i,o){return t.createElement("td",a({ref:e,className:d.concat(n).join(" ")},h),t.createElement("div",{ref:i},o))}))},n}(t.BaseComponent),C=function(){function e(e,n,i,o,r,a){this.slatRootEl=e,this.dateProfile=i,this.tDateProfile=o,this.dateEnv=r,this.isRtl=a,this.outerCoordCache=new t.PositionCache(e,n,!0,!1),this.innerCoordCache=new t.PositionCache(e,t.findDirectChildren(n,"div"),!0,!1)}return e.prototype.rangeToCoords=function(e){return this.isRtl?{right:this.dateToCoord(e.start),left:this.dateToCoord(e.end)}:{left:this.dateToCoord(e.start),right:this.dateToCoord(e.end)}},e.prototype.isDateInRange=function(e){return t.rangeContainsMarker(this.dateProfile.currentRange,e)},e.prototype.dateToCoord=function(e){var t=this.tDateProfile,n=this.computeDateSnapCoverage(e)/t.snapsPerSlot,i=Math.floor(n),o=n-(i=Math.min(i,t.slotCnt-1)),r=this.innerCoordCache,a=this.outerCoordCache;return this.isRtl?a.rights[i]-r.getWidth(i)*o-a.originClientRect.width:a.lefts[i]+r.getWidth(i)*o},e.prototype.computeDateSnapCoverage=function(e){return R(e,this.tDateProfile,this.dateEnv)},e.prototype.computeDurationLeft=function(e){var n=this.dateProfile,i=this.tDateProfile,o=this.dateEnv,r=this.isRtl,a=0;if(n){var s=o.add(n.activeRange.start,e);i.isTimeScale||(s=t.startOfDay(s)),a=this.dateToCoord(s),!r&&a&&(a+=1)}return a},e}();function R(e,n,i){var o=i.countDurationsBetween(n.normalizedRange.start,e,n.snapDuration);if(o<0)return 0;if(o>=n.snapDiffToIndex.length)return n.snapCnt;var r=Math.floor(o),a=n.snapDiffToIndex[r];return t.isInt(a)?a+=o-r:a=Math.ceil(a),a}var w=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.rootElRef=t.createRef(),n.cellElRefs=new t.RefMap,n.handleScrollRequest=function(e){var t=n.props.onScrollLeftRequest,i=n.coords;if(t&&i){if(e.time)t(i.computeDurationLeft(e.time));return!0}},n}return r(n,e),n.prototype.render=function(){var e=this.props,n=this.context;return t.createElement("div",{className:"fc-timeline-slots",ref:this.rootElRef},t.createElement("table",{className:n.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,t.createElement(E,{cellElRefs:this.cellElRefs,dateProfile:e.dateProfile,tDateProfile:e.tDateProfile,nowDate:e.nowDate,todayRange:e.todayRange})))},n.prototype.componentDidMount=function(){this.updateSizing(),this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)},n.prototype.componentDidUpdate=function(e){this.updateSizing(),this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)},n.prototype.componentWillUnmount=function(){this.scrollResponder.detach(),this.props.onCoords&&this.props.onCoords(null)},n.prototype.updateSizing=function(){var e,t=this.props,n=this.context;null!==t.clientWidth&&this.scrollResponder&&(this.rootElRef.current.offsetWidth&&(this.coords=new C(this.rootElRef.current,(e=this.cellElRefs.currentMap,t.tDateProfile.slotDates.map((function(t){var n=t.toISOString();return e[n]}))),t.dateProfile,t.tDateProfile,n.dateEnv,n.isRtl),t.onCoords&&t.onCoords(this.coords),this.scrollResponder.update(!1)))},n.prototype.positionToHit=function(e){var n=this.coords.outerCoordCache,i=this.context,o=i.dateEnv,r=i.isRtl,a=this.props.tDateProfile,s=n.leftToIndex(e);if(null!=s){var l=n.getWidth(s),u=r?(n.rights[s]-e)/l:(e-n.lefts[s])/l,c=Math.floor(u*a.snapsPerSlot),d=o.add(a.slotDates[s],t.multiplyDuration(a.snapDuration,c));return{dateSpan:{range:{start:d,end:o.add(d,a.snapDuration)},allDay:!this.props.tDateProfile.isTimeScale},dayEl:this.cellElRefs.currentMap[s],left:n.lefts[s],right:n.rights[s]}}return null},n}(t.BaseComponent),E=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.render=function(){var e=this.props,n=e.tDateProfile,i=e.cellElRefs,o=n.slotDates,r=n.isWeekStarts,a=!n.isTimeScale&&!n.largeUnit;return t.createElement("tbody",null,t.createElement("tr",null,o.map((function(o,s){var l=o.toISOString();return t.createElement(S,{key:l,elRef:i.createRef(l),date:o,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:r[s],isDay:a})}))))},n}(t.BaseComponent);var b=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.render=function(){var e=this.props,n=[].concat(e.eventResizeSegs,e.dateSelectionSegs);return e.timelineCoords&&t.createElement("div",{className:"fc-timeline-bg"},this.renderSegs(e.businessHourSegs||[],e.timelineCoords,"non-business"),this.renderSegs(e.bgEventSegs||[],e.timelineCoords,"bg-event"),this.renderSegs(n,e.timelineCoords,"highlight"))},n.prototype.renderSegs=function(e,n,i){var o=this.props,r=o.todayRange,s=o.nowDate,l=e.map((function(e){var o=n.rangeToCoords(e);return t.createElement("div",{key:t.buildEventRangeKey(e.eventRange),className:"fc-timeline-bg-harness",style:{left:o.left,right:-o.right}},"bg-event"===i?t.createElement(t.BgEvent,a({seg:e},t.getSegMeta(e,r,s))):t.renderFill(i))}));return t.createElement(t.Fragment,null,l)},n}(t.BaseComponent),P=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.sliceRange=function(e,n,i,o,r){var a=function(e,n,i){if(!n.isTimeScale&&(e=t.computeVisibleDayRange(e),n.largeUnit)){var o=e;((e={start:i.startOf(e.start,n.largeUnit),end:i.startOf(e.end,n.largeUnit)}).end.valueOf()!==o.end.valueOf()||e.end<=e.start)&&(e={start:e.start,end:i.add(e.end,n.slotDuration)})}return e}(e,o,r),s=[];if(R(a.start,o,r)<R(a.end,o,r)){var l=t.intersectRanges(a,o.normalizedRange);l&&s.push({start:l.start,end:l.end,isStart:l.start.valueOf()===a.start.valueOf()&&c(l.start,o,n,i),isEnd:l.end.valueOf()===a.end.valueOf()&&c(t.addMs(l.end,-1),o,n,i)})}return s},n}(t.Slicer),k=t.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"}),M=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return r(n,e),n.prototype.render=function(){var e=this.props;return t.createElement(t.StandardEvent,a({},e,{extraClassNames:["fc-timeline-event","fc-h-event"],defaultTimeFormat:k,defaultDisplayEventTime:!e.isTimeScale}))},n}(t.BaseComponent);function T(e,t){var n={};if(t)for(var i=0,o=e;i<o.length;i++){var r=o[i];n[r.eventRange.instance.instanceId]=t.rangeToCoords(r)}return n}function W(e,n,i){var o,r,a,s,l=[],u=0;if(i)for(var c=0,d=e=t.sortEventSegs(e,n);c<d.length;c++){var h=d[c].eventRange.instance.instanceId,f=i[h];if(f){for(var m=0,p=0,g=0;g<l.length;g++){var v=l[g];o=f,r=m,a=v.dims,s=v.top,o.right>a.left&&o.left<a.right&&r+o.height>s&&r<s+a.height&&(m=v.top+v.dims.height,p=g)}for(;p<l.length&&m>=l[p].top;)p++;l.splice(p,0,{key:h,dims:f,top:m}),u=Math.max(u,m+f.height)}}for(var y={},D=0,S=l;D<S.length;D++){y[(v=S[D]).key]=v.top}return{segTops:y,height:u}}var I=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.slicer=new P,n.computeFgSegHorizontals=t.memoize(T),n.computeSegVerticals=t.memoize(W),n.harnessElRefs=new t.RefMap,n.innerElRef=t.createRef(),n.state={segDims:null},n}return r(n,e),n.prototype.render=function(){var e=this.props,n=this.state,i=this.context,o=e.dateProfile,r=e.tDateProfile,a=this.slicer.sliceProps(e,o,r.isTimeScale?null:e.nextDayThreshold,i,o,i.dateProfileGenerator,r,i.dateEnv),s=(a.eventDrag?a.eventDrag.segs:null)||(a.eventResize?a.eventResize.segs:null)||[],l=this.computeFgSegHorizontals(a.fgEventSegs,e.timelineCoords),u=this.computeSegVerticals(a.fgEventSegs,i.options.eventOrder,n.segDims),c=u.segTops,d=u.height,h=(a.eventDrag?a.eventDrag.affectedInstances:null)||(a.eventResize?a.eventResize.affectedInstances:null)||{};return t.createElement(t.Fragment,null,t.createElement(b,{businessHourSegs:a.businessHourSegs,bgEventSegs:a.bgEventSegs,timelineCoords:e.timelineCoords,eventResizeSegs:a.eventResize?a.eventResize.segs:[],dateSelectionSegs:a.dateSelectionSegs,nowDate:e.nowDate,todayRange:e.todayRange}),t.createElement("div",{className:"fc-timeline-events fc-scrollgrid-sync-inner",ref:this.innerElRef,style:{height:d}},this.renderFgSegs(a.fgEventSegs,l,c,h,!1,!1,!1),this.renderFgSegs(s,T(s,e.timelineCoords),c,{},Boolean(a.eventDrag),Boolean(a.eventResize),!1)))},n.prototype.componentDidMount=function(){this.updateSize()},n.prototype.componentDidUpdate=function(e,t){e.eventStore===this.props.eventStore&&e.timelineCoords===this.props.timelineCoords||this.updateSize()},n.prototype.updateSize=function(){var e=this,n=this.props,i=n.timelineCoords;if(n.onHeightChange&&n.onHeightChange(this.innerElRef.current,!1),i){var o=i.slatRootEl.getBoundingClientRect();this.setState({segDims:t.mapHash(this.harnessElRefs.currentMap,(function(e){var t=e.getBoundingClientRect();return{left:Math.round(t.left-o.left),right:Math.round(t.right-o.left),height:Math.round(t.height)}}))},(function(){n.onHeightChange&&n.onHeightChange(e.innerElRef.current,!0)}))}},n.prototype.renderFgSegs=function(e,n,i,o,r,s,l){var u=this,c=this.harnessElRefs,d=this.props,h=r||s||l;return t.createElement(t.Fragment,null,e.map((function(e){var f=e.eventRange.instance.instanceId,m=n[f],p=i[f];return t.createElement("div",{key:f,ref:h?null:c.createRef(f),className:"fc-timeline-event-harness",style:{left:m?m.left:"",right:m?-m.right:"",top:null!=p?p:"",visibility:o[f]?"hidden":""}},t.createElement(M,a({isTimeScale:u.props.tDateProfile.isTimeScale,seg:e,isDragging:r,isResizing:s,isDateSelecting:l,isSelected:f===u.props.eventSelection},t.getSegMeta(e,d.todayRange,d.nowDate))))})))},n}(t.BaseComponent),N=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.slatsRef=t.createRef(),n.state={coords:null},n.handeEl=function(e){e?n.context.registerInteractiveComponent(n,{el:e}):n.context.unregisterInteractiveComponent(n)},n.handleCoords=function(e){n.setState({coords:e}),n.props.onSlatCoords&&n.props.onSlatCoords(e)},n}return r(n,e),n.prototype.render=function(){var e=this,n=this.props,i=this.state,o=this.context.options,r=n.dateProfile,a=n.tDateProfile,s=t.greatestDurationDenominator(a.slotDuration).unit;return t.createElement("div",{className:"fc-timeline-body",ref:this.handeEl,style:{minWidth:n.tableMinWidth,height:n.clientHeight,width:n.clientWidth}},t.createElement(t.NowTimer,{unit:s},(function(s,l){return t.createElement(t.Fragment,null,t.createElement(w,{ref:e.slatsRef,dateProfile:r,tDateProfile:a,nowDate:s,todayRange:l,clientWidth:n.clientWidth,tableColGroupNode:n.tableColGroupNode,tableMinWidth:n.tableMinWidth,onCoords:e.handleCoords,onScrollLeftRequest:n.onScrollLeftRequest}),t.createElement(I,{dateProfile:r,tDateProfile:n.tDateProfile,nowDate:s,todayRange:l,nextDayThreshold:o.nextDayThreshold,businessHours:n.businessHours,eventStore:n.eventStore,eventUiBases:n.eventUiBases,dateSelection:n.dateSelection,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,timelineCoords:i.coords}),o.nowIndicator&&i.coords&&i.coords.isDateInRange(s)&&t.createElement("div",{className:"fc-timeline-now-indicator-container"},t.createElement(t.NowIndicatorRoot,{isAxis:!1,date:s},(function(e,n,o,r){return t.createElement("div",{ref:e,className:["fc-timeline-now-indicator-line"].concat(n).join(" "),style:{left:i.coords.dateToCoord(s)}},r)}))))})))},n.prototype.queryHit=function(e,t,n,i){var o=this.slatsRef.current.positionToHit(e);if(o)return{component:this,dateSpan:o.dateSpan,rect:{left:o.left,right:o.right,top:0,bottom:i},dayEl:o.dayEl,layer:0}},n}(t.DateComponent),x=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.buildTimelineDateProfile=t.memoize(l),n.scrollGridRef=t.createRef(),n.state={slatCoords:null,slotCushionMaxWidth:null},n.handleSlatCoords=function(e){n.setState({slatCoords:e})},n.handleScrollLeftRequest=function(e){n.scrollGridRef.current.forceScrollLeft(0,e)},n.handleMaxCushionWidth=function(e){n.setState({slotCushionMaxWidth:Math.ceil(e)})},n}return r(n,e),n.prototype.render=function(){var e=this,n=this.props,o=this.state,r=this.context,s=r.options,l=!n.forPrint&&t.getStickyHeaderDates(s),u=!n.forPrint&&t.getStickyFooterScrollbar(s),c=this.buildTimelineDateProfile(n.dateProfile,r.dateEnv,s,r.dateProfileGenerator),d=["fc-timeline",!1===s.eventOverlap?"fc-timeline-overlap-disabled":""],h=s.slotMinWidth,f=L(c,h||this.computeFallbackSlotMinWidth(c)),m=[{type:"header",key:"header",isSticky:l,chunks:[{key:"timeline",content:function(i){return t.createElement(D,{dateProfile:n.dateProfile,clientWidth:i.clientWidth,clientHeight:i.clientHeight,tableMinWidth:i.tableMinWidth,tableColGroupNode:i.tableColGroupNode,tDateProfile:c,slatCoords:o.slatCoords,onMaxCushionWidth:h?null:e.handleMaxCushionWidth})}}]},{type:"body",key:"body",liquid:!0,chunks:[{key:"timeline",content:function(i){return t.createElement(N,a({},n,{clientWidth:i.clientWidth,clientHeight:i.clientHeight,tableMinWidth:i.tableMinWidth,tableColGroupNode:i.tableColGroupNode,tDateProfile:c,onSlatCoords:e.handleSlatCoords,onScrollLeftRequest:e.handleScrollLeftRequest}))}}]}];return u&&m.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"timeline",content:t.renderScrollShim}]}),t.createElement(t.ViewRoot,{viewSpec:r.viewSpec},(function(o,r){return t.createElement("div",{ref:o,className:d.concat(r).join(" ")},t.createElement(i.ScrollGrid,{ref:e.scrollGridRef,liquid:!n.isHeightAuto&&!n.forPrint,colGroups:[{cols:f}],sections:m}))}))},n.prototype.computeFallbackSlotMinWidth=function(e){return Math.max(30,(this.state.slotCushionMaxWidth||0)/e.slotsPerLabel)},n}(t.DateComponent);function L(e,t){return[{span:e.slotCnt,minWidth:t||1}]}var z=t.createPlugin({deps:[n],initialView:"timelineDay",views:{timeline:{component:x,usesMinMaxTime:!0,eventResizableFromStart:!0},timelineDay:{type:"timeline",duration:{days:1}},timelineWeek:{type:"timeline",duration:{weeks:1}},timelineMonth:{type:"timeline",duration:{months:1}},timelineYear:{type:"timeline",duration:{years:1}}}});return t.globalPlugins.push(z),e.TimelineCoords=C,e.TimelineHeader=D,e.TimelineHeaderRows=y,e.TimelineLane=I,e.TimelineLaneBg=b,e.TimelineLaneSlicer=P,e.TimelineSlats=w,e.TimelineView=x,e.buildSlatCols=L,e.buildTimelineDateProfile=l,e.default=z,e}({},FullCalendar,FullCalendarPremiumCommon,FullCalendarScrollGrid); | ||
var FullCalendarTimeline=function(e,t,n,o){"use strict";function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var r=i(n),a=function(e,t){return(a=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 s(e,t){function n(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var l=function(){return(l=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};t.config.MAX_TIMELINE_SLOTS=1e3;var u=[{years:1},{months:1},{days:1},{hours:1},{minutes:30},{minutes:15},{minutes:10},{minutes:5},{minutes:1},{seconds:30},{seconds:15},{seconds:10},{seconds:5},{seconds:1},{milliseconds:500},{milliseconds:100},{milliseconds:10},{milliseconds:1}];function c(e,n,o,i){var r={labelInterval:o.slotLabelInterval,slotDuration:o.slotDuration};!function(e,n,o){var i=n.currentRange;if(e.labelInterval){o.countDurationsBetween(i.start,i.end,e.labelInterval)>t.config.MAX_TIMELINE_SLOTS&&(console.warn("slotLabelInterval results in too many cells"),e.labelInterval=null)}if(e.slotDuration){o.countDurationsBetween(i.start,i.end,e.slotDuration)>t.config.MAX_TIMELINE_SLOTS&&(console.warn("slotDuration results in too many cells"),e.slotDuration=null)}if(e.labelInterval&&e.slotDuration){var r=t.wholeDivideDurations(e.labelInterval,e.slotDuration);(null===r||r<1)&&(console.warn("slotLabelInterval must be a multiple of slotDuration"),e.slotDuration=null)}}(r,e,n),h(r,e,n),function(e,n,o){var i=n.currentRange,r=e.slotDuration;if(!r){for(var a=h(e,n,o),s=0,l=u;s<l.length;s++){var c=l[s],d=t.createDuration(c),f=t.wholeDivideDurations(a,d);if(null!==f&&f>1&&f<=6){r=d;break}}if(r)o.countDurationsBetween(i.start,i.end,r)>200&&(r=null);r||(r=a),e.slotDuration=r}}(r,e,n);var a=o.slotLabelFormat,s=Array.isArray(a)?a:null!=a?[a]:function(e,n,o,i){var r,a,s=e.labelInterval,l=t.greatestDurationDenominator(s).unit,u=i.weekNumbers,c=r=a=null;"week"!==l||u||(l="day");switch(l){case"year":c={year:"numeric"};break;case"month":m("years",n,o)>1&&(c={year:"numeric"}),r={month:"short"};break;case"week":m("years",n,o)>1&&(c={year:"numeric"}),r={week:"narrow"};break;case"day":m("years",n,o)>1?c={year:"numeric",month:"long"}:m("months",n,o)>1&&(c={month:"long"}),u&&(r={week:"short"}),a={weekday:"narrow",day:"numeric"};break;case"hour":u&&(c={week:"short"}),m("days",n,o)>1&&(r={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),a={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":t.asRoughMinutes(s)/60>=6?(c={hour:"numeric",meridiem:"short"},r=function(e){return":"+t.padStart(e.date.minute,2)}):c={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":t.asRoughSeconds(s)/60>=6?(c={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},r=function(e){return":"+t.padStart(e.date.second,2)}):c={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"};break;case"millisecond":c={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"},r=function(e){return"."+t.padStart(e.millisecond,3)}}return[].concat(c||[],r||[],a||[])}(r,e,n,o);r.headerFormats=s.map((function(e){return t.createFormatter(e)})),r.isTimeScale=Boolean(r.slotDuration.milliseconds);var l=null;if(!r.isTimeScale){var c=t.greatestDurationDenominator(r.slotDuration).unit;/year|month|week/.test(c)&&(l=c)}r.largeUnit=l,r.emphasizeWeeks=1===t.asCleanDays(r.slotDuration)&&m("weeks",e,n)>=2&&!o.businessHours;var g,v,y=o.snapDuration;y&&(g=t.createDuration(y),v=t.wholeDivideDurations(r.slotDuration,g)),null==v&&(g=r.slotDuration,v=1),r.snapDuration=g,r.snapsPerSlot=v;var D=t.asRoughMs(e.slotMaxTime)-t.asRoughMs(e.slotMinTime),S=d(e.renderRange.start,r,n),C=d(e.renderRange.end,r,n);r.isTimeScale&&(S=n.add(S,e.slotMinTime),C=n.add(t.addDays(C,-1),e.slotMaxTime)),r.timeWindowMs=D,r.normalizedRange={start:S,end:C};for(var R=[],w=S;w<C;)f(w,r,e,i)&&R.push(w),w=n.add(w,r.slotDuration);r.slotDates=R;var E=-1,b=0,P=[],M=[];for(w=S;w<C;)f(w,r,e,i)?(E+=1,P.push(E),M.push(b)):P.push(E+.5),w=n.add(w,r.snapDuration),b+=1;return r.snapDiffToIndex=P,r.snapIndexToDiff=M,r.snapCnt=E+1,r.slotCnt=r.snapCnt/r.snapsPerSlot,r.isWeekStarts=function(e,t){for(var n=e.slotDates,o=e.emphasizeWeeks,i=null,r=[],a=0,s=n;a<s.length;a++){var l=s[a],u=t.computeWeekNumber(l),c=o&&null!==i&&i!==u;i=u,r.push(c)}return r}(r,n),r.cellRows=function(e,n){for(var o=e.slotDates,i=e.headerFormats,r=i.map((function(){return[]})),a=t.asCleanDays(e.slotDuration),s=7===a?"week":1===a?"day":null,l=i.map((function(e){return e.getLargestUnit?e.getLargestUnit():null})),u=0;u<o.length;u+=1)for(var c=o[u],d=e.isWeekStarts[u],f=0;f<i.length;f+=1){var h=i[f],m=r[f],g=m[m.length-1],v=f===i.length-1,y=i.length>1&&!v,D=null,S=l[f]||(v?s:null);if(y){var C=n.format(c,h);g&&g.text===C?g.colspan+=1:D=p(c,C,S)}else if(!g||t.isInt(n.countDurationsBetween(e.normalizedRange.start,c,e.labelInterval))){C=n.format(c,h);D=p(c,C,S)}else g.colspan+=1;D&&(D.weekStart=d,m.push(D))}return r}(r,n),r.slotsPerLabel=t.wholeDivideDurations(r.labelInterval,r.slotDuration),r}function d(e,n,o){var i=e;return n.isTimeScale||(i=t.startOfDay(i),n.largeUnit&&(i=o.startOf(i,n.largeUnit))),i}function f(e,n,o,i){if(i.isHiddenDay(e))return!1;if(n.isTimeScale){var r=t.startOfDay(e),a=e.valueOf()-r.valueOf()-t.asRoughMs(o.slotMinTime);return(a=(a%864e5+864e5)%864e5)<n.timeWindowMs}return!0}function h(e,n,o){var i=n.currentRange,r=e.labelInterval;if(!r){var a=void 0;if(e.slotDuration){for(var s=0,l=u;s<l.length;s++){a=l[s];var c=t.createDuration(a),d=t.wholeDivideDurations(c,e.slotDuration);if(null!==d&&d<=6){r=c;break}}r||(r=e.slotDuration)}else for(var f=0,h=u;f<h.length;f++){if(a=h[f],r=t.createDuration(a),o.countDurationsBetween(i.start,i.end,r)>=18)break}e.labelInterval=r}return r}function m(e,n,o){var i=n.currentRange,r=null;return"years"===e?r=o.diffWholeYears(i.start,i.end):"months"===e||"weeks"===e?r=o.diffWholeMonths(i.start,i.end):"days"===e&&(r=t.diffWholeDays(i.start,i.end)),r||0}function p(e,t,n){return{date:e,text:t,rowUnit:n,colspan:1,isWeekStart:!1}}var g=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.render=function(){var e=this.props,n=this.context,o=e.navLinkData?{"data-navlink":e.navLinkData,tabIndex:0}:{};return t.createElement(t.ContentHook,{hookProps:e.hookProps,content:n.options.slotLabelContent,defaultContent:v},(function(n,i){return t.createElement("a",l({ref:n,className:"fc-timeline-slot-cushion fc-scrollgrid-sync-inner"+(e.isSticky?" fc-sticky":"")},o),i)}))},n}(t.BaseComponent);function v(e){return e.text}function y(e){return{level:e.level,date:e.dateEnv.toDate(e.dateMarker),view:e.viewApi,text:e.text}}var D=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.refineHookProps=t.memoizeObjArg(y),n.normalizeClassNames=t.buildClassNameNormalizer(),n}return s(n,e),n.prototype.render=function(){var e=this.props,n=this.context,o=n.dateEnv,i=n.options,r=e.cell,a=e.dateProfile,s=e.tDateProfile,l=t.getDateMeta(r.date,e.todayRange,e.nowDate,a),u=["fc-timeline-slot","fc-timeline-slot-label"].concat("time"===r.rowUnit?t.getSlotClassNames(l,n.theme):t.getDayClassNames(l,n.theme));r.isWeekStart&&u.push("fc-timeline-slot-em");var c=i.navLinks&&r.rowUnit&&"time"!==r.rowUnit?t.buildNavLinkData(r.date,r.rowUnit):null,d=this.refineHookProps({level:e.rowLevel,dateMarker:r.date,text:r.text,dateEnv:n.dateEnv,viewApi:n.viewApi}),f=this.normalizeClassNames(i.slotLabelClassNames,d);return t.createElement(t.MountHook,{hookProps:d,didMount:i.slotLabelDidMount,willUnmount:i.slotLabelWillUnmount},(function(n){return t.createElement("th",{ref:n,className:u.concat(f).join(" "),"data-date":o.formatIso(r.date,{omitTime:!s.isTimeScale,omitTimeZoneOffset:!0}),colSpan:r.colspan},t.createElement("div",{className:"fc-timeline-slot-frame",style:{height:e.rowInnerHeight}},t.createElement(g,{hookProps:d,isSticky:e.isSticky,navLinkData:c})))}))},n}(t.BaseComponent),S=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.render=function(){var e=this.props,n=e.dateProfile,o=e.tDateProfile,i=e.rowInnerHeights,r=e.todayRange,a=e.nowDate,s=o.cellRows;return t.createElement(t.Fragment,null,s.map((function(e,l){var u=l===s.length-1,c=["fc-timeline-header-row",o.isTimeScale&&u?"fc-timeline-header-row-chrono":""];return t.createElement("tr",{key:l,className:c.join(" ")},e.map((function(e){return t.createElement(D,{key:e.date.toISOString(),cell:e,rowLevel:l,dateProfile:n,tDateProfile:o,todayRange:r,nowDate:a,rowInnerHeight:i&&i[l],isSticky:!u})})))})))},n}(t.BaseComponent),C=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.rootElRef=t.createRef(),n}return s(n,e),n.prototype.render=function(){var e=this,n=this.props,o=this.context,i=t.greatestDurationDenominator(n.tDateProfile.slotDuration).unit,r=n.slatCoords&&n.slatCoords.dateProfile===n.dateProfile?n.slatCoords:null;return t.createElement(t.NowTimer,{unit:i},(function(i,a){return t.createElement("div",{className:"fc-timeline-header",ref:e.rootElRef},t.createElement("table",{className:"fc-scrollgrid-sync-table",style:{minWidth:n.tableMinWidth,width:n.clientWidth}},n.tableColGroupNode,t.createElement("tbody",null,t.createElement(S,{dateProfile:n.dateProfile,tDateProfile:n.tDateProfile,nowDate:i,todayRange:a,rowInnerHeights:n.rowInnerHeights}))),o.options.nowIndicator&&t.createElement("div",{className:"fc-timeline-now-indicator-container"},r&&r.isDateInRange(i)&&t.createElement(t.NowIndicatorRoot,{isAxis:!0,date:i},(function(e,n,o,a){return t.createElement("div",{ref:e,className:["fc-timeline-now-indicator-arrow"].concat(n).join(" "),style:{left:r.dateToCoord(i)}},a)}))))}))},n.prototype.componentDidMount=function(){this.updateSize()},n.prototype.componentDidUpdate=function(){this.updateSize()},n.prototype.updateSize=function(){this.props.onMaxCushionWidth&&this.props.onMaxCushionWidth(this.computeMaxCushionWidth())},n.prototype.computeMaxCushionWidth=function(){return Math.max.apply(Math,t.findElements(this.rootElRef.current,".fc-timeline-header-row:last-child .fc-timeline-slot-cushion").map((function(e){return e.getBoundingClientRect().width})))},n}(t.BaseComponent),R=function(){function e(e,n,o,i,r,a){this.slatRootEl=e,this.dateProfile=o,this.tDateProfile=i,this.dateEnv=r,this.isRtl=a,this.outerCoordCache=new t.PositionCache(e,n,!0,!1),this.innerCoordCache=new t.PositionCache(e,t.findDirectChildren(n,"div"),!0,!1)}return e.prototype.rangeToCoords=function(e){return this.isRtl?{right:this.dateToCoord(e.start),left:this.dateToCoord(e.end)}:{left:this.dateToCoord(e.start),right:this.dateToCoord(e.end)}},e.prototype.isDateInRange=function(e){return t.rangeContainsMarker(this.dateProfile.currentRange,e)},e.prototype.dateToCoord=function(e){var t=this.tDateProfile,n=this.computeDateSnapCoverage(e)/t.snapsPerSlot,o=Math.floor(n),i=n-(o=Math.min(o,t.slotCnt-1)),r=this.innerCoordCache,a=this.outerCoordCache;return this.isRtl?a.rights[o]-r.getWidth(o)*i-a.originClientRect.width:a.lefts[o]+r.getWidth(o)*i},e.prototype.computeDateSnapCoverage=function(e){return w(e,this.tDateProfile,this.dateEnv)},e.prototype.computeDurationLeft=function(e){var n=this.dateProfile,o=this.tDateProfile,i=this.dateEnv,r=this.isRtl,a=0;if(n){var s=i.add(n.activeRange.start,e);o.isTimeScale||(s=t.startOfDay(s)),a=this.dateToCoord(s),!r&&a&&(a+=1)}return a},e}();function w(e,n,o){var i=o.countDurationsBetween(n.normalizedRange.start,e,n.snapDuration);if(i<0)return 0;if(i>=n.snapDiffToIndex.length)return n.snapCnt;var r=Math.floor(i),a=n.snapDiffToIndex[r];return t.isInt(a)?a+=i-r:a=Math.ceil(a),a}var E=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.render=function(){var e=this.props,n=this.context,o=n.dateEnv,i=n.options,r=n.theme,a=e.date,s=e.tDateProfile,u=e.isEm,c=t.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),d=["fc-timeline-slot","fc-timeline-slot-lane"],f={"data-date":o.formatIso(a,{omitTimeZoneOffset:!0,omitTime:!s.isTimeScale})},h=l(l({date:o.toDate(e.date)},c),{view:n.viewApi});return u&&d.push("fc-timeline-slot-em"),s.isTimeScale&&d.push(t.isInt(o.countDurationsBetween(s.normalizedRange.start,e.date,s.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor"),d.push.apply(d,e.isDay?t.getDayClassNames(c,r):t.getSlotClassNames(c,r)),t.createElement(t.RenderHook,{hookProps:h,classNames:i.slotLaneClassNames,content:i.slotLaneContent,didMount:i.slotLaneDidMount,willUnmount:i.slotLaneWillUnmount,elRef:e.elRef},(function(e,n,o,i){return t.createElement("td",l({ref:e,className:d.concat(n).join(" ")},f),t.createElement("div",{ref:o},i))}))},n}(t.BaseComponent),b=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.render=function(){var e=this.props,n=e.tDateProfile,o=e.cellElRefs,i=n.slotDates,r=n.isWeekStarts,a=!n.isTimeScale&&!n.largeUnit;return t.createElement("tbody",null,t.createElement("tr",null,i.map((function(i,s){var l=i.toISOString();return t.createElement(E,{key:l,elRef:o.createRef(l),date:i,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:r[s],isDay:a})}))))},n}(t.BaseComponent),P=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.rootElRef=t.createRef(),n.cellElRefs=new t.RefMap,n.handleScrollRequest=function(e){var t=n.props.onScrollLeftRequest,o=n.coords;if(t&&o){if(e.time)t(o.computeDurationLeft(e.time));return!0}return null},n}return s(n,e),n.prototype.render=function(){var e=this.props,n=this.context;return t.createElement("div",{className:"fc-timeline-slots",ref:this.rootElRef},t.createElement("table",{className:n.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,t.createElement(b,{cellElRefs:this.cellElRefs,dateProfile:e.dateProfile,tDateProfile:e.tDateProfile,nowDate:e.nowDate,todayRange:e.todayRange})))},n.prototype.componentDidMount=function(){this.updateSizing(),this.scrollResponder=this.context.createScrollResponder(this.handleScrollRequest)},n.prototype.componentDidUpdate=function(e){this.updateSizing(),this.scrollResponder.update(e.dateProfile!==this.props.dateProfile)},n.prototype.componentWillUnmount=function(){this.scrollResponder.detach(),this.props.onCoords&&this.props.onCoords(null)},n.prototype.updateSizing=function(){var e,t=this.props,n=this.context;null!==t.clientWidth&&this.scrollResponder&&(this.rootElRef.current.offsetWidth&&(this.coords=new R(this.rootElRef.current,(e=this.cellElRefs.currentMap,t.tDateProfile.slotDates.map((function(t){var n=t.toISOString();return e[n]}))),t.dateProfile,t.tDateProfile,n.dateEnv,n.isRtl),t.onCoords&&t.onCoords(this.coords),this.scrollResponder.update(!1)))},n.prototype.positionToHit=function(e){var n=this.coords.outerCoordCache,o=this.context,i=o.dateEnv,r=o.isRtl,a=this.props.tDateProfile,s=n.leftToIndex(e);if(null!=s){var l=n.getWidth(s),u=r?(n.rights[s]-e)/l:(e-n.lefts[s])/l,c=Math.floor(u*a.snapsPerSlot),d=i.add(a.slotDates[s],t.multiplyDuration(a.snapDuration,c));return{dateSpan:{range:{start:d,end:i.add(d,a.snapDuration)},allDay:!this.props.tDateProfile.isTimeScale},dayEl:this.cellElRefs.currentMap[s],left:n.lefts[s],right:n.rights[s]}}return null},n}(t.BaseComponent);var M=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.render=function(){var e=this.props,n=[].concat(e.eventResizeSegs,e.dateSelectionSegs);return e.timelineCoords&&t.createElement("div",{className:"fc-timeline-bg"},this.renderSegs(e.businessHourSegs||[],e.timelineCoords,"non-business"),this.renderSegs(e.bgEventSegs||[],e.timelineCoords,"bg-event"),this.renderSegs(n,e.timelineCoords,"highlight"))},n.prototype.renderSegs=function(e,n,o){var i=this.props,r=i.todayRange,a=i.nowDate,s=e.map((function(e){var i=n.rangeToCoords(e);return t.createElement("div",{key:t.buildEventRangeKey(e.eventRange),className:"fc-timeline-bg-harness",style:{left:i.left,right:-i.right}},"bg-event"===o?t.createElement(t.BgEvent,l({seg:e},t.getSegMeta(e,r,a))):t.renderFill(o))}));return t.createElement(t.Fragment,null,s)},n}(t.BaseComponent),k=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.sliceRange=function(e,n,o,i,r){var a=function(e,n,o){if(!n.isTimeScale&&(e=t.computeVisibleDayRange(e),n.largeUnit)){var i=e;((e={start:o.startOf(e.start,n.largeUnit),end:o.startOf(e.end,n.largeUnit)}).end.valueOf()!==i.end.valueOf()||e.end<=e.start)&&(e={start:e.start,end:o.add(e.end,n.slotDuration)})}return e}(e,i,r),s=[];if(w(a.start,i,r)<w(a.end,i,r)){var l=t.intersectRanges(a,i.normalizedRange);l&&s.push({start:l.start,end:l.end,isStart:l.start.valueOf()===a.start.valueOf()&&f(l.start,i,n,o),isEnd:l.end.valueOf()===a.end.valueOf()&&f(t.addMs(l.end,-1),i,n,o)})}return s},n}(t.Slicer),T=t.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"}),W=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.render=function(){var e=this.props;return t.createElement(t.StandardEvent,l({},e,{extraClassNames:["fc-timeline-event","fc-h-event"],defaultTimeFormat:T,defaultDisplayEventTime:!e.isTimeScale}))},n}(t.BaseComponent);function I(e,t){var n={};if(t)for(var o=0,i=e;o<i.length;o++){var r=i[o];n[r.eventRange.instance.instanceId]=t.rangeToCoords(r)}return n}function N(e,n,o){var i,r,a,s,l=[],u=0;if(o)for(var c=0,d=e=t.sortEventSegs(e,n);c<d.length;c++){var f=d[c].eventRange.instance.instanceId,h=o[f];if(h){for(var m=0,p=0,g=0;g<l.length;g+=1){var v=l[g];i=h,r=m,a=v.dims,s=v.top,i.right>a.left&&i.left<a.right&&r+i.height>s&&r<s+a.height&&(m=v.top+v.dims.height,p=g)}for(;p<l.length&&m>=l[p].top;)p+=1;l.splice(p,0,{key:f,dims:h,top:m}),u=Math.max(u,m+h.height)}}for(var y={},D=0,S=l;D<S.length;D++){y[(v=S[D]).key]=v.top}return{segTops:y,height:u}}var x=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.slicer=new k,n.computeFgSegHorizontals=t.memoize(I),n.computeSegVerticals=t.memoize(N),n.harnessElRefs=new t.RefMap,n.innerElRef=t.createRef(),n.state={segDims:null},n}return s(n,e),n.prototype.render=function(){var e=this.props,n=this.state,o=this.context,i=e.dateProfile,r=e.tDateProfile,a=this.slicer.sliceProps(e,i,r.isTimeScale?null:e.nextDayThreshold,o,i,o.dateProfileGenerator,r,o.dateEnv),s=(a.eventDrag?a.eventDrag.segs:null)||(a.eventResize?a.eventResize.segs:null)||[],l=this.computeFgSegHorizontals(a.fgEventSegs,e.timelineCoords),u=this.computeSegVerticals(a.fgEventSegs,o.options.eventOrder,n.segDims),c=u.segTops,d=u.height,f=(a.eventDrag?a.eventDrag.affectedInstances:null)||(a.eventResize?a.eventResize.affectedInstances:null)||{};return t.createElement(t.Fragment,null,t.createElement(M,{businessHourSegs:a.businessHourSegs,bgEventSegs:a.bgEventSegs,timelineCoords:e.timelineCoords,eventResizeSegs:a.eventResize?a.eventResize.segs:[],dateSelectionSegs:a.dateSelectionSegs,nowDate:e.nowDate,todayRange:e.todayRange}),t.createElement("div",{className:"fc-timeline-events fc-scrollgrid-sync-inner",ref:this.innerElRef,style:{height:d}},this.renderFgSegs(a.fgEventSegs,l,c,f,!1,!1,!1),this.renderFgSegs(s,I(s,e.timelineCoords),c,{},Boolean(a.eventDrag),Boolean(a.eventResize),!1)))},n.prototype.componentDidMount=function(){this.updateSize()},n.prototype.componentDidUpdate=function(e,t){e.eventStore===this.props.eventStore&&e.timelineCoords===this.props.timelineCoords||this.updateSize()},n.prototype.updateSize=function(){var e=this,n=this.props,o=n.timelineCoords;if(n.onHeightChange&&n.onHeightChange(this.innerElRef.current,!1),o){var i=o.slatRootEl.getBoundingClientRect();this.setState({segDims:t.mapHash(this.harnessElRefs.currentMap,(function(e){var t=e.getBoundingClientRect();return{left:Math.round(t.left-i.left),right:Math.round(t.right-i.left),height:Math.round(t.height)}}))},(function(){n.onHeightChange&&n.onHeightChange(e.innerElRef.current,!0)}))}},n.prototype.renderFgSegs=function(e,n,o,i,r,a,s){var u=this,c=this.harnessElRefs,d=this.props,f=r||a||s;return t.createElement(t.Fragment,null,e.map((function(e){var h=e.eventRange.instance.instanceId,m=n[h],p=o[h];return t.createElement("div",{key:h,ref:f?null:c.createRef(h),className:"fc-timeline-event-harness",style:{left:m?m.left:"",right:m?-m.right:"",top:null!=p?p:"",visibility:i[h]?"hidden":""}},t.createElement(W,l({isTimeScale:u.props.tDateProfile.isTimeScale,seg:e,isDragging:r,isResizing:a,isDateSelecting:s,isSelected:h===u.props.eventSelection},t.getSegMeta(e,d.todayRange,d.nowDate))))})))},n}(t.BaseComponent),L=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.slatsRef=t.createRef(),n.state={coords:null},n.handeEl=function(e){e?n.context.registerInteractiveComponent(n,{el:e}):n.context.unregisterInteractiveComponent(n)},n.handleCoords=function(e){n.setState({coords:e}),n.props.onSlatCoords&&n.props.onSlatCoords(e)},n}return s(n,e),n.prototype.render=function(){var e=this,n=this.props,o=this.state,i=this.context.options,r=n.dateProfile,a=n.tDateProfile,s=t.greatestDurationDenominator(a.slotDuration).unit;return t.createElement("div",{className:"fc-timeline-body",ref:this.handeEl,style:{minWidth:n.tableMinWidth,height:n.clientHeight,width:n.clientWidth}},t.createElement(t.NowTimer,{unit:s},(function(s,l){return t.createElement(t.Fragment,null,t.createElement(P,{ref:e.slatsRef,dateProfile:r,tDateProfile:a,nowDate:s,todayRange:l,clientWidth:n.clientWidth,tableColGroupNode:n.tableColGroupNode,tableMinWidth:n.tableMinWidth,onCoords:e.handleCoords,onScrollLeftRequest:n.onScrollLeftRequest}),t.createElement(x,{dateProfile:r,tDateProfile:n.tDateProfile,nowDate:s,todayRange:l,nextDayThreshold:i.nextDayThreshold,businessHours:n.businessHours,eventStore:n.eventStore,eventUiBases:n.eventUiBases,dateSelection:n.dateSelection,eventSelection:n.eventSelection,eventDrag:n.eventDrag,eventResize:n.eventResize,timelineCoords:o.coords}),i.nowIndicator&&o.coords&&o.coords.isDateInRange(s)&&t.createElement("div",{className:"fc-timeline-now-indicator-container"},t.createElement(t.NowIndicatorRoot,{isAxis:!1,date:s},(function(e,n,i,r){return t.createElement("div",{ref:e,className:["fc-timeline-now-indicator-line"].concat(n).join(" "),style:{left:o.coords.dateToCoord(s)}},r)}))))})))},n.prototype.queryHit=function(e,t,n,o){var i=this.slatsRef.current.positionToHit(e);return i?{component:this,dateSpan:i.dateSpan,rect:{left:i.left,right:i.right,top:0,bottom:o},dayEl:i.dayEl,layer:0}:null},n}(t.DateComponent),z=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.buildTimelineDateProfile=t.memoize(c),n.scrollGridRef=t.createRef(),n.state={slatCoords:null,slotCushionMaxWidth:null},n.handleSlatCoords=function(e){n.setState({slatCoords:e})},n.handleScrollLeftRequest=function(e){n.scrollGridRef.current.forceScrollLeft(0,e)},n.handleMaxCushionWidth=function(e){n.setState({slotCushionMaxWidth:Math.ceil(e)})},n}return s(n,e),n.prototype.render=function(){var e=this,n=this.props,i=this.state,r=this.context,a=r.options,s=!n.forPrint&&t.getStickyHeaderDates(a),u=!n.forPrint&&t.getStickyFooterScrollbar(a),c=this.buildTimelineDateProfile(n.dateProfile,r.dateEnv,a,r.dateProfileGenerator),d=["fc-timeline",!1===a.eventOverlap?"fc-timeline-overlap-disabled":""],f=a.slotMinWidth,h=H(c,f||this.computeFallbackSlotMinWidth(c)),m=[{type:"header",key:"header",isSticky:s,chunks:[{key:"timeline",content:function(o){return t.createElement(C,{dateProfile:n.dateProfile,clientWidth:o.clientWidth,clientHeight:o.clientHeight,tableMinWidth:o.tableMinWidth,tableColGroupNode:o.tableColGroupNode,tDateProfile:c,slatCoords:i.slatCoords,onMaxCushionWidth:f?null:e.handleMaxCushionWidth})}}]},{type:"body",key:"body",liquid:!0,chunks:[{key:"timeline",content:function(o){return t.createElement(L,l({},n,{clientWidth:o.clientWidth,clientHeight:o.clientHeight,tableMinWidth:o.tableMinWidth,tableColGroupNode:o.tableColGroupNode,tDateProfile:c,onSlatCoords:e.handleSlatCoords,onScrollLeftRequest:e.handleScrollLeftRequest}))}}]}];return u&&m.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"timeline",content:t.renderScrollShim}]}),t.createElement(t.ViewRoot,{viewSpec:r.viewSpec},(function(i,r){return t.createElement("div",{ref:i,className:d.concat(r).join(" ")},t.createElement(o.ScrollGrid,{ref:e.scrollGridRef,liquid:!n.isHeightAuto&&!n.forPrint,colGroups:[{cols:h}],sections:m}))}))},n.prototype.computeFallbackSlotMinWidth=function(e){return Math.max(30,(this.state.slotCushionMaxWidth||0)/e.slotsPerLabel)},n}(t.DateComponent);function H(e,t){return[{span:e.slotCnt,minWidth:t||1}]}var O=t.createPlugin({deps:[r.default],initialView:"timelineDay",views:{timeline:{component:z,usesMinMaxTime:!0,eventResizableFromStart:!0},timelineDay:{type:"timeline",duration:{days:1}},timelineWeek:{type:"timeline",duration:{weeks:1}},timelineMonth:{type:"timeline",duration:{months:1}},timelineYear:{type:"timeline",duration:{years:1}}}});return t.globalPlugins.push(O),e.TimelineCoords=R,e.TimelineHeader=C,e.TimelineHeaderRows=S,e.TimelineLane=x,e.TimelineLaneBg=M,e.TimelineLaneSlicer=k,e.TimelineSlats=P,e.TimelineView=z,e.buildSlatCols=H,e.buildTimelineDateProfile=c,e.default=O,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendarPremiumCommon,FullCalendarScrollGrid); |
380
main.js
/*! | ||
FullCalendar Scheduler v5.3.1 | ||
FullCalendar Scheduler v5.3.2 | ||
Docs & License: https://fullcalendar.io/scheduler | ||
@@ -8,3 +8,3 @@ (c) 2020 Adam Shaw | ||
import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, padStart, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, memoizeObjArg, buildClassNameNormalizer, getDateMeta, getSlotClassNames, getDayClassNames, buildNavLinkData, createElement, MountHook, BaseComponent, ContentHook, Fragment, createRef, NowTimer, NowIndicatorRoot, findElements, RenderHook, rangeContainsMarker, PositionCache, findDirectChildren, RefMap, multiplyDuration, buildEventRangeKey, BgEvent, getSegMeta, renderFill, intersectRanges, addMs, Slicer, StandardEvent, sortEventSegs, memoize, mapHash, DateComponent, getStickyHeaderDates, getStickyFooterScrollbar, ViewRoot, renderScrollShim, createPlugin } from '@fullcalendar/common'; | ||
import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, padStart, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, createElement, ContentHook, BaseComponent, memoizeObjArg, buildClassNameNormalizer, getDateMeta, getSlotClassNames, getDayClassNames, buildNavLinkData, MountHook, Fragment, createRef, NowTimer, NowIndicatorRoot, findElements, rangeContainsMarker, PositionCache, findDirectChildren, RenderHook, RefMap, multiplyDuration, buildEventRangeKey, BgEvent, getSegMeta, renderFill, intersectRanges, addMs, Slicer, StandardEvent, sortEventSegs, memoize, mapHash, DateComponent, getStickyHeaderDates, getStickyFooterScrollbar, ViewRoot, renderScrollShim, createPlugin } from '@fullcalendar/common'; | ||
import premiumCommonPlugin from '@fullcalendar/premium-common'; | ||
@@ -37,3 +37,3 @@ import { __extends, __assign } from 'tslib'; | ||
{ milliseconds: 10 }, | ||
{ milliseconds: 1 } | ||
{ milliseconds: 1 }, | ||
]; | ||
@@ -43,3 +43,3 @@ function buildTimelineDateProfile(dateProfile, dateEnv, allOptions, dateProfileGenerator) { | ||
labelInterval: allOptions.slotLabelInterval, | ||
slotDuration: allOptions.slotDuration | ||
slotDuration: allOptions.slotDuration, | ||
}; | ||
@@ -53,5 +53,3 @@ validateLabelAndSlot(tDateProfile, dateProfile, dateEnv); // validate after computed grid duration | ||
computeHeaderFormats(tDateProfile, dateProfile, dateEnv, allOptions); | ||
tDateProfile.headerFormats = rawFormats.map(function (rawFormat) { | ||
return createFormatter(rawFormat); | ||
}); | ||
tDateProfile.headerFormats = rawFormats.map(function (rawFormat) { return createFormatter(rawFormat); }); | ||
tDateProfile.isTimeScale = Boolean(tDateProfile.slotDuration.milliseconds); | ||
@@ -121,3 +119,3 @@ var largeUnit = null; | ||
if (isValidDate(date, tDateProfile, dateProfile, dateProfileGenerator)) { | ||
snapIndex++; | ||
snapIndex += 1; | ||
snapDiffToIndex.push(snapIndex); | ||
@@ -130,3 +128,3 @@ snapIndexToDiff.push(snapDiff); | ||
date = dateEnv.add(date, tDateProfile.snapDuration); | ||
snapDiff++; | ||
snapDiff += 1; | ||
} | ||
@@ -166,3 +164,3 @@ tDateProfile.snapDiffToIndex = snapDiffToIndex; | ||
start: dateEnv.startOf(range.start, tDateProfile.largeUnit), | ||
end: dateEnv.startOf(range.end, tDateProfile.largeUnit) | ||
end: dateEnv.startOf(range.end, tDateProfile.largeUnit), | ||
}; | ||
@@ -174,3 +172,3 @@ // if date is partially through the interval, or is in the same interval as the start, | ||
start: range.start, | ||
end: dateEnv.add(range.end, tDateProfile.slotDuration) | ||
end: dateEnv.add(range.end, tDateProfile.slotDuration), | ||
}; | ||
@@ -186,3 +184,3 @@ } | ||
} | ||
else if (tDateProfile.isTimeScale) { | ||
if (tDateProfile.isTimeScale) { | ||
// determine if the time is within slotMinTime/slotMaxTime, which may have wacky values | ||
@@ -195,5 +193,3 @@ var day = startOfDay(date); | ||
} | ||
else { | ||
return true; | ||
} | ||
return true; | ||
} | ||
@@ -346,3 +342,3 @@ function validateLabelAndSlot(tDateProfile, dateProfile, dateEnv) { | ||
omitZeroMinute: true, | ||
meridiem: 'short' | ||
meridiem: 'short', | ||
}; | ||
@@ -355,7 +351,6 @@ break; | ||
hour: 'numeric', | ||
meridiem: 'short' | ||
meridiem: 'short', | ||
}; | ||
format1 = function (params) { | ||
return ':' + padStart(params.date.minute, 2); // ':30' | ||
}; | ||
format1 = function (params) { return (':' + padStart(params.date.minute, 2) // ':30' | ||
); }; | ||
} | ||
@@ -366,3 +361,3 @@ else { | ||
minute: 'numeric', | ||
meridiem: 'short' | ||
meridiem: 'short', | ||
}; | ||
@@ -375,5 +370,4 @@ } | ||
format0 = { hour: 'numeric', minute: '2-digit', meridiem: 'lowercase' }; // '8:30 PM' | ||
format1 = function (params) { | ||
return ':' + padStart(params.date.second, 2); // ':30' | ||
}; | ||
format1 = function (params) { return (':' + padStart(params.date.second, 2) // ':30' | ||
); }; | ||
} | ||
@@ -386,5 +380,3 @@ else { | ||
format0 = { hour: 'numeric', minute: '2-digit', second: '2-digit', meridiem: 'lowercase' }; // '8:30:45 PM' | ||
format1 = function (params) { | ||
return '.' + padStart(params.millisecond, 3); | ||
}; | ||
format1 = function (params) { return ('.' + padStart(params.millisecond, 3)); }; | ||
break; | ||
@@ -436,10 +428,8 @@ } | ||
// specifically for navclicks | ||
var rowUnitsFromFormats = formats.map(function (format) { | ||
return format.getLargestUnit ? format.getLargestUnit() : null; | ||
}); | ||
var rowUnitsFromFormats = formats.map(function (format) { return (format.getLargestUnit ? format.getLargestUnit() : null); }); | ||
// builds cellRows and slotCells | ||
for (var i = 0; i < slotDates.length; i++) { | ||
for (var i = 0; i < slotDates.length; i += 1) { | ||
var date = slotDates[i]; | ||
var isWeekStart = tDateProfile.isWeekStarts[i]; | ||
for (var row = 0; row < formats.length; row++) { | ||
for (var row = 0; row < formats.length; row += 1) { | ||
var format = formats[row]; | ||
@@ -461,11 +451,9 @@ var rowCells = cellRows[row]; | ||
} | ||
else if (!leadingCell || | ||
isInt(dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, date, tDateProfile.labelInterval))) { | ||
var text = dateEnv.format(date, format); | ||
newCell = buildCellObject(date, text, rowUnit); | ||
} | ||
else { | ||
if (!leadingCell || | ||
isInt(dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, date, tDateProfile.labelInterval))) { | ||
var text = dateEnv.format(date, format); | ||
newCell = buildCellObject(date, text, rowUnit); | ||
} | ||
else { | ||
leadingCell.colspan += 1; | ||
} | ||
leadingCell.colspan += 1; | ||
} | ||
@@ -484,2 +472,28 @@ if (newCell) { | ||
var TimelineHeaderThInner = /** @class */ (function (_super) { | ||
__extends(TimelineHeaderThInner, _super); | ||
function TimelineHeaderThInner() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
TimelineHeaderThInner.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var navLinkAttrs = props.navLinkData | ||
? { 'data-navlink': props.navLinkData, tabIndex: 0 } | ||
: {}; | ||
return (createElement(ContentHook, { hookProps: props.hookProps, content: context.options.slotLabelContent, defaultContent: renderInnerContent }, function (innerElRef, innerContent) { return (createElement("a", __assign({ ref: innerElRef, className: 'fc-timeline-slot-cushion fc-scrollgrid-sync-inner' + (props.isSticky ? ' fc-sticky' : '') }, navLinkAttrs), innerContent)); })); | ||
}; | ||
return TimelineHeaderThInner; | ||
}(BaseComponent)); | ||
function renderInnerContent(props) { | ||
return props.text; | ||
} | ||
function refineHookProps(input) { | ||
return { | ||
level: input.level, | ||
date: input.dateEnv.toDate(input.dateMarker), | ||
view: input.viewApi, | ||
text: input.text, | ||
}; | ||
} | ||
var TimelineHeaderTh = /** @class */ (function (_super) { | ||
@@ -515,7 +529,7 @@ __extends(TimelineHeaderTh, _super); | ||
dateEnv: context.dateEnv, | ||
viewApi: context.viewApi | ||
viewApi: context.viewApi, | ||
}); | ||
var customClassNames = this.normalizeClassNames(options.slotLabelClassNames, hookProps); | ||
return (createElement(MountHook, { hookProps: hookProps, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, function (rootElRef) { return (createElement("th", { ref: rootElRef, className: classNames.concat(customClassNames).join(' '), "data-date": dateEnv.formatIso(cell.date, { omitTime: !tDateProfile.isTimeScale, omitTimeZoneOffset: true }), colSpan: cell.colspan }, | ||
createElement("div", { className: 'fc-timeline-slot-frame', style: { height: props.rowInnerHeight } }, | ||
createElement("div", { className: "fc-timeline-slot-frame", style: { height: props.rowInnerHeight } }, | ||
createElement(TimelineHeaderThInner, { hookProps: hookProps, isSticky: props.isSticky, navLinkData: navLinkData })))); })); | ||
@@ -525,27 +539,2 @@ }; | ||
}(BaseComponent)); | ||
var TimelineHeaderThInner = /** @class */ (function (_super) { | ||
__extends(TimelineHeaderThInner, _super); | ||
function TimelineHeaderThInner() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
TimelineHeaderThInner.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var navLinkAttrs = props.navLinkData | ||
? { 'data-navlink': props.navLinkData, tabIndex: 0 } | ||
: {}; | ||
return (createElement(ContentHook, { hookProps: props.hookProps, content: context.options.slotLabelContent, defaultContent: renderInnerContent }, function (innerElRef, innerContent) { return (createElement("a", __assign({ ref: innerElRef, className: 'fc-timeline-slot-cushion fc-scrollgrid-sync-inner' + (props.isSticky ? ' fc-sticky' : '') }, navLinkAttrs), innerContent)); })); | ||
}; | ||
return TimelineHeaderThInner; | ||
}(BaseComponent)); | ||
function renderInnerContent(props) { | ||
return props.text; | ||
} | ||
function refineHookProps(input) { | ||
return { | ||
level: input.level, | ||
date: input.dateEnv.toDate(input.dateMarker), | ||
view: input.viewApi, | ||
text: input.text | ||
}; | ||
} | ||
@@ -565,5 +554,6 @@ var TimelineHeaderRows = /** @class */ (function (_super) { | ||
'fc-timeline-header-row', | ||
isChrono ? 'fc-timeline-header-row-chrono' : '' | ||
isChrono ? 'fc-timeline-header-row-chrono' : '', | ||
]; | ||
return (createElement("tr", { key: rowLevel, className: classNames.join(' ') }, rowCells.map(function (cell) { return (createElement(TimelineHeaderTh, { key: cell.date.toISOString(), cell: cell, rowLevel: rowLevel, dateProfile: dateProfile, tDateProfile: tDateProfile, todayRange: todayRange, nowDate: nowDate, rowInnerHeight: rowInnerHeights && rowInnerHeights[rowLevel], isSticky: !isLast })); }))); | ||
return ( // eslint-disable-next-line react/no-array-index-key | ||
createElement("tr", { key: rowLevel, className: classNames.join(' ') }, rowCells.map(function (cell) { return (createElement(TimelineHeaderTh, { key: cell.date.toISOString(), cell: cell, rowLevel: rowLevel, dateProfile: dateProfile, tDateProfile: tDateProfile, todayRange: todayRange, nowDate: nowDate, rowInnerHeight: rowInnerHeights && rowInnerHeights[rowLevel], isSticky: !isLast })); }))); | ||
}))); | ||
@@ -589,13 +579,12 @@ }; | ||
var slatCoords = props.slatCoords && props.slatCoords.dateProfile === props.dateProfile ? props.slatCoords : null; | ||
return (createElement(NowTimer, { unit: timerUnit }, function (nowDate, todayRange) { return (createElement("div", { className: 'fc-timeline-header', ref: _this.rootElRef }, | ||
createElement("table", { className: 'fc-scrollgrid-sync-table', style: { minWidth: props.tableMinWidth, width: props.clientWidth } }, | ||
return (createElement(NowTimer, { unit: timerUnit }, function (nowDate, todayRange) { return (createElement("div", { className: "fc-timeline-header", ref: _this.rootElRef }, | ||
createElement("table", { className: "fc-scrollgrid-sync-table", style: { minWidth: props.tableMinWidth, width: props.clientWidth } }, | ||
props.tableColGroupNode, | ||
createElement("tbody", null, | ||
createElement(TimelineHeaderRows, { dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, nowDate: nowDate, todayRange: todayRange, rowInnerHeights: props.rowInnerHeights }))), | ||
context.options.nowIndicator && | ||
// need to have a container regardless of whether the current view has a visible now indicator | ||
// because apparently removal of the element resets the scroll for some reasons (issue #5351). | ||
// this issue doesn't happen for the timeline body however | ||
createElement("div", { className: 'fc-timeline-now-indicator-container' }, (slatCoords && slatCoords.isDateInRange(nowDate)) && | ||
createElement(NowIndicatorRoot, { isAxis: true, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("div", { ref: rootElRef, className: ['fc-timeline-now-indicator-arrow'].concat(classNames).join(' '), style: { left: slatCoords.dateToCoord(nowDate) } }, innerContent)); })))); })); | ||
context.options.nowIndicator && ( | ||
// need to have a container regardless of whether the current view has a visible now indicator | ||
// because apparently removal of the element resets the scroll for some reasons (issue #5351). | ||
// this issue doesn't happen for the timeline body however ( | ||
createElement("div", { className: "fc-timeline-now-indicator-container" }, (slatCoords && slatCoords.isDateInRange(nowDate)) && (createElement(NowIndicatorRoot, { isAxis: true, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("div", { ref: rootElRef, className: ['fc-timeline-now-indicator-arrow'].concat(classNames).join(' '), style: { left: slatCoords.dateToCoord(nowDate) } }, innerContent)); })))))); })); | ||
}; | ||
@@ -619,32 +608,2 @@ TimelineHeader.prototype.componentDidMount = function () { | ||
var TimelineSlatCell = /** @class */ (function (_super) { | ||
__extends(TimelineSlatCell, _super); | ||
function TimelineSlatCell() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
TimelineSlatCell.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var dateEnv = context.dateEnv, options = context.options, theme = context.theme; | ||
var date = props.date, tDateProfile = props.tDateProfile, isEm = props.isEm; | ||
var dateMeta = getDateMeta(props.date, props.todayRange, props.nowDate, props.dateProfile); | ||
var classNames = ['fc-timeline-slot', 'fc-timeline-slot-lane']; | ||
var dataAttrs = { 'data-date': dateEnv.formatIso(date, { omitTimeZoneOffset: true, omitTime: !tDateProfile.isTimeScale }) }; | ||
var hookProps = __assign(__assign({ date: dateEnv.toDate(props.date) }, dateMeta), { view: context.viewApi }); | ||
if (isEm) { | ||
classNames.push('fc-timeline-slot-em'); | ||
} | ||
if (tDateProfile.isTimeScale) { | ||
classNames.push(isInt(dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, props.date, tDateProfile.labelInterval)) ? | ||
'fc-timeline-slot-major' : | ||
'fc-timeline-slot-minor'); | ||
} | ||
classNames.push.apply(classNames, (props.isDay | ||
? getDayClassNames(dateMeta, theme) | ||
: getSlotClassNames(dateMeta, theme))); | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.slotLaneClassNames, content: options.slotLaneContent, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount, elRef: props.elRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement("td", __assign({ ref: rootElRef, className: classNames.concat(customClassNames).join(' ') }, dataAttrs), | ||
createElement("div", { ref: innerElRef }, innerContent))); })); | ||
}; | ||
return TimelineSlatCell; | ||
}(BaseComponent)); | ||
var TimelineCoords = /** @class */ (function () { | ||
@@ -659,9 +618,7 @@ function TimelineCoords(slatRootEl, // okay to expose? | ||
this.outerCoordCache = new PositionCache(slatRootEl, slatEls, true, // isHorizontal | ||
false // isVertical | ||
); | ||
false); | ||
// for the inner divs within the slats | ||
// used for event rendering and scrollTime, to disregard slat border | ||
this.innerCoordCache = new PositionCache(slatRootEl, findDirectChildren(slatEls, 'div'), true, // isHorizontal | ||
false // isVertical | ||
); | ||
false); | ||
} | ||
@@ -672,5 +629,3 @@ TimelineCoords.prototype.rangeToCoords = function (range) { | ||
} | ||
else { | ||
return { left: this.dateToCoord(range.start), right: this.dateToCoord(range.end) }; | ||
} | ||
return { left: this.dateToCoord(range.start), right: this.dateToCoord(range.end) }; | ||
}; | ||
@@ -694,6 +649,4 @@ TimelineCoords.prototype.isDateInRange = function (date) { | ||
} | ||
else { | ||
return (outerCoordCache.lefts[slotIndex] + | ||
(innerCoordCache.getWidth(slotIndex) * partial)); | ||
} | ||
return (outerCoordCache.lefts[slotIndex] + | ||
(innerCoordCache.getWidth(slotIndex) * partial)); | ||
}; | ||
@@ -728,19 +681,66 @@ // returned value is between 0 and the number of snaps | ||
} | ||
else if (snapDiff >= tDateProfile.snapDiffToIndex.length) { | ||
if (snapDiff >= tDateProfile.snapDiffToIndex.length) { | ||
return tDateProfile.snapCnt; | ||
} | ||
var snapDiffInt = Math.floor(snapDiff); | ||
var snapCoverage = tDateProfile.snapDiffToIndex[snapDiffInt]; | ||
if (isInt(snapCoverage)) { // not an in-between value | ||
snapCoverage += snapDiff - snapDiffInt; // add the remainder | ||
} | ||
else { | ||
var snapDiffInt = Math.floor(snapDiff); | ||
var snapCoverage = tDateProfile.snapDiffToIndex[snapDiffInt]; | ||
if (isInt(snapCoverage)) { // not an in-between value | ||
snapCoverage += snapDiff - snapDiffInt; // add the remainder | ||
// a fractional value, meaning the date is not visible | ||
// always round up in this case. works for start AND end dates in a range. | ||
snapCoverage = Math.ceil(snapCoverage); | ||
} | ||
return snapCoverage; | ||
} | ||
var TimelineSlatCell = /** @class */ (function (_super) { | ||
__extends(TimelineSlatCell, _super); | ||
function TimelineSlatCell() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
TimelineSlatCell.prototype.render = function () { | ||
var _a = this, props = _a.props, context = _a.context; | ||
var dateEnv = context.dateEnv, options = context.options, theme = context.theme; | ||
var date = props.date, tDateProfile = props.tDateProfile, isEm = props.isEm; | ||
var dateMeta = getDateMeta(props.date, props.todayRange, props.nowDate, props.dateProfile); | ||
var classNames = ['fc-timeline-slot', 'fc-timeline-slot-lane']; | ||
var dataAttrs = { 'data-date': dateEnv.formatIso(date, { omitTimeZoneOffset: true, omitTime: !tDateProfile.isTimeScale }) }; | ||
var hookProps = __assign(__assign({ date: dateEnv.toDate(props.date) }, dateMeta), { view: context.viewApi }); | ||
if (isEm) { | ||
classNames.push('fc-timeline-slot-em'); | ||
} | ||
else { | ||
// a fractional value, meaning the date is not visible | ||
// always round up in this case. works for start AND end dates in a range. | ||
snapCoverage = Math.ceil(snapCoverage); | ||
if (tDateProfile.isTimeScale) { | ||
classNames.push(isInt(dateEnv.countDurationsBetween(tDateProfile.normalizedRange.start, props.date, tDateProfile.labelInterval)) ? | ||
'fc-timeline-slot-major' : | ||
'fc-timeline-slot-minor'); | ||
} | ||
return snapCoverage; | ||
classNames.push.apply(classNames, (props.isDay | ||
? getDayClassNames(dateMeta, theme) | ||
: getSlotClassNames(dateMeta, theme))); | ||
return (createElement(RenderHook, { hookProps: hookProps, classNames: options.slotLaneClassNames, content: options.slotLaneContent, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount, elRef: props.elRef }, function (rootElRef, customClassNames, innerElRef, innerContent) { return (createElement("td", __assign({ ref: rootElRef, className: classNames.concat(customClassNames).join(' ') }, dataAttrs), | ||
createElement("div", { ref: innerElRef }, innerContent))); })); | ||
}; | ||
return TimelineSlatCell; | ||
}(BaseComponent)); | ||
var TimelineSlatsBody = /** @class */ (function (_super) { | ||
__extends(TimelineSlatsBody, _super); | ||
function TimelineSlatsBody() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
} | ||
TimelineSlatsBody.prototype.render = function () { | ||
var props = this.props; | ||
var tDateProfile = props.tDateProfile, cellElRefs = props.cellElRefs; | ||
var slotDates = tDateProfile.slotDates, isWeekStarts = tDateProfile.isWeekStarts; | ||
var isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit; | ||
return (createElement("tbody", null, | ||
createElement("tr", null, slotDates.map(function (slotDate, i) { | ||
var key = slotDate.toISOString(); | ||
return (createElement(TimelineSlatCell, { key: key, elRef: cellElRefs.createRef(key), date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay })); | ||
})))); | ||
}; | ||
return TimelineSlatsBody; | ||
}(BaseComponent)); | ||
@@ -763,2 +763,3 @@ var TimelineSlats = /** @class */ (function (_super) { | ||
} | ||
return null; // best? | ||
}; | ||
@@ -769,6 +770,6 @@ return _this; | ||
var _a = this, props = _a.props, context = _a.context; | ||
return (createElement("div", { className: 'fc-timeline-slots', ref: this.rootElRef }, | ||
return (createElement("div", { className: "fc-timeline-slots", ref: this.rootElRef }, | ||
createElement("table", { className: context.theme.getClass('table'), style: { | ||
minWidth: props.tableMinWidth, | ||
width: props.clientWidth | ||
width: props.clientWidth, | ||
} }, | ||
@@ -795,3 +796,4 @@ props.tableColGroupNode, | ||
if (props.clientWidth !== null && // is sizing stable? | ||
this.scrollResponder // it's possible to have clientWidth immediately after mount (when returning from print view), but w/o scrollResponder | ||
this.scrollResponder | ||
// ^it's possible to have clientWidth immediately after mount (when returning from print view), but w/o scrollResponder | ||
) { | ||
@@ -825,7 +827,7 @@ var rootEl = this.rootElRef.current; | ||
range: { start: start, end: end }, | ||
allDay: !this.props.tDateProfile.isTimeScale | ||
allDay: !this.props.tDateProfile.isTimeScale, | ||
}, | ||
dayEl: this.cellElRefs.currentMap[slatIndex], | ||
left: outerCoordCache.lefts[slatIndex], | ||
right: outerCoordCache.rights[slatIndex] | ||
right: outerCoordCache.rights[slatIndex], | ||
}; | ||
@@ -837,20 +839,2 @@ } | ||
}(BaseComponent)); | ||
var TimelineSlatsBody = /** @class */ (function (_super) { | ||
__extends(TimelineSlatsBody, _super); | ||
function TimelineSlatsBody() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
TimelineSlatsBody.prototype.render = function () { | ||
var props = this.props; | ||
var tDateProfile = props.tDateProfile, cellElRefs = props.cellElRefs; | ||
var slotDates = tDateProfile.slotDates, isWeekStarts = tDateProfile.isWeekStarts; | ||
var isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit; | ||
return (createElement("tbody", null, | ||
createElement("tr", null, slotDates.map(function (slotDate, i) { | ||
var key = slotDate.toISOString(); | ||
return (createElement(TimelineSlatCell, { key: key, elRef: cellElRefs.createRef(key), date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay })); | ||
})))); | ||
}; | ||
return TimelineSlatsBody; | ||
}(BaseComponent)); | ||
function collectCellEls(elMap, slotDates) { | ||
@@ -871,3 +855,3 @@ return slotDates.map(function (slotDate) { | ||
var highlightSeg = [].concat(props.eventResizeSegs, props.dateSelectionSegs); | ||
return props.timelineCoords && (createElement("div", { className: 'fc-timeline-bg' }, | ||
return props.timelineCoords && (createElement("div", { className: "fc-timeline-bg" }, | ||
this.renderSegs(props.businessHourSegs || [], props.timelineCoords, 'non-business'), | ||
@@ -881,5 +865,5 @@ this.renderSegs(props.bgEventSegs || [], props.timelineCoords, 'bg-event'), | ||
var coords = timelineCoords.rangeToCoords(seg); // seg has { start, end } | ||
return (createElement("div", { key: buildEventRangeKey(seg.eventRange), className: 'fc-timeline-bg-harness', style: { | ||
return (createElement("div", { key: buildEventRangeKey(seg.eventRange), className: "fc-timeline-bg-harness", style: { | ||
left: coords.left, | ||
right: -coords.right // outwards from right edge (which is same as left edge) | ||
right: -coords.right, | ||
} }, fillType === 'bg-event' ? | ||
@@ -903,3 +887,4 @@ createElement(BgEvent, __assign({ seg: seg }, getSegMeta(seg, todayRange, nowDate))) : | ||
// protect against when the span is entirely in an invalid date region | ||
if (computeDateSnapCoverage(normalRange.start, tDateProfile, dateEnv) < computeDateSnapCoverage(normalRange.end, tDateProfile, dateEnv)) { | ||
if (computeDateSnapCoverage(normalRange.start, tDateProfile, dateEnv) | ||
< computeDateSnapCoverage(normalRange.end, tDateProfile, dateEnv)) { | ||
// intersect the footprint's range with the grid's range | ||
@@ -911,4 +896,6 @@ var slicedRange = intersectRanges(normalRange, tDateProfile.normalizedRange); | ||
end: slicedRange.end, | ||
isStart: slicedRange.start.valueOf() === normalRange.start.valueOf() && isValidDate(slicedRange.start, tDateProfile, dateProfile, dateProfileGenerator), | ||
isEnd: slicedRange.end.valueOf() === normalRange.end.valueOf() && isValidDate(addMs(slicedRange.end, -1), tDateProfile, dateProfile, dateProfileGenerator) | ||
isStart: slicedRange.start.valueOf() === normalRange.start.valueOf() | ||
&& isValidDate(slicedRange.start, tDateProfile, dateProfile, dateProfileGenerator), | ||
isEnd: slicedRange.end.valueOf() === normalRange.end.valueOf() | ||
&& isValidDate(addMs(slicedRange.end, -1), tDateProfile, dateProfile, dateProfileGenerator), | ||
}); | ||
@@ -926,3 +913,3 @@ } | ||
omitZeroMinute: true, | ||
meridiem: 'narrow' | ||
meridiem: 'narrow', | ||
}); | ||
@@ -964,3 +951,3 @@ var TimelineEvent = /** @class */ (function (_super) { | ||
var insertI = 0; // where to start searching for an insert position | ||
for (var i = 0; i < placements.length; i++) { // loop through existing placements | ||
for (var i = 0; i < placements.length; i += 1) { // loop through existing placements | ||
var placement = placements[i]; | ||
@@ -974,3 +961,3 @@ if (testCollide(dims, top_1, placement.dims, placement.top)) { | ||
while (insertI < placements.length && top_1 >= placements[insertI].top) { | ||
insertI++; | ||
insertI += 1; | ||
} | ||
@@ -1006,3 +993,3 @@ placements.splice(insertI, 0, { key: key, dims: dims, top: top_1 }); // insert | ||
_this.state = { | ||
segDims: null | ||
segDims: null, | ||
}; | ||
@@ -1027,8 +1014,7 @@ return _this; | ||
createElement(TimelineLaneBg, { businessHourSegs: slicedProps.businessHourSegs, bgEventSegs: slicedProps.bgEventSegs, timelineCoords: props.timelineCoords, eventResizeSegs: slicedProps.eventResize ? slicedProps.eventResize.segs : [] /* bad new empty array? */, dateSelectionSegs: slicedProps.dateSelectionSegs, nowDate: props.nowDate, todayRange: props.todayRange }), | ||
createElement("div", { className: 'fc-timeline-events fc-scrollgrid-sync-inner', ref: this.innerElRef, style: { height: height /* computed by computeSegVerticals */ } }, | ||
createElement("div", { className: "fc-timeline-events fc-scrollgrid-sync-inner", ref: this.innerElRef, style: { height: height /* computed by computeSegVerticals */ } }, | ||
this.renderFgSegs(slicedProps.fgEventSegs, segHorizontals, segTops, hiddenSegs, false, false, false), | ||
this.renderFgSegs(mirrorSegs, computeSegHorizontals(mirrorSegs, props.timelineCoords), // not memoized | ||
segTops, // reuse same tops for mirror | ||
{}, Boolean(slicedProps.eventDrag), Boolean(slicedProps.eventResize), false // because mirror is never drawn for date selection | ||
)))); | ||
{}, Boolean(slicedProps.eventDrag), Boolean(slicedProps.eventResize), false)))); | ||
}; | ||
@@ -1061,5 +1047,5 @@ TimelineLane.prototype.componentDidMount = function () { | ||
right: Math.round(harnessRect.right - originRect_1.left), | ||
height: Math.round(harnessRect.height) | ||
height: Math.round(harnessRect.height), | ||
}; | ||
}) | ||
}), | ||
}, function () { | ||
@@ -1080,7 +1066,7 @@ if (props.onHeightChange) { | ||
var top = segTops[instanceId]; | ||
return (createElement("div", { key: instanceId, ref: isMirror ? null : harnessElRefs.createRef(instanceId), className: 'fc-timeline-event-harness', style: { | ||
return (createElement("div", { key: instanceId, ref: isMirror ? null : harnessElRefs.createRef(instanceId), className: "fc-timeline-event-harness", style: { | ||
left: horizontalCoords ? horizontalCoords.left : '', | ||
right: horizontalCoords ? -horizontalCoords.right : '', | ||
top: top != null ? top : '', | ||
visibility: hiddenSegs[instanceId] ? 'hidden' : '' /* wtf, file @types/react bug */ | ||
visibility: hiddenSegs[instanceId] ? 'hidden' : '' /* wtf, file @types/react bug */, | ||
} }, | ||
@@ -1099,3 +1085,3 @@ createElement(TimelineEvent, __assign({ isTimeScale: _this.props.tDateProfile.isTimeScale, seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === _this.props.eventSelection /* TODO: bad for mirror? */ }, getSegMeta(seg, props.todayRange, props.nowDate))))); | ||
_this.state = { | ||
coords: null | ||
coords: null, | ||
}; | ||
@@ -1124,6 +1110,6 @@ _this.handeEl = function (el) { | ||
var timerUnit = greatestDurationDenominator(tDateProfile.slotDuration).unit; | ||
return (createElement("div", { className: 'fc-timeline-body', ref: this.handeEl, style: { | ||
return (createElement("div", { className: "fc-timeline-body", ref: this.handeEl, style: { | ||
minWidth: props.tableMinWidth, | ||
height: props.clientHeight, | ||
width: props.clientWidth | ||
width: props.clientWidth, | ||
} }, | ||
@@ -1133,5 +1119,4 @@ createElement(NowTimer, { unit: timerUnit }, function (nowDate, todayRange) { return (createElement(Fragment, null, | ||
createElement(TimelineLane, { dateProfile: dateProfile, tDateProfile: props.tDateProfile, nowDate: nowDate, todayRange: todayRange, nextDayThreshold: options.nextDayThreshold, businessHours: props.businessHours, eventStore: props.eventStore, eventUiBases: props.eventUiBases, dateSelection: props.dateSelection, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, timelineCoords: state.coords }), | ||
(options.nowIndicator && state.coords && state.coords.isDateInRange(nowDate)) && | ||
createElement("div", { className: 'fc-timeline-now-indicator-container' }, | ||
createElement(NowIndicatorRoot, { isAxis: false, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("div", { ref: rootElRef, className: ['fc-timeline-now-indicator-line'].concat(classNames).join(' '), style: { left: state.coords.dateToCoord(nowDate) } }, innerContent)); })))); }))); | ||
(options.nowIndicator && state.coords && state.coords.isDateInRange(nowDate)) && (createElement("div", { className: "fc-timeline-now-indicator-container" }, | ||
createElement(NowIndicatorRoot, { isAxis: false, date: nowDate }, function (rootElRef, classNames, innerElRef, innerContent) { return (createElement("div", { ref: rootElRef, className: ['fc-timeline-now-indicator-line'].concat(classNames).join(' '), style: { left: state.coords.dateToCoord(nowDate) } }, innerContent)); }))))); }))); | ||
}; | ||
@@ -1151,8 +1136,9 @@ // Hit System | ||
top: 0, | ||
bottom: elHeight | ||
bottom: elHeight, | ||
}, | ||
dayEl: slatHit.dayEl, | ||
layer: 0 | ||
layer: 0, | ||
}; | ||
} | ||
return null; | ||
}; | ||
@@ -1170,3 +1156,3 @@ return TimelineGrid; | ||
slatCoords: null, | ||
slotCushionMaxWidth: null | ||
slotCushionMaxWidth: null, | ||
}; | ||
@@ -1182,3 +1168,3 @@ _this.handleSlatCoords = function (slatCoords) { | ||
_this.setState({ | ||
slotCushionMaxWidth: Math.ceil(slotCushionMaxWidth) // for less rerendering TODO: DRY | ||
slotCushionMaxWidth: Math.ceil(slotCushionMaxWidth), | ||
}); | ||
@@ -1197,3 +1183,3 @@ }; | ||
'fc-timeline', | ||
options.eventOverlap === false ? 'fc-timeline-overlap-disabled' : '' | ||
options.eventOverlap === false ? 'fc-timeline-overlap-disabled' : '', | ||
]; | ||
@@ -1209,4 +1195,4 @@ var slotMinWidth = options.slotMinWidth; | ||
key: 'timeline', | ||
content: function (contentArg) { return (createElement(TimelineHeader, { dateProfile: props.dateProfile, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, tDateProfile: tDateProfile, slatCoords: state.slatCoords, onMaxCushionWidth: slotMinWidth ? null : _this.handleMaxCushionWidth })); } | ||
}] | ||
content: function (contentArg) { return (createElement(TimelineHeader, { dateProfile: props.dateProfile, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, tDateProfile: tDateProfile, slatCoords: state.slatCoords, onMaxCushionWidth: slotMinWidth ? null : _this.handleMaxCushionWidth })); }, | ||
}], | ||
}, | ||
@@ -1219,5 +1205,5 @@ { | ||
key: 'timeline', | ||
content: function (contentArg) { return (createElement(TimelineGrid, __assign({}, props, { clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, tDateProfile: tDateProfile, onSlatCoords: _this.handleSlatCoords, onScrollLeftRequest: _this.handleScrollLeftRequest }))); } | ||
}] | ||
} | ||
content: function (contentArg) { return (createElement(TimelineGrid, __assign({}, props, { clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, tableMinWidth: contentArg.tableMinWidth, tableColGroupNode: contentArg.tableColGroupNode, tDateProfile: tDateProfile, onSlatCoords: _this.handleSlatCoords, onScrollLeftRequest: _this.handleScrollLeftRequest }))); }, | ||
}], | ||
}, | ||
]; | ||
@@ -1231,4 +1217,4 @@ if (stickyFooterScrollbar) { | ||
key: 'timeline', | ||
content: renderScrollShim | ||
}] | ||
content: renderScrollShim, | ||
}], | ||
}); | ||
@@ -1238,3 +1224,3 @@ } | ||
createElement(ScrollGrid, { ref: _this.scrollGridRef, liquid: !props.isHeightAuto && !props.forPrint, colGroups: [ | ||
{ cols: slatCols } | ||
{ cols: slatCols }, | ||
], sections: sections }))); })); | ||
@@ -1250,3 +1236,3 @@ }; | ||
span: tDateProfile.slotCnt, | ||
minWidth: slotMinWidth || 1 // needs to be a non-zero number to trigger horizontal scrollbars!?????? | ||
minWidth: slotMinWidth || 1, | ||
}]; | ||
@@ -1257,3 +1243,3 @@ } | ||
deps: [ | ||
premiumCommonPlugin | ||
premiumCommonPlugin, | ||
], | ||
@@ -1265,21 +1251,21 @@ initialView: 'timelineDay', | ||
usesMinMaxTime: true, | ||
eventResizableFromStart: true // how is this consumed for TimelineView tho? | ||
eventResizableFromStart: true, | ||
}, | ||
timelineDay: { | ||
type: 'timeline', | ||
duration: { days: 1 } | ||
duration: { days: 1 }, | ||
}, | ||
timelineWeek: { | ||
type: 'timeline', | ||
duration: { weeks: 1 } | ||
duration: { weeks: 1 }, | ||
}, | ||
timelineMonth: { | ||
type: 'timeline', | ||
duration: { months: 1 } | ||
duration: { months: 1 }, | ||
}, | ||
timelineYear: { | ||
type: 'timeline', | ||
duration: { years: 1 } | ||
} | ||
} | ||
duration: { years: 1 }, | ||
}, | ||
}, | ||
}); | ||
@@ -1286,0 +1272,0 @@ |
{ | ||
"name": "@fullcalendar/timeline", | ||
"version": "5.3.1", | ||
"version": "5.4.0", | ||
"title": "FullCalendar Timeline Plugin", | ||
@@ -8,9 +8,9 @@ "description": "Display events on a horizontal time axis (without resources)", | ||
"dependencies": { | ||
"@fullcalendar/common": "~5.3.1", | ||
"@fullcalendar/premium-common": "~5.3.1", | ||
"@fullcalendar/scrollgrid": "~5.3.1", | ||
"tslib": "^2.0.0" | ||
"@fullcalendar/common": "~5.4.0", | ||
"@fullcalendar/premium-common": "~5.4.0", | ||
"@fullcalendar/scrollgrid": "~5.4.0", | ||
"tslib": "^2.0.3" | ||
}, | ||
"type": "module", | ||
"main": "main.js", | ||
"main": "main.cjs.js", | ||
"module": "main.js", | ||
"types": "main.d.ts", | ||
@@ -31,3 +31,6 @@ "jsdelivr": "main.global.min.js", | ||
"url": "http://arshaw.com/" | ||
}, | ||
"devDependencies": { | ||
"@fullcalendar/core-preact": "5.4.0" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
342225
11
4080
1
No
+ Added@fullcalendar/common@5.4.0(transitive)
+ Added@fullcalendar/premium-common@5.4.0(transitive)
+ Added@fullcalendar/scrollgrid@5.4.0(transitive)
- Removed@fullcalendar/common@5.3.1(transitive)
- Removed@fullcalendar/premium-common@5.3.1(transitive)
- Removed@fullcalendar/scrollgrid@5.3.1(transitive)
Updated@fullcalendar/common@~5.4.0
Updatedtslib@^2.0.3