@fullcalendar/timeline 5.10.0 → 5.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.cjs.js +2 -2
- package/main.global.js +2 -2
- package/main.global.min.js +2 -2
- package/main.js +2 -2
- package/package.json +5 -5
package/main.cjs.js
CHANGED
package/main.global.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Scheduler v5.
|
|
2
|
+
FullCalendar Scheduler v5.11.2
|
|
3
3
|
Docs & License: https://fullcalendar.io/scheduler
|
|
4
|
-
(c)
|
|
4
|
+
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
var FullCalendarTimeline = (function (exports, common, premiumCommonPlugin, scrollgrid) {
|
|
7
7
|
'use strict';
|
package/main.global.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar Scheduler v5.
|
|
2
|
+
FullCalendar Scheduler v5.11.2
|
|
3
3
|
Docs & License: https://fullcalendar.io/scheduler
|
|
4
|
-
(c)
|
|
4
|
+
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
6
6
|
var FullCalendarTimeline=function(e,t,n,r){"use strict";function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=o(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){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");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,r=arguments.length;n<r;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 c=[{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 u(e,n,r,o){var i={labelInterval:r.slotLabelInterval,slotDuration:r.slotDuration};!function(e,n,r){var o=n.currentRange;if(e.labelInterval){r.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){r.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 i=t.wholeDivideDurations(e.labelInterval,e.slotDuration);(null===i||i<1)&&(console.warn("slotLabelInterval must be a multiple of slotDuration"),e.slotDuration=null)}}(i,e,n),h(i,e,n),function(e,n,r){var o=n.currentRange,i=e.slotDuration;if(!i){for(var a=h(e,n,r),s=0,l=c;s<l.length;s++){var u=l[s],d=t.createDuration(u),f=t.wholeDivideDurations(a,d);if(null!==f&&f>1&&f<=6){i=d;break}}if(i)r.countDurationsBetween(o.start,o.end,i)>200&&(i=null);i||(i=a),e.slotDuration=i}}(i,e,n);var a=r.slotLabelFormat,s=Array.isArray(a)?a:null!=a?[a]:function(e,n,r,o){var i,a,s=e.labelInterval,l=t.greatestDurationDenominator(s).unit,c=o.weekNumbers,u=i=a=null;"week"!==l||c||(l="day");switch(l){case"year":u={year:"numeric"};break;case"month":m("years",n,r)>1&&(u={year:"numeric"}),i={month:"short"};break;case"week":m("years",n,r)>1&&(u={year:"numeric"}),i={week:"narrow"};break;case"day":m("years",n,r)>1?u={year:"numeric",month:"long"}:m("months",n,r)>1&&(u={month:"long"}),c&&(i={week:"short"}),a={weekday:"narrow",day:"numeric"};break;case"hour":c&&(u={week:"short"}),m("days",n,r)>1&&(i={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?(u={hour:"numeric",meridiem:"short"},i=function(e){return":"+t.padStart(e.date.minute,2)}):u={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":t.asRoughSeconds(s)/60>=6?(u={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},i=function(e){return":"+t.padStart(e.date.second,2)}):u={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"};break;case"millisecond":u={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"},i=function(e){return"."+t.padStart(e.millisecond,3)}}return[].concat(u||[],i||[],a||[])}(i,e,n,r);i.headerFormats=s.map((function(e){return t.createFormatter(e)})),i.isTimeScale=Boolean(i.slotDuration.milliseconds);var l=null;if(!i.isTimeScale){var u=t.greatestDurationDenominator(i.slotDuration).unit;/year|month|week/.test(u)&&(l=u)}i.largeUnit=l,i.emphasizeWeeks=1===t.asCleanDays(i.slotDuration)&&m("weeks",e,n)>=2&&!r.businessHours;var g,v,y=r.snapDuration;y&&(g=t.createDuration(y),v=t.wholeDivideDurations(i.slotDuration,g)),null==v&&(g=i.slotDuration,v=1),i.snapDuration=g,i.snapsPerSlot=v;var D=t.asRoughMs(e.slotMaxTime)-t.asRoughMs(e.slotMinTime),S=d(e.renderRange.start,i,n),R=d(e.renderRange.end,i,n);i.isTimeScale&&(S=n.add(S,e.slotMinTime),R=n.add(t.addDays(R,-1),e.slotMaxTime)),i.timeWindowMs=D,i.normalizedRange={start:S,end:R};for(var C=[],E=S;E<R;)f(E,i,e,o)&&C.push(E),E=n.add(E,i.slotDuration);i.slotDates=C;var w=-1,b=0,k=[],P=[];for(E=S;E<R;)f(E,i,e,o)?(w+=1,k.push(w),P.push(b)):k.push(w+.5),E=n.add(E,i.snapDuration),b+=1;return i.snapDiffToIndex=k,i.snapIndexToDiff=P,i.snapCnt=w+1,i.slotCnt=i.snapCnt/i.snapsPerSlot,i.isWeekStarts=function(e,t){for(var n=e.slotDates,r=e.emphasizeWeeks,o=null,i=[],a=0,s=n;a<s.length;a++){var l=s[a],c=t.computeWeekNumber(l),u=r&&null!==o&&o!==c;o=c,i.push(u)}return i}(i,n),i.cellRows=function(e,n){for(var r=e.slotDates,o=e.headerFormats,i=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})),c=0;c<r.length;c+=1)for(var u=r[c],d=e.isWeekStarts[c],f=0;f<o.length;f+=1){var h=o[f],m=i[f],g=m[m.length-1],v=f===o.length-1,y=o.length>1&&!v,D=null,S=l[f]||(v?s:null);if(y){var R=n.format(u,h);g&&g.text===R?g.colspan+=1:D=p(u,R,S)}else if(!g||t.isInt(n.countDurationsBetween(e.normalizedRange.start,u,e.labelInterval))){D=p(u,R=n.format(u,h),S)}else g.colspan+=1;D&&(D.weekStart=d,m.push(D))}return i}(i,n),i.slotsPerLabel=t.wholeDivideDurations(i.labelInterval,i.slotDuration),i}function d(e,n,r){var o=e;return n.isTimeScale||(o=t.startOfDay(o),n.largeUnit&&(o=r.startOf(o,n.largeUnit))),o}function f(e,n,r,o){if(o.isHiddenDay(e))return!1;if(n.isTimeScale){var i=t.startOfDay(e),a=e.valueOf()-i.valueOf()-t.asRoughMs(r.slotMinTime);return(a=(a%864e5+864e5)%864e5)<n.timeWindowMs}return!0}function h(e,n,r){var o=n.currentRange,i=e.labelInterval;if(!i){var a=void 0;if(e.slotDuration){for(var s=0,l=c;s<l.length;s++){a=l[s];var u=t.createDuration(a),d=t.wholeDivideDurations(u,e.slotDuration);if(null!==d&&d<=6){i=u;break}}i||(i=e.slotDuration)}else for(var f=0,h=c;f<h.length;f++){if(a=h[f],i=t.createDuration(a),r.countDurationsBetween(o.start,o.end,i)>=18)break}e.labelInterval=i}return i}function m(e,n,r){var o=n.currentRange,i=null;return"years"===e?i=r.diffWholeYears(o.start,o.end):"months"===e||"weeks"===e?i=r.diffWholeMonths(o.start,o.end):"days"===e&&(i=t.diffWholeDays(o.start,o.end)),i||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;return t.createElement(t.ContentHook,{hookProps:e.hookProps,content:n.options.slotLabelContent,defaultContent:v},(function(n,r){return t.createElement("a",l({ref:n,className:"fc-timeline-slot-cushion fc-scrollgrid-sync-inner"+(e.isSticky?" fc-sticky":"")},e.navLinkAttrs),r)}))},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.buildCellNavLinkAttrs=t.memoize(S),n}return s(n,e),n.prototype.render=function(){var e=this,n=this.props,r=this.context,o=r.dateEnv,i=r.options,a=n.cell,s=n.dateProfile,l=n.tDateProfile,c=t.getDateMeta(a.date,n.todayRange,n.nowDate,s),u=["fc-timeline-slot","fc-timeline-slot-label"].concat("time"===a.rowUnit?t.getSlotClassNames(c,r.theme):t.getDayClassNames(c,r.theme));a.isWeekStart&&u.push("fc-timeline-slot-em");var d=this.refineHookProps({level:n.rowLevel,dateMarker:a.date,text:a.text,dateEnv:r.dateEnv,viewApi:r.viewApi}),f=this.normalizeClassNames(i.slotLabelClassNames,d);return t.createElement(t.MountHook,{hookProps:d,didMount:i.slotLabelDidMount,willUnmount:i.slotLabelWillUnmount},(function(i){return t.createElement("th",{ref:i,className:u.concat(f).join(" "),"data-date":o.formatIso(a.date,{omitTime:!l.isTimeScale,omitTimeZoneOffset:!0}),colSpan:a.colspan},t.createElement("div",{className:"fc-timeline-slot-frame",style:{height:n.rowInnerHeight}},t.createElement(g,{hookProps:d,isSticky:n.isSticky,navLinkAttrs:e.buildCellNavLinkAttrs(r,a.date,a.rowUnit)})))}))},n}(t.BaseComponent);function S(e,n,r){return r&&"time"!==r?t.buildNavLinkAttrs(e,n,r):{}}var R=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,r=e.tDateProfile,o=e.rowInnerHeights,i=e.todayRange,a=e.nowDate,s=r.cellRows;return t.createElement(t.Fragment,null,s.map((function(e,l){var c=l===s.length-1,u=["fc-timeline-header-row",r.isTimeScale&&c?"fc-timeline-header-row-chrono":""];return t.createElement("tr",{key:l,className:u.join(" ")},e.map((function(e){return t.createElement(D,{key:e.date.toISOString(),cell:e,rowLevel:l,dateProfile:n,tDateProfile:r,todayRange:i,nowDate:a,rowInnerHeight:o&&o[l],isSticky:!c})})))})))},n}(t.BaseComponent),C=function(){function e(e,n,r,o,i,a){this.slatRootEl=e,this.dateProfile=r,this.tDateProfile=o,this.dateEnv=i,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.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,r=Math.floor(n),o=n-(r=Math.min(r,t.slotCnt-1)),i=this.innerCoordCache,a=this.outerCoordCache;return this.isRtl?a.originClientRect.width-(a.rights[r]-i.getWidth(r)*o):a.lefts[r]+i.getWidth(r)*o},e.prototype.rangeToCoords=function(e){return{start:this.dateToCoord(e.start),end:this.dateToCoord(e.end)}},e.prototype.durationToCoord=function(e){var n=this,r=n.dateProfile,o=n.tDateProfile,i=n.dateEnv,a=n.isRtl,s=0;if(r){var l=i.add(r.activeRange.start,e);o.isTimeScale||(l=t.startOfDay(l)),s=this.dateToCoord(l),!a&&s&&(s+=1)}return s},e.prototype.coordFromLeft=function(e){return this.isRtl?this.outerCoordCache.originClientRect.width-e:e},e.prototype.computeDateSnapCoverage=function(e){return E(e,this.tDateProfile,this.dateEnv)},e}();function E(e,n,r){var o=r.countDurationsBetween(n.normalizedRange.start,e,n.snapDuration);if(o<0)return 0;if(o>=n.snapDiffToIndex.length)return n.snapCnt;var i=Math.floor(o),a=n.snapDiffToIndex[i];return t.isInt(a)?a+=o-i:a=Math.ceil(a),a}function w(e,t){return null===e?{left:"",right:""}:t?{right:e,left:""}:{left:e,right:""}}function b(e,t){return e?t?{right:e.start,left:-e.end}:{left:e.start,right:-e.end}:{left:"",right:""}}var k=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,r=this.context,o=t.greatestDurationDenominator(n.tDateProfile.slotDuration).unit,i=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",{"aria-hidden":!0,className:"fc-scrollgrid-sync-table",style:{minWidth:n.tableMinWidth,width:n.clientWidth}},n.tableColGroupNode,t.createElement("tbody",null,t.createElement(R,{dateProfile:n.dateProfile,tDateProfile:n.tDateProfile,nowDate:o,todayRange:a,rowInnerHeights:n.rowInnerHeights}))),r.options.nowIndicator&&t.createElement("div",{className:"fc-timeline-now-indicator-container"},i&&i.isDateInRange(o)&&t.createElement(t.NowIndicatorRoot,{isAxis:!0,date:o},(function(e,n,a,s){return t.createElement("div",{ref:e,className:["fc-timeline-now-indicator-arrow"].concat(n).join(" "),style:w(i.dateToCoord(o),r.isRtl)},s)}))))}))},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),P=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,r=n.dateEnv,o=n.options,i=n.theme,a=e.date,s=e.tDateProfile,c=e.isEm,u=t.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),d=["fc-timeline-slot","fc-timeline-slot-lane"],f={"data-date":r.formatIso(a,{omitTimeZoneOffset:!0,omitTime:!s.isTimeScale})},h=l(l({date:r.toDate(e.date)},u),{view:n.viewApi});return c&&d.push("fc-timeline-slot-em"),s.isTimeScale&&d.push(t.isInt(r.countDurationsBetween(s.normalizedRange.start,e.date,s.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor"),d.push.apply(d,e.isDay?t.getDayClassNames(u,i):t.getSlotClassNames(u,i)),t.createElement(t.RenderHook,{hookProps:h,classNames:o.slotLaneClassNames,content:o.slotLaneContent,didMount:o.slotLaneDidMount,willUnmount:o.slotLaneWillUnmount,elRef:e.elRef},(function(e,n,r,o){return t.createElement("td",l({ref:e,className:d.concat(n).join(" ")},f),t.createElement("div",{ref:r},o))}))},n}(t.BaseComponent),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=e.tDateProfile,r=e.cellElRefs,o=n.slotDates,i=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(P,{key:l,elRef:r.createRef(l),date:o,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:i[s],isDay:a})}))))},n}(t.BaseComponent),T=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,r=n.coords;if(t&&r){if(e.time)t(r.coordFromLeft(r.durationToCoord(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",{"aria-hidden":!0,className:n.theme.getClass("table"),style:{minWidth:e.tableMinWidth,width:e.clientWidth}},e.tableColGroupNode,t.createElement(M,{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,r=this.context,o=r.dateEnv,i=r.isRtl,a=this.props.tDateProfile,s=n.leftToIndex(e);if(null!=s){var l=n.getWidth(s),c=i?(n.rights[s]-e)/l:(e-n.lefts[s])/l,u=Math.floor(c*a.snapsPerSlot),d=o.add(a.slotDates[s],t.multiplyDuration(a.snapDuration,u));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);function I(e,t,n){var r=[];if(n)for(var o=0,i=e;o<i.length;o++){var a=i[o],s=n.rangeToCoords(a),l=Math.round(s.start),c=Math.round(s.end);c-l<t&&(c=l+t),r.push({start:l,end:c})}return r}var x=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,r){var o=this.props,i=o.todayRange,a=o.nowDate,s=this.context.isRtl,c=I(e,0,n),u=e.map((function(e,n){var o=b(c[n],s);return t.createElement("div",{key:t.buildEventRangeKey(e.eventRange),className:"fc-timeline-bg-harness",style:o},"bg-event"===r?t.createElement(t.BgEvent,l({seg:e},t.getSegMeta(e,i,a))):t.renderFill(r))}));return t.createElement(t.Fragment,null,u)},n}(t.BaseComponent),W=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return s(n,e),n.prototype.sliceRange=function(e,n,r,o,i){var a=function(e,n,r){if(!n.isTimeScale&&(e=t.computeVisibleDayRange(e),n.largeUnit)){var o=e;((e={start:r.startOf(e.start,n.largeUnit),end:r.startOf(e.end,n.largeUnit)}).end.valueOf()!==o.end.valueOf()||e.end<=e.start)&&(e={start:e.start,end:r.add(e.end,n.slotDuration)})}return e}(e,o,i),s=[];if(E(a.start,o,i)<E(a.end,o,i)){var l=t.intersectRanges(a,o.normalizedRange);l&&s.push({start:l.start,end:l.end,isStart:l.start.valueOf()===a.start.valueOf()&&f(l.start,o,n,r),isEnd:l.end.valueOf()===a.end.valueOf()&&f(t.addMs(l.end,-1),o,n,r)})}return s},n}(t.Slicer),N=t.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"}),L=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:N,defaultDisplayEventTime:!e.isTimeScale}))},n}(t.BaseComponent),H=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,r=this.context,o=n.hiddenSegs,i=n.elRef,a=n.placement,s=n.resourceId,c=a.top,u=a.hcoords,d=u&&null!==c,f=b(u,r.isRtl),h=s?{resourceId:s}:{};return t.createElement(t.MoreLinkRoot,{allDayDate:null,moreCnt:o.length,allSegs:o,hiddenSegs:o,alignmentElRef:this.rootElRef,dateProfile:n.dateProfile,todayRange:n.todayRange,extraDateSpan:h,popoverContent:function(){return t.createElement(t.Fragment,null,o.map((function(e){var r=e.eventRange.instance.instanceId;return t.createElement("div",{key:r,style:{visibility:n.isForcedInvisible[r]?"hidden":""}},t.createElement(L,l({isTimeScale:n.isTimeScale,seg:e,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:r===n.eventSelection},t.getSegMeta(e,n.todayRange,n.nowDate))))})))}},(function(n,r,o,a,s,u,h,m){return t.createElement("a",{ref:function(r){t.setRef(n,r),t.setRef(i,r),t.setRef(e.rootElRef,r)},className:["fc-timeline-more-link"].concat(r).join(" "),style:l({visibility:d?"":"hidden",top:c||0},f),onClick:s,title:u,"aria-expanded":h,"aria-controls":m},t.createElement("div",{ref:o,className:"fc-timeline-more-link-inner fc-sticky"},a))}))},n}(t.BaseComponent),z=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.slicer=new W,n.sortEventSegs=t.memoize(t.sortEventSegs),n.harnessElRefs=new t.RefMap,n.moreElRefs=new t.RefMap,n.innerElRef=t.createRef(),n.state={eventInstanceHeights:{},moreLinkHeights:{}},n}return s(n,e),n.prototype.render=function(){var e=this,n=e.props,r=e.state,o=e.context,i=o.options,a=n.dateProfile,s=n.tDateProfile,l=this.slicer.sliceProps(n,a,s.isTimeScale?null:n.nextDayThreshold,o,a,o.dateProfileGenerator,s,o.dateEnv),c=(l.eventDrag?l.eventDrag.segs:null)||(l.eventResize?l.eventResize.segs:null)||[],u=this.sortEventSegs(l.fgEventSegs,i.eventOrder),d=function(e,n,r,o,i,a){for(var s=[],l=[],c=0;c<e.length;c+=1){var u=e[c],d=r[u.eventRange.instance.instanceId],f=n[c];d&&f?s.push({index:c,span:f,thickness:d}):l.push({seg:u,hcoords:f,top:null})}var h=new t.SegHierarchy;null!=i&&(h.strictOrder=i),null!=a&&(h.maxStackCnt=a);var m=h.addSegs(s),p=m.map((function(t){return{seg:e[t.index],hcoords:t.span,top:null}})),g=t.groupIntersectingEntries(m),v=[],y=[],D=function(t){return e[t.index]};for(c=0;c<g.length;c+=1){var S=g[c],R=S.entries.map(D);null!=(d=o[t.buildIsoString(t.computeEarliestSegStart(R))])?v.push({index:e.length+c,thickness:d,span:S.span}):y.push({seg:R,hcoords:S.span,top:null})}h.maxStackCnt=-1,h.addSegs(v);for(var C=[],E=0,w=0,b=h.toRects();w<b.length;w++){var k=b[w],P=k.index;C.push({seg:P<e.length?e[P]:g[P-e.length].entries.map(D),hcoords:k.span,top:k.levelCoord}),E=Math.max(E,k.levelCoord+k.thickness)}return[C.concat(l,p,y),E]}(u,I(u,i.eventMinWidth,n.timelineCoords),r.eventInstanceHeights,r.moreLinkHeights,i.eventOrderStrict,i.eventMaxStack),f=d[0],h=d[1],m=(l.eventDrag?l.eventDrag.affectedInstances:null)||(l.eventResize?l.eventResize.affectedInstances:null)||{};return t.createElement(t.Fragment,null,t.createElement(x,{businessHourSegs:l.businessHourSegs,bgEventSegs:l.bgEventSegs,timelineCoords:n.timelineCoords,eventResizeSegs:l.eventResize?l.eventResize.segs:[],dateSelectionSegs:l.dateSelectionSegs,nowDate:n.nowDate,todayRange:n.todayRange}),t.createElement("div",{className:"fc-timeline-events fc-scrollgrid-sync-inner",ref:this.innerElRef,style:{height:h}},this.renderFgSegs(f,m,!1,!1,!1),this.renderFgSegs(function(e,t,n){if(!e.length||!t)return[];var r=function(e){for(var t={},n=0,r=e;n<r.length;n++){var o=r[n],i=o.seg;Array.isArray(i)||(t[i.eventRange.instance.instanceId]=o.top)}return t}(n);return e.map((function(e){return{seg:e,hcoords:t.rangeToCoords(e),top:r[e.eventRange.instance.instanceId]}}))}(c,n.timelineCoords,f),{},Boolean(l.eventDrag),Boolean(l.eventResize),!1)))},n.prototype.componentDidMount=function(){this.updateSize()},n.prototype.componentDidUpdate=function(e,t){e.eventStore===this.props.eventStore&&e.timelineCoords===this.props.timelineCoords&&t.moreLinkHeights===this.state.moreLinkHeights||this.updateSize()},n.prototype.updateSize=function(){var e=this,n=this.props,r=n.timelineCoords;n.onHeightChange&&n.onHeightChange(this.innerElRef.current,!1),r&&this.setState({eventInstanceHeights:t.mapHash(this.harnessElRefs.currentMap,(function(e){return Math.round(e.getBoundingClientRect().height)})),moreLinkHeights:t.mapHash(this.moreElRefs.currentMap,(function(e){return Math.round(e.getBoundingClientRect().height)}))},(function(){n.onHeightChange&&n.onHeightChange(e.innerElRef.current,!0)}))},n.prototype.renderFgSegs=function(e,n,r,o,i){var a=this,s=a.harnessElRefs,c=a.moreElRefs,u=a.props,d=a.context,f=r||o||i;return t.createElement(t.Fragment,null,e.map((function(e){var a=e.seg,h=e.hcoords,m=e.top;if(Array.isArray(a)){var p=t.buildIsoString(t.computeEarliestSegStart(a));return t.createElement(H,{key:"m:"+p,elRef:c.createRef(p),hiddenSegs:a,placement:e,dateProfile:u.dateProfile,nowDate:u.nowDate,todayRange:u.todayRange,isTimeScale:u.tDateProfile.isTimeScale,eventSelection:u.eventSelection,resourceId:u.resourceId,isForcedInvisible:n})}var g=a.eventRange.instance.instanceId,v=f||Boolean(!n[g]&&h&&null!==m),y=b(h,d.isRtl);return t.createElement("div",{key:"e:"+g,ref:f?null:s.createRef(g),className:"fc-timeline-event-harness",style:l({visibility:v?"":"hidden",top:m||0},y)},t.createElement(L,l({isTimeScale:u.tDateProfile.isTimeScale,seg:a,isDragging:r,isResizing:o,isDateSelecting:i,isSelected:g===u.eventSelection},t.getSegMeta(a,u.todayRange,u.nowDate))))})))},n}(t.BaseComponent);z.addStateEquality({eventInstanceHeights:t.isPropsEqual,moreLinkHeights:t.isPropsEqual});var O=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,r=n.props,o=n.state,i=n.context,a=i.options,s=r.dateProfile,l=r.tDateProfile,c=t.greatestDurationDenominator(l.slotDuration).unit;return t.createElement("div",{className:"fc-timeline-body",ref:this.handeEl,style:{minWidth:r.tableMinWidth,height:r.clientHeight,width:r.clientWidth}},t.createElement(t.NowTimer,{unit:c},(function(n,c){return t.createElement(t.Fragment,null,t.createElement(T,{ref:e.slatsRef,dateProfile:s,tDateProfile:l,nowDate:n,todayRange:c,clientWidth:r.clientWidth,tableColGroupNode:r.tableColGroupNode,tableMinWidth:r.tableMinWidth,onCoords:e.handleCoords,onScrollLeftRequest:r.onScrollLeftRequest}),t.createElement(z,{dateProfile:s,tDateProfile:r.tDateProfile,nowDate:n,todayRange:c,nextDayThreshold:a.nextDayThreshold,businessHours:r.businessHours,eventStore:r.eventStore,eventUiBases:r.eventUiBases,dateSelection:r.dateSelection,eventSelection:r.eventSelection,eventDrag:r.eventDrag,eventResize:r.eventResize,timelineCoords:o.coords}),a.nowIndicator&&o.coords&&o.coords.isDateInRange(n)&&t.createElement("div",{className:"fc-timeline-now-indicator-container"},t.createElement(t.NowIndicatorRoot,{isAxis:!1,date:n},(function(e,r,a,s){return t.createElement("div",{ref:e,className:["fc-timeline-now-indicator-line"].concat(r).join(" "),style:w(o.coords.dateToCoord(n),i.isRtl)},s)}))))})))},n.prototype.queryHit=function(e,t,n,r){var o=this.slatsRef.current.positionToHit(e);return o?{dateProfile:this.props.dateProfile,dateSpan:o.dateSpan,rect:{left:o.left,right:o.right,top:0,bottom:r},dayEl:o.dayEl,layer:0}:null},n}(t.DateComponent),B=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.buildTimelineDateProfile=t.memoize(u),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,o=n.props,i=n.state,a=n.context,s=a.options,c=!o.forPrint&&t.getStickyHeaderDates(s),u=!o.forPrint&&t.getStickyFooterScrollbar(s),d=this.buildTimelineDateProfile(o.dateProfile,a.dateEnv,s,a.dateProfileGenerator),f=["fc-timeline",!1===s.eventOverlap?"fc-timeline-overlap-disabled":""],h=s.slotMinWidth,m=F(d,h||this.computeFallbackSlotMinWidth(d)),p=[{type:"header",key:"header",isSticky:c,chunks:[{key:"timeline",content:function(n){return t.createElement(k,{dateProfile:o.dateProfile,clientWidth:n.clientWidth,clientHeight:n.clientHeight,tableMinWidth:n.tableMinWidth,tableColGroupNode:n.tableColGroupNode,tDateProfile:d,slatCoords:i.slatCoords,onMaxCushionWidth:h?null:e.handleMaxCushionWidth})}}]},{type:"body",key:"body",liquid:!0,chunks:[{key:"timeline",content:function(n){return t.createElement(O,l({},o,{clientWidth:n.clientWidth,clientHeight:n.clientHeight,tableMinWidth:n.tableMinWidth,tableColGroupNode:n.tableColGroupNode,tDateProfile:d,onSlatCoords:e.handleSlatCoords,onScrollLeftRequest:e.handleScrollLeftRequest}))}}]}];return u&&p.push({type:"footer",key:"footer",isSticky:!0,chunks:[{key:"timeline",content:t.renderScrollShim}]}),t.createElement(t.ViewRoot,{viewSpec:a.viewSpec},(function(n,i){return t.createElement("div",{ref:n,className:f.concat(i).join(" ")},t.createElement(r.ScrollGrid,{ref:e.scrollGridRef,liquid:!o.isHeightAuto&&!o.forPrint,collapsibleWidth:!1,colGroups:[{cols:m}],sections:p}))}))},n.prototype.computeFallbackSlotMinWidth=function(e){return Math.max(30,(this.state.slotCushionMaxWidth||0)/e.slotsPerLabel)},n}(t.DateComponent);function F(e,t){return[{span:e.slotCnt,minWidth:t||1}]}var A=t.createPlugin({deps:[i.default],initialView:"timelineDay",views:{timeline:{component:B,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(A),e.TimelineCoords=C,e.TimelineHeader=k,e.TimelineHeaderRows=R,e.TimelineLane=z,e.TimelineLaneBg=x,e.TimelineLaneSlicer=W,e.TimelineSlats=T,e.TimelineView=B,e.buildSlatCols=F,e.buildTimelineDateProfile=u,e.coordToCss=w,e.coordsToCss=b,e.default=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendarPremiumCommon,FullCalendarScrollGrid);
|
package/main.js
CHANGED
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullcalendar/timeline",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.2",
|
|
4
4
|
"title": "FullCalendar Timeline Plugin",
|
|
5
5
|
"description": "Display events on a horizontal time axis (without resources)",
|
|
6
6
|
"docs": "https://fullcalendar.io/docs/timeline-view-no-resources",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@fullcalendar/common": "~5.
|
|
9
|
-
"@fullcalendar/premium-common": "~5.
|
|
10
|
-
"@fullcalendar/scrollgrid": "~5.
|
|
8
|
+
"@fullcalendar/common": "~5.11.2",
|
|
9
|
+
"@fullcalendar/premium-common": "~5.11.2",
|
|
10
|
+
"@fullcalendar/scrollgrid": "~5.11.2",
|
|
11
11
|
"tslib": "^2.1.0"
|
|
12
12
|
},
|
|
13
13
|
"main": "main.cjs.js",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"url": "http://arshaw.com/"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@fullcalendar/core-preact": "5.
|
|
32
|
+
"@fullcalendar/core-preact": "5.11.2"
|
|
33
33
|
}
|
|
34
34
|
}
|