@fullcalendar/daygrid 5.7.2 → 5.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.cjs.js +51 -53
- package/main.global.js +59 -57
- package/main.global.min.js +2 -2
- package/main.js +52 -54
- package/main.js.map +1 -1
- package/package.json +4 -4
package/main.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar v5.
|
|
2
|
+
FullCalendar v5.10.1
|
|
3
3
|
Docs & License: https://fullcalendar.io/
|
|
4
4
|
(c) 2021 Adam Shaw
|
|
5
5
|
*/
|
|
@@ -147,11 +147,9 @@ var TableCellTop = /** @class */ (function (_super) {
|
|
|
147
147
|
}
|
|
148
148
|
TableCellTop.prototype.render = function () {
|
|
149
149
|
var props = this.props;
|
|
150
|
-
var navLinkAttrs = this.context.
|
|
151
|
-
? { 'data-navlink': common.buildNavLinkData(props.date), tabIndex: 0 }
|
|
152
|
-
: {};
|
|
150
|
+
var navLinkAttrs = common.buildNavLinkAttrs(this.context, props.date);
|
|
153
151
|
return (common.createElement(common.DayCellContent, { date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, defaultContent: renderTopInner }, function (innerElRef, innerContent) { return ((innerContent || props.forceDayTop) && (common.createElement("div", { className: "fc-daygrid-day-top", ref: innerElRef },
|
|
154
|
-
common.createElement("a", tslib.__assign({ className: "fc-daygrid-day-number" }, navLinkAttrs), innerContent || common.createElement(common.Fragment, null, "\u00A0"))))); }));
|
|
152
|
+
common.createElement("a", tslib.__assign({ id: props.dayNumberId, className: "fc-daygrid-day-number" }, navLinkAttrs), innerContent || common.createElement(common.Fragment, null, "\u00A0"))))); }));
|
|
155
153
|
};
|
|
156
154
|
return TableCellTop;
|
|
157
155
|
}(common.BaseComponent));
|
|
@@ -197,7 +195,7 @@ var TableListItemEvent = /** @class */ (function (_super) {
|
|
|
197
195
|
var timeFormat = context.options.eventTimeFormat || DEFAULT_TABLE_EVENT_TIME_FORMAT;
|
|
198
196
|
var timeText = common.buildSegTimeText(props.seg, timeFormat, context, true, props.defaultDisplayEventEnd);
|
|
199
197
|
return (common.createElement(common.EventRoot, { seg: props.seg, timeText: timeText, defaultContent: renderInnerContent, isDragging: props.isDragging, isResizing: false, isDateSelecting: false, isSelected: props.isSelected, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent) { return ( // we don't use styles!
|
|
200
|
-
common.createElement("a", tslib.__assign({ className: ['fc-daygrid-event', 'fc-daygrid-dot-event'].concat(classNames).join(' '), ref: rootElRef }, getSegAnchorAttrs(props.seg)), innerContent)); }));
|
|
198
|
+
common.createElement("a", tslib.__assign({ className: ['fc-daygrid-event', 'fc-daygrid-dot-event'].concat(classNames).join(' '), ref: rootElRef }, common.getSegAnchorAttrs(props.seg, context)), innerContent)); }));
|
|
201
199
|
};
|
|
202
200
|
return TableListItemEvent;
|
|
203
201
|
}(common.BaseComponent));
|
|
@@ -207,10 +205,6 @@ function renderInnerContent(innerProps) {
|
|
|
207
205
|
innerProps.timeText && (common.createElement("div", { className: "fc-event-time" }, innerProps.timeText)),
|
|
208
206
|
common.createElement("div", { className: "fc-event-title" }, innerProps.event.title || common.createElement(common.Fragment, null, "\u00A0"))));
|
|
209
207
|
}
|
|
210
|
-
function getSegAnchorAttrs(seg) {
|
|
211
|
-
var url = seg.eventRange.def.url;
|
|
212
|
-
return url ? { href: url } : {};
|
|
213
|
-
}
|
|
214
208
|
|
|
215
209
|
var TableCellMoreLink = /** @class */ (function (_super) {
|
|
216
210
|
tslib.__extends(TableCellMoreLink, _super);
|
|
@@ -232,7 +226,7 @@ var TableCellMoreLink = /** @class */ (function (_super) {
|
|
|
232
226
|
visibility: isForcedInvisible[instanceId] ? 'hidden' : '',
|
|
233
227
|
} }, hasListItemDisplay(seg) ? (common.createElement(TableListItemEvent, tslib.__assign({ seg: seg, isDragging: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, common.getSegMeta(seg, props.todayRange)))) : (common.createElement(TableBlockEvent, tslib.__assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, common.getSegMeta(seg, props.todayRange))))));
|
|
234
228
|
})));
|
|
235
|
-
} }, function (rootElRef, classNames, innerElRef, innerContent, handleClick) { return (common.createElement("a", { ref: rootElRef, className: ['fc-daygrid-more-link'].concat(classNames).join(' '),
|
|
229
|
+
} }, function (rootElRef, classNames, innerElRef, innerContent, handleClick, title, isExpanded, popoverId) { return (common.createElement("a", tslib.__assign({ ref: rootElRef, className: ['fc-daygrid-more-link'].concat(classNames).join(' '), title: title, "aria-expanded": isExpanded, "aria-controls": popoverId }, common.createAriaClickAttrs(handleClick)), innerContent)); }));
|
|
236
230
|
};
|
|
237
231
|
return TableCellMoreLink;
|
|
238
232
|
}(common.BaseComponent));
|
|
@@ -255,6 +249,9 @@ var TableCell = /** @class */ (function (_super) {
|
|
|
255
249
|
function TableCell() {
|
|
256
250
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
257
251
|
_this.rootElRef = common.createRef();
|
|
252
|
+
_this.state = {
|
|
253
|
+
dayNumberId: common.getUniqueDomId(),
|
|
254
|
+
};
|
|
258
255
|
_this.handleRootEl = function (el) {
|
|
259
256
|
common.setRef(_this.rootElRef, el);
|
|
260
257
|
common.setRef(_this.props.elRef, el);
|
|
@@ -262,16 +259,13 @@ var TableCell = /** @class */ (function (_super) {
|
|
|
262
259
|
return _this;
|
|
263
260
|
}
|
|
264
261
|
TableCell.prototype.render = function () {
|
|
265
|
-
var _a = this, props = _a.props,
|
|
266
|
-
var options = context.options;
|
|
262
|
+
var _a = this, context = _a.context, props = _a.props, state = _a.state, rootElRef = _a.rootElRef;
|
|
267
263
|
var date = props.date, dateProfile = props.dateProfile;
|
|
268
|
-
var navLinkAttrs =
|
|
269
|
-
|
|
270
|
-
: {};
|
|
271
|
-
return (common.createElement(common.DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl }, function (dayElRef, dayClassNames, rootDataAttrs, isDisabled) { return (common.createElement("td", tslib.__assign({ ref: dayElRef, className: ['fc-daygrid-day'].concat(dayClassNames, props.extraClassNames || []).join(' ') }, rootDataAttrs, props.extraDataAttrs),
|
|
264
|
+
var navLinkAttrs = common.buildNavLinkAttrs(context, date, 'week');
|
|
265
|
+
return (common.createElement(common.DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl }, function (dayElRef, dayClassNames, rootDataAttrs, isDisabled) { return (common.createElement("td", tslib.__assign({ ref: dayElRef, role: "gridcell", className: ['fc-daygrid-day'].concat(dayClassNames, props.extraClassNames || []).join(' ') }, rootDataAttrs, props.extraDataAttrs, (props.showDayNumber ? { 'aria-labelledby': state.dayNumberId } : {})),
|
|
272
266
|
common.createElement("div", { className: "fc-daygrid-day-frame fc-scrollgrid-sync-inner", ref: props.innerElRef /* different from hook system! RENAME */ },
|
|
273
267
|
props.showWeekNumber && (common.createElement(common.WeekNumberRoot, { date: date, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, function (weekElRef, weekClassNames, innerElRef, innerContent) { return (common.createElement("a", tslib.__assign({ ref: weekElRef, className: ['fc-daygrid-week-number'].concat(weekClassNames).join(' ') }, navLinkAttrs), innerContent)); })),
|
|
274
|
-
!isDisabled && (common.createElement(TableCellTop, { date: date, dateProfile: dateProfile, showDayNumber: props.showDayNumber, forceDayTop: props.forceDayTop, todayRange: props.todayRange, extraHookProps: props.extraHookProps })),
|
|
268
|
+
!isDisabled && (common.createElement(TableCellTop, { date: date, dateProfile: dateProfile, showDayNumber: props.showDayNumber, dayNumberId: state.dayNumberId, forceDayTop: props.forceDayTop, todayRange: props.todayRange, extraHookProps: props.extraHookProps })),
|
|
275
269
|
common.createElement("div", { className: "fc-daygrid-day-events", ref: props.fgContentElRef },
|
|
276
270
|
props.fgContent,
|
|
277
271
|
common.createElement("div", { className: "fc-daygrid-day-bottom", style: { marginTop: props.moreMarginTop } },
|
|
@@ -307,9 +301,11 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
307
301
|
if (eventHeight != null) {
|
|
308
302
|
segInputs.push({
|
|
309
303
|
index: i,
|
|
310
|
-
spanStart: seg.firstCol,
|
|
311
|
-
spanEnd: seg.lastCol + 1,
|
|
312
304
|
thickness: eventHeight,
|
|
305
|
+
span: {
|
|
306
|
+
start: seg.firstCol,
|
|
307
|
+
end: seg.lastCol + 1,
|
|
308
|
+
},
|
|
313
309
|
});
|
|
314
310
|
}
|
|
315
311
|
else {
|
|
@@ -347,15 +343,16 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
347
343
|
}
|
|
348
344
|
for (var _b = 0, hiddenEntries_1 = hiddenEntries; _b < hiddenEntries_1.length; _b++) {
|
|
349
345
|
var hiddenEntry = hiddenEntries_1[_b];
|
|
350
|
-
var seg = segs[hiddenEntry.
|
|
351
|
-
|
|
352
|
-
|
|
346
|
+
var seg = segs[hiddenEntry.index];
|
|
347
|
+
var hiddenSpan = hiddenEntry.span;
|
|
348
|
+
multiColPlacements[hiddenSpan.start].push({
|
|
349
|
+
seg: resliceSeg(seg, hiddenSpan.start, hiddenSpan.end, cells),
|
|
353
350
|
isVisible: false,
|
|
354
351
|
isAbsolute: true,
|
|
355
352
|
absoluteTop: 0,
|
|
356
353
|
marginTop: 0,
|
|
357
354
|
});
|
|
358
|
-
for (var col =
|
|
355
|
+
for (var col = hiddenSpan.start; col < hiddenSpan.end; col += 1) {
|
|
359
356
|
moreCnts[col] += 1;
|
|
360
357
|
singleColPlacements[col].push({
|
|
361
358
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
@@ -386,12 +383,12 @@ function placeRects(allRects, segs, cells) {
|
|
|
386
383
|
var currentMarginTop = 0;
|
|
387
384
|
for (var _i = 0, rects_1 = rects; _i < rects_1.length; _i++) {
|
|
388
385
|
var rect = rects_1[_i];
|
|
389
|
-
var seg = segs[rect.
|
|
386
|
+
var seg = segs[rect.index];
|
|
390
387
|
singlePlacements.push({
|
|
391
388
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
392
389
|
isVisible: true,
|
|
393
390
|
isAbsolute: false,
|
|
394
|
-
absoluteTop:
|
|
391
|
+
absoluteTop: rect.levelCoord,
|
|
395
392
|
marginTop: rect.levelCoord - currentHeight,
|
|
396
393
|
});
|
|
397
394
|
currentHeight = rect.levelCoord + rect.thickness;
|
|
@@ -402,16 +399,16 @@ function placeRects(allRects, segs, cells) {
|
|
|
402
399
|
currentMarginTop = 0;
|
|
403
400
|
for (var _a = 0, rects_2 = rects; _a < rects_2.length; _a++) {
|
|
404
401
|
var rect = rects_2[_a];
|
|
405
|
-
var seg = segs[rect.
|
|
406
|
-
var isAbsolute = rect.
|
|
407
|
-
var isFirstCol = rect.
|
|
402
|
+
var seg = segs[rect.index];
|
|
403
|
+
var isAbsolute = rect.span.end - rect.span.start > 1; // multi-column?
|
|
404
|
+
var isFirstCol = rect.span.start === col;
|
|
408
405
|
currentMarginTop += rect.levelCoord - currentHeight; // amount of space since bottom of previous seg
|
|
409
406
|
currentHeight = rect.levelCoord + rect.thickness; // height will now be bottom of current seg
|
|
410
407
|
if (isAbsolute) {
|
|
411
408
|
currentMarginTop += rect.thickness;
|
|
412
409
|
if (isFirstCol) {
|
|
413
410
|
multiPlacements.push({
|
|
414
|
-
seg: resliceSeg(seg, rect.
|
|
411
|
+
seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),
|
|
415
412
|
isVisible: true,
|
|
416
413
|
isAbsolute: true,
|
|
417
414
|
absoluteTop: rect.levelCoord,
|
|
@@ -421,10 +418,10 @@ function placeRects(allRects, segs, cells) {
|
|
|
421
418
|
}
|
|
422
419
|
else if (isFirstCol) {
|
|
423
420
|
multiPlacements.push({
|
|
424
|
-
seg: resliceSeg(seg, rect.
|
|
421
|
+
seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),
|
|
425
422
|
isVisible: true,
|
|
426
423
|
isAbsolute: false,
|
|
427
|
-
absoluteTop:
|
|
424
|
+
absoluteTop: rect.levelCoord,
|
|
428
425
|
marginTop: currentMarginTop, // claim the margin
|
|
429
426
|
});
|
|
430
427
|
currentMarginTop = 0;
|
|
@@ -443,7 +440,7 @@ function groupRectsByEachCol(rects, colCnt) {
|
|
|
443
440
|
}
|
|
444
441
|
for (var _i = 0, rects_3 = rects; _i < rects_3.length; _i++) {
|
|
445
442
|
var rect = rects_3[_i];
|
|
446
|
-
for (var col = rect.
|
|
443
|
+
for (var col = rect.span.start; col < rect.span.end; col += 1) {
|
|
447
444
|
rectsByEachCol[col].push(rect);
|
|
448
445
|
}
|
|
449
446
|
}
|
|
@@ -489,25 +486,21 @@ var DayGridSegHierarchy = /** @class */ (function (_super) {
|
|
|
489
486
|
};
|
|
490
487
|
DayGridSegHierarchy.prototype.handleInvalidInsertion = function (insertion, entry, hiddenEntries) {
|
|
491
488
|
var _a = this, entriesByLevel = _a.entriesByLevel, forceHidden = _a.forceHidden;
|
|
492
|
-
var
|
|
493
|
-
if (this.hiddenConsumes &&
|
|
494
|
-
|
|
495
|
-
|
|
489
|
+
var touchingEntry = insertion.touchingEntry, touchingLevel = insertion.touchingLevel, touchingLateral = insertion.touchingLateral;
|
|
490
|
+
if (this.hiddenConsumes && touchingEntry) {
|
|
491
|
+
var touchingEntryId = common.buildEntryKey(touchingEntry);
|
|
492
|
+
// if not already hidden
|
|
493
|
+
if (!forceHidden[touchingEntryId]) {
|
|
496
494
|
if (this.allowReslicing) {
|
|
497
|
-
var placeholderEntry = tslib.__assign(tslib.__assign({},
|
|
495
|
+
var placeholderEntry = tslib.__assign(tslib.__assign({}, touchingEntry), { span: common.intersectSpans(touchingEntry.span, entry.span) });
|
|
498
496
|
var placeholderEntryId = common.buildEntryKey(placeholderEntry);
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
this.splitEntry(leadingEntry, entry, hiddenEntries); // split up the leadingEntry
|
|
503
|
-
}
|
|
497
|
+
forceHidden[placeholderEntryId] = true;
|
|
498
|
+
entriesByLevel[touchingLevel][touchingLateral] = placeholderEntry; // replace touchingEntry with our placeholder
|
|
499
|
+
this.splitEntry(touchingEntry, entry, hiddenEntries); // split up the touchingEntry, reinsert it
|
|
504
500
|
}
|
|
505
501
|
else {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
forceHidden[placeholderEntryId] = true;
|
|
509
|
-
hiddenEntries.push(leadingEntry);
|
|
510
|
-
}
|
|
502
|
+
forceHidden[touchingEntryId] = true;
|
|
503
|
+
hiddenEntries.push(touchingEntry);
|
|
511
504
|
}
|
|
512
505
|
}
|
|
513
506
|
}
|
|
@@ -546,7 +539,7 @@ var TableRow = /** @class */ (function (_super) {
|
|
|
546
539
|
(props.eventDrag && props.eventDrag.affectedInstances) ||
|
|
547
540
|
(props.eventResize && props.eventResize.affectedInstances) ||
|
|
548
541
|
{};
|
|
549
|
-
return (common.createElement("tr", { ref: this.rootElRef },
|
|
542
|
+
return (common.createElement("tr", { ref: this.rootElRef, role: "row" },
|
|
550
543
|
props.renderIntro && props.renderIntro(),
|
|
551
544
|
props.cells.map(function (cell, col) {
|
|
552
545
|
var normalFgNodes = _this.renderFgSegs(col, props.forPrint ? singleColPlacements[col] : multiColPlacements[col], props.todayRange, isForcedInvisible);
|
|
@@ -664,9 +657,14 @@ var TableRow = /** @class */ (function (_super) {
|
|
|
664
657
|
});
|
|
665
658
|
}
|
|
666
659
|
}
|
|
660
|
+
var oldInstanceHeights = this.state.eventInstanceHeights;
|
|
661
|
+
var newInstanceHeights = this.queryEventInstanceHeights();
|
|
667
662
|
var limitByContentHeight = props.dayMaxEvents === true || props.dayMaxEventRows === true;
|
|
668
663
|
this.setState({
|
|
669
|
-
|
|
664
|
+
// HACK to prevent oscillations of events being shown/hidden from max-event-rows
|
|
665
|
+
// Essentially, once you compute an element's height, never null-out.
|
|
666
|
+
// TODO: always display all events, as visibility:hidden?
|
|
667
|
+
eventInstanceHeights: tslib.__assign(tslib.__assign({}, oldInstanceHeights), newInstanceHeights),
|
|
670
668
|
maxContentHeight: limitByContentHeight ? this.computeMaxContentHeight() : null,
|
|
671
669
|
});
|
|
672
670
|
}
|
|
@@ -719,7 +717,7 @@ function buildAbsoluteTopHash(colPlacements) {
|
|
|
719
717
|
topsByInstanceId[placement.seg.eventRange.instance.instanceId] = placement.absoluteTop;
|
|
720
718
|
}
|
|
721
719
|
}
|
|
722
|
-
return
|
|
720
|
+
return topsByInstanceId;
|
|
723
721
|
}
|
|
724
722
|
|
|
725
723
|
var Table = /** @class */ (function (_super) {
|
|
@@ -778,13 +776,13 @@ var Table = /** @class */ (function (_super) {
|
|
|
778
776
|
minWidth: props.tableMinWidth,
|
|
779
777
|
} },
|
|
780
778
|
common.createElement(common.NowTimer, { unit: "day" }, function (nowDate, todayRange) { return (common.createElement(common.Fragment, null,
|
|
781
|
-
common.createElement("table", { className: "fc-scrollgrid-sync-table", style: {
|
|
779
|
+
common.createElement("table", { role: "presentation", className: "fc-scrollgrid-sync-table", style: {
|
|
782
780
|
width: props.clientWidth,
|
|
783
781
|
minWidth: props.tableMinWidth,
|
|
784
782
|
height: expandRows ? props.clientHeight : '',
|
|
785
783
|
} },
|
|
786
784
|
props.colGroupNode,
|
|
787
|
-
common.createElement("tbody",
|
|
785
|
+
common.createElement("tbody", { role: "presentation" }, props.cells.map(function (cells, row) { return (common.createElement(TableRow, { ref: _this.rowRefs.createRef(row), key: cells.length
|
|
788
786
|
? cells[0].date.toISOString() /* best? or put key on cell? or use diff formatter? */
|
|
789
787
|
: row // in case there are no cells (like when resource view is loading)
|
|
790
788
|
, showDayNumbers: rowCnt > 1, showWeekNumbers: props.showWeekNumbers, todayRange: todayRange, dateProfile: dateProfile, cells: cells, renderIntro: props.renderRowIntro, businessHourSegs: businessHourSegsByRow[row], eventSelection: props.eventSelection, bgEventSegs: bgEventSegsByRow[row].filter(isSegAllDay) /* hack */, fgEventSegs: fgEventSegsByRow[row], dateSelectionSegs: dateSelectionSegsByRow[row], eventDrag: eventDragByRow[row], eventResize: eventResizeByRow[row], dayMaxEvents: dayMaxEvents, dayMaxEventRows: dayMaxEventRows, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint })); }))))); })));
|
package/main.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar v5.
|
|
2
|
+
FullCalendar v5.10.1
|
|
3
3
|
Docs & License: https://fullcalendar.io/
|
|
4
4
|
(c) 2021 Adam Shaw
|
|
5
5
|
*/
|
|
@@ -48,10 +48,14 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
48
48
|
return __assign.apply(this, arguments);
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
function __spreadArray(to, from) {
|
|
52
|
-
for (var i = 0,
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
function __spreadArray(to, from, pack) {
|
|
52
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
53
|
+
if (ar || !(i in from)) {
|
|
54
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
55
|
+
ar[i] = from[i];
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return to.concat(ar || from);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
/* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.
|
|
@@ -190,11 +194,9 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
190
194
|
}
|
|
191
195
|
TableCellTop.prototype.render = function () {
|
|
192
196
|
var props = this.props;
|
|
193
|
-
var navLinkAttrs = this.context.
|
|
194
|
-
? { 'data-navlink': common.buildNavLinkData(props.date), tabIndex: 0 }
|
|
195
|
-
: {};
|
|
197
|
+
var navLinkAttrs = common.buildNavLinkAttrs(this.context, props.date);
|
|
196
198
|
return (common.createElement(common.DayCellContent, { date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, defaultContent: renderTopInner }, function (innerElRef, innerContent) { return ((innerContent || props.forceDayTop) && (common.createElement("div", { className: "fc-daygrid-day-top", ref: innerElRef },
|
|
197
|
-
common.createElement("a", __assign({ className: "fc-daygrid-day-number" }, navLinkAttrs), innerContent || common.createElement(common.Fragment, null, "\u00A0"))))); }));
|
|
199
|
+
common.createElement("a", __assign({ id: props.dayNumberId, className: "fc-daygrid-day-number" }, navLinkAttrs), innerContent || common.createElement(common.Fragment, null, "\u00A0"))))); }));
|
|
198
200
|
};
|
|
199
201
|
return TableCellTop;
|
|
200
202
|
}(common.BaseComponent));
|
|
@@ -240,7 +242,7 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
240
242
|
var timeFormat = context.options.eventTimeFormat || DEFAULT_TABLE_EVENT_TIME_FORMAT;
|
|
241
243
|
var timeText = common.buildSegTimeText(props.seg, timeFormat, context, true, props.defaultDisplayEventEnd);
|
|
242
244
|
return (common.createElement(common.EventRoot, { seg: props.seg, timeText: timeText, defaultContent: renderInnerContent, isDragging: props.isDragging, isResizing: false, isDateSelecting: false, isSelected: props.isSelected, isPast: props.isPast, isFuture: props.isFuture, isToday: props.isToday }, function (rootElRef, classNames, innerElRef, innerContent) { return ( // we don't use styles!
|
|
243
|
-
common.createElement("a", __assign({ className: ['fc-daygrid-event', 'fc-daygrid-dot-event'].concat(classNames).join(' '), ref: rootElRef }, getSegAnchorAttrs(props.seg)), innerContent)); }));
|
|
245
|
+
common.createElement("a", __assign({ className: ['fc-daygrid-event', 'fc-daygrid-dot-event'].concat(classNames).join(' '), ref: rootElRef }, common.getSegAnchorAttrs(props.seg, context)), innerContent)); }));
|
|
244
246
|
};
|
|
245
247
|
return TableListItemEvent;
|
|
246
248
|
}(common.BaseComponent));
|
|
@@ -250,10 +252,6 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
250
252
|
innerProps.timeText && (common.createElement("div", { className: "fc-event-time" }, innerProps.timeText)),
|
|
251
253
|
common.createElement("div", { className: "fc-event-title" }, innerProps.event.title || common.createElement(common.Fragment, null, "\u00A0"))));
|
|
252
254
|
}
|
|
253
|
-
function getSegAnchorAttrs(seg) {
|
|
254
|
-
var url = seg.eventRange.def.url;
|
|
255
|
-
return url ? { href: url } : {};
|
|
256
|
-
}
|
|
257
255
|
|
|
258
256
|
var TableCellMoreLink = /** @class */ (function (_super) {
|
|
259
257
|
__extends(TableCellMoreLink, _super);
|
|
@@ -275,7 +273,7 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
275
273
|
visibility: isForcedInvisible[instanceId] ? 'hidden' : '',
|
|
276
274
|
} }, hasListItemDisplay(seg) ? (common.createElement(TableListItemEvent, __assign({ seg: seg, isDragging: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, common.getSegMeta(seg, props.todayRange)))) : (common.createElement(TableBlockEvent, __assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, common.getSegMeta(seg, props.todayRange))))));
|
|
277
275
|
})));
|
|
278
|
-
} }, function (rootElRef, classNames, innerElRef, innerContent, handleClick) { return (common.createElement("a", { ref: rootElRef, className: ['fc-daygrid-more-link'].concat(classNames).join(' '),
|
|
276
|
+
} }, function (rootElRef, classNames, innerElRef, innerContent, handleClick, title, isExpanded, popoverId) { return (common.createElement("a", __assign({ ref: rootElRef, className: ['fc-daygrid-more-link'].concat(classNames).join(' '), title: title, "aria-expanded": isExpanded, "aria-controls": popoverId }, common.createAriaClickAttrs(handleClick)), innerContent)); }));
|
|
279
277
|
};
|
|
280
278
|
return TableCellMoreLink;
|
|
281
279
|
}(common.BaseComponent));
|
|
@@ -298,6 +296,9 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
298
296
|
function TableCell() {
|
|
299
297
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
300
298
|
_this.rootElRef = common.createRef();
|
|
299
|
+
_this.state = {
|
|
300
|
+
dayNumberId: common.getUniqueDomId(),
|
|
301
|
+
};
|
|
301
302
|
_this.handleRootEl = function (el) {
|
|
302
303
|
common.setRef(_this.rootElRef, el);
|
|
303
304
|
common.setRef(_this.props.elRef, el);
|
|
@@ -305,16 +306,13 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
305
306
|
return _this;
|
|
306
307
|
}
|
|
307
308
|
TableCell.prototype.render = function () {
|
|
308
|
-
var _a = this, props = _a.props,
|
|
309
|
-
var options = context.options;
|
|
309
|
+
var _a = this, context = _a.context, props = _a.props, state = _a.state, rootElRef = _a.rootElRef;
|
|
310
310
|
var date = props.date, dateProfile = props.dateProfile;
|
|
311
|
-
var navLinkAttrs =
|
|
312
|
-
|
|
313
|
-
: {};
|
|
314
|
-
return (common.createElement(common.DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl }, function (dayElRef, dayClassNames, rootDataAttrs, isDisabled) { return (common.createElement("td", __assign({ ref: dayElRef, className: ['fc-daygrid-day'].concat(dayClassNames, props.extraClassNames || []).join(' ') }, rootDataAttrs, props.extraDataAttrs),
|
|
311
|
+
var navLinkAttrs = common.buildNavLinkAttrs(context, date, 'week');
|
|
312
|
+
return (common.createElement(common.DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl }, function (dayElRef, dayClassNames, rootDataAttrs, isDisabled) { return (common.createElement("td", __assign({ ref: dayElRef, role: "gridcell", className: ['fc-daygrid-day'].concat(dayClassNames, props.extraClassNames || []).join(' ') }, rootDataAttrs, props.extraDataAttrs, (props.showDayNumber ? { 'aria-labelledby': state.dayNumberId } : {})),
|
|
315
313
|
common.createElement("div", { className: "fc-daygrid-day-frame fc-scrollgrid-sync-inner", ref: props.innerElRef /* different from hook system! RENAME */ },
|
|
316
314
|
props.showWeekNumber && (common.createElement(common.WeekNumberRoot, { date: date, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, function (weekElRef, weekClassNames, innerElRef, innerContent) { return (common.createElement("a", __assign({ ref: weekElRef, className: ['fc-daygrid-week-number'].concat(weekClassNames).join(' ') }, navLinkAttrs), innerContent)); })),
|
|
317
|
-
!isDisabled && (common.createElement(TableCellTop, { date: date, dateProfile: dateProfile, showDayNumber: props.showDayNumber, forceDayTop: props.forceDayTop, todayRange: props.todayRange, extraHookProps: props.extraHookProps })),
|
|
315
|
+
!isDisabled && (common.createElement(TableCellTop, { date: date, dateProfile: dateProfile, showDayNumber: props.showDayNumber, dayNumberId: state.dayNumberId, forceDayTop: props.forceDayTop, todayRange: props.todayRange, extraHookProps: props.extraHookProps })),
|
|
318
316
|
common.createElement("div", { className: "fc-daygrid-day-events", ref: props.fgContentElRef },
|
|
319
317
|
props.fgContent,
|
|
320
318
|
common.createElement("div", { className: "fc-daygrid-day-bottom", style: { marginTop: props.moreMarginTop } },
|
|
@@ -350,9 +348,11 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
350
348
|
if (eventHeight != null) {
|
|
351
349
|
segInputs.push({
|
|
352
350
|
index: i,
|
|
353
|
-
spanStart: seg.firstCol,
|
|
354
|
-
spanEnd: seg.lastCol + 1,
|
|
355
351
|
thickness: eventHeight,
|
|
352
|
+
span: {
|
|
353
|
+
start: seg.firstCol,
|
|
354
|
+
end: seg.lastCol + 1,
|
|
355
|
+
},
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
358
|
else {
|
|
@@ -390,15 +390,16 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
390
390
|
}
|
|
391
391
|
for (var _b = 0, hiddenEntries_1 = hiddenEntries; _b < hiddenEntries_1.length; _b++) {
|
|
392
392
|
var hiddenEntry = hiddenEntries_1[_b];
|
|
393
|
-
var seg = segs[hiddenEntry.
|
|
394
|
-
|
|
395
|
-
|
|
393
|
+
var seg = segs[hiddenEntry.index];
|
|
394
|
+
var hiddenSpan = hiddenEntry.span;
|
|
395
|
+
multiColPlacements[hiddenSpan.start].push({
|
|
396
|
+
seg: resliceSeg(seg, hiddenSpan.start, hiddenSpan.end, cells),
|
|
396
397
|
isVisible: false,
|
|
397
398
|
isAbsolute: true,
|
|
398
399
|
absoluteTop: 0,
|
|
399
400
|
marginTop: 0,
|
|
400
401
|
});
|
|
401
|
-
for (var col =
|
|
402
|
+
for (var col = hiddenSpan.start; col < hiddenSpan.end; col += 1) {
|
|
402
403
|
moreCnts[col] += 1;
|
|
403
404
|
singleColPlacements[col].push({
|
|
404
405
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
@@ -429,12 +430,12 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
429
430
|
var currentMarginTop = 0;
|
|
430
431
|
for (var _i = 0, rects_1 = rects; _i < rects_1.length; _i++) {
|
|
431
432
|
var rect = rects_1[_i];
|
|
432
|
-
var seg = segs[rect.
|
|
433
|
+
var seg = segs[rect.index];
|
|
433
434
|
singlePlacements.push({
|
|
434
435
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
435
436
|
isVisible: true,
|
|
436
437
|
isAbsolute: false,
|
|
437
|
-
absoluteTop:
|
|
438
|
+
absoluteTop: rect.levelCoord,
|
|
438
439
|
marginTop: rect.levelCoord - currentHeight,
|
|
439
440
|
});
|
|
440
441
|
currentHeight = rect.levelCoord + rect.thickness;
|
|
@@ -445,16 +446,16 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
445
446
|
currentMarginTop = 0;
|
|
446
447
|
for (var _a = 0, rects_2 = rects; _a < rects_2.length; _a++) {
|
|
447
448
|
var rect = rects_2[_a];
|
|
448
|
-
var seg = segs[rect.
|
|
449
|
-
var isAbsolute = rect.
|
|
450
|
-
var isFirstCol = rect.
|
|
449
|
+
var seg = segs[rect.index];
|
|
450
|
+
var isAbsolute = rect.span.end - rect.span.start > 1; // multi-column?
|
|
451
|
+
var isFirstCol = rect.span.start === col;
|
|
451
452
|
currentMarginTop += rect.levelCoord - currentHeight; // amount of space since bottom of previous seg
|
|
452
453
|
currentHeight = rect.levelCoord + rect.thickness; // height will now be bottom of current seg
|
|
453
454
|
if (isAbsolute) {
|
|
454
455
|
currentMarginTop += rect.thickness;
|
|
455
456
|
if (isFirstCol) {
|
|
456
457
|
multiPlacements.push({
|
|
457
|
-
seg: resliceSeg(seg, rect.
|
|
458
|
+
seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),
|
|
458
459
|
isVisible: true,
|
|
459
460
|
isAbsolute: true,
|
|
460
461
|
absoluteTop: rect.levelCoord,
|
|
@@ -464,10 +465,10 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
464
465
|
}
|
|
465
466
|
else if (isFirstCol) {
|
|
466
467
|
multiPlacements.push({
|
|
467
|
-
seg: resliceSeg(seg, rect.
|
|
468
|
+
seg: resliceSeg(seg, rect.span.start, rect.span.end, cells),
|
|
468
469
|
isVisible: true,
|
|
469
470
|
isAbsolute: false,
|
|
470
|
-
absoluteTop:
|
|
471
|
+
absoluteTop: rect.levelCoord,
|
|
471
472
|
marginTop: currentMarginTop, // claim the margin
|
|
472
473
|
});
|
|
473
474
|
currentMarginTop = 0;
|
|
@@ -486,7 +487,7 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
486
487
|
}
|
|
487
488
|
for (var _i = 0, rects_3 = rects; _i < rects_3.length; _i++) {
|
|
488
489
|
var rect = rects_3[_i];
|
|
489
|
-
for (var col = rect.
|
|
490
|
+
for (var col = rect.span.start; col < rect.span.end; col += 1) {
|
|
490
491
|
rectsByEachCol[col].push(rect);
|
|
491
492
|
}
|
|
492
493
|
}
|
|
@@ -532,25 +533,21 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
532
533
|
};
|
|
533
534
|
DayGridSegHierarchy.prototype.handleInvalidInsertion = function (insertion, entry, hiddenEntries) {
|
|
534
535
|
var _a = this, entriesByLevel = _a.entriesByLevel, forceHidden = _a.forceHidden;
|
|
535
|
-
var
|
|
536
|
-
if (this.hiddenConsumes &&
|
|
537
|
-
|
|
538
|
-
|
|
536
|
+
var touchingEntry = insertion.touchingEntry, touchingLevel = insertion.touchingLevel, touchingLateral = insertion.touchingLateral;
|
|
537
|
+
if (this.hiddenConsumes && touchingEntry) {
|
|
538
|
+
var touchingEntryId = common.buildEntryKey(touchingEntry);
|
|
539
|
+
// if not already hidden
|
|
540
|
+
if (!forceHidden[touchingEntryId]) {
|
|
539
541
|
if (this.allowReslicing) {
|
|
540
|
-
var placeholderEntry = __assign(__assign({},
|
|
542
|
+
var placeholderEntry = __assign(__assign({}, touchingEntry), { span: common.intersectSpans(touchingEntry.span, entry.span) });
|
|
541
543
|
var placeholderEntryId = common.buildEntryKey(placeholderEntry);
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
this.splitEntry(leadingEntry, entry, hiddenEntries); // split up the leadingEntry
|
|
546
|
-
}
|
|
544
|
+
forceHidden[placeholderEntryId] = true;
|
|
545
|
+
entriesByLevel[touchingLevel][touchingLateral] = placeholderEntry; // replace touchingEntry with our placeholder
|
|
546
|
+
this.splitEntry(touchingEntry, entry, hiddenEntries); // split up the touchingEntry, reinsert it
|
|
547
547
|
}
|
|
548
548
|
else {
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
forceHidden[placeholderEntryId] = true;
|
|
552
|
-
hiddenEntries.push(leadingEntry);
|
|
553
|
-
}
|
|
549
|
+
forceHidden[touchingEntryId] = true;
|
|
550
|
+
hiddenEntries.push(touchingEntry);
|
|
554
551
|
}
|
|
555
552
|
}
|
|
556
553
|
}
|
|
@@ -589,7 +586,7 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
589
586
|
(props.eventDrag && props.eventDrag.affectedInstances) ||
|
|
590
587
|
(props.eventResize && props.eventResize.affectedInstances) ||
|
|
591
588
|
{};
|
|
592
|
-
return (common.createElement("tr", { ref: this.rootElRef },
|
|
589
|
+
return (common.createElement("tr", { ref: this.rootElRef, role: "row" },
|
|
593
590
|
props.renderIntro && props.renderIntro(),
|
|
594
591
|
props.cells.map(function (cell, col) {
|
|
595
592
|
var normalFgNodes = _this.renderFgSegs(col, props.forPrint ? singleColPlacements[col] : multiColPlacements[col], props.todayRange, isForcedInvisible);
|
|
@@ -707,9 +704,14 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
707
704
|
});
|
|
708
705
|
}
|
|
709
706
|
}
|
|
707
|
+
var oldInstanceHeights = this.state.eventInstanceHeights;
|
|
708
|
+
var newInstanceHeights = this.queryEventInstanceHeights();
|
|
710
709
|
var limitByContentHeight = props.dayMaxEvents === true || props.dayMaxEventRows === true;
|
|
711
710
|
this.setState({
|
|
712
|
-
|
|
711
|
+
// HACK to prevent oscillations of events being shown/hidden from max-event-rows
|
|
712
|
+
// Essentially, once you compute an element's height, never null-out.
|
|
713
|
+
// TODO: always display all events, as visibility:hidden?
|
|
714
|
+
eventInstanceHeights: __assign(__assign({}, oldInstanceHeights), newInstanceHeights),
|
|
713
715
|
maxContentHeight: limitByContentHeight ? this.computeMaxContentHeight() : null,
|
|
714
716
|
});
|
|
715
717
|
}
|
|
@@ -762,7 +764,7 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
762
764
|
topsByInstanceId[placement.seg.eventRange.instance.instanceId] = placement.absoluteTop;
|
|
763
765
|
}
|
|
764
766
|
}
|
|
765
|
-
return
|
|
767
|
+
return topsByInstanceId;
|
|
766
768
|
}
|
|
767
769
|
|
|
768
770
|
var Table = /** @class */ (function (_super) {
|
|
@@ -821,13 +823,13 @@ var FullCalendarDayGrid = (function (exports, common) {
|
|
|
821
823
|
minWidth: props.tableMinWidth,
|
|
822
824
|
} },
|
|
823
825
|
common.createElement(common.NowTimer, { unit: "day" }, function (nowDate, todayRange) { return (common.createElement(common.Fragment, null,
|
|
824
|
-
common.createElement("table", { className: "fc-scrollgrid-sync-table", style: {
|
|
826
|
+
common.createElement("table", { role: "presentation", className: "fc-scrollgrid-sync-table", style: {
|
|
825
827
|
width: props.clientWidth,
|
|
826
828
|
minWidth: props.tableMinWidth,
|
|
827
829
|
height: expandRows ? props.clientHeight : '',
|
|
828
830
|
} },
|
|
829
831
|
props.colGroupNode,
|
|
830
|
-
common.createElement("tbody",
|
|
832
|
+
common.createElement("tbody", { role: "presentation" }, props.cells.map(function (cells, row) { return (common.createElement(TableRow, { ref: _this.rowRefs.createRef(row), key: cells.length
|
|
831
833
|
? cells[0].date.toISOString() /* best? or put key on cell? or use diff formatter? */
|
|
832
834
|
: row // in case there are no cells (like when resource view is loading)
|
|
833
835
|
, showDayNumbers: rowCnt > 1, showWeekNumbers: props.showWeekNumbers, todayRange: todayRange, dateProfile: dateProfile, cells: cells, renderIntro: props.renderRowIntro, businessHourSegs: businessHourSegsByRow[row], eventSelection: props.eventSelection, bgEventSegs: bgEventSegsByRow[row].filter(isSegAllDay) /* hack */, fgEventSegs: fgEventSegsByRow[row], dateSelectionSegs: dateSelectionSegsByRow[row], eventDrag: eventDragByRow[row], eventResize: eventResizeByRow[row], dayMaxEvents: dayMaxEvents, dayMaxEventRows: dayMaxEventRows, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint })); }))))); })));
|