@syncfusion/ej2-schedule 19.3.55 → 19.4.38
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 +24 -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 +423 -101
- package/dist/es6/ej2-schedule.es2015.js.map +1 -1
- package/dist/es6/ej2-schedule.es5.js +427 -108
- 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/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 +14 -3
- 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 +1 -0
- package/src/schedule/event-renderer/event-base.js +18 -2
- package/src/schedule/event-renderer/inline-edit.js +8 -5
- package/src/schedule/event-renderer/month.js +1 -1
- 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 +22 -8
- package/src/schedule/renderer/month.d.ts +4 -0
- package/src/schedule/renderer/month.js +68 -19
- package/src/schedule/renderer/timeline-year.js +3 -0
- package/src/schedule/renderer/view-base.js +9 -0
- 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
|
@@ -91,6 +91,7 @@ const cellMouseDown = 'cell-mouse-down';
|
|
|
91
91
|
* Schedule common utilities
|
|
92
92
|
*/
|
|
93
93
|
const WEEK_LENGTH = 7;
|
|
94
|
+
const DEFAULT_WEEKS = 6;
|
|
94
95
|
const MS_PER_DAY = 86400000;
|
|
95
96
|
const MS_PER_MINUTE = 60000;
|
|
96
97
|
/**
|
|
@@ -1243,8 +1244,10 @@ class HeaderRenderer {
|
|
|
1243
1244
|
enableRtl: this.parent.enableRtl
|
|
1244
1245
|
});
|
|
1245
1246
|
const calendarView = this.getCalendarView();
|
|
1247
|
+
const isDisplayDate = this.parent.currentView === 'Month' &&
|
|
1248
|
+
!isNullOrUndefined(this.parent.activeViewOptions.displayDate) && !this.hasSelectedDate();
|
|
1246
1249
|
this.headerCalendar = new Calendar({
|
|
1247
|
-
value: this.parent.selectedDate,
|
|
1250
|
+
value: isDisplayDate ? this.parent.activeViewOptions.displayDate : this.parent.selectedDate,
|
|
1248
1251
|
min: this.parent.minDate,
|
|
1249
1252
|
max: this.parent.maxDate,
|
|
1250
1253
|
firstDayOfWeek: this.parent.activeViewOptions.firstDayOfWeek,
|
|
@@ -1332,8 +1335,13 @@ class HeaderRenderer {
|
|
|
1332
1335
|
this.parent.changeView('TimelineYear', args.originalEvent, undefined, this.calculateViewIndex(args));
|
|
1333
1336
|
break;
|
|
1334
1337
|
case 'e-today':
|
|
1335
|
-
|
|
1336
|
-
|
|
1338
|
+
const currentTime = resetTime(this.parent.getCurrentTime());
|
|
1339
|
+
if (this.parent.currentView === 'Agenda' || !this.parent.isSelectedDate(currentTime) ||
|
|
1340
|
+
this.parent.currentView === 'Month' && this.parent.activeViewOptions.displayDate && !this.hasSelectedDate() &&
|
|
1341
|
+
resetTime(this.parent.activeViewOptions.displayDate) !== currentTime || this.parent.currentView === 'Month' &&
|
|
1342
|
+
this.parent.activeViewOptions.numberOfWeeks > 0 && !this.hasSelectedDate()
|
|
1343
|
+
&& resetTime(firstDateOfMonth(this.parent.selectedDate)) !== currentTime) {
|
|
1344
|
+
this.parent.changeDate(currentTime, args.originalEvent);
|
|
1337
1345
|
}
|
|
1338
1346
|
break;
|
|
1339
1347
|
case 'e-prev':
|
|
@@ -1368,6 +1376,11 @@ class HeaderRenderer {
|
|
|
1368
1376
|
toolbarPopUp.ej2_instances[0].hide({ name: 'SlideUp', duration: 100 });
|
|
1369
1377
|
}
|
|
1370
1378
|
}
|
|
1379
|
+
hasSelectedDate() {
|
|
1380
|
+
const selectedTime = resetTime(this.parent.selectedDate).getTime();
|
|
1381
|
+
return selectedTime >= this.parent.activeView.getStartDate().getTime() &&
|
|
1382
|
+
selectedTime <= this.parent.activeView.getEndDate().getTime();
|
|
1383
|
+
}
|
|
1371
1384
|
getHeaderElement() {
|
|
1372
1385
|
return this.toolbarObj.element;
|
|
1373
1386
|
}
|
|
@@ -1412,9 +1425,11 @@ class HeaderRenderer {
|
|
|
1412
1425
|
lastDate = addDays(firstDate, 7 * this.parent.activeViewOptions.interval);
|
|
1413
1426
|
}
|
|
1414
1427
|
if (this.parent.currentView === 'Month') {
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1428
|
+
const isCustomMonth = !isNullOrUndefined(this.parent.activeViewOptions.displayDate) ||
|
|
1429
|
+
this.parent.activeViewOptions.numberOfWeeks > 0;
|
|
1430
|
+
firstDate = isCustomMonth ? this.parent.activeView.getStartDate() : firstDateOfMonth(this.parent.selectedDate);
|
|
1431
|
+
lastDate = isCustomMonth ? this.parent.activeView.getEndDate() :
|
|
1432
|
+
lastDateOfMonth(addMonths(firstDate, this.parent.activeViewOptions.interval - 1));
|
|
1418
1433
|
}
|
|
1419
1434
|
if (!isNullOrUndefined(prevNavEle)) {
|
|
1420
1435
|
this.toolbarObj.enableItems(prevNavEle, firstDate > this.parent.minDate);
|
|
@@ -1945,6 +1960,9 @@ class KeyboardInteraction {
|
|
|
1945
1960
|
}
|
|
1946
1961
|
const queryStr = '.' + WORK_CELLS_CLASS + ',.' + ALLDAY_CELLS_CLASS + ',.' + HEADER_CELLS_CLASS;
|
|
1947
1962
|
const target = closest(e.target, queryStr);
|
|
1963
|
+
if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
|
|
1964
|
+
return;
|
|
1965
|
+
}
|
|
1948
1966
|
this.parent.activeCellsData = this.getSelectedElements(target);
|
|
1949
1967
|
const cellData = {};
|
|
1950
1968
|
if (this.parent.eventWindow) {
|
|
@@ -1968,6 +1986,9 @@ class KeyboardInteraction {
|
|
|
1968
1986
|
|| this.isPreventAction(e)) {
|
|
1969
1987
|
return;
|
|
1970
1988
|
}
|
|
1989
|
+
if (this.parent.currentView === 'TimelineYear' && e.target.classList.contains(OTHERMONTH_CLASS)) {
|
|
1990
|
+
return;
|
|
1991
|
+
}
|
|
1971
1992
|
const target = e.target;
|
|
1972
1993
|
if (closest(target, '.' + POPUP_WRAPPER_CLASS)) {
|
|
1973
1994
|
if (target.classList.contains(QUICK_POPUP_EVENT_DETAILS_CLASS) ||
|
|
@@ -2002,11 +2023,16 @@ class KeyboardInteraction {
|
|
|
2002
2023
|
this.parent.notify(inlineClick, inlineArgs);
|
|
2003
2024
|
}
|
|
2004
2025
|
else {
|
|
2005
|
-
this.parent.
|
|
2026
|
+
if (this.parent.currentView === 'Year') {
|
|
2027
|
+
target.click();
|
|
2028
|
+
}
|
|
2029
|
+
else {
|
|
2030
|
+
this.parent.notify(cellClick, args);
|
|
2031
|
+
}
|
|
2006
2032
|
}
|
|
2007
2033
|
return;
|
|
2008
2034
|
}
|
|
2009
|
-
if (target.classList.contains(INLINE_SUBJECT_CLASS)) {
|
|
2035
|
+
if (target.classList.contains(INLINE_SUBJECT_CLASS) && this.parent.inlineModule) {
|
|
2010
2036
|
this.parent.inlineModule.inlineCrudActions(target);
|
|
2011
2037
|
return;
|
|
2012
2038
|
}
|
|
@@ -2038,7 +2064,9 @@ class KeyboardInteraction {
|
|
|
2038
2064
|
}
|
|
2039
2065
|
getCells(isInverseTable, start, end) {
|
|
2040
2066
|
const tableEle = this.parent.getContentTable();
|
|
2041
|
-
|
|
2067
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2068
|
+
const query = isTimelineYear && !isInverseTable ? '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')' : 'td';
|
|
2069
|
+
let cells = [].slice.call(tableEle.querySelectorAll(query));
|
|
2042
2070
|
let maxRow = tableEle.rows.length;
|
|
2043
2071
|
let maxColumn = tableEle.rows[0].cells.length;
|
|
2044
2072
|
if (start && start.classList.contains(ALLDAY_CELLS_CLASS)) {
|
|
@@ -2053,7 +2081,11 @@ class KeyboardInteraction {
|
|
|
2053
2081
|
if (isInverseTable) {
|
|
2054
2082
|
for (let i = 0; i < maxColumn; i++) {
|
|
2055
2083
|
for (let j = 0; j < maxRow; j++) {
|
|
2056
|
-
|
|
2084
|
+
const cell = cells[maxColumn * j + i];
|
|
2085
|
+
if (isTimelineYear && cell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2086
|
+
continue;
|
|
2087
|
+
}
|
|
2088
|
+
inverseCells.push(cell);
|
|
2057
2089
|
}
|
|
2058
2090
|
}
|
|
2059
2091
|
startIndex = inverseCells.indexOf(start);
|
|
@@ -2075,11 +2107,17 @@ class KeyboardInteraction {
|
|
|
2075
2107
|
return;
|
|
2076
2108
|
}
|
|
2077
2109
|
this.parent.eventBase.removeSelectedAppointmentClass();
|
|
2078
|
-
if (this.parent.activeView.isTimelineView()) {
|
|
2110
|
+
if (this.parent.activeView.isTimelineView() && this.parent.currentView !== 'TimelineYear') {
|
|
2079
2111
|
const cell = this.parent.element.querySelector('.' + CONTENT_TABLE_CLASS +
|
|
2080
2112
|
' tr:not(.' + HIDDEN_CLASS + ') .' + WORK_CELLS_CLASS + ':not(.' + RESOURCE_GROUP_CELLS_CLASS + ')');
|
|
2081
2113
|
this.selectCells(false, cell);
|
|
2082
2114
|
}
|
|
2115
|
+
else if (this.parent.currentView.indexOf('Year') > -1) {
|
|
2116
|
+
let query = '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')' + ':not(.' + RESOURCE_GROUP_CELLS_CLASS + ')';
|
|
2117
|
+
const isVerticalYear = this.parent.currentView === 'TimelineYear' && this.parent.activeViewOptions.orientation === 'Vertical';
|
|
2118
|
+
query += isVerticalYear ? '[data-date="' + this.parent.activeView.startDate().getTime() + '"]' : '';
|
|
2119
|
+
this.selectCells(false, this.parent.element.querySelector(query));
|
|
2120
|
+
}
|
|
2083
2121
|
else {
|
|
2084
2122
|
this.selectCells(false, this.parent.getWorkCellElements()[0]);
|
|
2085
2123
|
}
|
|
@@ -2100,13 +2138,21 @@ class KeyboardInteraction {
|
|
|
2100
2138
|
let target = (targetCell instanceof Array) ? targetCell.slice(-1)[0] : targetCell;
|
|
2101
2139
|
if (isMultiple) {
|
|
2102
2140
|
let initialId;
|
|
2103
|
-
const views = ['Day', 'Week', 'WorkWeek', '
|
|
2141
|
+
const views = ['Day', 'Week', 'WorkWeek', 'TimelineDay', 'TimelineWeek', 'TimelineWorkWeek', 'TimelineMonth', 'TimelineYear'];
|
|
2104
2142
|
const args = { element: targetCell, requestType: 'mousemove', allowMultipleRow: true };
|
|
2105
2143
|
this.parent.inlineModule.removeInlineAppointmentElement();
|
|
2106
2144
|
this.parent.trigger(select, args, (selectArgs) => {
|
|
2107
2145
|
const allowMultipleRow = (!selectArgs.allowMultipleRow) || (!this.parent.allowMultiRowSelection);
|
|
2108
|
-
if (allowMultipleRow
|
|
2109
|
-
|
|
2146
|
+
if (allowMultipleRow) {
|
|
2147
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2148
|
+
if (isTimelineYear && this.parent.activeViewOptions.orientation === 'Horizontal' || this.parent.currentView === 'Month') {
|
|
2149
|
+
const isGroupYear = isTimelineYear && this.parent.activeViewOptions.group.resources.length > 0;
|
|
2150
|
+
target = isGroupYear ? this.initialTarget :
|
|
2151
|
+
this.initialTarget.parentElement.children[target.cellIndex];
|
|
2152
|
+
}
|
|
2153
|
+
else if (views.indexOf(this.parent.currentView) > -1) {
|
|
2154
|
+
target = target.parentElement.children[this.initialTarget.cellIndex];
|
|
2155
|
+
}
|
|
2110
2156
|
}
|
|
2111
2157
|
let selectedCells = this.getCells(this.isInverseTableSelect(), this.initialTarget, target);
|
|
2112
2158
|
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
@@ -2239,8 +2285,20 @@ class KeyboardInteraction {
|
|
|
2239
2285
|
}
|
|
2240
2286
|
}
|
|
2241
2287
|
}
|
|
2288
|
+
cancelUpDownAction(isTimelineYear) {
|
|
2289
|
+
const isVerticalYear = isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical';
|
|
2290
|
+
const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
|
|
2291
|
+
if (isVerticalYear && isGroup || isTimelineYear && this.initialTarget.classList.contains(OTHERMONTH_CLASS)) {
|
|
2292
|
+
return true;
|
|
2293
|
+
}
|
|
2294
|
+
if (this.parent.activeView.isTimelineView() && !isTimelineYear || this.parent.currentView === 'MonthAgenda') {
|
|
2295
|
+
return true;
|
|
2296
|
+
}
|
|
2297
|
+
return false;
|
|
2298
|
+
}
|
|
2242
2299
|
processUp(e, isMultiple) {
|
|
2243
|
-
|
|
2300
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2301
|
+
if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
|
|
2244
2302
|
return;
|
|
2245
2303
|
}
|
|
2246
2304
|
let target = (e.target);
|
|
@@ -2263,8 +2321,22 @@ class KeyboardInteraction {
|
|
|
2263
2321
|
if (target.classList.contains(WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + POPUP_OPEN)) {
|
|
2264
2322
|
const tableRows = this.parent.getTableRows();
|
|
2265
2323
|
const curRowIndex = tableRows.indexOf(target.parentElement);
|
|
2266
|
-
|
|
2267
|
-
|
|
2324
|
+
let targetCell;
|
|
2325
|
+
if (isTimelineYear && isMultiple && this.parent.activeViewOptions.group.resources.length === 0) {
|
|
2326
|
+
targetCell = this.isInverseTableSelect() ? this.getVerticalUpDownCell(tableRows, target, curRowIndex, true) :
|
|
2327
|
+
this.getHorizontalUpDownCell(tableRows, target, curRowIndex, true);
|
|
2328
|
+
}
|
|
2329
|
+
if ((curRowIndex > 0 || targetCell) && curRowIndex < tableRows.length) {
|
|
2330
|
+
targetCell = targetCell ? targetCell : (tableRows[curRowIndex - 1]).cells[target.cellIndex];
|
|
2331
|
+
if (this.parent.currentView === 'Year' && targetCell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2332
|
+
if (this.parent.activeView.getStartDate().getTime() < +targetCell.getAttribute('data-date')) {
|
|
2333
|
+
targetCell = this.getYearUpDownCell(tableRows, curRowIndex - 1, target.cellIndex, true);
|
|
2334
|
+
}
|
|
2335
|
+
else {
|
|
2336
|
+
return;
|
|
2337
|
+
}
|
|
2338
|
+
}
|
|
2339
|
+
this.selectCells(isMultiple, targetCell);
|
|
2268
2340
|
}
|
|
2269
2341
|
}
|
|
2270
2342
|
else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
|
|
@@ -2272,7 +2344,8 @@ class KeyboardInteraction {
|
|
|
2272
2344
|
}
|
|
2273
2345
|
}
|
|
2274
2346
|
processDown(e, isMultiple) {
|
|
2275
|
-
|
|
2347
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2348
|
+
if (isMultiple && this.cancelUpDownAction(isTimelineYear)) {
|
|
2276
2349
|
return;
|
|
2277
2350
|
}
|
|
2278
2351
|
let target = (e.target);
|
|
@@ -2295,16 +2368,62 @@ class KeyboardInteraction {
|
|
|
2295
2368
|
}
|
|
2296
2369
|
if (target.classList.contains(WORK_CELLS_CLASS) && !this.parent.element.querySelector('.' + POPUP_OPEN)) {
|
|
2297
2370
|
const curRowIndex = tableRows.indexOf(target.parentElement);
|
|
2298
|
-
|
|
2299
|
-
|
|
2371
|
+
let targetCell;
|
|
2372
|
+
if (isTimelineYear && isMultiple && this.parent.activeViewOptions.group.resources.length === 0) {
|
|
2373
|
+
targetCell = this.isInverseTableSelect() ? this.getVerticalUpDownCell(tableRows, target, curRowIndex, false)
|
|
2374
|
+
: this.getHorizontalUpDownCell(tableRows, target, curRowIndex, false);
|
|
2375
|
+
}
|
|
2376
|
+
if (curRowIndex >= 0 && ((curRowIndex < tableRows.length - 1) || targetCell)) {
|
|
2377
|
+
targetCell = targetCell ? targetCell : (tableRows[curRowIndex + 1]).cells[target.cellIndex];
|
|
2378
|
+
if (this.parent.currentView === 'Year' && targetCell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2379
|
+
if (this.parent.activeView.getEndDate().getTime() > +targetCell.getAttribute('data-date')) {
|
|
2380
|
+
targetCell = this.getYearUpDownCell(tableRows, curRowIndex + 1, target.cellIndex, false);
|
|
2381
|
+
}
|
|
2382
|
+
else {
|
|
2383
|
+
return;
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
this.selectCells(isMultiple, targetCell);
|
|
2300
2387
|
}
|
|
2301
2388
|
}
|
|
2302
2389
|
else if (this.parent.currentView === 'Agenda' || this.parent.currentView === 'MonthAgenda') {
|
|
2303
2390
|
this.selectAppointment(false, target);
|
|
2304
2391
|
}
|
|
2305
2392
|
}
|
|
2393
|
+
getYearUpDownCell(tableRows, rowIndex, cellIndex, isUp) {
|
|
2394
|
+
while (tableRows[rowIndex] && tableRows[rowIndex].cells[cellIndex].classList.contains(OTHERMONTH_CLASS)) {
|
|
2395
|
+
rowIndex = rowIndex + (isUp ? -1 : 1);
|
|
2396
|
+
}
|
|
2397
|
+
return tableRows[rowIndex].cells[cellIndex];
|
|
2398
|
+
}
|
|
2399
|
+
// eslint-disable-next-line max-len
|
|
2400
|
+
getHorizontalUpDownCell(tableRows, target, curRowIndex, isUp) {
|
|
2401
|
+
const row = tableRows[curRowIndex + (isUp ? -1 : 1)];
|
|
2402
|
+
let cell = row ? row.cells[target.cellIndex] : target;
|
|
2403
|
+
if (cell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2404
|
+
const workCell = row.querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')');
|
|
2405
|
+
const date = new Date(+workCell.getAttribute('data-date'));
|
|
2406
|
+
const query = '[data-date="' + new Date(date.getFullYear(), date.getMonth() + 1, 0).getTime() + '"]';
|
|
2407
|
+
cell = cell.cellIndex < workCell.cellIndex ? workCell : row.querySelector(query);
|
|
2408
|
+
}
|
|
2409
|
+
return cell;
|
|
2410
|
+
}
|
|
2411
|
+
// eslint-disable-next-line max-len
|
|
2412
|
+
getVerticalUpDownCell(tableRows, target, curRowIndex, isUp) {
|
|
2413
|
+
const hasRow = isUp && curRowIndex > 0 || !isUp && curRowIndex < tableRows.length - 1;
|
|
2414
|
+
let targetCell = hasRow ? tableRows[curRowIndex + (isUp ? -1 : 1)].cells[target.cellIndex] : undefined;
|
|
2415
|
+
if (!targetCell || targetCell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2416
|
+
const column = tableRows[curRowIndex].cells[target.cellIndex - (isUp ? 1 : -1)];
|
|
2417
|
+
if (column) {
|
|
2418
|
+
const dateAttr = +target.getAttribute('data-date') - (isUp ? MS_PER_DAY : -MS_PER_DAY);
|
|
2419
|
+
return this.parent.getContentTable().querySelector('.' + WORK_CELLS_CLASS + '[data-date="' + dateAttr + '"]');
|
|
2420
|
+
}
|
|
2421
|
+
targetCell = target;
|
|
2422
|
+
}
|
|
2423
|
+
return targetCell;
|
|
2424
|
+
}
|
|
2306
2425
|
processLeftRight(target) {
|
|
2307
|
-
const tableEle = this.parent.getContentTable();
|
|
2426
|
+
const tableEle = (this.parent.currentView === 'Year' ? target.closest('tbody') : this.parent.getContentTable());
|
|
2308
2427
|
const curRowIndex = target.parentNode.sectionRowIndex;
|
|
2309
2428
|
const key = {
|
|
2310
2429
|
element: tableEle,
|
|
@@ -2317,8 +2436,9 @@ class KeyboardInteraction {
|
|
|
2317
2436
|
getQuickPopupElement() {
|
|
2318
2437
|
return (this.parent.isAdaptive ? document.body : this.parent.element).querySelector('.' + POPUP_WRAPPER_CLASS);
|
|
2319
2438
|
}
|
|
2320
|
-
isCancelLeftRightAction(e, isMultiple) {
|
|
2321
|
-
|
|
2439
|
+
isCancelLeftRightAction(e, isMultiple, isTimelineYear) {
|
|
2440
|
+
const prevent = this.parent.currentView === 'MonthAgenda' || isTimelineYear && this.initialTarget.classList.contains(OTHERMONTH_CLASS);
|
|
2441
|
+
if (this.parent.currentView === 'Agenda' || (isMultiple && prevent)) {
|
|
2322
2442
|
return true;
|
|
2323
2443
|
}
|
|
2324
2444
|
if (this.isPreventAction(e) && isMultiple) {
|
|
@@ -2332,7 +2452,8 @@ class KeyboardInteraction {
|
|
|
2332
2452
|
return false;
|
|
2333
2453
|
}
|
|
2334
2454
|
processRight(e, isMultiple) {
|
|
2335
|
-
|
|
2455
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2456
|
+
if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
|
|
2336
2457
|
return;
|
|
2337
2458
|
}
|
|
2338
2459
|
const selectedCells = this.parent.getSelectedElements();
|
|
@@ -2353,24 +2474,36 @@ class KeyboardInteraction {
|
|
|
2353
2474
|
if (target.classList.contains(WORK_CELLS_CLASS) &&
|
|
2354
2475
|
(e.target).classList.contains(WORK_CELLS_CLASS)) {
|
|
2355
2476
|
const key = this.processLeftRight(target);
|
|
2356
|
-
|
|
2477
|
+
const targetDate = new Date(+target.getAttribute('data-date'));
|
|
2478
|
+
const isMonthEnd = this.parent.currentView === 'Year' && targetDate.getTime() === lastDateOfMonth(targetDate).getTime();
|
|
2479
|
+
if (key.columnIndex >= 0 && key.columnIndex < key.maxIndex - 1 && !isMonthEnd) {
|
|
2357
2480
|
targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex + 1], 'right');
|
|
2481
|
+
if (isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2482
|
+
targetCell = this.getTimelineYearTargetCell(key, target, true);
|
|
2483
|
+
}
|
|
2358
2484
|
if (!isNullOrUndefined(targetCell)) {
|
|
2359
2485
|
this.selectCells(isMultiple, targetCell);
|
|
2360
2486
|
}
|
|
2361
2487
|
}
|
|
2362
|
-
else if (key.columnIndex === key.maxIndex - 1) {
|
|
2363
|
-
if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1) {
|
|
2488
|
+
else if (key.columnIndex === key.maxIndex - 1 || isMonthEnd) {
|
|
2489
|
+
if (!this.isInverseTableSelect() && key.rowIndex < key.element.rows.length - 1 && !isMonthEnd) {
|
|
2364
2490
|
targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex + 1].cells[0], 'right');
|
|
2491
|
+
const changeTargetCell = isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS);
|
|
2492
|
+
targetCell = changeTargetCell ? this.getHorizontalLeftRightCell(key, target, true) : targetCell;
|
|
2365
2493
|
if (!isNullOrUndefined(targetCell)) {
|
|
2366
2494
|
this.selectCells(isMultiple, targetCell);
|
|
2367
2495
|
}
|
|
2368
2496
|
}
|
|
2369
2497
|
else if (!isMultiple) {
|
|
2498
|
+
if (isMonthEnd && targetDate.getTime() !== this.parent.activeView.getEndDate().getTime()) {
|
|
2499
|
+
this.selectCells(isMultiple, this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + (targetDate.getTime() + MS_PER_DAY) + '"]'));
|
|
2500
|
+
return;
|
|
2501
|
+
}
|
|
2370
2502
|
const rowIndex = this.isInverseTableSelect() ? key.rowIndex : 0;
|
|
2371
2503
|
this.parent.changeDate(this.parent.activeView.getNextPreviousDate('next'), e);
|
|
2372
2504
|
const tableEle = this.parent.getContentTable();
|
|
2373
|
-
|
|
2505
|
+
const cell = isMonthEnd ? tableEle.rows[rowIndex].querySelector('.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')') : tableEle.rows[rowIndex].cells[0];
|
|
2506
|
+
this.selectCells(false, cell);
|
|
2374
2507
|
}
|
|
2375
2508
|
}
|
|
2376
2509
|
}
|
|
@@ -2389,7 +2522,8 @@ class KeyboardInteraction {
|
|
|
2389
2522
|
}
|
|
2390
2523
|
}
|
|
2391
2524
|
processLeft(e, isMultiple) {
|
|
2392
|
-
|
|
2525
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2526
|
+
if (this.isCancelLeftRightAction(e, isMultiple, isTimelineYear)) {
|
|
2393
2527
|
return;
|
|
2394
2528
|
}
|
|
2395
2529
|
let target = (e.target);
|
|
@@ -2410,24 +2544,40 @@ class KeyboardInteraction {
|
|
|
2410
2544
|
if ((e.target).classList.contains(WORK_CELLS_CLASS) &&
|
|
2411
2545
|
target.classList.contains(WORK_CELLS_CLASS)) {
|
|
2412
2546
|
const key = this.processLeftRight(target);
|
|
2413
|
-
|
|
2547
|
+
const targetDate = new Date(+target.getAttribute('data-date'));
|
|
2548
|
+
const isMonthStart = this.parent.currentView === 'Year' && targetDate.getTime() === firstDateOfMonth(targetDate).getTime();
|
|
2549
|
+
if (key.columnIndex > 0 && key.columnIndex < key.maxIndex && !isMonthStart) {
|
|
2414
2550
|
targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex].cells[target.cellIndex - 1], 'left');
|
|
2551
|
+
if (isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS)) {
|
|
2552
|
+
targetCell = this.getTimelineYearTargetCell(key, target, false);
|
|
2553
|
+
}
|
|
2415
2554
|
if (!isNullOrUndefined(targetCell)) {
|
|
2416
2555
|
this.selectCells(isMultiple, targetCell);
|
|
2417
2556
|
}
|
|
2418
2557
|
}
|
|
2419
|
-
else if (key.columnIndex === 0) {
|
|
2558
|
+
else if (key.columnIndex === 0 || isMonthStart) {
|
|
2420
2559
|
if (!this.isInverseTableSelect() && key.rowIndex > 0) {
|
|
2421
2560
|
targetCell = this.calculateNextPrevDate(target, key.element.rows[key.rowIndex - 1].cells[key.maxIndex - 1], 'left');
|
|
2561
|
+
const otherMonthCell = isTimelineYear && isMultiple && targetCell.classList.contains(OTHERMONTH_CLASS);
|
|
2562
|
+
targetCell = otherMonthCell ? this.getHorizontalLeftRightCell(key, target, false) : targetCell;
|
|
2422
2563
|
if (!isNullOrUndefined(targetCell)) {
|
|
2423
2564
|
this.selectCells(isMultiple, targetCell);
|
|
2424
2565
|
}
|
|
2425
2566
|
}
|
|
2426
2567
|
else if (!isMultiple) {
|
|
2568
|
+
if (isMonthStart && targetDate.getTime() !== this.parent.activeView.getStartDate().getTime()) {
|
|
2569
|
+
this.selectCells(isMultiple, this.parent.element.querySelector('[data-date="' + (targetDate.getTime() - MS_PER_DAY) + '"]'));
|
|
2570
|
+
return;
|
|
2571
|
+
}
|
|
2427
2572
|
this.parent.changeDate(this.parent.activeView.getNextPreviousDate('previous'), e);
|
|
2428
2573
|
const tableEle = this.parent.getContentTable();
|
|
2429
2574
|
const rowIndex = this.isInverseTableSelect() ? key.rowIndex : tableEle.rows.length - 1;
|
|
2430
|
-
|
|
2575
|
+
let cell = tableEle.rows[rowIndex].cells[key.maxIndex - 1];
|
|
2576
|
+
if (isMonthStart) {
|
|
2577
|
+
const tbody = this.parent.element.querySelectorAll('.' + CONTENT_TABLE_CLASS + ' tbody');
|
|
2578
|
+
cell = tbody.item(tbody.length - 1).querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + this.parent.activeView.getEndDate().getTime() + '"]');
|
|
2579
|
+
}
|
|
2580
|
+
this.selectCells(false, cell);
|
|
2431
2581
|
}
|
|
2432
2582
|
}
|
|
2433
2583
|
}
|
|
@@ -2445,6 +2595,29 @@ class KeyboardInteraction {
|
|
|
2445
2595
|
}
|
|
2446
2596
|
}
|
|
2447
2597
|
}
|
|
2598
|
+
getTimelineYearTargetCell(key, target, isRight) {
|
|
2599
|
+
return this.isInverseTableSelect() ? this.getVerticalLeftRightCell(target, isRight) :
|
|
2600
|
+
this.getHorizontalLeftRightCell(key, target, isRight);
|
|
2601
|
+
}
|
|
2602
|
+
getHorizontalLeftRightCell(key, target, isRight) {
|
|
2603
|
+
const row = key.element.rows[target.parentNode.sectionRowIndex + (isRight ? 1 : -1)];
|
|
2604
|
+
if (row) {
|
|
2605
|
+
const query = isRight ? '.' + WORK_CELLS_CLASS + ':not(.' + OTHERMONTH_CLASS + ')'
|
|
2606
|
+
: '[data-date="' + ((+target.getAttribute('data-date')) - MS_PER_DAY) + '"]';
|
|
2607
|
+
return row.querySelector(query);
|
|
2608
|
+
}
|
|
2609
|
+
return target;
|
|
2610
|
+
}
|
|
2611
|
+
getVerticalLeftRightCell(target, isRight) {
|
|
2612
|
+
const date = new Date(+target.getAttribute('data-date'));
|
|
2613
|
+
const start = new Date(date.getFullYear(), date.getMonth() + (isRight ? 1 : -1), 1);
|
|
2614
|
+
const tableEle = this.parent.getContentTable();
|
|
2615
|
+
const targetCell = tableEle.querySelector('[data-date="' + start.getTime() + '"]');
|
|
2616
|
+
if (targetCell.parentNode.sectionRowIndex > target.parentNode.sectionRowIndex) {
|
|
2617
|
+
return targetCell;
|
|
2618
|
+
}
|
|
2619
|
+
return tableEle.querySelector('[data-date="' + new Date(start.getFullYear(), start.getMonth() + 1, 0).getTime() + '"]');
|
|
2620
|
+
}
|
|
2448
2621
|
calculateNextPrevDate(currentCell, target, type) {
|
|
2449
2622
|
const initialId = this.initialTarget.getAttribute('data-group-index');
|
|
2450
2623
|
if (this.parent.activeViewOptions.group.resources.length > 0 && this.parent.currentView === 'Month') {
|
|
@@ -2488,6 +2661,16 @@ class KeyboardInteraction {
|
|
|
2488
2661
|
}
|
|
2489
2662
|
processTab(e, isReverse) {
|
|
2490
2663
|
let target = e.target;
|
|
2664
|
+
if (target.classList.contains(INLINE_SUBJECT_CLASS) && this.parent.inlineModule) {
|
|
2665
|
+
target = target.closest('.e-appointment');
|
|
2666
|
+
this.parent.inlineModule.inlineCrudActions(e.target);
|
|
2667
|
+
}
|
|
2668
|
+
if (this.parent.currentView === 'TimelineYear' && target.classList.contains(OTHERMONTH_CLASS)) {
|
|
2669
|
+
if (target.classList.contains(SELECTED_CELL_CLASS)) {
|
|
2670
|
+
this.parent.removeSelectedClass();
|
|
2671
|
+
}
|
|
2672
|
+
return;
|
|
2673
|
+
}
|
|
2491
2674
|
const popupWrapper = closest(target, '.' + POPUP_WRAPPER_CLASS + ',.' + MORE_POPUP_WRAPPER_CLASS);
|
|
2492
2675
|
if (popupWrapper && popupWrapper.classList.contains(POPUP_OPEN)) {
|
|
2493
2676
|
if (popupWrapper.classList.contains(MORE_POPUP_WRAPPER_CLASS)) {
|
|
@@ -2529,7 +2712,9 @@ class KeyboardInteraction {
|
|
|
2529
2712
|
}
|
|
2530
2713
|
if (target.classList.contains(APPOINTMENT_CLASS)) {
|
|
2531
2714
|
let appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
2532
|
-
|
|
2715
|
+
const isTimelineYear = this.parent.currentView === 'TimelineYear';
|
|
2716
|
+
const isTimeline = this.parent.activeView.isTimelineView() && !isTimelineYear;
|
|
2717
|
+
if ((isTimeline || isTimelineYear && this.parent.activeViewOptions.orientation === 'Vertical') && this.parent.activeViewOptions.group.resources.length > 0) {
|
|
2533
2718
|
const index = parseInt(target.getAttribute('data-group-index'), 10);
|
|
2534
2719
|
appElements = [].slice.call(this.parent.element.querySelectorAll(`.${APPOINTMENT_CLASS}[data-group-index="${index}"]`));
|
|
2535
2720
|
const resCellSelector = `.${RESOURCE_CELLS_CLASS}[data-group-index="${isReverse ? index : index + 1}"]`;
|
|
@@ -2578,7 +2763,6 @@ class KeyboardInteraction {
|
|
|
2578
2763
|
this.processTabOnResourceCells(target, isReverse);
|
|
2579
2764
|
}
|
|
2580
2765
|
}
|
|
2581
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2582
2766
|
processDelete(e) {
|
|
2583
2767
|
let activeEle = document.activeElement;
|
|
2584
2768
|
if (this.parent.currentView === 'MonthAgenda') {
|
|
@@ -5579,7 +5763,8 @@ class EventBase {
|
|
|
5579
5763
|
}
|
|
5580
5764
|
eventClick(eventData) {
|
|
5581
5765
|
const target = eventData.target;
|
|
5582
|
-
if (target.classList.contains(DRAG_CLONE_CLASS) || target.classList.contains(RESIZE_CLONE_CLASS)
|
|
5766
|
+
if (target.classList.contains(DRAG_CLONE_CLASS) || target.classList.contains(RESIZE_CLONE_CLASS) ||
|
|
5767
|
+
target.classList.contains(INLINE_SUBJECT_CLASS)) {
|
|
5583
5768
|
return;
|
|
5584
5769
|
}
|
|
5585
5770
|
if ((eventData.ctrlKey || eventData.metaKey) && eventData.which === 1 && this.parent.keyboardInteractionModule) {
|
|
@@ -6028,13 +6213,28 @@ class EventBase {
|
|
|
6028
6213
|
indentHeight = dateHeader.offsetHeight - indentHeight;
|
|
6029
6214
|
this.parent.element.querySelector('.' + ALLDAY_CELLS_CLASS).style.height = (indentHeight / 12) + 'em';
|
|
6030
6215
|
const content = this.parent.element.querySelector('.' + CONTENT_WRAP_CLASS);
|
|
6031
|
-
if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged)) {
|
|
6216
|
+
if (this.parent.uiStateValues.expand && (content.offsetWidth - content.clientWidth > 0 || heightPropChanged || this.parent.element.classList.contains(DEVICE_CLASS))) {
|
|
6032
6217
|
addClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
|
|
6033
6218
|
}
|
|
6034
6219
|
else {
|
|
6035
6220
|
removeClass([dateHeader], ALLDAY_APPOINTMENT_SCROLL);
|
|
6036
6221
|
}
|
|
6037
6222
|
}
|
|
6223
|
+
updateEventMinimumDuration(startEndHours, startTime, endTime) {
|
|
6224
|
+
const eventDuration = (getUniversalTime(endTime) - getUniversalTime(startTime)) / MS_PER_MINUTE;
|
|
6225
|
+
if (eventDuration < this.parent.eventSettings.minimumEventDuration) {
|
|
6226
|
+
const tempEnd = new Date(startTime);
|
|
6227
|
+
tempEnd.setMinutes(tempEnd.getMinutes() + this.parent.eventSettings.minimumEventDuration);
|
|
6228
|
+
endTime = tempEnd;
|
|
6229
|
+
if (endTime.getTime() > startEndHours.endHour.getTime()) {
|
|
6230
|
+
const tempStart = new Date(startEndHours.endHour.getTime());
|
|
6231
|
+
tempStart.setMinutes(tempStart.getMinutes() - this.parent.eventSettings.minimumEventDuration);
|
|
6232
|
+
startTime = tempStart;
|
|
6233
|
+
endTime = startEndHours.endHour;
|
|
6234
|
+
}
|
|
6235
|
+
}
|
|
6236
|
+
return { startDate: startTime, endDate: endTime };
|
|
6237
|
+
}
|
|
6038
6238
|
unWireEvents() {
|
|
6039
6239
|
const appElements = [].slice.call(this.parent.element.querySelectorAll('.' + APPOINTMENT_CLASS));
|
|
6040
6240
|
for (const element of appElements) {
|
|
@@ -6436,18 +6636,21 @@ class VerticalEvent extends EventBase {
|
|
|
6436
6636
|
if (currentDay.length === 0) {
|
|
6437
6637
|
currentDate = resetTime(renderedDate[0]);
|
|
6438
6638
|
}
|
|
6439
|
-
const
|
|
6440
|
-
const
|
|
6639
|
+
const field = this.parent.eventFields;
|
|
6640
|
+
const schedule = getStartEndHours(currentDate, this.startHour, this.endHour);
|
|
6441
6641
|
const event = extend({}, record, null, true);
|
|
6442
6642
|
event.isSpanned = { isBottom: false, isTop: false };
|
|
6443
|
-
if (record[
|
|
6444
|
-
event[
|
|
6643
|
+
if (record[field.startTime].getTime() < schedule.startHour.getTime()) {
|
|
6644
|
+
event[field.startTime] = schedule.startHour;
|
|
6445
6645
|
event.isSpanned.isTop = true;
|
|
6446
6646
|
}
|
|
6447
|
-
if (record[
|
|
6448
|
-
event[
|
|
6647
|
+
if (record[field.endTime].getTime() > schedule.endHour.getTime()) {
|
|
6648
|
+
event[field.endTime] = schedule.endHour;
|
|
6449
6649
|
event.isSpanned.isBottom = true;
|
|
6450
6650
|
}
|
|
6651
|
+
const eventDates = this.updateEventMinimumDuration(schedule, event[field.startTime], event[field.endTime]);
|
|
6652
|
+
event[field.startTime] = eventDates.startDate;
|
|
6653
|
+
event[field.endTime] = eventDates.endDate;
|
|
6451
6654
|
return event;
|
|
6452
6655
|
}
|
|
6453
6656
|
renderAllDayEvents(eventObj, dayIndex, resource, dayCount, inline) {
|
|
@@ -6981,7 +7184,7 @@ class MonthEvent extends EventBase {
|
|
|
6981
7184
|
this.cellHeight = cellDetail.height;
|
|
6982
7185
|
this.dateRender = dateRender;
|
|
6983
7186
|
const filteredDates = this.getRenderedDates(dateRender);
|
|
6984
|
-
this.getSlotDates(workDays);
|
|
7187
|
+
this.getSlotDates(workDays || this.parent.activeViewOptions.workDays);
|
|
6985
7188
|
this.processBlockEvents(blockList, resIndex, resData);
|
|
6986
7189
|
for (const event of eventsList) {
|
|
6987
7190
|
if (this.parent.resourceBase && !resData) {
|
|
@@ -7607,6 +7810,10 @@ class TimelineEvent extends MonthEvent {
|
|
|
7607
7810
|
const eventData = event.data;
|
|
7608
7811
|
startTime = this.getStartTime(event, eventData);
|
|
7609
7812
|
endTime = this.getEndTime(event, eventData);
|
|
7813
|
+
const startEndHours = getStartEndHours(event[this.fields.startTime], this.startHour, this.endHour);
|
|
7814
|
+
const eventDates = this.updateEventMinimumDuration(startEndHours, startTime, endTime);
|
|
7815
|
+
startTime = eventDates.startDate;
|
|
7816
|
+
endTime = eventDates.endDate;
|
|
7610
7817
|
this.day = this.parent.getIndexOfDate(this.dateRender, resetTime(new Date(startTime.getTime())));
|
|
7611
7818
|
if (this.day < 0) {
|
|
7612
7819
|
return;
|
|
@@ -7993,11 +8200,11 @@ class InlineEdit {
|
|
|
7993
8200
|
if (this.parent.quickPopup) {
|
|
7994
8201
|
this.parent.quickPopup.quickPopupHide();
|
|
7995
8202
|
}
|
|
7996
|
-
const moreWrapper = this.parent.element.querySelector('.e-more-popup-wrapper ');
|
|
7997
|
-
if (moreWrapper && moreWrapper.classList.contains(POPUP_OPEN)) {
|
|
7998
|
-
this.parent.quickPopup.morePopup.hide();
|
|
7999
|
-
}
|
|
8000
8203
|
if (args.type === 'Cell') {
|
|
8204
|
+
const moreWrapper = this.parent.element.querySelector('.' + MORE_POPUP_WRAPPER_CLASS);
|
|
8205
|
+
if (moreWrapper && moreWrapper.classList.contains(POPUP_OPEN)) {
|
|
8206
|
+
this.parent.quickPopup.morePopup.hide();
|
|
8207
|
+
}
|
|
8001
8208
|
this.removeInlineAppointmentElement();
|
|
8002
8209
|
this.cellEdit(args);
|
|
8003
8210
|
}
|
|
@@ -8060,8 +8267,8 @@ class InlineEdit {
|
|
|
8060
8267
|
'.e-inner-wrap' : '.e-appointment-details';
|
|
8061
8268
|
args.element.querySelector(elementSelector).insertBefore(inlineSubject, timeEle);
|
|
8062
8269
|
}
|
|
8270
|
+
inlineSubject.focus();
|
|
8063
8271
|
}
|
|
8064
|
-
inlineSubject.focus();
|
|
8065
8272
|
inlineSubject.setSelectionRange(subject.length, subject.length);
|
|
8066
8273
|
}
|
|
8067
8274
|
createVerticalViewInline(saveObj, dayIndex, resIndex, daysCount) {
|
|
@@ -8155,6 +8362,9 @@ class InlineEdit {
|
|
|
8155
8362
|
if (target && target.value !== '') {
|
|
8156
8363
|
this.inlineCrudActions(target);
|
|
8157
8364
|
}
|
|
8365
|
+
else {
|
|
8366
|
+
this.removeInlineAppointmentElement();
|
|
8367
|
+
}
|
|
8158
8368
|
}
|
|
8159
8369
|
inlineCrudActions(target) {
|
|
8160
8370
|
if (closest(target, '.' + INLINE_APPOINTMENT_CLASS)) {
|
|
@@ -9188,6 +9398,9 @@ class QuickPopups {
|
|
|
9188
9398
|
}
|
|
9189
9399
|
closeClick(event) {
|
|
9190
9400
|
this.dialogEvent = event;
|
|
9401
|
+
if (this.parent.currentView === 'Year' && this.parent.activeCellsData && this.parent.activeCellsData.element) {
|
|
9402
|
+
this.parent.selectCell(this.parent.activeCellsData.element);
|
|
9403
|
+
}
|
|
9191
9404
|
this.quickPopupHide();
|
|
9192
9405
|
this.morePopup.hide();
|
|
9193
9406
|
}
|
|
@@ -9771,6 +9984,7 @@ const INTERVALCLASS = 'e-interval';
|
|
|
9771
9984
|
const DAYWRAPPER = 'e-days';
|
|
9772
9985
|
const WEEKWRAPPER = 'e-non-week';
|
|
9773
9986
|
const WEEKPOSITION = 'e-week-position';
|
|
9987
|
+
const DAYPOSITION = 'e-day-position';
|
|
9774
9988
|
const YEAREXPANDERWRAPPER = 'e-year-expander';
|
|
9775
9989
|
const YEAREXPANDERELEMENT = 'e-year-expander-element';
|
|
9776
9990
|
const MONETHEXPANDERWRAPPER = 'e-month-expander';
|
|
@@ -10115,7 +10329,6 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
|
|
|
10115
10329
|
}
|
|
10116
10330
|
});
|
|
10117
10331
|
this.endType.appendTo(this.element.querySelector('.' + ENDONELEMENT));
|
|
10118
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
10119
10332
|
const renderDropDownList = (dropDownData) => {
|
|
10120
10333
|
return new DropDownList({
|
|
10121
10334
|
dataSource: dropDownData,
|
|
@@ -10477,7 +10690,7 @@ let RecurrenceEditor = class RecurrenceEditor extends Component {
|
|
|
10477
10690
|
'<td><div class="' + INPUTWARAPPER + ' ' + WEEKPOSITION + '" >' +
|
|
10478
10691
|
'<input type="text" tabindex="0" class="' + MONTHPOS + '"title="' + this.localeObj.getConstant('monthPosition') + '" />' +
|
|
10479
10692
|
'</div></td>' +
|
|
10480
|
-
'<td><div class="' + INPUTWARAPPER + '
|
|
10693
|
+
'<td><div class="' + INPUTWARAPPER + ' ' + DAYPOSITION + '">' +
|
|
10481
10694
|
'<input type="text" tabindex="0" class="' + MONTHWEEK + '"title="' + this.localeObj.getConstant('monthWeek') + '" />' +
|
|
10482
10695
|
'</div></td></tr></table>' +
|
|
10483
10696
|
'</div></div>' +
|
|
@@ -13927,12 +14140,15 @@ __decorate$6([
|
|
|
13927
14140
|
__decorate$6([
|
|
13928
14141
|
Property(false)
|
|
13929
14142
|
], EventSettings.prototype, "enableTooltip", void 0);
|
|
13930
|
-
__decorate$6([
|
|
13931
|
-
Property()
|
|
13932
|
-
], EventSettings.prototype, "tooltipTemplate", void 0);
|
|
13933
14143
|
__decorate$6([
|
|
13934
14144
|
Property('AllDayRow')
|
|
13935
14145
|
], EventSettings.prototype, "spannedEventPlacement", void 0);
|
|
14146
|
+
__decorate$6([
|
|
14147
|
+
Property(1)
|
|
14148
|
+
], EventSettings.prototype, "minimumEventDuration", void 0);
|
|
14149
|
+
__decorate$6([
|
|
14150
|
+
Property()
|
|
14151
|
+
], EventSettings.prototype, "tooltipTemplate", void 0);
|
|
13936
14152
|
__decorate$6([
|
|
13937
14153
|
Property()
|
|
13938
14154
|
], EventSettings.prototype, "resourceColorField", void 0);
|
|
@@ -14381,6 +14597,7 @@ class ResourceBase {
|
|
|
14381
14597
|
targetType: 'relative',
|
|
14382
14598
|
actionOnScroll: 'none',
|
|
14383
14599
|
content: this.treeViewObj.element,
|
|
14600
|
+
relateTo: this.parent.element.querySelector('.' + TABLE_CONTAINER_CLASS),
|
|
14384
14601
|
enableRtl: this.parent.enableRtl,
|
|
14385
14602
|
hideAnimation: { name: 'SlideLeftOut', duration: 500 },
|
|
14386
14603
|
showAnimation: { name: 'SlideLeftIn', duration: 500 },
|
|
@@ -15279,13 +15496,19 @@ let Schedule = class Schedule extends Component {
|
|
|
15279
15496
|
timeFormat: this.internalTimeFormat,
|
|
15280
15497
|
group: group,
|
|
15281
15498
|
headerRows: this.headerRows,
|
|
15282
|
-
orientation: 'Horizontal'
|
|
15499
|
+
orientation: 'Horizontal',
|
|
15500
|
+
numberOfWeeks: 0,
|
|
15501
|
+
displayDate: null
|
|
15283
15502
|
};
|
|
15284
15503
|
const viewOptions = this.viewCollections[this.viewIndex];
|
|
15285
15504
|
const viewsData = extend(scheduleOptions, viewOptions, undefined, true);
|
|
15286
15505
|
if (this.firstDayOfWeek !== 0 && viewOptions.firstDayOfWeek && this.firstDayOfWeek !== viewOptions.firstDayOfWeek) {
|
|
15287
15506
|
viewsData.firstDayOfWeek = this.firstDayOfWeek;
|
|
15288
15507
|
}
|
|
15508
|
+
if (viewsData.displayDate) {
|
|
15509
|
+
viewsData.displayDate = viewsData.displayDate instanceof Date ? new Date(viewsData.displayDate.getTime()) :
|
|
15510
|
+
new Date(viewsData.displayDate);
|
|
15511
|
+
}
|
|
15289
15512
|
return viewsData;
|
|
15290
15513
|
}
|
|
15291
15514
|
initializeDataModule() {
|
|
@@ -15592,7 +15815,7 @@ let Schedule = class Schedule extends Component {
|
|
|
15592
15815
|
if (this && isNullOrUndefined(this.uiStateValues) || !(this.enablePersistence)) {
|
|
15593
15816
|
this.uiStateValues = {
|
|
15594
15817
|
expand: false, isInitial: true, left: 0, top: 0, isGroupAdaptive: false,
|
|
15595
|
-
isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false
|
|
15818
|
+
isIgnoreOccurrence: false, groupIndex: 0, action: false, isBlock: false, isCustomMonth: true
|
|
15596
15819
|
};
|
|
15597
15820
|
}
|
|
15598
15821
|
this.activeCellsData = { startTime: this.getCurrentTime(), endTime: this.getCurrentTime(), isAllDay: false };
|
|
@@ -16556,6 +16779,7 @@ let Schedule = class Schedule extends Component {
|
|
|
16556
16779
|
}
|
|
16557
16780
|
break;
|
|
16558
16781
|
case 'spannedEventPlacement':
|
|
16782
|
+
case 'minimumEventDuration':
|
|
16559
16783
|
case 'enableMaxHeight':
|
|
16560
16784
|
case 'enableIndicator':
|
|
16561
16785
|
this.refreshEvents(false);
|
|
@@ -16928,7 +17152,7 @@ let Schedule = class Schedule extends Component {
|
|
|
16928
17152
|
*/
|
|
16929
17153
|
exportToExcel(excelExportOptions) {
|
|
16930
17154
|
if (this.excelExportModule) {
|
|
16931
|
-
this.excelExportModule.initializeExcelExport(excelExportOptions
|
|
17155
|
+
this.excelExportModule.initializeExcelExport(excelExportOptions);
|
|
16932
17156
|
}
|
|
16933
17157
|
else {
|
|
16934
17158
|
throw Error('Inject ExcelExport module');
|
|
@@ -17112,6 +17336,9 @@ let Schedule = class Schedule extends Component {
|
|
|
17112
17336
|
this.crudModule.refreshDataManager();
|
|
17113
17337
|
}
|
|
17114
17338
|
else {
|
|
17339
|
+
if (this.activeViewOptions && this.activeViewOptions.eventTemplate) {
|
|
17340
|
+
this.resetTemplates(['eventTemplate']);
|
|
17341
|
+
}
|
|
17115
17342
|
const eventsData = this.eventsData || [];
|
|
17116
17343
|
const blockData = this.blockData || [];
|
|
17117
17344
|
const data = eventsData.concat(blockData);
|
|
@@ -17366,6 +17593,7 @@ let Schedule = class Schedule extends Component {
|
|
|
17366
17593
|
this.eventTooltip = null;
|
|
17367
17594
|
}
|
|
17368
17595
|
this.destroyPopups();
|
|
17596
|
+
this.hideSpinner();
|
|
17369
17597
|
this.unWireEvents();
|
|
17370
17598
|
this.destroyHeaderModule();
|
|
17371
17599
|
if (this.eventTooltip) {
|
|
@@ -19117,7 +19345,7 @@ class YearEvent extends TimelineEvent {
|
|
|
19117
19345
|
}
|
|
19118
19346
|
}
|
|
19119
19347
|
else {
|
|
19120
|
-
if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime()
|
|
19348
|
+
if (((resetTime(appStart).getTime() <= dateStart) && (resetTime(appEnd).getTime() >= dateStart)) ||
|
|
19121
19349
|
(resetTime(appStart).getTime() >= dateStart) && (resetTime(appEnd).getTime() <= dateEnd)) {
|
|
19122
19350
|
appointmentsList.push(app);
|
|
19123
19351
|
}
|
|
@@ -19295,7 +19523,9 @@ class DragAndDrop extends ActionBase {
|
|
|
19295
19523
|
const eventGuid = this.actionObj.element.getAttribute('data-guid');
|
|
19296
19524
|
this.actionObj.event = this.parent.eventBase.getEventByGuid(eventGuid);
|
|
19297
19525
|
const eventObj = extend({}, this.actionObj.event, null, true);
|
|
19298
|
-
|
|
19526
|
+
if (!isNullOrUndefined(eventObj)) {
|
|
19527
|
+
this.startTime = eventObj[this.parent.eventFields.startTime].getTime();
|
|
19528
|
+
}
|
|
19299
19529
|
const dragArgs = {
|
|
19300
19530
|
cancel: false,
|
|
19301
19531
|
data: eventObj,
|
|
@@ -19712,7 +19942,7 @@ class DragAndDrop extends ActionBase {
|
|
|
19712
19942
|
return;
|
|
19713
19943
|
}
|
|
19714
19944
|
const td = tr.children[colIndex];
|
|
19715
|
-
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
19945
|
+
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
19716
19946
|
this.actionObj.groupIndex = parseInt(td.getAttribute('data-group-index'), 10);
|
|
19717
19947
|
}
|
|
19718
19948
|
let dragStart$$1;
|
|
@@ -19978,7 +20208,7 @@ class DragAndDrop extends ActionBase {
|
|
|
19978
20208
|
const renderDates = this.getRenderedDates();
|
|
19979
20209
|
const events = this.parent.eventBase.splitEvent(event, renderDates);
|
|
19980
20210
|
let query = `.e-all-day-cells[data-date="${events[0][this.parent.eventFields.startTime].getTime()}"]`;
|
|
19981
|
-
if (this.parent.activeViewOptions.group.resources.length > 0) {
|
|
20211
|
+
if (this.parent.activeViewOptions.group.resources.length > 0 && !this.parent.uiStateValues.isGroupAdaptive) {
|
|
19982
20212
|
query = query.concat('[data-group-index = "' + this.actionObj.groupIndex + '"]');
|
|
19983
20213
|
}
|
|
19984
20214
|
const cell = [].slice.call(this.parent.element.querySelectorAll(query));
|
|
@@ -20176,7 +20406,13 @@ class DragAndDrop extends ActionBase {
|
|
|
20176
20406
|
if (this.parent.eventDragArea) {
|
|
20177
20407
|
const targetDate = this.parent.getDateFromElement(e.target);
|
|
20178
20408
|
if (!isNullOrUndefined(targetDate)) {
|
|
20179
|
-
|
|
20409
|
+
if (!this.parent.activeViewOptions.timeScale.enable || (this.parent.currentView == "TimelineMonth")) {
|
|
20410
|
+
const eventSrt = eventObj[this.parent.eventFields.startTime];
|
|
20411
|
+
eventStart = new Date(eventStart.setHours(eventSrt.getHours(), eventSrt.getMinutes(), eventSrt.getSeconds()));
|
|
20412
|
+
}
|
|
20413
|
+
else {
|
|
20414
|
+
eventStart = targetDate;
|
|
20415
|
+
}
|
|
20180
20416
|
}
|
|
20181
20417
|
}
|
|
20182
20418
|
const eventEnd = new Date(eventStart.getTime());
|
|
@@ -20605,6 +20841,10 @@ class ViewBase {
|
|
|
20605
20841
|
return date.setHours(0, 0, 0, 0) === this.parent.getCurrentTime().setHours(0, 0, 0, 0);
|
|
20606
20842
|
}
|
|
20607
20843
|
isCurrentMonth(date) {
|
|
20844
|
+
if (this.parent.activeViewOptions.displayDate || this.parent.activeViewOptions.numberOfWeeks > 0) {
|
|
20845
|
+
return this.parent.activeView.getStartDate().getTime() <= this.parent.getCurrentTime().getTime() &&
|
|
20846
|
+
this.parent.activeView.getEndDate().getTime() >= this.parent.getCurrentTime().getTime();
|
|
20847
|
+
}
|
|
20608
20848
|
return date.getFullYear() ===
|
|
20609
20849
|
this.parent.getCurrentTime().getFullYear() && date.getMonth() === this.parent.getCurrentTime().getMonth();
|
|
20610
20850
|
}
|
|
@@ -20835,6 +21075,11 @@ class ViewBase {
|
|
|
20835
21075
|
setStyleAttribute(resourceColumn, { 'height': formatUnit(content.clientHeight) });
|
|
20836
21076
|
}
|
|
20837
21077
|
}
|
|
21078
|
+
const headerCellElements = [].slice.call(this.element.querySelectorAll('.' + HEADER_CELLS_CLASS));
|
|
21079
|
+
headerCellElements.forEach((ele) => {
|
|
21080
|
+
const headerCellColSpan = parseInt(ele.getAttribute('colspan'), 10);
|
|
21081
|
+
setStyleAttribute(ele, { 'width': formatUnit(colWidth * headerCellColSpan) });
|
|
21082
|
+
});
|
|
20838
21083
|
}
|
|
20839
21084
|
}
|
|
20840
21085
|
resetColWidth() {
|
|
@@ -21872,10 +22117,11 @@ class Month extends ViewBase {
|
|
|
21872
22117
|
getDateSlots(renderDates, workDays) {
|
|
21873
22118
|
const count = this.parent.activeViewOptions.showWeekend ? WEEK_LENGTH : workDays.length;
|
|
21874
22119
|
const dateSlots = [];
|
|
22120
|
+
const isCurrentMonth = this.isCurrentMonth(this.parent.selectedDate);
|
|
21875
22121
|
for (let col = 0; col < count; col++) {
|
|
21876
22122
|
const classList$$1 = [HEADER_CELLS_CLASS];
|
|
21877
22123
|
const currentDateIndex = renderDates.slice(0, count).map((date) => date.getDay());
|
|
21878
|
-
if (
|
|
22124
|
+
if (isCurrentMonth && currentDateIndex.indexOf(this.parent.getCurrentTime().getDay()) === col) {
|
|
21879
22125
|
classList$$1.push(CURRENT_DAY_CLASS);
|
|
21880
22126
|
}
|
|
21881
22127
|
dateSlots.push({ date: renderDates[col], type: 'monthDay', className: classList$$1, colSpan: 1, workDays: workDays });
|
|
@@ -21914,6 +22160,9 @@ class Month extends ViewBase {
|
|
|
21914
22160
|
this.renderResourceMobileLayout();
|
|
21915
22161
|
}
|
|
21916
22162
|
this.parent.notify(contentReady, {});
|
|
22163
|
+
if (this.parent.uiStateValues.isCustomMonth) {
|
|
22164
|
+
this.parent.uiStateValues.isCustomMonth = false;
|
|
22165
|
+
}
|
|
21917
22166
|
}
|
|
21918
22167
|
refreshHeader() {
|
|
21919
22168
|
remove(this.element.querySelector('tbody tr'));
|
|
@@ -22096,7 +22345,7 @@ class Month extends ViewBase {
|
|
|
22096
22345
|
return slotDatas;
|
|
22097
22346
|
}
|
|
22098
22347
|
updateClassList(data) {
|
|
22099
|
-
if (this.isOtherMonth(data.date)) {
|
|
22348
|
+
if (!this.isCustomMonth() && this.isOtherMonth(data.date)) {
|
|
22100
22349
|
data.className.push(OTHERMONTH_CLASS);
|
|
22101
22350
|
}
|
|
22102
22351
|
if (!this.parent.isMinMaxDate(data.date)) {
|
|
@@ -22205,15 +22454,33 @@ class Month extends ViewBase {
|
|
|
22205
22454
|
}
|
|
22206
22455
|
}
|
|
22207
22456
|
getMonthStart(currentDate) {
|
|
22208
|
-
const
|
|
22209
|
-
const
|
|
22210
|
-
|
|
22457
|
+
const useDisplayDate = this.parent.currentView === 'Month' && !isNullOrUndefined(this.parent.activeViewOptions.displayDate) && (this.parent.uiStateValues.isCustomMonth || this.isCustomRange());
|
|
22458
|
+
const date = useDisplayDate ? this.parent.activeViewOptions.displayDate : !(this.parent.uiStateValues.isCustomMonth ||
|
|
22459
|
+
this.isCustomRange()) && this.isCustomMonth() ? currentDate : this.parent.calendarUtil.firstDateOfMonth(currentDate);
|
|
22460
|
+
const monthStart = getWeekFirstDate(date, this.parent.activeViewOptions.firstDayOfWeek);
|
|
22461
|
+
return new Date(monthStart.getFullYear(), monthStart.getMonth(), monthStart.getDate());
|
|
22211
22462
|
}
|
|
22212
22463
|
getMonthEnd(currentDate) {
|
|
22213
|
-
|
|
22214
|
-
|
|
22215
|
-
|
|
22216
|
-
|
|
22464
|
+
if (this.isCustomMonth()) {
|
|
22465
|
+
const start = this.getMonthStart(currentDate);
|
|
22466
|
+
const numberOfDays = WEEK_LENGTH * (this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
22467
|
+
this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS);
|
|
22468
|
+
return addDays(start, (numberOfDays - 1));
|
|
22469
|
+
}
|
|
22470
|
+
else {
|
|
22471
|
+
const endDate = addMonths(currentDate, this.parent.activeViewOptions.interval - 1);
|
|
22472
|
+
const lastWeekOfMonth = getWeekFirstDate(this.parent.calendarUtil.lastDateOfMonth(endDate), this.parent.activeViewOptions.firstDayOfWeek);
|
|
22473
|
+
return addDays(lastWeekOfMonth, WEEK_LENGTH - 1);
|
|
22474
|
+
}
|
|
22475
|
+
}
|
|
22476
|
+
isCustomRange() {
|
|
22477
|
+
const dates = this.parent.getCurrentViewDates();
|
|
22478
|
+
if (dates && dates.length > 0) {
|
|
22479
|
+
const selectedTime = resetTime(this.parent.selectedDate).getTime();
|
|
22480
|
+
return !(selectedTime >= getWeekFirstDate(dates[0], this.parent.activeViewOptions.firstDayOfWeek).getTime() &&
|
|
22481
|
+
selectedTime <= addDays(getWeekFirstDate(dates[dates.length - 1], this.parent.activeViewOptions.firstDayOfWeek), 6).getTime());
|
|
22482
|
+
}
|
|
22483
|
+
return false;
|
|
22217
22484
|
}
|
|
22218
22485
|
getRenderDates(workDays) {
|
|
22219
22486
|
const renderDates = [];
|
|
@@ -22243,34 +22510,57 @@ class Month extends ViewBase {
|
|
|
22243
22510
|
return renderDates;
|
|
22244
22511
|
}
|
|
22245
22512
|
getNextPreviousDate(type) {
|
|
22246
|
-
if (
|
|
22247
|
-
|
|
22513
|
+
if (this.isCustomMonth()) {
|
|
22514
|
+
const dates = this.parent.getCurrentViewDates();
|
|
22515
|
+
const date = getWeekFirstDate(type === 'next' ? dates[dates.length - 1]
|
|
22516
|
+
: dates[0], this.parent.activeViewOptions.firstDayOfWeek);
|
|
22517
|
+
return addDays(date, type === 'next' ? WEEK_LENGTH : -(this.parent.activeViewOptions.numberOfWeeks > 0 ?
|
|
22518
|
+
this.parent.activeViewOptions.numberOfWeeks : DEFAULT_WEEKS) * WEEK_LENGTH);
|
|
22248
22519
|
}
|
|
22249
22520
|
else {
|
|
22250
|
-
return addMonths(this.parent.selectedDate, -
|
|
22521
|
+
return addMonths(this.parent.selectedDate, ((type === 'next' ? 1 : -1) * this.parent.activeViewOptions.interval));
|
|
22251
22522
|
}
|
|
22252
22523
|
}
|
|
22524
|
+
getStartDate() {
|
|
22525
|
+
return this.getMonthStart(this.parent.selectedDate);
|
|
22526
|
+
}
|
|
22527
|
+
getEndDate() {
|
|
22528
|
+
return this.getMonthEnd(this.parent.selectedDate);
|
|
22529
|
+
}
|
|
22253
22530
|
getEndDateFromStartDate(start) {
|
|
22254
22531
|
return addDays(new Date(start.getTime()), 1);
|
|
22255
22532
|
}
|
|
22256
22533
|
getDateRangeText() {
|
|
22257
22534
|
if (this.parent.isAdaptive || isNullOrUndefined(this.parent.activeViewOptions.dateFormat)) {
|
|
22258
|
-
|
|
22259
|
-
|
|
22260
|
-
|
|
22261
|
-
|
|
22535
|
+
let startDate = this.parent.selectedDate;
|
|
22536
|
+
let endDate;
|
|
22537
|
+
let updateCustomRange = false;
|
|
22538
|
+
if (this.isCustomMonth()) {
|
|
22539
|
+
const dates = this.parent.getCurrentViewDates();
|
|
22540
|
+
updateCustomRange = dates[0].getMonth() !== dates[dates.length - 1].getMonth() ||
|
|
22541
|
+
dates[0].getFullYear() !== dates[dates.length - 1].getFullYear();
|
|
22542
|
+
if (updateCustomRange) {
|
|
22543
|
+
startDate = dates[0];
|
|
22544
|
+
endDate = dates[dates.length - 1];
|
|
22545
|
+
}
|
|
22546
|
+
}
|
|
22547
|
+
const isUpdateDateRange = (this.parent.currentView !== 'Month' || !this.isCustomMonth());
|
|
22548
|
+
if (this.parent.activeViewOptions.interval > 1 && isUpdateDateRange || updateCustomRange) {
|
|
22549
|
+
endDate = endDate ? endDate : addMonths(lastDateOfMonth(startDate), this.parent.activeViewOptions.interval - 1);
|
|
22550
|
+
if (startDate.getFullYear() === endDate.getFullYear()) {
|
|
22551
|
+
const monthNames = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' - ' +
|
|
22262
22552
|
(this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() })) +
|
|
22263
22553
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
22264
22554
|
return capitalizeFirstWord(monthNames, 'single');
|
|
22265
22555
|
}
|
|
22266
|
-
const text = (this.parent.globalize.formatDate(
|
|
22267
|
-
|
|
22556
|
+
const text = (this.parent.globalize.formatDate(startDate, { format: 'MMMM', calendar: this.parent.getCalendarMode() })) + ' ' +
|
|
22557
|
+
startDate.getFullYear() + ' - ' +
|
|
22268
22558
|
this.parent.globalize.formatDate(endDate, { format: 'MMMM ', calendar: this.parent.getCalendarMode() }) +
|
|
22269
22559
|
this.parent.globalize.formatDate(endDate, { skeleton: 'y', calendar: this.parent.getCalendarMode() });
|
|
22270
22560
|
return capitalizeFirstWord(text, 'single');
|
|
22271
22561
|
}
|
|
22272
22562
|
const format = (this.parent.activeViewOptions.dateFormat) ? this.parent.activeViewOptions.dateFormat : 'MMMM y';
|
|
22273
|
-
return capitalizeFirstWord(this.parent.globalize.formatDate(
|
|
22563
|
+
return capitalizeFirstWord(this.parent.globalize.formatDate(startDate, { format: format, calendar: this.parent.getCalendarMode() }), 'single');
|
|
22274
22564
|
}
|
|
22275
22565
|
return this.formatDateRange(this.parent.selectedDate);
|
|
22276
22566
|
}
|
|
@@ -22295,6 +22585,10 @@ class Month extends ViewBase {
|
|
|
22295
22585
|
EventHandler.remove(contentScrollableEle, 'scroll', this.onContentScroll);
|
|
22296
22586
|
}
|
|
22297
22587
|
}
|
|
22588
|
+
isCustomMonth() {
|
|
22589
|
+
return this.parent.currentView === 'Month' &&
|
|
22590
|
+
(!isNullOrUndefined(this.parent.activeViewOptions.displayDate) || this.parent.activeViewOptions.numberOfWeeks > 0);
|
|
22591
|
+
}
|
|
22298
22592
|
getModuleName() {
|
|
22299
22593
|
return 'month';
|
|
22300
22594
|
}
|
|
@@ -22526,12 +22820,29 @@ class Year extends ViewBase {
|
|
|
22526
22820
|
return Array.apply(null, { length: this.parent.activeViewOptions.monthsCount }).map((value, index) => this.parent.firstMonthOfYear + index);
|
|
22527
22821
|
}
|
|
22528
22822
|
onCellClick(e) {
|
|
22529
|
-
|
|
22823
|
+
let target = closest(e.target, '.' + WORK_CELLS_CLASS);
|
|
22530
22824
|
const startDate = this.parent.getDateFromElement(target);
|
|
22531
|
-
|
|
22532
|
-
const
|
|
22533
|
-
|
|
22534
|
-
|
|
22825
|
+
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
22826
|
+
const isPrevious = startDate.getTime() < this.getStartDate().getTime();
|
|
22827
|
+
if (isPrevious || startDate.getTime() > this.getEndDate().getTime()) {
|
|
22828
|
+
this.parent.changeDate(this.parent.activeView.getNextPreviousDate(isPrevious ? 'previous' : 'next'), e);
|
|
22829
|
+
const activeDate = this.parent.activeCellsData.startTime.getTime();
|
|
22830
|
+
const inRange = activeDate >= this.getStartDate().getTime() && activeDate <= this.getEndDate().getTime();
|
|
22831
|
+
const dateAttr = inRange ? activeDate : (isPrevious ? this.getEndDate() : this.getStartDate()).getTime();
|
|
22832
|
+
const selectedCell = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + dateAttr + '"]');
|
|
22833
|
+
this.parent.selectCell(selectedCell);
|
|
22834
|
+
this.parent.activeCellsData = this.parent.getCellDetails(selectedCell);
|
|
22835
|
+
}
|
|
22836
|
+
else {
|
|
22837
|
+
const endDate = addDays(new Date(startDate.getTime()), 1);
|
|
22838
|
+
const filteredEvents = this.parent.eventBase.filterEvents(startDate, endDate);
|
|
22839
|
+
const moreEventArgs = { date: startDate, event: filteredEvents, element: e.target };
|
|
22840
|
+
if (target.classList.contains(OTHERMONTH_CLASS)) {
|
|
22841
|
+
target = this.parent.element.querySelector(':not(.' + OTHERMONTH_CLASS + ')[data-date="' + target.getAttribute('data-date') + '"]');
|
|
22842
|
+
}
|
|
22843
|
+
this.parent.activeCellsData = this.parent.getCellDetails(target);
|
|
22844
|
+
this.parent.quickPopup.moreEventClick(moreEventArgs, endDate);
|
|
22845
|
+
}
|
|
22535
22846
|
}
|
|
22536
22847
|
onContentScroll(e) {
|
|
22537
22848
|
const target = e.target;
|
|
@@ -22583,10 +22894,10 @@ class Year extends ViewBase {
|
|
|
22583
22894
|
return addDays(addMonths(this.getStartDate(), this.parent.monthsCount), -1);
|
|
22584
22895
|
}
|
|
22585
22896
|
startDate() {
|
|
22586
|
-
return getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek);
|
|
22897
|
+
return this.parent.currentView === 'Year' ? getWeekFirstDate(this.getStartDate(), this.parent.firstDayOfWeek) : this.getStartDate();
|
|
22587
22898
|
}
|
|
22588
22899
|
endDate() {
|
|
22589
|
-
return addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1);
|
|
22900
|
+
return this.parent.currentView === 'Year' ? addDays(getWeekLastDate(this.getEndDate(), this.parent.firstDayOfWeek), 1) : this.getEndDate();
|
|
22590
22901
|
}
|
|
22591
22902
|
getEndDateFromStartDate(start) {
|
|
22592
22903
|
let date = new Date(start.getTime());
|
|
@@ -22629,6 +22940,7 @@ class Year extends ViewBase {
|
|
|
22629
22940
|
EventHandler.add(element, 'click', this.onCellClick, this);
|
|
22630
22941
|
}
|
|
22631
22942
|
else {
|
|
22943
|
+
EventHandler.add(element, 'mousedown', this.parent.workCellAction.cellMouseDown, this.parent.workCellAction);
|
|
22632
22944
|
EventHandler.add(element, 'click', this.parent.workCellAction.cellClick, this.parent.workCellAction);
|
|
22633
22945
|
if (!this.parent.isAdaptive) {
|
|
22634
22946
|
EventHandler.add(element, 'dblclick', this.parent.workCellAction.cellDblClick, this.parent.workCellAction);
|
|
@@ -23065,7 +23377,8 @@ class Agenda extends AgendaBase {
|
|
|
23065
23377
|
for (const event of this.parent.eventsData) {
|
|
23066
23378
|
delete event.generatedDates;
|
|
23067
23379
|
}
|
|
23068
|
-
let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ?
|
|
23380
|
+
let eventCollection = this.parent.activeViewOptions.allowVirtualScrolling ?
|
|
23381
|
+
args.processedData : this.parent.eventsProcessed;
|
|
23069
23382
|
if (this.parent.uiStateValues.isGroupAdaptive) {
|
|
23070
23383
|
const resource = this.parent.resourceBase.lastResourceLevel[this.parent.uiStateValues.groupIndex];
|
|
23071
23384
|
this.dataSource = this.parent.eventBase.filterEventsByResource(resource, this.dataSource);
|
|
@@ -24114,6 +24427,9 @@ class TimelineYear extends Year {
|
|
|
24114
24427
|
tr.appendChild(leftHeaderCells);
|
|
24115
24428
|
leftHeaderCells.appendChild(this.renderResourceHeader(LEFT_INDENT_WRAP_CLASS));
|
|
24116
24429
|
}
|
|
24430
|
+
const isHorizontal = this.parent.activeViewOptions.orientation === 'Horizontal';
|
|
24431
|
+
const isGroup = this.parent.activeViewOptions.group.resources.length > 0;
|
|
24432
|
+
this.isInverseTableSelect = isHorizontal && !isGroup ? false : true;
|
|
24117
24433
|
const td = createElement('td');
|
|
24118
24434
|
tr.appendChild(td);
|
|
24119
24435
|
const container = createElement('div', { className: DATE_HEADER_CONTAINER_CLASS });
|
|
@@ -24791,8 +25107,8 @@ class ExcelExport {
|
|
|
24791
25107
|
constructor(parent) {
|
|
24792
25108
|
this.parent = parent;
|
|
24793
25109
|
}
|
|
24794
|
-
initializeExcelExport(excelExportOptions) {
|
|
24795
|
-
const
|
|
25110
|
+
initializeExcelExport(excelExportOptions = {}) {
|
|
25111
|
+
const exportColumns = this.getExportColumns(excelExportOptions);
|
|
24796
25112
|
const exportName = excelExportOptions.fileName || 'Schedule';
|
|
24797
25113
|
const exportType = excelExportOptions.exportType || 'xlsx';
|
|
24798
25114
|
const isIncludeOccurrences = excelExportOptions.includeOccurrences || false;
|
|
@@ -24804,34 +25120,40 @@ class ExcelExport {
|
|
|
24804
25120
|
else {
|
|
24805
25121
|
eventCollection = !isIncludeOccurrences ? this.parent.eventsData : this.parent.eventsProcessed;
|
|
24806
25122
|
}
|
|
24807
|
-
this.processWorkbook(
|
|
25123
|
+
this.processWorkbook(exportColumns, exportName, exportType, eventCollection);
|
|
24808
25124
|
}
|
|
24809
25125
|
processWorkbook(fields, name, type, eventCollection) {
|
|
24810
25126
|
const columns = [];
|
|
24811
25127
|
const rows = [];
|
|
24812
25128
|
const columnHeader = [];
|
|
24813
|
-
fields.forEach((field, i) => columns.push({ index: i + 1, width: (field === 'Id' ?
|
|
25129
|
+
fields.forEach((field, i) => { columns.push({ index: i + 1, width: (field.name === 'Id' ? 50 : 150) }); });
|
|
24814
25130
|
const style = { fontSize: 12, borders: { color: '#E0E0E0' }, bold: true };
|
|
24815
|
-
fields.forEach((field, i) => columnHeader.push({ index: i + 1, value: field, style: style }));
|
|
25131
|
+
fields.forEach((field, i) => { columnHeader.push({ index: i + 1, value: field.text, style: style }); });
|
|
24816
25132
|
rows.push({ index: 1, cells: columnHeader });
|
|
24817
|
-
|
|
24818
|
-
for (const event of eventCollection) {
|
|
25133
|
+
eventCollection.forEach((event, i) => {
|
|
24819
25134
|
const columnData = [];
|
|
24820
25135
|
fields.forEach((field, n) => {
|
|
24821
|
-
let columnRule = { index: n + 1, value: event[field] || '' };
|
|
24822
|
-
if (field === this.parent.eventFields.startTime || field === this.parent.eventFields.endTime) {
|
|
25136
|
+
let columnRule = { index: n + 1, value: event[field.name] || '' };
|
|
25137
|
+
if (field.name === this.parent.eventFields.startTime || field.name === this.parent.eventFields.endTime) {
|
|
24823
25138
|
const styleRule = { fontSize: 12, numberFormat: 'm/d/yyyy h:mm AM/PM' };
|
|
24824
25139
|
columnRule = extend({}, columnRule, { style: styleRule }, true);
|
|
24825
25140
|
}
|
|
24826
25141
|
columnData.push(columnRule);
|
|
24827
25142
|
});
|
|
24828
|
-
rows.push({ index: i, cells: columnData });
|
|
24829
|
-
|
|
24830
|
-
}
|
|
25143
|
+
rows.push({ index: i + 2, cells: columnData });
|
|
25144
|
+
});
|
|
24831
25145
|
const workSheet = [{ columns: columns, rows: rows }];
|
|
24832
25146
|
const book = new Workbook({ worksheets: workSheet }, type, this.parent.locale);
|
|
24833
25147
|
book.save(name + '.' + type);
|
|
24834
25148
|
}
|
|
25149
|
+
getExportColumns(exportOptions) {
|
|
25150
|
+
const exportColumns = exportOptions.fieldsInfo || [];
|
|
25151
|
+
if (exportColumns.length === 0) {
|
|
25152
|
+
const fields = exportOptions.fields || Object.keys(this.parent.eventFields).map((field) => this.parent.eventFields[field]);
|
|
25153
|
+
fields.forEach((field) => { exportColumns.push({ name: field, text: field }); });
|
|
25154
|
+
}
|
|
25155
|
+
return exportColumns;
|
|
25156
|
+
}
|
|
24835
25157
|
getModuleName() {
|
|
24836
25158
|
return 'excelExport';
|
|
24837
25159
|
}
|
|
@@ -24976,5 +25298,5 @@ class Print {
|
|
|
24976
25298
|
* Export Schedule components
|
|
24977
25299
|
*/
|
|
24978
25300
|
|
|
24979
|
-
export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
|
|
25301
|
+
export { Schedule, cellClick, cellDoubleClick, moreEventsClick, select, hover, actionBegin, actionComplete, actionFailure, navigating, renderCell, eventClick, eventRendered, dataBinding, dataBound, popupOpen, popupClose, dragStart, drag, dragStop, resizeStart, resizing, resizeStop, inlineClick, initialLoad, initialEnd, print$1 as print, dataReady, eventsLoaded, contentReady, scroll, virtualScroll, scrollUiUpdate, uiUpdate, documentClick, cellMouseDown, WEEK_LENGTH, DEFAULT_WEEKS, MS_PER_DAY, MS_PER_MINUTE, getElementHeightFromClass, getTranslateY, getWeekFirstDate, getWeekLastDate, firstDateOfMonth, lastDateOfMonth, getWeekNumber, getWeekMiddleDate, setTime, resetTime, getDateInMs, getDateCount, addDays, addMonths, addYears, getStartEndHours, getMaxDays, getDaysCount, getDateFromString, getScrollBarWidth, findIndexInData, getOuterHeight, removeChildren, isDaylightSavingTime, getUniversalTime, isMobile, isIPadDevice, capitalizeFirstWord, Resize, DragAndDrop, HeaderRenderer, ViewBase, Day, Week, WorkWeek, Month, Year, Agenda, MonthAgenda, TimelineViews, TimelineMonth, TimelineYear, Timezone, timezoneData, ICalendarExport, ICalendarImport, ExcelExport, Print, RecurrenceEditor, generateSummary, generate, getDateFromRecurrenceDateString, extractObjectFromRule, getCalendarUtil, getRecurrenceStringFromDate, Gregorian, Islamic };
|
|
24980
25302
|
//# sourceMappingURL=ej2-schedule.es2015.js.map
|