@syncfusion/ej2-schedule 19.3.55 → 19.4.42
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/.github/PULL_REQUEST_TEMPLATE/Bug.md +63 -0
- package/.github/PULL_REQUEST_TEMPLATE/Feature.md +39 -0
- package/CHANGELOG.md +50 -1
- package/dist/ej2-schedule.umd.min.js +2 -2
- package/dist/ej2-schedule.umd.min.js.map +1 -1
- package/dist/es6/ej2-schedule.es2015.js +489 -145
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +493 -152
- package/dist/es6/ej2-schedule.es5.js.map +1 -1
- package/dist/global/ej2-schedule.min.js +2 -2
- package/dist/global/ej2-schedule.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +15 -15
- package/src/recurrence-editor/recurrence-editor.js +2 -2
- package/src/schedule/actions/drag.js +12 -4
- package/src/schedule/actions/keyboard.d.ts +7 -0
- package/src/schedule/actions/keyboard.js +197 -28
- package/src/schedule/actions/resize.js +44 -37
- package/src/schedule/base/css-constant.d.ts +6 -0
- package/src/schedule/base/css-constant.js +6 -0
- package/src/schedule/base/interface.d.ts +12 -0
- package/src/schedule/base/resource.js +1 -0
- package/src/schedule/base/schedule-model.d.ts +89 -20
- package/src/schedule/base/schedule.d.ts +88 -19
- package/src/schedule/base/schedule.js +15 -4
- package/src/schedule/base/util.d.ts +1 -0
- package/src/schedule/base/util.js +1 -0
- package/src/schedule/event-renderer/event-base.d.ts +2 -1
- package/src/schedule/event-renderer/event-base.js +19 -4
- package/src/schedule/event-renderer/inline-edit.js +8 -5
- package/src/schedule/event-renderer/month.js +3 -2
- package/src/schedule/event-renderer/timeline-view.js +4 -0
- package/src/schedule/event-renderer/vertical-view.js +9 -6
- package/src/schedule/event-renderer/year.js +1 -1
- package/src/schedule/exports/excel-export.d.ts +2 -1
- package/src/schedule/exports/excel-export.js +21 -18
- package/src/schedule/models/event-settings-model.d.ts +17 -9
- package/src/schedule/models/event-settings.d.ts +15 -8
- package/src/schedule/models/event-settings.js +6 -3
- package/src/schedule/models/views-model.d.ts +19 -0
- package/src/schedule/models/views.d.ts +17 -0
- package/src/schedule/models/views.js +6 -0
- package/src/schedule/popups/quick-popups.js +3 -0
- package/src/schedule/renderer/agenda.js +2 -1
- package/src/schedule/renderer/header-renderer.d.ts +1 -0
- package/src/schedule/renderer/header-renderer.js +23 -8
- package/src/schedule/renderer/month.d.ts +4 -0
- package/src/schedule/renderer/month.js +69 -19
- package/src/schedule/renderer/renderer.js +6 -1
- package/src/schedule/renderer/timeline-year.js +4 -1
- package/src/schedule/renderer/view-base.js +12 -1
- package/src/schedule/renderer/year.d.ts +2 -2
- package/src/schedule/renderer/year.js +24 -6
- package/styles/bootstrap-dark.css +108 -27
- package/styles/bootstrap.css +105 -27
- package/styles/bootstrap4.css +117 -62
- package/styles/bootstrap5-dark.css +118 -67
- package/styles/bootstrap5.css +118 -67
- package/styles/fabric-dark.css +108 -26
- package/styles/fabric.css +109 -26
- package/styles/highcontrast-light.css +104 -26
- package/styles/highcontrast.css +109 -28
- package/styles/material-dark.css +110 -32
- package/styles/material.css +103 -25
- package/styles/recurrence-editor/_bootstrap-dark-definition.scss +7 -0
- package/styles/recurrence-editor/_bootstrap-definition.scss +7 -0
- package/styles/recurrence-editor/_bootstrap4-definition.scss +7 -0
- package/styles/recurrence-editor/_bootstrap5-definition.scss +7 -0
- package/styles/recurrence-editor/_fabric-dark-definition.scss +8 -0
- package/styles/recurrence-editor/_fabric-definition.scss +7 -0
- package/styles/recurrence-editor/_fluent-definition.scss +15 -0
- package/styles/recurrence-editor/_highcontrast-definition.scss +7 -0
- package/styles/recurrence-editor/_highcontrast-light-definition.scss +7 -0
- package/styles/recurrence-editor/_layout.scss +20 -4
- package/styles/recurrence-editor/_material-dark-definition.scss +7 -0
- package/styles/recurrence-editor/_material-definition.scss +7 -0
- package/styles/recurrence-editor/_tailwind-definition.scss +15 -8
- package/styles/recurrence-editor/bootstrap-dark.css +20 -4
- package/styles/recurrence-editor/bootstrap.css +20 -4
- package/styles/recurrence-editor/bootstrap4.css +20 -4
- package/styles/recurrence-editor/bootstrap5-dark.css +20 -4
- package/styles/recurrence-editor/bootstrap5.css +20 -4
- package/styles/recurrence-editor/fabric-dark.css +20 -4
- package/styles/recurrence-editor/fabric.css +20 -4
- package/styles/recurrence-editor/highcontrast-light.css +20 -4
- package/styles/recurrence-editor/highcontrast.css +20 -4
- package/styles/recurrence-editor/material-dark.css +20 -4
- package/styles/recurrence-editor/material.css +20 -4
- package/styles/recurrence-editor/tailwind-dark.css +20 -4
- package/styles/recurrence-editor/tailwind.css +20 -4
- package/styles/schedule/_bootstrap-dark-definition.scss +22 -1
- package/styles/schedule/_bootstrap-definition.scss +22 -1
- package/styles/schedule/_bootstrap4-definition.scss +23 -1
- package/styles/schedule/_bootstrap5-definition.scss +145 -119
- package/styles/schedule/_fabric-dark-definition.scss +22 -1
- package/styles/schedule/_fabric-definition.scss +22 -1
- package/styles/schedule/_fluent-definition.scss +218 -0
- package/styles/schedule/_highcontrast-definition.scss +22 -1
- package/styles/schedule/_highcontrast-light-definition.scss +22 -1
- package/styles/schedule/_layout.scss +95 -158
- package/styles/schedule/_material-dark-definition.scss +22 -1
- package/styles/schedule/_material-definition.scss +21 -0
- package/styles/schedule/_tailwind-definition.scss +216 -195
- package/styles/schedule/_theme.scss +1 -1
- package/styles/schedule/bootstrap-dark.css +88 -23
- package/styles/schedule/bootstrap.css +85 -23
- package/styles/schedule/bootstrap4.css +97 -58
- package/styles/schedule/bootstrap5-dark.css +98 -63
- package/styles/schedule/bootstrap5.css +98 -63
- package/styles/schedule/fabric-dark.css +88 -22
- package/styles/schedule/fabric.css +89 -22
- package/styles/schedule/highcontrast-light.css +84 -22
- package/styles/schedule/highcontrast.css +89 -24
- package/styles/schedule/icons/_fluent.scss +231 -0
- package/styles/schedule/icons/_tailwind.scss +231 -231
- package/styles/schedule/material-dark.css +90 -28
- package/styles/schedule/material.css +83 -21
- package/styles/schedule/tailwind-dark.css +94 -52
- package/styles/schedule/tailwind.css +94 -52
- package/styles/tailwind-dark.css +114 -56
- package/styles/tailwind.css +114 -56
|
@@ -144,10 +144,11 @@ var Month = /** @class */ (function (_super) {
|
|
|
144
144
|
Month.prototype.getDateSlots = function (renderDates, workDays) {
|
|
145
145
|
var count = this.parent.activeViewOptions.showWeekend ? util.WEEK_LENGTH : workDays.length;
|
|
146
146
|
var dateSlots = [];
|
|
147
|
+
var isCurrentMonth = this.isCurrentMonth(this.parent.selectedDate);
|
|
147
148
|
for (var col = 0; col < count; col++) {
|
|
148
149
|
var classList = [cls.HEADER_CELLS_CLASS];
|
|
149
150
|
var currentDateIndex = renderDates.slice(0, count).map(function (date) { return date.getDay(); });
|
|
150
|
-
if (
|
|
151
|
+
if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
|
|
151
152
|
classList.push(cls.CURRENT_DAY_CLASS);
|
|
152
153
|
}
|
|
153
154
|
dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList, colSpan: 1, workDays: workDays });
|
|
@@ -186,6 +187,9 @@ var Month = /** @class */ (function (_super) {
|
|
|
186
187
|
this.renderResourceMobileLayout();
|
|
187
188
|
}
|
|
188
189
|
this.parent.notify(event.contentReady, {});
|
|
190
|
+
if (this.parent.uiStateValues.isCustomMonth) {
|
|
191
|
+
this.parent.uiStateValues.isCustomMonth = false;
|
|
192
|
+
}
|
|
189
193
|
};
|
|
190
194
|
Month.prototype.refreshHeader = function () {
|
|
191
195
|
remove(this.element.querySelector('tbody tr'));
|
|
@@ -371,7 +375,7 @@ var Month = /** @class */ (function (_super) {
|
|
|
371
375
|
return slotDatas;
|
|
372
376
|
};
|
|
373
377
|
Month.prototype.updateClassList = function (data) {
|
|
374
|
-
if (this.isOtherMonth(data.date)) {
|
|
378
|
+
if (!this.isCustomMonth() && this.isOtherMonth(data.date)) {
|
|
375
379
|
data.className.push(cls.OTHERMONTH_CLASS);
|
|
376
380
|
}
|
|
377
381
|
if (!this.parent.isMinMaxDate(data.date)) {
|
|
@@ -480,15 +484,34 @@ var Month = /** @class */ (function (_super) {
|
|
|
480
484
|
}
|
|
481
485
|
};
|
|
482
486
|
Month.prototype.getMonthStart = function (currentDate) {
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
|
|
487
|
+
var useDisplayDate = this.parent.currentView === 'Month' && !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && (this.parent.uiStateValues.isCustomMonth || this.isCustomRange());
|
|
488
|
+
var date = useDisplayDate ? this.parent.activeViewOptions.displayDate : !(this.parent.uiStateValues.isCustomMonth ||
|
|
489
|
+
this.isCustomRange()) && this.isCustomMonth() ? currentDate : this.parent.calendarUtil.firstDateOfMonth(currentDate);
|
|
490
|
+
var monthStart = util.getWeekFirstDate(date, this.parent.activeViewOptions.firstDayOfWeek);
|
|
491
|
+
return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
|
|
486
492
|
};
|
|
487
493
|
Month.prototype.getMonthEnd = function (currentDate) {
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
if (this.isCustomMonth()) {
|
|
495
|
+
var start = this.getMonthStart(currentDate);
|
|
496
|
+
var numberOfDays = util.WEEK_LENGTH * (this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
497
|
+
this.parent.activeViewOptions.numberOfWeeks : util.DEFAULT_WEEKS);
|
|
498
|
+
return util.addDays(start, (numberOfDays - 1));
|
|
499
|
+
}
|
|
500
|
+
else {
|
|
501
|
+
var endDate = util.addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
|
|
502
|
+
var lastWeekOfMonth = util.getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
|
|
503
|
+
return util.addDays(lastWeekOfMonth, util.WEEK_LENGTH - 1);
|
|
504
|
+
}
|
|
505
|
+
};
|
|
506
|
+
Month.prototype.isCustomRange = function () {
|
|
507
|
+
var dates = this.parent.getCurrentViewDates();
|
|
508
|
+
if (dates && dates.length > 0) {
|
|
509
|
+
var selectedTime = util.resetTime(this.parent.selectedDate).getTime();
|
|
510
|
+
var weekFirstDate = util.getWeekFirstDate(dates[dates.length - 1], this.parent.activeViewOptions.firstDayOfWeek);
|
|
511
|
+
return !(selectedTime >= util.getWeekFirstDate(dates[0], this.parent.activeViewOptions.firstDayOfWeek).getTime() &&
|
|
512
|
+
selectedTime <= util.addDays(weekFirstDate, 6).getTime());
|
|
513
|
+
}
|
|
514
|
+
return false;
|
|
492
515
|
};
|
|
493
516
|
Month.prototype.getRenderDates = function (workDays) {
|
|
494
517
|
var renderDates = [];
|
|
@@ -518,34 +541,57 @@ var Month = /** @class */ (function (_super) {
|
|
|
518
541
|
return renderDates;
|
|
519
542
|
};
|
|
520
543
|
Month.prototype.getNextPreviousDate = function (type) {
|
|
521
|
-
if (
|
|
522
|
-
|
|
544
|
+
if (this.isCustomMonth()) {
|
|
545
|
+
var dates = this.parent.getCurrentViewDates();
|
|
546
|
+
var date = util.getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
|
|
547
|
+
: dates[0], this.parent.activeViewOptions.firstDayOfWeek);
|
|
548
|
+
return util.addDays(date, type === 'next' ? util.WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
549
|
+
this.parent.activeViewOptions.numberOfWeeks : util.DEFAULT_WEEKS) * util.WEEK_LENGTH);
|
|
523
550
|
}
|
|
524
551
|
else {
|
|
525
|
-
return util.addMonths(this.parent.selectedDate, -
|
|
552
|
+
return util.addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
|
|
526
553
|
}
|
|
527
554
|
};
|
|
555
|
+
Month.prototype.getStartDate = function () {
|
|
556
|
+
return this.getMonthStart(this.parent.selectedDate);
|
|
557
|
+
};
|
|
558
|
+
Month.prototype.getEndDate = function () {
|
|
559
|
+
return this.getMonthEnd(this.parent.selectedDate);
|
|
560
|
+
};
|
|
528
561
|
Month.prototype.getEndDateFromStartDate = function (start) {
|
|
529
562
|
return util.addDays(new Date(start.getTime()), 1);
|
|
530
563
|
};
|
|
531
564
|
Month.prototype.getDateRangeText = function () {
|
|
532
565
|
if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
566
|
+
var startDate = this.parent.selectedDate;
|
|
567
|
+
var endDate = void 0;
|
|
568
|
+
var updateCustomRange = false;
|
|
569
|
+
if (this.isCustomMonth()) {
|
|
570
|
+
var dates = this.parent.getCurrentViewDates();
|
|
571
|
+
updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
|
|
572
|
+
dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
|
|
573
|
+
if (updateCustomRange) {
|
|
574
|
+
startDate = dates[0];
|
|
575
|
+
endDate = dates[dates.length - 1];
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
var isUpdateDateRange = (this.parent.currentView !== 'Month' || !this.isCustomMonth());
|
|
579
|
+
if (this.parent.activeViewOptions.interval > 1 && isUpdateDateRange || updateCustomRange) {
|
|
580
|
+
endDate = endDate ? endDate : util.addMonths(util.lastDateOfMonth(startDate), this.parent.activeViewOptions.interval - 1);
|
|
581
|
+
if (startDate.getFullYear() === endDate.getFullYear()) {
|
|
582
|
+
var monthNames = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
|
|
537
583
|
(this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
|
|
538
584
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
539
585
|
return util.capitalizeFirstWord(monthNames, 'single');
|
|
540
586
|
}
|
|
541
|
-
var text = (this.parent.globalize.formatDate(
|
|
542
|
-
|
|
587
|
+
var text = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
|
|
588
|
+
startDate.getFullYear() + ' - ' +
|
|
543
589
|
this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() }) +
|
|
544
590
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
545
591
|
return util.capitalizeFirstWord(text, 'single');
|
|
546
592
|
}
|
|
547
593
|
var format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
|
|
548
|
-
return util.capitalizeFirstWord(this.parent.globalize.formatDate(
|
|
594
|
+
return util.capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
|
|
549
595
|
}
|
|
550
596
|
return this.formatDateRange(this.parent.selectedDate);
|
|
551
597
|
};
|
|
@@ -570,6 +616,10 @@ var Month = /** @class */ (function (_super) {
|
|
|
570
616
|
EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll);
|
|
571
617
|
}
|
|
572
618
|
};
|
|
619
|
+
Month.prototype.isCustomMonth = function () {
|
|
620
|
+
return this.parent.currentView === 'Month' &&
|
|
621
|
+
(!isNullOrUndefined(this.parent.activeViewOptions.displayDate) || this.parent.activeViewOptions.numberOfWeeks > 0);
|
|
622
|
+
};
|
|
573
623
|
Month.prototype.getModuleName = function () {
|
|
574
624
|
return 'month';
|
|
575
625
|
};
|
|
@@ -18,7 +18,12 @@ var Render = /** @class */ (function () {
|
|
|
18
18
|
};
|
|
19
19
|
Render.prototype.initializeLayout = function (viewName) {
|
|
20
20
|
if (this.parent.activeView) {
|
|
21
|
-
|
|
21
|
+
var templates = [
|
|
22
|
+
'cellTemplate', 'eventTemplate', 'tooltipTemplate', 'majorSlotTemplate', 'minorSlotTemplate',
|
|
23
|
+
'headerTooltipTemplate', 'dateHeaderTemplate', 'dayHeaderTemplate', 'mothHeaderTemplate',
|
|
24
|
+
'headerIndentTemplate', 'resourceHeaderTemplate', 'cellHeaderTemplate'
|
|
25
|
+
];
|
|
26
|
+
this.parent.resetTemplates(templates);
|
|
22
27
|
this.parent.activeView.removeEventListener();
|
|
23
28
|
this.parent.activeView.destroy();
|
|
24
29
|
}
|
|
@@ -43,6 +43,9 @@ var TimelineYear = /** @class */ (function (_super) {
|
|
|
43
43
|
tr.appendChild(leftHeaderCells);
|
|
44
44
|
leftHeaderCells.appendChild(this.renderResourceHeader(cls.LEFT_INDENT_WRAP_CLASS));
|
|
45
45
|
}
|
|
46
|
+
var isHorizontal = this.parent.activeViewOptions.orientation === 'Horizontal';
|
|
47
|
+
var isGroup = this.parent.activeViewOptions.group.resources.length > 0;
|
|
48
|
+
this.isInverseTableSelect = isHorizontal && !isGroup ? false : true;
|
|
46
49
|
var td = createElement('td');
|
|
47
50
|
tr.appendChild(td);
|
|
48
51
|
var container = createElement('div', { className: cls.DATE_HEADER_CONTAINER_CLASS });
|
|
@@ -75,7 +78,7 @@ var TimelineYear = /** @class */ (function (_super) {
|
|
|
75
78
|
}
|
|
76
79
|
else {
|
|
77
80
|
if (this.parent.monthHeaderTemplate) {
|
|
78
|
-
append(this.renderDayMonthHeaderTemplate(date, months[column], '
|
|
81
|
+
append(this.renderDayMonthHeaderTemplate(date, months[column], 'monthHeaderTemplate'), innerTd);
|
|
79
82
|
}
|
|
80
83
|
else {
|
|
81
84
|
innerTd.innerHTML = "<span>" + this.getMonthName(date) + "</span>";
|
|
@@ -209,6 +209,10 @@ var ViewBase = /** @class */ (function () {
|
|
|
209
209
|
return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
|
|
210
210
|
};
|
|
211
211
|
ViewBase.prototype.isCurrentMonth = function (date) {
|
|
212
|
+
if (this.parent.activeViewOptions.displayDate || this.parent.activeViewOptions.numberOfWeeks > 0) {
|
|
213
|
+
return this.parent.activeView.getStartDate().getTime() <= this.parent.getCurrentTime().getTime() &&
|
|
214
|
+
this.parent.activeView.getEndDate().getTime() >= this.parent.getCurrentTime().getTime();
|
|
215
|
+
}
|
|
212
216
|
return date.getFullYear() ===
|
|
213
217
|
this.parent.getCurrentTime().getFullYear() && date.getMonth() === this.parent.getCurrentTime().getMonth();
|
|
214
218
|
};
|
|
@@ -433,7 +437,7 @@ var ViewBase = /** @class */ (function () {
|
|
|
433
437
|
if (this.isTimelineView()) {
|
|
434
438
|
var colElements = this.getColElements();
|
|
435
439
|
var contentBody = this.element.querySelector('.' + cls.CONTENT_TABLE_CLASS + ' tbody');
|
|
436
|
-
var colWidth_1 =
|
|
440
|
+
var colWidth_1 = (contentBody.getBoundingClientRect().width / (colElements.length / 2));
|
|
437
441
|
colElements.forEach(function (col) { return setStyleAttribute(col, { 'width': formatUnit(colWidth_1) }); });
|
|
438
442
|
if (content.offsetHeight !== content.clientHeight) {
|
|
439
443
|
var resourceColumn = this.parent.element.querySelector('.' + cls.RESOURCE_COLUMN_WRAP_CLASS);
|
|
@@ -441,6 +445,13 @@ var ViewBase = /** @class */ (function () {
|
|
|
441
445
|
setStyleAttribute(resourceColumn, { 'height': formatUnit(content.clientHeight) });
|
|
442
446
|
}
|
|
443
447
|
}
|
|
448
|
+
var cssClass = "." + cls.HEADER_CELLS_CLASS + ",." + cls.TIME_SLOT_CLASS + ",." + cls.HEADER_WEEK_CELLS_CLASS + ",." + cls.HEADER_MONTH_CELLS_CLASS + ",." + cls.HEADER_YEAR_CELLS_CLASS;
|
|
449
|
+
var headerCellElements = [].slice.call(this.element.querySelectorAll(cssClass));
|
|
450
|
+
headerCellElements.forEach(function (ele) {
|
|
451
|
+
var colSpan = isNullOrUndefined(ele.getAttribute('colspan')) ? '1' : ele.getAttribute('colspan');
|
|
452
|
+
var headerCellColSpan = parseInt(colSpan, 10);
|
|
453
|
+
setStyleAttribute(ele, { 'width': formatUnit(colWidth_1 * headerCellColSpan) });
|
|
454
|
+
});
|
|
444
455
|
}
|
|
445
456
|
};
|
|
446
457
|
ViewBase.prototype.resetColWidth = function () {
|
|
@@ -29,8 +29,8 @@ export declare class Year extends ViewBase implements IRenderer {
|
|
|
29
29
|
private onCellClick;
|
|
30
30
|
onContentScroll(e: Event): void;
|
|
31
31
|
onScrollUiUpdate(args: NotifyEventArgs): void;
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
getStartDate(): Date;
|
|
33
|
+
getEndDate(): Date;
|
|
34
34
|
startDate(): Date;
|
|
35
35
|
endDate(): Date;
|
|
36
36
|
getEndDateFromStartDate(start: Date): Date;
|
|
@@ -236,10 +236,27 @@ var Year = /** @class */ (function (_super) {
|
|
|
236
236
|
Year.prototype.onCellClick = function (e) {
|
|
237
237
|
var target = closest(e.target, '.' + cls.WORK_CELLS_CLASS);
|
|
238
238
|
var startDate = this.parent.getDateFromElement(target);
|
|
239
|
-
|
|
240
|
-
var
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
240
|
+
var isPrevious = startDate.getTime() < this.getStartDate().getTime();
|
|
241
|
+
if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
|
|
242
|
+
this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
|
|
243
|
+
var activeDate = this.parent.activeCellsData.startTime.getTime();
|
|
244
|
+
var inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
|
|
245
|
+
var dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
|
|
246
|
+
var selectedCell = this.parent.element.querySelector(':not(.' + cls.OTHERMONTH_CLASS + ')[data-date="' + dateAttr + '"]');
|
|
247
|
+
this.parent.selectCell(selectedCell);
|
|
248
|
+
this.parent.activeCellsData = this.parent.getCellDetails(selectedCell);
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
var endDate = util.addDays(new Date(startDate.getTime()), 1);
|
|
252
|
+
var filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
|
|
253
|
+
var moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
|
|
254
|
+
if (target.classList.contains(cls.OTHERMONTH_CLASS)) {
|
|
255
|
+
target = this.parent.element.querySelector(':not(.' + cls.OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
|
|
256
|
+
}
|
|
257
|
+
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
258
|
+
this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
|
|
259
|
+
}
|
|
243
260
|
};
|
|
244
261
|
Year.prototype.onContentScroll = function (e) {
|
|
245
262
|
var target = e.target;
|
|
@@ -291,10 +308,10 @@ var Year = /** @class */ (function (_super) {
|
|
|
291
308
|
return util.addDays(util.addMonths(this.getStartDate(), this.parent.monthsCount), -1);
|
|
292
309
|
};
|
|
293
310
|
Year.prototype.startDate = function () {
|
|
294
|
-
return util.getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek);
|
|
311
|
+
return this.parent.currentView === 'Year' ? util.getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek) : this.getStartDate();
|
|
295
312
|
};
|
|
296
313
|
Year.prototype.endDate = function () {
|
|
297
|
-
return util.addDays(util.getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1);
|
|
314
|
+
return this.parent.currentView === 'Year' ? util.addDays(util.getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1) : this.getEndDate();
|
|
298
315
|
};
|
|
299
316
|
Year.prototype.getEndDateFromStartDate = function (start) {
|
|
300
317
|
var date = new Date(start.getTime());
|
|
@@ -337,6 +354,7 @@ var Year = /** @class */ (function (_super) {
|
|
|
337
354
|
EventHandler.add(element, 'click', this.onCellClick, this);
|
|
338
355
|
}
|
|
339
356
|
else {
|
|
357
|
+
EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
|
|
340
358
|
EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
|
|
341
359
|
if (!this.parent.isAdaptive) {
|
|
342
360
|
EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
|