@fullcalendar/timeline 7.0.0-beta.3 → 7.0.0-beta.4

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
@@ -15,7 +15,7 @@ var premiumCommonPlugin__default = /*#__PURE__*/_interopDefaultLegacy(premiumCom
15
15
 
16
16
  var index = index_cjs.createPlugin({
17
17
  name: '@fullcalendar/timeline',
18
- premiumReleaseDate: '2024-12-19',
18
+ premiumReleaseDate: '2025-01-09',
19
19
  deps: [premiumCommonPlugin__default["default"]],
20
20
  initialView: 'timelineDay',
21
21
  views: {
package/index.global.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Timeline Plugin v7.0.0-beta.3
2
+ FullCalendar Timeline Plugin v7.0.0-beta.4
3
3
  Docs & License: https://fullcalendar.io/docs/timeline-view-no-resources
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -468,12 +468,10 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
468
468
  'fc-timeline-slot-major' :
469
469
  'fc-timeline-slot-minor'), 'fc-timeline-slot-lane fc-cell fc-flex-col fc-align-start', props.borderStart && 'fc-border-s', props.isDay ?
470
470
  internal$1.getDayClassName(dateMeta) :
471
- internal$1.getSlotClassName(dateMeta)), attrs: {
472
- 'data-date': dateEnv.formatIso(date, {
471
+ internal$1.getSlotClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(date, {
473
472
  omitTimeZoneOffset: true,
474
473
  omitTime: !tDateProfile.isTimeScale,
475
- }),
476
- }, style: {
474
+ }) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
477
475
  width: props.width,
478
476
  }, renderProps: renderProps, generatorName: "slotLaneContent", customGenerator: options.slotLaneContent, classNameGenerator: options.slotLaneClassNames, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }, (InnerContent) => (preact.createElement(InnerContent, { tag: "div", className: 'fc-cell-inner', elRef: this.innerElRef }))));
479
477
  }
@@ -510,7 +508,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
510
508
  let { tDateProfile, slotWidth } = props;
511
509
  let { slotDates, isWeekStarts } = tDateProfile;
512
510
  let isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit;
513
- return (preact.createElement("div", { className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
511
+ return (preact.createElement("div", { "aria-hidden": true, className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
514
512
  let key = slotDate.toISOString();
515
513
  return (preact.createElement(TimelineSlatCell, { key: key, date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay, borderStart: Boolean(i),
516
514
  // ref
@@ -904,7 +902,6 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
904
902
  super(...arguments);
905
903
  // memo
906
904
  this.refineRenderProps = internal$1.memoizeObjArg(refineRenderProps);
907
- this.buildCellNavLinkAttrs = internal$1.memoize(buildCellNavLinkAttrs);
908
905
  // ref
909
906
  this.innerElRef = preact.createRef();
910
907
  }
@@ -923,21 +920,24 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
923
920
  dateEnv: context.dateEnv,
924
921
  viewApi: context.viewApi,
925
922
  });
923
+ let isNavLink = !dateMeta.isDisabled && (cell.rowUnit && cell.rowUnit !== 'time');
926
924
  return (preact.createElement(internal$1.ContentContainer, { tag: "div", className: internal$1.joinClassNames('fc-timeline-slot-label fc-timeline-slot', cell.isWeekStart && 'fc-timeline-slot-em', // TODO: document this semantic className
927
925
  'fc-header-cell fc-cell fc-flex-col fc-justify-center', props.borderStart && 'fc-border-s', props.isCentered ? 'fc-align-center' : 'fc-align-start',
928
926
  // TODO: so slot classnames for week/month/bigger. see note above about rowUnit
929
927
  cell.rowUnit === 'time' ?
930
928
  internal$1.getSlotClassName(dateMeta) :
931
- internal$1.getDayClassName(dateMeta)), attrs: {
932
- 'data-date': dateEnv.formatIso(cell.date, {
929
+ internal$1.getDayClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(cell.date, {
933
930
  omitTime: !tDateProfile.isTimeScale,
934
931
  omitTimeZoneOffset: true,
935
- }),
936
- }, style: {
932
+ }) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
937
933
  width: props.slotWidth != null
938
934
  ? props.slotWidth * cell.colspan
939
935
  : undefined,
940
- }, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (preact.createElement(InnerContent, { tag: "a", attrs: this.buildCellNavLinkAttrs(context, cell.date, cell.rowUnit), className: internal$1.joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
936
+ }, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (preact.createElement(InnerContent, { tag: 'div', attrs: isNavLink
937
+ // not tabbable because parent is aria-hidden
938
+ ? internal$1.buildNavLinkAttrs(context, cell.date, cell.rowUnit, undefined, /* isTabbable = */ false)
939
+ : {} // don't bother with aria-hidden because parent already hidden
940
+ , className: internal$1.joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
941
941
  }
942
942
  componentDidMount() {
943
943
  const { props } = this;
@@ -961,11 +961,6 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
961
961
  }
962
962
  // Utils
963
963
  // -------------------------------------------------------------------------------------------------
964
- function buildCellNavLinkAttrs(context, cellDate, rowUnit) {
965
- return (rowUnit && rowUnit !== 'time')
966
- ? internal$1.buildNavLinkAttrs(context, cellDate, rowUnit)
967
- : {};
968
- }
969
964
  function renderInnerContent(renderProps) {
970
965
  return renderProps.text;
971
966
  }
@@ -1089,23 +1084,15 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1089
1084
  endScrollbarWidth
1090
1085
  });
1091
1086
  };
1092
- this.handleTimeScroll = (scrollTime) => {
1087
+ this.handleTimeScrollRequest = (scrollTime) => {
1093
1088
  this.scrollTime = scrollTime;
1094
- this.updateScroll();
1089
+ this.applyTimeScroll();
1095
1090
  };
1096
- this.updateScroll = () => {
1097
- const { props, context, tDateProfile, scrollTime, slotWidth } = this;
1098
- if (scrollTime != null && slotWidth != null) {
1099
- let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
1100
- if (x) {
1101
- x += 1; // overcome border. TODO: DRY this up
1102
- }
1103
- this.syncedScroller.scrollTo({ x });
1091
+ this.handleTimeScrollEnd = ({ isUser }) => {
1092
+ if (isUser) {
1093
+ this.scrollTime = null;
1104
1094
  }
1105
1095
  };
1106
- this.clearScroll = () => {
1107
- this.scrollTime = null;
1108
- };
1109
1096
  // Hit System
1110
1097
  // -----------------------------------------------------------------------------------------------
1111
1098
  this.handeBodyEl = (el) => {
@@ -1154,7 +1141,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1154
1141
  enableNowIndicator && (preact.createElement(TimelineNowIndicatorArrow, { tDateProfile: tDateProfile, nowDate: nowDate, slotWidth: slotWidth }))),
1155
1142
  Boolean(state.endScrollbarWidth) && (preact.createElement("div", { className: 'fc-border-s fc-filler', style: { minWidth: state.endScrollbarWidth } }))),
1156
1143
  preact.createElement(internal$1.Scroller, { vertical: verticalScrolling, horizontal: true, hideScrollbars: props.forPrint, className: internal$1.joinClassNames('fc-timeline-body fc-flex-col', verticalScrolling && 'fc-liquid'), ref: this.bodyScrollerRef, clientWidthRef: this.handleClientWidth, endScrollbarWidthRef: this.handleEndScrollbarWidth },
1157
- preact.createElement("div", { className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
1144
+ preact.createElement("div", { "aria-label": options.eventsHint, className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
1158
1145
  preact.createElement(TimelineSlats, { dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange,
1159
1146
  // ref
1160
1147
  innerWidthRef: this.handleBodySlotInnerWidth,
@@ -1172,8 +1159,8 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1172
1159
  this.syncedScroller = new internal$2.ScrollerSyncer(true); // horizontal=true
1173
1160
  this.updateSyncedScroller();
1174
1161
  this.resetScroll();
1175
- this.context.emitter.on('_timeScrollRequest', this.handleTimeScroll);
1176
- this.syncedScroller.addScrollEndListener(this.clearScroll);
1162
+ this.context.emitter.on('_timeScrollRequest', this.handleTimeScrollRequest);
1163
+ this.syncedScroller.addScrollEndListener(this.handleTimeScrollEnd);
1177
1164
  }
1178
1165
  componentDidUpdate(prevProps) {
1179
1166
  this.updateSyncedScroller();
@@ -1182,13 +1169,13 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1182
1169
  }
1183
1170
  else {
1184
1171
  // TODO: inefficient to update so often
1185
- this.updateScroll();
1172
+ this.applyTimeScroll();
1186
1173
  }
1187
1174
  }
1188
1175
  componentWillUnmount() {
1189
1176
  this.syncedScroller.destroy();
1190
- this.context.emitter.off('_timeScrollRequest', this.handleTimeScroll);
1191
- this.syncedScroller.removeScrollEndListener(this.clearScroll);
1177
+ this.context.emitter.off('_timeScrollRequest', this.handleTimeScrollRequest);
1178
+ this.syncedScroller.removeScrollEndListener(this.handleTimeScrollEnd);
1192
1179
  }
1193
1180
  // Scrolling
1194
1181
  // -----------------------------------------------------------------------------------------------
@@ -1200,7 +1187,17 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1200
1187
  ]);
1201
1188
  }
1202
1189
  resetScroll() {
1203
- this.handleTimeScroll(this.context.options.scrollTime);
1190
+ this.handleTimeScrollRequest(this.context.options.scrollTime);
1191
+ }
1192
+ applyTimeScroll() {
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 += 1; // overcome border. TODO: DRY this up
1198
+ }
1199
+ this.syncedScroller.scrollTo({ x });
1200
+ }
1204
1201
  }
1205
1202
  queryHit(positionLeft, positionTop, elWidth, elHeight) {
1206
1203
  const { props, context, tDateProfile, slotWidth } = this;
@@ -1252,7 +1249,7 @@ FullCalendar.Timeline = (function (exports, core, premiumCommonPlugin, internal$
1252
1249
 
1253
1250
  var plugin = core.createPlugin({
1254
1251
  name: '@fullcalendar/timeline',
1255
- premiumReleaseDate: '2024-12-19',
1252
+ premiumReleaseDate: '2025-01-09',
1256
1253
  deps: [premiumCommonPlugin__default["default"]],
1257
1254
  initialView: 'timelineDay',
1258
1255
  views: {
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar Timeline Plugin v7.0.0-beta.3
2
+ FullCalendar Timeline Plugin v7.0.0-beta.4
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,s){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}var a=l(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 s={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)}}(s,e,t),h(s,e,t),function(e,t,n){const{currentRange:r}=t;let{slotDuration:s}=e;if(!s){const l=h(e,t,n);for(let e of o){const t=i.createDuration(e),n=i.wholeDivideDurations(l,t);if(null!==n&&n>1&&n<=6){s=t;break}}if(s){n.countDurationsBetween(r.start,r.end,s)>200&&(s=null)}s||(s=l),e.slotDuration=s}}(s,e,t);let l=n.slotLabelFormat,a=Array.isArray(l)?l:null!=l?[l]:function(e,t,n,r){let s,l;const{labelInterval:a}=e;let o=i.greatestDurationDenominator(a).unit;const c=r.weekNumbers;let d=s=l=null;"week"!==o||c||(o="day");switch(o){case"year":d={year:"numeric"};break;case"month":m("years",t,n)>1&&(d={year:"numeric"}),s={month:"short"};break;case"week":m("years",t,n)>1&&(d={year:"numeric"}),s={week:"narrow"};break;case"day":m("years",t,n)>1?d={year:"numeric",month:"long"}:m("months",t,n)>1&&(d={month:"long"}),c&&(s={week:"short"}),l={weekday:"narrow",day:"numeric"};break;case"hour":c&&(d={week:"short"}),m("days",t,n)>1&&(s={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),l={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":i.asRoughMinutes(a)/60>=6?(d={hour:"numeric",meridiem:"short"},s=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"},s=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"},s=e=>"."+i.padStart(e.millisecond,3)}return[].concat(d||[],s||[],l||[])}(s,e,t,n);s.headerFormats=a.map(e=>i.createFormatter(e)),s.isTimeScale=Boolean(s.slotDuration.milliseconds);let c=null;if(!s.isTimeScale){const e=i.greatestDurationDenominator(s.slotDuration).unit;/year|month|week/.test(e)&&(c=e)}s.largeUnit=c,s.emphasizeWeeks=1===i.asCleanDays(s.slotDuration)&&m("weeks",e,t)>=2&&!n.businessHours;let g,p,v=n.snapDuration;v&&(g=i.createDuration(v),p=i.wholeDivideDurations(s.slotDuration,g)),null==p&&(g=s.slotDuration,p=1),s.snapDuration=g,s.snapsPerSlot=p;let S=i.asRoughMs(e.slotMaxTime)-i.asRoughMs(e.slotMinTime),R=d(e.renderRange.start,s,t),D=d(e.renderRange.end,s,t);s.isTimeScale&&(R=t.add(R,e.slotMinTime),D=t.add(i.addDays(D,-1),e.slotMaxTime)),s.timeWindowMs=S,s.normalizedRange={start:R,end:D};let y=[],w=R;for(;w<D;)f(w,s,e,r)&&y.push(w),w=t.add(w,s.slotDuration);s.slotDates=y;let b=-1,E=0;const x=[],W=[];for(w=R;w<D;)f(w,s,e,r)?(b+=1,x.push(b),W.push(E)):x.push(b+.5),w=t.add(w,s.snapDuration),E+=1;return s.snapDiffToIndex=x,s.snapIndexToDiff=W,s.snapCnt=b+1,s.slotCnt=s.snapCnt/s.snapsPerSlot,s.isWeekStarts=function(e,t){let{slotDates:n,emphasizeWeeks:i}=e,r=null,s=[];for(let e of n){let n=t.computeWeekNumber(e),l=i&&null!==r&&r!==n;r=n,s.push(l)}return s}(s,t),s.cellRows=function(e,t){let n=e.slotDates,r=e.headerFormats,s=r.map(()=>[]),l=i.asCleanDays(e.slotDuration),a=7===l?"week":1===l?"day":null,o=r.map(e=>e.getLargestUnit?e.getLargestUnit():null);for(let l=0;l<n.length;l+=1){let c=n[l],d=e.isWeekStarts[l];for(let n=0;n<r.length;n+=1){let l=r[n],f=s[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,l);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,l);p=u(c,e,v)}else h.colspan+=1;p&&(p.weekStart=d,f.push(p))}}return s}(s,t),s.slotsPerLabel=i.wholeDivideDurations(s.labelInterval,s.slotDuration),s}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),s=e.valueOf()-r.valueOf()-i.asRoughMs(n.slotMinTime);return s=(s%864e5+864e5)%864e5,s<t.timeWindowMs}return!0}function h(e,t,n){const{currentRange:r}=t;let{labelInterval:s}=e;if(!s){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){s=n;break}}s||(s=e.slotDuration)}else for(t of o){s=i.createDuration(t);if(n.countDurationsBetween(r.start,r.end,s)>=18)break}e.labelInterval=s}return s}function m(e,t,n){let r=t.currentRange,s=null;return"years"===e?s=n.diffWholeYears(r.start,r.end):"months"===e||"weeks"===e?s=n.diffWholeMonths(r.start,r.end):"days"===e&&(s=i.diffWholeDays(r.start,r.end)),s||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:s}=t,{date:l,tDateProfile:a,isEm:o}=e,c=i.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),d=Object.assign(Object.assign({date:n.toDate(e.date)},c),{view:t.viewApi});return r.createElement(i.ContentContainer,{tag:"div",className:i.joinClassNames("fc-timeline-slot",o&&"fc-timeline-slot-em",a.isTimeScale&&(i.isInt(n.countDurationsBetween(a.normalizedRange.start,e.date,a.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor"),"fc-timeline-slot-lane fc-cell fc-flex-col fc-align-start",e.borderStart&&"fc-border-s",e.isDay?i.getDayClassName(c):i.getSlotClassName(c)),attrs:{"data-date":n.formatIso(l,{omitTimeZoneOffset:!0,omitTime:!a.isTimeScale})},style:{width:e.width},renderProps:d,generatorName:"slotLaneContent",customGenerator:s.slotLaneContent,classNameGenerator:s.slotLaneClassNames,didMount:s.slotLaneDidMount,willUnmount:s.slotLaneWillUnmount},e=>r.createElement(e,{tag:"div",className:"fc-cell-inner",elRef:this.innerElRef}))}componentDidMount(){const e=this.innerElRef.current;this.disconnectInnerWidth=i.watchWidth(e,e=>{i.setRef(this.props.innerWidthRef,e)})}componentWillUnmount(){this.disconnectInnerWidth(),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:s,isWeekStarts:l}=n,a=!n.isTimeScale&&!n.largeUnit;return r.createElement("div",{className:"fc-timeline-slots fc-fill fc-flex-row",style:{height:e.height}},s.map((s,o)=>{let c=s.toISOString();return r.createElement(g,{key:c,date:s,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:l[o],isDay:a,borderStart:Boolean(o),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 s=Math.floor(r),l=t.snapDiffToIndex[s];return i.isInt(l)?l+=r-s:l=Math.ceil(l),l}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 s=r/e;let l,a;return s>=(n=Math.max(n||0,(i+1)/t,30))?(l=!0,a=s):(l=!1,a=Math.max(n,s)),[a*e,a,l]}function y(e,t,n,r,s){let l=t.add(n.activeRange.start,e);return r.isTimeScale||(l=i.startOfDay(l)),w(l,t,r,s)}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 s=Math.floor(r),l=t.snapDiffToIndex[s];i.isInt(l)?l+=r-s:l=Math.ceil(l);return l}(e,n,t)/n.snapsPerSlot*r}function b(e,t,n,r,s){const l={};for(const a of e)l[i.getEventKey(a)]=E(a,t,n,r,s);return l}function E(e,t,n,i,r){const s=w(e.startDate,n,i,r);let l=w(e.endDate,n,i,r)-s;return t&&(l=Math.max(l,t)),{start:s,size:l}}class x extends i.BaseComponent{render(){let{props:e}=this,t=[].concat(e.eventResizeSegs,e.dateSelectionSegs);return r.createElement(r.Fragment,null,this.renderSegs(e.businessHourSegs||[],"non-business"),this.renderSegs(e.bgEventSegs||[],"bg-event"),this.renderSegs(t,"highlight"))}renderSegs(e,t){let{tDateProfile:n,todayRange:s,nowDate:l,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(E(e,void 0,o,n,a),c)}return r.createElement("div",{key:i.buildEventRangeKey(e.eventRange),className:"fc-fill-y",style:d},"bg-event"===t?r.createElement(i.BgEvent,Object.assign({eventRange:e.eventRange,isStart:e.isStart,isEnd:e.isEnd},i.getEventRangeMeta(e.eventRange,s,l))):i.renderFill(t))}))}}class W extends i.Slicer{sliceRange(e,t,n,r,s){let l=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,s),a=[];if(v(l.start,r,s)<v(l.end,r,s)){let e=i.intersectRanges(l,r.normalizedRange);e&&a.push({startDate:e.start,endDate:e.end,isStart:e.start.valueOf()===l.start.valueOf()&&f(e.start,r,t,n),isEnd:e.end.valueOf()===l.end.valueOf()&&f(i.addMs(e.end,-1),r,t,n)})}return a}}const M=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,{className:i.joinClassNames("fc-timeline-event",!1===n.eventOverlap&&"fc-timeline-event-spacious","fc-h-event"),defaultTimeFormat:M,defaultDisplayEventTime:!e.isTimeScale}))}}class k extends i.BaseComponent{render(){let{props:e}=this,{hiddenSegs:t,resourceId:n,forcedInvisibleMap:s}=e,l=n?{resourceId:n}:{};return r.createElement(i.MoreLinkContainer,{className:"fc-timeline-more-link",allDayDate:null,segs:t,hiddenSegs:t,dateProfile:e.dateProfile,todayRange:e.todayRange,dateSpanProps:l,popoverContent:()=>r.createElement(r.Fragment,null,t.map(t=>{let{eventRange:n}=t,l=n.instance.instanceId;return r.createElement("div",{key:l,style:{visibility:s[l]?"hidden":""}},r.createElement(I,Object.assign({isTimeScale:e.isTimeScale,eventRange:n,isStart:t.isStart,isEnd:t.isEnd,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:l===e.eventSelection},i.getEventRangeMeta(n,e.todayRange,e.nowDate))))}))},e=>r.createElement(e,{tag:"div",className:"fc-timeline-more-link-inner fc-sticky-s"}))}}class P 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.disconnectHeight=i.watchHeight(e,e=>{i.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.disconnectHeight(),i.setRef(this.props.heightRef,null)}}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 W,this.handleMoreLinkHeights=()=>{this.setState({moreLinkHeightRev:this.moreLinkHeightRefMap.rev})},this.handleSegHeights=()=>{this.setState({segHeightRev:this.segHeightRefMap.rev})}}render(){let{props:e,context:t,segHeightRefMap:n,moreLinkHeightRefMap:s}=this,{options:l}=t,{dateProfile:a,tDateProfile:o}=e,c=this.slicer.sliceProps(e,a,o.isTimeScale?null:e.nextDayThreshold,t,a,t.dateProfileGenerator,o,t.dateEnv),d=(c.eventDrag?c.eventDrag.segs:null)||(c.eventResize?c.eventResize.segs:null)||[],f=this.sortEventSegs(c.fgEventSegs,l.eventOrder),h=null!=e.slotWidth?b(f,l.eventMinWidth,t.dateEnv,o,e.slotWidth):{},[m,u,g,p]=function(e,t,n,r,s,l){const a=[];for(const n of e){const e=t[i.getEventKey(n)];e&&a.push(Object.assign(Object.assign({},n),{start:e.start,end:e.start+e.size}))}const o=new i.SegHierarchy(a,e=>n.get(i.getEventKey(e)),s,void 0,l),c=new Map;o.traverseSegs((e,t)=>{c.set(i.getEventKey(e),t)});const{hiddenSegs:d}=o;let f=0;for(const e of a){const t=i.getEventKey(e),r=n.get(t),s=c.get(t);null!=r&&null!=s&&(f=Math.max(f,s+r))}const h=i.groupIntersectingSegs(d),m=new Map;o.strictOrder=!0;for(const e of h){const{levelCoord:t}=o.findInsertion(e,0),n=r.get(e.key)||0;m.set(e.key,t),f=Math.max(f,t+n)}return[c,h,m,f]}(f,h,n.current,s.current,l.eventOrderStrict,l.eventMaxStack),v=(c.eventDrag?c.eventDrag.affectedInstances:null)||(c.eventResize?c.eventResize.affectedInstances:null)||{};return r.createElement(r.Fragment,null,r.createElement(x,{tDateProfile:o,nowDate:e.nowDate,todayRange:e.todayRange,bgEventSegs:c.bgEventSegs,businessHourSegs:c.businessHourSegs,dateSelectionSegs:c.dateSelectionSegs,eventResizeSegs:c.eventResize?c.eventResize.segs:[],slotWidth:e.slotWidth}),r.createElement("div",{className:i.joinClassNames("fc-timeline-events",!1===l.eventOverlap?"fc-timeline-events-overlap-disabled":"fc-timeline-events-overlap-enabled","fc-content-box"),style:{height:p}},this.renderFgSegs(f,h,m,v,u,g,!1,!1,!1),this.renderFgSegs(d,e.slotWidth?b(d,l.eventMinWidth,t.dateEnv,o,e.slotWidth):{},m,{},[],new Map,Boolean(c.eventDrag),Boolean(c.eventResize),!1)))}renderFgSegs(e,t,n,s,l,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:l}=e,{instanceId:a}=l.instance,u=n.get(a),p=t[a],v=g||p&&null!=u&&!s[a];return r.createElement(P,{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:l,isStart:e.isStart,isEnd:e.isEnd,isDragging:o,isResizing:c,isDateSelecting:d,isSelected:a===f.eventSelection},i.getEventRangeMeta(l,f.todayRange,f.nowDate))))}),l.map(e=>r.createElement(P,{key:e.key,style:Object.assign({top:a.get(e.key)||0},S({start:e.start,size:e.end-e.start},h.isRtl)),heightRef:u.createRef(e.key)},r.createElement(k,{hiddenSegs:e.segs,dateProfile:f.dateProfile,nowDate:f.nowDate,todayRange:f.todayRange,isTimeScale:f.tDateProfile.isTimeScale,eventSelection:f.eventSelection,resourceId:f.resourceId,forcedInvisibleMap:s}))))}}class C extends i.BaseComponent{constructor(){super(...arguments),this.refineRenderProps=i.memoizeObjArg(L),this.buildCellNavLinkAttrs=i.memoize(z),this.innerElRef=r.createRef()}render(){let{props:e,context:t}=this,{dateEnv:n,options:s}=t,{cell:l,dateProfile:a,tDateProfile:o}=e,c=i.getDateMeta(l.date,e.todayRange,e.nowDate,a),d=this.refineRenderProps({level:e.rowLevel,dateMarker:l.date,text:l.text,dateEnv:t.dateEnv,viewApi:t.viewApi});return r.createElement(i.ContentContainer,{tag:"div",className:i.joinClassNames("fc-timeline-slot-label fc-timeline-slot",l.isWeekStart&&"fc-timeline-slot-em","fc-header-cell fc-cell fc-flex-col fc-justify-center",e.borderStart&&"fc-border-s",e.isCentered?"fc-align-center":"fc-align-start","time"===l.rowUnit?i.getSlotClassName(c):i.getDayClassName(c)),attrs:{"data-date":n.formatIso(l.date,{omitTime:!o.isTimeScale,omitTimeZoneOffset:!0})},style:{width:null!=e.slotWidth?e.slotWidth*l.colspan:void 0},renderProps:d,generatorName:"slotLabelContent",customGenerator:s.slotLabelContent,defaultGenerator:N,classNameGenerator:s.slotLabelClassNames,didMount:s.slotLabelDidMount,willUnmount:s.slotLabelWillUnmount},n=>r.createElement(n,{tag:"a",attrs:this.buildCellNavLinkAttrs(t,l.date,l.rowUnit),className:i.joinClassNames("fc-cell-inner fc-padding-md",e.isSticky&&"fc-sticky-s"),elRef:this.innerElRef}))}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 z(e,t,n){return n&&"time"!==n?i.buildNavLinkAttrs(e,t,n):{}}function N(e){return e.text}function L(e){return{level:e.level,date:e.dateEnv.toDate(e.dateMarker),view:e.viewApi,text:e.text}}class H 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,s=!(e.tDateProfile.isTimeScale&&e.isLastRow),l=!e.isLastRow;return r.createElement("div",{className:i.joinClassNames("fc-flex-row fc-grow",!e.isLastRow&&"fc-border-b")},e.cells.map((i,a)=>{const o=i.rowUnit+":"+i.date.toISOString();return r.createElement(C,{key:o,cell:i,rowLevel:e.rowLevel,dateProfile:e.dateProfile,tDateProfile:e.tDateProfile,todayRange:e.todayRange,nowDate:e.nowDate,isCentered:s,isSticky:l,borderStart:Boolean(a),innerWidthRef:t.createRef(o),innerHeightRef:n.createRef(o),slotWidth:e.slotWidth})}))}componentWillUnmount(){i.setRef(this.props.innerWidthRef,null),i.setRef(this.props.innerHeighRef,null)}}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,{className:"fc-timeline-now-indicator-line",style:null!=e.slotWidth?R(w(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,{className:"fc-timeline-now-indicator-arrow",style:null!=e.slotWidth?R(w(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!0,date:e.nowDate}))}}class j 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.handleClientWidth=e=>{this.setState({clientWidth:e})},this.handleEndScrollbarWidth=e=>{this.setState({endScrollbarWidth: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 s=y(i,t.dateEnv,e.dateProfile,n,r);s&&(s+=1),this.syncedScroller.scrollTo({x:s})}},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:s}=n,l=this.tDateProfile=this.buildTimelineDateProfile(e.dateProfile,n.dateEnv,s,n.dateProfileGenerator),{cellRows:a}=l,o=i.greatestDurationDenominator(l.slotDuration).unit,c=!e.forPrint&&!i.getIsHeightAuto(s),d=!e.forPrint&&i.getStickyHeaderDates(s),f=!e.forPrint&&i.getStickyFooterScrollbar(s),[h,m]=this.computeSlotWidth(l.slotCnt,l.slotsPerLabel,s.slotMinWidth,t.slotInnerWidth,t.clientWidth);return this.slotWidth=m,r.createElement(i.NowTimer,{unit:o},(o,u)=>{const g=s.nowIndicator&&null!=m&&i.rangeContainsMarker(e.dateProfile.currentRange,o);return r.createElement(i.ViewContainer,{viewSpec:n.viewSpec,className:i.joinClassNames("fc-timeline fc-border",!e.forPrint&&"fc-flex-col")},r.createElement(i.Scroller,{horizontal:!0,hideScrollbars:!0,className:i.joinClassNames("fc-timeline-header fc-flex-row fc-border-b",d&&"fc-table-header-sticky"),ref:this.headerScrollerRef},r.createElement("div",{className:i.joinClassNames("fc-rel",null==h&&"fc-liquid"),style:{width:h}},a.map((t,n)=>{const i=n===a.length-1;return r.createElement(H,{key:n,dateProfile:e.dateProfile,tDateProfile:l,nowDate:o,todayRange:u,rowLevel:n,isLastRow:i,cells:t,slotWidth:m,innerWidthRef:this.headerRowInnerWidthMap.createRef(n)})}),g&&r.createElement(B,{tDateProfile:l,nowDate:o,slotWidth:m})),Boolean(t.endScrollbarWidth)&&r.createElement("div",{className:"fc-border-s fc-filler",style:{minWidth:t.endScrollbarWidth}})),r.createElement(i.Scroller,{vertical:c,horizontal:!0,hideScrollbars:e.forPrint,className:i.joinClassNames("fc-timeline-body fc-flex-col",c&&"fc-liquid"),ref:this.bodyScrollerRef,clientWidthRef:this.handleClientWidth,endScrollbarWidthRef:this.handleEndScrollbarWidth},r.createElement("div",{className:"fc-rel fc-grow",style:{width:h},ref:this.handeBodyEl},r.createElement(p,{dateProfile:e.dateProfile,tDateProfile:l,nowDate:o,todayRange:u,innerWidthRef:this.handleBodySlotInnerWidth,slotWidth:m}),r.createElement(T,{dateProfile:e.dateProfile,tDateProfile:l,nowDate:o,todayRange:u,nextDayThreshold:s.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(O,{tDateProfile:l,nowDate:o,slotWidth:m}))),f&&r.createElement(i.Scroller,{ref:this.footerScrollerRef,horizontal:!0},r.createElement("div",{style:{width:h}})))})}componentDidMount(){this.syncedScroller=new s.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:s,context:l,tDateProfile:a,slotWidth:o}=this,{dateEnv:c}=l;if(o){const t=l.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 l.isRtl?(m=n-R,u=n-S):(m=S,u=R),{dateProfile:s.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-events{position:relative;z-index:2}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px}.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 .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event-spacious .fc-event-inner{padding-bottom:5px;padding-top:5px}.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-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-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-now-indicator-container{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow{border-bottom-style:solid;border-bottom-width:0;border-color:var(--fc-now-indicator-color);border-left:5px solid transparent;border-right:5px solid transparent;border-top-style:solid;border-top-width:6px;height:0;margin:0 -5px;position:absolute;top:0;width:0}.fc-timeline-now-indicator-line{border-left:1px solid var(--fc-now-indicator-color);bottom:0;position:absolute;top:0}');var U=t.createPlugin({name:"@fullcalendar/timeline",premiumReleaseDate:"2024-12-19",deps:[a.default],initialView:"timelineDay",views:{timeline:{component:j,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:j,TimelineLane:T,TimelineLaneBg:x,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,TimelineLaneSlicer:W,TimelineHeaderRow:H,TimelineNowIndicatorArrow:B,TimelineNowIndicatorLine:O};return t.globalPlugins.push(U),e.Internal=F,e.default=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal,FullCalendar.Preact,FullCalendar.ScrollGrid.Internal);
6
+ FullCalendar.Timeline=function(e,t,n,i,r,s){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}var l=a(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 s={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)}}(s,e,t),h(s,e,t),function(e,t,n){const{currentRange:r}=t;let{slotDuration:s}=e;if(!s){const a=h(e,t,n);for(let e of o){const t=i.createDuration(e),n=i.wholeDivideDurations(a,t);if(null!==n&&n>1&&n<=6){s=t;break}}if(s){n.countDurationsBetween(r.start,r.end,s)>200&&(s=null)}s||(s=a),e.slotDuration=s}}(s,e,t);let a=n.slotLabelFormat,l=Array.isArray(a)?a:null!=a?[a]:function(e,t,n,r){let s,a;const{labelInterval:l}=e;let o=i.greatestDurationDenominator(l).unit;const c=r.weekNumbers;let d=s=a=null;"week"!==o||c||(o="day");switch(o){case"year":d={year:"numeric"};break;case"month":m("years",t,n)>1&&(d={year:"numeric"}),s={month:"short"};break;case"week":m("years",t,n)>1&&(d={year:"numeric"}),s={week:"narrow"};break;case"day":m("years",t,n)>1?d={year:"numeric",month:"long"}:m("months",t,n)>1&&(d={month:"long"}),c&&(s={week:"short"}),a={weekday:"narrow",day:"numeric"};break;case"hour":c&&(d={week:"short"}),m("days",t,n)>1&&(s={weekday:"short",day:"numeric",month:"numeric",omitCommas:!0}),a={hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"short"};break;case"minute":i.asRoughMinutes(l)/60>=6?(d={hour:"numeric",meridiem:"short"},s=e=>":"+i.padStart(e.date.minute,2)):d={hour:"numeric",minute:"numeric",meridiem:"short"};break;case"second":i.asRoughSeconds(l)/60>=6?(d={hour:"numeric",minute:"2-digit",meridiem:"lowercase"},s=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"},s=e=>"."+i.padStart(e.millisecond,3)}return[].concat(d||[],s||[],a||[])}(s,e,t,n);s.headerFormats=l.map(e=>i.createFormatter(e)),s.isTimeScale=Boolean(s.slotDuration.milliseconds);let c=null;if(!s.isTimeScale){const e=i.greatestDurationDenominator(s.slotDuration).unit;/year|month|week/.test(e)&&(c=e)}s.largeUnit=c,s.emphasizeWeeks=1===i.asCleanDays(s.slotDuration)&&m("weeks",e,t)>=2&&!n.businessHours;let g,p,v=n.snapDuration;v&&(g=i.createDuration(v),p=i.wholeDivideDurations(s.slotDuration,g)),null==p&&(g=s.slotDuration,p=1),s.snapDuration=g,s.snapsPerSlot=p;let S=i.asRoughMs(e.slotMaxTime)-i.asRoughMs(e.slotMinTime),R=d(e.renderRange.start,s,t),D=d(e.renderRange.end,s,t);s.isTimeScale&&(R=t.add(R,e.slotMinTime),D=t.add(i.addDays(D,-1),e.slotMaxTime)),s.timeWindowMs=S,s.normalizedRange={start:R,end:D};let y=[],w=R;for(;w<D;)f(w,s,e,r)&&y.push(w),w=t.add(w,s.slotDuration);s.slotDates=y;let b=-1,E=0;const x=[],W=[];for(w=R;w<D;)f(w,s,e,r)?(b+=1,x.push(b),W.push(E)):x.push(b+.5),w=t.add(w,s.snapDuration),E+=1;return s.snapDiffToIndex=x,s.snapIndexToDiff=W,s.snapCnt=b+1,s.slotCnt=s.snapCnt/s.snapsPerSlot,s.isWeekStarts=function(e,t){let{slotDates:n,emphasizeWeeks:i}=e,r=null,s=[];for(let e of n){let n=t.computeWeekNumber(e),a=i&&null!==r&&r!==n;r=n,s.push(a)}return s}(s,t),s.cellRows=function(e,t){let n=e.slotDates,r=e.headerFormats,s=r.map(()=>[]),a=i.asCleanDays(e.slotDuration),l=7===a?"week":1===a?"day":null,o=r.map(e=>e.getLargestUnit?e.getLargestUnit():null);for(let a=0;a<n.length;a+=1){let c=n[a],d=e.isWeekStarts[a];for(let n=0;n<r.length;n+=1){let a=r[n],f=s[n],h=f[f.length-1],m=n===r.length-1,g=r.length>1&&!m,p=null,v=o[n]||(m?l:null);if(g){let e=t.format(c,a);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,a);p=u(c,e,v)}else h.colspan+=1;p&&(p.weekStart=d,f.push(p))}}return s}(s,t),s.slotsPerLabel=i.wholeDivideDurations(s.labelInterval,s.slotDuration),s}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),s=e.valueOf()-r.valueOf()-i.asRoughMs(n.slotMinTime);return s=(s%864e5+864e5)%864e5,s<t.timeWindowMs}return!0}function h(e,t,n){const{currentRange:r}=t;let{labelInterval:s}=e;if(!s){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){s=n;break}}s||(s=e.slotDuration)}else for(t of o){s=i.createDuration(t);if(n.countDurationsBetween(r.start,r.end,s)>=18)break}e.labelInterval=s}return s}function m(e,t,n){let r=t.currentRange,s=null;return"years"===e?s=n.diffWholeYears(r.start,r.end):"months"===e||"weeks"===e?s=n.diffWholeMonths(r.start,r.end):"days"===e&&(s=i.diffWholeDays(r.start,r.end)),s||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:s}=t,{date:a,tDateProfile:l,isEm:o}=e,c=i.getDateMeta(e.date,e.todayRange,e.nowDate,e.dateProfile),d=Object.assign(Object.assign({date:n.toDate(e.date)},c),{view:t.viewApi});return r.createElement(i.ContentContainer,{tag:"div",className:i.joinClassNames("fc-timeline-slot",o&&"fc-timeline-slot-em",l.isTimeScale&&(i.isInt(n.countDurationsBetween(l.normalizedRange.start,e.date,l.labelInterval))?"fc-timeline-slot-major":"fc-timeline-slot-minor"),"fc-timeline-slot-lane fc-cell fc-flex-col fc-align-start",e.borderStart&&"fc-border-s",e.isDay?i.getDayClassName(c):i.getSlotClassName(c)),attrs:Object.assign({"data-date":n.formatIso(a,{omitTimeZoneOffset:!0,omitTime:!l.isTimeScale})},c.isToday?{"aria-current":"date"}:{}),style:{width:e.width},renderProps:d,generatorName:"slotLaneContent",customGenerator:s.slotLaneContent,classNameGenerator:s.slotLaneClassNames,didMount:s.slotLaneDidMount,willUnmount:s.slotLaneWillUnmount},e=>r.createElement(e,{tag:"div",className:"fc-cell-inner",elRef:this.innerElRef}))}componentDidMount(){const e=this.innerElRef.current;this.disconnectInnerWidth=i.watchWidth(e,e=>{i.setRef(this.props.innerWidthRef,e)})}componentWillUnmount(){this.disconnectInnerWidth(),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:s,isWeekStarts:a}=n,l=!n.isTimeScale&&!n.largeUnit;return r.createElement("div",{"aria-hidden":!0,className:"fc-timeline-slots fc-fill fc-flex-row",style:{height:e.height}},s.map((s,o)=>{let c=s.toISOString();return r.createElement(g,{key:c,date:s,dateProfile:e.dateProfile,tDateProfile:n,nowDate:e.nowDate,todayRange:e.todayRange,isEm:a[o],isDay:l,borderStart:Boolean(o),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 s=Math.floor(r),a=t.snapDiffToIndex[s];return i.isInt(a)?a+=r-s:a=Math.ceil(a),a}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 s=r/e;let a,l;return s>=(n=Math.max(n||0,(i+1)/t,30))?(a=!0,l=s):(a=!1,l=Math.max(n,s)),[l*e,l,a]}function y(e,t,n,r,s){let a=t.add(n.activeRange.start,e);return r.isTimeScale||(a=i.startOfDay(a)),w(a,t,r,s)}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 s=Math.floor(r),a=t.snapDiffToIndex[s];i.isInt(a)?a+=r-s:a=Math.ceil(a);return a}(e,n,t)/n.snapsPerSlot*r}function b(e,t,n,r,s){const a={};for(const l of e)a[i.getEventKey(l)]=E(l,t,n,r,s);return a}function E(e,t,n,i,r){const s=w(e.startDate,n,i,r);let a=w(e.endDate,n,i,r)-s;return t&&(a=Math.max(a,t)),{start:s,size:a}}class x extends i.BaseComponent{render(){let{props:e}=this,t=[].concat(e.eventResizeSegs,e.dateSelectionSegs);return r.createElement(r.Fragment,null,this.renderSegs(e.businessHourSegs||[],"non-business"),this.renderSegs(e.bgEventSegs||[],"bg-event"),this.renderSegs(t,"highlight"))}renderSegs(e,t){let{tDateProfile:n,todayRange:s,nowDate:a,slotWidth:l}=this.props,{dateEnv:o,isRtl:c}=this.context;return r.createElement(r.Fragment,null,e.map(e=>{let d;if(null!=l){d=S(E(e,void 0,o,n,l),c)}return r.createElement("div",{key:i.buildEventRangeKey(e.eventRange),className:"fc-fill-y",style:d},"bg-event"===t?r.createElement(i.BgEvent,Object.assign({eventRange:e.eventRange,isStart:e.isStart,isEnd:e.isEnd},i.getEventRangeMeta(e.eventRange,s,a))):i.renderFill(t))}))}}class W extends i.Slicer{sliceRange(e,t,n,r,s){let a=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,s),l=[];if(v(a.start,r,s)<v(a.end,r,s)){let e=i.intersectRanges(a,r.normalizedRange);e&&l.push({startDate:e.start,endDate:e.end,isStart:e.start.valueOf()===a.start.valueOf()&&f(e.start,r,t,n),isEnd:e.end.valueOf()===a.end.valueOf()&&f(i.addMs(e.end,-1),r,t,n)})}return l}}const M=i.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});class T extends i.BaseComponent{render(){let{props:e,context:t}=this,{options:n}=t;return r.createElement(i.StandardEvent,Object.assign({},e,{className:i.joinClassNames("fc-timeline-event",!1===n.eventOverlap&&"fc-timeline-event-spacious","fc-h-event"),defaultTimeFormat:M,defaultDisplayEventTime:!e.isTimeScale}))}}class I extends i.BaseComponent{render(){let{props:e}=this,{hiddenSegs:t,resourceId:n,forcedInvisibleMap:s}=e,a=n?{resourceId:n}:{};return r.createElement(i.MoreLinkContainer,{className:"fc-timeline-more-link",allDayDate:null,segs:t,hiddenSegs:t,dateProfile:e.dateProfile,todayRange:e.todayRange,dateSpanProps:a,popoverContent:()=>r.createElement(r.Fragment,null,t.map(t=>{let{eventRange:n}=t,a=n.instance.instanceId;return r.createElement("div",{key:a,style:{visibility:s[a]?"hidden":""}},r.createElement(T,Object.assign({isTimeScale:e.isTimeScale,eventRange:n,isStart:t.isStart,isEnd:t.isEnd,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:a===e.eventSelection},i.getEventRangeMeta(n,e.todayRange,e.nowDate))))}))},e=>r.createElement(e,{tag:"div",className:"fc-timeline-more-link-inner fc-sticky-s"}))}}class k 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.disconnectHeight=i.watchHeight(e,e=>{i.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.disconnectHeight(),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 W,this.handleMoreLinkHeights=()=>{this.setState({moreLinkHeightRev:this.moreLinkHeightRefMap.rev})},this.handleSegHeights=()=>{this.setState({segHeightRev:this.segHeightRefMap.rev})}}render(){let{props:e,context:t,segHeightRefMap:n,moreLinkHeightRefMap:s}=this,{options:a}=t,{dateProfile:l,tDateProfile:o}=e,c=this.slicer.sliceProps(e,l,o.isTimeScale?null:e.nextDayThreshold,t,l,t.dateProfileGenerator,o,t.dateEnv),d=(c.eventDrag?c.eventDrag.segs:null)||(c.eventResize?c.eventResize.segs:null)||[],f=this.sortEventSegs(c.fgEventSegs,a.eventOrder),h=null!=e.slotWidth?b(f,a.eventMinWidth,t.dateEnv,o,e.slotWidth):{},[m,u,g,p]=function(e,t,n,r,s,a){const l=[];for(const n of e){const e=t[i.getEventKey(n)];e&&l.push(Object.assign(Object.assign({},n),{start:e.start,end:e.start+e.size}))}const o=new i.SegHierarchy(l,e=>n.get(i.getEventKey(e)),s,void 0,a),c=new Map;o.traverseSegs((e,t)=>{c.set(i.getEventKey(e),t)});const{hiddenSegs:d}=o;let f=0;for(const e of l){const t=i.getEventKey(e),r=n.get(t),s=c.get(t);null!=r&&null!=s&&(f=Math.max(f,s+r))}const h=i.groupIntersectingSegs(d),m=new Map;o.strictOrder=!0;for(const e of h){const{levelCoord:t}=o.findInsertion(e,0),n=r.get(e.key)||0;m.set(e.key,t),f=Math.max(f,t+n)}return[c,h,m,f]}(f,h,n.current,s.current,a.eventOrderStrict,a.eventMaxStack),v=(c.eventDrag?c.eventDrag.affectedInstances:null)||(c.eventResize?c.eventResize.affectedInstances:null)||{};return r.createElement(r.Fragment,null,r.createElement(x,{tDateProfile:o,nowDate:e.nowDate,todayRange:e.todayRange,bgEventSegs:c.bgEventSegs,businessHourSegs:c.businessHourSegs,dateSelectionSegs:c.dateSelectionSegs,eventResizeSegs:c.eventResize?c.eventResize.segs:[],slotWidth:e.slotWidth}),r.createElement("div",{className:i.joinClassNames("fc-timeline-events",!1===a.eventOverlap?"fc-timeline-events-overlap-disabled":"fc-timeline-events-overlap-enabled","fc-content-box"),style:{height:p}},this.renderFgSegs(f,h,m,v,u,g,!1,!1,!1),this.renderFgSegs(d,e.slotWidth?b(d,a.eventMinWidth,t.dateEnv,o,e.slotWidth):{},m,{},[],new Map,Boolean(c.eventDrag),Boolean(c.eventResize),!1)))}renderFgSegs(e,t,n,s,a,l,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:a}=e,{instanceId:l}=a.instance,u=n.get(l),p=t[l],v=g||p&&null!=u&&!s[l];return r.createElement(k,{key:l,style:Object.assign({visibility:v?"":"hidden",top:u||0},S(p,h.isRtl)),heightRef:g?void 0:m.createRef(l)},r.createElement(T,Object.assign({isTimeScale:f.tDateProfile.isTimeScale,eventRange:a,isStart:e.isStart,isEnd:e.isEnd,isDragging:o,isResizing:c,isDateSelecting:d,isSelected:l===f.eventSelection},i.getEventRangeMeta(a,f.todayRange,f.nowDate))))}),a.map(e=>r.createElement(k,{key:e.key,style:Object.assign({top:l.get(e.key)||0},S({start:e.start,size:e.end-e.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:s}))))}}class C extends i.BaseComponent{constructor(){super(...arguments),this.refineRenderProps=i.memoizeObjArg(N),this.innerElRef=r.createRef()}render(){let{props:e,context:t}=this,{dateEnv:n,options:s}=t,{cell:a,dateProfile:l,tDateProfile:o}=e,c=i.getDateMeta(a.date,e.todayRange,e.nowDate,l),d=this.refineRenderProps({level:e.rowLevel,dateMarker:a.date,text:a.text,dateEnv:t.dateEnv,viewApi:t.viewApi}),f=!c.isDisabled&&a.rowUnit&&"time"!==a.rowUnit;return r.createElement(i.ContentContainer,{tag:"div",className:i.joinClassNames("fc-timeline-slot-label fc-timeline-slot",a.isWeekStart&&"fc-timeline-slot-em","fc-header-cell fc-cell fc-flex-col fc-justify-center",e.borderStart&&"fc-border-s",e.isCentered?"fc-align-center":"fc-align-start","time"===a.rowUnit?i.getSlotClassName(c):i.getDayClassName(c)),attrs:Object.assign({"data-date":n.formatIso(a.date,{omitTime:!o.isTimeScale,omitTimeZoneOffset:!0})},c.isToday?{"aria-current":"date"}:{}),style:{width:null!=e.slotWidth?e.slotWidth*a.colspan:void 0},renderProps:d,generatorName:"slotLabelContent",customGenerator:s.slotLabelContent,defaultGenerator:z,classNameGenerator:s.slotLabelClassNames,didMount:s.slotLabelDidMount,willUnmount:s.slotLabelWillUnmount},n=>r.createElement(n,{tag:"div",attrs:f?i.buildNavLinkAttrs(t,a.date,a.rowUnit,void 0,!1):{},className:i.joinClassNames("fc-cell-inner fc-padding-md",e.isSticky&&"fc-sticky-s"),elRef:this.innerElRef}))}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 z(e){return e.text}function N(e){return{level:e.level,date:e.dateEnv.toDate(e.dateMarker),view:e.viewApi,text:e.text}}class L 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,s=!(e.tDateProfile.isTimeScale&&e.isLastRow),a=!e.isLastRow;return r.createElement("div",{className:i.joinClassNames("fc-flex-row fc-grow",!e.isLastRow&&"fc-border-b")},e.cells.map((i,l)=>{const o=i.rowUnit+":"+i.date.toISOString();return r.createElement(C,{key:o,cell:i,rowLevel:e.rowLevel,dateProfile:e.dateProfile,tDateProfile:e.tDateProfile,todayRange:e.todayRange,nowDate:e.nowDate,isCentered:s,isSticky:a,borderStart:Boolean(l),innerWidthRef:t.createRef(o),innerHeightRef:n.createRef(o),slotWidth:e.slotWidth})}))}componentWillUnmount(){i.setRef(this.props.innerWidthRef,null),i.setRef(this.props.innerHeighRef,null)}}class H extends i.BaseComponent{render(){const{props:e,context:t}=this;return r.createElement("div",{className:"fc-timeline-now-indicator-container"},r.createElement(i.NowIndicatorContainer,{className:"fc-timeline-now-indicator-line",style:null!=e.slotWidth?R(w(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!1,date:e.nowDate}))}}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,{className:"fc-timeline-now-indicator-arrow",style:null!=e.slotWidth?R(w(e.nowDate,t.dateEnv,e.tDateProfile,e.slotWidth),t.isRtl):{},isAxis:!0,date:e.nowDate}))}}class B 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.handleClientWidth=e=>{this.setState({clientWidth:e})},this.handleEndScrollbarWidth=e=>{this.setState({endScrollbarWidth:e})},this.handleTimeScrollRequest=e=>{this.scrollTime=e,this.applyTimeScroll()},this.handleTimeScrollEnd=({isUser:e})=>{e&&(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:s}=n,a=this.tDateProfile=this.buildTimelineDateProfile(e.dateProfile,n.dateEnv,s,n.dateProfileGenerator),{cellRows:l}=a,o=i.greatestDurationDenominator(a.slotDuration).unit,c=!e.forPrint&&!i.getIsHeightAuto(s),d=!e.forPrint&&i.getStickyHeaderDates(s),f=!e.forPrint&&i.getStickyFooterScrollbar(s),[h,m]=this.computeSlotWidth(a.slotCnt,a.slotsPerLabel,s.slotMinWidth,t.slotInnerWidth,t.clientWidth);return this.slotWidth=m,r.createElement(i.NowTimer,{unit:o},(o,u)=>{const g=s.nowIndicator&&null!=m&&i.rangeContainsMarker(e.dateProfile.currentRange,o);return r.createElement(i.ViewContainer,{viewSpec:n.viewSpec,className:i.joinClassNames("fc-timeline fc-border",!e.forPrint&&"fc-flex-col")},r.createElement(i.Scroller,{horizontal:!0,hideScrollbars:!0,className:i.joinClassNames("fc-timeline-header fc-flex-row fc-border-b",d&&"fc-table-header-sticky"),ref:this.headerScrollerRef},r.createElement("div",{className:i.joinClassNames("fc-rel",null==h&&"fc-liquid"),style:{width:h}},l.map((t,n)=>{const i=n===l.length-1;return r.createElement(L,{key:n,dateProfile:e.dateProfile,tDateProfile:a,nowDate:o,todayRange:u,rowLevel:n,isLastRow:i,cells:t,slotWidth:m,innerWidthRef:this.headerRowInnerWidthMap.createRef(n)})}),g&&r.createElement(O,{tDateProfile:a,nowDate:o,slotWidth:m})),Boolean(t.endScrollbarWidth)&&r.createElement("div",{className:"fc-border-s fc-filler",style:{minWidth:t.endScrollbarWidth}})),r.createElement(i.Scroller,{vertical:c,horizontal:!0,hideScrollbars:e.forPrint,className:i.joinClassNames("fc-timeline-body fc-flex-col",c&&"fc-liquid"),ref:this.bodyScrollerRef,clientWidthRef:this.handleClientWidth,endScrollbarWidthRef:this.handleEndScrollbarWidth},r.createElement("div",{"aria-label":s.eventsHint,className:"fc-rel fc-grow",style:{width:h},ref:this.handeBodyEl},r.createElement(p,{dateProfile:e.dateProfile,tDateProfile:a,nowDate:o,todayRange:u,innerWidthRef:this.handleBodySlotInnerWidth,slotWidth:m}),r.createElement(P,{dateProfile:e.dateProfile,tDateProfile:a,nowDate:o,todayRange:u,nextDayThreshold:s.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(H,{tDateProfile:a,nowDate:o,slotWidth:m}))),f&&r.createElement(i.Scroller,{ref:this.footerScrollerRef,horizontal:!0},r.createElement("div",{style:{width:h}})))})}componentDidMount(){this.syncedScroller=new s.ScrollerSyncer(!0),this.updateSyncedScroller(),this.resetScroll(),this.context.emitter.on("_timeScrollRequest",this.handleTimeScrollRequest),this.syncedScroller.addScrollEndListener(this.handleTimeScrollEnd)}componentDidUpdate(e){this.updateSyncedScroller(),e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset?this.resetScroll():this.applyTimeScroll()}componentWillUnmount(){this.syncedScroller.destroy(),this.context.emitter.off("_timeScrollRequest",this.handleTimeScrollRequest),this.syncedScroller.removeScrollEndListener(this.handleTimeScrollEnd)}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current])}resetScroll(){this.handleTimeScrollRequest(this.context.options.scrollTime)}applyTimeScroll(){const{props:e,context:t,tDateProfile:n,scrollTime:i,slotWidth:r}=this;if(null!=i&&null!=r){let s=y(i,t.dateEnv,e.dateProfile,n,r);s&&(s+=1),this.syncedScroller.scrollTo({x:s})}}queryHit(e,t,n,r){const{props:s,context:a,tDateProfile:l,slotWidth:o}=this,{dateEnv:c}=a;if(o){const t=a.isRtl?n-e:e,d=Math.floor(t/o),f=(t-d*o)/o,h=Math.floor(f*l.snapsPerSlot);let m,u,g=c.add(l.slotDates[d],i.multiplyDuration(l.snapDuration,h)),p=c.add(g,l.snapDuration),v=o/l.snapsPerSlot,S=d*o+v*h,R=S+v;return a.isRtl?(m=n-R,u=n-S):(m=S,u=R),{dateProfile:s.dateProfile,dateSpan:{range:{start:g,end:p},allDay:!l.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-events{position:relative;z-index:2}.fc-timeline-slot-minor{border-style:dotted}.fc-timeline-events-overlap-enabled{padding-bottom:10px}.fc-timeline-event{border-radius:0;font-size:var(--fc-small-font-size);margin-bottom:1px}.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 .fc-event-inner{align-items:center;display:flex;flex-direction:row;padding:2px 1px}.fc-timeline-event-spacious .fc-event-inner{padding-bottom:5px;padding-top:5px}.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-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-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-now-indicator-container{bottom:0;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;z-index:4}.fc-timeline-now-indicator-arrow{border-bottom-style:solid;border-bottom-width:0;border-color:var(--fc-now-indicator-color);border-left:5px solid transparent;border-right:5px solid transparent;border-top-style:solid;border-top-width:6px;height:0;margin:0 -5px;position:absolute;top:0;width:0}.fc-timeline-now-indicator-line{border-left:1px solid var(--fc-now-indicator-color);bottom:0;position:absolute;top:0}');var U=t.createPlugin({name:"@fullcalendar/timeline",premiumReleaseDate:"2025-01-09",deps:[l.default],initialView:"timelineDay",views:{timeline:{component:B,usesMinMaxTime:!0,eventResizableFromStart:!0},timelineDay:{type:"timeline",duration:{days:1}},timelineWeek:{type:"timeline",duration:{weeks:1}},timelineMonth:{type:"timeline",duration:{months:1}},timelineYear:{type:"timeline",duration:{years:1}}}}),j={__proto__:null,TimelineView:B,TimelineLane:P,TimelineLaneBg:x,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,TimelineLaneSlicer:W,TimelineHeaderRow:L,TimelineNowIndicatorArrow:O,TimelineNowIndicatorLine:H};return t.globalPlugins.push(U),e.Internal=j,e.default=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.PremiumCommon,FullCalendar.Internal,FullCalendar.Preact,FullCalendar.ScrollGrid.Internal);
package/index.js CHANGED
@@ -7,7 +7,7 @@ import '@fullcalendar/scrollgrid/internal.js';
7
7
 
8
8
  var index = createPlugin({
9
9
  name: '@fullcalendar/timeline',
10
- premiumReleaseDate: '2024-12-19',
10
+ premiumReleaseDate: '2025-01-09',
11
11
  deps: [premiumCommonPlugin],
12
12
  initialView: 'timelineDay',
13
13
  views: {
package/internal.cjs CHANGED
@@ -464,12 +464,10 @@ class TimelineSlatCell extends internal_cjs.BaseComponent {
464
464
  'fc-timeline-slot-major' :
465
465
  'fc-timeline-slot-minor'), 'fc-timeline-slot-lane fc-cell fc-flex-col fc-align-start', props.borderStart && 'fc-border-s', props.isDay ?
466
466
  internal_cjs.getDayClassName(dateMeta) :
467
- internal_cjs.getSlotClassName(dateMeta)), attrs: {
468
- 'data-date': dateEnv.formatIso(date, {
467
+ internal_cjs.getSlotClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(date, {
469
468
  omitTimeZoneOffset: true,
470
469
  omitTime: !tDateProfile.isTimeScale,
471
- }),
472
- }, style: {
470
+ }) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
473
471
  width: props.width,
474
472
  }, renderProps: renderProps, generatorName: "slotLaneContent", customGenerator: options.slotLaneContent, classNameGenerator: options.slotLaneClassNames, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }, (InnerContent) => (preact_cjs.createElement(InnerContent, { tag: "div", className: 'fc-cell-inner', elRef: this.innerElRef }))));
475
473
  }
@@ -506,7 +504,7 @@ class TimelineSlats extends internal_cjs.BaseComponent {
506
504
  let { tDateProfile, slotWidth } = props;
507
505
  let { slotDates, isWeekStarts } = tDateProfile;
508
506
  let isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit;
509
- return (preact_cjs.createElement("div", { className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
507
+ return (preact_cjs.createElement("div", { "aria-hidden": true, className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
510
508
  let key = slotDate.toISOString();
511
509
  return (preact_cjs.createElement(TimelineSlatCell, { key: key, date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay, borderStart: Boolean(i),
512
510
  // ref
@@ -900,7 +898,6 @@ class TimelineHeaderCell extends internal_cjs.BaseComponent {
900
898
  super(...arguments);
901
899
  // memo
902
900
  this.refineRenderProps = internal_cjs.memoizeObjArg(refineRenderProps);
903
- this.buildCellNavLinkAttrs = internal_cjs.memoize(buildCellNavLinkAttrs);
904
901
  // ref
905
902
  this.innerElRef = preact_cjs.createRef();
906
903
  }
@@ -919,21 +916,24 @@ class TimelineHeaderCell extends internal_cjs.BaseComponent {
919
916
  dateEnv: context.dateEnv,
920
917
  viewApi: context.viewApi,
921
918
  });
919
+ let isNavLink = !dateMeta.isDisabled && (cell.rowUnit && cell.rowUnit !== 'time');
922
920
  return (preact_cjs.createElement(internal_cjs.ContentContainer, { tag: "div", className: internal_cjs.joinClassNames('fc-timeline-slot-label fc-timeline-slot', cell.isWeekStart && 'fc-timeline-slot-em', // TODO: document this semantic className
923
921
  'fc-header-cell fc-cell fc-flex-col fc-justify-center', props.borderStart && 'fc-border-s', props.isCentered ? 'fc-align-center' : 'fc-align-start',
924
922
  // TODO: so slot classnames for week/month/bigger. see note above about rowUnit
925
923
  cell.rowUnit === 'time' ?
926
924
  internal_cjs.getSlotClassName(dateMeta) :
927
- internal_cjs.getDayClassName(dateMeta)), attrs: {
928
- 'data-date': dateEnv.formatIso(cell.date, {
925
+ internal_cjs.getDayClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(cell.date, {
929
926
  omitTime: !tDateProfile.isTimeScale,
930
927
  omitTimeZoneOffset: true,
931
- }),
932
- }, style: {
928
+ }) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
933
929
  width: props.slotWidth != null
934
930
  ? props.slotWidth * cell.colspan
935
931
  : undefined,
936
- }, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (preact_cjs.createElement(InnerContent, { tag: "a", attrs: this.buildCellNavLinkAttrs(context, cell.date, cell.rowUnit), className: internal_cjs.joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
932
+ }, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (preact_cjs.createElement(InnerContent, { tag: 'div', attrs: isNavLink
933
+ // not tabbable because parent is aria-hidden
934
+ ? internal_cjs.buildNavLinkAttrs(context, cell.date, cell.rowUnit, undefined, /* isTabbable = */ false)
935
+ : {} // don't bother with aria-hidden because parent already hidden
936
+ , className: internal_cjs.joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
937
937
  }
938
938
  componentDidMount() {
939
939
  const { props } = this;
@@ -957,11 +957,6 @@ class TimelineHeaderCell extends internal_cjs.BaseComponent {
957
957
  }
958
958
  // Utils
959
959
  // -------------------------------------------------------------------------------------------------
960
- function buildCellNavLinkAttrs(context, cellDate, rowUnit) {
961
- return (rowUnit && rowUnit !== 'time')
962
- ? internal_cjs.buildNavLinkAttrs(context, cellDate, rowUnit)
963
- : {};
964
- }
965
960
  function renderInnerContent(renderProps) {
966
961
  return renderProps.text;
967
962
  }
@@ -1085,23 +1080,15 @@ class TimelineView extends internal_cjs.DateComponent {
1085
1080
  endScrollbarWidth
1086
1081
  });
1087
1082
  };
1088
- this.handleTimeScroll = (scrollTime) => {
1083
+ this.handleTimeScrollRequest = (scrollTime) => {
1089
1084
  this.scrollTime = scrollTime;
1090
- this.updateScroll();
1085
+ this.applyTimeScroll();
1091
1086
  };
1092
- this.updateScroll = () => {
1093
- const { props, context, tDateProfile, scrollTime, slotWidth } = this;
1094
- if (scrollTime != null && slotWidth != null) {
1095
- let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
1096
- if (x) {
1097
- x += 1; // overcome border. TODO: DRY this up
1098
- }
1099
- this.syncedScroller.scrollTo({ x });
1087
+ this.handleTimeScrollEnd = ({ isUser }) => {
1088
+ if (isUser) {
1089
+ this.scrollTime = null;
1100
1090
  }
1101
1091
  };
1102
- this.clearScroll = () => {
1103
- this.scrollTime = null;
1104
- };
1105
1092
  // Hit System
1106
1093
  // -----------------------------------------------------------------------------------------------
1107
1094
  this.handeBodyEl = (el) => {
@@ -1150,7 +1137,7 @@ class TimelineView extends internal_cjs.DateComponent {
1150
1137
  enableNowIndicator && (preact_cjs.createElement(TimelineNowIndicatorArrow, { tDateProfile: tDateProfile, nowDate: nowDate, slotWidth: slotWidth }))),
1151
1138
  Boolean(state.endScrollbarWidth) && (preact_cjs.createElement("div", { className: 'fc-border-s fc-filler', style: { minWidth: state.endScrollbarWidth } }))),
1152
1139
  preact_cjs.createElement(internal_cjs.Scroller, { vertical: verticalScrolling, horizontal: true, hideScrollbars: props.forPrint, className: internal_cjs.joinClassNames('fc-timeline-body fc-flex-col', verticalScrolling && 'fc-liquid'), ref: this.bodyScrollerRef, clientWidthRef: this.handleClientWidth, endScrollbarWidthRef: this.handleEndScrollbarWidth },
1153
- preact_cjs.createElement("div", { className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
1140
+ preact_cjs.createElement("div", { "aria-label": options.eventsHint, className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
1154
1141
  preact_cjs.createElement(TimelineSlats, { dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange,
1155
1142
  // ref
1156
1143
  innerWidthRef: this.handleBodySlotInnerWidth,
@@ -1168,8 +1155,8 @@ class TimelineView extends internal_cjs.DateComponent {
1168
1155
  this.syncedScroller = new internal_cjs$1.ScrollerSyncer(true); // horizontal=true
1169
1156
  this.updateSyncedScroller();
1170
1157
  this.resetScroll();
1171
- this.context.emitter.on('_timeScrollRequest', this.handleTimeScroll);
1172
- this.syncedScroller.addScrollEndListener(this.clearScroll);
1158
+ this.context.emitter.on('_timeScrollRequest', this.handleTimeScrollRequest);
1159
+ this.syncedScroller.addScrollEndListener(this.handleTimeScrollEnd);
1173
1160
  }
1174
1161
  componentDidUpdate(prevProps) {
1175
1162
  this.updateSyncedScroller();
@@ -1178,13 +1165,13 @@ class TimelineView extends internal_cjs.DateComponent {
1178
1165
  }
1179
1166
  else {
1180
1167
  // TODO: inefficient to update so often
1181
- this.updateScroll();
1168
+ this.applyTimeScroll();
1182
1169
  }
1183
1170
  }
1184
1171
  componentWillUnmount() {
1185
1172
  this.syncedScroller.destroy();
1186
- this.context.emitter.off('_timeScrollRequest', this.handleTimeScroll);
1187
- this.syncedScroller.removeScrollEndListener(this.clearScroll);
1173
+ this.context.emitter.off('_timeScrollRequest', this.handleTimeScrollRequest);
1174
+ this.syncedScroller.removeScrollEndListener(this.handleTimeScrollEnd);
1188
1175
  }
1189
1176
  // Scrolling
1190
1177
  // -----------------------------------------------------------------------------------------------
@@ -1196,7 +1183,17 @@ class TimelineView extends internal_cjs.DateComponent {
1196
1183
  ]);
1197
1184
  }
1198
1185
  resetScroll() {
1199
- this.handleTimeScroll(this.context.options.scrollTime);
1186
+ this.handleTimeScrollRequest(this.context.options.scrollTime);
1187
+ }
1188
+ applyTimeScroll() {
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 += 1; // overcome border. TODO: DRY this up
1194
+ }
1195
+ this.syncedScroller.scrollTo({ x });
1196
+ }
1200
1197
  }
1201
1198
  queryHit(positionLeft, positionTop, elWidth, elHeight) {
1202
1199
  const { props, context, tDateProfile, slotWidth } = this;
package/internal.d.ts CHANGED
@@ -30,9 +30,9 @@ declare class TimelineView extends DateComponent<ViewProps, TimelineViewState> {
30
30
  handleEndScrollbarWidth: (endScrollbarWidth: number) => void;
31
31
  private updateSyncedScroller;
32
32
  private resetScroll;
33
- private handleTimeScroll;
34
- private updateScroll;
35
- private clearScroll;
33
+ private handleTimeScrollRequest;
34
+ private handleTimeScrollEnd;
35
+ private applyTimeScroll;
36
36
  handeBodyEl: (el: HTMLElement | null) => void;
37
37
  queryHit(positionLeft: number, positionTop: number, elWidth: number, elHeight: number): Hit;
38
38
  }
package/internal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, BaseComponent, getDateMeta, ContentContainer, joinClassNames, getDayClassName, getSlotClassName, watchWidth, setRef, RefMap, afterSize, getEventKey, SegHierarchy, groupIntersectingSegs, 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';
1
+ import { config, createFormatter, greatestDurationDenominator, asCleanDays, createDuration, wholeDivideDurations, asRoughMs, addDays, startOfDay, asRoughSeconds, asRoughMinutes, diffWholeDays, isInt, computeVisibleDayRange, padStart, BaseComponent, getDateMeta, ContentContainer, joinClassNames, getDayClassName, getSlotClassName, watchWidth, setRef, RefMap, afterSize, getEventKey, SegHierarchy, groupIntersectingSegs, buildEventRangeKey, BgEvent, getEventRangeMeta, renderFill, Slicer, intersectRanges, addMs, StandardEvent, MoreLinkContainer, watchHeight, memoize, sortEventSegs, memoizeObjArg, buildNavLinkAttrs, watchSize, 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
3
  import { ScrollerSyncer } from '@fullcalendar/scrollgrid/internal.js';
4
4
 
@@ -460,12 +460,10 @@ class TimelineSlatCell extends BaseComponent {
460
460
  'fc-timeline-slot-major' :
461
461
  'fc-timeline-slot-minor'), 'fc-timeline-slot-lane fc-cell fc-flex-col fc-align-start', props.borderStart && 'fc-border-s', props.isDay ?
462
462
  getDayClassName(dateMeta) :
463
- getSlotClassName(dateMeta)), attrs: {
464
- 'data-date': dateEnv.formatIso(date, {
463
+ getSlotClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(date, {
465
464
  omitTimeZoneOffset: true,
466
465
  omitTime: !tDateProfile.isTimeScale,
467
- }),
468
- }, style: {
466
+ }) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
469
467
  width: props.width,
470
468
  }, renderProps: renderProps, generatorName: "slotLaneContent", customGenerator: options.slotLaneContent, classNameGenerator: options.slotLaneClassNames, didMount: options.slotLaneDidMount, willUnmount: options.slotLaneWillUnmount }, (InnerContent) => (createElement(InnerContent, { tag: "div", className: 'fc-cell-inner', elRef: this.innerElRef }))));
471
469
  }
@@ -502,7 +500,7 @@ class TimelineSlats extends BaseComponent {
502
500
  let { tDateProfile, slotWidth } = props;
503
501
  let { slotDates, isWeekStarts } = tDateProfile;
504
502
  let isDay = !tDateProfile.isTimeScale && !tDateProfile.largeUnit;
505
- return (createElement("div", { className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
503
+ return (createElement("div", { "aria-hidden": true, className: "fc-timeline-slots fc-fill fc-flex-row", style: { height: props.height } }, slotDates.map((slotDate, i) => {
506
504
  let key = slotDate.toISOString();
507
505
  return (createElement(TimelineSlatCell, { key: key, date: slotDate, dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: props.nowDate, todayRange: props.todayRange, isEm: isWeekStarts[i], isDay: isDay, borderStart: Boolean(i),
508
506
  // ref
@@ -896,7 +894,6 @@ class TimelineHeaderCell extends BaseComponent {
896
894
  super(...arguments);
897
895
  // memo
898
896
  this.refineRenderProps = memoizeObjArg(refineRenderProps);
899
- this.buildCellNavLinkAttrs = memoize(buildCellNavLinkAttrs);
900
897
  // ref
901
898
  this.innerElRef = createRef();
902
899
  }
@@ -915,21 +912,24 @@ class TimelineHeaderCell extends BaseComponent {
915
912
  dateEnv: context.dateEnv,
916
913
  viewApi: context.viewApi,
917
914
  });
915
+ let isNavLink = !dateMeta.isDisabled && (cell.rowUnit && cell.rowUnit !== 'time');
918
916
  return (createElement(ContentContainer, { tag: "div", className: joinClassNames('fc-timeline-slot-label fc-timeline-slot', cell.isWeekStart && 'fc-timeline-slot-em', // TODO: document this semantic className
919
917
  'fc-header-cell fc-cell fc-flex-col fc-justify-center', props.borderStart && 'fc-border-s', props.isCentered ? 'fc-align-center' : 'fc-align-start',
920
918
  // TODO: so slot classnames for week/month/bigger. see note above about rowUnit
921
919
  cell.rowUnit === 'time' ?
922
920
  getSlotClassName(dateMeta) :
923
- getDayClassName(dateMeta)), attrs: {
924
- 'data-date': dateEnv.formatIso(cell.date, {
921
+ getDayClassName(dateMeta)), attrs: Object.assign({ 'data-date': dateEnv.formatIso(cell.date, {
925
922
  omitTime: !tDateProfile.isTimeScale,
926
923
  omitTimeZoneOffset: true,
927
- }),
928
- }, style: {
924
+ }) }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), style: {
929
925
  width: props.slotWidth != null
930
926
  ? props.slotWidth * cell.colspan
931
927
  : undefined,
932
- }, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (createElement(InnerContent, { tag: "a", attrs: this.buildCellNavLinkAttrs(context, cell.date, cell.rowUnit), className: joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
928
+ }, renderProps: renderProps, generatorName: "slotLabelContent", customGenerator: options.slotLabelContent, defaultGenerator: renderInnerContent, classNameGenerator: options.slotLabelClassNames, didMount: options.slotLabelDidMount, willUnmount: options.slotLabelWillUnmount }, (InnerContent) => (createElement(InnerContent, { tag: 'div', attrs: isNavLink
929
+ // not tabbable because parent is aria-hidden
930
+ ? buildNavLinkAttrs(context, cell.date, cell.rowUnit, undefined, /* isTabbable = */ false)
931
+ : {} // don't bother with aria-hidden because parent already hidden
932
+ , className: joinClassNames('fc-cell-inner fc-padding-md', props.isSticky && 'fc-sticky-s'), elRef: this.innerElRef }))));
933
933
  }
934
934
  componentDidMount() {
935
935
  const { props } = this;
@@ -953,11 +953,6 @@ class TimelineHeaderCell extends BaseComponent {
953
953
  }
954
954
  // Utils
955
955
  // -------------------------------------------------------------------------------------------------
956
- function buildCellNavLinkAttrs(context, cellDate, rowUnit) {
957
- return (rowUnit && rowUnit !== 'time')
958
- ? buildNavLinkAttrs(context, cellDate, rowUnit)
959
- : {};
960
- }
961
956
  function renderInnerContent(renderProps) {
962
957
  return renderProps.text;
963
958
  }
@@ -1081,23 +1076,15 @@ class TimelineView extends DateComponent {
1081
1076
  endScrollbarWidth
1082
1077
  });
1083
1078
  };
1084
- this.handleTimeScroll = (scrollTime) => {
1079
+ this.handleTimeScrollRequest = (scrollTime) => {
1085
1080
  this.scrollTime = scrollTime;
1086
- this.updateScroll();
1081
+ this.applyTimeScroll();
1087
1082
  };
1088
- this.updateScroll = () => {
1089
- const { props, context, tDateProfile, scrollTime, slotWidth } = this;
1090
- if (scrollTime != null && slotWidth != null) {
1091
- let x = timeToCoord(scrollTime, context.dateEnv, props.dateProfile, tDateProfile, slotWidth);
1092
- if (x) {
1093
- x += 1; // overcome border. TODO: DRY this up
1094
- }
1095
- this.syncedScroller.scrollTo({ x });
1083
+ this.handleTimeScrollEnd = ({ isUser }) => {
1084
+ if (isUser) {
1085
+ this.scrollTime = null;
1096
1086
  }
1097
1087
  };
1098
- this.clearScroll = () => {
1099
- this.scrollTime = null;
1100
- };
1101
1088
  // Hit System
1102
1089
  // -----------------------------------------------------------------------------------------------
1103
1090
  this.handeBodyEl = (el) => {
@@ -1146,7 +1133,7 @@ class TimelineView extends DateComponent {
1146
1133
  enableNowIndicator && (createElement(TimelineNowIndicatorArrow, { tDateProfile: tDateProfile, nowDate: nowDate, slotWidth: slotWidth }))),
1147
1134
  Boolean(state.endScrollbarWidth) && (createElement("div", { className: 'fc-border-s fc-filler', style: { minWidth: state.endScrollbarWidth } }))),
1148
1135
  createElement(Scroller, { vertical: verticalScrolling, horizontal: true, hideScrollbars: props.forPrint, className: joinClassNames('fc-timeline-body fc-flex-col', verticalScrolling && 'fc-liquid'), ref: this.bodyScrollerRef, clientWidthRef: this.handleClientWidth, endScrollbarWidthRef: this.handleEndScrollbarWidth },
1149
- createElement("div", { className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
1136
+ createElement("div", { "aria-label": options.eventsHint, className: "fc-rel fc-grow", style: { width: canvasWidth }, ref: this.handeBodyEl },
1150
1137
  createElement(TimelineSlats, { dateProfile: props.dateProfile, tDateProfile: tDateProfile, nowDate: nowDate, todayRange: todayRange,
1151
1138
  // ref
1152
1139
  innerWidthRef: this.handleBodySlotInnerWidth,
@@ -1164,8 +1151,8 @@ class TimelineView extends DateComponent {
1164
1151
  this.syncedScroller = new ScrollerSyncer(true); // horizontal=true
1165
1152
  this.updateSyncedScroller();
1166
1153
  this.resetScroll();
1167
- this.context.emitter.on('_timeScrollRequest', this.handleTimeScroll);
1168
- this.syncedScroller.addScrollEndListener(this.clearScroll);
1154
+ this.context.emitter.on('_timeScrollRequest', this.handleTimeScrollRequest);
1155
+ this.syncedScroller.addScrollEndListener(this.handleTimeScrollEnd);
1169
1156
  }
1170
1157
  componentDidUpdate(prevProps) {
1171
1158
  this.updateSyncedScroller();
@@ -1174,13 +1161,13 @@ class TimelineView extends DateComponent {
1174
1161
  }
1175
1162
  else {
1176
1163
  // TODO: inefficient to update so often
1177
- this.updateScroll();
1164
+ this.applyTimeScroll();
1178
1165
  }
1179
1166
  }
1180
1167
  componentWillUnmount() {
1181
1168
  this.syncedScroller.destroy();
1182
- this.context.emitter.off('_timeScrollRequest', this.handleTimeScroll);
1183
- this.syncedScroller.removeScrollEndListener(this.clearScroll);
1169
+ this.context.emitter.off('_timeScrollRequest', this.handleTimeScrollRequest);
1170
+ this.syncedScroller.removeScrollEndListener(this.handleTimeScrollEnd);
1184
1171
  }
1185
1172
  // Scrolling
1186
1173
  // -----------------------------------------------------------------------------------------------
@@ -1192,7 +1179,17 @@ class TimelineView extends DateComponent {
1192
1179
  ]);
1193
1180
  }
1194
1181
  resetScroll() {
1195
- this.handleTimeScroll(this.context.options.scrollTime);
1182
+ this.handleTimeScrollRequest(this.context.options.scrollTime);
1183
+ }
1184
+ applyTimeScroll() {
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 += 1; // overcome border. TODO: DRY this up
1190
+ }
1191
+ this.syncedScroller.scrollTo({ x });
1192
+ }
1196
1193
  }
1197
1194
  queryHit(positionLeft, positionTop, elWidth, elHeight) {
1198
1195
  const { props, context, tDateProfile, slotWidth } = this;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullcalendar/timeline",
3
- "version": "7.0.0-beta.3",
3
+ "version": "7.0.0-beta.4",
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.3",
19
- "@fullcalendar/scrollgrid": "7.0.0-beta.3"
18
+ "@fullcalendar/premium-common": "7.0.0-beta.4",
19
+ "@fullcalendar/scrollgrid": "7.0.0-beta.4"
20
20
  },
21
21
  "peerDependencies": {
22
- "@fullcalendar/core": "7.0.0-beta.3"
22
+ "@fullcalendar/core": "7.0.0-beta.4"
23
23
  },
24
24
  "type": "module",
25
25
  "bugs": "https://fullcalendar.io/reporting-bugs",