@fullcalendar/daygrid 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.global.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- FullCalendar Day Grid Plugin v7.0.0-beta.3
2
+ FullCalendar Day Grid Plugin v7.0.0-beta.4
3
3
  Docs & License: https://fullcalendar.io/docs/month-view
4
4
  (c) 2024 Adam Shaw
5
5
  */
@@ -37,6 +37,10 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
37
37
  dataConfigs: buildDateDataConfigs(dates, datesRepDistinctDays, dateProfile, todayRange, dayHeaderFormat, context, colSpan)
38
38
  };
39
39
  }
40
+ /*
41
+ For header cells: how to connect w/ custom rendering
42
+ Applies to all cells in a row
43
+ */
40
44
  function buildDateRenderConfig(context) {
41
45
  const { options } = context;
42
46
  return {
@@ -47,6 +51,9 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
47
51
  willUnmount: options.dayHeaderWillUnmount,
48
52
  };
49
53
  }
54
+ /*
55
+ For header cells: data
56
+ */
50
57
  function buildDateDataConfigs(dates, datesRepDistinctDays, dateProfile, todayRange, dayHeaderFormat, // TODO: rename to dateHeaderFormat?
51
58
  context, colSpan = 1, keyPrefix = '') {
52
59
  const { dateEnv, viewApi, options } = context;
@@ -56,11 +63,16 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
56
63
  const text = dateEnv.format(date, dayHeaderFormat);
57
64
  const renderProps = Object.assign(Object.assign({}, dateMeta), { date: dateEnv.toDate(date), view: viewApi, text });
58
65
  const isNavLink = options.navLinks && !dateMeta.isDisabled;
66
+ const fullDateStr = internal$1.buildDateStr(context, date);
67
+ // for DayGridHeaderCell
59
68
  return {
60
69
  key: keyPrefix + date.toUTCString(),
61
70
  renderProps,
62
- attrs: { 'data-date': !dateMeta.isDisabled ? internal$1.formatDayString(date) : undefined },
63
- innerAttrs: isNavLink ? internal$1.buildNavLinkAttrs(context, date) : {},
71
+ attrs: Object.assign(Object.assign({ 'aria-label': fullDateStr }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), { 'data-date': internal$1.formatDayString(date) }),
72
+ // for navlink
73
+ innerAttrs: isNavLink
74
+ ? internal$1.buildNavLinkAttrs(context, date, undefined, fullDateStr)
75
+ : { 'aria-hidden': true },
64
76
  colSpan,
65
77
  isNavLink,
66
78
  className: internal$1.getDayClassName(dateMeta),
@@ -79,10 +91,18 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
79
91
  };
80
92
  const text = dateEnv.format(normDate, dayHeaderFormat);
81
93
  const renderProps = Object.assign(Object.assign({}, dayMeta), { date, view: viewApi, text });
94
+ const fullWeekDayStr = dateEnv.format(normDate, WEEKDAY_FORMAT);
95
+ // for DayGridHeaderCell
82
96
  return {
83
97
  key: keyPrefix + String(dow),
84
98
  renderProps,
85
- innerAttrs: { 'aria-label': dateEnv.format(normDate, WEEKDAY_FORMAT) },
99
+ attrs: {
100
+ 'aria-label': fullWeekDayStr,
101
+ },
102
+ // for navlink
103
+ innerAttrs: {
104
+ 'aria-hidden': true, // label already on cell
105
+ },
86
106
  colSpan,
87
107
  className: internal$1.getDayClassName(dayMeta),
88
108
  };
@@ -168,8 +188,8 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
168
188
  /* slicedStart = */ undefined,
169
189
  /* slicedEnd = */ undefined, props.isStart, props.isEnd, context,
170
190
  /* defaultDisplayEventTime = */ true, props.defaultDisplayEventEnd);
171
- let anchorAttrs = internal$1.getEventRangeAnchorAttrs(eventRange, context);
172
- return (preact.createElement(internal$1.EventContainer, Object.assign({}, props, { tag: anchorAttrs ? 'a' : 'div', attrs: anchorAttrs, className: 'fc-daygrid-dot-event fc-daygrid-event', defaultGenerator: renderInnerContent, timeText: timeText, isResizing: false, isDateSelecting: false })));
191
+ let [tag, attrs] = internal$1.getEventTagAndAttrs(eventRange, context);
192
+ return (preact.createElement(internal$1.EventContainer, Object.assign({}, props, { tag: tag, attrs: attrs, className: 'fc-daygrid-dot-event fc-daygrid-event', defaultGenerator: renderInnerContent, timeText: timeText, isResizing: false, isDateSelecting: false })));
173
193
  }
174
194
  }
175
195
  function renderInnerContent(renderProps) {
@@ -205,7 +225,30 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
205
225
  super(...arguments);
206
226
  // ref
207
227
  this.rootElRef = preact.createRef();
208
- this.bodyElRef = preact.createRef();
228
+ this.handleBodyEl = (bodyEl) => {
229
+ if (this.disconnectBodyHeight) {
230
+ this.disconnectBodyHeight();
231
+ this.disconnectBodyHeight = undefined;
232
+ internal$1.setRef(this.props.headerHeightRef, null);
233
+ internal$1.setRef(this.props.mainHeightRef, null);
234
+ }
235
+ if (bodyEl) {
236
+ // we want to fire on ANY size change, because we do more advanced stuff
237
+ this.disconnectBodyHeight = internal$1.watchSize(bodyEl, (_bodyWidth, bodyHeight) => {
238
+ const { props } = this;
239
+ const mainRect = bodyEl.getBoundingClientRect();
240
+ const rootRect = this.rootElRef.current.getBoundingClientRect();
241
+ const headerHeight = mainRect.top - rootRect.top;
242
+ if (!internal$1.isDimsEqual(this.headerHeight, headerHeight)) {
243
+ this.headerHeight = headerHeight;
244
+ internal$1.setRef(props.headerHeightRef, headerHeight);
245
+ }
246
+ if (props.fgLiquidHeight) {
247
+ internal$1.setRef(props.mainHeightRef, bodyHeight);
248
+ }
249
+ });
250
+ }
251
+ };
209
252
  }
210
253
  render() {
211
254
  let { props, context } = this;
@@ -213,38 +256,29 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
213
256
  // TODO: memoize this
214
257
  const isMonthStart = props.showDayNumber &&
215
258
  shouldDisplayMonthStart(props.date, props.dateProfile.currentRange, dateEnv);
216
- return (preact.createElement(internal$1.DayCellContainer, { tag: "div", className: internal$1.joinClassNames(props.className, 'fc-daygrid-day fc-flex-col', props.borderStart && 'fc-border-s', props.width != null ? '' : 'fc-liquid'), attrs: Object.assign(Object.assign({}, props.attrs), { role: 'gridcell' }), style: {
259
+ // TODO: memoize this
260
+ const dateMeta = internal$1.getDateMeta(props.date, props.todayRange, null, props.dateProfile);
261
+ const baseClassName = internal$1.joinClassNames('fc-daygrid-day', props.borderStart && 'fc-border-s', props.width != null ? '' : 'fc-liquid', 'fc-flex-col');
262
+ if (dateMeta.isDisabled) {
263
+ return (preact.createElement("div", { role: 'gridcell', "aria-disabled": true, className: internal$1.joinClassNames(baseClassName, 'fc-day-disabled'), style: {
264
+ width: props.width
265
+ } }));
266
+ }
267
+ const hasDayNumber = props.showDayNumber || internal$1.hasCustomDayCellContent(options);
268
+ const isNavLink = options.navLinks;
269
+ const fullDateStr = internal$1.buildDateStr(context, props.date);
270
+ return (preact.createElement(internal$1.DayCellContainer, { tag: "div", className: internal$1.joinClassNames(baseClassName, props.className), attrs: Object.assign(Object.assign({}, props.attrs), { role: 'gridcell', 'aria-label': fullDateStr }), style: {
217
271
  width: props.width
218
- }, elRef: this.rootElRef, renderProps: props.renderProps, defaultGenerator: renderTopInner, date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, isMonthStart: isMonthStart }, (InnerContent, renderProps) => (preact.createElement(preact.Fragment, null,
219
- !renderProps.isDisabled && (props.showDayNumber || internal$1.hasCustomDayCellContent(options)) && (preact.createElement("div", { className: "fc-daygrid-day-header" },
220
- preact.createElement(InnerContent, { tag: "a", attrs: internal$1.buildNavLinkAttrs(context, props.date), className: internal$1.joinClassNames('fc-daygrid-day-number', isMonthStart && 'fc-daygrid-month-start') }))),
221
- preact.createElement("div", { className: internal$1.joinClassNames('fc-daygrid-day-body', props.isTall && 'fc-daygrid-day-body-tall', props.fgLiquidHeight ? 'fc-liquid' : 'fc-grow'), ref: this.bodyElRef },
272
+ }, elRef: this.rootElRef, renderProps: props.renderProps, defaultGenerator: renderTopInner, date: props.date, dateMeta: dateMeta, showDayNumber: props.showDayNumber, isMonthStart: isMonthStart }, (InnerContent) => (preact.createElement(preact.Fragment, null,
273
+ hasDayNumber && (preact.createElement("div", { className: "fc-daygrid-day-header" },
274
+ preact.createElement(InnerContent, { tag: 'div', attrs: isNavLink
275
+ ? internal$1.buildNavLinkAttrs(context, props.date, undefined, fullDateStr)
276
+ : { 'aria-hidden': true } // label already on cell
277
+ , className: internal$1.joinClassNames('fc-daygrid-day-number', isMonthStart && 'fc-daygrid-month-start') }))),
278
+ preact.createElement("div", { className: internal$1.joinClassNames('fc-daygrid-day-body', props.isTall && 'fc-daygrid-day-body-tall', props.fgLiquidHeight ? 'fc-liquid' : 'fc-grow'), ref: this.handleBodyEl },
222
279
  preact.createElement("div", { className: 'fc-daygrid-day-events', style: { height: props.fgHeight } }, props.fg),
223
280
  preact.createElement(DayGridMoreLink, { isBlock: props.isCompact, allDayDate: props.date, segs: props.segs, hiddenSegs: props.hiddenSegs, alignElRef: this.rootElRef, alignParentTop: props.showDayNumber ? '[role=row]' : '.fc-view', dateSpanProps: props.dateSpanProps, dateProfile: props.dateProfile, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange }))))));
224
281
  }
225
- componentDidMount() {
226
- const bodyEl = this.bodyElRef.current;
227
- // we want to fire on ANY size change, because we do more advanced stuff
228
- this.disconnectBodyHeight = internal$1.watchSize(bodyEl, (_bodyWidth, bodyHeight) => {
229
- const { props } = this;
230
- const mainRect = bodyEl.getBoundingClientRect();
231
- const rootRect = this.rootElRef.current.getBoundingClientRect();
232
- const headerHeight = mainRect.top - rootRect.top;
233
- if (!internal$1.isDimsEqual(this.headerHeight, headerHeight)) {
234
- this.headerHeight = headerHeight;
235
- internal$1.setRef(props.headerHeightRef, headerHeight);
236
- }
237
- if (props.fgLiquidHeight) {
238
- internal$1.setRef(props.mainHeightRef, bodyHeight);
239
- }
240
- });
241
- }
242
- componentWillUnmount() {
243
- this.disconnectBodyHeight();
244
- const { props } = this;
245
- internal$1.setRef(props.headerHeightRef, null);
246
- internal$1.setRef(props.mainHeightRef, null);
247
- }
248
282
  }
249
283
  // Utils
250
284
  // -------------------------------------------------------------------------------------------------
@@ -568,7 +602,11 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
568
602
  (props.eventDrag && props.eventDrag.affectedInstances) ||
569
603
  (props.eventResize && props.eventResize.affectedInstances) ||
570
604
  {};
571
- return (preact.createElement("div", { role: 'row' // TODO: audit this for all scenarios
605
+ const isNavLink = options.navLinks;
606
+ const fullWeekStr = internal$1.buildDateStr(context, weekDate, 'week');
607
+ return (preact.createElement("div", { role: props.role /* !!! */, "aria-label": props.role === 'row' // HACK
608
+ ? fullWeekStr
609
+ : undefined // can't have label on non-role div
572
610
  , className: internal$1.joinClassNames('fc-flex-row fc-rel', props.className), style: {
573
611
  minHeight: props.minHeight,
574
612
  }, ref: this.handleRootEl },
@@ -587,7 +625,9 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
587
625
  // refs
588
626
  headerHeightRef: headerHeightRefMap.createRef(cell.key), mainHeightRef: mainHeightRefMap.createRef(cell.key) }));
589
627
  })),
590
- props.showWeekNumbers && (preact.createElement(internal$1.WeekNumberContainer, { tag: "a", attrs: internal$1.buildNavLinkAttrs(context, weekDate, 'week'), className: 'fc-daygrid-week-number', date: weekDate, defaultFormat: DEFAULT_WEEK_NUM_FORMAT })),
628
+ props.showWeekNumbers && (preact.createElement(internal$1.WeekNumberContainer, { tag: 'div', attrs: Object.assign(Object.assign({}, (isNavLink
629
+ ? internal$1.buildNavLinkAttrs(context, weekDate, 'week', fullWeekStr, /* isTabbable = */ false)
630
+ : {})), { 'role': undefined, 'aria-hidden': true }), className: 'fc-daygrid-week-number', date: weekDate, defaultFormat: DEFAULT_WEEK_NUM_FORMAT })),
591
631
  this.renderFgSegs(maxMainTop, mirrorSegs, segTops, props.todayRange, {}, // forcedInvisibleMap
592
632
  Boolean(props.eventDrag), Boolean(props.eventResize), false)));
593
633
  }
@@ -748,10 +788,10 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
748
788
  let isHeightAuto = internal$1.getIsHeightAuto(options);
749
789
  let rowHeightsRedistribute = !props.forPrint && !isHeightAuto;
750
790
  let [rowMinHeight, isCompact] = computeRowHeight(props.visibleWidth, rowCnt, isHeightAuto, props.forPrint, options);
751
- return (preact.createElement("div", { className: internal$1.joinClassNames(
791
+ return (preact.createElement("div", { role: 'rowgroup', className: internal$1.joinClassNames(
752
792
  // HACK for Safari. Can't do break-inside:avoid with flexbox items, likely b/c it's not standard:
753
793
  // https://stackoverflow.com/a/60256345
754
- !props.forPrint && 'fc-flex-col', props.className), style: { width: props.width }, ref: this.handleRootEl }, props.cellRows.map((cells, row) => (preact.createElement(DayGridRow, { key: cells[0].key, dateProfile: props.dateProfile, todayRange: props.todayRange, cells: cells, showDayNumbers: rowCnt > 1, showWeekNumbers: options.weekNumbers, forPrint: props.forPrint, isCompact: isCompact,
794
+ !props.forPrint && 'fc-flex-col', props.className), style: { width: props.width }, ref: this.handleRootEl }, props.cellRows.map((cells, row) => (preact.createElement(DayGridRow, { key: cells[0].key, role: 'row', dateProfile: props.dateProfile, todayRange: props.todayRange, cells: cells, showDayNumbers: rowCnt > 1, showWeekNumbers: rowCnt > 1 && options.weekNumbers, forPrint: props.forPrint, isCompact: isCompact,
755
795
  // if not auto-height, distribute height of container somewhat evently to rows
756
796
  // (treat all as zero, distribute height, then ensure min-heights -- the inner content height)
757
797
  className: internal$1.joinClassNames(rowHeightsRedistribute && 'fc-grow fc-basis0', rowCnt > 1 && 'fc-break-inside-avoid', // don't avoid breaks for single tall row
@@ -848,14 +888,16 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
848
888
  render() {
849
889
  const { props } = this;
850
890
  const { renderConfig, dataConfig } = props;
851
- return (preact.createElement(internal$1.ContentContainer, { tag: 'div', attrs: dataConfig.attrs, className: internal$1.joinClassNames(dataConfig.className, 'fc-header-cell fc-cell fc-flex-col fc-align-center', props.borderStart && 'fc-border-s', !props.isSticky && 'fc-crop', props.colWidth == null && 'fc-liquid'), style: {
891
+ // HACK
892
+ const isDisabled = dataConfig.renderProps.isDisabled;
893
+ return (preact.createElement(internal$1.ContentContainer, { tag: 'div', attrs: Object.assign({ role: 'columnheader', 'aria-colspan': dataConfig.colSpan }, dataConfig.attrs), className: internal$1.joinClassNames('fc-header-cell fc-cell fc-flex-col fc-align-center', props.borderStart && 'fc-border-s', !props.isSticky && 'fc-crop', props.colWidth == null && 'fc-liquid', dataConfig.className), style: {
852
894
  width: props.colWidth != null
853
895
  ? props.colWidth * (dataConfig.colSpan || 1)
854
896
  : undefined,
855
897
  }, renderProps: dataConfig.renderProps, generatorName: renderConfig.generatorName, customGenerator: renderConfig.customGenerator, defaultGenerator: internal$1.renderText, classNameGenerator:
856
898
  // don't use custom classNames if disabled
857
899
  // TODO: make DRY with DayCellContainer
858
- dataConfig.renderProps.isDisabled ? undefined : renderConfig.classNameGenerator, didMount: renderConfig.didMount, willUnmount: renderConfig.willUnmount }, (InnerContainer) => (!dataConfig.renderProps.isDisabled && (preact.createElement(InnerContainer, { tag: dataConfig.isNavLink ? 'a' : 'div', attrs: dataConfig.innerAttrs, className: internal$1.joinClassNames('fc-cell-inner fc-flex-col fc-padding-sm', props.isSticky && 'fc-sticky-s'), elRef: this.handleInnerEl })))));
900
+ isDisabled ? undefined : renderConfig.classNameGenerator, didMount: renderConfig.didMount, willUnmount: renderConfig.willUnmount }, (InnerContainer) => (preact.createElement(InnerContainer, { tag: 'div', attrs: dataConfig.innerAttrs, className: internal$1.joinClassNames('fc-cell-inner fc-flex-col fc-padding-sm', props.isSticky && 'fc-sticky-s'), elRef: this.handleInnerEl }))));
859
901
  }
860
902
  }
861
903
 
@@ -880,7 +922,7 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
880
922
  }
881
923
  render() {
882
924
  const { props } = this;
883
- return (preact.createElement("div", { role: 'row', className: internal$1.joinClassNames('fc-flex-row fc-content-box', props.className), style: { height: props.height } }, props.dataConfigs.map((dataConfig, cellI) => (preact.createElement(DayGridHeaderCell, { key: dataConfig.key, renderConfig: props.renderConfig, dataConfig: dataConfig, isSticky: props.isSticky, borderStart: Boolean(cellI), colWidth: props.colWidth, innerHeightRef: props.innerHeightRef })))));
925
+ return (preact.createElement("div", { role: props.role /* !!! */, "aria-rowindex": props.rowIndex != null ? 1 + props.rowIndex : undefined, className: internal$1.joinClassNames('fc-flex-row fc-content-box', props.className), style: { height: props.height } }, props.dataConfigs.map((dataConfig, cellI) => (preact.createElement(DayGridHeaderCell, { key: dataConfig.key, renderConfig: props.renderConfig, dataConfig: dataConfig, isSticky: props.isSticky, borderStart: Boolean(cellI), colWidth: props.colWidth, innerHeightRef: props.innerHeightRef })))));
884
926
  }
885
927
  }
886
928
 
@@ -890,9 +932,9 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
890
932
  class DayGridHeader extends internal$1.BaseComponent {
891
933
  render() {
892
934
  const { props } = this;
893
- return (preact.createElement("div", { className: internal$1.joinClassNames(props.className, 'fc-flex-col', props.width == null && 'fc-liquid'), style: {
935
+ return (preact.createElement("div", { role: 'rowgroup', className: internal$1.joinClassNames(props.className, 'fc-flex-col', props.width == null && 'fc-liquid'), style: {
894
936
  width: props.width
895
- } }, props.headerTiers.map((rowConfig, tierNum) => (preact.createElement(DayGridHeaderRow, Object.assign({}, rowConfig, { key: tierNum, className: tierNum ? 'fc-border-t' : '', colWidth: props.colWidth }))))));
937
+ } }, props.headerTiers.map((rowConfig, tierNum) => (preact.createElement(DayGridHeaderRow, Object.assign({}, rowConfig, { key: tierNum, role: 'row', className: tierNum ? 'fc-border-t' : '', colWidth: props.colWidth }))))));
896
938
  }
897
939
  }
898
940
 
@@ -1035,21 +1077,29 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
1035
1077
  }
1036
1078
  }
1037
1079
  };
1038
- this.clearScroll = () => {
1039
- this.scrollDate = null;
1080
+ this.handleScrollEnd = ({ isUser }) => {
1081
+ if (isUser) {
1082
+ this.scrollDate = null;
1083
+ }
1040
1084
  };
1041
1085
  }
1042
1086
  render() {
1043
1087
  const { props, context } = this;
1044
1088
  const { options } = context;
1045
1089
  const commonLayoutProps = Object.assign(Object.assign({}, props), { scrollerRef: this.scrollerRef, rowHeightRefMap: this.rowHeightRefMap });
1046
- return (preact.createElement(internal$1.ViewContainer, { viewSpec: context.viewSpec, className: internal$1.joinClassNames(props.className, 'fc-print-root fc-border') }, options.dayMinWidth ? (preact.createElement(DayGridLayoutPannable, Object.assign({}, commonLayoutProps, { dayMinWidth: options.dayMinWidth }))) : (preact.createElement(DayGridLayoutNormal, Object.assign({}, commonLayoutProps)))));
1090
+ return (preact.createElement(internal$1.ViewContainer, { viewSpec: context.viewSpec, attrs: {
1091
+ role: 'grid',
1092
+ 'aria-rowcount': props.headerTiers.length + props.cellRows.length,
1093
+ 'aria-colcount': props.cellRows[0].length,
1094
+ 'aria-labelledby': props.labelId,
1095
+ 'aria-label': props.labelStr,
1096
+ }, className: internal$1.joinClassNames(props.className, 'fc-print-root fc-border') }, options.dayMinWidth ? (preact.createElement(DayGridLayoutPannable, Object.assign({}, commonLayoutProps, { dayMinWidth: options.dayMinWidth }))) : (preact.createElement(DayGridLayoutNormal, Object.assign({}, commonLayoutProps)))));
1047
1097
  }
1048
1098
  // Lifecycle
1049
1099
  // -----------------------------------------------------------------------------------------------
1050
1100
  componentDidMount() {
1051
1101
  this.resetScroll();
1052
- this.scrollerRef.current.addScrollEndListener(this.clearScroll);
1102
+ this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd);
1053
1103
  }
1054
1104
  componentDidUpdate(prevProps) {
1055
1105
  if (prevProps.dateProfile !== this.props.dateProfile && this.context.options.scrollTimeReset) {
@@ -1057,14 +1107,13 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
1057
1107
  }
1058
1108
  }
1059
1109
  componentWillUnmount() {
1060
- this.scrollerRef.current.removeScrollEndListener(this.clearScroll);
1110
+ this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd);
1061
1111
  }
1062
1112
  // Scrolling
1063
1113
  // -----------------------------------------------------------------------------------------------
1064
1114
  resetScroll() {
1065
1115
  this.scrollDate = this.props.dateProfile.currentDate;
1066
1116
  this.updateScrollY();
1067
- // updateScrollX
1068
1117
  const scroller = this.scrollerRef.current;
1069
1118
  scroller.scrollTo({ x: 0 });
1070
1119
  }
@@ -1089,7 +1138,7 @@ FullCalendar.DayGrid = (function (exports, core, internal$1, preact) {
1089
1138
  const slicedProps = this.slicer.sliceProps(props, props.dateProfile, options.nextDayThreshold, context, dayTableModel);
1090
1139
  return (preact.createElement(internal$1.NowTimer, { unit: "day" }, (nowDate, todayRange) => {
1091
1140
  const headerTiers = this.buildDateRowConfigs(dayTableModel.headerDates, datesRepDistinctDays, props.dateProfile, todayRange, dayHeaderFormat, context);
1092
- return (preact.createElement(DayGridLayout, { dateProfile: props.dateProfile, todayRange: todayRange, cellRows: dayTableModel.cellRows, forPrint: props.forPrint, className: 'fc-daygrid',
1141
+ return (preact.createElement(DayGridLayout, { labelId: props.labelId, labelStr: props.labelStr, dateProfile: props.dateProfile, todayRange: todayRange, cellRows: dayTableModel.cellRows, forPrint: props.forPrint, className: 'fc-daygrid',
1093
1142
  // header content
1094
1143
  headerTiers: headerTiers,
1095
1144
  // body content
@@ -1,6 +1,6 @@
1
1
  /*!
2
- FullCalendar Day Grid Plugin v7.0.0-beta.3
2
+ FullCalendar Day Grid Plugin v7.0.0-beta.4
3
3
  Docs & License: https://fullcalendar.io/docs/month-view
4
4
  (c) 2024 Adam Shaw
5
5
  */
6
- FullCalendar.DayGrid=function(e,t,n,r){"use strict";class i extends n.Slicer{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,t){return t.sliceRange(e)}}const s=n.createFormatter({weekday:"long"}),a=new Date(2592e5);function o(...e){return[l(...e)]}function l(e,t,n,r,i,s,a){return{renderConfig:d(s),dataConfigs:c(e,t,n,r,i,s,a)}}function d(e){const{options:t}=e;return{generatorName:"dayHeaderContent",customGenerator:t.dayHeaderContent,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount}}function c(e,t,r,i,o,l,d=1,c=""){const{dateEnv:g,viewApi:f,options:h}=l;return t?e.map(e=>{const t=n.getDateMeta(e,i,null,r),s=g.format(e,o),a=Object.assign(Object.assign({},t),{date:g.toDate(e),view:f,text:s}),u=h.navLinks&&!t.isDisabled;return{key:c+e.toUTCString(),renderProps:a,attrs:{"data-date":t.isDisabled?void 0:n.formatDayString(e)},innerAttrs:u?n.buildNavLinkAttrs(l,e):{},colSpan:d,isNavLink:u,className:n.getDayClassName(t)}}):e.map(e=>{const t=e.getUTCDay(),r=n.addDays(a,t),i={dow:t,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},l=g.format(r,o),h=Object.assign(Object.assign({},i),{date:e,view:f,text:l});return{key:c+String(t),renderProps:h,innerAttrs:{"aria-label":g.format(r,s)},colSpan:d,className:n.getDayClassName(i)}})}function g(e){return n.getEventKey(e)+":"+e.start+(e.standinFor?":standin":e.isSlice?":slice":"")}function f(e,t){const n=[];for(let e=0;e<t;e++)n[e]=[];for(const t of e)n[t.row].push(t);return n}function h(e,t){const n=[];if(e){for(let r=0;r<t;r++)n[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(const t of e.segs)n[t.row].segs.push(t)}else for(let e=0;e<t;e++)n[e]=null;return n}function u(e,t){return Object.assign(Object.assign({},e),{start:t,end:t+1,isStart:e.isStart&&e.start===t,isEnd:e.isEnd&&e.end-1===t,standinFor:e})}const m=n.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function p(e){let{display:t}=e.eventRange.ui;return"list-item"===t||"auto"===t&&!e.eventRange.def.allDay&&e.end-e.start==1&&e.isStart&&e.isEnd}class v extends n.BaseComponent{render(){let{props:e}=this;return r.createElement(n.StandardEvent,Object.assign({},e,{className:"fc-daygrid-block-event fc-daygrid-event fc-h-event",defaultTimeFormat:m,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.eventRange.def.allDay}))}}class y extends n.BaseComponent{render(){let{props:e,context:t}=this,{options:i}=t,{eventRange:s}=e,a=i.eventTimeFormat||m,o=n.buildEventRangeTimeText(a,s,void 0,void 0,e.isStart,e.isEnd,t,!0,e.defaultDisplayEventEnd),l=n.getEventRangeAnchorAttrs(s,t);return r.createElement(n.EventContainer,Object.assign({},e,{tag:l?"a":"div",attrs:l,className:"fc-daygrid-dot-event fc-daygrid-event",defaultGenerator:R,timeText:o,isResizing:!1,isDateSelecting:!1}))}}function R(e){return r.createElement(r.Fragment,null,r.createElement("div",{className:"fc-daygrid-event-dot",style:{borderColor:e.borderColor||e.backgroundColor}}),e.timeText&&r.createElement("div",{className:"fc-event-time"},e.timeText),r.createElement("div",{className:"fc-event-title"},e.event.title||r.createElement(r.Fragment,null," ")))}class S extends n.BaseComponent{render(){let{props:e}=this;return r.createElement(n.MoreLinkContainer,{className:n.joinClassNames("fc-daygrid-more-link",e.isBlock?"fc-daygrid-more-link-block":"fc-daygrid-more-link-button"),dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:e.alignElRef,alignParentTop:e.alignParentTop,dateSpanProps:e.dateSpanProps,popoverContent:()=>{let t=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return r.createElement(r.Fragment,null,e.segs.map(i=>{let{eventRange:s}=i,{instanceId:a}=s.instance;return r.createElement("div",{key:a,style:{visibility:t[a]?"hidden":""}},p(i)?r.createElement(y,Object.assign({eventRange:s,isStart:i.isStart,isEnd:i.isEnd,isDragging:!1,isSelected:a===e.eventSelection,defaultDisplayEventEnd:!1},n.getEventRangeMeta(s,e.todayRange))):r.createElement(v,Object.assign({eventRange:s,isStart:i.isStart,isEnd:i.isEnd,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:a===e.eventSelection,defaultDisplayEventEnd:!1},n.getEventRangeMeta(s,e.todayRange))))}))}})}}class b extends n.DateComponent{constructor(){super(...arguments),this.rootElRef=r.createRef(),this.bodyElRef=r.createRef()}render(){let{props:e,context:t}=this,{options:i,dateEnv:s}=t;const a=e.showDayNumber&&function(e,t,r){const{start:i,end:s}=t,a=n.addMs(s,-1),o=r.getYear(i),l=r.getMonth(i),d=r.getYear(a),c=r.getMonth(a);return!(o===d&&l===c)&&Boolean(e.valueOf()===i.valueOf()||1===r.getDay(e)&&e.valueOf()<s.valueOf())}(e.date,e.dateProfile.currentRange,s);return r.createElement(n.DayCellContainer,{tag:"div",className:n.joinClassNames(e.className,"fc-daygrid-day fc-flex-col",e.borderStart&&"fc-border-s",null!=e.width?"":"fc-liquid"),attrs:Object.assign(Object.assign({},e.attrs),{role:"gridcell"}),style:{width:e.width},elRef:this.rootElRef,renderProps:e.renderProps,defaultGenerator:E,date:e.date,dateProfile:e.dateProfile,todayRange:e.todayRange,showDayNumber:e.showDayNumber,isMonthStart:a},(s,o)=>r.createElement(r.Fragment,null,!o.isDisabled&&(e.showDayNumber||n.hasCustomDayCellContent(i))&&r.createElement("div",{className:"fc-daygrid-day-header"},r.createElement(s,{tag:"a",attrs:n.buildNavLinkAttrs(t,e.date),className:n.joinClassNames("fc-daygrid-day-number",a&&"fc-daygrid-month-start")})),r.createElement("div",{className:n.joinClassNames("fc-daygrid-day-body",e.isTall&&"fc-daygrid-day-body-tall",e.fgLiquidHeight?"fc-liquid":"fc-grow"),ref:this.bodyElRef},r.createElement("div",{className:"fc-daygrid-day-events",style:{height:e.fgHeight}},e.fg),r.createElement(S,{isBlock:e.isCompact,allDayDate:e.date,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:this.rootElRef,alignParentTop:e.showDayNumber?"[role=row]":".fc-view",dateSpanProps:e.dateSpanProps,dateProfile:e.dateProfile,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange}))))}componentDidMount(){const e=this.bodyElRef.current;this.disconnectBodyHeight=n.watchSize(e,(t,r)=>{const{props:i}=this,s=e.getBoundingClientRect(),a=this.rootElRef.current.getBoundingClientRect(),o=s.top-a.top;n.isDimsEqual(this.headerHeight,o)||(this.headerHeight=o,n.setRef(i.headerHeightRef,o)),i.fgLiquidHeight&&n.setRef(i.mainHeightRef,r)})}componentWillUnmount(){this.disconnectBodyHeight();const{props:e}=this;n.setRef(e.headerHeightRef,null),n.setRef(e.mainHeightRef,null)}}function E(e){return e.dayNumberText||r.createElement(r.Fragment,null," ")}function w(e,t){let n=e.get(t.eventRange);n||e.set(t.eventRange,n=[]),n.push(t)}function D(e,t){let r=new n.DaySeriesModel(e.renderRange,t);return new n.DayTableModel(r,/year|month|week/.test(e.currentRangeUnit))}function x(e,t,n){if(null==n)return[void 0,void 0];return n/e<t?[t*e,t]:[n,void 0]}function C(e,t,r,i){let s,a;if(null!=t)s=e.start*t,a=(r-e.end)*t;else{const t=1/r;s=n.fracToCssDim(e.start*t),a=n.fracToCssDim(1-e.end*t)}return i?{right:s,left:a}:{left:s,right:a}}function H(e,t,n,r,i){const s=null!=n?n:t/r,a=Math.floor(e/s),o=a*s;return{col:i?r-a-1:a,left:o,right:o+s}}function N(e,t){return e.querySelectorAll(":scope > [role=row]")[t]}function M(e,t){return e.querySelectorAll(":scope > [role=gridcell]")[t]}function k(e,t,r){return e||function(e,t){if(!e||t>10)return n.createFormatter({weekday:"short"});if(t>1)return n.createFormatter({weekday:"short",month:"numeric",day:"numeric",omitCommas:!0});return n.createFormatter({weekday:"long"})}(t,r)}class P extends r.Component{constructor(){super(...arguments),this.rootElRef=r.createRef()}render(){const{props:e}=this;return r.createElement("div",{className:n.joinClassNames(e.className,"fc-abs"),style:e.style,ref:this.rootElRef},e.children)}componentDidMount(){const e=this.rootElRef.current;this.disconnectHeight=n.watchHeight(e,e=>{n.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.disconnectHeight(),n.setRef(this.props.heightRef,null)}}const W=n.createFormatter({week:"narrow"});class z extends n.BaseComponent{constructor(){super(...arguments),this.headerHeightRefMap=new n.RefMap(()=>{n.afterSize(this.handleSegPositioning)}),this.mainHeightRefMap=new n.RefMap(()=>{(!0===this.props.dayMaxEvents||!0===this.props.dayMaxEventRows)&&n.afterSize(this.handleSegPositioning)}),this.segHeightRefMap=new n.RefMap(()=>{n.afterSize(this.handleSegPositioning)}),this.handleRootEl=e=>{this.rootEl=e,n.setRef(this.props.rootElRef,e)},this.handleSegPositioning=()=>{this.forceUpdate()}}render(){const{props:e,context:t,headerHeightRefMap:i,mainHeightRefMap:s}=this,{cells:a}=e,{options:o}=t,l=e.cells[0].date,d=!0===e.dayMaxEvents||!0===e.dayMaxEventRows,c=n.sortEventSegs(e.fgEventSegs,o.eventOrder),[f,h]=this.computeFgDims(),[m,p,v,y,R]=function(e,t,r,i,s,a=!0,o,l){let d,c,f;!0===o||!0===l?(d=i,f=!0):"number"==typeof o?(c=o,f=!1):"number"==typeof l&&(c=l,f=!0);const h=new Map,m=new Map,p=new Map,v=new Map;let y=new n.SegHierarchy(e,e=>t.get(g(e)),s,d,c,f,a);y.traverseSegs((e,t)=>{w(h,e),p.set(g(e),t),e.isSlice&&v.set(e.eventRange,!0)});for(const e of y.hiddenSegs)w(m,e);if(v.size){p.clear(),y=new n.SegHierarchy(function(e,t){const n=[];for(const r of e)n.push(...t.get(r.eventRange)||[]);return n}(e,h),e=>t.get(g(e)),s,d,c,f),y.traverseSegs((e,t)=>{p.set(g(e),t)});for(const e of y.hiddenSegs)w(m,e)}const R=[],S=[],b=[],E=[];for(let e=0;e<r.length;e++)R.push([]),S.push([]),b.push([]),E.push(0);for(const n of e){const{eventRange:e}=n,r=h.get(e)||[],i=m.get(e)||[],s=v.get(e)||!1;if(b[n.start].push(n),s)for(const e of r)b[e.start].push(e);for(const e of r){for(let t=e.start;t<e.end;t++){const n=u(e,t);R[t].push(n)}const n=g(e),r=p.get(n);if(null!=r){const i=t.get(n);for(let t=e.start;t<e.end;t++)E[t]=Math.max(E[t],r+i)}}for(const e of i)for(let t=e.start;t<e.end;t++){const n=u(e,t);R[t].push(n),S[t].push(n)}}return[R,S,b,p,E]}(c,this.segHeightRefMap.current,a,d?h:void 0,o.eventOrderStrict,o.eventSlicing,e.dayMaxEvents,e.dayMaxEventRows),S=[];if(null!=f){let e=0;for(const t of a){const n=i.current.get(t.key),r=f-n;S.push(R[e++]+r)}}const E=this.getHighlightSegs(),D=this.getMirrorSegs(),x=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{};return r.createElement("div",{role:"row",className:n.joinClassNames("fc-flex-row fc-rel",e.className),style:{minHeight:e.minHeight},ref:this.handleRootEl},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(E,"highlight"),r.createElement("div",{className:"fc-flex-row fc-liquid fc-rel"},e.cells.map((t,n)=>{const a=this.renderFgSegs(f,v[n],y,e.todayRange,x);return r.createElement(b,{key:t.key,dateProfile:e.dateProfile,todayRange:e.todayRange,date:t.date,showDayNumber:e.showDayNumbers,isCompact:e.isCompact,isTall:e.isTall,borderStart:Boolean(n),segs:m[n],hiddenSegs:p[n],fgLiquidHeight:d,fg:r.createElement(r.Fragment,null,a),eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,renderProps:t.renderProps,dateSpanProps:t.dateSpanProps,attrs:t.attrs,className:t.className,fgHeight:S[n],width:e.colWidth,headerHeightRef:i.createRef(t.key),mainHeightRef:s.createRef(t.key)})})),e.showWeekNumbers&&r.createElement(n.WeekNumberContainer,{tag:"a",attrs:n.buildNavLinkAttrs(t,l,"week"),className:"fc-daygrid-week-number",date:l,defaultFormat:W}),this.renderFgSegs(f,D,y,e.todayRange,{},Boolean(e.eventDrag),Boolean(e.eventResize),!1))}renderFgSegs(e,t,i,s,a,o,l,d){var c;const{props:f,context:h,segHeightRefMap:u}=this,{isRtl:m}=h,{colWidth:R,eventSelection:S}=f,b=f.cells.length,E=1===f.cells.length,w=o||l||d,D=[];for(const f of t){const t=g(f),{standinFor:h,eventRange:x}=f,{instanceId:H}=x.instance;if(h)continue;const{left:N,right:M}=C(f,R,b,m),k=null!==(c=i.get(h?g(h):t))&&void 0!==c?c:w?0:void 0,W=null!=e&&null!=k?e+k:void 0,z=h||a[H]||null==W;D.push(r.createElement(P,{key:t,className:f.start?"fc-border-transparent fc-border-s":"",style:{visibility:z?"hidden":"",top:W,left:N,right:M},heightRef:h||w?null:u.createRef(t)},p(f)?r.createElement(y,Object.assign({eventRange:x,isStart:f.isStart,isEnd:f.isEnd,isDragging:o,isSelected:H===S,defaultDisplayEventEnd:E},n.getEventRangeMeta(x,s))):r.createElement(v,Object.assign({eventRange:x,isStart:f.isStart,isEnd:f.isEnd,isDragging:o,isResizing:l,isDateSelecting:d,isSelected:H===S,defaultDisplayEventEnd:E},n.getEventRangeMeta(x,s)))))}return D}renderFillSegs(e,t){const{props:i,context:s}=this,{isRtl:a}=s,{todayRange:o,colWidth:l}=i,d=i.cells.length,c=[];for(const i of e){const e=n.buildEventRangeKey(i.eventRange),{left:s,right:g}=C(i,l,d,a),f=!i.standinFor;c.push(r.createElement("div",{key:e,className:"fc-fill-y",style:{visibility:f?"":"hidden",left:s,right:g}},"bg-event"===t?r.createElement(n.BgEvent,Object.assign({eventRange:i.eventRange,isStart:i.isStart,isEnd:i.isEnd},n.getEventRangeMeta(i.eventRange,o))):n.renderFill(t)))}return r.createElement(r.Fragment,{},...c)}componentDidMount(){const{rootEl:e}=this;this.disconnectHeight=n.watchHeight(e,e=>{n.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.disconnectHeight(),n.setRef(this.props.heightRef,null)}computeFgDims(){const{cells:e}=this.props,t=this.headerHeightRefMap.current,n=this.mainHeightRefMap.current;let r,i;for(const s of e){const e=t.get(s.key),a=n.get(s.key);if(null!=e&&((void 0===r||e>r)&&(r=e),null!=a)){const t=e+a;(void 0===i||t<i)&&(i=t)}}return[r,null!=i&&null!=r?i-r:void 0]}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}}class F extends n.DateComponent{constructor(){super(...arguments),this.splitBusinessHourSegs=n.memoize(f),this.splitBgEventSegs=n.memoize(f),this.splitFgEventSegs=n.memoize(f),this.splitDateSelectionSegs=n.memoize(f),this.splitEventDrag=n.memoize(h),this.splitEventResize=n.memoize(h),this.rowHeightRefMap=new n.RefMap((e,t)=>{const{rowHeightRefMap:n}=this.props;n&&n.handleValue(e,t)}),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:t,rowHeightRefMap:i}=this,{options:s}=t,a=e.cellRows.length,o=this.splitFgEventSegs(e.fgEventSegs,a),l=this.splitBgEventSegs(e.bgEventSegs,a),d=this.splitBusinessHourSegs(e.businessHourSegs,a),c=this.splitDateSelectionSegs(e.dateSelectionSegs,a),g=this.splitEventDrag(e.eventDrag,a),f=this.splitEventResize(e.eventResize,a),h=n.getIsHeightAuto(s),u=!e.forPrint&&!h,[m,p]=T(e.visibleWidth,a,h,e.forPrint,s);return r.createElement("div",{className:n.joinClassNames(!e.forPrint&&"fc-flex-col",e.className),style:{width:e.width},ref:this.handleRootEl},e.cellRows.map((t,h)=>r.createElement(z,{key:t[0].key,dateProfile:e.dateProfile,todayRange:e.todayRange,cells:t,showDayNumbers:a>1,showWeekNumbers:s.weekNumbers,forPrint:e.forPrint,isCompact:p,className:n.joinClassNames(u&&"fc-grow fc-basis0",a>1&&"fc-break-inside-avoid",h<a-1&&"fc-border-b"),fgEventSegs:o[h],bgEventSegs:l[h].filter(j),businessHourSegs:d[h],dateSelectionSegs:c[h],eventSelection:e.eventSelection,eventDrag:g[h],eventResize:f[h],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,colWidth:e.colWidth,minHeight:m,heightRef:i.createRef(t[0].key)})))}componentDidMount(){this.disconnectWidth=n.watchWidth(this.rootEl,e=>{this.setState({width:e})})}componentWillUnmount(){this.disconnectWidth()}queryHit(e,t,r){const{props:i,context:s}=this,a=i.cellRows[0].length,{col:o,left:l,right:d}=H(e,r,i.colWidth,a,s.isRtl),{row:c,top:g,bottom:f}=function(e,t,n){let r=0,i=0,s=0;for(const a of t){const t=a[0].key;if(i=s,s=i+n.get(t),e<s)break;r++}return{row:r,top:i,bottom:s}}(t,i.cellRows,this.rowHeightRefMap.current),h=i.cellRows[c][o],u=h.date,m=n.addDays(u,1);return{dateProfile:i.dateProfile,dateSpan:Object.assign({range:{start:u,end:m},allDay:!0},h.dateSpanProps),dayEl:M(N(this.rootEl,c),o),rect:{left:l,right:d,top:g,bottom:f},layer:0}}}function j(e){return e.eventRange.def.allDay}function T(e,t,n,r,i){if(null!=e){const s=e/i.aspectRatio/6;return[r?"6em":t>6||n?s:void 0,s<70]}return[void 0,!1]}class O extends n.BaseComponent{constructor(){super(...arguments),this.handleInnerEl=e=>{this.disconectInnerHeight&&(this.disconectInnerHeight(),this.disconectInnerHeight=void 0),e?this.disconectInnerHeight=n.watchHeight(e,e=>{n.setRef(this.props.innerHeightRef,e)}):n.setRef(this.props.innerHeightRef,null)}}render(){const{props:e}=this,{renderConfig:t,dataConfig:i}=e;return r.createElement(n.ContentContainer,{tag:"div",attrs:i.attrs,className:n.joinClassNames(i.className,"fc-header-cell fc-cell fc-flex-col fc-align-center",e.borderStart&&"fc-border-s",!e.isSticky&&"fc-crop",null==e.colWidth&&"fc-liquid"),style:{width:null!=e.colWidth?e.colWidth*(i.colSpan||1):void 0},renderProps:i.renderProps,generatorName:t.generatorName,customGenerator:t.customGenerator,defaultGenerator:n.renderText,classNameGenerator:i.renderProps.isDisabled?void 0:t.classNameGenerator,didMount:t.didMount,willUnmount:t.willUnmount},t=>!i.renderProps.isDisabled&&r.createElement(t,{tag:i.isNavLink?"a":"div",attrs:i.innerAttrs,className:n.joinClassNames("fc-cell-inner fc-flex-col fc-padding-sm",e.isSticky&&"fc-sticky-s"),elRef:this.handleInnerEl}))}}class B extends n.BaseComponent{constructor(){super(...arguments),this.innerHeightRefMap=new n.RefMap(()=>{n.afterSize(this.handleInnerHeights)}),this.handleInnerHeights=()=>{const e=this.innerHeightRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);this.currentInnerHeight!==t&&(this.currentInnerHeight=t,n.setRef(this.props.innerHeightRef,t))}}render(){const{props:e}=this;return r.createElement("div",{role:"row",className:n.joinClassNames("fc-flex-row fc-content-box",e.className),style:{height:e.height}},e.dataConfigs.map((t,n)=>r.createElement(O,{key:t.key,renderConfig:e.renderConfig,dataConfig:t,isSticky:e.isSticky,borderStart:Boolean(n),colWidth:e.colWidth,innerHeightRef:e.innerHeightRef})))}}class G extends n.BaseComponent{render(){const{props:e}=this;return r.createElement("div",{className:n.joinClassNames(e.className,"fc-flex-col",null==e.width&&"fc-liquid"),style:{width:e.width}},e.headerTiers.map((t,n)=>r.createElement(B,Object.assign({},t,{key:n,className:n?"fc-border-t":"",colWidth:e.colWidth}))))}}class I extends n.BaseComponent{constructor(){super(...arguments),this.handleScroller=e=>{n.setRef(this.props.scrollerRef,e)},this.handleClientWidth=e=>{this.setState({clientWidth:e})},this.handleEndScrollbarWidth=e=>{this.setState({endScrollbarWidth:e})}}render(){const{props:e,state:t,context:i}=this,{options:s}=i,a=!e.forPrint&&!n.getIsHeightAuto(s),o=!e.forPrint&&n.getStickyHeaderDates(s);return r.createElement(r.Fragment,null,s.dayHeaders&&r.createElement("div",{className:n.joinClassNames(e.forPrint?"fc-print-header":"fc-flex-row","fc-border-b")},r.createElement(G,{headerTiers:e.headerTiers,className:n.joinClassNames("fc-daygrid-header",o&&"fc-table-header-sticky")}),Boolean(t.endScrollbarWidth)&&r.createElement("div",{className:"fc-border-s fc-filler",style:{minWidth:t.endScrollbarWidth}})),r.createElement(n.Scroller,{vertical:a,clientWidthRef:this.handleClientWidth,endScrollbarWidthRef:this.handleEndScrollbarWidth,className:n.joinClassNames("fc-daygrid-body",!e.forPrint&&"fc-flex-col",a&&"fc-liquid"),ref:this.handleScroller},r.createElement(F,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:"fc-grow",dayMaxEvents:e.forPrint?void 0:s.dayMaxEvents,dayMaxEventRows:s.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,visibleWidth:null!=t.clientWidth&&null!=t.endScrollbarWidth?t.clientWidth+t.endScrollbarWidth:void 0,rowHeightRefMap:e.rowHeightRefMap})))}}class A extends n.BaseComponent{constructor(){super(...arguments),this.headerScrollerRef=r.createRef(),this.bodyScrollerRef=r.createRef(),this.footerScrollerRef=r.createRef(),this.handleClientWidth=e=>{this.setState({clientWidth:e})},this.handleEndScrollbarWidth=e=>{this.setState({endScrollbarWidth:e})}}render(){const{props:e,state:t,context:i}=this,{options:s}=i,a=!e.forPrint&&!n.getIsHeightAuto(s),o=!e.forPrint&&n.getStickyHeaderDates(s),l=!e.forPrint&&n.getStickyFooterScrollbar(s),d=e.cellRows[0].length,[c,g]=x(d,e.dayMinWidth,t.clientWidth);return r.createElement(r.Fragment,null,s.dayHeaders&&r.createElement("div",{className:"fc-print-header"},r.createElement(n.Scroller,{horizontal:!0,hideScrollbars:!0,className:n.joinClassNames("fc-daygrid-header fc-flex-row fc-border-b",o&&"fc-table-header-sticky"),ref:this.headerScrollerRef},r.createElement(G,{headerTiers:e.headerTiers,colWidth:g,width:c}),Boolean(t.endScrollbarWidth)&&r.createElement("div",{className:"fc-border-s fc-filler",style:{minWidth:t.endScrollbarWidth}}))),r.createElement(n.Scroller,{vertical:a,horizontal:!0,hideScrollbars:l||e.forPrint,className:n.joinClassNames("fc-daygrid-body",!e.forPrint&&"fc-flex-col",a&&"fc-liquid"),ref:this.bodyScrollerRef,clientWidthRef:this.handleClientWidth,endScrollbarWidthRef:this.handleEndScrollbarWidth},r.createElement(F,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:"fc-grow",dayMaxEvents:e.forPrint?void 0:s.dayMaxEvents,dayMaxEventRows:s.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,colWidth:g,width:c,visibleWidth:null!=t.clientWidth&&null!=t.endScrollbarWidth?t.clientWidth+t.endScrollbarWidth:void 0,rowHeightRefMap:e.rowHeightRefMap})),Boolean(l)&&r.createElement(n.StickyFooterScrollbar,{canvasWidth:c,scrollerRef:this.footerScrollerRef}))}componentDidMount(){const e=n.getScrollerSyncerClass(this.context.pluginHooks);this.syncedScroller=new e(!0),n.setRef(this.props.scrollerRef,this.syncedScroller),this.updateSyncedScroller()}componentDidUpdate(){this.updateSyncedScroller()}componentWillUnmount(){this.syncedScroller.destroy()}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current])}}class U extends n.BaseComponent{constructor(){super(...arguments),this.scrollerRef=r.createRef(),this.rowHeightRefMap=new n.RefMap(()=>{n.afterSize(this.updateScrollY)}),this.scrollDate=null,this.updateScrollY=()=>{const e=this.rowHeightRefMap.current,t=this.scrollerRef.current;if(t&&this.scrollDate){let n=function(e,t,n,r=0){let i=0;for(const s of t){const t=s[0].date,a=s[s.length-1].date,o=t.toISOString();if(e>=t&&e<=a)return i;const l=n.get(o);if(null==l)return;i+=l+r}return i}(this.scrollDate,this.props.cellRows,e,1);null!=n&&(n&&n++,t.scrollTo({y:n}))}},this.clearScroll=()=>{this.scrollDate=null}}render(){const{props:e,context:t}=this,{options:i}=t,s=Object.assign(Object.assign({},e),{scrollerRef:this.scrollerRef,rowHeightRefMap:this.rowHeightRefMap});return r.createElement(n.ViewContainer,{viewSpec:t.viewSpec,className:n.joinClassNames(e.className,"fc-print-root fc-border")},i.dayMinWidth?r.createElement(A,Object.assign({},s,{dayMinWidth:i.dayMinWidth})):r.createElement(I,Object.assign({},s)))}componentDidMount(){this.resetScroll(),this.scrollerRef.current.addScrollEndListener(this.clearScroll)}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset&&this.resetScroll()}componentWillUnmount(){this.scrollerRef.current.removeScrollEndListener(this.clearScroll)}resetScroll(){this.scrollDate=this.props.dateProfile.currentDate,this.updateScrollY();this.scrollerRef.current.scrollTo({x:0})}}class q extends n.BaseComponent{constructor(){super(...arguments),this.buildDayTableModel=n.memoize(D),this.buildDateRowConfigs=n.memoize(o),this.createDayHeaderFormatter=n.memoize(k),this.slicer=new i}render(){const{props:e,context:t}=this,{options:i}=t,s=this.buildDayTableModel(e.dateProfile,t.dateProfileGenerator),a=1===s.rowCnt,o=this.createDayHeaderFormatter(t.options.dayHeaderFormat,a,s.colCnt),l=this.slicer.sliceProps(e,e.dateProfile,i.nextDayThreshold,t,s);return r.createElement(n.NowTimer,{unit:"day"},(n,i)=>{const d=this.buildDateRowConfigs(s.headerDates,a,e.dateProfile,i,o,t);return r.createElement(U,{dateProfile:e.dateProfile,todayRange:i,cellRows:s.cellRows,forPrint:e.forPrint,className:"fc-daygrid",headerTiers:d,fgEventSegs:l.fgEventSegs,bgEventSegs:l.bgEventSegs,businessHourSegs:l.businessHourSegs,dateSelectionSegs:l.dateSelectionSegs,eventDrag:l.eventDrag,eventResize:l.eventResize,eventSelection:l.eventSelection})})}}class L extends n.DateProfileGenerator{buildRenderRange(e,t,n){let r=super.buildRenderRange(e,t,n),{props:i}=this;return Y({currentRange:r,snapToWeek:/^(year|month)$/.test(t),fixedWeekCount:i.fixedWeekCount,dateEnv:i.dateEnv})}}function Y(e){let t,{dateEnv:r,currentRange:i}=e,{start:s,end:a}=i;if(e.snapToWeek&&(s=r.startOfWeek(s),t=r.startOfWeek(a),t.valueOf()!==a.valueOf()&&(a=n.addWeeks(t,1))),e.fixedWeekCount){let e=r.startOfWeek(r.startOfMonth(n.addDays(i.end,-1))),t=Math.ceil(n.diffWeeks(e,a));a=n.addWeeks(a,6-t)}return{start:s,end:a}}n.injectStyles(":root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc-daygrid-day-header{display:flex;flex-direction:row-reverse}.fc-day-other .fc-daygrid-day-header{opacity:.3}.fc-daygrid-day-number{padding:4px;position:relative}.fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc-daygrid-day-body{display:flex;flex-direction:column;margin-bottom:1px}.fc-daygrid-day-body-tall{margin-bottom:1em;min-height:2em}.fc-daygrid-day-body:only-child{margin-top:2px}.fc-daygrid-more-link{border-radius:3px;cursor:pointer;font-size:var(--fc-small-font-size);margin:0 2px 1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap}.fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc-daygrid-more-link-button{align-self:flex-start}.fc-daygrid-more-link-block{border:1px solid var(--fc-event-border-color);padding:1px}.fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0}.fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);margin-bottom:1px}.fc-media-print .fc-daygrid-event{overflow:hidden!important;white-space:nowrap!important}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;direction:row;display:flex;padding:2px 0;position:relative;z-index:2}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-daygrid-dot-event .fc-event-time,.fc-daygrid-dot-event .fc-event-title{overflow:hidden;white-space:nowrap}.fc-daygrid-dot-event .fc-event-title{flex-basis:0;flex-grow:1;font-weight:700;min-height:0;min-width:0}");var _=t.createPlugin({name:"@fullcalendar/daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:q,dateProfileGeneratorClass:L},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}}),V={__proto__:null,DayTableSlicer:i,TableDateProfileGenerator:L,buildDayTableRenderRange:Y,DayGridView:q,DayGridHeaderRow:B,buildDateRowConfigs:o,buildDateRowConfig:l,buildDateRenderConfig:d,buildDateDataConfigs:c,createDayHeaderFormatter:k,DayGridLayout:U,computeRowHeight:T,DayGridRow:z,DayGridRows:F,buildDayTableModel:D,computeColWidth:x,computeColFromPosition:H,getRowEl:N,getCellEl:M};return t.globalPlugins.push(_),e.Internal=V,e.default=_,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal,FullCalendar.Preact);
6
+ FullCalendar.DayGrid=function(e,t,n,r){"use strict";class i extends n.Slicer{constructor(){super(...arguments),this.forceDayIfListItem=!0}sliceRange(e,t){return t.sliceRange(e)}}const a=n.createFormatter({weekday:"long"}),s=new Date(2592e5);function o(...e){return[l(...e)]}function l(e,t,n,r,i,a,s){return{renderConfig:d(a),dataConfigs:c(e,t,n,r,i,a,s)}}function d(e){const{options:t}=e;return{generatorName:"dayHeaderContent",customGenerator:t.dayHeaderContent,classNameGenerator:t.dayHeaderClassNames,didMount:t.dayHeaderDidMount,willUnmount:t.dayHeaderWillUnmount}}function c(e,t,r,i,o,l,d=1,c=""){const{dateEnv:g,viewApi:f,options:h}=l;return t?e.map(e=>{const t=n.getDateMeta(e,i,null,r),a=g.format(e,o),s=Object.assign(Object.assign({},t),{date:g.toDate(e),view:f,text:a}),u=h.navLinks&&!t.isDisabled,m=n.buildDateStr(l,e);return{key:c+e.toUTCString(),renderProps:s,attrs:Object.assign(Object.assign({"aria-label":m},t.isToday?{"aria-current":"date"}:{}),{"data-date":n.formatDayString(e)}),innerAttrs:u?n.buildNavLinkAttrs(l,e,void 0,m):{"aria-hidden":!0},colSpan:d,isNavLink:u,className:n.getDayClassName(t)}}):e.map(e=>{const t=e.getUTCDay(),r=n.addDays(s,t),i={dow:t,isDisabled:!1,isFuture:!1,isPast:!1,isToday:!1,isOther:!1},l=g.format(r,o),h=Object.assign(Object.assign({},i),{date:e,view:f,text:l}),u=g.format(r,a);return{key:c+String(t),renderProps:h,attrs:{"aria-label":u},innerAttrs:{"aria-hidden":!0},colSpan:d,className:n.getDayClassName(i)}})}function g(e){return n.getEventKey(e)+":"+e.start+(e.standinFor?":standin":e.isSlice?":slice":"")}function f(e,t){const n=[];for(let e=0;e<t;e++)n[e]=[];for(const t of e)n[t.row].push(t);return n}function h(e,t){const n=[];if(e){for(let r=0;r<t;r++)n[r]={affectedInstances:e.affectedInstances,isEvent:e.isEvent,segs:[]};for(const t of e.segs)n[t.row].segs.push(t)}else for(let e=0;e<t;e++)n[e]=null;return n}function u(e,t){return Object.assign(Object.assign({},e),{start:t,end:t+1,isStart:e.isStart&&e.start===t,isEnd:e.isEnd&&e.end-1===t,standinFor:e})}const m=n.createFormatter({hour:"numeric",minute:"2-digit",omitZeroMinute:!0,meridiem:"narrow"});function p(e){let{display:t}=e.eventRange.ui;return"list-item"===t||"auto"===t&&!e.eventRange.def.allDay&&e.end-e.start==1&&e.isStart&&e.isEnd}class v extends n.BaseComponent{render(){let{props:e}=this;return r.createElement(n.StandardEvent,Object.assign({},e,{className:"fc-daygrid-block-event fc-daygrid-event fc-h-event",defaultTimeFormat:m,defaultDisplayEventEnd:e.defaultDisplayEventEnd,disableResizing:!e.eventRange.def.allDay}))}}class y extends n.BaseComponent{render(){let{props:e,context:t}=this,{options:i}=t,{eventRange:a}=e,s=i.eventTimeFormat||m,o=n.buildEventRangeTimeText(s,a,void 0,void 0,e.isStart,e.isEnd,t,!0,e.defaultDisplayEventEnd),[l,d]=n.getEventTagAndAttrs(a,t);return r.createElement(n.EventContainer,Object.assign({},e,{tag:l,attrs:d,className:"fc-daygrid-dot-event fc-daygrid-event",defaultGenerator:R,timeText:o,isResizing:!1,isDateSelecting:!1}))}}function R(e){return r.createElement(r.Fragment,null,r.createElement("div",{className:"fc-daygrid-event-dot",style:{borderColor:e.borderColor||e.backgroundColor}}),e.timeText&&r.createElement("div",{className:"fc-event-time"},e.timeText),r.createElement("div",{className:"fc-event-title"},e.event.title||r.createElement(r.Fragment,null," ")))}class S extends n.BaseComponent{render(){let{props:e}=this;return r.createElement(n.MoreLinkContainer,{className:n.joinClassNames("fc-daygrid-more-link",e.isBlock?"fc-daygrid-more-link-block":"fc-daygrid-more-link-button"),dateProfile:e.dateProfile,todayRange:e.todayRange,allDayDate:e.allDayDate,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:e.alignElRef,alignParentTop:e.alignParentTop,dateSpanProps:e.dateSpanProps,popoverContent:()=>{let t=(e.eventDrag?e.eventDrag.affectedInstances:null)||(e.eventResize?e.eventResize.affectedInstances:null)||{};return r.createElement(r.Fragment,null,e.segs.map(i=>{let{eventRange:a}=i,{instanceId:s}=a.instance;return r.createElement("div",{key:s,style:{visibility:t[s]?"hidden":""}},p(i)?r.createElement(y,Object.assign({eventRange:a,isStart:i.isStart,isEnd:i.isEnd,isDragging:!1,isSelected:s===e.eventSelection,defaultDisplayEventEnd:!1},n.getEventRangeMeta(a,e.todayRange))):r.createElement(v,Object.assign({eventRange:a,isStart:i.isStart,isEnd:i.isEnd,isDragging:!1,isResizing:!1,isDateSelecting:!1,isSelected:s===e.eventSelection,defaultDisplayEventEnd:!1},n.getEventRangeMeta(a,e.todayRange))))}))}})}}class b extends n.DateComponent{constructor(){super(...arguments),this.rootElRef=r.createRef(),this.handleBodyEl=e=>{this.disconnectBodyHeight&&(this.disconnectBodyHeight(),this.disconnectBodyHeight=void 0,n.setRef(this.props.headerHeightRef,null),n.setRef(this.props.mainHeightRef,null)),e&&(this.disconnectBodyHeight=n.watchSize(e,(t,r)=>{const{props:i}=this,a=e.getBoundingClientRect(),s=this.rootElRef.current.getBoundingClientRect(),o=a.top-s.top;n.isDimsEqual(this.headerHeight,o)||(this.headerHeight=o,n.setRef(i.headerHeightRef,o)),i.fgLiquidHeight&&n.setRef(i.mainHeightRef,r)}))}}render(){let{props:e,context:t}=this,{options:i,dateEnv:a}=t;const s=e.showDayNumber&&function(e,t,r){const{start:i,end:a}=t,s=n.addMs(a,-1),o=r.getYear(i),l=r.getMonth(i),d=r.getYear(s),c=r.getMonth(s);return!(o===d&&l===c)&&Boolean(e.valueOf()===i.valueOf()||1===r.getDay(e)&&e.valueOf()<a.valueOf())}(e.date,e.dateProfile.currentRange,a),o=n.getDateMeta(e.date,e.todayRange,null,e.dateProfile),l=n.joinClassNames("fc-daygrid-day",e.borderStart&&"fc-border-s",null!=e.width?"":"fc-liquid","fc-flex-col");if(o.isDisabled)return r.createElement("div",{role:"gridcell","aria-disabled":!0,className:n.joinClassNames(l,"fc-day-disabled"),style:{width:e.width}});const d=e.showDayNumber||n.hasCustomDayCellContent(i),c=i.navLinks,g=n.buildDateStr(t,e.date);return r.createElement(n.DayCellContainer,{tag:"div",className:n.joinClassNames(l,e.className),attrs:Object.assign(Object.assign({},e.attrs),{role:"gridcell","aria-label":g}),style:{width:e.width},elRef:this.rootElRef,renderProps:e.renderProps,defaultGenerator:E,date:e.date,dateMeta:o,showDayNumber:e.showDayNumber,isMonthStart:s},i=>r.createElement(r.Fragment,null,d&&r.createElement("div",{className:"fc-daygrid-day-header"},r.createElement(i,{tag:"div",attrs:c?n.buildNavLinkAttrs(t,e.date,void 0,g):{"aria-hidden":!0},className:n.joinClassNames("fc-daygrid-day-number",s&&"fc-daygrid-month-start")})),r.createElement("div",{className:n.joinClassNames("fc-daygrid-day-body",e.isTall&&"fc-daygrid-day-body-tall",e.fgLiquidHeight?"fc-liquid":"fc-grow"),ref:this.handleBodyEl},r.createElement("div",{className:"fc-daygrid-day-events",style:{height:e.fgHeight}},e.fg),r.createElement(S,{isBlock:e.isCompact,allDayDate:e.date,segs:e.segs,hiddenSegs:e.hiddenSegs,alignElRef:this.rootElRef,alignParentTop:e.showDayNumber?"[role=row]":".fc-view",dateSpanProps:e.dateSpanProps,dateProfile:e.dateProfile,eventSelection:e.eventSelection,eventDrag:e.eventDrag,eventResize:e.eventResize,todayRange:e.todayRange}))))}}function E(e){return e.dayNumberText||r.createElement(r.Fragment,null," ")}function w(e,t){let n=e.get(t.eventRange);n||e.set(t.eventRange,n=[]),n.push(t)}function D(e,t){let r=new n.DaySeriesModel(e.renderRange,t);return new n.DayTableModel(r,/year|month|week/.test(e.currentRangeUnit))}function x(e,t,n){if(null==n)return[void 0,void 0];return n/e<t?[t*e,t]:[n,void 0]}function C(e,t,r,i){let a,s;if(null!=t)a=e.start*t,s=(r-e.end)*t;else{const t=1/r;a=n.fracToCssDim(e.start*t),s=n.fracToCssDim(1-e.end*t)}return i?{right:a,left:s}:{left:a,right:s}}function H(e,t,n,r,i){const a=null!=n?n:t/r,s=Math.floor(e/a),o=s*a;return{col:i?r-s-1:s,left:o,right:o+a}}function N(e,t){return e.querySelectorAll(":scope > [role=row]")[t]}function k(e,t){return e.querySelectorAll(":scope > [role=gridcell]")[t]}function M(e,t,r){return e||function(e,t){if(!e||t>10)return n.createFormatter({weekday:"short"});if(t>1)return n.createFormatter({weekday:"short",month:"numeric",day:"numeric",omitCommas:!0});return n.createFormatter({weekday:"long"})}(t,r)}class P extends r.Component{constructor(){super(...arguments),this.rootElRef=r.createRef()}render(){const{props:e}=this;return r.createElement("div",{className:n.joinClassNames(e.className,"fc-abs"),style:e.style,ref:this.rootElRef},e.children)}componentDidMount(){const e=this.rootElRef.current;this.disconnectHeight=n.watchHeight(e,e=>{n.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.disconnectHeight(),n.setRef(this.props.heightRef,null)}}const W=n.createFormatter({week:"narrow"});class z extends n.BaseComponent{constructor(){super(...arguments),this.headerHeightRefMap=new n.RefMap(()=>{n.afterSize(this.handleSegPositioning)}),this.mainHeightRefMap=new n.RefMap(()=>{(!0===this.props.dayMaxEvents||!0===this.props.dayMaxEventRows)&&n.afterSize(this.handleSegPositioning)}),this.segHeightRefMap=new n.RefMap(()=>{n.afterSize(this.handleSegPositioning)}),this.handleRootEl=e=>{this.rootEl=e,n.setRef(this.props.rootElRef,e)},this.handleSegPositioning=()=>{this.forceUpdate()}}render(){const{props:e,context:t,headerHeightRefMap:i,mainHeightRefMap:a}=this,{cells:s}=e,{options:o}=t,l=e.cells[0].date,d=!0===e.dayMaxEvents||!0===e.dayMaxEventRows,c=n.sortEventSegs(e.fgEventSegs,o.eventOrder),[f,h]=this.computeFgDims(),[m,p,v,y,R]=function(e,t,r,i,a,s=!0,o,l){let d,c,f;!0===o||!0===l?(d=i,f=!0):"number"==typeof o?(c=o,f=!1):"number"==typeof l&&(c=l,f=!0);const h=new Map,m=new Map,p=new Map,v=new Map;let y=new n.SegHierarchy(e,e=>t.get(g(e)),a,d,c,f,s);y.traverseSegs((e,t)=>{w(h,e),p.set(g(e),t),e.isSlice&&v.set(e.eventRange,!0)});for(const e of y.hiddenSegs)w(m,e);if(v.size){p.clear(),y=new n.SegHierarchy(function(e,t){const n=[];for(const r of e)n.push(...t.get(r.eventRange)||[]);return n}(e,h),e=>t.get(g(e)),a,d,c,f),y.traverseSegs((e,t)=>{p.set(g(e),t)});for(const e of y.hiddenSegs)w(m,e)}const R=[],S=[],b=[],E=[];for(let e=0;e<r.length;e++)R.push([]),S.push([]),b.push([]),E.push(0);for(const n of e){const{eventRange:e}=n,r=h.get(e)||[],i=m.get(e)||[],a=v.get(e)||!1;if(b[n.start].push(n),a)for(const e of r)b[e.start].push(e);for(const e of r){for(let t=e.start;t<e.end;t++){const n=u(e,t);R[t].push(n)}const n=g(e),r=p.get(n);if(null!=r){const i=t.get(n);for(let t=e.start;t<e.end;t++)E[t]=Math.max(E[t],r+i)}}for(const e of i)for(let t=e.start;t<e.end;t++){const n=u(e,t);R[t].push(n),S[t].push(n)}}return[R,S,b,p,E]}(c,this.segHeightRefMap.current,s,d?h:void 0,o.eventOrderStrict,o.eventSlicing,e.dayMaxEvents,e.dayMaxEventRows),S=[];if(null!=f){let e=0;for(const t of s){const n=i.current.get(t.key),r=f-n;S.push(R[e++]+r)}}const E=this.getHighlightSegs(),D=this.getMirrorSegs(),x=e.eventDrag&&e.eventDrag.affectedInstances||e.eventResize&&e.eventResize.affectedInstances||{},C=o.navLinks,H=n.buildDateStr(t,l,"week");return r.createElement("div",{role:e.role,"aria-label":"row"===e.role?H:void 0,className:n.joinClassNames("fc-flex-row fc-rel",e.className),style:{minHeight:e.minHeight},ref:this.handleRootEl},this.renderFillSegs(e.businessHourSegs,"non-business"),this.renderFillSegs(e.bgEventSegs,"bg-event"),this.renderFillSegs(E,"highlight"),r.createElement("div",{className:"fc-flex-row fc-liquid fc-rel"},e.cells.map((t,n)=>{const s=this.renderFgSegs(f,v[n],y,e.todayRange,x);return r.createElement(b,{key:t.key,dateProfile:e.dateProfile,todayRange:e.todayRange,date:t.date,showDayNumber:e.showDayNumbers,isCompact:e.isCompact,isTall:e.isTall,borderStart:Boolean(n),segs:m[n],hiddenSegs:p[n],fgLiquidHeight:d,fg:r.createElement(r.Fragment,null,s),eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,renderProps:t.renderProps,dateSpanProps:t.dateSpanProps,attrs:t.attrs,className:t.className,fgHeight:S[n],width:e.colWidth,headerHeightRef:i.createRef(t.key),mainHeightRef:a.createRef(t.key)})})),e.showWeekNumbers&&r.createElement(n.WeekNumberContainer,{tag:"div",attrs:Object.assign(Object.assign({},C?n.buildNavLinkAttrs(t,l,"week",H,!1):{}),{role:void 0,"aria-hidden":!0}),className:"fc-daygrid-week-number",date:l,defaultFormat:W}),this.renderFgSegs(f,D,y,e.todayRange,{},Boolean(e.eventDrag),Boolean(e.eventResize),!1))}renderFgSegs(e,t,i,a,s,o,l,d){var c;const{props:f,context:h,segHeightRefMap:u}=this,{isRtl:m}=h,{colWidth:R,eventSelection:S}=f,b=f.cells.length,E=1===f.cells.length,w=o||l||d,D=[];for(const f of t){const t=g(f),{standinFor:h,eventRange:x}=f,{instanceId:H}=x.instance;if(h)continue;const{left:N,right:k}=C(f,R,b,m),M=null!==(c=i.get(h?g(h):t))&&void 0!==c?c:w?0:void 0,W=null!=e&&null!=M?e+M:void 0,z=h||s[H]||null==W;D.push(r.createElement(P,{key:t,className:f.start?"fc-border-transparent fc-border-s":"",style:{visibility:z?"hidden":"",top:W,left:N,right:k},heightRef:h||w?null:u.createRef(t)},p(f)?r.createElement(y,Object.assign({eventRange:x,isStart:f.isStart,isEnd:f.isEnd,isDragging:o,isSelected:H===S,defaultDisplayEventEnd:E},n.getEventRangeMeta(x,a))):r.createElement(v,Object.assign({eventRange:x,isStart:f.isStart,isEnd:f.isEnd,isDragging:o,isResizing:l,isDateSelecting:d,isSelected:H===S,defaultDisplayEventEnd:E},n.getEventRangeMeta(x,a)))))}return D}renderFillSegs(e,t){const{props:i,context:a}=this,{isRtl:s}=a,{todayRange:o,colWidth:l}=i,d=i.cells.length,c=[];for(const i of e){const e=n.buildEventRangeKey(i.eventRange),{left:a,right:g}=C(i,l,d,s),f=!i.standinFor;c.push(r.createElement("div",{key:e,className:"fc-fill-y",style:{visibility:f?"":"hidden",left:a,right:g}},"bg-event"===t?r.createElement(n.BgEvent,Object.assign({eventRange:i.eventRange,isStart:i.isStart,isEnd:i.isEnd},n.getEventRangeMeta(i.eventRange,o))):n.renderFill(t)))}return r.createElement(r.Fragment,{},...c)}componentDidMount(){const{rootEl:e}=this;this.disconnectHeight=n.watchHeight(e,e=>{n.setRef(this.props.heightRef,e)})}componentWillUnmount(){this.disconnectHeight(),n.setRef(this.props.heightRef,null)}computeFgDims(){const{cells:e}=this.props,t=this.headerHeightRefMap.current,n=this.mainHeightRefMap.current;let r,i;for(const a of e){const e=t.get(a.key),s=n.get(a.key);if(null!=e&&((void 0===r||e>r)&&(r=e),null!=s)){const t=e+s;(void 0===i||t<i)&&(i=t)}}return[r,null!=i&&null!=r?i-r:void 0]}getMirrorSegs(){let{props:e}=this;return e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:[]}getHighlightSegs(){let{props:e}=this;return e.eventDrag&&e.eventDrag.segs.length?e.eventDrag.segs:e.eventResize&&e.eventResize.segs.length?e.eventResize.segs:e.dateSelectionSegs}}class j extends n.DateComponent{constructor(){super(...arguments),this.splitBusinessHourSegs=n.memoize(f),this.splitBgEventSegs=n.memoize(f),this.splitFgEventSegs=n.memoize(f),this.splitDateSelectionSegs=n.memoize(f),this.splitEventDrag=n.memoize(h),this.splitEventResize=n.memoize(h),this.rowHeightRefMap=new n.RefMap((e,t)=>{const{rowHeightRefMap:n}=this.props;n&&n.handleValue(e,t)}),this.handleRootEl=e=>{this.rootEl=e,e?this.context.registerInteractiveComponent(this,{el:e,isHitComboAllowed:this.props.isHitComboAllowed}):this.context.unregisterInteractiveComponent(this)}}render(){let{props:e,context:t,rowHeightRefMap:i}=this,{options:a}=t,s=e.cellRows.length,o=this.splitFgEventSegs(e.fgEventSegs,s),l=this.splitBgEventSegs(e.bgEventSegs,s),d=this.splitBusinessHourSegs(e.businessHourSegs,s),c=this.splitDateSelectionSegs(e.dateSelectionSegs,s),g=this.splitEventDrag(e.eventDrag,s),f=this.splitEventResize(e.eventResize,s),h=n.getIsHeightAuto(a),u=!e.forPrint&&!h,[m,p]=T(e.visibleWidth,s,h,e.forPrint,a);return r.createElement("div",{role:"rowgroup",className:n.joinClassNames(!e.forPrint&&"fc-flex-col",e.className),style:{width:e.width},ref:this.handleRootEl},e.cellRows.map((t,h)=>r.createElement(z,{key:t[0].key,role:"row",dateProfile:e.dateProfile,todayRange:e.todayRange,cells:t,showDayNumbers:s>1,showWeekNumbers:s>1&&a.weekNumbers,forPrint:e.forPrint,isCompact:p,className:n.joinClassNames(u&&"fc-grow fc-basis0",s>1&&"fc-break-inside-avoid",h<s-1&&"fc-border-b"),fgEventSegs:o[h],bgEventSegs:l[h].filter(F),businessHourSegs:d[h],dateSelectionSegs:c[h],eventSelection:e.eventSelection,eventDrag:g[h],eventResize:f[h],dayMaxEvents:e.dayMaxEvents,dayMaxEventRows:e.dayMaxEventRows,colWidth:e.colWidth,minHeight:m,heightRef:i.createRef(t[0].key)})))}componentDidMount(){this.disconnectWidth=n.watchWidth(this.rootEl,e=>{this.setState({width:e})})}componentWillUnmount(){this.disconnectWidth()}queryHit(e,t,r){const{props:i,context:a}=this,s=i.cellRows[0].length,{col:o,left:l,right:d}=H(e,r,i.colWidth,s,a.isRtl),{row:c,top:g,bottom:f}=function(e,t,n){let r=0,i=0,a=0;for(const s of t){const t=s[0].key;if(i=a,a=i+n.get(t),e<a)break;r++}return{row:r,top:i,bottom:a}}(t,i.cellRows,this.rowHeightRefMap.current),h=i.cellRows[c][o],u=h.date,m=n.addDays(u,1);return{dateProfile:i.dateProfile,dateSpan:Object.assign({range:{start:u,end:m},allDay:!0},h.dateSpanProps),dayEl:k(N(this.rootEl,c),o),rect:{left:l,right:d,top:g,bottom:f},layer:0}}}function F(e){return e.eventRange.def.allDay}function T(e,t,n,r,i){if(null!=e){const a=e/i.aspectRatio/6;return[r?"6em":t>6||n?a:void 0,a<70]}return[void 0,!1]}class O extends n.BaseComponent{constructor(){super(...arguments),this.handleInnerEl=e=>{this.disconectInnerHeight&&(this.disconectInnerHeight(),this.disconectInnerHeight=void 0),e?this.disconectInnerHeight=n.watchHeight(e,e=>{n.setRef(this.props.innerHeightRef,e)}):n.setRef(this.props.innerHeightRef,null)}}render(){const{props:e}=this,{renderConfig:t,dataConfig:i}=e,a=i.renderProps.isDisabled;return r.createElement(n.ContentContainer,{tag:"div",attrs:Object.assign({role:"columnheader","aria-colspan":i.colSpan},i.attrs),className:n.joinClassNames("fc-header-cell fc-cell fc-flex-col fc-align-center",e.borderStart&&"fc-border-s",!e.isSticky&&"fc-crop",null==e.colWidth&&"fc-liquid",i.className),style:{width:null!=e.colWidth?e.colWidth*(i.colSpan||1):void 0},renderProps:i.renderProps,generatorName:t.generatorName,customGenerator:t.customGenerator,defaultGenerator:n.renderText,classNameGenerator:a?void 0:t.classNameGenerator,didMount:t.didMount,willUnmount:t.willUnmount},t=>r.createElement(t,{tag:"div",attrs:i.innerAttrs,className:n.joinClassNames("fc-cell-inner fc-flex-col fc-padding-sm",e.isSticky&&"fc-sticky-s"),elRef:this.handleInnerEl}))}}class B extends n.BaseComponent{constructor(){super(...arguments),this.innerHeightRefMap=new n.RefMap(()=>{n.afterSize(this.handleInnerHeights)}),this.handleInnerHeights=()=>{const e=this.innerHeightRefMap.current;let t=0;for(const n of e.values())t=Math.max(t,n);this.currentInnerHeight!==t&&(this.currentInnerHeight=t,n.setRef(this.props.innerHeightRef,t))}}render(){const{props:e}=this;return r.createElement("div",{role:e.role,"aria-rowindex":null!=e.rowIndex?1+e.rowIndex:void 0,className:n.joinClassNames("fc-flex-row fc-content-box",e.className),style:{height:e.height}},e.dataConfigs.map((t,n)=>r.createElement(O,{key:t.key,renderConfig:e.renderConfig,dataConfig:t,isSticky:e.isSticky,borderStart:Boolean(n),colWidth:e.colWidth,innerHeightRef:e.innerHeightRef})))}}class I extends n.BaseComponent{render(){const{props:e}=this;return r.createElement("div",{role:"rowgroup",className:n.joinClassNames(e.className,"fc-flex-col",null==e.width&&"fc-liquid"),style:{width:e.width}},e.headerTiers.map((t,n)=>r.createElement(B,Object.assign({},t,{key:n,role:"row",className:n?"fc-border-t":"",colWidth:e.colWidth}))))}}class G extends n.BaseComponent{constructor(){super(...arguments),this.handleScroller=e=>{n.setRef(this.props.scrollerRef,e)},this.handleClientWidth=e=>{this.setState({clientWidth:e})},this.handleEndScrollbarWidth=e=>{this.setState({endScrollbarWidth:e})}}render(){const{props:e,state:t,context:i}=this,{options:a}=i,s=!e.forPrint&&!n.getIsHeightAuto(a),o=!e.forPrint&&n.getStickyHeaderDates(a);return r.createElement(r.Fragment,null,a.dayHeaders&&r.createElement("div",{className:n.joinClassNames(e.forPrint?"fc-print-header":"fc-flex-row","fc-border-b")},r.createElement(I,{headerTiers:e.headerTiers,className:n.joinClassNames("fc-daygrid-header",o&&"fc-table-header-sticky")}),Boolean(t.endScrollbarWidth)&&r.createElement("div",{className:"fc-border-s fc-filler",style:{minWidth:t.endScrollbarWidth}})),r.createElement(n.Scroller,{vertical:s,clientWidthRef:this.handleClientWidth,endScrollbarWidthRef:this.handleEndScrollbarWidth,className:n.joinClassNames("fc-daygrid-body",!e.forPrint&&"fc-flex-col",s&&"fc-liquid"),ref:this.handleScroller},r.createElement(j,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:"fc-grow",dayMaxEvents:e.forPrint?void 0:a.dayMaxEvents,dayMaxEventRows:a.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,visibleWidth:null!=t.clientWidth&&null!=t.endScrollbarWidth?t.clientWidth+t.endScrollbarWidth:void 0,rowHeightRefMap:e.rowHeightRefMap})))}}class A extends n.BaseComponent{constructor(){super(...arguments),this.headerScrollerRef=r.createRef(),this.bodyScrollerRef=r.createRef(),this.footerScrollerRef=r.createRef(),this.handleClientWidth=e=>{this.setState({clientWidth:e})},this.handleEndScrollbarWidth=e=>{this.setState({endScrollbarWidth:e})}}render(){const{props:e,state:t,context:i}=this,{options:a}=i,s=!e.forPrint&&!n.getIsHeightAuto(a),o=!e.forPrint&&n.getStickyHeaderDates(a),l=!e.forPrint&&n.getStickyFooterScrollbar(a),d=e.cellRows[0].length,[c,g]=x(d,e.dayMinWidth,t.clientWidth);return r.createElement(r.Fragment,null,a.dayHeaders&&r.createElement("div",{className:"fc-print-header"},r.createElement(n.Scroller,{horizontal:!0,hideScrollbars:!0,className:n.joinClassNames("fc-daygrid-header fc-flex-row fc-border-b",o&&"fc-table-header-sticky"),ref:this.headerScrollerRef},r.createElement(I,{headerTiers:e.headerTiers,colWidth:g,width:c}),Boolean(t.endScrollbarWidth)&&r.createElement("div",{className:"fc-border-s fc-filler",style:{minWidth:t.endScrollbarWidth}}))),r.createElement(n.Scroller,{vertical:s,horizontal:!0,hideScrollbars:l||e.forPrint,className:n.joinClassNames("fc-daygrid-body",!e.forPrint&&"fc-flex-col",s&&"fc-liquid"),ref:this.bodyScrollerRef,clientWidthRef:this.handleClientWidth,endScrollbarWidthRef:this.handleEndScrollbarWidth},r.createElement(j,{dateProfile:e.dateProfile,todayRange:e.todayRange,cellRows:e.cellRows,forPrint:e.forPrint,isHitComboAllowed:e.isHitComboAllowed,className:"fc-grow",dayMaxEvents:e.forPrint?void 0:a.dayMaxEvents,dayMaxEventRows:a.dayMaxEventRows,fgEventSegs:e.fgEventSegs,bgEventSegs:e.bgEventSegs,businessHourSegs:e.businessHourSegs,dateSelectionSegs:e.dateSelectionSegs,eventDrag:e.eventDrag,eventResize:e.eventResize,eventSelection:e.eventSelection,colWidth:g,width:c,visibleWidth:null!=t.clientWidth&&null!=t.endScrollbarWidth?t.clientWidth+t.endScrollbarWidth:void 0,rowHeightRefMap:e.rowHeightRefMap})),Boolean(l)&&r.createElement(n.StickyFooterScrollbar,{canvasWidth:c,scrollerRef:this.footerScrollerRef}))}componentDidMount(){const e=n.getScrollerSyncerClass(this.context.pluginHooks);this.syncedScroller=new e(!0),n.setRef(this.props.scrollerRef,this.syncedScroller),this.updateSyncedScroller()}componentDidUpdate(){this.updateSyncedScroller()}componentWillUnmount(){this.syncedScroller.destroy()}updateSyncedScroller(){this.syncedScroller.handleChildren([this.headerScrollerRef.current,this.bodyScrollerRef.current,this.footerScrollerRef.current])}}class U extends n.BaseComponent{constructor(){super(...arguments),this.scrollerRef=r.createRef(),this.rowHeightRefMap=new n.RefMap(()=>{n.afterSize(this.updateScrollY)}),this.scrollDate=null,this.updateScrollY=()=>{const e=this.rowHeightRefMap.current,t=this.scrollerRef.current;if(t&&this.scrollDate){let n=function(e,t,n,r=0){let i=0;for(const a of t){const t=a[0].date,s=a[a.length-1].date,o=t.toISOString();if(e>=t&&e<=s)return i;const l=n.get(o);if(null==l)return;i+=l+r}return i}(this.scrollDate,this.props.cellRows,e,1);null!=n&&(n&&n++,t.scrollTo({y:n}))}},this.handleScrollEnd=({isUser:e})=>{e&&(this.scrollDate=null)}}render(){const{props:e,context:t}=this,{options:i}=t,a=Object.assign(Object.assign({},e),{scrollerRef:this.scrollerRef,rowHeightRefMap:this.rowHeightRefMap});return r.createElement(n.ViewContainer,{viewSpec:t.viewSpec,attrs:{role:"grid","aria-rowcount":e.headerTiers.length+e.cellRows.length,"aria-colcount":e.cellRows[0].length,"aria-labelledby":e.labelId,"aria-label":e.labelStr},className:n.joinClassNames(e.className,"fc-print-root fc-border")},i.dayMinWidth?r.createElement(A,Object.assign({},a,{dayMinWidth:i.dayMinWidth})):r.createElement(G,Object.assign({},a)))}componentDidMount(){this.resetScroll(),this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd)}componentDidUpdate(e){e.dateProfile!==this.props.dateProfile&&this.context.options.scrollTimeReset&&this.resetScroll()}componentWillUnmount(){this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd)}resetScroll(){this.scrollDate=this.props.dateProfile.currentDate,this.updateScrollY();this.scrollerRef.current.scrollTo({x:0})}}class L extends n.BaseComponent{constructor(){super(...arguments),this.buildDayTableModel=n.memoize(D),this.buildDateRowConfigs=n.memoize(o),this.createDayHeaderFormatter=n.memoize(M),this.slicer=new i}render(){const{props:e,context:t}=this,{options:i}=t,a=this.buildDayTableModel(e.dateProfile,t.dateProfileGenerator),s=1===a.rowCnt,o=this.createDayHeaderFormatter(t.options.dayHeaderFormat,s,a.colCnt),l=this.slicer.sliceProps(e,e.dateProfile,i.nextDayThreshold,t,a);return r.createElement(n.NowTimer,{unit:"day"},(n,i)=>{const d=this.buildDateRowConfigs(a.headerDates,s,e.dateProfile,i,o,t);return r.createElement(U,{labelId:e.labelId,labelStr:e.labelStr,dateProfile:e.dateProfile,todayRange:i,cellRows:a.cellRows,forPrint:e.forPrint,className:"fc-daygrid",headerTiers:d,fgEventSegs:l.fgEventSegs,bgEventSegs:l.bgEventSegs,businessHourSegs:l.businessHourSegs,dateSelectionSegs:l.dateSelectionSegs,eventDrag:l.eventDrag,eventResize:l.eventResize,eventSelection:l.eventSelection})})}}class q extends n.DateProfileGenerator{buildRenderRange(e,t,n){let r=super.buildRenderRange(e,t,n),{props:i}=this;return Y({currentRange:r,snapToWeek:/^(year|month)$/.test(t),fixedWeekCount:i.fixedWeekCount,dateEnv:i.dateEnv})}}function Y(e){let t,{dateEnv:r,currentRange:i}=e,{start:a,end:s}=i;if(e.snapToWeek&&(a=r.startOfWeek(a),t=r.startOfWeek(s),t.valueOf()!==s.valueOf()&&(s=n.addWeeks(t,1))),e.fixedWeekCount){let e=r.startOfWeek(r.startOfMonth(n.addDays(i.end,-1))),t=Math.ceil(n.diffWeeks(e,s));s=n.addWeeks(s,6-t)}return{start:a,end:s}}n.injectStyles(":root{--fc-daygrid-event-dot-width:8px}.fc-daygrid-day.fc-day-today{background-color:var(--fc-today-bg-color)}.fc-daygrid-day-header{display:flex;flex-direction:row-reverse}.fc-day-other .fc-daygrid-day-header{opacity:.3}.fc-daygrid-day-number{padding:4px;position:relative}.fc-daygrid-month-start{font-size:1.1em;font-weight:700}.fc-daygrid-day-body{display:flex;flex-direction:column;margin-bottom:1px}.fc-daygrid-day-body-tall{margin-bottom:1em;min-height:2em}.fc-daygrid-day-body:only-child{margin-top:2px}.fc-daygrid-more-link{border-radius:3px;cursor:pointer;font-size:var(--fc-small-font-size);margin:0 2px 1px;max-width:100%;overflow:hidden;padding:2px;position:relative;white-space:nowrap}.fc-daygrid-more-link:hover{background-color:rgba(0,0,0,.1)}.fc-daygrid-more-link-button{align-self:flex-start}.fc-daygrid-more-link-block{border:1px solid var(--fc-event-border-color);padding:1px}.fc-daygrid-week-number{background-color:var(--fc-neutral-bg-color);color:var(--fc-neutral-text-color);min-width:1.5em;padding:2px;position:absolute;text-align:center;top:0}.fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-daygrid-event{border-radius:3px;font-size:var(--fc-small-font-size);margin-bottom:1px}.fc-media-print .fc-daygrid-event{overflow:hidden!important;white-space:nowrap!important}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-bottom-left-radius:0;border-left-width:0;border-top-left-radius:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-bottom-right-radius:0;border-right-width:0;border-top-right-radius:0}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{align-items:center;direction:row;display:flex;padding:2px 0;position:relative;z-index:2}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{bottom:-10px;top:-10px}.fc-daygrid-event-dot{border:calc(var(--fc-daygrid-event-dot-width)/2) solid var(--fc-event-border-color);border-radius:calc(var(--fc-daygrid-event-dot-width)/2);box-sizing:content-box;height:0;margin:0 4px;width:0}.fc-daygrid-dot-event .fc-event-time,.fc-daygrid-dot-event .fc-event-title{overflow:hidden;white-space:nowrap}.fc-daygrid-dot-event .fc-event-title{flex-basis:0;flex-grow:1;font-weight:700;min-height:0;min-width:0}");var _=t.createPlugin({name:"@fullcalendar/daygrid",initialView:"dayGridMonth",views:{dayGrid:{component:L,dateProfileGeneratorClass:q},dayGridDay:{type:"dayGrid",duration:{days:1}},dayGridWeek:{type:"dayGrid",duration:{weeks:1}},dayGridMonth:{type:"dayGrid",duration:{months:1},fixedWeekCount:!0},dayGridYear:{type:"dayGrid",duration:{years:1}}}}),V={__proto__:null,DayTableSlicer:i,TableDateProfileGenerator:q,buildDayTableRenderRange:Y,DayGridView:L,DayGridHeaderRow:B,buildDateRowConfigs:o,buildDateRowConfig:l,buildDateRenderConfig:d,buildDateDataConfigs:c,createDayHeaderFormatter:M,DayGridLayout:U,computeRowHeight:T,DayGridRow:z,DayGridRows:j,buildDayTableModel:D,computeColWidth:x,computeColFromPosition:H,getRowEl:N,getCellEl:k};return t.globalPlugins.push(_),e.Internal=V,e.default=_,Object.defineProperty(e,"__esModule",{value:!0}),e}({},FullCalendar,FullCalendar.Internal,FullCalendar.Preact);
package/internal.cjs CHANGED
@@ -36,6 +36,10 @@ context, colSpan) {
36
36
  dataConfigs: buildDateDataConfigs(dates, datesRepDistinctDays, dateProfile, todayRange, dayHeaderFormat, context, colSpan)
37
37
  };
38
38
  }
39
+ /*
40
+ For header cells: how to connect w/ custom rendering
41
+ Applies to all cells in a row
42
+ */
39
43
  function buildDateRenderConfig(context) {
40
44
  const { options } = context;
41
45
  return {
@@ -46,6 +50,9 @@ function buildDateRenderConfig(context) {
46
50
  willUnmount: options.dayHeaderWillUnmount,
47
51
  };
48
52
  }
53
+ /*
54
+ For header cells: data
55
+ */
49
56
  function buildDateDataConfigs(dates, datesRepDistinctDays, dateProfile, todayRange, dayHeaderFormat, // TODO: rename to dateHeaderFormat?
50
57
  context, colSpan = 1, keyPrefix = '') {
51
58
  const { dateEnv, viewApi, options } = context;
@@ -55,11 +62,16 @@ context, colSpan = 1, keyPrefix = '') {
55
62
  const text = dateEnv.format(date, dayHeaderFormat);
56
63
  const renderProps = Object.assign(Object.assign({}, dateMeta), { date: dateEnv.toDate(date), view: viewApi, text });
57
64
  const isNavLink = options.navLinks && !dateMeta.isDisabled;
65
+ const fullDateStr = internal_cjs.buildDateStr(context, date);
66
+ // for DayGridHeaderCell
58
67
  return {
59
68
  key: keyPrefix + date.toUTCString(),
60
69
  renderProps,
61
- attrs: { 'data-date': !dateMeta.isDisabled ? internal_cjs.formatDayString(date) : undefined },
62
- innerAttrs: isNavLink ? internal_cjs.buildNavLinkAttrs(context, date) : {},
70
+ attrs: Object.assign(Object.assign({ 'aria-label': fullDateStr }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), { 'data-date': internal_cjs.formatDayString(date) }),
71
+ // for navlink
72
+ innerAttrs: isNavLink
73
+ ? internal_cjs.buildNavLinkAttrs(context, date, undefined, fullDateStr)
74
+ : { 'aria-hidden': true },
63
75
  colSpan,
64
76
  isNavLink,
65
77
  className: internal_cjs.getDayClassName(dateMeta),
@@ -78,10 +90,18 @@ context, colSpan = 1, keyPrefix = '') {
78
90
  };
79
91
  const text = dateEnv.format(normDate, dayHeaderFormat);
80
92
  const renderProps = Object.assign(Object.assign({}, dayMeta), { date, view: viewApi, text });
93
+ const fullWeekDayStr = dateEnv.format(normDate, WEEKDAY_FORMAT);
94
+ // for DayGridHeaderCell
81
95
  return {
82
96
  key: keyPrefix + String(dow),
83
97
  renderProps,
84
- innerAttrs: { 'aria-label': dateEnv.format(normDate, WEEKDAY_FORMAT) },
98
+ attrs: {
99
+ 'aria-label': fullWeekDayStr,
100
+ },
101
+ // for navlink
102
+ innerAttrs: {
103
+ 'aria-hidden': true, // label already on cell
104
+ },
85
105
  colSpan,
86
106
  className: internal_cjs.getDayClassName(dayMeta),
87
107
  };
@@ -167,8 +187,8 @@ class DayGridListEvent extends internal_cjs.BaseComponent {
167
187
  /* slicedStart = */ undefined,
168
188
  /* slicedEnd = */ undefined, props.isStart, props.isEnd, context,
169
189
  /* defaultDisplayEventTime = */ true, props.defaultDisplayEventEnd);
170
- let anchorAttrs = internal_cjs.getEventRangeAnchorAttrs(eventRange, context);
171
- return (preact_cjs.createElement(internal_cjs.EventContainer, Object.assign({}, props, { tag: anchorAttrs ? 'a' : 'div', attrs: anchorAttrs, className: 'fc-daygrid-dot-event fc-daygrid-event', defaultGenerator: renderInnerContent, timeText: timeText, isResizing: false, isDateSelecting: false })));
190
+ let [tag, attrs] = internal_cjs.getEventTagAndAttrs(eventRange, context);
191
+ return (preact_cjs.createElement(internal_cjs.EventContainer, Object.assign({}, props, { tag: tag, attrs: attrs, className: 'fc-daygrid-dot-event fc-daygrid-event', defaultGenerator: renderInnerContent, timeText: timeText, isResizing: false, isDateSelecting: false })));
172
192
  }
173
193
  }
174
194
  function renderInnerContent(renderProps) {
@@ -204,7 +224,30 @@ class DayGridCell extends internal_cjs.DateComponent {
204
224
  super(...arguments);
205
225
  // ref
206
226
  this.rootElRef = preact_cjs.createRef();
207
- this.bodyElRef = preact_cjs.createRef();
227
+ this.handleBodyEl = (bodyEl) => {
228
+ if (this.disconnectBodyHeight) {
229
+ this.disconnectBodyHeight();
230
+ this.disconnectBodyHeight = undefined;
231
+ internal_cjs.setRef(this.props.headerHeightRef, null);
232
+ internal_cjs.setRef(this.props.mainHeightRef, null);
233
+ }
234
+ if (bodyEl) {
235
+ // we want to fire on ANY size change, because we do more advanced stuff
236
+ this.disconnectBodyHeight = internal_cjs.watchSize(bodyEl, (_bodyWidth, bodyHeight) => {
237
+ const { props } = this;
238
+ const mainRect = bodyEl.getBoundingClientRect();
239
+ const rootRect = this.rootElRef.current.getBoundingClientRect();
240
+ const headerHeight = mainRect.top - rootRect.top;
241
+ if (!internal_cjs.isDimsEqual(this.headerHeight, headerHeight)) {
242
+ this.headerHeight = headerHeight;
243
+ internal_cjs.setRef(props.headerHeightRef, headerHeight);
244
+ }
245
+ if (props.fgLiquidHeight) {
246
+ internal_cjs.setRef(props.mainHeightRef, bodyHeight);
247
+ }
248
+ });
249
+ }
250
+ };
208
251
  }
209
252
  render() {
210
253
  let { props, context } = this;
@@ -212,38 +255,29 @@ class DayGridCell extends internal_cjs.DateComponent {
212
255
  // TODO: memoize this
213
256
  const isMonthStart = props.showDayNumber &&
214
257
  shouldDisplayMonthStart(props.date, props.dateProfile.currentRange, dateEnv);
215
- return (preact_cjs.createElement(internal_cjs.DayCellContainer, { tag: "div", className: internal_cjs.joinClassNames(props.className, 'fc-daygrid-day fc-flex-col', props.borderStart && 'fc-border-s', props.width != null ? '' : 'fc-liquid'), attrs: Object.assign(Object.assign({}, props.attrs), { role: 'gridcell' }), style: {
258
+ // TODO: memoize this
259
+ const dateMeta = internal_cjs.getDateMeta(props.date, props.todayRange, null, props.dateProfile);
260
+ const baseClassName = internal_cjs.joinClassNames('fc-daygrid-day', props.borderStart && 'fc-border-s', props.width != null ? '' : 'fc-liquid', 'fc-flex-col');
261
+ if (dateMeta.isDisabled) {
262
+ return (preact_cjs.createElement("div", { role: 'gridcell', "aria-disabled": true, className: internal_cjs.joinClassNames(baseClassName, 'fc-day-disabled'), style: {
263
+ width: props.width
264
+ } }));
265
+ }
266
+ const hasDayNumber = props.showDayNumber || internal_cjs.hasCustomDayCellContent(options);
267
+ const isNavLink = options.navLinks;
268
+ const fullDateStr = internal_cjs.buildDateStr(context, props.date);
269
+ return (preact_cjs.createElement(internal_cjs.DayCellContainer, { tag: "div", className: internal_cjs.joinClassNames(baseClassName, props.className), attrs: Object.assign(Object.assign({}, props.attrs), { role: 'gridcell', 'aria-label': fullDateStr }), style: {
216
270
  width: props.width
217
- }, elRef: this.rootElRef, renderProps: props.renderProps, defaultGenerator: renderTopInner, date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, isMonthStart: isMonthStart }, (InnerContent, renderProps) => (preact_cjs.createElement(preact_cjs.Fragment, null,
218
- !renderProps.isDisabled && (props.showDayNumber || internal_cjs.hasCustomDayCellContent(options)) && (preact_cjs.createElement("div", { className: "fc-daygrid-day-header" },
219
- preact_cjs.createElement(InnerContent, { tag: "a", attrs: internal_cjs.buildNavLinkAttrs(context, props.date), className: internal_cjs.joinClassNames('fc-daygrid-day-number', isMonthStart && 'fc-daygrid-month-start') }))),
220
- preact_cjs.createElement("div", { className: internal_cjs.joinClassNames('fc-daygrid-day-body', props.isTall && 'fc-daygrid-day-body-tall', props.fgLiquidHeight ? 'fc-liquid' : 'fc-grow'), ref: this.bodyElRef },
271
+ }, elRef: this.rootElRef, renderProps: props.renderProps, defaultGenerator: renderTopInner, date: props.date, dateMeta: dateMeta, showDayNumber: props.showDayNumber, isMonthStart: isMonthStart }, (InnerContent) => (preact_cjs.createElement(preact_cjs.Fragment, null,
272
+ hasDayNumber && (preact_cjs.createElement("div", { className: "fc-daygrid-day-header" },
273
+ preact_cjs.createElement(InnerContent, { tag: 'div', attrs: isNavLink
274
+ ? internal_cjs.buildNavLinkAttrs(context, props.date, undefined, fullDateStr)
275
+ : { 'aria-hidden': true } // label already on cell
276
+ , className: internal_cjs.joinClassNames('fc-daygrid-day-number', isMonthStart && 'fc-daygrid-month-start') }))),
277
+ preact_cjs.createElement("div", { className: internal_cjs.joinClassNames('fc-daygrid-day-body', props.isTall && 'fc-daygrid-day-body-tall', props.fgLiquidHeight ? 'fc-liquid' : 'fc-grow'), ref: this.handleBodyEl },
221
278
  preact_cjs.createElement("div", { className: 'fc-daygrid-day-events', style: { height: props.fgHeight } }, props.fg),
222
279
  preact_cjs.createElement(DayGridMoreLink, { isBlock: props.isCompact, allDayDate: props.date, segs: props.segs, hiddenSegs: props.hiddenSegs, alignElRef: this.rootElRef, alignParentTop: props.showDayNumber ? '[role=row]' : '.fc-view', dateSpanProps: props.dateSpanProps, dateProfile: props.dateProfile, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange }))))));
223
280
  }
224
- componentDidMount() {
225
- const bodyEl = this.bodyElRef.current;
226
- // we want to fire on ANY size change, because we do more advanced stuff
227
- this.disconnectBodyHeight = internal_cjs.watchSize(bodyEl, (_bodyWidth, bodyHeight) => {
228
- const { props } = this;
229
- const mainRect = bodyEl.getBoundingClientRect();
230
- const rootRect = this.rootElRef.current.getBoundingClientRect();
231
- const headerHeight = mainRect.top - rootRect.top;
232
- if (!internal_cjs.isDimsEqual(this.headerHeight, headerHeight)) {
233
- this.headerHeight = headerHeight;
234
- internal_cjs.setRef(props.headerHeightRef, headerHeight);
235
- }
236
- if (props.fgLiquidHeight) {
237
- internal_cjs.setRef(props.mainHeightRef, bodyHeight);
238
- }
239
- });
240
- }
241
- componentWillUnmount() {
242
- this.disconnectBodyHeight();
243
- const { props } = this;
244
- internal_cjs.setRef(props.headerHeightRef, null);
245
- internal_cjs.setRef(props.mainHeightRef, null);
246
- }
247
281
  }
248
282
  // Utils
249
283
  // -------------------------------------------------------------------------------------------------
@@ -567,7 +601,11 @@ class DayGridRow extends internal_cjs.BaseComponent {
567
601
  (props.eventDrag && props.eventDrag.affectedInstances) ||
568
602
  (props.eventResize && props.eventResize.affectedInstances) ||
569
603
  {};
570
- return (preact_cjs.createElement("div", { role: 'row' // TODO: audit this for all scenarios
604
+ const isNavLink = options.navLinks;
605
+ const fullWeekStr = internal_cjs.buildDateStr(context, weekDate, 'week');
606
+ return (preact_cjs.createElement("div", { role: props.role /* !!! */, "aria-label": props.role === 'row' // HACK
607
+ ? fullWeekStr
608
+ : undefined // can't have label on non-role div
571
609
  , className: internal_cjs.joinClassNames('fc-flex-row fc-rel', props.className), style: {
572
610
  minHeight: props.minHeight,
573
611
  }, ref: this.handleRootEl },
@@ -586,7 +624,9 @@ class DayGridRow extends internal_cjs.BaseComponent {
586
624
  // refs
587
625
  headerHeightRef: headerHeightRefMap.createRef(cell.key), mainHeightRef: mainHeightRefMap.createRef(cell.key) }));
588
626
  })),
589
- props.showWeekNumbers && (preact_cjs.createElement(internal_cjs.WeekNumberContainer, { tag: "a", attrs: internal_cjs.buildNavLinkAttrs(context, weekDate, 'week'), className: 'fc-daygrid-week-number', date: weekDate, defaultFormat: DEFAULT_WEEK_NUM_FORMAT })),
627
+ props.showWeekNumbers && (preact_cjs.createElement(internal_cjs.WeekNumberContainer, { tag: 'div', attrs: Object.assign(Object.assign({}, (isNavLink
628
+ ? internal_cjs.buildNavLinkAttrs(context, weekDate, 'week', fullWeekStr, /* isTabbable = */ false)
629
+ : {})), { 'role': undefined, 'aria-hidden': true }), className: 'fc-daygrid-week-number', date: weekDate, defaultFormat: DEFAULT_WEEK_NUM_FORMAT })),
590
630
  this.renderFgSegs(maxMainTop, mirrorSegs, segTops, props.todayRange, {}, // forcedInvisibleMap
591
631
  Boolean(props.eventDrag), Boolean(props.eventResize), false)));
592
632
  }
@@ -747,10 +787,10 @@ class DayGridRows extends internal_cjs.DateComponent {
747
787
  let isHeightAuto = internal_cjs.getIsHeightAuto(options);
748
788
  let rowHeightsRedistribute = !props.forPrint && !isHeightAuto;
749
789
  let [rowMinHeight, isCompact] = computeRowHeight(props.visibleWidth, rowCnt, isHeightAuto, props.forPrint, options);
750
- return (preact_cjs.createElement("div", { className: internal_cjs.joinClassNames(
790
+ return (preact_cjs.createElement("div", { role: 'rowgroup', className: internal_cjs.joinClassNames(
751
791
  // HACK for Safari. Can't do break-inside:avoid with flexbox items, likely b/c it's not standard:
752
792
  // https://stackoverflow.com/a/60256345
753
- !props.forPrint && 'fc-flex-col', props.className), style: { width: props.width }, ref: this.handleRootEl }, props.cellRows.map((cells, row) => (preact_cjs.createElement(DayGridRow, { key: cells[0].key, dateProfile: props.dateProfile, todayRange: props.todayRange, cells: cells, showDayNumbers: rowCnt > 1, showWeekNumbers: options.weekNumbers, forPrint: props.forPrint, isCompact: isCompact,
793
+ !props.forPrint && 'fc-flex-col', props.className), style: { width: props.width }, ref: this.handleRootEl }, props.cellRows.map((cells, row) => (preact_cjs.createElement(DayGridRow, { key: cells[0].key, role: 'row', dateProfile: props.dateProfile, todayRange: props.todayRange, cells: cells, showDayNumbers: rowCnt > 1, showWeekNumbers: rowCnt > 1 && options.weekNumbers, forPrint: props.forPrint, isCompact: isCompact,
754
794
  // if not auto-height, distribute height of container somewhat evently to rows
755
795
  // (treat all as zero, distribute height, then ensure min-heights -- the inner content height)
756
796
  className: internal_cjs.joinClassNames(rowHeightsRedistribute && 'fc-grow fc-basis0', rowCnt > 1 && 'fc-break-inside-avoid', // don't avoid breaks for single tall row
@@ -847,14 +887,16 @@ class DayGridHeaderCell extends internal_cjs.BaseComponent {
847
887
  render() {
848
888
  const { props } = this;
849
889
  const { renderConfig, dataConfig } = props;
850
- return (preact_cjs.createElement(internal_cjs.ContentContainer, { tag: 'div', attrs: dataConfig.attrs, className: internal_cjs.joinClassNames(dataConfig.className, 'fc-header-cell fc-cell fc-flex-col fc-align-center', props.borderStart && 'fc-border-s', !props.isSticky && 'fc-crop', props.colWidth == null && 'fc-liquid'), style: {
890
+ // HACK
891
+ const isDisabled = dataConfig.renderProps.isDisabled;
892
+ return (preact_cjs.createElement(internal_cjs.ContentContainer, { tag: 'div', attrs: Object.assign({ role: 'columnheader', 'aria-colspan': dataConfig.colSpan }, dataConfig.attrs), className: internal_cjs.joinClassNames('fc-header-cell fc-cell fc-flex-col fc-align-center', props.borderStart && 'fc-border-s', !props.isSticky && 'fc-crop', props.colWidth == null && 'fc-liquid', dataConfig.className), style: {
851
893
  width: props.colWidth != null
852
894
  ? props.colWidth * (dataConfig.colSpan || 1)
853
895
  : undefined,
854
896
  }, renderProps: dataConfig.renderProps, generatorName: renderConfig.generatorName, customGenerator: renderConfig.customGenerator, defaultGenerator: internal_cjs.renderText, classNameGenerator:
855
897
  // don't use custom classNames if disabled
856
898
  // TODO: make DRY with DayCellContainer
857
- dataConfig.renderProps.isDisabled ? undefined : renderConfig.classNameGenerator, didMount: renderConfig.didMount, willUnmount: renderConfig.willUnmount }, (InnerContainer) => (!dataConfig.renderProps.isDisabled && (preact_cjs.createElement(InnerContainer, { tag: dataConfig.isNavLink ? 'a' : 'div', attrs: dataConfig.innerAttrs, className: internal_cjs.joinClassNames('fc-cell-inner fc-flex-col fc-padding-sm', props.isSticky && 'fc-sticky-s'), elRef: this.handleInnerEl })))));
899
+ isDisabled ? undefined : renderConfig.classNameGenerator, didMount: renderConfig.didMount, willUnmount: renderConfig.willUnmount }, (InnerContainer) => (preact_cjs.createElement(InnerContainer, { tag: 'div', attrs: dataConfig.innerAttrs, className: internal_cjs.joinClassNames('fc-cell-inner fc-flex-col fc-padding-sm', props.isSticky && 'fc-sticky-s'), elRef: this.handleInnerEl }))));
858
900
  }
859
901
  }
860
902
 
@@ -879,7 +921,7 @@ class DayGridHeaderRow extends internal_cjs.BaseComponent {
879
921
  }
880
922
  render() {
881
923
  const { props } = this;
882
- return (preact_cjs.createElement("div", { role: 'row', className: internal_cjs.joinClassNames('fc-flex-row fc-content-box', props.className), style: { height: props.height } }, props.dataConfigs.map((dataConfig, cellI) => (preact_cjs.createElement(DayGridHeaderCell, { key: dataConfig.key, renderConfig: props.renderConfig, dataConfig: dataConfig, isSticky: props.isSticky, borderStart: Boolean(cellI), colWidth: props.colWidth, innerHeightRef: props.innerHeightRef })))));
924
+ return (preact_cjs.createElement("div", { role: props.role /* !!! */, "aria-rowindex": props.rowIndex != null ? 1 + props.rowIndex : undefined, className: internal_cjs.joinClassNames('fc-flex-row fc-content-box', props.className), style: { height: props.height } }, props.dataConfigs.map((dataConfig, cellI) => (preact_cjs.createElement(DayGridHeaderCell, { key: dataConfig.key, renderConfig: props.renderConfig, dataConfig: dataConfig, isSticky: props.isSticky, borderStart: Boolean(cellI), colWidth: props.colWidth, innerHeightRef: props.innerHeightRef })))));
883
925
  }
884
926
  }
885
927
 
@@ -889,9 +931,9 @@ TODO: kill this class in favor of DayGridHeaderRows?
889
931
  class DayGridHeader extends internal_cjs.BaseComponent {
890
932
  render() {
891
933
  const { props } = this;
892
- return (preact_cjs.createElement("div", { className: internal_cjs.joinClassNames(props.className, 'fc-flex-col', props.width == null && 'fc-liquid'), style: {
934
+ return (preact_cjs.createElement("div", { role: 'rowgroup', className: internal_cjs.joinClassNames(props.className, 'fc-flex-col', props.width == null && 'fc-liquid'), style: {
893
935
  width: props.width
894
- } }, props.headerTiers.map((rowConfig, tierNum) => (preact_cjs.createElement(DayGridHeaderRow, Object.assign({}, rowConfig, { key: tierNum, className: tierNum ? 'fc-border-t' : '', colWidth: props.colWidth }))))));
936
+ } }, props.headerTiers.map((rowConfig, tierNum) => (preact_cjs.createElement(DayGridHeaderRow, Object.assign({}, rowConfig, { key: tierNum, role: 'row', className: tierNum ? 'fc-border-t' : '', colWidth: props.colWidth }))))));
895
937
  }
896
938
  }
897
939
 
@@ -1034,21 +1076,29 @@ class DayGridLayout extends internal_cjs.BaseComponent {
1034
1076
  }
1035
1077
  }
1036
1078
  };
1037
- this.clearScroll = () => {
1038
- this.scrollDate = null;
1079
+ this.handleScrollEnd = ({ isUser }) => {
1080
+ if (isUser) {
1081
+ this.scrollDate = null;
1082
+ }
1039
1083
  };
1040
1084
  }
1041
1085
  render() {
1042
1086
  const { props, context } = this;
1043
1087
  const { options } = context;
1044
1088
  const commonLayoutProps = Object.assign(Object.assign({}, props), { scrollerRef: this.scrollerRef, rowHeightRefMap: this.rowHeightRefMap });
1045
- return (preact_cjs.createElement(internal_cjs.ViewContainer, { viewSpec: context.viewSpec, className: internal_cjs.joinClassNames(props.className, 'fc-print-root fc-border') }, options.dayMinWidth ? (preact_cjs.createElement(DayGridLayoutPannable, Object.assign({}, commonLayoutProps, { dayMinWidth: options.dayMinWidth }))) : (preact_cjs.createElement(DayGridLayoutNormal, Object.assign({}, commonLayoutProps)))));
1089
+ return (preact_cjs.createElement(internal_cjs.ViewContainer, { viewSpec: context.viewSpec, attrs: {
1090
+ role: 'grid',
1091
+ 'aria-rowcount': props.headerTiers.length + props.cellRows.length,
1092
+ 'aria-colcount': props.cellRows[0].length,
1093
+ 'aria-labelledby': props.labelId,
1094
+ 'aria-label': props.labelStr,
1095
+ }, className: internal_cjs.joinClassNames(props.className, 'fc-print-root fc-border') }, options.dayMinWidth ? (preact_cjs.createElement(DayGridLayoutPannable, Object.assign({}, commonLayoutProps, { dayMinWidth: options.dayMinWidth }))) : (preact_cjs.createElement(DayGridLayoutNormal, Object.assign({}, commonLayoutProps)))));
1046
1096
  }
1047
1097
  // Lifecycle
1048
1098
  // -----------------------------------------------------------------------------------------------
1049
1099
  componentDidMount() {
1050
1100
  this.resetScroll();
1051
- this.scrollerRef.current.addScrollEndListener(this.clearScroll);
1101
+ this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd);
1052
1102
  }
1053
1103
  componentDidUpdate(prevProps) {
1054
1104
  if (prevProps.dateProfile !== this.props.dateProfile && this.context.options.scrollTimeReset) {
@@ -1056,14 +1106,13 @@ class DayGridLayout extends internal_cjs.BaseComponent {
1056
1106
  }
1057
1107
  }
1058
1108
  componentWillUnmount() {
1059
- this.scrollerRef.current.removeScrollEndListener(this.clearScroll);
1109
+ this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd);
1060
1110
  }
1061
1111
  // Scrolling
1062
1112
  // -----------------------------------------------------------------------------------------------
1063
1113
  resetScroll() {
1064
1114
  this.scrollDate = this.props.dateProfile.currentDate;
1065
1115
  this.updateScrollY();
1066
- // updateScrollX
1067
1116
  const scroller = this.scrollerRef.current;
1068
1117
  scroller.scrollTo({ x: 0 });
1069
1118
  }
@@ -1088,7 +1137,7 @@ class DayGridView extends internal_cjs.BaseComponent {
1088
1137
  const slicedProps = this.slicer.sliceProps(props, props.dateProfile, options.nextDayThreshold, context, dayTableModel);
1089
1138
  return (preact_cjs.createElement(internal_cjs.NowTimer, { unit: "day" }, (nowDate, todayRange) => {
1090
1139
  const headerTiers = this.buildDateRowConfigs(dayTableModel.headerDates, datesRepDistinctDays, props.dateProfile, todayRange, dayHeaderFormat, context);
1091
- return (preact_cjs.createElement(DayGridLayout, { dateProfile: props.dateProfile, todayRange: todayRange, cellRows: dayTableModel.cellRows, forPrint: props.forPrint, className: 'fc-daygrid',
1140
+ return (preact_cjs.createElement(DayGridLayout, { labelId: props.labelId, labelStr: props.labelStr, dateProfile: props.dateProfile, todayRange: todayRange, cellRows: dayTableModel.cellRows, forPrint: props.forPrint, className: 'fc-daygrid',
1092
1141
  // header content
1093
1142
  headerTiers: headerTiers,
1094
1143
  // body content
package/internal.d.ts CHANGED
@@ -62,6 +62,8 @@ interface DayGridHeaderRowProps<RenderProps> extends RowConfig<RenderProps> {
62
62
  height?: number;
63
63
  colWidth?: number;
64
64
  innerHeightRef?: Ref<number>;
65
+ role?: string;
66
+ rowIndex?: number;
65
67
  }
66
68
  declare class DayGridHeaderRow<RenderProps extends {
67
69
  text: string;
@@ -88,6 +90,8 @@ declare function getCellEl(rowEl: HTMLElement, col: number): HTMLElement;
88
90
  declare function createDayHeaderFormatter(explicitFormat: DateFormatter, datesRepDistinctDays: any, dateCnt: any): DateFormatter;
89
91
 
90
92
  interface DayGridLayoutProps {
93
+ labelId: string | undefined;
94
+ labelStr: string | undefined;
91
95
  dateProfile: DateProfile;
92
96
  todayRange: DateRange;
93
97
  cellRows: DayTableCell[][];
@@ -116,7 +120,9 @@ declare class DayGridLayout extends BaseComponent<DayGridLayoutProps> {
116
120
  componentWillUnmount(): void;
117
121
  resetScroll(): void;
118
122
  updateScrollY: () => void;
119
- clearScroll: () => void;
123
+ handleScrollEnd: ({ isUser }: {
124
+ isUser: boolean;
125
+ }) => void;
120
126
  }
121
127
 
122
128
  interface DayGridRowsProps {
@@ -176,6 +182,7 @@ interface DayGridRowProps {
176
182
  className?: string;
177
183
  isCompact?: boolean;
178
184
  isTall?: boolean;
185
+ role?: string;
179
186
  fgEventSegs: (SlicedCoordRange & EventRangeProps)[];
180
187
  bgEventSegs: (SlicedCoordRange & EventRangeProps)[];
181
188
  businessHourSegs: (SlicedCoordRange & EventRangeProps)[];
package/internal.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Slicer, createFormatter, getDateMeta, formatDayString, buildNavLinkAttrs, getDayClassName, addDays, getEventKey, BaseComponent, StandardEvent, buildEventRangeTimeText, getEventRangeAnchorAttrs, EventContainer, MoreLinkContainer, joinClassNames, getEventRangeMeta, DateComponent, DayCellContainer, hasCustomDayCellContent, watchSize, isDimsEqual, setRef, addMs, SegHierarchy, DaySeriesModel, DayTableModel, fracToCssDim, watchHeight, RefMap, afterSize, sortEventSegs, WeekNumberContainer, buildEventRangeKey, BgEvent, renderFill, memoize, getIsHeightAuto, watchWidth, ContentContainer, renderText, getStickyHeaderDates, Scroller, getStickyFooterScrollbar, StickyFooterScrollbar, getScrollerSyncerClass, ViewContainer, NowTimer, DateProfileGenerator, addWeeks, diffWeeks, injectStyles } from '@fullcalendar/core/internal.js';
1
+ import { Slicer, createFormatter, getDateMeta, buildDateStr, formatDayString, buildNavLinkAttrs, getDayClassName, addDays, getEventKey, BaseComponent, StandardEvent, buildEventRangeTimeText, getEventTagAndAttrs, EventContainer, MoreLinkContainer, joinClassNames, getEventRangeMeta, DateComponent, setRef, watchSize, isDimsEqual, hasCustomDayCellContent, DayCellContainer, addMs, SegHierarchy, DaySeriesModel, DayTableModel, fracToCssDim, watchHeight, RefMap, afterSize, sortEventSegs, WeekNumberContainer, buildEventRangeKey, BgEvent, renderFill, memoize, getIsHeightAuto, watchWidth, ContentContainer, renderText, getStickyHeaderDates, Scroller, getStickyFooterScrollbar, StickyFooterScrollbar, getScrollerSyncerClass, ViewContainer, NowTimer, DateProfileGenerator, addWeeks, diffWeeks, injectStyles } from '@fullcalendar/core/internal.js';
2
2
  import { createElement, Fragment, createRef, Component } from '@fullcalendar/core/preact.js';
3
3
 
4
4
  class DayTableSlicer extends Slicer {
@@ -32,6 +32,10 @@ context, colSpan) {
32
32
  dataConfigs: buildDateDataConfigs(dates, datesRepDistinctDays, dateProfile, todayRange, dayHeaderFormat, context, colSpan)
33
33
  };
34
34
  }
35
+ /*
36
+ For header cells: how to connect w/ custom rendering
37
+ Applies to all cells in a row
38
+ */
35
39
  function buildDateRenderConfig(context) {
36
40
  const { options } = context;
37
41
  return {
@@ -42,6 +46,9 @@ function buildDateRenderConfig(context) {
42
46
  willUnmount: options.dayHeaderWillUnmount,
43
47
  };
44
48
  }
49
+ /*
50
+ For header cells: data
51
+ */
45
52
  function buildDateDataConfigs(dates, datesRepDistinctDays, dateProfile, todayRange, dayHeaderFormat, // TODO: rename to dateHeaderFormat?
46
53
  context, colSpan = 1, keyPrefix = '') {
47
54
  const { dateEnv, viewApi, options } = context;
@@ -51,11 +58,16 @@ context, colSpan = 1, keyPrefix = '') {
51
58
  const text = dateEnv.format(date, dayHeaderFormat);
52
59
  const renderProps = Object.assign(Object.assign({}, dateMeta), { date: dateEnv.toDate(date), view: viewApi, text });
53
60
  const isNavLink = options.navLinks && !dateMeta.isDisabled;
61
+ const fullDateStr = buildDateStr(context, date);
62
+ // for DayGridHeaderCell
54
63
  return {
55
64
  key: keyPrefix + date.toUTCString(),
56
65
  renderProps,
57
- attrs: { 'data-date': !dateMeta.isDisabled ? formatDayString(date) : undefined },
58
- innerAttrs: isNavLink ? buildNavLinkAttrs(context, date) : {},
66
+ attrs: Object.assign(Object.assign({ 'aria-label': fullDateStr }, (dateMeta.isToday ? { 'aria-current': 'date' } : {})), { 'data-date': formatDayString(date) }),
67
+ // for navlink
68
+ innerAttrs: isNavLink
69
+ ? buildNavLinkAttrs(context, date, undefined, fullDateStr)
70
+ : { 'aria-hidden': true },
59
71
  colSpan,
60
72
  isNavLink,
61
73
  className: getDayClassName(dateMeta),
@@ -74,10 +86,18 @@ context, colSpan = 1, keyPrefix = '') {
74
86
  };
75
87
  const text = dateEnv.format(normDate, dayHeaderFormat);
76
88
  const renderProps = Object.assign(Object.assign({}, dayMeta), { date, view: viewApi, text });
89
+ const fullWeekDayStr = dateEnv.format(normDate, WEEKDAY_FORMAT);
90
+ // for DayGridHeaderCell
77
91
  return {
78
92
  key: keyPrefix + String(dow),
79
93
  renderProps,
80
- innerAttrs: { 'aria-label': dateEnv.format(normDate, WEEKDAY_FORMAT) },
94
+ attrs: {
95
+ 'aria-label': fullWeekDayStr,
96
+ },
97
+ // for navlink
98
+ innerAttrs: {
99
+ 'aria-hidden': true, // label already on cell
100
+ },
81
101
  colSpan,
82
102
  className: getDayClassName(dayMeta),
83
103
  };
@@ -163,8 +183,8 @@ class DayGridListEvent extends BaseComponent {
163
183
  /* slicedStart = */ undefined,
164
184
  /* slicedEnd = */ undefined, props.isStart, props.isEnd, context,
165
185
  /* defaultDisplayEventTime = */ true, props.defaultDisplayEventEnd);
166
- let anchorAttrs = getEventRangeAnchorAttrs(eventRange, context);
167
- return (createElement(EventContainer, Object.assign({}, props, { tag: anchorAttrs ? 'a' : 'div', attrs: anchorAttrs, className: 'fc-daygrid-dot-event fc-daygrid-event', defaultGenerator: renderInnerContent, timeText: timeText, isResizing: false, isDateSelecting: false })));
186
+ let [tag, attrs] = getEventTagAndAttrs(eventRange, context);
187
+ return (createElement(EventContainer, Object.assign({}, props, { tag: tag, attrs: attrs, className: 'fc-daygrid-dot-event fc-daygrid-event', defaultGenerator: renderInnerContent, timeText: timeText, isResizing: false, isDateSelecting: false })));
168
188
  }
169
189
  }
170
190
  function renderInnerContent(renderProps) {
@@ -200,7 +220,30 @@ class DayGridCell extends DateComponent {
200
220
  super(...arguments);
201
221
  // ref
202
222
  this.rootElRef = createRef();
203
- this.bodyElRef = createRef();
223
+ this.handleBodyEl = (bodyEl) => {
224
+ if (this.disconnectBodyHeight) {
225
+ this.disconnectBodyHeight();
226
+ this.disconnectBodyHeight = undefined;
227
+ setRef(this.props.headerHeightRef, null);
228
+ setRef(this.props.mainHeightRef, null);
229
+ }
230
+ if (bodyEl) {
231
+ // we want to fire on ANY size change, because we do more advanced stuff
232
+ this.disconnectBodyHeight = watchSize(bodyEl, (_bodyWidth, bodyHeight) => {
233
+ const { props } = this;
234
+ const mainRect = bodyEl.getBoundingClientRect();
235
+ const rootRect = this.rootElRef.current.getBoundingClientRect();
236
+ const headerHeight = mainRect.top - rootRect.top;
237
+ if (!isDimsEqual(this.headerHeight, headerHeight)) {
238
+ this.headerHeight = headerHeight;
239
+ setRef(props.headerHeightRef, headerHeight);
240
+ }
241
+ if (props.fgLiquidHeight) {
242
+ setRef(props.mainHeightRef, bodyHeight);
243
+ }
244
+ });
245
+ }
246
+ };
204
247
  }
205
248
  render() {
206
249
  let { props, context } = this;
@@ -208,38 +251,29 @@ class DayGridCell extends DateComponent {
208
251
  // TODO: memoize this
209
252
  const isMonthStart = props.showDayNumber &&
210
253
  shouldDisplayMonthStart(props.date, props.dateProfile.currentRange, dateEnv);
211
- return (createElement(DayCellContainer, { tag: "div", className: joinClassNames(props.className, 'fc-daygrid-day fc-flex-col', props.borderStart && 'fc-border-s', props.width != null ? '' : 'fc-liquid'), attrs: Object.assign(Object.assign({}, props.attrs), { role: 'gridcell' }), style: {
254
+ // TODO: memoize this
255
+ const dateMeta = getDateMeta(props.date, props.todayRange, null, props.dateProfile);
256
+ const baseClassName = joinClassNames('fc-daygrid-day', props.borderStart && 'fc-border-s', props.width != null ? '' : 'fc-liquid', 'fc-flex-col');
257
+ if (dateMeta.isDisabled) {
258
+ return (createElement("div", { role: 'gridcell', "aria-disabled": true, className: joinClassNames(baseClassName, 'fc-day-disabled'), style: {
259
+ width: props.width
260
+ } }));
261
+ }
262
+ const hasDayNumber = props.showDayNumber || hasCustomDayCellContent(options);
263
+ const isNavLink = options.navLinks;
264
+ const fullDateStr = buildDateStr(context, props.date);
265
+ return (createElement(DayCellContainer, { tag: "div", className: joinClassNames(baseClassName, props.className), attrs: Object.assign(Object.assign({}, props.attrs), { role: 'gridcell', 'aria-label': fullDateStr }), style: {
212
266
  width: props.width
213
- }, elRef: this.rootElRef, renderProps: props.renderProps, defaultGenerator: renderTopInner, date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, isMonthStart: isMonthStart }, (InnerContent, renderProps) => (createElement(Fragment, null,
214
- !renderProps.isDisabled && (props.showDayNumber || hasCustomDayCellContent(options)) && (createElement("div", { className: "fc-daygrid-day-header" },
215
- createElement(InnerContent, { tag: "a", attrs: buildNavLinkAttrs(context, props.date), className: joinClassNames('fc-daygrid-day-number', isMonthStart && 'fc-daygrid-month-start') }))),
216
- createElement("div", { className: joinClassNames('fc-daygrid-day-body', props.isTall && 'fc-daygrid-day-body-tall', props.fgLiquidHeight ? 'fc-liquid' : 'fc-grow'), ref: this.bodyElRef },
267
+ }, elRef: this.rootElRef, renderProps: props.renderProps, defaultGenerator: renderTopInner, date: props.date, dateMeta: dateMeta, showDayNumber: props.showDayNumber, isMonthStart: isMonthStart }, (InnerContent) => (createElement(Fragment, null,
268
+ hasDayNumber && (createElement("div", { className: "fc-daygrid-day-header" },
269
+ createElement(InnerContent, { tag: 'div', attrs: isNavLink
270
+ ? buildNavLinkAttrs(context, props.date, undefined, fullDateStr)
271
+ : { 'aria-hidden': true } // label already on cell
272
+ , className: joinClassNames('fc-daygrid-day-number', isMonthStart && 'fc-daygrid-month-start') }))),
273
+ createElement("div", { className: joinClassNames('fc-daygrid-day-body', props.isTall && 'fc-daygrid-day-body-tall', props.fgLiquidHeight ? 'fc-liquid' : 'fc-grow'), ref: this.handleBodyEl },
217
274
  createElement("div", { className: 'fc-daygrid-day-events', style: { height: props.fgHeight } }, props.fg),
218
275
  createElement(DayGridMoreLink, { isBlock: props.isCompact, allDayDate: props.date, segs: props.segs, hiddenSegs: props.hiddenSegs, alignElRef: this.rootElRef, alignParentTop: props.showDayNumber ? '[role=row]' : '.fc-view', dateSpanProps: props.dateSpanProps, dateProfile: props.dateProfile, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange }))))));
219
276
  }
220
- componentDidMount() {
221
- const bodyEl = this.bodyElRef.current;
222
- // we want to fire on ANY size change, because we do more advanced stuff
223
- this.disconnectBodyHeight = watchSize(bodyEl, (_bodyWidth, bodyHeight) => {
224
- const { props } = this;
225
- const mainRect = bodyEl.getBoundingClientRect();
226
- const rootRect = this.rootElRef.current.getBoundingClientRect();
227
- const headerHeight = mainRect.top - rootRect.top;
228
- if (!isDimsEqual(this.headerHeight, headerHeight)) {
229
- this.headerHeight = headerHeight;
230
- setRef(props.headerHeightRef, headerHeight);
231
- }
232
- if (props.fgLiquidHeight) {
233
- setRef(props.mainHeightRef, bodyHeight);
234
- }
235
- });
236
- }
237
- componentWillUnmount() {
238
- this.disconnectBodyHeight();
239
- const { props } = this;
240
- setRef(props.headerHeightRef, null);
241
- setRef(props.mainHeightRef, null);
242
- }
243
277
  }
244
278
  // Utils
245
279
  // -------------------------------------------------------------------------------------------------
@@ -563,7 +597,11 @@ class DayGridRow extends BaseComponent {
563
597
  (props.eventDrag && props.eventDrag.affectedInstances) ||
564
598
  (props.eventResize && props.eventResize.affectedInstances) ||
565
599
  {};
566
- return (createElement("div", { role: 'row' // TODO: audit this for all scenarios
600
+ const isNavLink = options.navLinks;
601
+ const fullWeekStr = buildDateStr(context, weekDate, 'week');
602
+ return (createElement("div", { role: props.role /* !!! */, "aria-label": props.role === 'row' // HACK
603
+ ? fullWeekStr
604
+ : undefined // can't have label on non-role div
567
605
  , className: joinClassNames('fc-flex-row fc-rel', props.className), style: {
568
606
  minHeight: props.minHeight,
569
607
  }, ref: this.handleRootEl },
@@ -582,7 +620,9 @@ class DayGridRow extends BaseComponent {
582
620
  // refs
583
621
  headerHeightRef: headerHeightRefMap.createRef(cell.key), mainHeightRef: mainHeightRefMap.createRef(cell.key) }));
584
622
  })),
585
- props.showWeekNumbers && (createElement(WeekNumberContainer, { tag: "a", attrs: buildNavLinkAttrs(context, weekDate, 'week'), className: 'fc-daygrid-week-number', date: weekDate, defaultFormat: DEFAULT_WEEK_NUM_FORMAT })),
623
+ props.showWeekNumbers && (createElement(WeekNumberContainer, { tag: 'div', attrs: Object.assign(Object.assign({}, (isNavLink
624
+ ? buildNavLinkAttrs(context, weekDate, 'week', fullWeekStr, /* isTabbable = */ false)
625
+ : {})), { 'role': undefined, 'aria-hidden': true }), className: 'fc-daygrid-week-number', date: weekDate, defaultFormat: DEFAULT_WEEK_NUM_FORMAT })),
586
626
  this.renderFgSegs(maxMainTop, mirrorSegs, segTops, props.todayRange, {}, // forcedInvisibleMap
587
627
  Boolean(props.eventDrag), Boolean(props.eventResize), false)));
588
628
  }
@@ -743,10 +783,10 @@ class DayGridRows extends DateComponent {
743
783
  let isHeightAuto = getIsHeightAuto(options);
744
784
  let rowHeightsRedistribute = !props.forPrint && !isHeightAuto;
745
785
  let [rowMinHeight, isCompact] = computeRowHeight(props.visibleWidth, rowCnt, isHeightAuto, props.forPrint, options);
746
- return (createElement("div", { className: joinClassNames(
786
+ return (createElement("div", { role: 'rowgroup', className: joinClassNames(
747
787
  // HACK for Safari. Can't do break-inside:avoid with flexbox items, likely b/c it's not standard:
748
788
  // https://stackoverflow.com/a/60256345
749
- !props.forPrint && 'fc-flex-col', props.className), style: { width: props.width }, ref: this.handleRootEl }, props.cellRows.map((cells, row) => (createElement(DayGridRow, { key: cells[0].key, dateProfile: props.dateProfile, todayRange: props.todayRange, cells: cells, showDayNumbers: rowCnt > 1, showWeekNumbers: options.weekNumbers, forPrint: props.forPrint, isCompact: isCompact,
789
+ !props.forPrint && 'fc-flex-col', props.className), style: { width: props.width }, ref: this.handleRootEl }, props.cellRows.map((cells, row) => (createElement(DayGridRow, { key: cells[0].key, role: 'row', dateProfile: props.dateProfile, todayRange: props.todayRange, cells: cells, showDayNumbers: rowCnt > 1, showWeekNumbers: rowCnt > 1 && options.weekNumbers, forPrint: props.forPrint, isCompact: isCompact,
750
790
  // if not auto-height, distribute height of container somewhat evently to rows
751
791
  // (treat all as zero, distribute height, then ensure min-heights -- the inner content height)
752
792
  className: joinClassNames(rowHeightsRedistribute && 'fc-grow fc-basis0', rowCnt > 1 && 'fc-break-inside-avoid', // don't avoid breaks for single tall row
@@ -843,14 +883,16 @@ class DayGridHeaderCell extends BaseComponent {
843
883
  render() {
844
884
  const { props } = this;
845
885
  const { renderConfig, dataConfig } = props;
846
- return (createElement(ContentContainer, { tag: 'div', attrs: dataConfig.attrs, className: joinClassNames(dataConfig.className, 'fc-header-cell fc-cell fc-flex-col fc-align-center', props.borderStart && 'fc-border-s', !props.isSticky && 'fc-crop', props.colWidth == null && 'fc-liquid'), style: {
886
+ // HACK
887
+ const isDisabled = dataConfig.renderProps.isDisabled;
888
+ return (createElement(ContentContainer, { tag: 'div', attrs: Object.assign({ role: 'columnheader', 'aria-colspan': dataConfig.colSpan }, dataConfig.attrs), className: joinClassNames('fc-header-cell fc-cell fc-flex-col fc-align-center', props.borderStart && 'fc-border-s', !props.isSticky && 'fc-crop', props.colWidth == null && 'fc-liquid', dataConfig.className), style: {
847
889
  width: props.colWidth != null
848
890
  ? props.colWidth * (dataConfig.colSpan || 1)
849
891
  : undefined,
850
892
  }, renderProps: dataConfig.renderProps, generatorName: renderConfig.generatorName, customGenerator: renderConfig.customGenerator, defaultGenerator: renderText, classNameGenerator:
851
893
  // don't use custom classNames if disabled
852
894
  // TODO: make DRY with DayCellContainer
853
- dataConfig.renderProps.isDisabled ? undefined : renderConfig.classNameGenerator, didMount: renderConfig.didMount, willUnmount: renderConfig.willUnmount }, (InnerContainer) => (!dataConfig.renderProps.isDisabled && (createElement(InnerContainer, { tag: dataConfig.isNavLink ? 'a' : 'div', attrs: dataConfig.innerAttrs, className: joinClassNames('fc-cell-inner fc-flex-col fc-padding-sm', props.isSticky && 'fc-sticky-s'), elRef: this.handleInnerEl })))));
895
+ isDisabled ? undefined : renderConfig.classNameGenerator, didMount: renderConfig.didMount, willUnmount: renderConfig.willUnmount }, (InnerContainer) => (createElement(InnerContainer, { tag: 'div', attrs: dataConfig.innerAttrs, className: joinClassNames('fc-cell-inner fc-flex-col fc-padding-sm', props.isSticky && 'fc-sticky-s'), elRef: this.handleInnerEl }))));
854
896
  }
855
897
  }
856
898
 
@@ -875,7 +917,7 @@ class DayGridHeaderRow extends BaseComponent {
875
917
  }
876
918
  render() {
877
919
  const { props } = this;
878
- return (createElement("div", { role: 'row', className: joinClassNames('fc-flex-row fc-content-box', props.className), style: { height: props.height } }, props.dataConfigs.map((dataConfig, cellI) => (createElement(DayGridHeaderCell, { key: dataConfig.key, renderConfig: props.renderConfig, dataConfig: dataConfig, isSticky: props.isSticky, borderStart: Boolean(cellI), colWidth: props.colWidth, innerHeightRef: props.innerHeightRef })))));
920
+ return (createElement("div", { role: props.role /* !!! */, "aria-rowindex": props.rowIndex != null ? 1 + props.rowIndex : undefined, className: joinClassNames('fc-flex-row fc-content-box', props.className), style: { height: props.height } }, props.dataConfigs.map((dataConfig, cellI) => (createElement(DayGridHeaderCell, { key: dataConfig.key, renderConfig: props.renderConfig, dataConfig: dataConfig, isSticky: props.isSticky, borderStart: Boolean(cellI), colWidth: props.colWidth, innerHeightRef: props.innerHeightRef })))));
879
921
  }
880
922
  }
881
923
 
@@ -885,9 +927,9 @@ TODO: kill this class in favor of DayGridHeaderRows?
885
927
  class DayGridHeader extends BaseComponent {
886
928
  render() {
887
929
  const { props } = this;
888
- return (createElement("div", { className: joinClassNames(props.className, 'fc-flex-col', props.width == null && 'fc-liquid'), style: {
930
+ return (createElement("div", { role: 'rowgroup', className: joinClassNames(props.className, 'fc-flex-col', props.width == null && 'fc-liquid'), style: {
889
931
  width: props.width
890
- } }, props.headerTiers.map((rowConfig, tierNum) => (createElement(DayGridHeaderRow, Object.assign({}, rowConfig, { key: tierNum, className: tierNum ? 'fc-border-t' : '', colWidth: props.colWidth }))))));
932
+ } }, props.headerTiers.map((rowConfig, tierNum) => (createElement(DayGridHeaderRow, Object.assign({}, rowConfig, { key: tierNum, role: 'row', className: tierNum ? 'fc-border-t' : '', colWidth: props.colWidth }))))));
891
933
  }
892
934
  }
893
935
 
@@ -1030,21 +1072,29 @@ class DayGridLayout extends BaseComponent {
1030
1072
  }
1031
1073
  }
1032
1074
  };
1033
- this.clearScroll = () => {
1034
- this.scrollDate = null;
1075
+ this.handleScrollEnd = ({ isUser }) => {
1076
+ if (isUser) {
1077
+ this.scrollDate = null;
1078
+ }
1035
1079
  };
1036
1080
  }
1037
1081
  render() {
1038
1082
  const { props, context } = this;
1039
1083
  const { options } = context;
1040
1084
  const commonLayoutProps = Object.assign(Object.assign({}, props), { scrollerRef: this.scrollerRef, rowHeightRefMap: this.rowHeightRefMap });
1041
- return (createElement(ViewContainer, { viewSpec: context.viewSpec, className: joinClassNames(props.className, 'fc-print-root fc-border') }, options.dayMinWidth ? (createElement(DayGridLayoutPannable, Object.assign({}, commonLayoutProps, { dayMinWidth: options.dayMinWidth }))) : (createElement(DayGridLayoutNormal, Object.assign({}, commonLayoutProps)))));
1085
+ return (createElement(ViewContainer, { viewSpec: context.viewSpec, attrs: {
1086
+ role: 'grid',
1087
+ 'aria-rowcount': props.headerTiers.length + props.cellRows.length,
1088
+ 'aria-colcount': props.cellRows[0].length,
1089
+ 'aria-labelledby': props.labelId,
1090
+ 'aria-label': props.labelStr,
1091
+ }, className: joinClassNames(props.className, 'fc-print-root fc-border') }, options.dayMinWidth ? (createElement(DayGridLayoutPannable, Object.assign({}, commonLayoutProps, { dayMinWidth: options.dayMinWidth }))) : (createElement(DayGridLayoutNormal, Object.assign({}, commonLayoutProps)))));
1042
1092
  }
1043
1093
  // Lifecycle
1044
1094
  // -----------------------------------------------------------------------------------------------
1045
1095
  componentDidMount() {
1046
1096
  this.resetScroll();
1047
- this.scrollerRef.current.addScrollEndListener(this.clearScroll);
1097
+ this.scrollerRef.current.addScrollEndListener(this.handleScrollEnd);
1048
1098
  }
1049
1099
  componentDidUpdate(prevProps) {
1050
1100
  if (prevProps.dateProfile !== this.props.dateProfile && this.context.options.scrollTimeReset) {
@@ -1052,14 +1102,13 @@ class DayGridLayout extends BaseComponent {
1052
1102
  }
1053
1103
  }
1054
1104
  componentWillUnmount() {
1055
- this.scrollerRef.current.removeScrollEndListener(this.clearScroll);
1105
+ this.scrollerRef.current.removeScrollEndListener(this.handleScrollEnd);
1056
1106
  }
1057
1107
  // Scrolling
1058
1108
  // -----------------------------------------------------------------------------------------------
1059
1109
  resetScroll() {
1060
1110
  this.scrollDate = this.props.dateProfile.currentDate;
1061
1111
  this.updateScrollY();
1062
- // updateScrollX
1063
1112
  const scroller = this.scrollerRef.current;
1064
1113
  scroller.scrollTo({ x: 0 });
1065
1114
  }
@@ -1084,7 +1133,7 @@ class DayGridView extends BaseComponent {
1084
1133
  const slicedProps = this.slicer.sliceProps(props, props.dateProfile, options.nextDayThreshold, context, dayTableModel);
1085
1134
  return (createElement(NowTimer, { unit: "day" }, (nowDate, todayRange) => {
1086
1135
  const headerTiers = this.buildDateRowConfigs(dayTableModel.headerDates, datesRepDistinctDays, props.dateProfile, todayRange, dayHeaderFormat, context);
1087
- return (createElement(DayGridLayout, { dateProfile: props.dateProfile, todayRange: todayRange, cellRows: dayTableModel.cellRows, forPrint: props.forPrint, className: 'fc-daygrid',
1136
+ return (createElement(DayGridLayout, { labelId: props.labelId, labelStr: props.labelStr, dateProfile: props.dateProfile, todayRange: todayRange, cellRows: dayTableModel.cellRows, forPrint: props.forPrint, className: 'fc-daygrid',
1088
1137
  // header content
1089
1138
  headerTiers: headerTiers,
1090
1139
  // body content
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fullcalendar/daygrid",
3
- "version": "7.0.0-beta.3",
3
+ "version": "7.0.0-beta.4",
4
4
  "title": "FullCalendar Day Grid Plugin",
5
5
  "description": "Display events on a month view or \"day grid\" view",
6
6
  "homepage": "https://fullcalendar.io/docs/month-view",
@@ -13,7 +13,7 @@
13
13
  "month-view"
14
14
  ],
15
15
  "peerDependencies": {
16
- "@fullcalendar/core": "7.0.0-beta.3"
16
+ "@fullcalendar/core": "7.0.0-beta.4"
17
17
  },
18
18
  "type": "module",
19
19
  "bugs": "https://fullcalendar.io/reporting-bugs",