@fullcalendar/daygrid 5.11.2 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/main.cjs.js +392 -428
- package/main.global.js +392 -478
- package/main.global.min.js +2 -2
- package/main.js +393 -430
- package/main.js.map +1 -1
- package/package.json +3 -3
- package/main.css +0 -235
- package/main.min.css +0 -1
package/main.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
FullCalendar
|
|
2
|
+
FullCalendar v6.0.0-beta.1
|
|
3
3
|
Docs & License: https://fullcalendar.io/
|
|
4
4
|
(c) 2022 Adam Shaw
|
|
5
5
|
*/
|
|
@@ -8,24 +8,20 @@ Docs & License: https://fullcalendar.io/
|
|
|
8
8
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
9
9
|
|
|
10
10
|
var common = require('@fullcalendar/common');
|
|
11
|
-
var tslib = require('tslib');
|
|
12
|
-
;
|
|
13
11
|
|
|
14
12
|
/* An abstract class for the daygrid views, as well as month view. Renders one or more rows of day cells.
|
|
15
13
|
----------------------------------------------------------------------------------------------------------------------*/
|
|
16
14
|
// It is a manager for a Table subcomponent, which does most of the heavy lifting.
|
|
17
15
|
// It is responsible for managing width/height.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
var sections = [];
|
|
28
|
-
var stickyHeaderDates = common.getStickyHeaderDates(context.options);
|
|
16
|
+
class TableView extends common.DateComponent {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.headerElRef = common.createRef();
|
|
20
|
+
}
|
|
21
|
+
renderSimpleLayout(headerRowContent, bodyContent) {
|
|
22
|
+
let { props, context } = this;
|
|
23
|
+
let sections = [];
|
|
24
|
+
let stickyHeaderDates = common.getStickyHeaderDates(context.options);
|
|
29
25
|
if (headerRowContent) {
|
|
30
26
|
sections.push({
|
|
31
27
|
type: 'header',
|
|
@@ -44,18 +40,18 @@ var TableView = /** @class */ (function (_super) {
|
|
|
44
40
|
liquid: true,
|
|
45
41
|
chunk: { content: bodyContent },
|
|
46
42
|
});
|
|
47
|
-
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec },
|
|
48
|
-
common.createElement(common.SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [] /* TODO: make optional? */, sections: sections })))
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec }, (rootElRef, classNames) => (common.createElement("div", { ref: rootElRef, className: ['fc-daygrid'].concat(classNames).join(' ') },
|
|
44
|
+
common.createElement(common.SimpleScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, cols: [] /* TODO: make optional? */, sections: sections })))));
|
|
45
|
+
}
|
|
46
|
+
renderHScrollLayout(headerRowContent, bodyContent, colCnt, dayMinWidth) {
|
|
47
|
+
let ScrollGrid = this.context.pluginHooks.scrollGridImpl;
|
|
52
48
|
if (!ScrollGrid) {
|
|
53
49
|
throw new Error('No ScrollGrid implementation');
|
|
54
50
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
51
|
+
let { props, context } = this;
|
|
52
|
+
let stickyHeaderDates = !props.forPrint && common.getStickyHeaderDates(context.options);
|
|
53
|
+
let stickyFooterScrollbar = !props.forPrint && common.getStickyFooterScrollbar(context.options);
|
|
54
|
+
let sections = [];
|
|
59
55
|
if (headerRowContent) {
|
|
60
56
|
sections.push({
|
|
61
57
|
type: 'header',
|
|
@@ -89,82 +85,73 @@ var TableView = /** @class */ (function (_super) {
|
|
|
89
85
|
}],
|
|
90
86
|
});
|
|
91
87
|
}
|
|
92
|
-
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec },
|
|
93
|
-
common.createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, colGroups: [{ cols: [{ span: colCnt, minWidth: dayMinWidth }] }], sections: sections })))
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
}(common.DateComponent));
|
|
88
|
+
return (common.createElement(common.ViewRoot, { viewSpec: context.viewSpec }, (rootElRef, classNames) => (common.createElement("div", { ref: rootElRef, className: ['fc-daygrid'].concat(classNames).join(' ') },
|
|
89
|
+
common.createElement(ScrollGrid, { liquid: !props.isHeightAuto && !props.forPrint, collapsibleWidth: props.forPrint, colGroups: [{ cols: [{ span: colCnt, minWidth: dayMinWidth }] }], sections: sections })))));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
97
92
|
|
|
98
93
|
function splitSegsByRow(segs, rowCnt) {
|
|
99
|
-
|
|
100
|
-
for (
|
|
94
|
+
let byRow = [];
|
|
95
|
+
for (let i = 0; i < rowCnt; i += 1) {
|
|
101
96
|
byRow[i] = [];
|
|
102
97
|
}
|
|
103
|
-
for (
|
|
104
|
-
var seg = segs_1[_i];
|
|
98
|
+
for (let seg of segs) {
|
|
105
99
|
byRow[seg.row].push(seg);
|
|
106
100
|
}
|
|
107
101
|
return byRow;
|
|
108
102
|
}
|
|
109
103
|
function splitSegsByFirstCol(segs, colCnt) {
|
|
110
|
-
|
|
111
|
-
for (
|
|
104
|
+
let byCol = [];
|
|
105
|
+
for (let i = 0; i < colCnt; i += 1) {
|
|
112
106
|
byCol[i] = [];
|
|
113
107
|
}
|
|
114
|
-
for (
|
|
115
|
-
var seg = segs_2[_i];
|
|
108
|
+
for (let seg of segs) {
|
|
116
109
|
byCol[seg.firstCol].push(seg);
|
|
117
110
|
}
|
|
118
111
|
return byCol;
|
|
119
112
|
}
|
|
120
113
|
function splitInteractionByRow(ui, rowCnt) {
|
|
121
|
-
|
|
114
|
+
let byRow = [];
|
|
122
115
|
if (!ui) {
|
|
123
|
-
for (
|
|
116
|
+
for (let i = 0; i < rowCnt; i += 1) {
|
|
124
117
|
byRow[i] = null;
|
|
125
118
|
}
|
|
126
119
|
}
|
|
127
120
|
else {
|
|
128
|
-
for (
|
|
121
|
+
for (let i = 0; i < rowCnt; i += 1) {
|
|
129
122
|
byRow[i] = {
|
|
130
123
|
affectedInstances: ui.affectedInstances,
|
|
131
124
|
isEvent: ui.isEvent,
|
|
132
125
|
segs: [],
|
|
133
126
|
};
|
|
134
127
|
}
|
|
135
|
-
for (
|
|
136
|
-
var seg = _a[_i];
|
|
128
|
+
for (let seg of ui.segs) {
|
|
137
129
|
byRow[seg.row].segs.push(seg);
|
|
138
130
|
}
|
|
139
131
|
}
|
|
140
132
|
return byRow;
|
|
141
133
|
}
|
|
142
134
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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 },
|
|
152
|
-
common.createElement("a", tslib.__assign({ id: props.dayNumberId, className: "fc-daygrid-day-number" }, navLinkAttrs), innerContent || common.createElement(common.Fragment, null, "\u00A0"))))); }));
|
|
153
|
-
};
|
|
154
|
-
return TableCellTop;
|
|
155
|
-
}(common.BaseComponent));
|
|
135
|
+
class TableCellTop extends common.BaseComponent {
|
|
136
|
+
render() {
|
|
137
|
+
let { props } = this;
|
|
138
|
+
let navLinkAttrs = common.buildNavLinkAttrs(this.context, props.date);
|
|
139
|
+
return (common.createElement(common.DayCellContent, { date: props.date, dateProfile: props.dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, defaultContent: renderTopInner }, (innerElRef, innerContent) => ((innerContent || props.forceDayTop) && (common.createElement("div", { className: "fc-daygrid-day-top", ref: innerElRef },
|
|
140
|
+
common.createElement("a", Object.assign({ id: props.dayNumberId, className: "fc-daygrid-day-number" }, navLinkAttrs), innerContent || common.createElement(common.Fragment, null, "\u00A0")))))));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
156
143
|
function renderTopInner(props) {
|
|
157
144
|
return props.dayNumberText;
|
|
158
145
|
}
|
|
159
146
|
|
|
160
|
-
|
|
147
|
+
const DEFAULT_TABLE_EVENT_TIME_FORMAT = common.createFormatter({
|
|
161
148
|
hour: 'numeric',
|
|
162
149
|
minute: '2-digit',
|
|
163
150
|
omitZeroMinute: true,
|
|
164
151
|
meridiem: 'narrow',
|
|
165
152
|
});
|
|
166
153
|
function hasListItemDisplay(seg) {
|
|
167
|
-
|
|
154
|
+
let { display } = seg.eventRange.ui;
|
|
168
155
|
return display === 'list-item' || (display === 'auto' &&
|
|
169
156
|
!seg.eventRange.def.allDay &&
|
|
170
157
|
seg.firstCol === seg.lastCol && // can't be multi-day
|
|
@@ -173,32 +160,22 @@ function hasListItemDisplay(seg) {
|
|
|
173
160
|
);
|
|
174
161
|
}
|
|
175
162
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
return
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
var props = this.props;
|
|
183
|
-
return (common.createElement(common.StandardEvent, tslib.__assign({}, props, { extraClassNames: ['fc-daygrid-event', 'fc-daygrid-block-event', 'fc-h-event'], defaultTimeFormat: DEFAULT_TABLE_EVENT_TIME_FORMAT, defaultDisplayEventEnd: props.defaultDisplayEventEnd, disableResizing: !props.seg.eventRange.def.allDay })));
|
|
184
|
-
};
|
|
185
|
-
return TableBlockEvent;
|
|
186
|
-
}(common.BaseComponent));
|
|
163
|
+
class TableBlockEvent extends common.BaseComponent {
|
|
164
|
+
render() {
|
|
165
|
+
let { props } = this;
|
|
166
|
+
return (common.createElement(common.StandardEvent, Object.assign({}, props, { extraClassNames: ['fc-daygrid-event', 'fc-daygrid-block-event', 'fc-h-event'], defaultTimeFormat: DEFAULT_TABLE_EVENT_TIME_FORMAT, defaultDisplayEventEnd: props.defaultDisplayEventEnd, disableResizing: !props.seg.eventRange.def.allDay })));
|
|
167
|
+
}
|
|
168
|
+
}
|
|
187
169
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
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!
|
|
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)); }));
|
|
199
|
-
};
|
|
200
|
-
return TableListItemEvent;
|
|
201
|
-
}(common.BaseComponent));
|
|
170
|
+
class TableListItemEvent extends common.BaseComponent {
|
|
171
|
+
render() {
|
|
172
|
+
let { props, context } = this;
|
|
173
|
+
let timeFormat = context.options.eventTimeFormat || DEFAULT_TABLE_EVENT_TIME_FORMAT;
|
|
174
|
+
let timeText = common.buildSegTimeText(props.seg, timeFormat, context, true, props.defaultDisplayEventEnd);
|
|
175
|
+
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 }, (rootElRef, classNames, innerElRef, innerContent) => ( // we don't use styles!
|
|
176
|
+
common.createElement("a", Object.assign({ className: ['fc-daygrid-event', 'fc-daygrid-dot-event'].concat(classNames).join(' '), ref: rootElRef }, common.getSegAnchorAttrs(props.seg, context)), innerContent))));
|
|
177
|
+
}
|
|
178
|
+
}
|
|
202
179
|
function renderInnerContent(innerProps) {
|
|
203
180
|
return (common.createElement(common.Fragment, null,
|
|
204
181
|
common.createElement("div", { className: "fc-daygrid-event-dot", style: { borderColor: innerProps.borderColor || innerProps.backgroundColor } }),
|
|
@@ -206,78 +183,71 @@ function renderInnerContent(innerProps) {
|
|
|
206
183
|
common.createElement("div", { className: "fc-event-title" }, innerProps.event.title || common.createElement(common.Fragment, null, "\u00A0"))));
|
|
207
184
|
}
|
|
208
185
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
return (common.createElement(common.MoreLinkRoot, { dateProfile: props.dateProfile, todayRange: props.todayRange, allDayDate: props.allDayDate, moreCnt: props.moreCnt, allSegs: allSegs, hiddenSegs: invisibleSegs, alignmentElRef: props.alignmentElRef, alignGridTop: props.alignGridTop, extraDateSpan: props.extraDateSpan, popoverContent: function () {
|
|
220
|
-
var isForcedInvisible = (props.eventDrag ? props.eventDrag.affectedInstances : null) ||
|
|
186
|
+
class TableCellMoreLink extends common.BaseComponent {
|
|
187
|
+
constructor() {
|
|
188
|
+
super(...arguments);
|
|
189
|
+
this.compileSegs = common.memoize(compileSegs);
|
|
190
|
+
}
|
|
191
|
+
render() {
|
|
192
|
+
let { props } = this;
|
|
193
|
+
let { allSegs, invisibleSegs } = this.compileSegs(props.singlePlacements);
|
|
194
|
+
return (common.createElement(common.MoreLinkRoot, { dateProfile: props.dateProfile, todayRange: props.todayRange, allDayDate: props.allDayDate, moreCnt: props.moreCnt, allSegs: allSegs, hiddenSegs: invisibleSegs, alignmentElRef: props.alignmentElRef, alignGridTop: props.alignGridTop, extraDateSpan: props.extraDateSpan, popoverContent: () => {
|
|
195
|
+
let isForcedInvisible = (props.eventDrag ? props.eventDrag.affectedInstances : null) ||
|
|
221
196
|
(props.eventResize ? props.eventResize.affectedInstances : null) ||
|
|
222
197
|
{};
|
|
223
|
-
return (common.createElement(common.Fragment, null, allSegs.map(
|
|
224
|
-
|
|
198
|
+
return (common.createElement(common.Fragment, null, allSegs.map((seg) => {
|
|
199
|
+
let instanceId = seg.eventRange.instance.instanceId;
|
|
225
200
|
return (common.createElement("div", { className: "fc-daygrid-event-harness", key: instanceId, style: {
|
|
226
201
|
visibility: isForcedInvisible[instanceId] ? 'hidden' : '',
|
|
227
|
-
} }, hasListItemDisplay(seg) ? (common.createElement(TableListItemEvent,
|
|
202
|
+
} }, hasListItemDisplay(seg) ? (common.createElement(TableListItemEvent, Object.assign({ seg: seg, isDragging: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, common.getSegMeta(seg, props.todayRange)))) : (common.createElement(TableBlockEvent, Object.assign({ seg: seg, isDragging: false, isResizing: false, isDateSelecting: false, isSelected: instanceId === props.eventSelection, defaultDisplayEventEnd: false }, common.getSegMeta(seg, props.todayRange))))));
|
|
228
203
|
})));
|
|
229
|
-
} },
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
}(common.BaseComponent));
|
|
204
|
+
} }, (rootElRef, classNames, innerElRef, innerContent, handleClick, title, isExpanded, popoverId) => (common.createElement("a", Object.assign({ ref: rootElRef, className: ['fc-daygrid-more-link'].concat(classNames).join(' '), title: title, "aria-expanded": isExpanded, "aria-controls": popoverId }, common.createAriaClickAttrs(handleClick)), innerContent))));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
233
207
|
function compileSegs(singlePlacements) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
for (
|
|
237
|
-
var placement = singlePlacements_1[_i];
|
|
208
|
+
let allSegs = [];
|
|
209
|
+
let invisibleSegs = [];
|
|
210
|
+
for (let placement of singlePlacements) {
|
|
238
211
|
allSegs.push(placement.seg);
|
|
239
212
|
if (!placement.isVisible) {
|
|
240
213
|
invisibleSegs.push(placement.seg);
|
|
241
214
|
}
|
|
242
215
|
}
|
|
243
|
-
return { allSegs
|
|
216
|
+
return { allSegs, invisibleSegs };
|
|
244
217
|
}
|
|
245
218
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
_this.state = {
|
|
219
|
+
const DEFAULT_WEEK_NUM_FORMAT = common.createFormatter({ week: 'narrow' });
|
|
220
|
+
class TableCell extends common.DateComponent {
|
|
221
|
+
constructor() {
|
|
222
|
+
super(...arguments);
|
|
223
|
+
this.rootElRef = common.createRef();
|
|
224
|
+
this.state = {
|
|
253
225
|
dayNumberId: common.getUniqueDomId(),
|
|
254
226
|
};
|
|
255
|
-
|
|
256
|
-
common.setRef(
|
|
257
|
-
common.setRef(
|
|
227
|
+
this.handleRootEl = (el) => {
|
|
228
|
+
common.setRef(this.rootElRef, el);
|
|
229
|
+
common.setRef(this.props.elRef, el);
|
|
258
230
|
};
|
|
259
|
-
return _this;
|
|
260
231
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return (common.createElement(common.DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl },
|
|
232
|
+
render() {
|
|
233
|
+
let { context, props, state, rootElRef } = this;
|
|
234
|
+
let { date, dateProfile } = props;
|
|
235
|
+
let navLinkAttrs = common.buildNavLinkAttrs(context, date, 'week');
|
|
236
|
+
return (common.createElement(common.DayCellRoot, { date: date, dateProfile: dateProfile, todayRange: props.todayRange, showDayNumber: props.showDayNumber, extraHookProps: props.extraHookProps, elRef: this.handleRootEl }, (dayElRef, dayClassNames, rootDataAttrs, isDisabled) => (common.createElement("td", Object.assign({ ref: dayElRef, role: "gridcell", className: ['fc-daygrid-day'].concat(dayClassNames, props.extraClassNames || []).join(' ') }, rootDataAttrs, props.extraDataAttrs, (props.showDayNumber ? { 'aria-labelledby': state.dayNumberId } : {})),
|
|
266
237
|
common.createElement("div", { className: "fc-daygrid-day-frame fc-scrollgrid-sync-inner", ref: props.innerElRef /* different from hook system! RENAME */ },
|
|
267
|
-
props.showWeekNumber && (common.createElement(common.WeekNumberRoot, { date: date, defaultFormat: DEFAULT_WEEK_NUM_FORMAT },
|
|
238
|
+
props.showWeekNumber && (common.createElement(common.WeekNumberRoot, { date: date, defaultFormat: DEFAULT_WEEK_NUM_FORMAT }, (weekElRef, weekClassNames, innerElRef, innerContent) => (common.createElement("a", Object.assign({ ref: weekElRef, className: ['fc-daygrid-week-number'].concat(weekClassNames).join(' ') }, navLinkAttrs), innerContent)))),
|
|
268
239
|
!isDisabled && (common.createElement(TableCellTop, { date: date, dateProfile: dateProfile, showDayNumber: props.showDayNumber, dayNumberId: state.dayNumberId, forceDayTop: props.forceDayTop, todayRange: props.todayRange, extraHookProps: props.extraHookProps })),
|
|
269
240
|
common.createElement("div", { className: "fc-daygrid-day-events", ref: props.fgContentElRef },
|
|
270
241
|
props.fgContent,
|
|
271
242
|
common.createElement("div", { className: "fc-daygrid-day-bottom", style: { marginTop: props.moreMarginTop } },
|
|
272
243
|
common.createElement(TableCellMoreLink, { allDayDate: date, singlePlacements: props.singlePlacements, moreCnt: props.moreCnt, alignmentElRef: rootElRef, alignGridTop: !props.showDayNumber, extraDateSpan: props.extraDateSpan, dateProfile: props.dateProfile, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, todayRange: props.todayRange }))),
|
|
273
|
-
common.createElement("div", { className: "fc-daygrid-day-bg" }, props.bgContent))))
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
}(common.DateComponent));
|
|
244
|
+
common.createElement("div", { className: "fc-daygrid-day-bg" }, props.bgContent))))));
|
|
245
|
+
}
|
|
246
|
+
}
|
|
277
247
|
|
|
278
248
|
function computeFgSegPlacement(segs, // assumed already sorted
|
|
279
249
|
dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeight, cells) {
|
|
280
|
-
|
|
250
|
+
let hierarchy = new DayGridSegHierarchy();
|
|
281
251
|
hierarchy.allowReslicing = true;
|
|
282
252
|
hierarchy.strictOrder = strictOrder;
|
|
283
253
|
if (dayMaxEvents === true || dayMaxEventRows === true) {
|
|
@@ -292,12 +262,12 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
292
262
|
hierarchy.hiddenConsumes = true;
|
|
293
263
|
}
|
|
294
264
|
// create segInputs only for segs with known heights
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
for (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
265
|
+
let segInputs = [];
|
|
266
|
+
let unknownHeightSegs = [];
|
|
267
|
+
for (let i = 0; i < segs.length; i += 1) {
|
|
268
|
+
let seg = segs[i];
|
|
269
|
+
let { instanceId } = seg.eventRange.instance;
|
|
270
|
+
let eventHeight = eventInstanceHeights[instanceId];
|
|
301
271
|
if (eventHeight != null) {
|
|
302
272
|
segInputs.push({
|
|
303
273
|
index: i,
|
|
@@ -312,22 +282,21 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
312
282
|
unknownHeightSegs.push(seg);
|
|
313
283
|
}
|
|
314
284
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
285
|
+
let hiddenEntries = hierarchy.addSegs(segInputs);
|
|
286
|
+
let segRects = hierarchy.toRects();
|
|
287
|
+
let { singleColPlacements, multiColPlacements, leftoverMargins } = placeRects(segRects, segs, cells);
|
|
288
|
+
let moreCnts = [];
|
|
289
|
+
let moreMarginTops = [];
|
|
320
290
|
// add segs with unknown heights
|
|
321
|
-
for (
|
|
322
|
-
var seg = unknownHeightSegs_1[_i];
|
|
291
|
+
for (let seg of unknownHeightSegs) {
|
|
323
292
|
multiColPlacements[seg.firstCol].push({
|
|
324
|
-
seg
|
|
293
|
+
seg,
|
|
325
294
|
isVisible: false,
|
|
326
295
|
isAbsolute: true,
|
|
327
296
|
absoluteTop: 0,
|
|
328
297
|
marginTop: 0,
|
|
329
298
|
});
|
|
330
|
-
for (
|
|
299
|
+
for (let col = seg.firstCol; col <= seg.lastCol; col += 1) {
|
|
331
300
|
singleColPlacements[col].push({
|
|
332
301
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
333
302
|
isVisible: false,
|
|
@@ -338,13 +307,12 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
338
307
|
}
|
|
339
308
|
}
|
|
340
309
|
// add the hidden entries
|
|
341
|
-
for (
|
|
310
|
+
for (let col = 0; col < cells.length; col += 1) {
|
|
342
311
|
moreCnts.push(0);
|
|
343
312
|
}
|
|
344
|
-
for (
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var hiddenSpan = hiddenEntry.span;
|
|
313
|
+
for (let hiddenEntry of hiddenEntries) {
|
|
314
|
+
let seg = segs[hiddenEntry.index];
|
|
315
|
+
let hiddenSpan = hiddenEntry.span;
|
|
348
316
|
multiColPlacements[hiddenSpan.start].push({
|
|
349
317
|
seg: resliceSeg(seg, hiddenSpan.start, hiddenSpan.end, cells),
|
|
350
318
|
isVisible: false,
|
|
@@ -352,7 +320,7 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
352
320
|
absoluteTop: 0,
|
|
353
321
|
marginTop: 0,
|
|
354
322
|
});
|
|
355
|
-
for (
|
|
323
|
+
for (let col = hiddenSpan.start; col < hiddenSpan.end; col += 1) {
|
|
356
324
|
moreCnts[col] += 1;
|
|
357
325
|
singleColPlacements[col].push({
|
|
358
326
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
@@ -364,26 +332,25 @@ dayMaxEvents, dayMaxEventRows, strictOrder, eventInstanceHeights, maxContentHeig
|
|
|
364
332
|
}
|
|
365
333
|
}
|
|
366
334
|
// deal with leftover margins
|
|
367
|
-
for (
|
|
335
|
+
for (let col = 0; col < cells.length; col += 1) {
|
|
368
336
|
moreMarginTops.push(leftoverMargins[col]);
|
|
369
337
|
}
|
|
370
|
-
return { singleColPlacements
|
|
338
|
+
return { singleColPlacements, multiColPlacements, moreCnts, moreMarginTops };
|
|
371
339
|
}
|
|
372
340
|
// rects ordered by top coord, then left
|
|
373
341
|
function placeRects(allRects, segs, cells) {
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
for (
|
|
379
|
-
|
|
342
|
+
let rectsByEachCol = groupRectsByEachCol(allRects, cells.length);
|
|
343
|
+
let singleColPlacements = [];
|
|
344
|
+
let multiColPlacements = [];
|
|
345
|
+
let leftoverMargins = [];
|
|
346
|
+
for (let col = 0; col < cells.length; col += 1) {
|
|
347
|
+
let rects = rectsByEachCol[col];
|
|
380
348
|
// compute all static segs in singlePlacements
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
for (
|
|
385
|
-
|
|
386
|
-
var seg = segs[rect.index];
|
|
349
|
+
let singlePlacements = [];
|
|
350
|
+
let currentHeight = 0;
|
|
351
|
+
let currentMarginTop = 0;
|
|
352
|
+
for (let rect of rects) {
|
|
353
|
+
let seg = segs[rect.index];
|
|
387
354
|
singlePlacements.push({
|
|
388
355
|
seg: resliceSeg(seg, col, col + 1, cells),
|
|
389
356
|
isVisible: true,
|
|
@@ -394,14 +361,13 @@ function placeRects(allRects, segs, cells) {
|
|
|
394
361
|
currentHeight = rect.levelCoord + rect.thickness;
|
|
395
362
|
}
|
|
396
363
|
// compute mixed static/absolute segs in multiPlacements
|
|
397
|
-
|
|
364
|
+
let multiPlacements = [];
|
|
398
365
|
currentHeight = 0;
|
|
399
366
|
currentMarginTop = 0;
|
|
400
|
-
for (
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
var isFirstCol = rect.span.start === col;
|
|
367
|
+
for (let rect of rects) {
|
|
368
|
+
let seg = segs[rect.index];
|
|
369
|
+
let isAbsolute = rect.span.end - rect.span.start > 1; // multi-column?
|
|
370
|
+
let isFirstCol = rect.span.start === col;
|
|
405
371
|
currentMarginTop += rect.levelCoord - currentHeight; // amount of space since bottom of previous seg
|
|
406
372
|
currentHeight = rect.levelCoord + rect.thickness; // height will now be bottom of current seg
|
|
407
373
|
if (isAbsolute) {
|
|
@@ -431,16 +397,15 @@ function placeRects(allRects, segs, cells) {
|
|
|
431
397
|
multiColPlacements.push(multiPlacements);
|
|
432
398
|
leftoverMargins.push(currentMarginTop);
|
|
433
399
|
}
|
|
434
|
-
return { singleColPlacements
|
|
400
|
+
return { singleColPlacements, multiColPlacements, leftoverMargins };
|
|
435
401
|
}
|
|
436
402
|
function groupRectsByEachCol(rects, colCnt) {
|
|
437
|
-
|
|
438
|
-
for (
|
|
403
|
+
let rectsByEachCol = [];
|
|
404
|
+
for (let col = 0; col < colCnt; col += 1) {
|
|
439
405
|
rectsByEachCol.push([]);
|
|
440
406
|
}
|
|
441
|
-
for (
|
|
442
|
-
|
|
443
|
-
for (var col = rect.span.start; col < rect.span.end; col += 1) {
|
|
407
|
+
for (let rect of rects) {
|
|
408
|
+
for (let col = rect.span.start; col < rect.span.end; col += 1) {
|
|
444
409
|
rectsByEachCol[col].push(rect);
|
|
445
410
|
}
|
|
446
411
|
}
|
|
@@ -450,50 +415,47 @@ function resliceSeg(seg, spanStart, spanEnd, cells) {
|
|
|
450
415
|
if (seg.firstCol === spanStart && seg.lastCol === spanEnd - 1) {
|
|
451
416
|
return seg;
|
|
452
417
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
418
|
+
let eventRange = seg.eventRange;
|
|
419
|
+
let origRange = eventRange.range;
|
|
420
|
+
let slicedRange = common.intersectRanges(origRange, {
|
|
456
421
|
start: cells[spanStart].date,
|
|
457
422
|
end: common.addDays(cells[spanEnd - 1].date, 1),
|
|
458
423
|
});
|
|
459
|
-
return
|
|
424
|
+
return Object.assign(Object.assign({}, seg), { firstCol: spanStart, lastCol: spanEnd - 1, eventRange: {
|
|
460
425
|
def: eventRange.def,
|
|
461
|
-
ui:
|
|
426
|
+
ui: Object.assign(Object.assign({}, eventRange.ui), { durationEditable: false }),
|
|
462
427
|
instance: eventRange.instance,
|
|
463
428
|
range: slicedRange,
|
|
464
429
|
}, isStart: seg.isStart && slicedRange.start.valueOf() === origRange.start.valueOf(), isEnd: seg.isEnd && slicedRange.end.valueOf() === origRange.end.valueOf() });
|
|
465
430
|
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
431
|
+
class DayGridSegHierarchy extends common.SegHierarchy {
|
|
432
|
+
constructor() {
|
|
433
|
+
super(...arguments);
|
|
470
434
|
// config
|
|
471
|
-
|
|
435
|
+
this.hiddenConsumes = false;
|
|
472
436
|
// allows us to keep hidden entries in the hierarchy so they take up space
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
var entriesByLevel = this.entriesByLevel;
|
|
480
|
-
var excludeHidden = function (entry) { return !_this.forceHidden[common.buildEntryKey(entry)]; };
|
|
437
|
+
this.forceHidden = {};
|
|
438
|
+
}
|
|
439
|
+
addSegs(segInputs) {
|
|
440
|
+
const hiddenSegs = super.addSegs(segInputs);
|
|
441
|
+
const { entriesByLevel } = this;
|
|
442
|
+
const excludeHidden = (entry) => !this.forceHidden[common.buildEntryKey(entry)];
|
|
481
443
|
// remove the forced-hidden segs
|
|
482
|
-
for (
|
|
444
|
+
for (let level = 0; level < entriesByLevel.length; level += 1) {
|
|
483
445
|
entriesByLevel[level] = entriesByLevel[level].filter(excludeHidden);
|
|
484
446
|
}
|
|
485
447
|
return hiddenSegs;
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
448
|
+
}
|
|
449
|
+
handleInvalidInsertion(insertion, entry, hiddenEntries) {
|
|
450
|
+
const { entriesByLevel, forceHidden } = this;
|
|
451
|
+
const { touchingEntry, touchingLevel, touchingLateral } = insertion;
|
|
490
452
|
if (this.hiddenConsumes && touchingEntry) {
|
|
491
|
-
|
|
453
|
+
const touchingEntryId = common.buildEntryKey(touchingEntry);
|
|
492
454
|
// if not already hidden
|
|
493
455
|
if (!forceHidden[touchingEntryId]) {
|
|
494
456
|
if (this.allowReslicing) {
|
|
495
|
-
|
|
496
|
-
|
|
457
|
+
const placeholderEntry = Object.assign(Object.assign({}, touchingEntry), { span: common.intersectSpans(touchingEntry.span, entry.span) });
|
|
458
|
+
const placeholderEntryId = common.buildEntryKey(placeholderEntry);
|
|
497
459
|
forceHidden[placeholderEntryId] = true;
|
|
498
460
|
entriesByLevel[touchingLevel][touchingLateral] = placeholderEntry; // replace touchingEntry with our placeholder
|
|
499
461
|
this.splitEntry(touchingEntry, entry, hiddenEntries); // split up the touchingEntry, reinsert it
|
|
@@ -504,65 +466,61 @@ var DayGridSegHierarchy = /** @class */ (function (_super) {
|
|
|
504
466
|
}
|
|
505
467
|
}
|
|
506
468
|
}
|
|
507
|
-
return
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
}(common.SegHierarchy));
|
|
469
|
+
return super.handleInvalidInsertion(insertion, entry, hiddenEntries);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
511
472
|
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
_this.state = {
|
|
473
|
+
class TableRow extends common.DateComponent {
|
|
474
|
+
constructor() {
|
|
475
|
+
super(...arguments);
|
|
476
|
+
this.cellElRefs = new common.RefMap(); // the <td>
|
|
477
|
+
this.frameElRefs = new common.RefMap(); // the fc-daygrid-day-frame
|
|
478
|
+
this.fgElRefs = new common.RefMap(); // the fc-daygrid-day-events
|
|
479
|
+
this.segHarnessRefs = new common.RefMap(); // indexed by "instanceId:firstCol"
|
|
480
|
+
this.rootElRef = common.createRef();
|
|
481
|
+
this.state = {
|
|
522
482
|
framePositions: null,
|
|
523
483
|
maxContentHeight: null,
|
|
524
484
|
eventInstanceHeights: {},
|
|
525
485
|
};
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
var _b = computeFgSegPlacement(common.sortEventSegs(props.fgEventSegs, options.eventOrder), props.dayMaxEvents, props.dayMaxEventRows, options.eventOrderStrict, state.eventInstanceHeights, state.maxContentHeight, props.cells), singleColPlacements = _b.singleColPlacements, multiColPlacements = _b.multiColPlacements, moreCnts = _b.moreCnts, moreMarginTops = _b.moreMarginTops;
|
|
538
|
-
var isForcedInvisible = // TODO: messy way to compute this
|
|
486
|
+
}
|
|
487
|
+
render() {
|
|
488
|
+
let { props, state, context } = this;
|
|
489
|
+
let { options } = context;
|
|
490
|
+
let colCnt = props.cells.length;
|
|
491
|
+
let businessHoursByCol = splitSegsByFirstCol(props.businessHourSegs, colCnt);
|
|
492
|
+
let bgEventSegsByCol = splitSegsByFirstCol(props.bgEventSegs, colCnt);
|
|
493
|
+
let highlightSegsByCol = splitSegsByFirstCol(this.getHighlightSegs(), colCnt);
|
|
494
|
+
let mirrorSegsByCol = splitSegsByFirstCol(this.getMirrorSegs(), colCnt);
|
|
495
|
+
let { singleColPlacements, multiColPlacements, moreCnts, moreMarginTops } = computeFgSegPlacement(common.sortEventSegs(props.fgEventSegs, options.eventOrder), props.dayMaxEvents, props.dayMaxEventRows, options.eventOrderStrict, state.eventInstanceHeights, state.maxContentHeight, props.cells);
|
|
496
|
+
let isForcedInvisible = // TODO: messy way to compute this
|
|
539
497
|
(props.eventDrag && props.eventDrag.affectedInstances) ||
|
|
540
498
|
(props.eventResize && props.eventResize.affectedInstances) ||
|
|
541
499
|
{};
|
|
542
500
|
return (common.createElement("tr", { ref: this.rootElRef, role: "row" },
|
|
543
501
|
props.renderIntro && props.renderIntro(),
|
|
544
|
-
props.cells.map(
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
return (common.createElement(TableCell, { key: cell.key, elRef:
|
|
502
|
+
props.cells.map((cell, col) => {
|
|
503
|
+
let normalFgNodes = this.renderFgSegs(col, props.forPrint ? singleColPlacements[col] : multiColPlacements[col], props.todayRange, isForcedInvisible);
|
|
504
|
+
let mirrorFgNodes = this.renderFgSegs(col, buildMirrorPlacements(mirrorSegsByCol[col], multiColPlacements), props.todayRange, {}, Boolean(props.eventDrag), Boolean(props.eventResize), false);
|
|
505
|
+
return (common.createElement(TableCell, { key: cell.key, elRef: this.cellElRefs.createRef(cell.key), innerElRef: this.frameElRefs.createRef(cell.key) /* FF <td> problem, but okay to use for left/right. TODO: rename prop */, dateProfile: props.dateProfile, date: cell.date, showDayNumber: props.showDayNumbers, showWeekNumber: props.showWeekNumbers && col === 0, forceDayTop: props.showWeekNumbers /* even displaying weeknum for row, not necessarily day */, todayRange: props.todayRange, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, extraHookProps: cell.extraHookProps, extraDataAttrs: cell.extraDataAttrs, extraClassNames: cell.extraClassNames, extraDateSpan: cell.extraDateSpan, moreCnt: moreCnts[col], moreMarginTop: moreMarginTops[col], singlePlacements: singleColPlacements[col], fgContentElRef: this.fgElRefs.createRef(cell.key), fgContent: ( // Fragment scopes the keys
|
|
548
506
|
common.createElement(common.Fragment, null,
|
|
549
507
|
common.createElement(common.Fragment, null, normalFgNodes),
|
|
550
508
|
common.createElement(common.Fragment, null, mirrorFgNodes))), bgContent: ( // Fragment scopes the keys
|
|
551
509
|
common.createElement(common.Fragment, null,
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
510
|
+
this.renderFillSegs(highlightSegsByCol[col], 'highlight'),
|
|
511
|
+
this.renderFillSegs(businessHoursByCol[col], 'non-business'),
|
|
512
|
+
this.renderFillSegs(bgEventSegsByCol[col], 'bg-event'))) }));
|
|
555
513
|
})));
|
|
556
|
-
}
|
|
557
|
-
|
|
514
|
+
}
|
|
515
|
+
componentDidMount() {
|
|
558
516
|
this.updateSizing(true);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
|
-
|
|
517
|
+
}
|
|
518
|
+
componentDidUpdate(prevProps, prevState) {
|
|
519
|
+
let currentProps = this.props;
|
|
562
520
|
this.updateSizing(!common.isPropsEqual(prevProps, currentProps));
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
|
|
521
|
+
}
|
|
522
|
+
getHighlightSegs() {
|
|
523
|
+
let { props } = this;
|
|
566
524
|
if (props.eventDrag && props.eventDrag.segs.length) { // messy check
|
|
567
525
|
return props.eventDrag.segs;
|
|
568
526
|
}
|
|
@@ -570,31 +528,30 @@ var TableRow = /** @class */ (function (_super) {
|
|
|
570
528
|
return props.eventResize.segs;
|
|
571
529
|
}
|
|
572
530
|
return props.dateSelectionSegs;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
|
|
531
|
+
}
|
|
532
|
+
getMirrorSegs() {
|
|
533
|
+
let { props } = this;
|
|
576
534
|
if (props.eventResize && props.eventResize.segs.length) { // messy check
|
|
577
535
|
return props.eventResize.segs;
|
|
578
536
|
}
|
|
579
537
|
return [];
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
538
|
+
}
|
|
539
|
+
renderFgSegs(col, segPlacements, todayRange, isForcedInvisible, isDragging, isResizing, isDateSelecting) {
|
|
540
|
+
let { context } = this;
|
|
541
|
+
let { eventSelection } = this.props;
|
|
542
|
+
let { framePositions } = this.state;
|
|
543
|
+
let defaultDisplayEventEnd = this.props.cells.length === 1; // colCnt === 1
|
|
544
|
+
let isMirror = isDragging || isResizing || isDateSelecting;
|
|
545
|
+
let nodes = [];
|
|
588
546
|
if (framePositions) {
|
|
589
|
-
for (
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
var right = '';
|
|
547
|
+
for (let placement of segPlacements) {
|
|
548
|
+
let { seg } = placement;
|
|
549
|
+
let { instanceId } = seg.eventRange.instance;
|
|
550
|
+
let key = instanceId + ':' + col;
|
|
551
|
+
let isVisible = placement.isVisible && !isForcedInvisible[instanceId];
|
|
552
|
+
let isAbsolute = placement.isAbsolute;
|
|
553
|
+
let left = '';
|
|
554
|
+
let right = '';
|
|
598
555
|
if (isAbsolute) {
|
|
599
556
|
if (context.isRtl) {
|
|
600
557
|
right = 0;
|
|
@@ -613,22 +570,21 @@ var TableRow = /** @class */ (function (_super) {
|
|
|
613
570
|
visibility: isVisible ? '' : 'hidden',
|
|
614
571
|
marginTop: isAbsolute ? '' : placement.marginTop,
|
|
615
572
|
top: isAbsolute ? placement.absoluteTop : '',
|
|
616
|
-
left
|
|
617
|
-
right
|
|
618
|
-
} }, hasListItemDisplay(seg) ? (common.createElement(TableListItemEvent,
|
|
573
|
+
left,
|
|
574
|
+
right,
|
|
575
|
+
} }, hasListItemDisplay(seg) ? (common.createElement(TableListItemEvent, Object.assign({ seg: seg, isDragging: isDragging, isSelected: instanceId === eventSelection, defaultDisplayEventEnd: defaultDisplayEventEnd }, common.getSegMeta(seg, todayRange)))) : (common.createElement(TableBlockEvent, Object.assign({ seg: seg, isDragging: isDragging, isResizing: isResizing, isDateSelecting: isDateSelecting, isSelected: instanceId === eventSelection, defaultDisplayEventEnd: defaultDisplayEventEnd }, common.getSegMeta(seg, todayRange))))));
|
|
619
576
|
}
|
|
620
577
|
}
|
|
621
578
|
return nodes;
|
|
622
|
-
}
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
579
|
+
}
|
|
580
|
+
renderFillSegs(segs, fillType) {
|
|
581
|
+
let { isRtl } = this.context;
|
|
582
|
+
let { todayRange } = this.props;
|
|
583
|
+
let { framePositions } = this.state;
|
|
584
|
+
let nodes = [];
|
|
628
585
|
if (framePositions) {
|
|
629
|
-
for (
|
|
630
|
-
|
|
631
|
-
var leftRightCss = isRtl ? {
|
|
586
|
+
for (let seg of segs) {
|
|
587
|
+
let leftRightCss = isRtl ? {
|
|
632
588
|
right: 0,
|
|
633
589
|
left: framePositions.lefts[seg.lastCol] - framePositions.lefts[seg.firstCol],
|
|
634
590
|
} : {
|
|
@@ -636,62 +592,61 @@ var TableRow = /** @class */ (function (_super) {
|
|
|
636
592
|
right: framePositions.rights[seg.firstCol] - framePositions.rights[seg.lastCol],
|
|
637
593
|
};
|
|
638
594
|
nodes.push(common.createElement("div", { key: common.buildEventRangeKey(seg.eventRange), className: "fc-daygrid-bg-harness", style: leftRightCss }, fillType === 'bg-event' ?
|
|
639
|
-
common.createElement(common.BgEvent,
|
|
595
|
+
common.createElement(common.BgEvent, Object.assign({ seg: seg }, common.getSegMeta(seg, todayRange))) :
|
|
640
596
|
common.renderFill(fillType)));
|
|
641
597
|
}
|
|
642
598
|
}
|
|
643
|
-
return common.createElement
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
|
|
599
|
+
return common.createElement(common.Fragment, {}, ...nodes);
|
|
600
|
+
}
|
|
601
|
+
updateSizing(isExternalSizingChange) {
|
|
602
|
+
let { props, frameElRefs } = this;
|
|
647
603
|
if (!props.forPrint &&
|
|
648
604
|
props.clientWidth !== null // positioning ready?
|
|
649
605
|
) {
|
|
650
606
|
if (isExternalSizingChange) {
|
|
651
|
-
|
|
607
|
+
let frameEls = props.cells.map((cell) => frameElRefs.currentMap[cell.key]);
|
|
652
608
|
if (frameEls.length) {
|
|
653
|
-
|
|
609
|
+
let originEl = this.rootElRef.current;
|
|
654
610
|
this.setState({
|
|
655
611
|
framePositions: new common.PositionCache(originEl, frameEls, true, // isHorizontal
|
|
656
612
|
false),
|
|
657
613
|
});
|
|
658
614
|
}
|
|
659
615
|
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
616
|
+
const oldInstanceHeights = this.state.eventInstanceHeights;
|
|
617
|
+
const newInstanceHeights = this.queryEventInstanceHeights();
|
|
618
|
+
const limitByContentHeight = props.dayMaxEvents === true || props.dayMaxEventRows === true;
|
|
663
619
|
this.safeSetState({
|
|
664
620
|
// HACK to prevent oscillations of events being shown/hidden from max-event-rows
|
|
665
621
|
// Essentially, once you compute an element's height, never null-out.
|
|
666
622
|
// TODO: always display all events, as visibility:hidden?
|
|
667
|
-
eventInstanceHeights:
|
|
623
|
+
eventInstanceHeights: Object.assign(Object.assign({}, oldInstanceHeights), newInstanceHeights),
|
|
668
624
|
maxContentHeight: limitByContentHeight ? this.computeMaxContentHeight() : null,
|
|
669
625
|
});
|
|
670
626
|
}
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
627
|
+
}
|
|
628
|
+
queryEventInstanceHeights() {
|
|
629
|
+
let segElMap = this.segHarnessRefs.currentMap;
|
|
630
|
+
let eventInstanceHeights = {};
|
|
675
631
|
// get the max height amongst instance segs
|
|
676
|
-
for (
|
|
677
|
-
|
|
678
|
-
|
|
632
|
+
for (let key in segElMap) {
|
|
633
|
+
let height = Math.round(segElMap[key].getBoundingClientRect().height);
|
|
634
|
+
let instanceId = key.split(':')[0]; // deconstruct how renderFgSegs makes the key
|
|
679
635
|
eventInstanceHeights[instanceId] = Math.max(eventInstanceHeights[instanceId] || 0, height);
|
|
680
636
|
}
|
|
681
637
|
return eventInstanceHeights;
|
|
682
|
-
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
638
|
+
}
|
|
639
|
+
computeMaxContentHeight() {
|
|
640
|
+
let firstKey = this.props.cells[0].key;
|
|
641
|
+
let cellEl = this.cellElRefs.currentMap[firstKey];
|
|
642
|
+
let fcContainerEl = this.fgElRefs.currentMap[firstKey];
|
|
687
643
|
return cellEl.getBoundingClientRect().bottom - fcContainerEl.getBoundingClientRect().top;
|
|
688
|
-
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
return this.props.cells.map(
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
}(common.DateComponent));
|
|
644
|
+
}
|
|
645
|
+
getCellEls() {
|
|
646
|
+
let elMap = this.cellElRefs.currentMap;
|
|
647
|
+
return this.props.cells.map((cell) => elMap[cell.key]);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
695
650
|
TableRow.addStateEquality({
|
|
696
651
|
eventInstanceHeights: common.isPropsEqual,
|
|
697
652
|
});
|
|
@@ -699,64 +654,59 @@ function buildMirrorPlacements(mirrorSegs, colPlacements) {
|
|
|
699
654
|
if (!mirrorSegs.length) {
|
|
700
655
|
return [];
|
|
701
656
|
}
|
|
702
|
-
|
|
703
|
-
return mirrorSegs.map(
|
|
704
|
-
seg
|
|
657
|
+
let topsByInstanceId = buildAbsoluteTopHash(colPlacements); // TODO: cache this at first render?
|
|
658
|
+
return mirrorSegs.map((seg) => ({
|
|
659
|
+
seg,
|
|
705
660
|
isVisible: true,
|
|
706
661
|
isAbsolute: true,
|
|
707
662
|
absoluteTop: topsByInstanceId[seg.eventRange.instance.instanceId],
|
|
708
663
|
marginTop: 0,
|
|
709
|
-
})
|
|
664
|
+
}));
|
|
710
665
|
}
|
|
711
666
|
function buildAbsoluteTopHash(colPlacements) {
|
|
712
|
-
|
|
713
|
-
for (
|
|
714
|
-
|
|
715
|
-
for (var _a = 0, placements_1 = placements; _a < placements_1.length; _a++) {
|
|
716
|
-
var placement = placements_1[_a];
|
|
667
|
+
let topsByInstanceId = {};
|
|
668
|
+
for (let placements of colPlacements) {
|
|
669
|
+
for (let placement of placements) {
|
|
717
670
|
topsByInstanceId[placement.seg.eventRange.instance.instanceId] = placement.absoluteTop;
|
|
718
671
|
}
|
|
719
672
|
}
|
|
720
673
|
return topsByInstanceId;
|
|
721
674
|
}
|
|
722
675
|
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
_this.rootEl = rootEl;
|
|
676
|
+
class Table extends common.DateComponent {
|
|
677
|
+
constructor() {
|
|
678
|
+
super(...arguments);
|
|
679
|
+
this.splitBusinessHourSegs = common.memoize(splitSegsByRow);
|
|
680
|
+
this.splitBgEventSegs = common.memoize(splitSegsByRow);
|
|
681
|
+
this.splitFgEventSegs = common.memoize(splitSegsByRow);
|
|
682
|
+
this.splitDateSelectionSegs = common.memoize(splitSegsByRow);
|
|
683
|
+
this.splitEventDrag = common.memoize(splitInteractionByRow);
|
|
684
|
+
this.splitEventResize = common.memoize(splitInteractionByRow);
|
|
685
|
+
this.rowRefs = new common.RefMap();
|
|
686
|
+
this.handleRootEl = (rootEl) => {
|
|
687
|
+
this.rootEl = rootEl;
|
|
736
688
|
if (rootEl) {
|
|
737
|
-
|
|
689
|
+
this.context.registerInteractiveComponent(this, {
|
|
738
690
|
el: rootEl,
|
|
739
|
-
isHitComboAllowed:
|
|
691
|
+
isHitComboAllowed: this.props.isHitComboAllowed,
|
|
740
692
|
});
|
|
741
693
|
}
|
|
742
694
|
else {
|
|
743
|
-
|
|
695
|
+
this.context.unregisterInteractiveComponent(this);
|
|
744
696
|
}
|
|
745
697
|
};
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
var eventResizeByRow = this.splitEventResize(props.eventResize, rowCnt);
|
|
759
|
-
var limitViaBalanced = dayMaxEvents === true || dayMaxEventRows === true;
|
|
698
|
+
}
|
|
699
|
+
render() {
|
|
700
|
+
let { props } = this;
|
|
701
|
+
let { dateProfile, dayMaxEventRows, dayMaxEvents, expandRows } = props;
|
|
702
|
+
let rowCnt = props.cells.length;
|
|
703
|
+
let businessHourSegsByRow = this.splitBusinessHourSegs(props.businessHourSegs, rowCnt);
|
|
704
|
+
let bgEventSegsByRow = this.splitBgEventSegs(props.bgEventSegs, rowCnt);
|
|
705
|
+
let fgEventSegsByRow = this.splitFgEventSegs(props.fgEventSegs, rowCnt);
|
|
706
|
+
let dateSelectionSegsByRow = this.splitDateSelectionSegs(props.dateSelectionSegs, rowCnt);
|
|
707
|
+
let eventDragByRow = this.splitEventDrag(props.eventDrag, rowCnt);
|
|
708
|
+
let eventResizeByRow = this.splitEventResize(props.eventResize, rowCnt);
|
|
709
|
+
let limitViaBalanced = dayMaxEvents === true || dayMaxEventRows === true;
|
|
760
710
|
// if rows can't expand to fill fixed height, can't do balanced-height event limit
|
|
761
711
|
// TODO: best place to normalize these options?
|
|
762
712
|
if (limitViaBalanced && !expandRows) {
|
|
@@ -764,7 +714,7 @@ var Table = /** @class */ (function (_super) {
|
|
|
764
714
|
dayMaxEventRows = null;
|
|
765
715
|
dayMaxEvents = null;
|
|
766
716
|
}
|
|
767
|
-
|
|
717
|
+
let classNames = [
|
|
768
718
|
'fc-daygrid-body',
|
|
769
719
|
limitViaBalanced ? 'fc-daygrid-body-balanced' : 'fc-daygrid-body-unbalanced',
|
|
770
720
|
expandRows ? '' : 'fc-daygrid-body-natural', // will height of one row depend on the others?
|
|
@@ -775,36 +725,36 @@ var Table = /** @class */ (function (_super) {
|
|
|
775
725
|
width: props.clientWidth,
|
|
776
726
|
minWidth: props.tableMinWidth,
|
|
777
727
|
} },
|
|
778
|
-
common.createElement(common.NowTimer, { unit: "day" },
|
|
728
|
+
common.createElement(common.NowTimer, { unit: "day" }, (nowDate, todayRange) => (common.createElement(common.Fragment, null,
|
|
779
729
|
common.createElement("table", { role: "presentation", className: "fc-scrollgrid-sync-table", style: {
|
|
780
730
|
width: props.clientWidth,
|
|
781
731
|
minWidth: props.tableMinWidth,
|
|
782
732
|
height: expandRows ? props.clientHeight : '',
|
|
783
733
|
} },
|
|
784
734
|
props.colGroupNode,
|
|
785
|
-
common.createElement("tbody", { role: "presentation" }, props.cells.map(
|
|
735
|
+
common.createElement("tbody", { role: "presentation" }, props.cells.map((cells, row) => (common.createElement(TableRow, { ref: this.rowRefs.createRef(row), key: cells.length
|
|
786
736
|
? cells[0].date.toISOString() /* best? or put key on cell? or use diff formatter? */
|
|
787
737
|
: row // in case there are no cells (like when resource view is loading)
|
|
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 }))
|
|
789
|
-
}
|
|
738
|
+
, 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 }))))))))));
|
|
739
|
+
}
|
|
790
740
|
// Hit System
|
|
791
741
|
// ----------------------------------------------------------------------------------------------------
|
|
792
|
-
|
|
793
|
-
this.rowPositions = new common.PositionCache(this.rootEl, this.rowRefs.collect().map(
|
|
742
|
+
prepareHits() {
|
|
743
|
+
this.rowPositions = new common.PositionCache(this.rootEl, this.rowRefs.collect().map((rowObj) => rowObj.getCellEls()[0]), // first cell el in each row. TODO: not optimal
|
|
794
744
|
false, true);
|
|
795
745
|
this.colPositions = new common.PositionCache(this.rootEl, this.rowRefs.currentMap[0].getCellEls(), // cell els in first row
|
|
796
746
|
true, // horizontal
|
|
797
747
|
false);
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
748
|
+
}
|
|
749
|
+
queryHit(positionLeft, positionTop) {
|
|
750
|
+
let { colPositions, rowPositions } = this;
|
|
751
|
+
let col = colPositions.leftToIndex(positionLeft);
|
|
752
|
+
let row = rowPositions.topToIndex(positionTop);
|
|
803
753
|
if (row != null && col != null) {
|
|
804
|
-
|
|
754
|
+
let cell = this.props.cells[row][col];
|
|
805
755
|
return {
|
|
806
756
|
dateProfile: this.props.dateProfile,
|
|
807
|
-
dateSpan:
|
|
757
|
+
dateSpan: Object.assign({ range: this.getCellRange(row, col), allDay: true }, cell.extraDateSpan),
|
|
808
758
|
dayEl: this.getCellEl(row, col),
|
|
809
759
|
rect: {
|
|
810
760
|
left: colPositions.lefts[col],
|
|
@@ -816,88 +766,73 @@ var Table = /** @class */ (function (_super) {
|
|
|
816
766
|
};
|
|
817
767
|
}
|
|
818
768
|
return null;
|
|
819
|
-
}
|
|
820
|
-
|
|
769
|
+
}
|
|
770
|
+
getCellEl(row, col) {
|
|
821
771
|
return this.rowRefs.currentMap[row].getCellEls()[col]; // TODO: not optimal
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
return { start
|
|
827
|
-
}
|
|
828
|
-
|
|
829
|
-
}(common.DateComponent));
|
|
772
|
+
}
|
|
773
|
+
getCellRange(row, col) {
|
|
774
|
+
let start = this.props.cells[row][col].date;
|
|
775
|
+
let end = common.addDays(start, 1);
|
|
776
|
+
return { start, end };
|
|
777
|
+
}
|
|
778
|
+
}
|
|
830
779
|
function isSegAllDay(seg) {
|
|
831
780
|
return seg.eventRange.def.allDay;
|
|
832
781
|
}
|
|
833
782
|
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
}
|
|
841
|
-
DayTableSlicer.prototype.sliceRange = function (dateRange, dayTableModel) {
|
|
783
|
+
class DayTableSlicer extends common.Slicer {
|
|
784
|
+
constructor() {
|
|
785
|
+
super(...arguments);
|
|
786
|
+
this.forceDayIfListItem = true;
|
|
787
|
+
}
|
|
788
|
+
sliceRange(dateRange, dayTableModel) {
|
|
842
789
|
return dayTableModel.sliceRange(dateRange);
|
|
843
|
-
}
|
|
844
|
-
|
|
845
|
-
}(common.Slicer));
|
|
790
|
+
}
|
|
791
|
+
}
|
|
846
792
|
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
};
|
|
859
|
-
return DayTable;
|
|
860
|
-
}(common.DateComponent));
|
|
793
|
+
class DayTable extends common.DateComponent {
|
|
794
|
+
constructor() {
|
|
795
|
+
super(...arguments);
|
|
796
|
+
this.slicer = new DayTableSlicer();
|
|
797
|
+
this.tableRef = common.createRef();
|
|
798
|
+
}
|
|
799
|
+
render() {
|
|
800
|
+
let { props, context } = this;
|
|
801
|
+
return (common.createElement(Table, Object.assign({ ref: this.tableRef }, this.slicer.sliceProps(props, props.dateProfile, props.nextDayThreshold, context, props.dayTableModel), { dateProfile: props.dateProfile, cells: props.dayTableModel.cells, colGroupNode: props.colGroupNode, tableMinWidth: props.tableMinWidth, renderRowIntro: props.renderRowIntro, dayMaxEvents: props.dayMaxEvents, dayMaxEventRows: props.dayMaxEventRows, showWeekNumbers: props.showWeekNumbers, expandRows: props.expandRows, headerAlignElRef: props.headerAlignElRef, clientWidth: props.clientWidth, clientHeight: props.clientHeight, forPrint: props.forPrint })));
|
|
802
|
+
}
|
|
803
|
+
}
|
|
861
804
|
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
var dayTableModel = this.buildDayTableModel(props.dateProfile, dateProfileGenerator);
|
|
876
|
-
var headerContent = options.dayHeaders && (common.createElement(common.DayHeader, { ref: this.headerRef, dateProfile: props.dateProfile, dates: dayTableModel.headerDates, datesRepDistinctDays: dayTableModel.rowCnt === 1 }));
|
|
877
|
-
var bodyContent = function (contentArg) { return (common.createElement(DayTable, { ref: _this.tableRef, dateProfile: props.dateProfile, dayTableModel: dayTableModel, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, nextDayThreshold: options.nextDayThreshold, colGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, dayMaxEvents: options.dayMaxEvents, dayMaxEventRows: options.dayMaxEventRows, showWeekNumbers: options.weekNumbers, expandRows: !props.isHeightAuto, headerAlignElRef: _this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint })); };
|
|
805
|
+
class DayTableView extends TableView {
|
|
806
|
+
constructor() {
|
|
807
|
+
super(...arguments);
|
|
808
|
+
this.buildDayTableModel = common.memoize(buildDayTableModel);
|
|
809
|
+
this.headerRef = common.createRef();
|
|
810
|
+
this.tableRef = common.createRef();
|
|
811
|
+
}
|
|
812
|
+
render() {
|
|
813
|
+
let { options, dateProfileGenerator } = this.context;
|
|
814
|
+
let { props } = this;
|
|
815
|
+
let dayTableModel = this.buildDayTableModel(props.dateProfile, dateProfileGenerator);
|
|
816
|
+
let headerContent = options.dayHeaders && (common.createElement(common.DayHeader, { ref: this.headerRef, dateProfile: props.dateProfile, dates: dayTableModel.headerDates, datesRepDistinctDays: dayTableModel.rowCnt === 1 }));
|
|
817
|
+
let bodyContent = (contentArg) => (common.createElement(DayTable, { ref: this.tableRef, dateProfile: props.dateProfile, dayTableModel: dayTableModel, businessHours: props.businessHours, dateSelection: props.dateSelection, eventStore: props.eventStore, eventUiBases: props.eventUiBases, eventSelection: props.eventSelection, eventDrag: props.eventDrag, eventResize: props.eventResize, nextDayThreshold: options.nextDayThreshold, colGroupNode: contentArg.tableColGroupNode, tableMinWidth: contentArg.tableMinWidth, dayMaxEvents: options.dayMaxEvents, dayMaxEventRows: options.dayMaxEventRows, showWeekNumbers: options.weekNumbers, expandRows: !props.isHeightAuto, headerAlignElRef: this.headerElRef, clientWidth: contentArg.clientWidth, clientHeight: contentArg.clientHeight, forPrint: props.forPrint }));
|
|
878
818
|
return options.dayMinWidth
|
|
879
819
|
? this.renderHScrollLayout(headerContent, bodyContent, dayTableModel.colCnt, options.dayMinWidth)
|
|
880
820
|
: this.renderSimpleLayout(headerContent, bodyContent);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
}(TableView));
|
|
821
|
+
}
|
|
822
|
+
}
|
|
884
823
|
function buildDayTableModel(dateProfile, dateProfileGenerator) {
|
|
885
|
-
|
|
824
|
+
let daySeries = new common.DaySeriesModel(dateProfile.renderRange, dateProfileGenerator);
|
|
886
825
|
return new common.DayTableModel(daySeries, /year|month|week/.test(dateProfile.currentRangeUnit));
|
|
887
826
|
}
|
|
888
827
|
|
|
889
|
-
|
|
890
|
-
tslib.__extends(TableDateProfileGenerator, _super);
|
|
891
|
-
function TableDateProfileGenerator() {
|
|
892
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
893
|
-
}
|
|
828
|
+
class TableDateProfileGenerator extends common.DateProfileGenerator {
|
|
894
829
|
// Computes the date range that will be rendered.
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
830
|
+
buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay) {
|
|
831
|
+
let { dateEnv } = this.props;
|
|
832
|
+
let renderRange = super.buildRenderRange(currentRange, currentRangeUnit, isRangeAllDay);
|
|
833
|
+
let start = renderRange.start;
|
|
834
|
+
let end = renderRange.end;
|
|
835
|
+
let endOfWeek;
|
|
901
836
|
// year and month views should be aligned with weeks. this is already done for week
|
|
902
837
|
if (/^(year|month)$/.test(currentRangeUnit)) {
|
|
903
838
|
start = dateEnv.startOfWeek(start);
|
|
@@ -910,14 +845,43 @@ var TableDateProfileGenerator = /** @class */ (function (_super) {
|
|
|
910
845
|
// ensure 6 weeks
|
|
911
846
|
if (this.props.monthMode &&
|
|
912
847
|
this.props.fixedWeekCount) {
|
|
913
|
-
|
|
848
|
+
let rowCnt = Math.ceil(// could be partial weeks due to hiddenDays
|
|
914
849
|
common.diffWeeks(start, end));
|
|
915
850
|
end = common.addWeeks(end, 6 - rowCnt);
|
|
916
851
|
}
|
|
917
|
-
return { start
|
|
918
|
-
}
|
|
919
|
-
|
|
920
|
-
|
|
852
|
+
return { start, end };
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function styleInject(css, ref) {
|
|
857
|
+
if ( ref === void 0 ) ref = {};
|
|
858
|
+
var insertAt = ref.insertAt;
|
|
859
|
+
|
|
860
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
861
|
+
|
|
862
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
863
|
+
var style = document.createElement('style');
|
|
864
|
+
style.type = 'text/css';
|
|
865
|
+
|
|
866
|
+
if (insertAt === 'top') {
|
|
867
|
+
if (head.firstChild) {
|
|
868
|
+
head.insertBefore(style, head.firstChild);
|
|
869
|
+
} else {
|
|
870
|
+
head.appendChild(style);
|
|
871
|
+
}
|
|
872
|
+
} else {
|
|
873
|
+
head.appendChild(style);
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
if (style.styleSheet) {
|
|
877
|
+
style.styleSheet.cssText = css;
|
|
878
|
+
} else {
|
|
879
|
+
style.appendChild(document.createTextNode(css));
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
var css_248z = "\n:root {\n --fc-daygrid-event-dot-width: 8px;\n}\n/* help things clear margins of inner content */\n.fc-daygrid-day-frame,\n.fc-daygrid-day-events,\n.fc-daygrid-event-harness { /* for event top/bottom margins */\n}\n.fc-daygrid-day-frame:before, .fc-daygrid-day-events:before, .fc-daygrid-event-harness:before {\n content: \"\";\n clear: both;\n display: table; }\n.fc-daygrid-day-frame:after, .fc-daygrid-day-events:after, .fc-daygrid-event-harness:after {\n content: \"\";\n clear: both;\n display: table; }\n.fc .fc-daygrid-body { /* a <div> that wraps the table */\n position: relative;\n z-index: 1; /* container inner z-index's because <tr>s can't do it */\n }\n.fc .fc-daygrid-day.fc-day-today {\n background-color: rgba(255, 220, 40, 0.15);\n background-color: var(--fc-today-bg-color, rgba(255, 220, 40, 0.15));\n }\n.fc .fc-daygrid-day-frame {\n position: relative;\n min-height: 100%; /* seems to work better than `height` because sets height after rows/cells naturally do it */\n }\n.fc {\n\n /* cell top */\n\n}\n.fc .fc-daygrid-day-top {\n display: flex;\n flex-direction: row-reverse;\n }\n.fc .fc-day-other .fc-daygrid-day-top {\n opacity: 0.3;\n }\n.fc {\n\n /* day number (within cell top) */\n\n}\n.fc .fc-daygrid-day-number {\n position: relative;\n z-index: 4;\n padding: 4px;\n }\n.fc {\n\n /* event container */\n\n}\n.fc .fc-daygrid-day-events {\n margin-top: 1px; /* needs to be margin, not padding, so that available cell height can be computed */\n }\n.fc {\n\n /* positioning for balanced vs natural */\n\n}\n.fc .fc-daygrid-body-balanced .fc-daygrid-day-events {\n position: absolute;\n left: 0;\n right: 0;\n }\n.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events {\n position: relative; /* for containing abs positioned event harnesses */\n min-height: 2em; /* in addition to being a min-height during natural height, equalizes the heights a little bit */\n }\n.fc .fc-daygrid-body-natural { /* can coexist with -unbalanced */\n }\n.fc .fc-daygrid-body-natural .fc-daygrid-day-events {\n margin-bottom: 1em;\n }\n.fc {\n\n /* event harness */\n\n}\n.fc .fc-daygrid-event-harness {\n position: relative;\n }\n.fc .fc-daygrid-event-harness-abs {\n position: absolute;\n top: 0; /* fallback coords for when cannot yet be computed */\n left: 0; /* */\n right: 0; /* */\n }\n.fc .fc-daygrid-bg-harness {\n position: absolute;\n top: 0;\n bottom: 0;\n }\n.fc {\n\n /* bg content */\n\n}\n.fc .fc-daygrid-day-bg .fc-non-business { z-index: 1 }\n.fc .fc-daygrid-day-bg .fc-bg-event { z-index: 2 }\n.fc .fc-daygrid-day-bg .fc-highlight { z-index: 3 }\n.fc {\n\n /* events */\n\n}\n.fc .fc-daygrid-event {\n z-index: 6;\n margin-top: 1px;\n }\n.fc .fc-daygrid-event.fc-event-mirror {\n z-index: 7;\n }\n.fc {\n\n /* cell bottom (within day-events) */\n\n}\n.fc .fc-daygrid-day-bottom {\n font-size: .85em;\n padding: 2px 3px 0\n }\n.fc .fc-daygrid-day-bottom:before {\n content: \"\";\n clear: both;\n display: table; }\n.fc .fc-daygrid-more-link {\n position: relative;\n z-index: 4;\n cursor: pointer;\n }\n.fc {\n\n /* week number (within frame) */\n\n}\n.fc .fc-daygrid-week-number {\n position: absolute;\n z-index: 5;\n top: 0;\n padding: 2px;\n min-width: 1.5em;\n text-align: center;\n background-color: rgba(208, 208, 208, 0.3);\n background-color: var(--fc-neutral-bg-color, rgba(208, 208, 208, 0.3));\n color: #808080;\n color: var(--fc-neutral-text-color, #808080);\n }\n.fc {\n\n /* popover */\n\n}\n.fc .fc-more-popover .fc-popover-body {\n min-width: 220px;\n padding: 10px;\n }\n.fc-direction-ltr .fc-daygrid-event.fc-event-start,\n.fc-direction-rtl .fc-daygrid-event.fc-event-end {\n margin-left: 2px;\n}\n.fc-direction-ltr .fc-daygrid-event.fc-event-end,\n.fc-direction-rtl .fc-daygrid-event.fc-event-start {\n margin-right: 2px;\n}\n.fc-direction-ltr .fc-daygrid-week-number {\n left: 0;\n border-radius: 0 0 3px 0;\n }\n.fc-direction-rtl .fc-daygrid-week-number {\n right: 0;\n border-radius: 0 0 0 3px;\n }\n.fc-liquid-hack .fc-daygrid-day-frame {\n position: static; /* will cause inner absolute stuff to expand to <td> */\n }\n.fc-daygrid-event { /* make root-level, because will be dragged-and-dropped outside of a component root */\n position: relative; /* for z-indexes assigned later */\n white-space: nowrap;\n border-radius: 3px; /* dot event needs this to when selected */\n font-size: .85em;\n font-size: var(--fc-small-font-size, .85em);\n}\n/* --- the rectangle (\"block\") style of event --- */\n.fc-daygrid-block-event .fc-event-time {\n font-weight: bold;\n }\n.fc-daygrid-block-event .fc-event-time,\n .fc-daygrid-block-event .fc-event-title {\n padding: 1px;\n }\n/* --- the dot style of event --- */\n.fc-daygrid-dot-event {\n display: flex;\n align-items: center;\n padding: 2px 0\n\n}\n.fc-daygrid-dot-event .fc-event-title {\n flex-grow: 1;\n flex-shrink: 1;\n min-width: 0; /* important for allowing to shrink all the way */\n overflow: hidden;\n font-weight: bold;\n }\n.fc-daygrid-dot-event:hover,\n .fc-daygrid-dot-event.fc-event-mirror {\n background: rgba(0, 0, 0, 0.1);\n }\n.fc-daygrid-dot-event.fc-event-selected:before {\n /* expand hit area */\n top: -10px;\n bottom: -10px;\n }\n.fc-daygrid-event-dot { /* the actual dot */\n margin: 0 4px;\n box-sizing: content-box;\n width: 0;\n height: 0;\n border: 4px solid #3788d8;\n border: calc(var(--fc-daygrid-event-dot-width, 8px) / 2) solid var(--fc-event-border-color, #3788d8);\n border-radius: 4px;\n border-radius: calc(var(--fc-daygrid-event-dot-width, 8px) / 2);\n}\n/* --- spacing between time and title --- */\n.fc-direction-ltr .fc-daygrid-event .fc-event-time {\n margin-right: 3px;\n }\n.fc-direction-rtl .fc-daygrid-event .fc-event-time {\n margin-left: 3px;\n }\n";
|
|
884
|
+
styleInject(css_248z);
|
|
921
885
|
|
|
922
886
|
var main = common.createPlugin({
|
|
923
887
|
initialView: 'dayGridMonth',
|