mirror of
https://github.com/itflow-org/itflow
synced 2026-03-01 03:14:52 +00:00
Updated AdminLTE to 3.04 assets, added search to side bar, added company select drop down on sidebar. removed extra delete under edit contact
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*!
|
||||
FullCalendar Time Grid Plugin v4.3.0
|
||||
FullCalendar Time Grid Plugin v4.4.0
|
||||
Docs & License: https://fullcalendar.io/
|
||||
(c) 2019 Adam Shaw
|
||||
*/
|
||||
@@ -57,15 +57,19 @@ Docs & License: https://fullcalendar.io/
|
||||
var TimeGridEventRenderer = /** @class */ (function (_super) {
|
||||
__extends(TimeGridEventRenderer, _super);
|
||||
function TimeGridEventRenderer(timeGrid) {
|
||||
var _this = _super.call(this, timeGrid.context) || this;
|
||||
var _this = _super.call(this) || this;
|
||||
_this.timeGrid = timeGrid;
|
||||
_this.fullTimeFormat = core.createFormatter({
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
separator: _this.context.options.defaultRangeSeparator
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
TimeGridEventRenderer.prototype.renderSegs = function (context, segs, mirrorInfo) {
|
||||
_super.prototype.renderSegs.call(this, context, segs, mirrorInfo);
|
||||
// TODO: dont do every time. memoize
|
||||
this.fullTimeFormat = core.createFormatter({
|
||||
hour: 'numeric',
|
||||
minute: '2-digit',
|
||||
separator: this.context.options.defaultRangeSeparator
|
||||
});
|
||||
};
|
||||
// Given an array of foreground segments, render a DOM element for each, computes position,
|
||||
// and attaches to the column inner-container elements.
|
||||
TimeGridEventRenderer.prototype.attachSegs = function (segs, mirrorInfo) {
|
||||
@@ -118,14 +122,13 @@ Docs & License: https://fullcalendar.io/
|
||||
};
|
||||
// Renders the HTML for a single event segment's default rendering
|
||||
TimeGridEventRenderer.prototype.renderSegHtml = function (seg, mirrorInfo) {
|
||||
var view = this.context.view;
|
||||
var eventRange = seg.eventRange;
|
||||
var eventDef = eventRange.def;
|
||||
var eventUi = eventRange.ui;
|
||||
var allDay = eventDef.allDay;
|
||||
var isDraggable = view.computeEventDraggable(eventDef, eventUi);
|
||||
var isResizableFromStart = seg.isStart && view.computeEventStartResizable(eventDef, eventUi);
|
||||
var isResizableFromEnd = seg.isEnd && view.computeEventEndResizable(eventDef, eventUi);
|
||||
var isDraggable = core.computeEventDraggable(this.context, eventDef, eventUi);
|
||||
var isResizableFromStart = seg.isStart && core.computeEventStartResizable(this.context, eventDef, eventUi);
|
||||
var isResizableFromEnd = seg.isEnd && core.computeEventEndResizable(this.context, eventDef, eventUi);
|
||||
var classes = this.getSegClasses(seg, isDraggable, isResizableFromStart || isResizableFromEnd, mirrorInfo);
|
||||
var skinCss = core.cssToStr(this.getSkinCss(eventUi));
|
||||
var timeText;
|
||||
@@ -245,7 +248,7 @@ Docs & License: https://fullcalendar.io/
|
||||
{ field: 'forwardPressure', order: -1 },
|
||||
// put segments that are closer to initial edge first (and favor ones with no coords yet)
|
||||
{ field: 'backwardCoord', order: 1 }
|
||||
].concat(this.context.view.eventOrderSpecs);
|
||||
].concat(this.context.eventOrderSpecs);
|
||||
objs.sort(function (obj0, obj1) {
|
||||
return core.compareByFieldSpecs(obj0, obj1, specs);
|
||||
});
|
||||
@@ -276,7 +279,7 @@ Docs & License: https://fullcalendar.io/
|
||||
var backwardCoord = seg.backwardCoord; // the left side if LTR. the right side if RTL. floating-point
|
||||
var forwardCoord = seg.forwardCoord; // the right side if LTR. the left side if RTL. floating-point
|
||||
var props = this.timeGrid.generateSegVerticalCss(seg); // get top/bottom first
|
||||
var isRtl = this.timeGrid.isRtl;
|
||||
var isRtl = this.context.isRtl;
|
||||
var left; // amount of space from left edge, a fraction of the total width
|
||||
var right; // amount of space from right edge, a fraction of the total width
|
||||
if (shouldOverlap) {
|
||||
@@ -410,7 +413,7 @@ Docs & License: https://fullcalendar.io/
|
||||
var TimeGridFillRenderer = /** @class */ (function (_super) {
|
||||
__extends(TimeGridFillRenderer, _super);
|
||||
function TimeGridFillRenderer(timeGrid) {
|
||||
var _this = _super.call(this, timeGrid.context) || this;
|
||||
var _this = _super.call(this) || this;
|
||||
_this.timeGrid = timeGrid;
|
||||
return _this;
|
||||
}
|
||||
@@ -454,15 +457,19 @@ Docs & License: https://fullcalendar.io/
|
||||
];
|
||||
var TimeGrid = /** @class */ (function (_super) {
|
||||
__extends(TimeGrid, _super);
|
||||
function TimeGrid(context, el, renderProps) {
|
||||
var _this = _super.call(this, context, el) || this;
|
||||
function TimeGrid(el, renderProps) {
|
||||
var _this = _super.call(this, el) || this;
|
||||
_this.isSlatSizesDirty = false;
|
||||
_this.isColSizesDirty = false;
|
||||
_this.renderSlats = core.memoizeRendering(_this._renderSlats);
|
||||
_this.processOptions = core.memoize(_this._processOptions);
|
||||
_this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton);
|
||||
_this.renderSlats = core.memoizeRendering(_this._renderSlats, null, [_this.renderSkeleton]);
|
||||
_this.renderColumns = core.memoizeRendering(_this._renderColumns, _this._unrenderColumns, [_this.renderSkeleton]);
|
||||
_this.renderProps = renderProps;
|
||||
var renderColumns = _this.renderColumns;
|
||||
var eventRenderer = _this.eventRenderer = new TimeGridEventRenderer(_this);
|
||||
var fillRenderer = _this.fillRenderer = new TimeGridFillRenderer(_this);
|
||||
_this.mirrorRenderer = new TimeGridMirrorRenderer(_this);
|
||||
var renderColumns = _this.renderColumns = core.memoizeRendering(_this._renderColumns, _this._unrenderColumns);
|
||||
_this.renderBusinessHours = core.memoizeRendering(fillRenderer.renderSegs.bind(fillRenderer, 'businessHours'), fillRenderer.unrender.bind(fillRenderer, 'businessHours'), [renderColumns]);
|
||||
_this.renderDateSelection = core.memoizeRendering(_this._renderDateSelection, _this._unrenderDateSelection, [renderColumns]);
|
||||
_this.renderFgEvents = core.memoizeRendering(eventRenderer.renderSegs.bind(eventRenderer), eventRenderer.unrender.bind(eventRenderer), [renderColumns]);
|
||||
@@ -470,23 +477,14 @@ Docs & License: https://fullcalendar.io/
|
||||
_this.renderEventSelection = core.memoizeRendering(eventRenderer.selectByInstanceId.bind(eventRenderer), eventRenderer.unselectByInstanceId.bind(eventRenderer), [_this.renderFgEvents]);
|
||||
_this.renderEventDrag = core.memoizeRendering(_this._renderEventDrag, _this._unrenderEventDrag, [renderColumns]);
|
||||
_this.renderEventResize = core.memoizeRendering(_this._renderEventResize, _this._unrenderEventResize, [renderColumns]);
|
||||
_this.processOptions();
|
||||
el.innerHTML =
|
||||
'<div class="fc-bg"></div>' +
|
||||
'<div class="fc-slats"></div>' +
|
||||
'<hr class="fc-divider ' + _this.theme.getClass('widgetHeader') + '" style="display:none" />';
|
||||
_this.rootBgContainerEl = el.querySelector('.fc-bg');
|
||||
_this.slatContainerEl = el.querySelector('.fc-slats');
|
||||
_this.bottomRuleEl = el.querySelector('.fc-divider');
|
||||
_this.renderProps = renderProps;
|
||||
return _this;
|
||||
}
|
||||
/* Options
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Parses various options into properties of this object
|
||||
TimeGrid.prototype.processOptions = function () {
|
||||
var slotDuration = this.opt('slotDuration');
|
||||
var snapDuration = this.opt('snapDuration');
|
||||
// MUST have context already set
|
||||
TimeGrid.prototype._processOptions = function (options) {
|
||||
var slotDuration = options.slotDuration, snapDuration = options.snapDuration;
|
||||
var snapsPerSlot;
|
||||
var input;
|
||||
slotDuration = core.createDuration(slotDuration);
|
||||
@@ -502,7 +500,7 @@ Docs & License: https://fullcalendar.io/
|
||||
this.snapsPerSlot = snapsPerSlot;
|
||||
// might be an array value (for TimelineView).
|
||||
// if so, getting the most granular entry (the last one probably).
|
||||
input = this.opt('slotLabelFormat');
|
||||
input = options.slotLabelFormat;
|
||||
if (Array.isArray(input)) {
|
||||
input = input[input.length - 1];
|
||||
}
|
||||
@@ -512,7 +510,7 @@ Docs & License: https://fullcalendar.io/
|
||||
omitZeroMinute: true,
|
||||
meridiem: 'short'
|
||||
});
|
||||
input = this.opt('slotLabelInterval');
|
||||
input = options.slotLabelInterval;
|
||||
this.labelInterval = input ?
|
||||
core.createDuration(input) :
|
||||
this.computeLabelInterval(slotDuration);
|
||||
@@ -534,15 +532,17 @@ Docs & License: https://fullcalendar.io/
|
||||
};
|
||||
/* Rendering
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
TimeGrid.prototype.render = function (props) {
|
||||
TimeGrid.prototype.render = function (props, context) {
|
||||
this.processOptions(context.options);
|
||||
var cells = props.cells;
|
||||
this.colCnt = cells.length;
|
||||
this.renderSkeleton(context.theme);
|
||||
this.renderSlats(props.dateProfile);
|
||||
this.renderColumns(props.cells, props.dateProfile);
|
||||
this.renderBusinessHours(props.businessHourSegs);
|
||||
this.renderBusinessHours(context, props.businessHourSegs);
|
||||
this.renderDateSelection(props.dateSelectionSegs);
|
||||
this.renderFgEvents(props.fgEventSegs);
|
||||
this.renderBgEvents(props.bgEventSegs);
|
||||
this.renderFgEvents(context, props.fgEventSegs);
|
||||
this.renderBgEvents(context, props.bgEventSegs);
|
||||
this.renderEventSelection(props.eventSelection);
|
||||
this.renderEventDrag(props.eventDrag);
|
||||
this.renderEventResize(props.eventResize);
|
||||
@@ -552,6 +552,7 @@ Docs & License: https://fullcalendar.io/
|
||||
// should unrender everything else too
|
||||
this.renderSlats.unrender();
|
||||
this.renderColumns.unrender();
|
||||
this.renderSkeleton.unrender();
|
||||
};
|
||||
TimeGrid.prototype.updateSize = function (isResize) {
|
||||
var _a = this, fillRenderer = _a.fillRenderer, eventRenderer = _a.eventRenderer, mirrorRenderer = _a.mirrorRenderer;
|
||||
@@ -570,8 +571,18 @@ Docs & License: https://fullcalendar.io/
|
||||
eventRenderer.assignSizes(isResize);
|
||||
mirrorRenderer.assignSizes(isResize);
|
||||
};
|
||||
TimeGrid.prototype._renderSkeleton = function (theme) {
|
||||
var el = this.el;
|
||||
el.innerHTML =
|
||||
'<div class="fc-bg"></div>' +
|
||||
'<div class="fc-slats"></div>' +
|
||||
'<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" style="display:none" />';
|
||||
this.rootBgContainerEl = el.querySelector('.fc-bg');
|
||||
this.slatContainerEl = el.querySelector('.fc-slats');
|
||||
this.bottomRuleEl = el.querySelector('.fc-divider');
|
||||
};
|
||||
TimeGrid.prototype._renderSlats = function (dateProfile) {
|
||||
var theme = this.theme;
|
||||
var theme = this.context.theme;
|
||||
this.slatContainerEl.innerHTML =
|
||||
'<table class="' + theme.getClass('tableGrid') + '">' +
|
||||
this.renderSlatRowHtml(dateProfile) +
|
||||
@@ -583,7 +594,7 @@ Docs & License: https://fullcalendar.io/
|
||||
};
|
||||
// Generates the HTML for the horizontal "slats" that run width-wise. Has a time axis on a side. Depends on RTL.
|
||||
TimeGrid.prototype.renderSlatRowHtml = function (dateProfile) {
|
||||
var _a = this, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl;
|
||||
var _a = this.context, dateEnv = _a.dateEnv, theme = _a.theme, isRtl = _a.isRtl;
|
||||
var html = '';
|
||||
var dayStart = core.startOfDay(dateProfile.renderRange.start);
|
||||
var slotTime = dateProfile.minTime;
|
||||
@@ -617,7 +628,7 @@ Docs & License: https://fullcalendar.io/
|
||||
return html;
|
||||
};
|
||||
TimeGrid.prototype._renderColumns = function (cells, dateProfile) {
|
||||
var _a = this, theme = _a.theme, dateEnv = _a.dateEnv, view = _a.view;
|
||||
var _a = this.context, calendar = _a.calendar, view = _a.view, isRtl = _a.isRtl, theme = _a.theme, dateEnv = _a.dateEnv;
|
||||
var bgRow = new daygrid.DayBgRow(this.context);
|
||||
this.rootBgContainerEl.innerHTML =
|
||||
'<table class="' + theme.getClass('tableGrid') + '">' +
|
||||
@@ -629,7 +640,7 @@ Docs & License: https://fullcalendar.io/
|
||||
'</table>';
|
||||
this.colEls = core.findElements(this.el, '.fc-day, .fc-disabled-day');
|
||||
for (var col = 0; col < this.colCnt; col++) {
|
||||
this.publiclyTrigger('dayRender', [
|
||||
calendar.publiclyTrigger('dayRender', [
|
||||
{
|
||||
date: dateEnv.toDate(cells[col].date),
|
||||
el: this.colEls[col],
|
||||
@@ -637,7 +648,7 @@ Docs & License: https://fullcalendar.io/
|
||||
}
|
||||
]);
|
||||
}
|
||||
if (this.isRtl) {
|
||||
if (isRtl) {
|
||||
this.colEls.reverse();
|
||||
}
|
||||
this.colPositions = new core.PositionCache(this.el, this.colEls, true, // horizontal
|
||||
@@ -652,6 +663,7 @@ Docs & License: https://fullcalendar.io/
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Renders the DOM that the view's content will live in
|
||||
TimeGrid.prototype.renderContentSkeleton = function () {
|
||||
var isRtl = this.context.isRtl;
|
||||
var parts = [];
|
||||
var skeletonEl;
|
||||
parts.push(this.renderProps.renderIntroHtml());
|
||||
@@ -666,7 +678,7 @@ Docs & License: https://fullcalendar.io/
|
||||
'</div>' +
|
||||
'</td>');
|
||||
}
|
||||
if (this.isRtl) {
|
||||
if (isRtl) {
|
||||
parts.reverse();
|
||||
}
|
||||
skeletonEl = this.contentSkeletonEl = core.htmlToElement('<div class="fc-content-skeleton">' +
|
||||
@@ -680,7 +692,7 @@ Docs & License: https://fullcalendar.io/
|
||||
this.bgContainerEls = core.findElements(skeletonEl, '.fc-bgevent-container');
|
||||
this.highlightContainerEls = core.findElements(skeletonEl, '.fc-highlight-container');
|
||||
this.businessContainerEls = core.findElements(skeletonEl, '.fc-business-container');
|
||||
if (this.isRtl) {
|
||||
if (isRtl) {
|
||||
this.colContainerEls.reverse();
|
||||
this.mirrorContainerEls.reverse();
|
||||
this.fgContainerEls.reverse();
|
||||
@@ -790,7 +802,8 @@ Docs & License: https://fullcalendar.io/
|
||||
};
|
||||
// For each segment in an array, computes and assigns its top and bottom properties
|
||||
TimeGrid.prototype.computeSegVerticals = function (segs) {
|
||||
var eventMinHeight = this.opt('timeGridEventMinHeight');
|
||||
var options = this.context.options;
|
||||
var eventMinHeight = options.timeGridEventMinHeight;
|
||||
var i;
|
||||
var seg;
|
||||
var dayDate;
|
||||
@@ -833,7 +846,8 @@ Docs & License: https://fullcalendar.io/
|
||||
/* Hit System
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
TimeGrid.prototype.positionToHit = function (positionLeft, positionTop) {
|
||||
var _a = this, dateEnv = _a.dateEnv, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions;
|
||||
var dateEnv = this.context.dateEnv;
|
||||
var _a = this, snapsPerSlot = _a.snapsPerSlot, slatPositions = _a.slatPositions, colPositions = _a.colPositions;
|
||||
var colIndex = colPositions.leftToIndex(positionLeft);
|
||||
var slatIndex = slatPositions.topToIndex(positionTop);
|
||||
if (colIndex != null && slatIndex != null) {
|
||||
@@ -868,18 +882,22 @@ Docs & License: https://fullcalendar.io/
|
||||
if (state) {
|
||||
this.eventRenderer.hideByHash(state.affectedInstances);
|
||||
if (state.isEvent) {
|
||||
this.mirrorRenderer.renderSegs(state.segs, { isDragging: true, sourceSeg: state.sourceSeg });
|
||||
this.mirrorRenderer.renderSegs(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg });
|
||||
}
|
||||
else {
|
||||
this.fillRenderer.renderSegs('highlight', state.segs);
|
||||
this.fillRenderer.renderSegs('highlight', this.context, state.segs);
|
||||
}
|
||||
}
|
||||
};
|
||||
TimeGrid.prototype._unrenderEventDrag = function (state) {
|
||||
if (state) {
|
||||
this.eventRenderer.showByHash(state.affectedInstances);
|
||||
this.mirrorRenderer.unrender(state.segs, { isDragging: true, sourceSeg: state.sourceSeg });
|
||||
this.fillRenderer.unrender('highlight');
|
||||
if (state.isEvent) {
|
||||
this.mirrorRenderer.unrender(this.context, state.segs, { isDragging: true, sourceSeg: state.sourceSeg });
|
||||
}
|
||||
else {
|
||||
this.fillRenderer.unrender('highlight', this.context);
|
||||
}
|
||||
}
|
||||
};
|
||||
/* Event Resize Visualization
|
||||
@@ -887,13 +905,13 @@ Docs & License: https://fullcalendar.io/
|
||||
TimeGrid.prototype._renderEventResize = function (state) {
|
||||
if (state) {
|
||||
this.eventRenderer.hideByHash(state.affectedInstances);
|
||||
this.mirrorRenderer.renderSegs(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
|
||||
this.mirrorRenderer.renderSegs(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
|
||||
}
|
||||
};
|
||||
TimeGrid.prototype._unrenderEventResize = function (state) {
|
||||
if (state) {
|
||||
this.eventRenderer.showByHash(state.affectedInstances);
|
||||
this.mirrorRenderer.unrender(state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
|
||||
this.mirrorRenderer.unrender(this.context, state.segs, { isResizing: true, sourceSeg: state.sourceSeg });
|
||||
}
|
||||
};
|
||||
/* Selection
|
||||
@@ -901,17 +919,23 @@ Docs & License: https://fullcalendar.io/
|
||||
// Renders a visual indication of a selection. Overrides the default, which was to simply render a highlight.
|
||||
TimeGrid.prototype._renderDateSelection = function (segs) {
|
||||
if (segs) {
|
||||
if (this.opt('selectMirror')) {
|
||||
this.mirrorRenderer.renderSegs(segs, { isSelecting: true });
|
||||
if (this.context.options.selectMirror) {
|
||||
this.mirrorRenderer.renderSegs(this.context, segs, { isSelecting: true });
|
||||
}
|
||||
else {
|
||||
this.fillRenderer.renderSegs('highlight', segs);
|
||||
this.fillRenderer.renderSegs('highlight', this.context, segs);
|
||||
}
|
||||
}
|
||||
};
|
||||
TimeGrid.prototype._unrenderDateSelection = function (segs) {
|
||||
this.mirrorRenderer.unrender(segs, { isSelecting: true });
|
||||
this.fillRenderer.unrender('highlight');
|
||||
if (segs) {
|
||||
if (this.context.options.selectMirror) {
|
||||
this.mirrorRenderer.unrender(this.context, segs, { isSelecting: true });
|
||||
}
|
||||
else {
|
||||
this.fillRenderer.unrender('highlight', this.context);
|
||||
}
|
||||
}
|
||||
};
|
||||
return TimeGrid;
|
||||
}(core.DateComponent));
|
||||
@@ -955,25 +979,26 @@ Docs & License: https://fullcalendar.io/
|
||||
----------------------------------------------------------------------------------------------------------------------*/
|
||||
// Is a manager for the TimeGrid subcomponent and possibly the DayGrid subcomponent (if allDaySlot is on).
|
||||
// Responsible for managing width/height.
|
||||
var TimeGridView = /** @class */ (function (_super) {
|
||||
__extends(TimeGridView, _super);
|
||||
function TimeGridView(context, viewSpec, dateProfileGenerator, parentEl) {
|
||||
var _this = _super.call(this, context, viewSpec, dateProfileGenerator, parentEl) || this;
|
||||
var AbstractTimeGridView = /** @class */ (function (_super) {
|
||||
__extends(AbstractTimeGridView, _super);
|
||||
function AbstractTimeGridView() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.splitter = new AllDaySplitter();
|
||||
_this.renderSkeleton = core.memoizeRendering(_this._renderSkeleton, _this._unrenderSkeleton);
|
||||
/* Header Render Methods
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Generates the HTML that will go before the day-of week header cells
|
||||
_this.renderHeadIntroHtml = function () {
|
||||
var _a = _this, theme = _a.theme, dateEnv = _a.dateEnv;
|
||||
var _a = _this.context, theme = _a.theme, dateEnv = _a.dateEnv, options = _a.options;
|
||||
var range = _this.props.dateProfile.renderRange;
|
||||
var dayCnt = core.diffDays(range.start, range.end);
|
||||
var weekText;
|
||||
if (_this.opt('weekNumbers')) {
|
||||
if (options.weekNumbers) {
|
||||
weekText = dateEnv.format(range.start, WEEK_HEADER_FORMAT);
|
||||
return '' +
|
||||
'<th class="fc-axis fc-week-number ' + theme.getClass('widgetHeader') + '" ' + _this.axisStyleAttr() + '>' +
|
||||
core.buildGotoAnchorHtml(// aside from link, important for matchCellWidths
|
||||
_this, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, core.htmlEscape(weekText) // inner HTML
|
||||
options, dateEnv, { date: range.start, type: 'week', forceOff: dayCnt > 1 }, core.htmlEscape(weekText) // inner HTML
|
||||
) +
|
||||
'</th>';
|
||||
}
|
||||
@@ -985,7 +1010,7 @@ Docs & License: https://fullcalendar.io/
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Generates the HTML that goes before the bg of the TimeGrid slot area. Long vertical column.
|
||||
_this.renderTimeGridBgIntroHtml = function () {
|
||||
var theme = _this.theme;
|
||||
var theme = _this.context.theme;
|
||||
return '<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '></td>';
|
||||
};
|
||||
// Generates the HTML that goes before all other types of cells.
|
||||
@@ -997,11 +1022,11 @@ Docs & License: https://fullcalendar.io/
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Generates the HTML that goes before the all-day cells
|
||||
_this.renderDayGridBgIntroHtml = function () {
|
||||
var theme = _this.theme;
|
||||
var _a = _this.context, theme = _a.theme, options = _a.options;
|
||||
return '' +
|
||||
'<td class="fc-axis ' + theme.getClass('widgetContent') + '" ' + _this.axisStyleAttr() + '>' +
|
||||
'<span>' + // needed for matchCellWidths
|
||||
core.getAllDayHtml(_this) +
|
||||
core.getAllDayHtml(options) +
|
||||
'</span>' +
|
||||
'</td>';
|
||||
};
|
||||
@@ -1010,37 +1035,47 @@ Docs & License: https://fullcalendar.io/
|
||||
_this.renderDayGridIntroHtml = function () {
|
||||
return '<td class="fc-axis" ' + _this.axisStyleAttr() + '></td>';
|
||||
};
|
||||
_this.el.classList.add('fc-timeGrid-view');
|
||||
_this.el.innerHTML = _this.renderSkeletonHtml();
|
||||
_this.scroller = new core.ScrollComponent('hidden', // overflow x
|
||||
return _this;
|
||||
}
|
||||
AbstractTimeGridView.prototype.render = function (props, context) {
|
||||
_super.prototype.render.call(this, props, context);
|
||||
this.renderSkeleton(context);
|
||||
};
|
||||
AbstractTimeGridView.prototype.destroy = function () {
|
||||
_super.prototype.destroy.call(this);
|
||||
this.renderSkeleton.unrender();
|
||||
};
|
||||
AbstractTimeGridView.prototype._renderSkeleton = function (context) {
|
||||
this.el.classList.add('fc-timeGrid-view');
|
||||
this.el.innerHTML = this.renderSkeletonHtml();
|
||||
this.scroller = new core.ScrollComponent('hidden', // overflow x
|
||||
'auto' // overflow y
|
||||
);
|
||||
var timeGridWrapEl = _this.scroller.el;
|
||||
_this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl);
|
||||
var timeGridWrapEl = this.scroller.el;
|
||||
this.el.querySelector('.fc-body > tr > td').appendChild(timeGridWrapEl);
|
||||
timeGridWrapEl.classList.add('fc-time-grid-container');
|
||||
var timeGridEl = core.createElement('div', { className: 'fc-time-grid' });
|
||||
timeGridWrapEl.appendChild(timeGridEl);
|
||||
_this.timeGrid = new TimeGrid(_this.context, timeGridEl, {
|
||||
renderBgIntroHtml: _this.renderTimeGridBgIntroHtml,
|
||||
renderIntroHtml: _this.renderTimeGridIntroHtml
|
||||
this.timeGrid = new TimeGrid(timeGridEl, {
|
||||
renderBgIntroHtml: this.renderTimeGridBgIntroHtml,
|
||||
renderIntroHtml: this.renderTimeGridIntroHtml
|
||||
});
|
||||
if (_this.opt('allDaySlot')) { // should we display the "all-day" area?
|
||||
_this.dayGrid = new daygrid.DayGrid(// the all-day subcomponent of this view
|
||||
_this.context, _this.el.querySelector('.fc-day-grid'), {
|
||||
renderNumberIntroHtml: _this.renderDayGridIntroHtml,
|
||||
renderBgIntroHtml: _this.renderDayGridBgIntroHtml,
|
||||
renderIntroHtml: _this.renderDayGridIntroHtml,
|
||||
if (context.options.allDaySlot) { // should we display the "all-day" area?
|
||||
this.dayGrid = new daygrid.DayGrid(// the all-day subcomponent of this view
|
||||
this.el.querySelector('.fc-day-grid'), {
|
||||
renderNumberIntroHtml: this.renderDayGridIntroHtml,
|
||||
renderBgIntroHtml: this.renderDayGridBgIntroHtml,
|
||||
renderIntroHtml: this.renderDayGridIntroHtml,
|
||||
colWeekNumbersVisible: false,
|
||||
cellWeekNumbersVisible: false
|
||||
});
|
||||
// have the day-grid extend it's coordinate area over the <hr> dividing the two grids
|
||||
var dividerEl = _this.el.querySelector('.fc-divider');
|
||||
_this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height;
|
||||
var dividerEl = this.el.querySelector('.fc-divider');
|
||||
this.dayGrid.bottomCoordPadding = dividerEl.getBoundingClientRect().height;
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
TimeGridView.prototype.destroy = function () {
|
||||
_super.prototype.destroy.call(this);
|
||||
};
|
||||
AbstractTimeGridView.prototype._unrenderSkeleton = function () {
|
||||
this.el.classList.remove('fc-timeGrid-view');
|
||||
this.timeGrid.destroy();
|
||||
if (this.dayGrid) {
|
||||
this.dayGrid.destroy();
|
||||
@@ -1051,11 +1086,11 @@ Docs & License: https://fullcalendar.io/
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Builds the HTML skeleton for the view.
|
||||
// The day-grid and time-grid components will render inside containers defined by this HTML.
|
||||
TimeGridView.prototype.renderSkeletonHtml = function () {
|
||||
var theme = this.theme;
|
||||
AbstractTimeGridView.prototype.renderSkeletonHtml = function () {
|
||||
var _a = this.context, theme = _a.theme, options = _a.options;
|
||||
return '' +
|
||||
'<table class="' + theme.getClass('tableGrid') + '">' +
|
||||
(this.opt('columnHeader') ?
|
||||
(options.columnHeader ?
|
||||
'<thead class="fc-head">' +
|
||||
'<tr>' +
|
||||
'<td class="fc-head-container ' + theme.getClass('widgetHeader') + '"> </td>' +
|
||||
@@ -1065,7 +1100,7 @@ Docs & License: https://fullcalendar.io/
|
||||
'<tbody class="fc-body">' +
|
||||
'<tr>' +
|
||||
'<td class="' + theme.getClass('widgetContent') + '">' +
|
||||
(this.opt('allDaySlot') ?
|
||||
(options.allDaySlot ?
|
||||
'<div class="fc-day-grid"></div>' +
|
||||
'<hr class="fc-divider ' + theme.getClass('widgetHeader') + '" />' :
|
||||
'') +
|
||||
@@ -1076,18 +1111,18 @@ Docs & License: https://fullcalendar.io/
|
||||
};
|
||||
/* Now Indicator
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
TimeGridView.prototype.getNowIndicatorUnit = function () {
|
||||
AbstractTimeGridView.prototype.getNowIndicatorUnit = function () {
|
||||
return this.timeGrid.getNowIndicatorUnit();
|
||||
};
|
||||
// subclasses should implement
|
||||
// renderNowIndicator(date: DateMarker) {
|
||||
// }
|
||||
TimeGridView.prototype.unrenderNowIndicator = function () {
|
||||
AbstractTimeGridView.prototype.unrenderNowIndicator = function () {
|
||||
this.timeGrid.unrenderNowIndicator();
|
||||
};
|
||||
/* Dimensions
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
TimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {
|
||||
AbstractTimeGridView.prototype.updateSize = function (isResize, viewHeight, isAuto) {
|
||||
_super.prototype.updateSize.call(this, isResize, viewHeight, isAuto); // will call updateBaseSize. important that executes first
|
||||
this.timeGrid.updateSize(isResize);
|
||||
if (this.dayGrid) {
|
||||
@@ -1095,7 +1130,7 @@ Docs & License: https://fullcalendar.io/
|
||||
}
|
||||
};
|
||||
// Adjusts the vertical dimensions of the view to the specified values
|
||||
TimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {
|
||||
AbstractTimeGridView.prototype.updateBaseSize = function (isResize, viewHeight, isAuto) {
|
||||
var _this = this;
|
||||
var eventLimit;
|
||||
var scrollerHeight;
|
||||
@@ -1122,7 +1157,7 @@ Docs & License: https://fullcalendar.io/
|
||||
// limit number of events in the all-day area
|
||||
if (this.dayGrid) {
|
||||
this.dayGrid.removeSegPopover(); // kill the "more" popover if displayed
|
||||
eventLimit = this.opt('eventLimit');
|
||||
eventLimit = this.context.options.eventLimit;
|
||||
if (eventLimit && typeof eventLimit !== 'number') {
|
||||
eventLimit = TIMEGRID_ALL_DAY_EVENT_LIMIT; // make sure "auto" goes to a real number
|
||||
}
|
||||
@@ -1154,14 +1189,14 @@ Docs & License: https://fullcalendar.io/
|
||||
}
|
||||
};
|
||||
// given a desired total height of the view, returns what the height of the scroller should be
|
||||
TimeGridView.prototype.computeScrollerHeight = function (viewHeight) {
|
||||
AbstractTimeGridView.prototype.computeScrollerHeight = function (viewHeight) {
|
||||
return viewHeight -
|
||||
core.subtractInnerElHeight(this.el, this.scroller.el); // everything that's NOT the scroller
|
||||
};
|
||||
/* Scroll
|
||||
------------------------------------------------------------------------------------------------------------------*/
|
||||
// Computes the initial pre-configured scroll state prior to allowing the user to change it
|
||||
TimeGridView.prototype.computeDateScroll = function (duration) {
|
||||
AbstractTimeGridView.prototype.computeDateScroll = function (duration) {
|
||||
var top = this.timeGrid.computeTimeTop(duration);
|
||||
// zoom can give weird floating-point values. rather scroll a little bit further
|
||||
top = Math.ceil(top);
|
||||
@@ -1170,45 +1205,48 @@ Docs & License: https://fullcalendar.io/
|
||||
}
|
||||
return { top: top };
|
||||
};
|
||||
TimeGridView.prototype.queryDateScroll = function () {
|
||||
AbstractTimeGridView.prototype.queryDateScroll = function () {
|
||||
return { top: this.scroller.getScrollTop() };
|
||||
};
|
||||
TimeGridView.prototype.applyDateScroll = function (scroll) {
|
||||
AbstractTimeGridView.prototype.applyDateScroll = function (scroll) {
|
||||
if (scroll.top !== undefined) {
|
||||
this.scroller.setScrollTop(scroll.top);
|
||||
}
|
||||
};
|
||||
// Generates an HTML attribute string for setting the width of the axis, if it is known
|
||||
TimeGridView.prototype.axisStyleAttr = function () {
|
||||
AbstractTimeGridView.prototype.axisStyleAttr = function () {
|
||||
if (this.axisWidth != null) {
|
||||
return 'style="width:' + this.axisWidth + 'px"';
|
||||
}
|
||||
return '';
|
||||
};
|
||||
return TimeGridView;
|
||||
return AbstractTimeGridView;
|
||||
}(core.View));
|
||||
TimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering
|
||||
AbstractTimeGridView.prototype.usesMinMaxTime = true; // indicates that minTime/maxTime affects rendering
|
||||
|
||||
var SimpleTimeGrid = /** @class */ (function (_super) {
|
||||
__extends(SimpleTimeGrid, _super);
|
||||
function SimpleTimeGrid(context, timeGrid) {
|
||||
var _this = _super.call(this, context, timeGrid.el) || this;
|
||||
function SimpleTimeGrid(timeGrid) {
|
||||
var _this = _super.call(this, timeGrid.el) || this;
|
||||
_this.buildDayRanges = core.memoize(buildDayRanges);
|
||||
_this.slicer = new TimeGridSlicer();
|
||||
_this.timeGrid = timeGrid;
|
||||
context.calendar.registerInteractiveComponent(_this, {
|
||||
el: _this.timeGrid.el
|
||||
});
|
||||
return _this;
|
||||
}
|
||||
SimpleTimeGrid.prototype.firstContext = function (context) {
|
||||
context.calendar.registerInteractiveComponent(this, {
|
||||
el: this.timeGrid.el
|
||||
});
|
||||
};
|
||||
SimpleTimeGrid.prototype.destroy = function () {
|
||||
_super.prototype.destroy.call(this);
|
||||
this.calendar.unregisterInteractiveComponent(this);
|
||||
this.context.calendar.unregisterInteractiveComponent(this);
|
||||
};
|
||||
SimpleTimeGrid.prototype.render = function (props) {
|
||||
SimpleTimeGrid.prototype.render = function (props, context) {
|
||||
var dateEnv = this.context.dateEnv;
|
||||
var dateProfile = props.dateProfile, dayTable = props.dayTable;
|
||||
var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, this.dateEnv);
|
||||
this.timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, this.timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }));
|
||||
var dayRanges = this.dayRanges = this.buildDayRanges(dayTable, dateProfile, dateEnv);
|
||||
this.timeGrid.receiveProps(__assign({}, this.slicer.sliceProps(props, dateProfile, null, context.calendar, this.timeGrid, dayRanges), { dateProfile: dateProfile, cells: dayTable.cells[0] }), context);
|
||||
};
|
||||
SimpleTimeGrid.prototype.renderNowIndicator = function (date) {
|
||||
this.timeGrid.renderNowIndicator(this.slicer.sliceNowDate(date, this.timeGrid, this.dayRanges), date);
|
||||
@@ -1270,22 +1308,48 @@ Docs & License: https://fullcalendar.io/
|
||||
return TimeGridSlicer;
|
||||
}(core.Slicer));
|
||||
|
||||
var TimeGridView$1 = /** @class */ (function (_super) {
|
||||
var TimeGridView = /** @class */ (function (_super) {
|
||||
__extends(TimeGridView, _super);
|
||||
function TimeGridView(_context, viewSpec, dateProfileGenerator, parentEl) {
|
||||
var _this = _super.call(this, _context, viewSpec, dateProfileGenerator, parentEl) || this;
|
||||
function TimeGridView() {
|
||||
var _this = _super !== null && _super.apply(this, arguments) || this;
|
||||
_this.buildDayTable = core.memoize(buildDayTable);
|
||||
if (_this.opt('columnHeader')) {
|
||||
_this.header = new core.DayHeader(_this.context, _this.el.querySelector('.fc-head-container'));
|
||||
}
|
||||
_this.simpleTimeGrid = new SimpleTimeGrid(_this.context, _this.timeGrid);
|
||||
if (_this.dayGrid) {
|
||||
_this.simpleDayGrid = new daygrid.SimpleDayGrid(_this.context, _this.dayGrid);
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
TimeGridView.prototype.destroy = function () {
|
||||
_super.prototype.destroy.call(this);
|
||||
TimeGridView.prototype.render = function (props, context) {
|
||||
_super.prototype.render.call(this, props, context); // for flags for updateSize. also _renderSkeleton/_unrenderSkeleton
|
||||
var _a = this.props, dateProfile = _a.dateProfile, dateProfileGenerator = _a.dateProfileGenerator;
|
||||
var nextDayThreshold = context.nextDayThreshold;
|
||||
var dayTable = this.buildDayTable(dateProfile, dateProfileGenerator);
|
||||
var splitProps = this.splitter.splitProps(props);
|
||||
if (this.header) {
|
||||
this.header.receiveProps({
|
||||
dateProfile: dateProfile,
|
||||
dates: dayTable.headerDates,
|
||||
datesRepDistinctDays: true,
|
||||
renderIntroHtml: this.renderHeadIntroHtml
|
||||
}, context);
|
||||
}
|
||||
this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile,
|
||||
dayTable: dayTable }), context);
|
||||
if (this.simpleDayGrid) {
|
||||
this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile,
|
||||
dayTable: dayTable,
|
||||
nextDayThreshold: nextDayThreshold, isRigid: false }), context);
|
||||
}
|
||||
this.startNowIndicator(dateProfile, dateProfileGenerator);
|
||||
};
|
||||
TimeGridView.prototype._renderSkeleton = function (context) {
|
||||
_super.prototype._renderSkeleton.call(this, context);
|
||||
if (context.options.columnHeader) {
|
||||
this.header = new core.DayHeader(this.el.querySelector('.fc-head-container'));
|
||||
}
|
||||
this.simpleTimeGrid = new SimpleTimeGrid(this.timeGrid);
|
||||
if (this.dayGrid) {
|
||||
this.simpleDayGrid = new daygrid.SimpleDayGrid(this.dayGrid);
|
||||
}
|
||||
};
|
||||
TimeGridView.prototype._unrenderSkeleton = function () {
|
||||
_super.prototype._unrenderSkeleton.call(this);
|
||||
if (this.header) {
|
||||
this.header.destroy();
|
||||
}
|
||||
@@ -1294,31 +1358,11 @@ Docs & License: https://fullcalendar.io/
|
||||
this.simpleDayGrid.destroy();
|
||||
}
|
||||
};
|
||||
TimeGridView.prototype.render = function (props) {
|
||||
_super.prototype.render.call(this, props); // for flags for updateSize
|
||||
var dateProfile = this.props.dateProfile;
|
||||
var dayTable = this.buildDayTable(dateProfile, this.dateProfileGenerator);
|
||||
var splitProps = this.splitter.splitProps(props);
|
||||
if (this.header) {
|
||||
this.header.receiveProps({
|
||||
dateProfile: dateProfile,
|
||||
dates: dayTable.headerDates,
|
||||
datesRepDistinctDays: true,
|
||||
renderIntroHtml: this.renderHeadIntroHtml
|
||||
});
|
||||
}
|
||||
this.simpleTimeGrid.receiveProps(__assign({}, splitProps['timed'], { dateProfile: dateProfile,
|
||||
dayTable: dayTable }));
|
||||
if (this.simpleDayGrid) {
|
||||
this.simpleDayGrid.receiveProps(__assign({}, splitProps['allDay'], { dateProfile: dateProfile,
|
||||
dayTable: dayTable, nextDayThreshold: this.nextDayThreshold, isRigid: false }));
|
||||
}
|
||||
};
|
||||
TimeGridView.prototype.renderNowIndicator = function (date) {
|
||||
this.simpleTimeGrid.renderNowIndicator(date);
|
||||
};
|
||||
return TimeGridView;
|
||||
}(TimeGridView));
|
||||
}(AbstractTimeGridView));
|
||||
function buildDayTable(dateProfile, dateProfileGenerator) {
|
||||
var daySeries = new core.DaySeries(dateProfile.renderRange, dateProfileGenerator);
|
||||
return new core.DayTable(daySeries, false);
|
||||
@@ -1328,7 +1372,7 @@ Docs & License: https://fullcalendar.io/
|
||||
defaultView: 'timeGridWeek',
|
||||
views: {
|
||||
timeGrid: {
|
||||
class: TimeGridView$1,
|
||||
class: TimeGridView,
|
||||
allDaySlot: true,
|
||||
slotDuration: '00:30:00',
|
||||
slotEventOverlap: true // a bad name. confused with overlap/constraint system
|
||||
@@ -1344,10 +1388,10 @@ Docs & License: https://fullcalendar.io/
|
||||
}
|
||||
});
|
||||
|
||||
exports.AbstractTimeGridView = TimeGridView;
|
||||
exports.AbstractTimeGridView = AbstractTimeGridView;
|
||||
exports.TimeGrid = TimeGrid;
|
||||
exports.TimeGridSlicer = TimeGridSlicer;
|
||||
exports.TimeGridView = TimeGridView$1;
|
||||
exports.TimeGridView = TimeGridView;
|
||||
exports.buildDayRanges = buildDayRanges;
|
||||
exports.buildDayTable = buildDayTable;
|
||||
exports.default = main;
|
||||
|
||||
Reference in New Issue
Block a user