@fullcalendar/timeline 7.0.0-beta.0 → 7.0.0-beta.1

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/index.cjs CHANGED
@@ -7,6 +7,7 @@ var premiumCommonPlugin = require('@fullcalendar/premium-common/index.cjs');
7
7
  var internalCommon = require('./internal.cjs');
8
8
  require('@fullcalendar/core/internal.cjs');
9
9
  require('@fullcalendar/core/preact.cjs');
10
+ require('@fullcalendar/scrollgrid/internal.cjs');
10
11
 
11
12
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
13
 
@@ -14,7 +15,7 @@ var premiumCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(premiumCom
14
15
 
15
16
  var index = index_cjs.createPlugin({
16
17
  name: '@fullcalendar/timeline',
17
- premiumReleaseDate: '2024-10-01',
18
+ premiumReleaseDate: '2024-10-09',
18
19
  deps: [premiumCommonPlugin__default["default"]],
19
20
  initialView: 'timelineDay',
20
21
  views: {
package/index.global.js CHANGED
@@ -1,9 +1,9 @@
1
1
  /*!
2
- FullCalendar Timeline Plugin v7.0.0-beta.0
2
+ FullCalendar Timeline Plugin v7.0.0-beta.1
3
3
  Docs & License: https://fullcalendar.io/docs/timeline-view-no-resources
4
4
  (c) 2024 Adam Shaw
5
5
  */
6
- FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$1, preact) {
6
+ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$1, preact, internal$2) {
7
7
  'use strict';
8
8
 
9
9
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
@@ -492,6 +492,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
492
492
  }
493
493
  componentWillUnmount() {
494
494
  this.detachWidth();
495
+ internal$1.setRef(this.props.innerWidthRef, null);
495
496
  }
496
497
  }
497
498
 
@@ -796,8 +797,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
796
797
  hStyle = horizontalsToCss(segHorizontal, isRtl);
797
798
  }
798
799
  return (preact.createElement("div", { key: internal$1.buildEventRangeKey(seg.eventRange), className: "fc-timeline-bg-harness", style: hStyle }, fillType === 'bg-event' ?
799
- preact.createElement(internal$1.BgEvent, Object.assign({ seg: seg }, internal$1.getSegMeta(seg, todayRange, nowDate))) :
800
- internal$1.renderFill(fillType)));
800
+ preact.createElement(internal$1.BgEvent, Object.assign({ eventRange: seg.eventRange, isStart: seg.isStart, isEnd: seg.isEnd }, internal$1.getEventRangeMeta(seg.eventRange, todayRange, nowDate))) : (internal$1.renderFill(fillType))));
801
801
  })));
802
802
  }
803
803
  }
@@ -852,9 +852,10 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
852
852
  let { hiddenSegs, resourceId, forcedInvisibleMap } = props;
853
853
  let extraDateSpan = resourceId ? { resourceId } : {};
854
854
  return (preact.createElement(internal$1.MoreLinkContainer, { elClasses: ['fc-timeline-more-link'], allDayDate: null, segs: hiddenSegs, hiddenSegs: hiddenSegs, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: extraDateSpan, popoverContent: () => (preact.createElement(preact.Fragment, null, hiddenSegs.map((seg) => {
855
- let instanceId = seg.eventRange.instance.instanceId;
855
+ let { eventRange } = seg;
856
+ let instanceId = eventRange.instance.instanceId;
856
857
  return (preact.createElement("div", { key: instanceId, style: { visibility: forcedInvisibleMap[instanceId] ? 'hidden' : '' } },
857
- preact.createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, internal$1.getSegMeta(seg, props.todayRange, props.nowDate)))));
858
+ preact.createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, internal$1.getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
858
859
  }))) }, (InnerContent) => (preact.createElement(InnerContent, { elTag: "div", elClasses: ['fc-timeline-more-link-inner', 'fc-sticky-x'] }))));
859
860
  }
860
861
  }
@@ -880,6 +881,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
880
881
  }
881
882
  componentWillUnmount() {
882
883
  this.detachHeight();
884
+ internal$1.setRef(this.props.heightRef, null);
883
885
  }
884
886
  }
885
887
 
@@ -957,13 +959,14 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
957
959
  let isMirror = isDragging || isResizing || isDateSelecting;
958
960
  return (preact.createElement(preact.Fragment, null,
959
961
  segs.map((seg) => {
960
- const { instanceId } = seg.eventRange.instance;
962
+ const { eventRange } = seg;
963
+ const { instanceId } = eventRange.instance;
961
964
  const segTop = segTops[instanceId];
962
965
  const segHorizontal = segHorizontals[instanceId];
963
966
  const isVisible = isMirror ||
964
967
  (segHorizontal && segTop != null && !forcedInvisibleMap[instanceId]);
965
968
  return (preact.createElement(TimelineEventHarness, { key: instanceId, style: Object.assign({ visibility: isVisible ? '' : 'hidden', top: segTop || 0 }, horizontalsToCss(segHorizontal, context.isRtl)), heightRef: isMirror ? undefined : segHeightRefMap.createRef(instanceId) },
966
- preact.createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, internal$1.getSegMeta(seg, props.todayRange, props.nowDate)))));
969
+ preact.createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, internal$1.getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
967
970
  }),
968
971
  hiddenGroups.map((hiddenGroup) => (preact.createElement(TimelineEventHarness, { key: hiddenGroup.key, style: Object.assign({ top: hiddenGroupTops[hiddenGroup.key] || 0 }, horizontalsToCss({
969
972
  start: hiddenGroup.span.start,
@@ -981,7 +984,6 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
981
984
  this.buildCellNavLinkAttrs = internal$1.memoize(buildCellNavLinkAttrs);
982
985
  // ref
983
986
  this.innerElRef = preact.createRef();
984
- // TODO: unset width/height ref on unmount?
985
987
  }
986
988
  render() {
987
989
  let { props, context } = this;
@@ -1043,7 +1045,10 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1043
1045
  });
1044
1046
  }
1045
1047
  componentWillUnmount() {
1048
+ const { props } = this;
1046
1049
  this.detachSize();
1050
+ internal$1.setRef(props.innerWidthRef, null);
1051
+ internal$1.setRef(props.innerHeightRef, null);
1047
1052
  }
1048
1053
  }
1049
1054
  // Utils
@@ -1102,6 +1107,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1102
1107
  // TODO: make this part of the cell obj?
1103
1108
  // TODO: rowUnit seems wrong sometimes. says 'month' when it should be day
1104
1109
  // TODO: rowUnit is relevant to whole row. put it on a row object, not the cells
1110
+ // TODO: use rowUnit to key the Row itself?
1105
1111
  const key = cell.rowUnit + ':' + cell.date.toISOString();
1106
1112
  return (preact.createElement(TimelineHeaderCell, { key: key, cell: cell, rowLevel: props.rowLevel, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, todayRange: props.todayRange, nowDate: props.nowDate, isCentered: isCentered, isSticky: isSticky,
1107
1113
  // refs
@@ -1110,6 +1116,10 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1110
1116
  slotWidth: props.slotWidth }));
1111
1117
  })));
1112
1118
  }
1119
+ componentWillUnmount() {
1120
+ internal$1.setRef(this.props.innerWidthRef, null);
1121
+ internal$1.setRef(this.props.innerHeighRef, null);
1122
+ }
1113
1123
  }
1114
1124
 
1115
1125
  class TimelineNowIndicatorLine extends internal$1.BaseComponent {
@@ -1143,19 +1153,19 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1143
1153
  this.headerScrollerRef = preact.createRef();
1144
1154
  this.bodyScrollerRef = preact.createRef();
1145
1155
  this.footerScrollerRef = preact.createRef();
1156
+ this.headerRowInnerWidthMap = new internal$1.RefMap(() => {
1157
+ internal$1.afterSize(this.handleSlotInnerWidths);
1158
+ });
1159
+ this.scrollTime = null;
1146
1160
  // Sizing
1147
1161
  // -----------------------------------------------------------------------------------------------
1148
- this.handleHeaderSlotInnerWidth = (innerWidth) => {
1149
- this.headerSlotInnerWidth = innerWidth;
1150
- internal$1.afterSize(this.handleSlotInnerWidths);
1151
- };
1152
1162
  this.handleBodySlotInnerWidth = (innerWidth) => {
1153
1163
  this.bodySlotInnerWidth = innerWidth;
1154
1164
  internal$1.afterSize(this.handleSlotInnerWidths);
1155
1165
  };
1156
1166
  this.handleSlotInnerWidths = () => {
1157
1167
  const { state } = this;
1158
- const slotInnerWidth = Math.max(this.headerSlotInnerWidth, this.bodySlotInnerWidth);
1168
+ const slotInnerWidth = Math.max(this.headerRowInnerWidthMap.current.get(this.tDateProfile.cellRows.length - 1) || 0, this.bodySlotInnerWidth);
1159
1169
  if (state.slotInnerWidth !== slotInnerWidth) {
1160
1170
  this.setState({ slotInnerWidth });
1161
1171
  }
@@ -1175,16 +1185,23 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1175
1185
  rightScrollbarWidth
1176
1186
  });
1177
1187
  };
1178
- this.timeScrollResponder = new internal$1.ScrollResponder((time) => {
1179
- const { props, context, tDateProfile, slotWidth } = this;
1180
- if (slotWidth != null) {
1181
- const x = timeToCoord(time, context.dateEnv, props.dateProfile, tDateProfile, slotWidth) +
1182
- (context.isRtl ? -1 : 1); // overcome border. TODO: DRY this up
1188
+ this.handleTimeScroll = (scrollTime) => {
1189
+ this.scrollTime = scrollTime;
1190
+ this.updateScroll();
1191
+ };
1192
+ this.updateScroll = () => {
1193
+ const { props, context, tDateProfile, scrollTime, slotWidth } = this;
1194
+ if (scrollTime != null && slotWidth != null) {
1195
+ let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
1196
+ if (x) {
1197
+ x += context.isRtl ? -1 : 1; // overcome border. TODO: DRY this up
1198
+ }
1183
1199
  this.syncedScroller.scrollTo({ x });
1184
- return true;
1185
1200
  }
1186
- return false;
1187
- });
1201
+ };
1202
+ this.clearScroll = () => {
1203
+ this.scrollTime = null;
1204
+ };
1188
1205
  // Hit System
1189
1206
  // -----------------------------------------------------------------------------------------------
1190
1207
  this.handeBodyEl = (el) => {
@@ -1235,7 +1252,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1235
1252
  } },
1236
1253
  preact.createElement("div", null, cellRows.map((cells, rowLevel) => {
1237
1254
  const isLast = rowLevel === cellRows.length - 1;
1238
- return (preact.createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: isLast ? this.handleHeaderSlotInnerWidth : undefined }));
1255
+ return (preact.createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: this.headerRowInnerWidthMap.createRef(rowLevel) }));
1239
1256
  })),
1240
1257
  enableNowIndicator && (
1241
1258
  // TODO: make this positioned WITHIN padding?
@@ -1262,27 +1279,26 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1262
1279
  // Lifecycle
1263
1280
  // -----------------------------------------------------------------------------------------------
1264
1281
  componentDidMount() {
1265
- const { context } = this;
1266
- const { options } = context;
1267
- const ScrollerSyncer = internal$1.getScrollerSyncerClass(this.context.pluginHooks);
1268
- this.syncedScroller = new ScrollerSyncer(true); // horizontal=true
1282
+ this.syncedScroller = new internal$2.ScrollerSyncer(true); // horizontal=true
1269
1283
  this.updateSyncedScroller();
1270
- context.emitter.on('_timeScrollRequest', this.timeScrollResponder.handleScroll);
1271
- this.timeScrollResponder.handleScroll(options.scrollTime);
1284
+ this.resetScroll();
1285
+ this.context.emitter.on('_timeScrollRequest', this.handleTimeScroll);
1286
+ this.syncedScroller.addScrollEndListener(this.clearScroll);
1272
1287
  }
1273
1288
  componentDidUpdate(prevProps) {
1274
- const { options } = this.context;
1275
1289
  this.updateSyncedScroller();
1276
- if (prevProps.dateProfile !== this.props.dateProfile && options.scrollTimeReset) {
1277
- this.timeScrollResponder.handleScroll(options.scrollTime);
1290
+ if (prevProps.dateProfile !== this.props.dateProfile && this.context.options.scrollTimeReset) {
1291
+ this.resetScroll();
1278
1292
  }
1279
1293
  else {
1280
- this.timeScrollResponder.drain();
1294
+ // TODO: inefficient to update so often
1295
+ this.updateScroll();
1281
1296
  }
1282
1297
  }
1283
1298
  componentWillUnmount() {
1284
1299
  this.syncedScroller.destroy();
1285
- this.context.emitter.off('_timeScrollRequest', this.timeScrollResponder.handleScroll);
1300
+ this.context.emitter.off('_timeScrollRequest', this.handleTimeScroll);
1301
+ this.syncedScroller.removeScrollEndListener(this.clearScroll);
1286
1302
  }
1287
1303
  // Scrolling
1288
1304
  // -----------------------------------------------------------------------------------------------
@@ -1291,7 +1307,10 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1291
1307
  this.headerScrollerRef.current,
1292
1308
  this.bodyScrollerRef.current,
1293
1309
  this.footerScrollerRef.current
1294
- ], this.context.isRtl);
1310
+ ]);
1311
+ }
1312
+ resetScroll() {
1313
+ this.handleTimeScroll(this.context.options.scrollTime);
1295
1314
  }
1296
1315
  queryHit(positionLeft, positionTop, elWidth, elHeight) {
1297
1316
  const { props, context, tDateProfile, slotWidth } = this;
@@ -1343,7 +1362,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1343
1362
 
1344
1363
  var plugin = core.createPlugin({
1345
1364
  name: '@fullcalendar/timeline',
1346
- premiumReleaseDate: '2024-10-01',
1365
+ premiumReleaseDate: '2024-10-09',
1347
1366
  deps: [premiumCommonPlugin__default["default"]],
1348
1367
  initialView: 'timelineDay',
1349
1368
  views: {
@@ -1399,4 +1418,4 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1399
1418
 
1400
1419
  return exports;
1401
1420
 
1402
- })({}, FullCalendar, FullCalendar.PremiumCommon, FullCalendar.Internal, FullCalendar.Preact);
1421
+ })({}, FullCalendar, FullCalendar.PremiumCommon, FullCalendar.Internal, FullCalendar.Preact, FullCalendar.ScrollGrid.Internal);
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar Timeline Plugin v7.0.0-beta.0
2
+ FullCalendar Timeline Plugin v7.0.0-beta.1
3
3
  Docs & License: https://fullcalendar.io/docs/timeline-view-no-resources
4
4
  (c) 2024 Adam Shaw
5
5
  */
6
- FullCalendar.Timeline=function(e,t,n,i,r){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}var s=l(n);i.config.MAX_TIMELINE_SLOTS=1e3;const a=[{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 o(e,t,n,r){let l={labelInterval:n.slotLabelInterval,slotDuration:n.slotDuration};!function(e,t,n){const{currentRange:r}=t;if(e.labelInterval){n.countDurationsBetween(r.start,r.end,e.labelInterval)>i.config.MAX_TIMELINE_SLOTS&&(console.warn("slotLabelInterval results in too many cells"),e.labelInterval=null)}if(e.slotDuration){n.countDurationsBetween(r.start,r.end,e.slotDuration)>i.config.MAX_TIMELINE_SLOTS&&(console.warn("slotDuration results in too many cells"),e.slotDuration=null)}if(e.labelInterval&&e.slotDuration){const t=i.wholeDivideDurations(e.labelInterval,e.slotDuration);(null===t||t<1)&&(console.warn("slotLabelInterval must be a multiple of slotDuration"),e.slotDuration=null)}}(l,e,t),f(l,e,t),function(e,t,n){const{currentRange:r}=t;let{slotDuration:l}=e;if(!l){const s=f(e,t,n);for(let e of a){const t=i.createDuration(e),n=i.wholeDivideDurations(s,t);if(null!==n&&n>1&&n<=6){l=t;break}}if(l){n.countDurationsBetween(r.start,r.end,l)>200&&(l=null)}l||(l=s),e.slotDuration=l}}(l,e,t);let s=n.slotLabelFormat,o=Array.isArray(s)?s:null!=s?[s]:function(e,t,n,r){let l,s;const{labelInterval:a}=e;let o=i.greatestDurationDenominator(a).unit;const c=r.weekNumbers;let d=l=s=null;"week"!==o||c||(o="day");switch(o){case"year":d={year:"numeric"};break;case"month":h("years",t,n)>1&&(d={year:"numeric"}),l={month:"short"};break;case"week":h("years",t,n)>1&&(d={year:"numeric"}),l={week:"narrow"};break;case"day":h("years",t,n)>1?d={year:"numeric",month:"long"}:h("months",t,n)>1&&(d={month:"long"}),c&&(l={week:"short"}),s={weekday:"narrow",day:"numeric"};break;case"hour":c&&(d={week:"short"}),h("days",t,n)>1&&(l={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),s={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":i.asRoughMinutes(a)/60>=6?(d={hour:"numeric",meridiem:"short"},l=e=>":"+i.padStart(e.date.minute,2)):d={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":i.asRoughSeconds(a)/60>=6?(d={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},l=e=>":"+i.padStart(e.date.second,2)):d={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"};break;case"millisecond":d={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"},l=e=>"."+i.padStart(e.millisecond,3)}return[].concat(d||[],l||[],s||[])}(l,e,t,n);l.headerFormats=o.map(e=>i.createFormatter(e)),l.isTimeScale=Boolean(l.slotDuration.milliseconds);let u=null;if(!l.isTimeScale){const e=i.greatestDurationDenominator(l.slotDuration).unit;/year|month|week/.test(e)&&(u=e)}l.largeUnit=u,l.emphasizeWeeks=1===i.asCleanDays(l.slotDuration)&&h("weeks",e,t)>=2&&!n.businessHours;let g,p,v=n.snapDuration;v&&(g=i.createDuration(v),p=i.wholeDivideDurations(l.slotDuration,g)),null==p&&(g=l.slotDuration,p=1),l.snapDuration=g,l.snapsPerSlot=p;let S=i.asRoughMs(e.slotMaxTime)-i.asRoughMs(e.slotMinTime),R=c(e.renderRange.start,l,t),D=c(e.renderRange.end,l,t);l.isTimeScale&&(R=t.add(R,e.slotMinTime),D=t.add(i.addDays(D,-1),e.slotMaxTime)),l.timeWindowMs=S,l.normalizedRange={start:R,end:D};let y=[],w=R;for(;w<D;)d(w,l,e,r)&&y.push(w),w=t.add(w,l.slotDuration);l.slotDates=y;let b=-1,x=0;const W=[],E=[];for(w=R;w<D;)d(w,l,e,r)?(b+=1,W.push(b),E.push(x)):W.push(b+.5),w=t.add(w,l.snapDuration),x+=1;return l.snapDiffToIndex=W,l.snapIndexToDiff=E,l.snapCnt=b+1,l.slotCnt=l.snapCnt/l.snapsPerSlot,l.isWeekStarts=function(e,t){let{slotDates:n,emphasizeWeeks:i}=e,r=null,l=[];for(let e of n){let n=t.computeWeekNumber(e),s=i&&null!==r&&r!==n;r=n,l.push(s)}return l}(l,t),l.cellRows=function(e,t){let n=e.slotDates,r=e.headerFormats,l=r.map(()=>[]),s=i.asCleanDays(e.slotDuration),a=7===s?"week":1===s?"day":null,o=r.map(e=>e.getLargestUnit?e.getLargestUnit():null);for(let s=0;s<n.length;s+=1){let c=n[s],d=e.isWeekStarts[s];for(let n=0;n<r.length;n+=1){let s=r[n],f=l[n],h=f[f.length-1],u=n===r.length-1,g=r.length>1&&!u,p=null,v=o[n]||(u?a:null);if(g){let e=t.format(c,s);h&&h.text===e?h.colspan+=1:p=m(c,e,v)}else if(!h||i.isInt(t.countDurationsBetween(e.normalizedRange.start,c,e.labelInterval))){let e=t.format(c,s);p=m(c,e,v)}else h.colspan+=1;p&&(p.weekStart=d,f.push(p))}}return l}(l,t),l.slotsPerLabel=i.wholeDivideDurations(l.labelInterval,l.slotDuration),l}function c(e,t,n){let r=e;return t.isTimeScale||(r=i.startOfDay(r),t.largeUnit&&(r=n.startOf(r,t.largeUnit))),r}function d(e,t,n,r){if(r.isHiddenDay(e))return!1;if(t.isTimeScale){let r=i.startOfDay(e),l=e.valueOf()-r.valueOf()-i.asRoughMs(n.slotMinTime);return l=(l%864e5+864e5)%864e5,l<t.timeWindowMs}return!0}function f(e,t,n){const{currentRange:r}=t;let{labelInterval:l}=e;if(!l){let t;if(e.slotDuration){for(t of a){const n=i.createDuration(t),r=i.wholeDivideDurations(n,e.slotDuration);if(null!==r&&r<=6){l=n;break}}l||(l=e.slotDuration)}else for(t of a){l=i.createDuration(t);if(n.countDurationsBetween(r.start,r.end,l)>=18)break}e.labelInterval=l}return l}function h(e,t,n){let r=t.currentRange,l=null;return"years"===e?l=n.diffWholeYears(r.start,r.end):"months"===e||"weeks"===e?l=n.diffWholeMonths(r.start,r.end):"days"===e&&(l=i.diffWholeDays(r.start,r.end)),l||0}function m(e,t,n){return{date:e,text:t,rowUnit:n,colspan:1,isWeekStart:!1}}class u extends i.BaseComponent{constructor(){super(...arguments),this.innerElRef=r.createRef()}render(){let{props:e,context:t}=this,{dateEnv:n,options:l,theme:s}=t,{date:a,tDateProfile:o,isEm:c}=e,d=i.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),f=Object.assign(Object.assign({date:n.toDate(e.date)},d),{view:t.viewApi});return r.createElement(i.ContentContainer,{elTag:"div",elClasses:["fc-flex-column","fc-align-start","fc-cell","fc-timeline-slot","fc-timeline-slot-lane",c?"fc-timeline-slot-em":"",o.isTimeScale?i.isInt(n.countDurationsBetween(o.normalizedRange.start,e.date,o.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor":"",...e.isDay?i.getDayClassNames(d,s):i.getSlotClassNames(d,s)],elAttrs:{"data-date":n.formatIso(a,{omitTimeZoneOffset:!0,omitTime:!o.isTimeScale})},elStyle:{width:e.width},renderProps:f,generatorName:"slotLaneContent",customGenerator:l.slotLaneContent,classNameGenerator:l.slotLaneClassNames,didMount:l.slotLaneDidMount,willUnmount:l.slotLaneWillUnmount},e=>r.createElement("div",{ref:this.innerElRef,className:"fc-flex-column"},r.createElement(e,{elTag:"div",elClasses:["fc-cell-inner"]})))}componentDidMount(){const e=this.innerElRef.current;this.detachWidth=i.watchWidth(e,e=>{i.setRef(this.props.innerWidthRef,e)})}componentWillUnmount(){this.detachWidth()}}class g extends i.BaseComponent{constructor(){super(...arguments),this.innerWidthRefMap=new i.RefMap(()=>{i.afterSize(this.handleInnerWidths)}),this.handleInnerWidths=()=>{const e=this.innerWidthRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);i.setRef(this.props.innerWidthRef,t)}}render(){let{props:e,innerWidthRefMap:t}=this,{tDateProfile:n,slotWidth:i}=e,{slotDates:l,isWeekStarts:s}=n,a=!n.isTimeScale&&!n.largeUnit;return r.createElement("div",{className:"fc-timeline-slots fc-fill fc-flex-row"},l.map((l,o)=>{let c=l.toISOString();return r.createElement(u,{key:c,date:l,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:s[o],isDay:a,innerWidthRef:t.createRef(c),width:i})}))}}function p(e,t,n){let r=n.countDurationsBetween(t.normalizedRange.start,e,t.snapDuration);if(r<0)return 0;if(r>=t.snapDiffToIndex.length)return t.snapCnt;let l=Math.floor(r),s=t.snapDiffToIndex[l];return i.isInt(s)?s+=r-l:s=Math.ceil(s),s}function v(e,t){return e?t?{right:e.start,width:e.size}:{left:e.start,width:e.size}:{}}function S(e,t){return t?{right:e}:{left:e}}function R(e,t,n,i,r){if(null==i||null==r)return[void 0,void 0,!1];const l=r/e;let s,a;return l>=(n=Math.max(n||0,(i+1)/t,30))?(s=!0,a=l):(s=!1,a=Math.max(n,l)),[a*e,a,s]}function D(e,t,n,r,l){let s=t.add(n.activeRange.start,e);return r.isTimeScale||(s=i.startOfDay(s)),y(s,t,r,l)}function y(e,t,n,r){return function(e,t,n){let r=n.countDurationsBetween(t.normalizedRange.start,e,t.snapDuration);if(r<0)return 0;if(r>=t.snapDiffToIndex.length)return t.snapCnt;let l=Math.floor(r),s=t.snapDiffToIndex[l];i.isInt(s)?s+=r-l:s=Math.ceil(s);return s}(e,n,t)/n.snapsPerSlot*r}function w(e,t,n,i,r){const l={};for(const s of e)l[s.eventRange.instance.instanceId]=b(s,t,n,i,r);return l}function b(e,t,n,i,r){const l=y(e.start,n,i,r);let s=y(e.end,n,i,r)-l;return t&&(s=Math.max(s,t)),{start:l,size:s}}function x(e,t,n){let i=0;for(const r of e){const{instanceId:e}=r.eventRange.instance,l=t[e],s=n.get(e);null!=l&&null!=s&&(i=Math.max(i,l+s))}return i}class W extends i.BaseComponent{render(){let{props:e}=this,t=[].concat(e.eventResizeSegs,e.dateSelectionSegs);return r.createElement("div",{className:"fc-timeline-bg"},this.renderSegs(e.businessHourSegs||[],"non-business"),this.renderSegs(e.bgEventSegs||[],"bg-event"),this.renderSegs(t,"highlight"))}renderSegs(e,t){let{tDateProfile:n,todayRange:l,nowDate:s,slotWidth:a}=this.props,{dateEnv:o,isRtl:c}=this.context;return r.createElement(r.Fragment,null,e.map(e=>{let d;if(null!=a){d=v(b(e,void 0,o,n,a),c)}return r.createElement("div",{key:i.buildEventRangeKey(e.eventRange),className:"fc-timeline-bg-harness",style:d},"bg-event"===t?r.createElement(i.BgEvent,Object.assign({seg:e},i.getSegMeta(e,l,s))):i.renderFill(t))}))}}class E extends i.Slicer{sliceRange(e,t,n,r,l){let s=function(e,t,n){if(!t.isTimeScale&&(e=i.computeVisibleDayRange(e),t.largeUnit)){let i=e;((e={start:n.startOf(e.start,t.largeUnit),end:n.startOf(e.end,t.largeUnit)}).end.valueOf()!==i.end.valueOf()||e.end<=e.start)&&(e={start:e.start,end:n.add(e.end,t.slotDuration)})}return e}(e,r,l),a=[];if(p(s.start,r,l)<p(s.end,r,l)){let e=i.intersectRanges(s,r.normalizedRange);e&&a.push({start:e.start,end:e.end,isStart:e.start.valueOf()===s.start.valueOf()&&d(e.start,r,t,n),isEnd:e.end.valueOf()===s.end.valueOf()&&d(i.addMs(e.end,-1),r,t,n)})}return a}}const M=i.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});class k extends i.BaseComponent{render(){let{props:e,context:t}=this,{options:n}=t;return r.createElement(i.StandardEvent,Object.assign({},e,{elClasses:["fc-timeline-event","fc-h-event",!1===n.eventOverlap?"fc-timeline-event-spacious":""],defaultTimeFormat:M,defaultDisplayEventTime:!e.isTimeScale}))}}class I extends i.BaseComponent{render(){let{props:e}=this,{hiddenSegs:t,resourceId:n,forcedInvisibleMap:l}=e,s=n?{resourceId:n}:{};return r.createElement(i.MoreLinkContainer,{elClasses:["fc-timeline-more-link"],allDayDate:null,segs:t,hiddenSegs:t,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:s,popoverContent:()=>r.createElement(r.Fragment,null,t.map(t=>{let n=t.eventRange.instance.instanceId;return r.createElement("div",{key:n,style:{visibility:l[n]?"hidden":""}},r.createElement(k,Object.assign({isTimeScale:e.isTimeScale,seg:t,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:n===e.eventSelection},i.getSegMeta(t,e.todayRange,e.nowDate))))}))},e=>r.createElement(e,{elTag:"div",elClasses:["fc-timeline-more-link-inner","fc-sticky-x"]}))}}class C extends r.Component{constructor(){super(...arguments),this.rootElRef=r.createRef()}render(){const{props:e}=this;return r.createElement("div",{className:"fc-abs",style:e.style,ref:this.rootElRef},e.children)}componentDidMount(){const e=this.rootElRef.current;this.detachHeight=i.watchHeight(e,e=>{i.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.detachHeight()}}class T extends i.BaseComponent{constructor(){super(...arguments),this.sortEventSegs=i.memoize(i.sortEventSegs),this.segHeightRefMap=new i.RefMap(()=>{i.afterSize(this.handleSegHeights)}),this.moreLinkHeightRefMap=new i.RefMap(()=>{i.afterSize(this.handleMoreLinkHeights)}),this.slicer=new E,this.handleMoreLinkHeights=()=>{this.setState({moreLinkHeightRev:this.moreLinkHeightRefMap.rev})},this.handleSegHeights=()=>{this.setState({segHeightRev:this.segHeightRefMap.rev})}}render(){let{props:e,context:t,segHeightRefMap:n}=this,{options:l}=t,{dateProfile:s,tDateProfile:a}=e,o=this.slicer.sliceProps(e,s,a.isTimeScale?null:e.nextDayThreshold,t,s,t.dateProfileGenerator,a,t.dateEnv),c=(o.eventDrag?o.eventDrag.segs:null)||(o.eventResize?o.eventResize.segs:null)||[],d=this.sortEventSegs(o.fgEventSegs,l.eventOrder),f=null!=e.slotWidth?w(d,l.eventMinWidth,t.dateEnv,a,e.slotWidth):{},[h,m,u,g]=function(e,t,n,r,l){let s=[];for(let i=0;i<e.length;i+=1){let r=e[i],l=r.eventRange.instance.instanceId,a=n.get(l),o=t[l];null!=a&&null!=o&&s.push({index:i,seg:r,span:{start:o.start,end:o.start+o.size},thickness:a})}let a=new i.SegHierarchy;null!=r&&(a.strictOrder=r),null!=l&&(a.maxStackCnt=l);let o=a.addSegs(s),c=i.groupIntersectingEntries(o),d=c.map((t,n)=>({index:e.length+n,segGroup:t,span:t.span,thickness:1}));a.maxStackCnt=-1,a.addSegs(d);let f=a.toRects(),h={},m={};for(let e of f){const{seg:t,segGroup:n}=e;t?h[t.eventRange.instance.instanceId]=e.levelCoord:m[n.key]=e.levelCoord}return[h,x(e,h,n),c,m]}(d,f,n.current,l.eventOrderStrict,l.eventMaxStack),p=function(e,t,n){let i=0;for(const r of e){const e=t[r.key],l=n.get(r.key);null!=e&&null!=l&&(i=Math.max(i,e+l))}return i}(u,g,this.moreLinkHeightRefMap.current),v=Math.max(p,m),S=(o.eventDrag?o.eventDrag.affectedInstances:null)||(o.eventResize?o.eventResize.affectedInstances:null)||{};return r.createElement(r.Fragment,null,r.createElement(W,{tDateProfile:a,nowDate:e.nowDate,todayRange:e.todayRange,bgEventSegs:o.bgEventSegs,businessHourSegs:o.businessHourSegs,dateSelectionSegs:o.dateSelectionSegs,eventResizeSegs:o.eventResize?o.eventResize.segs:[],slotWidth:e.slotWidth}),r.createElement("div",{className:["fc-timeline-events","fc-content-box",!1===l.eventOverlap?"fc-timeline-events-overlap-disabled":"fc-timeline-events-overlap-enabled"].join(" "),style:{height:v}},this.renderFgSegs(d,f,h,S,u,g,!1,!1,!1),this.renderFgSegs(c,e.slotWidth?w(c,l.eventMinWidth,t.dateEnv,a,e.slotWidth):{},h,{},[],{},Boolean(o.eventDrag),Boolean(o.eventResize),!1)))}renderFgSegs(e,t,n,l,s,a,o,c,d){let{props:f,context:h,segHeightRefMap:m,moreLinkHeightRefMap:u}=this,g=o||c||d;return r.createElement(r.Fragment,null,e.map(e=>{const{instanceId:s}=e.eventRange.instance,a=n[s],u=t[s],p=g||u&&null!=a&&!l[s];return r.createElement(C,{key:s,style:Object.assign({visibility:p?"":"hidden",top:a||0},v(u,h.isRtl)),heightRef:g?void 0:m.createRef(s)},r.createElement(k,Object.assign({isTimeScale:f.tDateProfile.isTimeScale,seg:e,isDragging:o,isResizing:c,isDateSelecting:d,isSelected:s===f.eventSelection},i.getSegMeta(e,f.todayRange,f.nowDate))))}),s.map(e=>r.createElement(C,{key:e.key,style:Object.assign({top:a[e.key]||0},v({start:e.span.start,size:e.span.end-e.span.start},h.isRtl)),heightRef:u.createRef(e.key)},r.createElement(I,{hiddenSegs:e.segs,dateProfile:f.dateProfile,nowDate:f.nowDate,todayRange:f.todayRange,isTimeScale:f.tDateProfile.isTimeScale,eventSelection:f.eventSelection,resourceId:f.resourceId,forcedInvisibleMap:l}))))}}class P extends i.BaseComponent{constructor(){super(...arguments),this.refineRenderProps=i.memoizeObjArg(H),this.buildCellNavLinkAttrs=i.memoize(z),this.innerElRef=r.createRef()}render(){let{props:e,context:t}=this,{dateEnv:n,options:l}=t,{cell:s,dateProfile:a,tDateProfile:o}=e,c=i.getDateMeta(s.date,e.todayRange,e.nowDate,a),d=this.refineRenderProps({level:e.rowLevel,dateMarker:s.date,text:s.text,dateEnv:t.dateEnv,viewApi:t.viewApi});return r.createElement(i.ContentContainer,{elTag:"div",elClasses:["fc-timeline-slot-label","fc-timeline-slot",s.isWeekStart?"fc-timeline-slot-em":"","fc-header-cell","fc-cell","fc-flex-column","fc-justify-center",e.isCentered?"fc-align-center":"fc-align-start",..."time"===s.rowUnit?i.getSlotClassNames(c,t.theme):i.getDayClassNames(c,t.theme)],elAttrs:{"data-date":n.formatIso(s.date,{omitTime:!o.isTimeScale,omitTimeZoneOffset:!0})},elStyle:{width:null!=e.slotWidth?e.slotWidth*s.colspan:void 0},renderProps:d,generatorName:"slotLabelContent",customGenerator:l.slotLabelContent,defaultGenerator:L,classNameGenerator:l.slotLabelClassNames,didMount:l.slotLabelDidMount,willUnmount:l.slotLabelWillUnmount},n=>r.createElement("div",{ref:this.innerElRef,className:["fc-flex-column",e.isSticky?"fc-sticky-x":""].join(" ")},r.createElement(n,{elTag:"a",elClasses:["fc-cell-inner","fc-padding-md"],elAttrs:this.buildCellNavLinkAttrs(t,s.date,s.rowUnit)})))}componentDidMount(){const{props:e}=this,t=this.innerElRef.current;this.detachSize=i.watchSize(t,(n,r)=>{i.setRef(e.innerWidthRef,n),i.setRef(e.innerHeightRef,r),t.style.left=t.style.right=e.isCentered&&e.isSticky?`calc(50% - ${n/2}px)`:""})}componentWillUnmount(){this.detachSize()}}function z(e,t,n){return n&&"time"!==n?i.buildNavLinkAttrs(e,t,n):{}}function L(e){return e.text}function H(e){return{level:e.level,date:e.dateEnv.toDate(e.dateMarker),view:e.viewApi,text:e.text}}class N extends i.BaseComponent{constructor(){super(...arguments),this.innerWidthRefMap=new i.RefMap(()=>{i.afterSize(this.handleInnerWidths)}),this.innerHeightRefMap=new i.RefMap(()=>{i.afterSize(this.handleInnerHeights)}),this.handleInnerWidths=()=>{const e=this.innerWidthRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);i.setRef(this.props.innerWidthRef,t)},this.handleInnerHeights=()=>{const e=this.innerHeightRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);i.setRef(this.props.innerHeighRef,t)}}render(){const{props:e,innerWidthRefMap:t,innerHeightRefMap:n}=this,i=!(e.tDateProfile.isTimeScale&&e.isLastRow),l=!e.isLastRow;return r.createElement("div",{className:"fc-row",style:{height:e.height}},e.cells.map(s=>{const a=s.rowUnit+":"+s.date.toISOString();return r.createElement(P,{key:a,cell:s,rowLevel:e.rowLevel,dateProfile:e.dateProfile,tDateProfile:e.tDateProfile,todayRange:e.todayRange,nowDate:e.nowDate,isCentered:i,isSticky:l,innerWidthRef:t.createRef(a),innerHeightRef:n.createRef(a),slotWidth:e.slotWidth})}))}}class O extends i.BaseComponent{render(){const{props:e,context:t}=this;return r.createElement("div",{className:"fc-timeline-now-indicator-container"},r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timeline-now-indicator-line"],elStyle:null!=e.slotWidth?S(y(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!1,date:e.nowDate}))}}class B extends i.BaseComponent{render(){const{props:e,context:t}=this;return r.createElement("div",{className:"fc-timeline-now-indicator-container"},r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timeline-now-indicator-arrow"],elStyle:null!=e.slotWidth?S(y(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!0,date:e.nowDate}))}}class U extends i.DateComponent{constructor(){super(...arguments),this.buildTimelineDateProfile=i.memoize(o),this.computeSlotWidth=i.memoize(R),this.headerScrollerRef=r.createRef(),this.bodyScrollerRef=r.createRef(),this.footerScrollerRef=r.createRef(),this.handleHeaderSlotInnerWidth=e=>{this.headerSlotInnerWidth=e,i.afterSize(this.handleSlotInnerWidths)},this.handleBodySlotInnerWidth=e=>{this.bodySlotInnerWidth=e,i.afterSize(this.handleSlotInnerWidths)},this.handleSlotInnerWidths=()=>{const{state:e}=this,t=Math.max(this.headerSlotInnerWidth,this.bodySlotInnerWidth);e.slotInnerWidth!==t&&this.setState({slotInnerWidth:t})},this.handleScrollerWidth=e=>{this.setState({scrollerWidth:e})},this.handleLeftScrollbarWidth=e=>{this.setState({leftScrollbarWidth:e})},this.handleRightScrollbarWidth=e=>{this.setState({rightScrollbarWidth:e})},this.timeScrollResponder=new i.ScrollResponder(e=>{const{props:t,context:n,tDateProfile:i,slotWidth:r}=this;if(null!=r){const l=D(e,n.dateEnv,t.dateProfile,i,r)+(n.isRtl?-1:1);return this.syncedScroller.scrollTo({x:l}),!0}return!1}),this.handeBodyEl=e=>{this.bodyEl=e,e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){const{props:e,state:t,context:n}=this,{options:l}=n,s=this.tDateProfile=this.buildTimelineDateProfile(e.dateProfile,n.dateEnv,l,n.dateProfileGenerator),{cellRows:a}=s,o=i.greatestDurationDenominator(s.slotDuration).unit,c=!e.forPrint&&!i.getIsHeightAuto(l),d=!e.forPrint&&i.getStickyHeaderDates(l),f=!e.forPrint&&i.getStickyFooterScrollbar(l),[h,m]=this.computeSlotWidth(s.slotCnt,s.slotsPerLabel,l.slotMinWidth,t.slotInnerWidth,t.scrollerWidth);return this.slotWidth=m,r.createElement(i.NowTimer,{unit:o},(o,u)=>{const p=l.nowIndicator&&null!=m&&i.rangeContainsMarker(e.dateProfile.currentRange,o);return r.createElement(i.ViewContainer,{viewSpec:n.viewSpec,elClasses:["fc-timeline-view","fc-flex-column","fc-border"]},r.createElement(i.Scroller,{horizontal:!0,hideScrollbars:!0,elClassNames:["fc-timeline-header","fc-rowgroup",d?"fc-sticky-header":""],ref:this.headerScrollerRef},r.createElement("div",{className:"fc-rel fc-content-box",style:{width:h,paddingLeft:t.leftScrollbarWidth,paddingRight:t.rightScrollbarWidth}},r.createElement("div",null,a.map((t,n)=>{const i=n===a.length-1;return r.createElement(N,{key:n,dateProfile:e.dateProfile,tDateProfile:s,nowDate:o,todayRange:u,rowLevel:n,isLastRow:i,cells:t,slotWidth:m,innerWidthRef:i?this.handleHeaderSlotInnerWidth:void 0})})),p&&r.createElement(B,{tDateProfile:s,nowDate:o,slotWidth:m}))),r.createElement(i.Scroller,{vertical:c,horizontal:!0,elClassNames:["fc-timeline-body","fc-rowgroup",c?"fc-liquid":""],ref:this.bodyScrollerRef,widthRef:this.handleScrollerWidth,leftScrollbarWidthRef:this.handleLeftScrollbarWidth,rightScrollbarWidthRef:this.handleRightScrollbarWidth},r.createElement("div",{className:"fc-rel fc-grow",style:{width:h},ref:this.handeBodyEl},r.createElement(g,{dateProfile:e.dateProfile,tDateProfile:s,nowDate:o,todayRange:u,innerWidthRef:this.handleBodySlotInnerWidth,slotWidth:m}),r.createElement(T,{dateProfile:e.dateProfile,tDateProfile:s,nowDate:o,todayRange:u,nextDayThreshold:l.nextDayThreshold,eventStore:e.eventStore,eventUiBases:e.eventUiBases,businessHours:e.businessHours,dateSelection:e.dateSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,slotWidth:m}),p&&r.createElement(O,{tDateProfile:s,nowDate:o,slotWidth:m}))),f&&r.createElement(i.Scroller,{ref:this.footerScrollerRef,horizontal:!0},r.createElement("div",{style:{width:h}})))})}componentDidMount(){const{context:e}=this,{options:t}=e,n=i.getScrollerSyncerClass(this.context.pluginHooks);this.syncedScroller=new n(!0),this.updateSyncedScroller(),e.emitter.on("_timeScrollRequest",this.timeScrollResponder.handleScroll),this.timeScrollResponder.handleScroll(t.scrollTime)}componentDidUpdate(e){const{options:t}=this.context;this.updateSyncedScroller(),e.dateProfile!==this.props.dateProfile&&t.scrollTimeReset?this.timeScrollResponder.handleScroll(t.scrollTime):this.timeScrollResponder.drain()}componentWillUnmount(){this.syncedScroller.destroy(),this.context.emitter.off("_timeScrollRequest",this.timeScrollResponder.handleScroll)}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current],this.context.isRtl)}queryHit(e,t,n,r){const{props:l,context:s,tDateProfile:a,slotWidth:o}=this,{dateEnv:c}=s;if(o){const t=s.isRtl?n-e:e,d=Math.floor(t/o),f=(t-d*o)/o,h=Math.floor(f*a.snapsPerSlot);let m,u,g=c.add(a.slotDates[d],i.multiplyDuration(a.snapDuration,h)),p=c.add(g,a.snapDuration),v=o/a.snapsPerSlot,S=d*o+v*h,R=S+v;return s.isRtl?(m=n-R,u=n-S):(m=S,u=R),{dateProfile:l.dateProfile,dateSpan:{range:{start:g,end:p},allDay:!a.isTimeScale},rect:{left:m,right:u,top:0,bottom:r},dayEl:this.bodyEl.querySelectorAll(".fc-timeline-slot")[d],layer:0}}return null}}i.injectStyles('.fc-timeline-slots{z-index:1}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow,.fc-timeline-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;pointer-events:none;position:absolute;top:0}.fc-timeline-now-indicator-arrow{border-left-color:transparent;border-right-color:transparent;border-width:6px 5px 0;margin:0 -5px}.fc-timeline-now-indicator-line{border-width:0 0 0 1px;bottom:0}.fc-timeline-events{z-index:3}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px;z-index:1}.fc-timeline-event.fc-event-mirror{z-index:2}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event-spacious{margin-bottom:0;padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:"";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-bg{bottom:0;left:0;position:absolute;right:0;top:0;z-index:2}.fc-timeline-bg .fc-non-business{z-index:1}.fc-timeline-bg .fc-bg-event{z-index:2}.fc-timeline-bg .fc-highlight{z-index:3}.fc-timeline-bg-harness{bottom:0;position:absolute;top:0}');var A=t.createPlugin({name:"@fullcalendar/timeline",premiumReleaseDate:"2024-10-01",deps:[s.default],initialView:"timelineDay",views:{timeline:{component:U,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}}}}),F={__proto__:null,TimelineView:U,TimelineLane:T,TimelineLaneBg:W,TimelineSlats:g,buildTimelineDateProfile:o,createVerticalStyle:function(e){if(e)return{top:e.start,height:e.size}},createHorizontalStyle:function(e,t){if(e)return{[t?"right":"left"]:e.start,width:e.size}},computeSlotWidth:R,timeToCoord:D,coordToCss:function(e,t){return null===e?{left:"",right:""}:t?{right:e,left:""}:{left:e,right:""}},coordsToCss:function(e,t){return e?t?{right:e.start,left:-e.end}:{left:e.start,right:-e.end}:{left:"",right:""}},TimelineLaneSlicer:E,TimelineHeaderRow:N,TimelineNowIndicatorArrow:B,TimelineNowIndicatorLine:O};return t.globalPlugins.push(A),e.Internal=F,e.default=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal,FullCalendar.Preact);
6
+ FullCalendar.Timeline=function(e,t,n,i,r,l){"use strict";function s(e){return e&&e.__esModule?e:{default:e}}var a=s(n);i.config.MAX_TIMELINE_SLOTS=1e3;const o=[{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,t,n,r){let l={labelInterval:n.slotLabelInterval,slotDuration:n.slotDuration};!function(e,t,n){const{currentRange:r}=t;if(e.labelInterval){n.countDurationsBetween(r.start,r.end,e.labelInterval)>i.config.MAX_TIMELINE_SLOTS&&(console.warn("slotLabelInterval results in too many cells"),e.labelInterval=null)}if(e.slotDuration){n.countDurationsBetween(r.start,r.end,e.slotDuration)>i.config.MAX_TIMELINE_SLOTS&&(console.warn("slotDuration results in too many cells"),e.slotDuration=null)}if(e.labelInterval&&e.slotDuration){const t=i.wholeDivideDurations(e.labelInterval,e.slotDuration);(null===t||t<1)&&(console.warn("slotLabelInterval must be a multiple of slotDuration"),e.slotDuration=null)}}(l,e,t),h(l,e,t),function(e,t,n){const{currentRange:r}=t;let{slotDuration:l}=e;if(!l){const s=h(e,t,n);for(let e of o){const t=i.createDuration(e),n=i.wholeDivideDurations(s,t);if(null!==n&&n>1&&n<=6){l=t;break}}if(l){n.countDurationsBetween(r.start,r.end,l)>200&&(l=null)}l||(l=s),e.slotDuration=l}}(l,e,t);let s=n.slotLabelFormat,a=Array.isArray(s)?s:null!=s?[s]:function(e,t,n,r){let l,s;const{labelInterval:a}=e;let o=i.greatestDurationDenominator(a).unit;const c=r.weekNumbers;let d=l=s=null;"week"!==o||c||(o="day");switch(o){case"year":d={year:"numeric"};break;case"month":m("years",t,n)>1&&(d={year:"numeric"}),l={month:"short"};break;case"week":m("years",t,n)>1&&(d={year:"numeric"}),l={week:"narrow"};break;case"day":m("years",t,n)>1?d={year:"numeric",month:"long"}:m("months",t,n)>1&&(d={month:"long"}),c&&(l={week:"short"}),s={weekday:"narrow",day:"numeric"};break;case"hour":c&&(d={week:"short"}),m("days",t,n)>1&&(l={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),s={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":i.asRoughMinutes(a)/60>=6?(d={hour:"numeric",meridiem:"short"},l=e=>":"+i.padStart(e.date.minute,2)):d={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":i.asRoughSeconds(a)/60>=6?(d={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},l=e=>":"+i.padStart(e.date.second,2)):d={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"};break;case"millisecond":d={hour:"numeric",minute:"2-digit",second:"2-digit",meridiem:"lowercase"},l=e=>"."+i.padStart(e.millisecond,3)}return[].concat(d||[],l||[],s||[])}(l,e,t,n);l.headerFormats=a.map(e=>i.createFormatter(e)),l.isTimeScale=Boolean(l.slotDuration.milliseconds);let c=null;if(!l.isTimeScale){const e=i.greatestDurationDenominator(l.slotDuration).unit;/year|month|week/.test(e)&&(c=e)}l.largeUnit=c,l.emphasizeWeeks=1===i.asCleanDays(l.slotDuration)&&m("weeks",e,t)>=2&&!n.businessHours;let g,p,v=n.snapDuration;v&&(g=i.createDuration(v),p=i.wholeDivideDurations(l.slotDuration,g)),null==p&&(g=l.slotDuration,p=1),l.snapDuration=g,l.snapsPerSlot=p;let S=i.asRoughMs(e.slotMaxTime)-i.asRoughMs(e.slotMinTime),R=d(e.renderRange.start,l,t),D=d(e.renderRange.end,l,t);l.isTimeScale&&(R=t.add(R,e.slotMinTime),D=t.add(i.addDays(D,-1),e.slotMaxTime)),l.timeWindowMs=S,l.normalizedRange={start:R,end:D};let y=[],w=R;for(;w<D;)f(w,l,e,r)&&y.push(w),w=t.add(w,l.slotDuration);l.slotDates=y;let b=-1,x=0;const E=[],W=[];for(w=R;w<D;)f(w,l,e,r)?(b+=1,E.push(b),W.push(x)):E.push(b+.5),w=t.add(w,l.snapDuration),x+=1;return l.snapDiffToIndex=E,l.snapIndexToDiff=W,l.snapCnt=b+1,l.slotCnt=l.snapCnt/l.snapsPerSlot,l.isWeekStarts=function(e,t){let{slotDates:n,emphasizeWeeks:i}=e,r=null,l=[];for(let e of n){let n=t.computeWeekNumber(e),s=i&&null!==r&&r!==n;r=n,l.push(s)}return l}(l,t),l.cellRows=function(e,t){let n=e.slotDates,r=e.headerFormats,l=r.map(()=>[]),s=i.asCleanDays(e.slotDuration),a=7===s?"week":1===s?"day":null,o=r.map(e=>e.getLargestUnit?e.getLargestUnit():null);for(let s=0;s<n.length;s+=1){let c=n[s],d=e.isWeekStarts[s];for(let n=0;n<r.length;n+=1){let s=r[n],f=l[n],h=f[f.length-1],m=n===r.length-1,g=r.length>1&&!m,p=null,v=o[n]||(m?a:null);if(g){let e=t.format(c,s);h&&h.text===e?h.colspan+=1:p=u(c,e,v)}else if(!h||i.isInt(t.countDurationsBetween(e.normalizedRange.start,c,e.labelInterval))){let e=t.format(c,s);p=u(c,e,v)}else h.colspan+=1;p&&(p.weekStart=d,f.push(p))}}return l}(l,t),l.slotsPerLabel=i.wholeDivideDurations(l.labelInterval,l.slotDuration),l}function d(e,t,n){let r=e;return t.isTimeScale||(r=i.startOfDay(r),t.largeUnit&&(r=n.startOf(r,t.largeUnit))),r}function f(e,t,n,r){if(r.isHiddenDay(e))return!1;if(t.isTimeScale){let r=i.startOfDay(e),l=e.valueOf()-r.valueOf()-i.asRoughMs(n.slotMinTime);return l=(l%864e5+864e5)%864e5,l<t.timeWindowMs}return!0}function h(e,t,n){const{currentRange:r}=t;let{labelInterval:l}=e;if(!l){let t;if(e.slotDuration){for(t of o){const n=i.createDuration(t),r=i.wholeDivideDurations(n,e.slotDuration);if(null!==r&&r<=6){l=n;break}}l||(l=e.slotDuration)}else for(t of o){l=i.createDuration(t);if(n.countDurationsBetween(r.start,r.end,l)>=18)break}e.labelInterval=l}return l}function m(e,t,n){let r=t.currentRange,l=null;return"years"===e?l=n.diffWholeYears(r.start,r.end):"months"===e||"weeks"===e?l=n.diffWholeMonths(r.start,r.end):"days"===e&&(l=i.diffWholeDays(r.start,r.end)),l||0}function u(e,t,n){return{date:e,text:t,rowUnit:n,colspan:1,isWeekStart:!1}}class g extends i.BaseComponent{constructor(){super(...arguments),this.innerElRef=r.createRef()}render(){let{props:e,context:t}=this,{dateEnv:n,options:l,theme:s}=t,{date:a,tDateProfile:o,isEm:c}=e,d=i.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),f=Object.assign(Object.assign({date:n.toDate(e.date)},d),{view:t.viewApi});return r.createElement(i.ContentContainer,{elTag:"div",elClasses:["fc-flex-column","fc-align-start","fc-cell","fc-timeline-slot","fc-timeline-slot-lane",c?"fc-timeline-slot-em":"",o.isTimeScale?i.isInt(n.countDurationsBetween(o.normalizedRange.start,e.date,o.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor":"",...e.isDay?i.getDayClassNames(d,s):i.getSlotClassNames(d,s)],elAttrs:{"data-date":n.formatIso(a,{omitTimeZoneOffset:!0,omitTime:!o.isTimeScale})},elStyle:{width:e.width},renderProps:f,generatorName:"slotLaneContent",customGenerator:l.slotLaneContent,classNameGenerator:l.slotLaneClassNames,didMount:l.slotLaneDidMount,willUnmount:l.slotLaneWillUnmount},e=>r.createElement("div",{ref:this.innerElRef,className:"fc-flex-column"},r.createElement(e,{elTag:"div",elClasses:["fc-cell-inner"]})))}componentDidMount(){const e=this.innerElRef.current;this.detachWidth=i.watchWidth(e,e=>{i.setRef(this.props.innerWidthRef,e)})}componentWillUnmount(){this.detachWidth(),i.setRef(this.props.innerWidthRef,null)}}class p extends i.BaseComponent{constructor(){super(...arguments),this.innerWidthRefMap=new i.RefMap(()=>{i.afterSize(this.handleInnerWidths)}),this.handleInnerWidths=()=>{const e=this.innerWidthRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);i.setRef(this.props.innerWidthRef,t)}}render(){let{props:e,innerWidthRefMap:t}=this,{tDateProfile:n,slotWidth:i}=e,{slotDates:l,isWeekStarts:s}=n,a=!n.isTimeScale&&!n.largeUnit;return r.createElement("div",{className:"fc-timeline-slots fc-fill fc-flex-row"},l.map((l,o)=>{let c=l.toISOString();return r.createElement(g,{key:c,date:l,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:s[o],isDay:a,innerWidthRef:t.createRef(c),width:i})}))}}function v(e,t,n){let r=n.countDurationsBetween(t.normalizedRange.start,e,t.snapDuration);if(r<0)return 0;if(r>=t.snapDiffToIndex.length)return t.snapCnt;let l=Math.floor(r),s=t.snapDiffToIndex[l];return i.isInt(s)?s+=r-l:s=Math.ceil(s),s}function S(e,t){return e?t?{right:e.start,width:e.size}:{left:e.start,width:e.size}:{}}function R(e,t){return t?{right:e}:{left:e}}function D(e,t,n,i,r){if(null==i||null==r)return[void 0,void 0,!1];const l=r/e;let s,a;return l>=(n=Math.max(n||0,(i+1)/t,30))?(s=!0,a=l):(s=!1,a=Math.max(n,l)),[a*e,a,s]}function y(e,t,n,r,l){let s=t.add(n.activeRange.start,e);return r.isTimeScale||(s=i.startOfDay(s)),w(s,t,r,l)}function w(e,t,n,r){return function(e,t,n){let r=n.countDurationsBetween(t.normalizedRange.start,e,t.snapDuration);if(r<0)return 0;if(r>=t.snapDiffToIndex.length)return t.snapCnt;let l=Math.floor(r),s=t.snapDiffToIndex[l];i.isInt(s)?s+=r-l:s=Math.ceil(s);return s}(e,n,t)/n.snapsPerSlot*r}function b(e,t,n,i,r){const l={};for(const s of e)l[s.eventRange.instance.instanceId]=x(s,t,n,i,r);return l}function x(e,t,n,i,r){const l=w(e.start,n,i,r);let s=w(e.end,n,i,r)-l;return t&&(s=Math.max(s,t)),{start:l,size:s}}function E(e,t,n){let i=0;for(const r of e){const{instanceId:e}=r.eventRange.instance,l=t[e],s=n.get(e);null!=l&&null!=s&&(i=Math.max(i,l+s))}return i}class W extends i.BaseComponent{render(){let{props:e}=this,t=[].concat(e.eventResizeSegs,e.dateSelectionSegs);return r.createElement("div",{className:"fc-timeline-bg"},this.renderSegs(e.businessHourSegs||[],"non-business"),this.renderSegs(e.bgEventSegs||[],"bg-event"),this.renderSegs(t,"highlight"))}renderSegs(e,t){let{tDateProfile:n,todayRange:l,nowDate:s,slotWidth:a}=this.props,{dateEnv:o,isRtl:c}=this.context;return r.createElement(r.Fragment,null,e.map(e=>{let d;if(null!=a){d=S(x(e,void 0,o,n,a),c)}return r.createElement("div",{key:i.buildEventRangeKey(e.eventRange),className:"fc-timeline-bg-harness",style:d},"bg-event"===t?r.createElement(i.BgEvent,Object.assign({eventRange:e.eventRange,isStart:e.isStart,isEnd:e.isEnd},i.getEventRangeMeta(e.eventRange,l,s))):i.renderFill(t))}))}}class M extends i.Slicer{sliceRange(e,t,n,r,l){let s=function(e,t,n){if(!t.isTimeScale&&(e=i.computeVisibleDayRange(e),t.largeUnit)){let i=e;((e={start:n.startOf(e.start,t.largeUnit),end:n.startOf(e.end,t.largeUnit)}).end.valueOf()!==i.end.valueOf()||e.end<=e.start)&&(e={start:e.start,end:n.add(e.end,t.slotDuration)})}return e}(e,r,l),a=[];if(v(s.start,r,l)<v(s.end,r,l)){let e=i.intersectRanges(s,r.normalizedRange);e&&a.push({start:e.start,end:e.end,isStart:e.start.valueOf()===s.start.valueOf()&&f(e.start,r,t,n),isEnd:e.end.valueOf()===s.end.valueOf()&&f(i.addMs(e.end,-1),r,t,n)})}return a}}const k=i.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});class I extends i.BaseComponent{render(){let{props:e,context:t}=this,{options:n}=t;return r.createElement(i.StandardEvent,Object.assign({},e,{elClasses:["fc-timeline-event","fc-h-event",!1===n.eventOverlap?"fc-timeline-event-spacious":""],defaultTimeFormat:k,defaultDisplayEventTime:!e.isTimeScale}))}}class T extends i.BaseComponent{render(){let{props:e}=this,{hiddenSegs:t,resourceId:n,forcedInvisibleMap:l}=e,s=n?{resourceId:n}:{};return r.createElement(i.MoreLinkContainer,{elClasses:["fc-timeline-more-link"],allDayDate:null,segs:t,hiddenSegs:t,dateProfile:e.dateProfile,todayRange:e.todayRange,extraDateSpan:s,popoverContent:()=>r.createElement(r.Fragment,null,t.map(t=>{let{eventRange:n}=t,s=n.instance.instanceId;return r.createElement("div",{key:s,style:{visibility:l[s]?"hidden":""}},r.createElement(I,Object.assign({isTimeScale:e.isTimeScale,eventRange:n,isStart:t.isStart,isEnd:t.isEnd,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:s===e.eventSelection},i.getEventRangeMeta(n,e.todayRange,e.nowDate))))}))},e=>r.createElement(e,{elTag:"div",elClasses:["fc-timeline-more-link-inner","fc-sticky-x"]}))}}class C extends r.Component{constructor(){super(...arguments),this.rootElRef=r.createRef()}render(){const{props:e}=this;return r.createElement("div",{className:"fc-abs",style:e.style,ref:this.rootElRef},e.children)}componentDidMount(){const e=this.rootElRef.current;this.detachHeight=i.watchHeight(e,e=>{i.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.detachHeight(),i.setRef(this.props.heightRef,null)}}class P extends i.BaseComponent{constructor(){super(...arguments),this.sortEventSegs=i.memoize(i.sortEventSegs),this.segHeightRefMap=new i.RefMap(()=>{i.afterSize(this.handleSegHeights)}),this.moreLinkHeightRefMap=new i.RefMap(()=>{i.afterSize(this.handleMoreLinkHeights)}),this.slicer=new M,this.handleMoreLinkHeights=()=>{this.setState({moreLinkHeightRev:this.moreLinkHeightRefMap.rev})},this.handleSegHeights=()=>{this.setState({segHeightRev:this.segHeightRefMap.rev})}}render(){let{props:e,context:t,segHeightRefMap:n}=this,{options:l}=t,{dateProfile:s,tDateProfile:a}=e,o=this.slicer.sliceProps(e,s,a.isTimeScale?null:e.nextDayThreshold,t,s,t.dateProfileGenerator,a,t.dateEnv),c=(o.eventDrag?o.eventDrag.segs:null)||(o.eventResize?o.eventResize.segs:null)||[],d=this.sortEventSegs(o.fgEventSegs,l.eventOrder),f=null!=e.slotWidth?b(d,l.eventMinWidth,t.dateEnv,a,e.slotWidth):{},[h,m,u,g]=function(e,t,n,r,l){let s=[];for(let i=0;i<e.length;i+=1){let r=e[i],l=r.eventRange.instance.instanceId,a=n.get(l),o=t[l];null!=a&&null!=o&&s.push({index:i,seg:r,span:{start:o.start,end:o.start+o.size},thickness:a})}let a=new i.SegHierarchy;null!=r&&(a.strictOrder=r),null!=l&&(a.maxStackCnt=l);let o=a.addSegs(s),c=i.groupIntersectingEntries(o),d=c.map((t,n)=>({index:e.length+n,segGroup:t,span:t.span,thickness:1}));a.maxStackCnt=-1,a.addSegs(d);let f=a.toRects(),h={},m={};for(let e of f){const{seg:t,segGroup:n}=e;t?h[t.eventRange.instance.instanceId]=e.levelCoord:m[n.key]=e.levelCoord}return[h,E(e,h,n),c,m]}(d,f,n.current,l.eventOrderStrict,l.eventMaxStack),p=function(e,t,n){let i=0;for(const r of e){const e=t[r.key],l=n.get(r.key);null!=e&&null!=l&&(i=Math.max(i,e+l))}return i}(u,g,this.moreLinkHeightRefMap.current),v=Math.max(p,m),S=(o.eventDrag?o.eventDrag.affectedInstances:null)||(o.eventResize?o.eventResize.affectedInstances:null)||{};return r.createElement(r.Fragment,null,r.createElement(W,{tDateProfile:a,nowDate:e.nowDate,todayRange:e.todayRange,bgEventSegs:o.bgEventSegs,businessHourSegs:o.businessHourSegs,dateSelectionSegs:o.dateSelectionSegs,eventResizeSegs:o.eventResize?o.eventResize.segs:[],slotWidth:e.slotWidth}),r.createElement("div",{className:["fc-timeline-events","fc-content-box",!1===l.eventOverlap?"fc-timeline-events-overlap-disabled":"fc-timeline-events-overlap-enabled"].join(" "),style:{height:v}},this.renderFgSegs(d,f,h,S,u,g,!1,!1,!1),this.renderFgSegs(c,e.slotWidth?b(c,l.eventMinWidth,t.dateEnv,a,e.slotWidth):{},h,{},[],{},Boolean(o.eventDrag),Boolean(o.eventResize),!1)))}renderFgSegs(e,t,n,l,s,a,o,c,d){let{props:f,context:h,segHeightRefMap:m,moreLinkHeightRefMap:u}=this,g=o||c||d;return r.createElement(r.Fragment,null,e.map(e=>{const{eventRange:s}=e,{instanceId:a}=s.instance,u=n[a],p=t[a],v=g||p&&null!=u&&!l[a];return r.createElement(C,{key:a,style:Object.assign({visibility:v?"":"hidden",top:u||0},S(p,h.isRtl)),heightRef:g?void 0:m.createRef(a)},r.createElement(I,Object.assign({isTimeScale:f.tDateProfile.isTimeScale,eventRange:s,isStart:e.isStart,isEnd:e.isEnd,isDragging:o,isResizing:c,isDateSelecting:d,isSelected:a===f.eventSelection},i.getEventRangeMeta(s,f.todayRange,f.nowDate))))}),s.map(e=>r.createElement(C,{key:e.key,style:Object.assign({top:a[e.key]||0},S({start:e.span.start,size:e.span.end-e.span.start},h.isRtl)),heightRef:u.createRef(e.key)},r.createElement(T,{hiddenSegs:e.segs,dateProfile:f.dateProfile,nowDate:f.nowDate,todayRange:f.todayRange,isTimeScale:f.tDateProfile.isTimeScale,eventSelection:f.eventSelection,resourceId:f.resourceId,forcedInvisibleMap:l}))))}}class z extends i.BaseComponent{constructor(){super(...arguments),this.refineRenderProps=i.memoizeObjArg(N),this.buildCellNavLinkAttrs=i.memoize(L),this.innerElRef=r.createRef()}render(){let{props:e,context:t}=this,{dateEnv:n,options:l}=t,{cell:s,dateProfile:a,tDateProfile:o}=e,c=i.getDateMeta(s.date,e.todayRange,e.nowDate,a),d=this.refineRenderProps({level:e.rowLevel,dateMarker:s.date,text:s.text,dateEnv:t.dateEnv,viewApi:t.viewApi});return r.createElement(i.ContentContainer,{elTag:"div",elClasses:["fc-timeline-slot-label","fc-timeline-slot",s.isWeekStart?"fc-timeline-slot-em":"","fc-header-cell","fc-cell","fc-flex-column","fc-justify-center",e.isCentered?"fc-align-center":"fc-align-start",..."time"===s.rowUnit?i.getSlotClassNames(c,t.theme):i.getDayClassNames(c,t.theme)],elAttrs:{"data-date":n.formatIso(s.date,{omitTime:!o.isTimeScale,omitTimeZoneOffset:!0})},elStyle:{width:null!=e.slotWidth?e.slotWidth*s.colspan:void 0},renderProps:d,generatorName:"slotLabelContent",customGenerator:l.slotLabelContent,defaultGenerator:H,classNameGenerator:l.slotLabelClassNames,didMount:l.slotLabelDidMount,willUnmount:l.slotLabelWillUnmount},n=>r.createElement("div",{ref:this.innerElRef,className:["fc-flex-column",e.isSticky?"fc-sticky-x":""].join(" ")},r.createElement(n,{elTag:"a",elClasses:["fc-cell-inner","fc-padding-md"],elAttrs:this.buildCellNavLinkAttrs(t,s.date,s.rowUnit)})))}componentDidMount(){const{props:e}=this,t=this.innerElRef.current;this.detachSize=i.watchSize(t,(n,r)=>{i.setRef(e.innerWidthRef,n),i.setRef(e.innerHeightRef,r),t.style.left=t.style.right=e.isCentered&&e.isSticky?`calc(50% - ${n/2}px)`:""})}componentWillUnmount(){const{props:e}=this;this.detachSize(),i.setRef(e.innerWidthRef,null),i.setRef(e.innerHeightRef,null)}}function L(e,t,n){return n&&"time"!==n?i.buildNavLinkAttrs(e,t,n):{}}function H(e){return e.text}function N(e){return{level:e.level,date:e.dateEnv.toDate(e.dateMarker),view:e.viewApi,text:e.text}}class O extends i.BaseComponent{constructor(){super(...arguments),this.innerWidthRefMap=new i.RefMap(()=>{i.afterSize(this.handleInnerWidths)}),this.innerHeightRefMap=new i.RefMap(()=>{i.afterSize(this.handleInnerHeights)}),this.handleInnerWidths=()=>{const e=this.innerWidthRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);i.setRef(this.props.innerWidthRef,t)},this.handleInnerHeights=()=>{const e=this.innerHeightRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);i.setRef(this.props.innerHeighRef,t)}}render(){const{props:e,innerWidthRefMap:t,innerHeightRefMap:n}=this,i=!(e.tDateProfile.isTimeScale&&e.isLastRow),l=!e.isLastRow;return r.createElement("div",{className:"fc-row",style:{height:e.height}},e.cells.map(s=>{const a=s.rowUnit+":"+s.date.toISOString();return r.createElement(z,{key:a,cell:s,rowLevel:e.rowLevel,dateProfile:e.dateProfile,tDateProfile:e.tDateProfile,todayRange:e.todayRange,nowDate:e.nowDate,isCentered:i,isSticky:l,innerWidthRef:t.createRef(a),innerHeightRef:n.createRef(a),slotWidth:e.slotWidth})}))}componentWillUnmount(){i.setRef(this.props.innerWidthRef,null),i.setRef(this.props.innerHeighRef,null)}}class B extends i.BaseComponent{render(){const{props:e,context:t}=this;return r.createElement("div",{className:"fc-timeline-now-indicator-container"},r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timeline-now-indicator-line"],elStyle:null!=e.slotWidth?R(w(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!1,date:e.nowDate}))}}class U extends i.BaseComponent{render(){const{props:e,context:t}=this;return r.createElement("div",{className:"fc-timeline-now-indicator-container"},r.createElement(i.NowIndicatorContainer,{elClasses:["fc-timeline-now-indicator-arrow"],elStyle:null!=e.slotWidth?R(w(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!0,date:e.nowDate}))}}class F extends i.DateComponent{constructor(){super(...arguments),this.buildTimelineDateProfile=i.memoize(c),this.computeSlotWidth=i.memoize(D),this.headerScrollerRef=r.createRef(),this.bodyScrollerRef=r.createRef(),this.footerScrollerRef=r.createRef(),this.headerRowInnerWidthMap=new i.RefMap(()=>{i.afterSize(this.handleSlotInnerWidths)}),this.scrollTime=null,this.handleBodySlotInnerWidth=e=>{this.bodySlotInnerWidth=e,i.afterSize(this.handleSlotInnerWidths)},this.handleSlotInnerWidths=()=>{const{state:e}=this,t=Math.max(this.headerRowInnerWidthMap.current.get(this.tDateProfile.cellRows.length-1)||0,this.bodySlotInnerWidth);e.slotInnerWidth!==t&&this.setState({slotInnerWidth:t})},this.handleScrollerWidth=e=>{this.setState({scrollerWidth:e})},this.handleLeftScrollbarWidth=e=>{this.setState({leftScrollbarWidth:e})},this.handleRightScrollbarWidth=e=>{this.setState({rightScrollbarWidth:e})},this.handleTimeScroll=e=>{this.scrollTime=e,this.updateScroll()},this.updateScroll=()=>{const{props:e,context:t,tDateProfile:n,scrollTime:i,slotWidth:r}=this;if(null!=i&&null!=r){let l=y(i,t.dateEnv,e.dateProfile,n,r);l&&(l+=t.isRtl?-1:1),this.syncedScroller.scrollTo({x:l})}},this.clearScroll=()=>{this.scrollTime=null},this.handeBodyEl=e=>{this.bodyEl=e,e?this.context.registerInteractiveComponent(this,{el:e}):this.context.unregisterInteractiveComponent(this)}}render(){const{props:e,state:t,context:n}=this,{options:l}=n,s=this.tDateProfile=this.buildTimelineDateProfile(e.dateProfile,n.dateEnv,l,n.dateProfileGenerator),{cellRows:a}=s,o=i.greatestDurationDenominator(s.slotDuration).unit,c=!e.forPrint&&!i.getIsHeightAuto(l),d=!e.forPrint&&i.getStickyHeaderDates(l),f=!e.forPrint&&i.getStickyFooterScrollbar(l),[h,m]=this.computeSlotWidth(s.slotCnt,s.slotsPerLabel,l.slotMinWidth,t.slotInnerWidth,t.scrollerWidth);return this.slotWidth=m,r.createElement(i.NowTimer,{unit:o},(o,u)=>{const g=l.nowIndicator&&null!=m&&i.rangeContainsMarker(e.dateProfile.currentRange,o);return r.createElement(i.ViewContainer,{viewSpec:n.viewSpec,elClasses:["fc-timeline-view","fc-flex-column","fc-border"]},r.createElement(i.Scroller,{horizontal:!0,hideScrollbars:!0,elClassNames:["fc-timeline-header","fc-rowgroup",d?"fc-sticky-header":""],ref:this.headerScrollerRef},r.createElement("div",{className:"fc-rel fc-content-box",style:{width:h,paddingLeft:t.leftScrollbarWidth,paddingRight:t.rightScrollbarWidth}},r.createElement("div",null,a.map((t,n)=>{const i=n===a.length-1;return r.createElement(O,{key:n,dateProfile:e.dateProfile,tDateProfile:s,nowDate:o,todayRange:u,rowLevel:n,isLastRow:i,cells:t,slotWidth:m,innerWidthRef:this.headerRowInnerWidthMap.createRef(n)})})),g&&r.createElement(U,{tDateProfile:s,nowDate:o,slotWidth:m}))),r.createElement(i.Scroller,{vertical:c,horizontal:!0,elClassNames:["fc-timeline-body","fc-rowgroup",c?"fc-liquid":""],ref:this.bodyScrollerRef,widthRef:this.handleScrollerWidth,leftScrollbarWidthRef:this.handleLeftScrollbarWidth,rightScrollbarWidthRef:this.handleRightScrollbarWidth},r.createElement("div",{className:"fc-rel fc-grow",style:{width:h},ref:this.handeBodyEl},r.createElement(p,{dateProfile:e.dateProfile,tDateProfile:s,nowDate:o,todayRange:u,innerWidthRef:this.handleBodySlotInnerWidth,slotWidth:m}),r.createElement(P,{dateProfile:e.dateProfile,tDateProfile:s,nowDate:o,todayRange:u,nextDayThreshold:l.nextDayThreshold,eventStore:e.eventStore,eventUiBases:e.eventUiBases,businessHours:e.businessHours,dateSelection:e.dateSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,slotWidth:m}),g&&r.createElement(B,{tDateProfile:s,nowDate:o,slotWidth:m}))),f&&r.createElement(i.Scroller,{ref:this.footerScrollerRef,horizontal:!0},r.createElement("div",{style:{width:h}})))})}componentDidMount(){this.syncedScroller=new l.ScrollerSyncer(!0),this.updateSyncedScroller(),this.resetScroll(),this.context.emitter.on("_timeScrollRequest",this.handleTimeScroll),this.syncedScroller.addScrollEndListener(this.clearScroll)}componentDidUpdate(e){this.updateSyncedScroller(),e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset?this.resetScroll():this.updateScroll()}componentWillUnmount(){this.syncedScroller.destroy(),this.context.emitter.off("_timeScrollRequest",this.handleTimeScroll),this.syncedScroller.removeScrollEndListener(this.clearScroll)}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current])}resetScroll(){this.handleTimeScroll(this.context.options.scrollTime)}queryHit(e,t,n,r){const{props:l,context:s,tDateProfile:a,slotWidth:o}=this,{dateEnv:c}=s;if(o){const t=s.isRtl?n-e:e,d=Math.floor(t/o),f=(t-d*o)/o,h=Math.floor(f*a.snapsPerSlot);let m,u,g=c.add(a.slotDates[d],i.multiplyDuration(a.snapDuration,h)),p=c.add(g,a.snapDuration),v=o/a.snapsPerSlot,S=d*o+v*h,R=S+v;return s.isRtl?(m=n-R,u=n-S):(m=S,u=R),{dateProfile:l.dateProfile,dateSpan:{range:{start:g,end:p},allDay:!a.isTimeScale},rect:{left:m,right:u,top:0,bottom:r},dayEl:this.bodyEl.querySelectorAll(".fc-timeline-slot")[d],layer:0}}return null}}i.injectStyles('.fc-timeline-slots{z-index:1}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow,.fc-timeline-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;pointer-events:none;position:absolute;top:0}.fc-timeline-now-indicator-arrow{border-left-color:transparent;border-right-color:transparent;border-width:6px 5px 0;margin:0 -5px}.fc-timeline-now-indicator-line{border-width:0 0 0 1px;bottom:0}.fc-timeline-events{z-index:3}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px;z-index:1}.fc-timeline-event.fc-event-mirror{z-index:2}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event-spacious{margin-bottom:0;padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:"";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-bg{bottom:0;left:0;position:absolute;right:0;top:0;z-index:2}.fc-timeline-bg .fc-non-business{z-index:1}.fc-timeline-bg .fc-bg-event{z-index:2}.fc-timeline-bg .fc-highlight{z-index:3}.fc-timeline-bg-harness{bottom:0;position:absolute;top:0}');var A=t.createPlugin({name:"@fullcalendar/timeline",premiumReleaseDate:"2024-10-09",deps:[a.default],initialView:"timelineDay",views:{timeline:{component:F,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}}}}),_={__proto__:null,TimelineView:F,TimelineLane:P,TimelineLaneBg:W,TimelineSlats:p,buildTimelineDateProfile:c,createVerticalStyle:function(e){if(e)return{top:e.start,height:e.size}},createHorizontalStyle:function(e,t){if(e)return{[t?"right":"left"]:e.start,width:e.size}},computeSlotWidth:D,timeToCoord:y,coordToCss:function(e,t){return null===e?{left:"",right:""}:t?{right:e,left:""}:{left:e,right:""}},coordsToCss:function(e,t){return e?t?{right:e.start,left:-e.end}:{left:e.start,right:-e.end}:{left:"",right:""}},TimelineLaneSlicer:M,TimelineHeaderRow:O,TimelineNowIndicatorArrow:U,TimelineNowIndicatorLine:B};return t.globalPlugins.push(A),e.Internal=_,e.default=A,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal,FullCalendar.Preact,FullCalendar.ScrollGrid.Internal);
package/index.js CHANGED
@@ -3,10 +3,11 @@ import premiumCommonPlugin from '@fullcalendar/premium-common/index.js';
3
3
  import { TimelineView } from './internal.js';
4
4
  import '@fullcalendar/core/internal.js';
5
5
  import '@fullcalendar/core/preact.js';
6
+ import '@fullcalendar/scrollgrid/internal.js';
6
7
 
7
8
  var index = createPlugin({
8
9
  name: '@fullcalendar/timeline',
9
- premiumReleaseDate: '2024-10-01',
10
+ premiumReleaseDate: '2024-10-09',
10
11
  deps: [premiumCommonPlugin],
11
12
  initialView: 'timelineDay',
12
13
  views: {
package/internal.cjs CHANGED
@@ -4,9 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var internal_cjs = require('@fullcalendar/core/internal.cjs');
6
6
  var preact_cjs = require('@fullcalendar/core/preact.cjs');
7
-
8
- var css_248z = ".fc-timeline-slots{z-index:1}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow,.fc-timeline-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;pointer-events:none;position:absolute;top:0}.fc-timeline-now-indicator-arrow{border-left-color:transparent;border-right-color:transparent;border-width:6px 5px 0;margin:0 -5px}.fc-timeline-now-indicator-line{border-width:0 0 0 1px;bottom:0}.fc-timeline-events{z-index:3}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px;z-index:1}.fc-timeline-event.fc-event-mirror{z-index:2}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event-spacious{margin-bottom:0;padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:\"\";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-bg{bottom:0;left:0;position:absolute;right:0;top:0;z-index:2}.fc-timeline-bg .fc-non-business{z-index:1}.fc-timeline-bg .fc-bg-event{z-index:2}.fc-timeline-bg .fc-highlight{z-index:3}.fc-timeline-bg-harness{bottom:0;position:absolute;top:0}";
9
- internal_cjs.injectStyles(css_248z);
7
+ var internal_cjs$1 = require('@fullcalendar/scrollgrid/internal.cjs');
10
8
 
11
9
  const MIN_AUTO_LABELS = 18; // more than `12` months but less that `24` hours
12
10
  const MAX_AUTO_SLOTS_PER_LABEL = 6; // allows 6 10-min slots in an hour
@@ -490,6 +488,7 @@ class TimelineSlatCell extends internal_cjs.BaseComponent {
490
488
  }
491
489
  componentWillUnmount() {
492
490
  this.detachWidth();
491
+ internal_cjs.setRef(this.props.innerWidthRef, null);
493
492
  }
494
493
  }
495
494
 
@@ -794,8 +793,7 @@ class TimelineLaneBg extends internal_cjs.BaseComponent {
794
793
  hStyle = horizontalsToCss(segHorizontal, isRtl);
795
794
  }
796
795
  return (preact_cjs.createElement("div", { key: internal_cjs.buildEventRangeKey(seg.eventRange), className: "fc-timeline-bg-harness", style: hStyle }, fillType === 'bg-event' ?
797
- preact_cjs.createElement(internal_cjs.BgEvent, Object.assign({ seg: seg }, internal_cjs.getSegMeta(seg, todayRange, nowDate))) :
798
- internal_cjs.renderFill(fillType)));
796
+ preact_cjs.createElement(internal_cjs.BgEvent, Object.assign({ eventRange: seg.eventRange, isStart: seg.isStart, isEnd: seg.isEnd }, internal_cjs.getEventRangeMeta(seg.eventRange, todayRange, nowDate))) : (internal_cjs.renderFill(fillType))));
799
797
  })));
800
798
  }
801
799
  }
@@ -850,9 +848,10 @@ class TimelineLaneMoreLink extends internal_cjs.BaseComponent {
850
848
  let { hiddenSegs, resourceId, forcedInvisibleMap } = props;
851
849
  let extraDateSpan = resourceId ? { resourceId } : {};
852
850
  return (preact_cjs.createElement(internal_cjs.MoreLinkContainer, { elClasses: ['fc-timeline-more-link'], allDayDate: null, segs: hiddenSegs, hiddenSegs: hiddenSegs, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: extraDateSpan, popoverContent: () => (preact_cjs.createElement(preact_cjs.Fragment, null, hiddenSegs.map((seg) => {
853
- let instanceId = seg.eventRange.instance.instanceId;
851
+ let { eventRange } = seg;
852
+ let instanceId = eventRange.instance.instanceId;
854
853
  return (preact_cjs.createElement("div", { key: instanceId, style: { visibility: forcedInvisibleMap[instanceId] ? 'hidden' : '' } },
855
- preact_cjs.createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, internal_cjs.getSegMeta(seg, props.todayRange, props.nowDate)))));
854
+ preact_cjs.createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, internal_cjs.getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
856
855
  }))) }, (InnerContent) => (preact_cjs.createElement(InnerContent, { elTag: "div", elClasses: ['fc-timeline-more-link-inner', 'fc-sticky-x'] }))));
857
856
  }
858
857
  }
@@ -878,6 +877,7 @@ class TimelineEventHarness extends preact_cjs.Component {
878
877
  }
879
878
  componentWillUnmount() {
880
879
  this.detachHeight();
880
+ internal_cjs.setRef(this.props.heightRef, null);
881
881
  }
882
882
  }
883
883
 
@@ -955,13 +955,14 @@ class TimelineLane extends internal_cjs.BaseComponent {
955
955
  let isMirror = isDragging || isResizing || isDateSelecting;
956
956
  return (preact_cjs.createElement(preact_cjs.Fragment, null,
957
957
  segs.map((seg) => {
958
- const { instanceId } = seg.eventRange.instance;
958
+ const { eventRange } = seg;
959
+ const { instanceId } = eventRange.instance;
959
960
  const segTop = segTops[instanceId];
960
961
  const segHorizontal = segHorizontals[instanceId];
961
962
  const isVisible = isMirror ||
962
963
  (segHorizontal && segTop != null && !forcedInvisibleMap[instanceId]);
963
964
  return (preact_cjs.createElement(TimelineEventHarness, { key: instanceId, style: Object.assign({ visibility: isVisible ? '' : 'hidden', top: segTop || 0 }, horizontalsToCss(segHorizontal, context.isRtl)), heightRef: isMirror ? undefined : segHeightRefMap.createRef(instanceId) },
964
- preact_cjs.createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, internal_cjs.getSegMeta(seg, props.todayRange, props.nowDate)))));
965
+ preact_cjs.createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, internal_cjs.getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
965
966
  }),
966
967
  hiddenGroups.map((hiddenGroup) => (preact_cjs.createElement(TimelineEventHarness, { key: hiddenGroup.key, style: Object.assign({ top: hiddenGroupTops[hiddenGroup.key] || 0 }, horizontalsToCss({
967
968
  start: hiddenGroup.span.start,
@@ -979,7 +980,6 @@ class TimelineHeaderCell extends internal_cjs.BaseComponent {
979
980
  this.buildCellNavLinkAttrs = internal_cjs.memoize(buildCellNavLinkAttrs);
980
981
  // ref
981
982
  this.innerElRef = preact_cjs.createRef();
982
- // TODO: unset width/height ref on unmount?
983
983
  }
984
984
  render() {
985
985
  let { props, context } = this;
@@ -1041,7 +1041,10 @@ class TimelineHeaderCell extends internal_cjs.BaseComponent {
1041
1041
  });
1042
1042
  }
1043
1043
  componentWillUnmount() {
1044
+ const { props } = this;
1044
1045
  this.detachSize();
1046
+ internal_cjs.setRef(props.innerWidthRef, null);
1047
+ internal_cjs.setRef(props.innerHeightRef, null);
1045
1048
  }
1046
1049
  }
1047
1050
  // Utils
@@ -1100,6 +1103,7 @@ class TimelineHeaderRow extends internal_cjs.BaseComponent {
1100
1103
  // TODO: make this part of the cell obj?
1101
1104
  // TODO: rowUnit seems wrong sometimes. says 'month' when it should be day
1102
1105
  // TODO: rowUnit is relevant to whole row. put it on a row object, not the cells
1106
+ // TODO: use rowUnit to key the Row itself?
1103
1107
  const key = cell.rowUnit + ':' + cell.date.toISOString();
1104
1108
  return (preact_cjs.createElement(TimelineHeaderCell, { key: key, cell: cell, rowLevel: props.rowLevel, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, todayRange: props.todayRange, nowDate: props.nowDate, isCentered: isCentered, isSticky: isSticky,
1105
1109
  // refs
@@ -1108,6 +1112,10 @@ class TimelineHeaderRow extends internal_cjs.BaseComponent {
1108
1112
  slotWidth: props.slotWidth }));
1109
1113
  })));
1110
1114
  }
1115
+ componentWillUnmount() {
1116
+ internal_cjs.setRef(this.props.innerWidthRef, null);
1117
+ internal_cjs.setRef(this.props.innerHeighRef, null);
1118
+ }
1111
1119
  }
1112
1120
 
1113
1121
  class TimelineNowIndicatorLine extends internal_cjs.BaseComponent {
@@ -1141,19 +1149,19 @@ class TimelineView extends internal_cjs.DateComponent {
1141
1149
  this.headerScrollerRef = preact_cjs.createRef();
1142
1150
  this.bodyScrollerRef = preact_cjs.createRef();
1143
1151
  this.footerScrollerRef = preact_cjs.createRef();
1152
+ this.headerRowInnerWidthMap = new internal_cjs.RefMap(() => {
1153
+ internal_cjs.afterSize(this.handleSlotInnerWidths);
1154
+ });
1155
+ this.scrollTime = null;
1144
1156
  // Sizing
1145
1157
  // -----------------------------------------------------------------------------------------------
1146
- this.handleHeaderSlotInnerWidth = (innerWidth) => {
1147
- this.headerSlotInnerWidth = innerWidth;
1148
- internal_cjs.afterSize(this.handleSlotInnerWidths);
1149
- };
1150
1158
  this.handleBodySlotInnerWidth = (innerWidth) => {
1151
1159
  this.bodySlotInnerWidth = innerWidth;
1152
1160
  internal_cjs.afterSize(this.handleSlotInnerWidths);
1153
1161
  };
1154
1162
  this.handleSlotInnerWidths = () => {
1155
1163
  const { state } = this;
1156
- const slotInnerWidth = Math.max(this.headerSlotInnerWidth, this.bodySlotInnerWidth);
1164
+ const slotInnerWidth = Math.max(this.headerRowInnerWidthMap.current.get(this.tDateProfile.cellRows.length - 1) || 0, this.bodySlotInnerWidth);
1157
1165
  if (state.slotInnerWidth !== slotInnerWidth) {
1158
1166
  this.setState({ slotInnerWidth });
1159
1167
  }
@@ -1173,16 +1181,23 @@ class TimelineView extends internal_cjs.DateComponent {
1173
1181
  rightScrollbarWidth
1174
1182
  });
1175
1183
  };
1176
- this.timeScrollResponder = new internal_cjs.ScrollResponder((time) => {
1177
- const { props, context, tDateProfile, slotWidth } = this;
1178
- if (slotWidth != null) {
1179
- const x = timeToCoord(time, context.dateEnv, props.dateProfile, tDateProfile, slotWidth) +
1180
- (context.isRtl ? -1 : 1); // overcome border. TODO: DRY this up
1184
+ this.handleTimeScroll = (scrollTime) => {
1185
+ this.scrollTime = scrollTime;
1186
+ this.updateScroll();
1187
+ };
1188
+ this.updateScroll = () => {
1189
+ const { props, context, tDateProfile, scrollTime, slotWidth } = this;
1190
+ if (scrollTime != null && slotWidth != null) {
1191
+ let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
1192
+ if (x) {
1193
+ x += context.isRtl ? -1 : 1; // overcome border. TODO: DRY this up
1194
+ }
1181
1195
  this.syncedScroller.scrollTo({ x });
1182
- return true;
1183
1196
  }
1184
- return false;
1185
- });
1197
+ };
1198
+ this.clearScroll = () => {
1199
+ this.scrollTime = null;
1200
+ };
1186
1201
  // Hit System
1187
1202
  // -----------------------------------------------------------------------------------------------
1188
1203
  this.handeBodyEl = (el) => {
@@ -1233,7 +1248,7 @@ class TimelineView extends internal_cjs.DateComponent {
1233
1248
  } },
1234
1249
  preact_cjs.createElement("div", null, cellRows.map((cells, rowLevel) => {
1235
1250
  const isLast = rowLevel === cellRows.length - 1;
1236
- return (preact_cjs.createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: isLast ? this.handleHeaderSlotInnerWidth : undefined }));
1251
+ return (preact_cjs.createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: this.headerRowInnerWidthMap.createRef(rowLevel) }));
1237
1252
  })),
1238
1253
  enableNowIndicator && (
1239
1254
  // TODO: make this positioned WITHIN padding?
@@ -1260,27 +1275,26 @@ class TimelineView extends internal_cjs.DateComponent {
1260
1275
  // Lifecycle
1261
1276
  // -----------------------------------------------------------------------------------------------
1262
1277
  componentDidMount() {
1263
- const { context } = this;
1264
- const { options } = context;
1265
- const ScrollerSyncer = internal_cjs.getScrollerSyncerClass(this.context.pluginHooks);
1266
- this.syncedScroller = new ScrollerSyncer(true); // horizontal=true
1278
+ this.syncedScroller = new internal_cjs$1.ScrollerSyncer(true); // horizontal=true
1267
1279
  this.updateSyncedScroller();
1268
- context.emitter.on('_timeScrollRequest', this.timeScrollResponder.handleScroll);
1269
- this.timeScrollResponder.handleScroll(options.scrollTime);
1280
+ this.resetScroll();
1281
+ this.context.emitter.on('_timeScrollRequest', this.handleTimeScroll);
1282
+ this.syncedScroller.addScrollEndListener(this.clearScroll);
1270
1283
  }
1271
1284
  componentDidUpdate(prevProps) {
1272
- const { options } = this.context;
1273
1285
  this.updateSyncedScroller();
1274
- if (prevProps.dateProfile !== this.props.dateProfile && options.scrollTimeReset) {
1275
- this.timeScrollResponder.handleScroll(options.scrollTime);
1286
+ if (prevProps.dateProfile !== this.props.dateProfile && this.context.options.scrollTimeReset) {
1287
+ this.resetScroll();
1276
1288
  }
1277
1289
  else {
1278
- this.timeScrollResponder.drain();
1290
+ // TODO: inefficient to update so often
1291
+ this.updateScroll();
1279
1292
  }
1280
1293
  }
1281
1294
  componentWillUnmount() {
1282
1295
  this.syncedScroller.destroy();
1283
- this.context.emitter.off('_timeScrollRequest', this.timeScrollResponder.handleScroll);
1296
+ this.context.emitter.off('_timeScrollRequest', this.handleTimeScroll);
1297
+ this.syncedScroller.removeScrollEndListener(this.clearScroll);
1284
1298
  }
1285
1299
  // Scrolling
1286
1300
  // -----------------------------------------------------------------------------------------------
@@ -1289,7 +1303,10 @@ class TimelineView extends internal_cjs.DateComponent {
1289
1303
  this.headerScrollerRef.current,
1290
1304
  this.bodyScrollerRef.current,
1291
1305
  this.footerScrollerRef.current
1292
- ], this.context.isRtl);
1306
+ ]);
1307
+ }
1308
+ resetScroll() {
1309
+ this.handleTimeScroll(this.context.options.scrollTime);
1293
1310
  }
1294
1311
  queryHit(positionLeft, positionTop, elWidth, elHeight) {
1295
1312
  const { props, context, tDateProfile, slotWidth } = this;
@@ -1336,6 +1353,9 @@ class TimelineView extends internal_cjs.DateComponent {
1336
1353
  }
1337
1354
  }
1338
1355
 
1356
+ var css_248z = ".fc-timeline-slots{z-index:1}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow,.fc-timeline-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;pointer-events:none;position:absolute;top:0}.fc-timeline-now-indicator-arrow{border-left-color:transparent;border-right-color:transparent;border-width:6px 5px 0;margin:0 -5px}.fc-timeline-now-indicator-line{border-width:0 0 0 1px;bottom:0}.fc-timeline-events{z-index:3}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px;z-index:1}.fc-timeline-event.fc-event-mirror{z-index:2}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event-spacious{margin-bottom:0;padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:\"\";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-bg{bottom:0;left:0;position:absolute;right:0;top:0;z-index:2}.fc-timeline-bg .fc-non-business{z-index:1}.fc-timeline-bg .fc-bg-event{z-index:2}.fc-timeline-bg .fc-highlight{z-index:3}.fc-timeline-bg-harness{bottom:0;position:absolute;top:0}";
1357
+ internal_cjs.injectStyles(css_248z);
1358
+
1339
1359
  exports.TimelineHeaderRow = TimelineHeaderRow;
1340
1360
  exports.TimelineLane = TimelineLane;
1341
1361
  exports.TimelineLaneBg = TimelineLaneBg;
package/internal.d.ts CHANGED
@@ -17,21 +17,24 @@ declare class TimelineView extends DateComponent<ViewProps, TimelineViewState> {
17
17
  private tDateProfile?;
18
18
  private bodyEl?;
19
19
  private slotWidth?;
20
- private headerSlotInnerWidth?;
20
+ private headerRowInnerWidthMap;
21
21
  private bodySlotInnerWidth?;
22
22
  private syncedScroller;
23
+ private scrollTime;
23
24
  render(): createElement.JSX.Element;
24
25
  componentDidMount(): void;
25
26
  componentDidUpdate(prevProps: ViewProps): void;
26
27
  componentWillUnmount(): void;
27
- handleHeaderSlotInnerWidth: (innerWidth: number) => void;
28
28
  handleBodySlotInnerWidth: (innerWidth: number) => void;
29
29
  handleSlotInnerWidths: () => void;
30
30
  handleScrollerWidth: (scrollerWidth: number) => void;
31
31
  handleLeftScrollbarWidth: (leftScrollbarWidth: number) => void;
32
32
  handleRightScrollbarWidth: (rightScrollbarWidth: number) => void;
33
- updateSyncedScroller(): void;
34
- private timeScrollResponder;
33
+ private updateSyncedScroller;
34
+ private resetScroll;
35
+ private handleTimeScroll;
36
+ private updateScroll;
37
+ private clearScroll;
35
38
  handeBodyEl: (el: HTMLElement | null) => void;
36
39
  queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit;
37
40
  }
@@ -208,6 +211,7 @@ declare class TimelineHeaderRow extends BaseComponent<TimelineHeaderRowProps> {
208
211
  render(): createElement.JSX.Element;
209
212
  handleInnerWidths: () => void;
210
213
  handleInnerHeights: () => void;
214
+ componentWillUnmount(): void;
211
215
  }
212
216
 
213
217
  interface TimelineNowIndicatorArrowProps {
package/internal.js CHANGED
@@ -1,8 +1,6 @@
1
- import { injectStyles, config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, BaseComponent, getDateMeta, ContentContainer, getDayClassNames, getSlotClassNames, watchWidth, setRef, RefMap, afterSize, SegHierarchy, groupIntersectingEntries, buildEventRangeKey, BgEvent, getSegMeta, renderFill, Slicer, intersectRanges, addMs, StandardEvent, MoreLinkContainer, watchHeight, memoize, sortEventSegs, memoizeObjArg, watchSize, buildNavLinkAttrs, NowIndicatorContainer, DateComponent, ScrollResponder, getIsHeightAuto, getStickyHeaderDates, getStickyFooterScrollbar, NowTimer, rangeContainsMarker, ViewContainer, Scroller, getScrollerSyncerClass, multiplyDuration } from '@fullcalendar/core/internal.js';
1
+ import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, BaseComponent, getDateMeta, ContentContainer, getDayClassNames, getSlotClassNames, watchWidth, setRef, RefMap, afterSize, SegHierarchy, groupIntersectingEntries, buildEventRangeKey, BgEvent, getEventRangeMeta, renderFill, Slicer, intersectRanges, addMs, StandardEvent, MoreLinkContainer, watchHeight, memoize, sortEventSegs, memoizeObjArg, watchSize, buildNavLinkAttrs, NowIndicatorContainer, DateComponent, getIsHeightAuto, getStickyHeaderDates, getStickyFooterScrollbar, NowTimer, rangeContainsMarker, ViewContainer, Scroller, multiplyDuration, injectStyles } from '@fullcalendar/core/internal.js';
2
2
  import { createRef, createElement, Fragment, Component } from '@fullcalendar/core/preact.js';
3
-
4
- var css_248z = ".fc-timeline-slots{z-index:1}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow,.fc-timeline-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;pointer-events:none;position:absolute;top:0}.fc-timeline-now-indicator-arrow{border-left-color:transparent;border-right-color:transparent;border-width:6px 5px 0;margin:0 -5px}.fc-timeline-now-indicator-line{border-width:0 0 0 1px;bottom:0}.fc-timeline-events{z-index:3}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px;z-index:1}.fc-timeline-event.fc-event-mirror{z-index:2}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event-spacious{margin-bottom:0;padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:\"\";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-bg{bottom:0;left:0;position:absolute;right:0;top:0;z-index:2}.fc-timeline-bg .fc-non-business{z-index:1}.fc-timeline-bg .fc-bg-event{z-index:2}.fc-timeline-bg .fc-highlight{z-index:3}.fc-timeline-bg-harness{bottom:0;position:absolute;top:0}";
5
- injectStyles(css_248z);
3
+ import { ScrollerSyncer } from '@fullcalendar/scrollgrid/internal.js';
6
4
 
7
5
  const MIN_AUTO_LABELS = 18; // more than `12` months but less that `24` hours
8
6
  const MAX_AUTO_SLOTS_PER_LABEL = 6; // allows 6 10-min slots in an hour
@@ -486,6 +484,7 @@ class TimelineSlatCell extends BaseComponent {
486
484
  }
487
485
  componentWillUnmount() {
488
486
  this.detachWidth();
487
+ setRef(this.props.innerWidthRef, null);
489
488
  }
490
489
  }
491
490
 
@@ -790,8 +789,7 @@ class TimelineLaneBg extends BaseComponent {
790
789
  hStyle = horizontalsToCss(segHorizontal, isRtl);
791
790
  }
792
791
  return (createElement("div", { key: buildEventRangeKey(seg.eventRange), className: "fc-timeline-bg-harness", style: hStyle }, fillType === 'bg-event' ?
793
- createElement(BgEvent, Object.assign({ seg: seg }, getSegMeta(seg, todayRange, nowDate))) :
794
- renderFill(fillType)));
792
+ createElement(BgEvent, Object.assign({ eventRange: seg.eventRange, isStart: seg.isStart, isEnd: seg.isEnd }, getEventRangeMeta(seg.eventRange, todayRange, nowDate))) : (renderFill(fillType))));
795
793
  })));
796
794
  }
797
795
  }
@@ -846,9 +844,10 @@ class TimelineLaneMoreLink extends BaseComponent {
846
844
  let { hiddenSegs, resourceId, forcedInvisibleMap } = props;
847
845
  let extraDateSpan = resourceId ? { resourceId } : {};
848
846
  return (createElement(MoreLinkContainer, { elClasses: ['fc-timeline-more-link'], allDayDate: null, segs: hiddenSegs, hiddenSegs: hiddenSegs, dateProfile: props.dateProfile, todayRange: props.todayRange, extraDateSpan: extraDateSpan, popoverContent: () => (createElement(Fragment, null, hiddenSegs.map((seg) => {
849
- let instanceId = seg.eventRange.instance.instanceId;
847
+ let { eventRange } = seg;
848
+ let instanceId = eventRange.instance.instanceId;
850
849
  return (createElement("div", { key: instanceId, style: { visibility: forcedInvisibleMap[instanceId] ? 'hidden' : '' } },
851
- createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, getSegMeta(seg, props.todayRange, props.nowDate)))));
850
+ createElement(TimelineEvent, Object.assign({ isTimeScale: props.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection }, getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
852
851
  }))) }, (InnerContent) => (createElement(InnerContent, { elTag: "div", elClasses: ['fc-timeline-more-link-inner', 'fc-sticky-x'] }))));
853
852
  }
854
853
  }
@@ -874,6 +873,7 @@ class TimelineEventHarness extends Component {
874
873
  }
875
874
  componentWillUnmount() {
876
875
  this.detachHeight();
876
+ setRef(this.props.heightRef, null);
877
877
  }
878
878
  }
879
879
 
@@ -951,13 +951,14 @@ class TimelineLane extends BaseComponent {
951
951
  let isMirror = isDragging || isResizing || isDateSelecting;
952
952
  return (createElement(Fragment, null,
953
953
  segs.map((seg) => {
954
- const { instanceId } = seg.eventRange.instance;
954
+ const { eventRange } = seg;
955
+ const { instanceId } = eventRange.instance;
955
956
  const segTop = segTops[instanceId];
956
957
  const segHorizontal = segHorizontals[instanceId];
957
958
  const isVisible = isMirror ||
958
959
  (segHorizontal && segTop != null && !forcedInvisibleMap[instanceId]);
959
960
  return (createElement(TimelineEventHarness, { key: instanceId, style: Object.assign({ visibility: isVisible ? '' : 'hidden', top: segTop || 0 }, horizontalsToCss(segHorizontal, context.isRtl)), heightRef: isMirror ? undefined : segHeightRefMap.createRef(instanceId) },
960
- createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, getSegMeta(seg, props.todayRange, props.nowDate)))));
961
+ createElement(TimelineEvent, Object.assign({ isTimeScale: props.tDateProfile.isTimeScale, eventRange: eventRange, isStart: seg.isStart, isEnd: seg.isEnd, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === props.eventSelection /* TODO: bad for mirror? */ }, getEventRangeMeta(eventRange, props.todayRange, props.nowDate)))));
961
962
  }),
962
963
  hiddenGroups.map((hiddenGroup) => (createElement(TimelineEventHarness, { key: hiddenGroup.key, style: Object.assign({ top: hiddenGroupTops[hiddenGroup.key] || 0 }, horizontalsToCss({
963
964
  start: hiddenGroup.span.start,
@@ -975,7 +976,6 @@ class TimelineHeaderCell extends BaseComponent {
975
976
  this.buildCellNavLinkAttrs = memoize(buildCellNavLinkAttrs);
976
977
  // ref
977
978
  this.innerElRef = createRef();
978
- // TODO: unset width/height ref on unmount?
979
979
  }
980
980
  render() {
981
981
  let { props, context } = this;
@@ -1037,7 +1037,10 @@ class TimelineHeaderCell extends BaseComponent {
1037
1037
  });
1038
1038
  }
1039
1039
  componentWillUnmount() {
1040
+ const { props } = this;
1040
1041
  this.detachSize();
1042
+ setRef(props.innerWidthRef, null);
1043
+ setRef(props.innerHeightRef, null);
1041
1044
  }
1042
1045
  }
1043
1046
  // Utils
@@ -1096,6 +1099,7 @@ class TimelineHeaderRow extends BaseComponent {
1096
1099
  // TODO: make this part of the cell obj?
1097
1100
  // TODO: rowUnit seems wrong sometimes. says 'month' when it should be day
1098
1101
  // TODO: rowUnit is relevant to whole row. put it on a row object, not the cells
1102
+ // TODO: use rowUnit to key the Row itself?
1099
1103
  const key = cell.rowUnit + ':' + cell.date.toISOString();
1100
1104
  return (createElement(TimelineHeaderCell, { key: key, cell: cell, rowLevel: props.rowLevel, dateProfile: props.dateProfile, tDateProfile: props.tDateProfile, todayRange: props.todayRange, nowDate: props.nowDate, isCentered: isCentered, isSticky: isSticky,
1101
1105
  // refs
@@ -1104,6 +1108,10 @@ class TimelineHeaderRow extends BaseComponent {
1104
1108
  slotWidth: props.slotWidth }));
1105
1109
  })));
1106
1110
  }
1111
+ componentWillUnmount() {
1112
+ setRef(this.props.innerWidthRef, null);
1113
+ setRef(this.props.innerHeighRef, null);
1114
+ }
1107
1115
  }
1108
1116
 
1109
1117
  class TimelineNowIndicatorLine extends BaseComponent {
@@ -1137,19 +1145,19 @@ class TimelineView extends DateComponent {
1137
1145
  this.headerScrollerRef = createRef();
1138
1146
  this.bodyScrollerRef = createRef();
1139
1147
  this.footerScrollerRef = createRef();
1148
+ this.headerRowInnerWidthMap = new RefMap(() => {
1149
+ afterSize(this.handleSlotInnerWidths);
1150
+ });
1151
+ this.scrollTime = null;
1140
1152
  // Sizing
1141
1153
  // -----------------------------------------------------------------------------------------------
1142
- this.handleHeaderSlotInnerWidth = (innerWidth) => {
1143
- this.headerSlotInnerWidth = innerWidth;
1144
- afterSize(this.handleSlotInnerWidths);
1145
- };
1146
1154
  this.handleBodySlotInnerWidth = (innerWidth) => {
1147
1155
  this.bodySlotInnerWidth = innerWidth;
1148
1156
  afterSize(this.handleSlotInnerWidths);
1149
1157
  };
1150
1158
  this.handleSlotInnerWidths = () => {
1151
1159
  const { state } = this;
1152
- const slotInnerWidth = Math.max(this.headerSlotInnerWidth, this.bodySlotInnerWidth);
1160
+ const slotInnerWidth = Math.max(this.headerRowInnerWidthMap.current.get(this.tDateProfile.cellRows.length - 1) || 0, this.bodySlotInnerWidth);
1153
1161
  if (state.slotInnerWidth !== slotInnerWidth) {
1154
1162
  this.setState({ slotInnerWidth });
1155
1163
  }
@@ -1169,16 +1177,23 @@ class TimelineView extends DateComponent {
1169
1177
  rightScrollbarWidth
1170
1178
  });
1171
1179
  };
1172
- this.timeScrollResponder = new ScrollResponder((time) => {
1173
- const { props, context, tDateProfile, slotWidth } = this;
1174
- if (slotWidth != null) {
1175
- const x = timeToCoord(time, context.dateEnv, props.dateProfile, tDateProfile, slotWidth) +
1176
- (context.isRtl ? -1 : 1); // overcome border. TODO: DRY this up
1180
+ this.handleTimeScroll = (scrollTime) => {
1181
+ this.scrollTime = scrollTime;
1182
+ this.updateScroll();
1183
+ };
1184
+ this.updateScroll = () => {
1185
+ const { props, context, tDateProfile, scrollTime, slotWidth } = this;
1186
+ if (scrollTime != null && slotWidth != null) {
1187
+ let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
1188
+ if (x) {
1189
+ x += context.isRtl ? -1 : 1; // overcome border. TODO: DRY this up
1190
+ }
1177
1191
  this.syncedScroller.scrollTo({ x });
1178
- return true;
1179
1192
  }
1180
- return false;
1181
- });
1193
+ };
1194
+ this.clearScroll = () => {
1195
+ this.scrollTime = null;
1196
+ };
1182
1197
  // Hit System
1183
1198
  // -----------------------------------------------------------------------------------------------
1184
1199
  this.handeBodyEl = (el) => {
@@ -1229,7 +1244,7 @@ class TimelineView extends DateComponent {
1229
1244
  } },
1230
1245
  createElement("div", null, cellRows.map((cells, rowLevel) => {
1231
1246
  const isLast = rowLevel === cellRows.length - 1;
1232
- return (createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: isLast ? this.handleHeaderSlotInnerWidth : undefined }));
1247
+ return (createElement(TimelineHeaderRow, { key: rowLevel, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange, rowLevel: rowLevel, isLastRow: isLast, cells: cells, slotWidth: slotWidth, innerWidthRef: this.headerRowInnerWidthMap.createRef(rowLevel) }));
1233
1248
  })),
1234
1249
  enableNowIndicator && (
1235
1250
  // TODO: make this positioned WITHIN padding?
@@ -1256,27 +1271,26 @@ class TimelineView extends DateComponent {
1256
1271
  // Lifecycle
1257
1272
  // -----------------------------------------------------------------------------------------------
1258
1273
  componentDidMount() {
1259
- const { context } = this;
1260
- const { options } = context;
1261
- const ScrollerSyncer = getScrollerSyncerClass(this.context.pluginHooks);
1262
1274
  this.syncedScroller = new ScrollerSyncer(true); // horizontal=true
1263
1275
  this.updateSyncedScroller();
1264
- context.emitter.on('_timeScrollRequest', this.timeScrollResponder.handleScroll);
1265
- this.timeScrollResponder.handleScroll(options.scrollTime);
1276
+ this.resetScroll();
1277
+ this.context.emitter.on('_timeScrollRequest', this.handleTimeScroll);
1278
+ this.syncedScroller.addScrollEndListener(this.clearScroll);
1266
1279
  }
1267
1280
  componentDidUpdate(prevProps) {
1268
- const { options } = this.context;
1269
1281
  this.updateSyncedScroller();
1270
- if (prevProps.dateProfile !== this.props.dateProfile && options.scrollTimeReset) {
1271
- this.timeScrollResponder.handleScroll(options.scrollTime);
1282
+ if (prevProps.dateProfile !== this.props.dateProfile && this.context.options.scrollTimeReset) {
1283
+ this.resetScroll();
1272
1284
  }
1273
1285
  else {
1274
- this.timeScrollResponder.drain();
1286
+ // TODO: inefficient to update so often
1287
+ this.updateScroll();
1275
1288
  }
1276
1289
  }
1277
1290
  componentWillUnmount() {
1278
1291
  this.syncedScroller.destroy();
1279
- this.context.emitter.off('_timeScrollRequest', this.timeScrollResponder.handleScroll);
1292
+ this.context.emitter.off('_timeScrollRequest', this.handleTimeScroll);
1293
+ this.syncedScroller.removeScrollEndListener(this.clearScroll);
1280
1294
  }
1281
1295
  // Scrolling
1282
1296
  // -----------------------------------------------------------------------------------------------
@@ -1285,7 +1299,10 @@ class TimelineView extends DateComponent {
1285
1299
  this.headerScrollerRef.current,
1286
1300
  this.bodyScrollerRef.current,
1287
1301
  this.footerScrollerRef.current
1288
- ], this.context.isRtl);
1302
+ ]);
1303
+ }
1304
+ resetScroll() {
1305
+ this.handleTimeScroll(this.context.options.scrollTime);
1289
1306
  }
1290
1307
  queryHit(positionLeft, positionTop, elWidth, elHeight) {
1291
1308
  const { props, context, tDateProfile, slotWidth } = this;
@@ -1332,4 +1349,7 @@ class TimelineView extends DateComponent {
1332
1349
  }
1333
1350
  }
1334
1351
 
1352
+ var css_248z = ".fc-timeline-slots{z-index:1}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-now-indicator-container{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow,.fc-timeline-now-indicator-line{border-color:var(--fc-now-indicator-color);border-style:solid;pointer-events:none;position:absolute;top:0}.fc-timeline-now-indicator-arrow{border-left-color:transparent;border-right-color:transparent;border-width:6px 5px 0;margin:0 -5px}.fc-timeline-now-indicator-line{border-width:0 0 0 1px;bottom:0}.fc-timeline-events{z-index:3}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px;z-index:1}.fc-timeline-event.fc-event-mirror{z-index:2}.fc-direction-ltr .fc-timeline-event.fc-event-end{margin-right:1px}.fc-direction-rtl .fc-timeline-event.fc-event-end{margin-left:1px}.fc-timeline-event-spacious{margin-bottom:0;padding-bottom:5px;padding-top:5px}.fc-timeline-event .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-color:transparent #000;border-style:solid;border-width:5px;content:\"\";flex-grow:0;flex-shrink:0;height:0;margin:0 1px;opacity:.5;width:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before,.fc-direction-rtl .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after{border-left:0}.fc-direction-ltr .fc-timeline-event:not(.fc-event-end) .fc-event-inner:after,.fc-direction-rtl .fc-timeline-event:not(.fc-event-start) .fc-event-inner:before{border-right:0}.fc-timeline-event .fc-event-time{font-weight:700}.fc-timeline-event .fc-event-time,.fc-timeline-event .fc-event-title{padding:0 2px}.fc-timeline-more-link{align-items:flex-start;background:var(--fc-more-link-bg-color);color:var(--fc-more-link-text-color);cursor:pointer;display:flex;flex-direction:column;font-size:var(--fc-small-font-size);padding:1px}.fc-direction-ltr .fc-timeline-more-link{margin-right:1px}.fc-direction-rtl .fc-timeline-more-link{margin-left:1px}.fc-timeline-more-link-inner{padding:2px}.fc-timeline-bg{bottom:0;left:0;position:absolute;right:0;top:0;z-index:2}.fc-timeline-bg .fc-non-business{z-index:1}.fc-timeline-bg .fc-bg-event{z-index:2}.fc-timeline-bg .fc-highlight{z-index:3}.fc-timeline-bg-harness{bottom:0;position:absolute;top:0}";
1353
+ injectStyles(css_248z);
1354
+
1335
1355
  export { TimelineHeaderRow, TimelineLane, TimelineLaneBg, TimelineLaneSlicer, TimelineNowIndicatorArrow, TimelineNowIndicatorLine, TimelineSlats, TimelineView, buildTimelineDateProfile, computeSlotWidth, coordToCss, coordsToCss, createHorizontalStyle, createVerticalStyle, timeToCoord };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullcalendar/timeline",
3
- "version": "7.0.0-beta.0",
3
+ "version": "7.0.0-beta.1",
4
4
  "title": "FullCalendar Timeline Plugin",
5
5
  "description": "Display events on a horizontal time axis (without resources)",
6
6
  "keywords": [
@@ -15,11 +15,11 @@
15
15
  ],
16
16
  "homepage": "https://fullcalendar.io/docs/timeline-view-no-resources",
17
17
  "dependencies": {
18
- "@fullcalendar/premium-common": "7.0.0-beta.0",
19
- "@fullcalendar/scrollgrid": "7.0.0-beta.0"
18
+ "@fullcalendar/premium-common": "7.0.0-beta.1",
19
+ "@fullcalendar/scrollgrid": "7.0.0-beta.1"
20
20
  },
21
21
  "peerDependencies": {
22
- "@fullcalendar/core": "7.0.0-beta.0"
22
+ "@fullcalendar/core": "7.0.0-beta.1"
23
23
  },
24
24
  "type": "module",
25
25
  "bugs": "https://fullcalendar.io/reporting-bugs",