1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 | 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 1× 149× 149× 149× 149× 149× 1× 26333× 1× 176× 176× 176× 1× 337× 1× 87× 87× 1× 246× 97× 246× 1× 194× 194× 6294× 6294× 6294× 5× 6294× 194× 1× 187× 54× 1× 187× 187× 54× 54× 54× 187× 187× 187× 187× 187× 187× 187× 187× 187× 9× 187× 1× 1270× 871× 399× 1× 202× 202× 881× 27193× 27193× 27193× 22825× 22825× 22825× 22825× 22825× 27193× 27193× 881× 27193× 202× 1× 23461× 70× 1× 187× 1× 384× 384× 1× 384× 384× 1× 187× 187× 187× 187× 60× 187× 187× 20× 20× 187× 187× 1× 4× 4× 26× 4× 1× 312× 122× 190× 187× 187× 187× 190× 140× 140× 190× 1× 1× | /* istanbul ignore next */ var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); define(["require", "exports", "@syncfusion/ej2-base", "./month", "../event-renderer/timeline-view", "./timeline-header-row", "../base/util", "../base/constant", "../base/css-constant"], function (require, exports, ej2_base_1, month_1, timeline_view_1, timeline_header_row_1, util, event, cls) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var TimelineMonth = (function (_super) { __extends(TimelineMonth, _super); function TimelineMonth(parent) { var _this = _super.call(this, parent) || this; _this.viewClass = 'e-timeline-month-view'; _this.isInverseTableSelect = true; _this.appointment = null; return _this; } TimelineMonth.prototype.getModuleName = function () { return 'timelineMonth'; }; TimelineMonth.prototype.onDataReady = function () { this.appointment = new timeline_view_1.TimelineEvent(this.parent, 'day'); this.appointment.renderAppointments(); this.parent.notify(event.eventsLoaded, {}); }; TimelineMonth.prototype.getLeftPanelElement = function () { return this.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS); }; TimelineMonth.prototype.scrollTopPanel = function (target) { _super.prototype.scrollTopPanel.call(this, target); this.scrollHeaderLabels(target); }; TimelineMonth.prototype.setContentHeight = function (content, leftPanelElement, height) { if (leftPanelElement) { leftPanelElement.style.height = ej2_base_1.formatUnit(height - this.getScrollXIndent(content)); } content.style.height = ej2_base_1.formatUnit(height); }; TimelineMonth.prototype.getDateSlots = function (renderDates, workDays) { var dateSlots = []; for (var _i = 0, renderDates_1 = renderDates; _i < renderDates_1.length; _i++) { var col = renderDates_1[_i]; var classList = [cls.HEADER_CELLS_CLASS]; if (this.isCurrentDate(col)) { classList.push(cls.CURRENT_DAY_CLASS); } dateSlots.push({ date: col, type: 'dateHeader', className: classList, colSpan: 1, workDays: workDays }); } return dateSlots; }; TimelineMonth.prototype.renderLeftIndent = function (tr) { if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) { this.parent.resourceBase.renderResourceHeaderIndent(tr); } }; TimelineMonth.prototype.renderContent = function () { var contentTr = ej2_base_1.createElement('tr'); if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) { var resTd = ej2_base_1.createElement('td'); resTd.appendChild(this.parent.resourceBase.createResourceColumn()); contentTr.appendChild(resTd); } var contentTd = ej2_base_1.createElement('td'); this.element.querySelector('tbody').appendChild(contentTr); var wrap = ej2_base_1.createElement('div', { className: cls.CONTENT_WRAP_CLASS }); wrap.appendChild(this.renderContentArea()); wrap.appendChild(this.createEventTable(this.getRowCount())); this.collapseRows(wrap); ej2_base_1.EventHandler.add(wrap, 'scroll', this.onContentScroll, this); contentTd.appendChild(wrap); if (this.parent.virtualScrollModule) { this.parent.virtualScrollModule.renderVirtualTrack(wrap); } contentTr.appendChild(contentTd); }; TimelineMonth.prototype.getRowCount = function () { if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) { return this.parent.resourceBase.renderedResources.length; } return 1; }; TimelineMonth.prototype.getContentSlots = function () { var slotDatas = []; for (var row = 0; row < this.getRowCount(); row++) { for (var _i = 0, _a = this.colLevels[this.colLevels.length - 1]; _i < _a.length; _i++) { var data = _a[_i]; data.className = [cls.WORK_CELLS_CLASS]; if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) { var resLevel = this.parent.resourceBase.renderedResources[parseInt(row.toString(), 10)]; data.workDays = resLevel.resourceData[resLevel.resource.workDaysField] || this.parent.workDays; data.className = data.className.concat(resLevel.className); data.groupIndex = resLevel.groupIndex; data.groupOrder = resLevel.groupOrder; } var slotData = { date: new Date(+data.date), colSpan: data.colSpan, groupIndex: data.groupIndex, workDays: data.workDays, type: 'monthCells', className: data.className }; if (!slotDatas[parseInt(row.toString(), 10)]) { slotDatas[parseInt(row.toString(), 10)] = []; } slotDatas[parseInt(row.toString(), 10)].push(slotData); } } return slotDatas; }; TimelineMonth.prototype.updateClassList = function (data) { if (!this.parent.isMinMaxDate(data.date)) { data.className.push(cls.DISABLE_DATES); } }; TimelineMonth.prototype.unWireEvents = function () { ej2_base_1.EventHandler.remove(this.getContentAreaElement(), 'scroll', this.onContentScroll); }; TimelineMonth.prototype.getMonthStart = function (currentDate) { var monthStart = this.parent.calendarUtil.firstDateOfMonth(util.resetTime(currentDate)); return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate()); }; TimelineMonth.prototype.getMonthEnd = function (currentDate) { var monthStart = this.parent.calendarUtil.firstDateOfMonth(util.resetTime(currentDate)); return this.parent.calendarUtil.lastDateOfMonth(util.addMonths(new Date(+monthStart), this.parent.activeViewOptions.interval - 1)); }; TimelineMonth.prototype.generateColumnLevels = function () { var colLevels = []; var level = this.getDateSlots(this.renderDates, this.parent.activeViewOptions.workDays); colLevels.push(level); if (this.parent.activeViewOptions.group.resources.length > 0) { this.parent.resourceBase.generateResourceLevels(level, !this.parent.uiStateValues.isGroupAdaptive); } var hourSlots = []; if (this.parent.activeViewOptions.headerRows.length > 0) { var renderGn = new timeline_header_row_1.TimelineHeaderRow(this.parent, this.renderDates); colLevels = renderGn.generateColumnLevels(level, hourSlots); } this.colLevels = colLevels; return colLevels; }; TimelineMonth.prototype.getAdjustedDate = function (startTime) { var timeSlots = this.colLevels[this.colLevels.length - 1]; for (var i = 0; i < timeSlots.length; i++) { if (timeSlots[parseInt(i.toString(), 10)].date.getTime() > startTime.getTime()) { return timeSlots[i - 1].date; } } return null; }; TimelineMonth.prototype.destroy = function () { if (!this.parent || this.parent && this.parent.isDestroyed) { return; } if (this.element) { var contentScrollableEle = this.element.querySelector('.' + cls.CONTENT_WRAP_CLASS); Eif (contentScrollableEle) { ej2_base_1.EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll); } } if (this.appointment) { this.appointment.destroy(); this.appointment = null; } _super.prototype.destroy.call(this); }; return TimelineMonth; }(month_1.Month)); exports.TimelineMonth = TimelineMonth; }); |