@syncfusion/ej2-gantt 24.1.41 → 24.1.44
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/CHANGELOG.md +15 -0
- package/README.md +1 -1
- package/dist/ej2-gantt.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js +2 -2
- package/dist/ej2-gantt.umd.min.js.map +1 -1
- package/dist/es6/ej2-gantt.es2015.js +67 -10
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +67 -10
- package/dist/es6/ej2-gantt.es5.js.map +1 -1
- package/dist/global/ej2-gantt.min.js +2 -2
- package/dist/global/ej2-gantt.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/gantt/actions/context-menu.js +1 -1
- package/src/gantt/actions/dialog-edit.js +10 -1
- package/src/gantt/actions/edit.js +2 -0
- package/src/gantt/actions/keyboard.js +4 -1
- package/src/gantt/base/gantt.js +6 -0
- package/src/gantt/base/task-processor.js +1 -1
- package/src/gantt/renderer/timeline.js +43 -6
|
@@ -2785,7 +2785,7 @@ class TaskProcessor extends DateProcessor {
|
|
|
2785
2785
|
}
|
|
2786
2786
|
else {
|
|
2787
2787
|
if (isValid) {
|
|
2788
|
-
return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
|
|
2788
|
+
return ((this.getTimeDifference(sDate, eDate, true) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth);
|
|
2789
2789
|
}
|
|
2790
2790
|
else {
|
|
2791
2791
|
return ((this.getTimeDifference(sDate, eDate) / (1000 * 60 * 60 * hour)) * this.parent.perDayWidth);
|
|
@@ -6499,8 +6499,10 @@ class Timeline {
|
|
|
6499
6499
|
}
|
|
6500
6500
|
}
|
|
6501
6501
|
calculateNumberOfTimelineCells(newTimeline) {
|
|
6502
|
-
const
|
|
6503
|
-
|
|
6502
|
+
const sDate = new Date(this.parent.cloneProjectStartDate.getTime());
|
|
6503
|
+
const eDate = new Date(this.parent.cloneProjectEndDate.getTime());
|
|
6504
|
+
this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
|
|
6505
|
+
const numberOfDays = Math.abs((eDate.getTime() - sDate.getTime()) / (24 * 60 * 60 * 1000));
|
|
6504
6506
|
const count = newTimeline.bottomTier.count;
|
|
6505
6507
|
const unit = newTimeline.bottomTier.unit;
|
|
6506
6508
|
if (unit === 'Day') {
|
|
@@ -7339,24 +7341,35 @@ class Timeline {
|
|
|
7339
7341
|
case 'Day':
|
|
7340
7342
|
lastDay.setHours(24, 0, 0, 0);
|
|
7341
7343
|
increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * 24 * (count - 1));
|
|
7344
|
+
increment = this.checkDate(firstDay, lastDay, increment, count, mode);
|
|
7342
7345
|
break;
|
|
7343
7346
|
case 'Hour':
|
|
7344
7347
|
lastDay.setMinutes(60);
|
|
7345
7348
|
lastDay.setSeconds(0);
|
|
7346
7349
|
increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * 60 * (count - 1));
|
|
7347
|
-
increment = this.checkDate(firstDay, lastDay, increment, count);
|
|
7350
|
+
increment = this.checkDate(firstDay, lastDay, increment, count, mode);
|
|
7348
7351
|
break;
|
|
7349
7352
|
case 'Minutes':
|
|
7350
7353
|
lastDay.setSeconds(60);
|
|
7351
7354
|
increment = (lastDay.getTime() - firstDay.getTime()) + (1000 * 60 * (count - 1));
|
|
7355
|
+
increment = this.checkDate(firstDay, lastDay, increment, count, mode);
|
|
7352
7356
|
break;
|
|
7353
7357
|
}
|
|
7354
7358
|
return increment;
|
|
7355
7359
|
}
|
|
7356
|
-
checkDate(firstDay, lastDay, increment, count) {
|
|
7360
|
+
checkDate(firstDay, lastDay, increment, count, mode) {
|
|
7357
7361
|
var date = new Date(firstDay.getTime());
|
|
7358
7362
|
date.setTime(date.getTime() + increment);
|
|
7359
|
-
if (count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
|
|
7363
|
+
if (mode === "Day" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
|
|
7364
|
+
var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60 * 24);
|
|
7365
|
+
if (!this.parent.isInDst(date)) {
|
|
7366
|
+
increment += (1000 * 60 * 60 * diffCount);
|
|
7367
|
+
}
|
|
7368
|
+
else if (this.parent.isInDst(date) && count !== 2) {
|
|
7369
|
+
increment -= (1000 * 60 * 60 * diffCount);
|
|
7370
|
+
}
|
|
7371
|
+
}
|
|
7372
|
+
else if (mode === "Hour" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
|
|
7360
7373
|
var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60 * 60);
|
|
7361
7374
|
if (!this.parent.isInDst(date)) {
|
|
7362
7375
|
increment += (1000 * 60 * 60 * diffCount);
|
|
@@ -7365,6 +7378,15 @@ class Timeline {
|
|
|
7365
7378
|
increment -= (1000 * 60 * 60 * diffCount);
|
|
7366
7379
|
}
|
|
7367
7380
|
}
|
|
7381
|
+
else if (mode === "Minutes" && count !== 1 && ((date.getTime() - lastDay.getTime()) / (1000 * 60)) != count && (firstDay.getTimezoneOffset() !== date.getTimezoneOffset())) {
|
|
7382
|
+
var diffCount = count - (date.getTime() - lastDay.getTime()) / (1000 * 60);
|
|
7383
|
+
if (!this.parent.isInDst(date)) {
|
|
7384
|
+
increment += (1000 * 60 * 60 * diffCount);
|
|
7385
|
+
}
|
|
7386
|
+
else if (this.parent.isInDst(date) && count !== 2) {
|
|
7387
|
+
increment -= (1000 * 60 * 60 * diffCount);
|
|
7388
|
+
}
|
|
7389
|
+
}
|
|
7368
7390
|
return increment;
|
|
7369
7391
|
}
|
|
7370
7392
|
/**
|
|
@@ -7432,6 +7454,18 @@ class Timeline {
|
|
|
7432
7454
|
this.parent.globalize.formatDate(scheduleWeeks, { format: this.parent.getDateFormat() }) :
|
|
7433
7455
|
this.customFormat(scheduleWeeks, format, tier, mode, formatter);
|
|
7434
7456
|
thWidth = (this.getIncrement(scheduleWeeks, count, mode) / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
|
|
7457
|
+
const newDate = new Date(scheduleWeeks.getTime() + this.getIncrement(scheduleWeeks, count, mode));
|
|
7458
|
+
if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks)) ||
|
|
7459
|
+
(this.parent.isInDst(newDate) && !this.parent.isInDst(scheduleWeeks))) {
|
|
7460
|
+
let temp;
|
|
7461
|
+
if ((!this.parent.isInDst(newDate) && this.parent.isInDst(scheduleWeeks))) {
|
|
7462
|
+
temp = this.getIncrement(scheduleWeeks, count, mode) - (1000 * 60 * 60);
|
|
7463
|
+
}
|
|
7464
|
+
else {
|
|
7465
|
+
temp = this.getIncrement(scheduleWeeks, count, mode) + (1000 * 60 * 60);
|
|
7466
|
+
}
|
|
7467
|
+
thWidth = (temp / (1000 * 60 * 60 * 24)) * this.parent.perDayWidth;
|
|
7468
|
+
}
|
|
7435
7469
|
const cellWidth = thWidth;
|
|
7436
7470
|
thWidth = isLast || isFirstCell ? isLast ? this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.timelineRoundOffEndDate) : this.calculateWidthBetweenTwoDate(mode, scheduleWeeks, this.calculateQuarterEndDate(scheduleWeeks, count))
|
|
7437
7471
|
: thWidth;
|
|
@@ -7473,7 +7507,10 @@ class Timeline {
|
|
|
7473
7507
|
* @private
|
|
7474
7508
|
*/
|
|
7475
7509
|
calculateWidthBetweenTwoDate(mode, scheduleWeeks, endDate) {
|
|
7476
|
-
|
|
7510
|
+
const sDate = new Date(scheduleWeeks.getTime());
|
|
7511
|
+
const eDate = new Date(endDate.getTime());
|
|
7512
|
+
this.parent.dateValidationModule['updateDateWithTimeZone'](sDate, eDate);
|
|
7513
|
+
let timeDifference = (eDate.getTime() - sDate.getTime());
|
|
7477
7514
|
const balanceDay = (timeDifference / (1000 * 60 * 60 * 24));
|
|
7478
7515
|
return balanceDay * this.parent.perDayWidth;
|
|
7479
7516
|
}
|
|
@@ -14345,7 +14382,10 @@ class FocusModule {
|
|
|
14345
14382
|
const selectingRowIndex = expandedRecords.indexOf(selectedItem);
|
|
14346
14383
|
const currentSelectingRecord = e.action === 'downArrow' ? expandedRecords[selectingRowIndex + 1] :
|
|
14347
14384
|
expandedRecords[selectingRowIndex - 1];
|
|
14348
|
-
|
|
14385
|
+
const activeElement = this.parent['args'];
|
|
14386
|
+
if (document.activeElement != activeElement) {
|
|
14387
|
+
ganttObj.selectionModule.selectRow(ganttObj.currentViewData.indexOf(currentSelectingRecord), false, true);
|
|
14388
|
+
}
|
|
14349
14389
|
}
|
|
14350
14390
|
else if (ganttObj.selectionSettings.mode === 'Cell' && ganttObj.selectionModule.getSelectedRowCellIndexes().length > 0) {
|
|
14351
14391
|
const selectCellIndex = ganttObj.selectionModule.getSelectedRowCellIndexes();
|
|
@@ -15207,6 +15247,12 @@ let Gantt = class Gantt extends Component {
|
|
|
15207
15247
|
}
|
|
15208
15248
|
}
|
|
15209
15249
|
keyActionHandler(e) {
|
|
15250
|
+
if (this.enableContextMenu && this.contextMenuModule && (e.action === 'downArrow' || e.action === 'upArrow') && document.getElementById(this.element.id + '_contextmenu') && this['args']) {
|
|
15251
|
+
const firstMenuItem = this['args'];
|
|
15252
|
+
if (!isNullOrUndefined(firstMenuItem)) {
|
|
15253
|
+
(firstMenuItem).focus();
|
|
15254
|
+
}
|
|
15255
|
+
}
|
|
15210
15256
|
if (e.target && (e.action === 'downArrow' || e.action === 'upArrow') && e.target === this.element.querySelector('.e-rowcell')) {
|
|
15211
15257
|
this.treeGrid.grid.notify('key-pressed', e);
|
|
15212
15258
|
}
|
|
@@ -22444,8 +22490,8 @@ class DialogEdit {
|
|
|
22444
22490
|
else {
|
|
22445
22491
|
this.parent.showSpinner();
|
|
22446
22492
|
}
|
|
22447
|
-
this.renderTabItems();
|
|
22448
22493
|
if (!arg.cancel) {
|
|
22494
|
+
this.renderTabItems();
|
|
22449
22495
|
tabModel.selected = this.tabSelectedEvent.bind(this);
|
|
22450
22496
|
tabModel.height = this.parent.isAdaptive ? '100%' : 'auto';
|
|
22451
22497
|
tabModel.overflowMode = 'Scrollable';
|
|
@@ -22482,6 +22528,15 @@ class DialogEdit {
|
|
|
22482
22528
|
}
|
|
22483
22529
|
});
|
|
22484
22530
|
}
|
|
22531
|
+
else {
|
|
22532
|
+
arg.cancel = false;
|
|
22533
|
+
if (!isNullOrUndefined(this.parent.loadingIndicator) && this.parent.loadingIndicator.indicatorType === "Shimmer") {
|
|
22534
|
+
this.parent.hideMaskRow();
|
|
22535
|
+
}
|
|
22536
|
+
else {
|
|
22537
|
+
this.parent.hideSpinner();
|
|
22538
|
+
}
|
|
22539
|
+
}
|
|
22485
22540
|
});
|
|
22486
22541
|
}
|
|
22487
22542
|
changeFormObj(actionCompleteArgs, isCustomTab) {
|
|
@@ -28477,6 +28532,8 @@ class Edit$2 {
|
|
|
28477
28532
|
if (args.data[tempTaskID] != args.data['ganttProperties']['taskId']) {
|
|
28478
28533
|
args.data['ganttProperties']['taskId'] = args.data[tempTaskID];
|
|
28479
28534
|
args.newTaskData[tempTaskID] = args.data[tempTaskID];
|
|
28535
|
+
args.data['ganttProperties']['rowUniqueID'] = args.data[tempTaskID].toString();
|
|
28536
|
+
this.parent.ids.push(args.data[tempTaskID].toString());
|
|
28480
28537
|
}
|
|
28481
28538
|
}
|
|
28482
28539
|
if (!args.cancel) {
|
|
@@ -32918,7 +32975,7 @@ class ContextMenu$2 {
|
|
|
32918
32975
|
}
|
|
32919
32976
|
contextMenuOpen(args) {
|
|
32920
32977
|
this.isOpen = true;
|
|
32921
|
-
const firstMenuItem = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
|
|
32978
|
+
const firstMenuItem = this.parent['args'] = args.element.querySelectorAll('li:not(.e-menu-hide):not(.e-disabled)')[0];
|
|
32922
32979
|
if (!isNullOrUndefined(firstMenuItem)) {
|
|
32923
32980
|
addClass([firstMenuItem], 'e-focused');
|
|
32924
32981
|
}
|