@syncfusion/ej2-gantt 23.2.7 → 24.1.43
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 +2 -5
- 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 +2993 -332
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +3047 -366
- 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 +21 -21
- package/src/gantt/actions/cell-edit.js +7 -3
- package/src/gantt/actions/chart-scroll.d.ts +9 -1
- package/src/gantt/actions/chart-scroll.js +111 -3
- package/src/gantt/actions/connector-line-edit.js +8 -1
- package/src/gantt/actions/context-menu.js +2 -2
- package/src/gantt/actions/day-markers.d.ts +2 -1
- package/src/gantt/actions/dependency.js +2 -2
- package/src/gantt/actions/dialog-edit.d.ts +24 -0
- package/src/gantt/actions/dialog-edit.js +393 -2
- package/src/gantt/actions/edit.js +68 -21
- package/src/gantt/actions/keyboard.js +5 -1
- package/src/gantt/actions/pdf-export.js +12 -4
- package/src/gantt/actions/rowdragdrop.js +20 -9
- package/src/gantt/actions/selection.js +6 -3
- package/src/gantt/actions/taskbar-edit.d.ts +14 -0
- package/src/gantt/actions/taskbar-edit.js +517 -82
- package/src/gantt/actions/toolbar.js +4 -1
- package/src/gantt/base/css-constants.d.ts +2 -0
- package/src/gantt/base/css-constants.js +2 -0
- package/src/gantt/base/enum.d.ts +22 -0
- package/src/gantt/base/gantt-chart.js +63 -21
- package/src/gantt/base/gantt-model.d.ts +9 -1
- package/src/gantt/base/gantt.d.ts +11 -1
- package/src/gantt/base/gantt.js +46 -18
- package/src/gantt/base/interface.d.ts +135 -3
- package/src/gantt/base/splitter.js +6 -0
- package/src/gantt/base/task-processor.d.ts +1 -1
- package/src/gantt/base/task-processor.js +38 -10
- package/src/gantt/export/export-helper.d.ts +12 -0
- package/src/gantt/export/export-helper.js +316 -9
- package/src/gantt/export/pdf-base/pdf-grid-table.js +14 -1
- package/src/gantt/export/pdf-base/pdf-style/gantt-theme.js +36 -0
- package/src/gantt/export/pdf-connector-line.js +137 -32
- package/src/gantt/export/pdf-event-marker.d.ts +10 -0
- package/src/gantt/export/pdf-event-marker.js +57 -0
- package/src/gantt/export/pdf-gantt.d.ts +2 -0
- package/src/gantt/export/pdf-gantt.js +30 -10
- package/src/gantt/export/pdf-taskbar.d.ts +23 -2
- package/src/gantt/export/pdf-taskbar.js +771 -43
- package/src/gantt/export/pdf-timeline.d.ts +9 -0
- package/src/gantt/export/pdf-timeline.js +98 -20
- package/src/gantt/models/column.d.ts +12 -0
- package/src/gantt/renderer/chart-rows.d.ts +1 -1
- package/src/gantt/renderer/chart-rows.js +29 -16
- package/src/gantt/renderer/connector-line.js +8 -5
- package/src/gantt/renderer/edit-tooltip.js +3 -0
- package/src/gantt/renderer/event-marker.js +4 -1
- package/src/gantt/renderer/nonworking-day.js +18 -5
- package/src/gantt/renderer/timeline.d.ts +9 -0
- package/src/gantt/renderer/timeline.js +207 -27
- package/styles/bootstrap-dark.css +77 -16
- package/styles/bootstrap.css +78 -17
- package/styles/bootstrap4.css +78 -17
- package/styles/bootstrap5-dark.css +78 -17
- package/styles/bootstrap5.css +78 -17
- package/styles/fabric-dark.css +78 -17
- package/styles/fabric.css +78 -17
- package/styles/fluent-dark.css +78 -17
- package/styles/fluent.css +78 -17
- package/styles/gantt/_bootstrap-dark-definition.scss +7 -2
- package/styles/gantt/_bootstrap-definition.scss +7 -2
- package/styles/gantt/_bootstrap4-definition.scss +7 -2
- package/styles/gantt/_bootstrap5-definition.scss +7 -2
- package/styles/gantt/_fabric-dark-definition.scss +7 -2
- package/styles/gantt/_fabric-definition.scss +7 -2
- package/styles/gantt/_fluent-definition.scss +7 -2
- package/styles/gantt/_fusionnew-definition.scss +6 -2
- package/styles/gantt/_highcontrast-definition.scss +7 -2
- package/styles/gantt/_highcontrast-light-definition.scss +7 -2
- package/styles/gantt/_layout.scss +92 -20
- package/styles/gantt/_material-dark-definition.scss +7 -2
- package/styles/gantt/_material-definition.scss +7 -2
- package/styles/gantt/_material3-definition.scss +7 -2
- package/styles/gantt/_tailwind-definition.scss +6 -1
- package/styles/gantt/_theme.scss +11 -0
- package/styles/gantt/bootstrap-dark.css +77 -16
- package/styles/gantt/bootstrap.css +78 -17
- package/styles/gantt/bootstrap4.css +78 -17
- package/styles/gantt/bootstrap5-dark.css +78 -17
- package/styles/gantt/bootstrap5.css +78 -17
- package/styles/gantt/fabric-dark.css +78 -17
- package/styles/gantt/fabric.css +78 -17
- package/styles/gantt/fluent-dark.css +78 -17
- package/styles/gantt/fluent.css +78 -17
- package/styles/gantt/highcontrast-light.css +78 -17
- package/styles/gantt/highcontrast.css +78 -17
- package/styles/gantt/material-dark.css +78 -17
- package/styles/gantt/material.css +78 -17
- package/styles/gantt/material3-dark.css +77 -16
- package/styles/gantt/material3.css +77 -16
- package/styles/gantt/tailwind-dark.css +78 -17
- package/styles/gantt/tailwind.css +78 -17
- package/styles/highcontrast-light.css +78 -17
- package/styles/highcontrast.css +78 -17
- package/styles/material-dark.css +78 -17
- package/styles/material.css +78 -17
- package/styles/material3-dark.css +77 -16
- package/styles/material3.css +77 -16
- package/styles/tailwind-dark.css +78 -17
- package/styles/tailwind.css +78 -17
|
@@ -22,7 +22,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
22
22
|
};
|
|
23
23
|
return __assign.apply(this, arguments);
|
|
24
24
|
};
|
|
25
|
-
import { isNullOrUndefined, createElement, extend, addClass, remove, removeClass, closest, merge } from '@syncfusion/ej2-base';
|
|
25
|
+
import { isNullOrUndefined, createElement, extend, addClass, remove, removeClass, closest, merge, classList, getValue } from '@syncfusion/ej2-base';
|
|
26
26
|
import { parentsUntil } from '../base/utils';
|
|
27
27
|
import { DateProcessor } from '../base/date-processor';
|
|
28
28
|
import * as cls from '../base/css-constants';
|
|
@@ -48,6 +48,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
48
48
|
_this.currentItemPrevTop = 0;
|
|
49
49
|
_this.topValue = 0;
|
|
50
50
|
_this.draggedRecordMarginTop = '0px';
|
|
51
|
+
_this.isClonedElement = false;
|
|
52
|
+
_this.updatePosition = false;
|
|
53
|
+
_this.tooltipValue = 0;
|
|
51
54
|
_this.parent = ganttObj;
|
|
52
55
|
_this.initPublicProp();
|
|
53
56
|
_this.wireEvents();
|
|
@@ -293,7 +296,12 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
293
296
|
addClass([resizeElement], 'e-taskbar-resize-div');
|
|
294
297
|
resizeElement.style.setProperty("width", ganttprop.width + "px");
|
|
295
298
|
var currentindex = this.editElement.getAttribute('data-segment-index');
|
|
296
|
-
|
|
299
|
+
if (!isNullOrUndefined(ganttprop.segments) && this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
300
|
+
resizeElement.style.setProperty("left", ((!isNullOrUndefined(ganttprop.segments) ? parentleft + "px" : (ganttprop.left) + "px")));
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
resizeElement.style.setProperty("left", ((!isNullOrUndefined(ganttprop.segments) ? parentleft + ganttprop.segments[Number(currentindex)].left + "px" : (ganttprop.left) + "px")));
|
|
304
|
+
}
|
|
297
305
|
var resizeTable = this.parent.createElement('table');
|
|
298
306
|
var resizetableBody = this.parent.createElement("tbody");
|
|
299
307
|
resizetableBody.appendChild(resizeElement);
|
|
@@ -304,11 +312,21 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
304
312
|
var cloneTaskBar = this.editElement.parentElement.cloneNode(true);
|
|
305
313
|
}
|
|
306
314
|
else {
|
|
307
|
-
|
|
315
|
+
if (this.segmentIndex !== -1 && this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
316
|
+
var cloneTaskBar = this.editElement.parentElement.cloneNode(true);
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
var cloneTaskBar = this.editElement.cloneNode(true);
|
|
320
|
+
}
|
|
308
321
|
}
|
|
309
322
|
if (!Check) {
|
|
310
323
|
addClass([cloneTaskBar], 'e-clone-taskbar');
|
|
311
324
|
cloneTaskBar.style.setProperty("position", "absolute");
|
|
325
|
+
if (currentRecord.hasChildRecords && !currentRecord.ganttProperties.isAutoSchedule) {
|
|
326
|
+
var containerPosition = this.parent.getOffsetRect(this.parent.ganttChartModule.chartBodyContainer);
|
|
327
|
+
var taskbarPosition = this.parent.getOffsetRect(this.editElement);
|
|
328
|
+
cloneTaskBar.style.setProperty(this.parent.enableRtl ? "right" : "left", Math.abs(taskbarPosition.left - containerPosition.left + Math.abs(this.parent.ganttChartModule.scrollElement.scrollLeft)) + "px");
|
|
329
|
+
}
|
|
312
330
|
cloneTaskBar.style.setProperty("top", 0 + "px");
|
|
313
331
|
createTable = this.parent.createElement('table');
|
|
314
332
|
var tableBody = this.parent.createElement("tbody");
|
|
@@ -484,7 +502,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
484
502
|
action = 'ManualParentDrag';
|
|
485
503
|
}
|
|
486
504
|
else if (data) {
|
|
487
|
-
action = data.hasChildRecords ?
|
|
505
|
+
action = data.hasChildRecords ? 'ParentDrag'
|
|
488
506
|
: data.ganttProperties.isMilestone ? 'MilestoneDrag' : 'ChildDrag';
|
|
489
507
|
}
|
|
490
508
|
return action;
|
|
@@ -540,6 +558,125 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
540
558
|
this.taskBarEditElement.setAttribute('aria-grabbed', 'true');
|
|
541
559
|
}
|
|
542
560
|
};
|
|
561
|
+
TaskbarEdit.prototype.removeFirstBorder = function (element) {
|
|
562
|
+
var canremove = this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment';
|
|
563
|
+
if (this.parent.element.getElementsByClassName('e-firstrow-border').length > 0 && element &&
|
|
564
|
+
(element.getAttribute('data-rowindex') !== 0 || canremove)) {
|
|
565
|
+
this.parent.element.getElementsByClassName('e-firstrow-border')[0].remove();
|
|
566
|
+
}
|
|
567
|
+
};
|
|
568
|
+
;
|
|
569
|
+
TaskbarEdit.prototype.removeLastBorder = function (element) {
|
|
570
|
+
var isEmptyRow = element && (element.classList.contains('e-emptyrow') || element.classList.contains('e-columnheader')
|
|
571
|
+
|| element.classList.contains('e-detailrow'));
|
|
572
|
+
var islastRowIndex;
|
|
573
|
+
if (this.parent.enableVirtualization) {
|
|
574
|
+
islastRowIndex = element && !isEmptyRow &&
|
|
575
|
+
this.parent.treeGrid.getRows()[this.parent.treeGrid.getCurrentViewRecords().length - 1].getAttribute('data-uid') !==
|
|
576
|
+
element.getAttribute('data-uid');
|
|
577
|
+
}
|
|
578
|
+
else {
|
|
579
|
+
islastRowIndex = element && !isEmptyRow &&
|
|
580
|
+
this.parent.treeGrid.getRowByIndex(this.parent.treeGrid.getCurrentViewRecords().length - 1).getAttribute('data-uid') !==
|
|
581
|
+
element.getAttribute('data-uid');
|
|
582
|
+
}
|
|
583
|
+
var canremove = islastRowIndex || this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment';
|
|
584
|
+
if (this.parent.element.getElementsByClassName('e-lastrow-border').length > 0 && element && (islastRowIndex || canremove)) {
|
|
585
|
+
this.parent.element.getElementsByClassName('e-lastrow-border')[0].remove();
|
|
586
|
+
}
|
|
587
|
+
};
|
|
588
|
+
;
|
|
589
|
+
TaskbarEdit.prototype.removetopOrBottomBorder = function () {
|
|
590
|
+
var border;
|
|
591
|
+
border = [].slice.call(this.parent.element.querySelectorAll('.e-dropbottom, .e-droptop'));
|
|
592
|
+
if (border.length) {
|
|
593
|
+
this.addRemoveClasses(border, false, 'e-dropbottom');
|
|
594
|
+
this.addRemoveClasses(border, false, 'e-droptop');
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
;
|
|
598
|
+
TaskbarEdit.prototype.topOrBottomBorder = function (target) {
|
|
599
|
+
var rowElement;
|
|
600
|
+
if (this.parent.enableVirtualization) {
|
|
601
|
+
var gridElement = this.parent.treeGrid.getRows().filter(function (data) {
|
|
602
|
+
return data.getAttribute('data-rowindex') === target.getAttribute('data-rowindex');
|
|
603
|
+
})[0];
|
|
604
|
+
var index = this.parent.treeGrid.getRows().indexOf(gridElement);
|
|
605
|
+
rowElement = this.parent.getRowByIndex(index).children;
|
|
606
|
+
}
|
|
607
|
+
else {
|
|
608
|
+
rowElement = this.parent.getRowByIndex(parseInt(target.getAttribute('data-rowindex'))).children;
|
|
609
|
+
;
|
|
610
|
+
}
|
|
611
|
+
if (rowElement) {
|
|
612
|
+
if (this.parent.rowDragAndDropModule['dropPosition'] === 'above') {
|
|
613
|
+
this.addRemoveClasses(rowElement, true, 'e-droptop');
|
|
614
|
+
if (this.parent.element.getElementsByClassName('e-lastrow-dragborder').length > 0) {
|
|
615
|
+
this.parent.element.getElementsByClassName('e-lastrow-dragborder')[0].remove();
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
if (this.parent.rowDragAndDropModule['dropPosition'] === 'below') {
|
|
619
|
+
this.addRemoveClasses(rowElement, true, 'e-dropbottom');
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
};
|
|
623
|
+
;
|
|
624
|
+
TaskbarEdit.prototype.removeChildBorder = function () {
|
|
625
|
+
var borderElem;
|
|
626
|
+
borderElem = [].slice.call(this.parent.element.querySelectorAll('.e-childborder'));
|
|
627
|
+
if (borderElem.length > 0) {
|
|
628
|
+
this.addRemoveClasses(borderElem, false, 'e-childborder');
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
;
|
|
632
|
+
TaskbarEdit.prototype.addRemoveClasses = function (cells, add, className) {
|
|
633
|
+
for (var i = 0, len = cells.length; i < len; i++) {
|
|
634
|
+
if (add) {
|
|
635
|
+
cells[parseInt(i.toString(), 10)].classList.add(className);
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
cells[parseInt(i.toString(), 10)].classList.remove(className);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
};
|
|
642
|
+
;
|
|
643
|
+
TaskbarEdit.prototype.addErrorElem = function () {
|
|
644
|
+
var dragelem = document.getElementsByClassName('e-clone-taskbar')[0];
|
|
645
|
+
var errorelem = document.querySelectorAll('.e-errorelem').length;
|
|
646
|
+
if (!errorelem) {
|
|
647
|
+
var ele = document.createElement('div');
|
|
648
|
+
classList(ele, ['e-errorcontainer'], []);
|
|
649
|
+
classList(ele, ['e-icons', 'e-errorelem'], []);
|
|
650
|
+
if (this.taskBarEditRecord.ganttProperties.segments && this.taskBarEditRecord.ganttProperties.segments.length > 0) {
|
|
651
|
+
ele.style.paddingTop = this.parent.taskbarHeight + 'px';
|
|
652
|
+
}
|
|
653
|
+
dragelem.appendChild(ele);
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
TaskbarEdit.prototype.removeErrorElem = function () {
|
|
657
|
+
var errorelem = document.querySelector('.e-errorelem');
|
|
658
|
+
if (errorelem) {
|
|
659
|
+
errorelem.remove();
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
;
|
|
663
|
+
TaskbarEdit.prototype.ensurePosition = function (draggedRecords, currentRecord) {
|
|
664
|
+
var _this = this;
|
|
665
|
+
draggedRecords.filter(function (draggedRecord) {
|
|
666
|
+
if (draggedRecord.hasChildRecords && !isNullOrUndefined(draggedRecord.childRecords)) {
|
|
667
|
+
var valid = draggedRecord.childRecords.indexOf(currentRecord);
|
|
668
|
+
if (valid === -1) {
|
|
669
|
+
_this.ensurePosition(draggedRecord.childRecords, currentRecord);
|
|
670
|
+
}
|
|
671
|
+
else {
|
|
672
|
+
_this.parent.rowDragAndDropModule['dropPosition'] = 'Invalid';
|
|
673
|
+
_this.addErrorElem();
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
});
|
|
678
|
+
};
|
|
679
|
+
;
|
|
543
680
|
/**
|
|
544
681
|
* To handle mouse move action in chart
|
|
545
682
|
*
|
|
@@ -570,7 +707,29 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
570
707
|
this.mouseMoveY = e.pageY - containerPosition.top +
|
|
571
708
|
this.parent.ganttChartModule.scrollObject.previousScroll.top;
|
|
572
709
|
this.dragMouseLeave = false;
|
|
573
|
-
|
|
710
|
+
var cancel = false;
|
|
711
|
+
if (this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'ParentDrag' || this.taskBarEditAction === 'ManualParentDrag' || this.taskBarEditAction === 'MilestoneDrag') {
|
|
712
|
+
var ganttRowElement = void 0;
|
|
713
|
+
if (this.parent.enableVirtualization) {
|
|
714
|
+
var index = this.parent.currentViewData.indexOf(this.taskBarEditRecord);
|
|
715
|
+
ganttRowElement = this.parent.getRowByIndex(index);
|
|
716
|
+
}
|
|
717
|
+
else {
|
|
718
|
+
ganttRowElement = this.parent.getRowByIndex(this.taskBarEditRecord.index);
|
|
719
|
+
}
|
|
720
|
+
var eventArgs = {
|
|
721
|
+
cancel: cancel,
|
|
722
|
+
cloneElement: this.taskbarElement,
|
|
723
|
+
data: this.taskBarEditRecord,
|
|
724
|
+
target: event.target,
|
|
725
|
+
rows: ganttRowElement
|
|
726
|
+
};
|
|
727
|
+
this.parent.trigger('rowDrag', eventArgs);
|
|
728
|
+
cancel = eventArgs['cancel'];
|
|
729
|
+
}
|
|
730
|
+
if (!cancel) {
|
|
731
|
+
this.isMouseDragCheck();
|
|
732
|
+
}
|
|
574
733
|
if (this.isMouseDragged && this.taskBarEditAction) {
|
|
575
734
|
event.preventDefault();
|
|
576
735
|
if (!isNullOrUndefined(this.taskbarElement) && !isNullOrUndefined(this.editElement) && (this.taskBarEditAction !== "ConnectorPointRightDrag" && this.taskBarEditAction !== "ConnectorPointLeftDrag") && !(this.parent.viewType === 'ResourceView' && this.currentData.hasChildRecords)) {
|
|
@@ -578,7 +737,12 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
578
737
|
currentElement.style.setProperty("position", "absolute");
|
|
579
738
|
if ((this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'LeftResizing') && !isNullOrUndefined(this.currentIndex) && !isNullOrUndefined(this.currentIndex) ? Number(this.currentIndex) === 0 : false) {
|
|
580
739
|
this.taskbarElement.childNodes[0].childNodes[0].style.setProperty("top", currentElement.parentElement.offsetTop + "px");
|
|
581
|
-
|
|
740
|
+
if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
741
|
+
this.parent.chartPane.getElementsByClassName('e-gantt-chart')[0].appendChild(this.taskbarElement);
|
|
742
|
+
}
|
|
743
|
+
else {
|
|
744
|
+
currentElement.parentElement.appendChild(this.taskbarElement);
|
|
745
|
+
}
|
|
582
746
|
}
|
|
583
747
|
else {
|
|
584
748
|
if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
@@ -593,6 +757,157 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
593
757
|
rootElement[0].appendChild(this.taskbarResizer);
|
|
594
758
|
}
|
|
595
759
|
}
|
|
760
|
+
if (this.parent.allowTaskbarDragAndDrop && (this.taskBarEditAction === "ChildDrag" || this.taskBarEditAction === "ParentDrag" ||
|
|
761
|
+
this.taskBarEditAction === "MilestoneDrag" || this.taskBarEditAction === "ManualParentDrag")) {
|
|
762
|
+
var taskbarPosition = this.parent.getOffsetRect(this.taskBarEditElement);
|
|
763
|
+
var left = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 12 : 0;
|
|
764
|
+
var pointerLeft = (3 + this.parent.chartRowsModule.connectorPointWidth + left);
|
|
765
|
+
var xValue = void 0;
|
|
766
|
+
if (this.parent.enableRtl) {
|
|
767
|
+
xValue = Math.abs(taskbarPosition.left + pointerLeft + 1);
|
|
768
|
+
}
|
|
769
|
+
else {
|
|
770
|
+
xValue = Math.abs(taskbarPosition.left - pointerLeft - 1);
|
|
771
|
+
}
|
|
772
|
+
if (!this.isClonedElement && !this.parent.enableRtl) {
|
|
773
|
+
xValue = xValue - this.parent.ganttChartModule.scrollElement.scrollLeft;
|
|
774
|
+
this.isClonedElement = true;
|
|
775
|
+
}
|
|
776
|
+
var rowPositionHeight = 0;
|
|
777
|
+
this.parent.rowDragAndDropModule['dropPosition'] = undefined;
|
|
778
|
+
var target = void 0;
|
|
779
|
+
var yValue = void 0;
|
|
780
|
+
if (event.type === 'touchmove' || event.type === 'touchstart' || event.type === 'touchend') {
|
|
781
|
+
yValue = event['changedTouches'][0].pageY;
|
|
782
|
+
}
|
|
783
|
+
else {
|
|
784
|
+
yValue = event.y;
|
|
785
|
+
}
|
|
786
|
+
if (this.parent.enableRtl) {
|
|
787
|
+
target = document.elementFromPoint(this.parent.ganttChartModule.chartBodyContainer.offsetWidth, yValue);
|
|
788
|
+
if (target.classList.contains('e-taskbar-resize-div')) {
|
|
789
|
+
target = document.elementFromPoint(this.parent.ganttChartModule.chartBodyContainer.offsetWidth - target['offsetWidth'], yValue);
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
target = document.elementFromPoint(xValue, yValue);
|
|
794
|
+
}
|
|
795
|
+
var draggedTreeGridRowElement = void 0;
|
|
796
|
+
if (this.parent.enableVirtualization) {
|
|
797
|
+
if (!this.draggedTreeGridRowElement) {
|
|
798
|
+
var currentElement = this.editElement.parentElement;
|
|
799
|
+
draggedTreeGridRowElement = currentElement.parentElement;
|
|
800
|
+
this.draggedTreeGridRowElement = draggedTreeGridRowElement;
|
|
801
|
+
this.draggedTreeGridRowHeight = this.draggedTreeGridRowElement.offsetHeight;
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
draggedTreeGridRowElement = this.parent.treeGrid.getRows()[this.taskBarEditRecord.index];
|
|
806
|
+
this.draggedTreeGridRowElement = draggedTreeGridRowElement;
|
|
807
|
+
if (this.parent.viewType === 'ResourceView') {
|
|
808
|
+
if (this.taskBarEditRecord.parentItem && !isNullOrUndefined(this.parent.getRowByID(this.taskBarEditRecord.parentItem.taskId))) {
|
|
809
|
+
this.draggedTreeGridRowHeight = this.parent.getRowByID(this.taskBarEditRecord.parentItem.taskId).offsetHeight;
|
|
810
|
+
}
|
|
811
|
+
else {
|
|
812
|
+
var currentElement = this.editElement.parentElement;
|
|
813
|
+
this.draggedTreeGridRowElement = currentElement.parentElement;
|
|
814
|
+
this.draggedTreeGridRowHeight = this.draggedTreeGridRowElement.offsetHeight;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
else {
|
|
818
|
+
this.draggedTreeGridRowHeight = this.draggedTreeGridRowElement.offsetHeight;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
var chartRowElement_1;
|
|
822
|
+
if (target) {
|
|
823
|
+
chartRowElement_1 = closest(target, 'tr.' + cls.chartRow);
|
|
824
|
+
}
|
|
825
|
+
if (chartRowElement_1) {
|
|
826
|
+
var droppedTreeGridRowElement = void 0;
|
|
827
|
+
if (this.parent.enableVirtualization) {
|
|
828
|
+
droppedTreeGridRowElement = this.parent.treeGrid.getRows().filter(function (data) {
|
|
829
|
+
return data.getAttribute('data-rowindex') === chartRowElement_1.getAttribute('data-rowindex');
|
|
830
|
+
})[0];
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
droppedTreeGridRowElement = this.parent.treeGrid.getRows()[parseInt(chartRowElement_1.getAttribute('data-rowindex'))];
|
|
834
|
+
}
|
|
835
|
+
this.removeFirstBorder(droppedTreeGridRowElement);
|
|
836
|
+
this.removeLastBorder(droppedTreeGridRowElement);
|
|
837
|
+
if (!isNullOrUndefined(droppedTreeGridRowElement) && droppedTreeGridRowElement.getAttribute('data-uid') === this.draggedTreeGridRowElement.getAttribute('data-uid')
|
|
838
|
+
|| !parentsUntil(target, 'e-chart-rows-container')) {
|
|
839
|
+
this.parent.rowDragAndDropModule['dropPosition'] = 'Invalid';
|
|
840
|
+
this.addErrorElem();
|
|
841
|
+
}
|
|
842
|
+
var tObj = this.parent;
|
|
843
|
+
var rowTop = 0;
|
|
844
|
+
var toolHeight = tObj.toolbarModule ?
|
|
845
|
+
this.parent.toolbarModule.element.offsetHeight : 0;
|
|
846
|
+
var positionOffSet = this.parent.getOffsetRect(tObj.element);
|
|
847
|
+
var contentHeight = tObj.treeGrid.getHeaderContent().offsetHeight + positionOffSet.top + toolHeight;
|
|
848
|
+
var scrollTop = tObj.treeGrid.getContent().firstElementChild.scrollTop;
|
|
849
|
+
if (!isNullOrUndefined(droppedTreeGridRowElement)) {
|
|
850
|
+
rowPositionHeight = droppedTreeGridRowElement.offsetTop - scrollTop;
|
|
851
|
+
}
|
|
852
|
+
if (this.parent.enableVirtualization) {
|
|
853
|
+
rowTop = this.parent.getOffsetRect(droppedTreeGridRowElement).top;
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
rowTop = rowPositionHeight + contentHeight;
|
|
857
|
+
}
|
|
858
|
+
var rowBottom = rowTop + this.draggedTreeGridRowHeight;
|
|
859
|
+
var difference = rowBottom - rowTop;
|
|
860
|
+
var divide = difference / 3;
|
|
861
|
+
var topRowSegment = rowTop + divide;
|
|
862
|
+
var middleRowSegment = topRowSegment + divide;
|
|
863
|
+
var bottomRowSegment = middleRowSegment + divide;
|
|
864
|
+
var posy = (event.type === 'mousemove') ? event.pageY : ((!isNullOrUndefined(event['changedTouches'])) ? event['changedTouches'][0].pageY : null);
|
|
865
|
+
var isTopSegment = posy <= topRowSegment;
|
|
866
|
+
var isMiddleRowSegment = (posy > topRowSegment && posy <= middleRowSegment);
|
|
867
|
+
var isBottomRowSegment = (posy > middleRowSegment && posy <= bottomRowSegment);
|
|
868
|
+
if (isTopSegment || isMiddleRowSegment || isBottomRowSegment) {
|
|
869
|
+
var rowElement = void 0;
|
|
870
|
+
if (this.parent.enableVirtualization) {
|
|
871
|
+
var index = this.parent.treeGrid.getRows().indexOf(droppedTreeGridRowElement);
|
|
872
|
+
rowElement = this.parent.getRowByIndex(index);
|
|
873
|
+
}
|
|
874
|
+
else {
|
|
875
|
+
rowElement = this.parent.getRowByIndex(parseInt(droppedTreeGridRowElement.getAttribute('data-rowindex')));
|
|
876
|
+
}
|
|
877
|
+
var rowIndex = getValue('rowIndex', rowElement);
|
|
878
|
+
var droppedTreeGridRecord = this.parent.flatData[rowIndex];
|
|
879
|
+
var isValid = true;
|
|
880
|
+
if (this.parent.viewType === 'ResourceView' && !this.taskBarEditRecord.hasChildRecords && !droppedTreeGridRecord.hasChildRecords && this.taskBarEditRecord.parentItem.taskId === droppedTreeGridRecord.parentItem.taskId) {
|
|
881
|
+
isValid = false;
|
|
882
|
+
}
|
|
883
|
+
if (droppedTreeGridRecord) {
|
|
884
|
+
this.ensurePosition([this.taskBarEditRecord], droppedTreeGridRecord);
|
|
885
|
+
}
|
|
886
|
+
if (isValid) {
|
|
887
|
+
if (isTopSegment && this.parent.rowDragAndDropModule['dropPosition'] !== 'Invalid') {
|
|
888
|
+
this.parent.rowDragAndDropModule['dropPosition'] = 'above';
|
|
889
|
+
this.removeChildBorder();
|
|
890
|
+
this.removeErrorElem();
|
|
891
|
+
this.removetopOrBottomBorder();
|
|
892
|
+
this.topOrBottomBorder(rowElement);
|
|
893
|
+
}
|
|
894
|
+
if (isMiddleRowSegment && this.parent.rowDragAndDropModule['dropPosition'] !== 'Invalid') {
|
|
895
|
+
this.parent.rowDragAndDropModule['dropPosition'] = 'child';
|
|
896
|
+
this.removetopOrBottomBorder();
|
|
897
|
+
this.addRemoveClasses(rowElement.children, true, 'e-childborder');
|
|
898
|
+
}
|
|
899
|
+
if (isBottomRowSegment && this.parent.rowDragAndDropModule['dropPosition'] !== 'Invalid') {
|
|
900
|
+
this.parent.rowDragAndDropModule['dropPosition'] = 'below';
|
|
901
|
+
this.removetopOrBottomBorder();
|
|
902
|
+
this.removeErrorElem();
|
|
903
|
+
this.removeChildBorder();
|
|
904
|
+
this.removeFirstBorder(droppedTreeGridRowElement);
|
|
905
|
+
this.topOrBottomBorder(droppedTreeGridRowElement);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
}
|
|
596
911
|
var args_1 = {
|
|
597
912
|
cancel: false,
|
|
598
913
|
requestType: 'taskbarediting',
|
|
@@ -669,43 +984,64 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
669
984
|
this.triggerDependencyEvent(e);
|
|
670
985
|
this.drawFalseLine();
|
|
671
986
|
}
|
|
672
|
-
if (this.parent.
|
|
987
|
+
if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction !== 'LeftResizing' && this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
673
988
|
var parentClientRect = this.parent.getOffsetRect(this.parent.chartPane);
|
|
674
989
|
var coordinates = this.getCoordinate(e);
|
|
675
990
|
var position = { top: coordinates.pageY, left: coordinates.pageX };
|
|
676
991
|
var pos = { left: Math.abs(position.left - parentClientRect.left), top: position.top - parentClientRect.top };
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
992
|
+
if (this.parent.viewType === 'ResourceView' && this.parent.enableMultiTaskbar) {
|
|
993
|
+
var parentRecord = this.parent.getRecordByID(this.taskBarEditRecord.parentItem.taskId);
|
|
994
|
+
if (!this.parent.allowTaskbarOverlap && this.taskBarEditRecord.parentItem && !parentRecord.expanded) {
|
|
995
|
+
var reduceHeight = 0;
|
|
996
|
+
if (parseInt(this.editElement['style'].marginTop) > this.parent.rowHeight) {
|
|
997
|
+
for (var i = 0; i < parentRecord.childRecords.length; i++) {
|
|
998
|
+
if (parentRecord.childRecords[i].ganttProperties.taskId !== this.taskBarEditRecord.ganttProperties.taskId) {
|
|
999
|
+
reduceHeight = reduceHeight + this.parent.rowHeight;
|
|
1000
|
+
}
|
|
1001
|
+
else {
|
|
1002
|
+
break;
|
|
1003
|
+
}
|
|
687
1004
|
}
|
|
1005
|
+
pos.top = pos.top - reduceHeight;
|
|
688
1006
|
}
|
|
689
|
-
pos.top = pos.top - reduceHeight;
|
|
690
1007
|
}
|
|
691
1008
|
}
|
|
692
1009
|
this.topValue = pos.top;
|
|
693
|
-
|
|
1010
|
+
var xValue = void 0;
|
|
1011
|
+
var yValue = void 0;
|
|
1012
|
+
if (e.type === 'touchmove' || e.type === 'touchstart' || e.type === 'touchend') {
|
|
1013
|
+
xValue = e['changedTouches'][0].pageX;
|
|
1014
|
+
yValue = e['changedTouches'][0].pageY;
|
|
1015
|
+
}
|
|
1016
|
+
else {
|
|
1017
|
+
xValue = e.pageX;
|
|
1018
|
+
yValue = e.pageY;
|
|
1019
|
+
}
|
|
1020
|
+
if (this.parent.enableRtl) {
|
|
1021
|
+
this.leftValue = pos.left - Math.abs(xValue - (this.parent.getOffsetRect(this.taskBarEditElement).left)) - (this.previousLeftValue !== 0 ? xValue - this.previousLeftValue : 0);
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
this.leftValue = pos.left - (xValue - this.parent.getOffsetRect(this.taskBarEditElement).left) + (this.previousLeftValue !== 0 ? xValue - this.previousLeftValue : 0);
|
|
1025
|
+
}
|
|
694
1026
|
if (this.previousLeftValue == 0) {
|
|
695
1027
|
if (!this.parent.enableRtl) {
|
|
696
|
-
this.leftValue = this.leftValue - this.parent.ganttChartModule.scrollObject.previousScroll.left
|
|
1028
|
+
this.leftValue = this.leftValue - this.parent.ganttChartModule.scrollObject.previousScroll.left;
|
|
697
1029
|
}
|
|
698
1030
|
else {
|
|
699
|
-
this.leftValue = this.leftValue
|
|
1031
|
+
this.leftValue = this.leftValue - (this.parent.ganttChartModule.scrollObject.previousScroll.left);
|
|
1032
|
+
if (this.parent.ganttChartModule.scrollObject.previousScroll.left == 0) {
|
|
1033
|
+
this.leftValue = this.leftValue - 60;
|
|
1034
|
+
}
|
|
700
1035
|
}
|
|
701
1036
|
}
|
|
702
|
-
this.previousLeftValue =
|
|
1037
|
+
this.previousLeftValue = xValue;
|
|
703
1038
|
}
|
|
704
1039
|
else {
|
|
705
1040
|
this.leftValue = this.taskBarEditRecord.ganttProperties.left;
|
|
706
1041
|
}
|
|
707
1042
|
this.setItemPosition();
|
|
708
1043
|
this.updateEditedItem();
|
|
1044
|
+
this.tooltipValue = (e.type === 'touchmove' || e.type === 'touchstart' || e.type === 'touchend') ? e['changedTouches'][0].pageX : e.pageX;
|
|
709
1045
|
this.editTooltip.updateTooltip(this.segmentIndex);
|
|
710
1046
|
if (isMouseClick) {
|
|
711
1047
|
this.taskBarEditedAction(e);
|
|
@@ -750,7 +1086,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
750
1086
|
var isConnectorLineEdit = (this.taskBarEditAction === 'ConnectorPointLeftDrag' ||
|
|
751
1087
|
this.taskBarEditAction === 'ConnectorPointRightDrag') ?
|
|
752
1088
|
true : false;
|
|
753
|
-
if ((this.taskBarEditRecord.ganttProperties.width > 3 && !(this.taskBarEditAction === 'ProgressResizing' &&
|
|
1089
|
+
if (((this.taskBarEditRecord.ganttProperties.width > 3 || this.taskBarEditRecord.ganttProperties.isMilestone) && !(this.taskBarEditAction === 'ProgressResizing' &&
|
|
754
1090
|
(this.taskBarEditRecord.ganttProperties.progress === 0 || this.taskBarEditRecord.ganttProperties.progress === 100))) ||
|
|
755
1091
|
isConnectorLineEdit) {
|
|
756
1092
|
var mouseX = 0;
|
|
@@ -813,8 +1149,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
813
1149
|
_this.timerCount = Math.abs(_this.timerCount);
|
|
814
1150
|
}
|
|
815
1151
|
if (direction === 'right') {
|
|
816
|
-
|
|
817
|
-
|
|
1152
|
+
var timelineWidth = _this.parent.enableTimelineVirtualization ? _this.parent.timelineModule.wholeTimelineWidth : _this.parent.timelineModule.totalTimelineWidth;
|
|
1153
|
+
_this.timerCount = (_this.timerCount + 1) >= timelineWidth ?
|
|
1154
|
+
timelineWidth : (_this.timerCount + 1);
|
|
818
1155
|
}
|
|
819
1156
|
else if (direction === 'bottom') {
|
|
820
1157
|
_this.timerCount = _this.timerCount + 1;
|
|
@@ -854,6 +1191,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
854
1191
|
// eslint-disable-next-line
|
|
855
1192
|
TaskbarEdit.prototype.enableDragging = function (e) {
|
|
856
1193
|
var item = this.taskBarEditRecord.ganttProperties;
|
|
1194
|
+
var timelineWidth = this.parent.enableTimelineVirtualization ? this.parent.timelineModule.wholeTimelineWidth : this.parent.timelineModule.totalTimelineWidth;
|
|
857
1195
|
var differenceWidth = 0;
|
|
858
1196
|
if (this.taskBarEditElement.classList.contains('e-segmented-taskbar') &&
|
|
859
1197
|
!this.taskBarEditElement.classList.contains('e-segment-first')) {
|
|
@@ -880,8 +1218,8 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
880
1218
|
}
|
|
881
1219
|
else {
|
|
882
1220
|
left = segment.left < (previousSegment.left + previousSegment.width) ? (previousSegment.left + previousSegment.width) :
|
|
883
|
-
(item.left + segment.width + segment.left) >=
|
|
884
|
-
(
|
|
1221
|
+
(item.left + segment.width + segment.left) >= timelineWidth ?
|
|
1222
|
+
(timelineWidth - segment.width) : segment.left;
|
|
885
1223
|
}
|
|
886
1224
|
segment.left = left;
|
|
887
1225
|
this.parent.setRecordValue('segments', segments, item, true);
|
|
@@ -898,8 +1236,8 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
898
1236
|
differenceWidth = this.mouseMoveX - this.mouseDownX;
|
|
899
1237
|
this.parent.setRecordValue('left', this.previousItem.left + differenceWidth, item, true);
|
|
900
1238
|
}
|
|
901
|
-
var left = item.left < 0 ? 0 : (item.left + item.width) >=
|
|
902
|
-
(
|
|
1239
|
+
var left = item.left < 0 ? 0 : (item.left + item.width) >= timelineWidth ?
|
|
1240
|
+
(timelineWidth - item.width) : item.left;
|
|
903
1241
|
this.parent.setRecordValue('left', left, item, true);
|
|
904
1242
|
}
|
|
905
1243
|
};
|
|
@@ -1514,7 +1852,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1514
1852
|
pStartDate.setTime(pStartDate.getTime() + (left * milliSecondsPerPixel));
|
|
1515
1853
|
/* To render the milestone in proper date while editing */
|
|
1516
1854
|
if (isMilestone && !isNullOrUndefined(property.predecessorsName) && property.predecessorsName !== '') {
|
|
1517
|
-
|
|
1855
|
+
pStartDate.setDate(pStartDate.getDate() - 1);
|
|
1518
1856
|
this.parent.dateValidationModule.setTime(this.parent.defaultEndTime, pStartDate);
|
|
1519
1857
|
pStartDate = this.parent.dateValidationModule.checkStartDate(pStartDate, property, true);
|
|
1520
1858
|
}
|
|
@@ -1524,9 +1862,9 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1524
1862
|
if (this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && !this.parent.isInDst(pStartDate)) {
|
|
1525
1863
|
pStartDate.setTime(pStartDate.getTime() + (60 * 60 * 1000));
|
|
1526
1864
|
}
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1865
|
+
else if (!this.parent.isInDst(new Date(this.parent.timelineModule.timelineStartDate.toString())) && this.parent.isInDst(pStartDate)) {
|
|
1866
|
+
pStartDate.setTime(pStartDate.getTime() - (60 * 60 * 1000));
|
|
1867
|
+
}
|
|
1530
1868
|
}
|
|
1531
1869
|
return pStartDate;
|
|
1532
1870
|
};
|
|
@@ -1539,7 +1877,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1539
1877
|
TaskbarEdit.prototype.setItemPosition = function () {
|
|
1540
1878
|
if (!isNullOrUndefined(this.editElement)) {
|
|
1541
1879
|
var currentElement = this.editElement.parentElement;
|
|
1542
|
-
if (this.parent.
|
|
1880
|
+
if (this.parent.allowTaskbarDragAndDrop && this.taskBarEditAction === 'ChildDrag') {
|
|
1543
1881
|
currentElement.style.position = null;
|
|
1544
1882
|
}
|
|
1545
1883
|
else {
|
|
@@ -1556,9 +1894,17 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1556
1894
|
rightResizer = this.parent.isAdaptive ? (segment.width - 2) : (segment.width - 10);
|
|
1557
1895
|
}
|
|
1558
1896
|
this.taskBarEditElement.style.setProperty("opacity", '.75');
|
|
1559
|
-
var taskBarMainContainer
|
|
1560
|
-
|
|
1561
|
-
|
|
1897
|
+
var taskBarMainContainer;
|
|
1898
|
+
if (this.parent.allowTaskbarDragAndDrop && !item.isAutoSchedule && this.taskBarEditRecord.hasChildRecords) {
|
|
1899
|
+
taskBarMainContainer = this.taskBarEditElement;
|
|
1900
|
+
}
|
|
1901
|
+
else {
|
|
1902
|
+
taskBarMainContainer = (!this.taskBarEditElement.classList.contains(cls.taskBarMainContainer)) ? ((this.taskBarEditAction === 'ChildDrag' ||
|
|
1903
|
+
this.taskBarEditAction === 'LeftResizing') && this.segmentIndex === 0) ? this.taskBarEditElement.parentElement : closest(this.taskBarEditElement, 'tr.' + cls.chartRow)
|
|
1904
|
+
.querySelector('.' + cls.taskBarMainContainer) : this.taskBarEditElement;
|
|
1905
|
+
}
|
|
1906
|
+
var segmentedTaskBarContainer = (this.taskBarEditElement.classList.contains('e-segmented-taskbar') ||
|
|
1907
|
+
this.taskBarEditElement.querySelector('.e-segmented-taskbar')) ? true : false;
|
|
1562
1908
|
var traceChildProgressBar = this.taskBarEditElement.querySelector('.' + cls.traceChildProgressBar);
|
|
1563
1909
|
var traceChildTaskBar = this.taskBarEditElement.querySelector('.' + cls.traceChildTaskBar);
|
|
1564
1910
|
var childProgressResizer = this.taskBarEditElement.querySelector('.' + cls.childProgressResizer);
|
|
@@ -1572,13 +1918,20 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1572
1918
|
var manualParentRight = this.taskBarEditElement.querySelector('.' + cls.manualParentRightResizer);
|
|
1573
1919
|
var manualParentLeft = this.taskBarEditElement.querySelector('.' + cls.manualParentLeftResizer);
|
|
1574
1920
|
var resizeLine = this.parent.ganttChartModule.chartBodyContainer.querySelector('.e-taskbar-resize-div');
|
|
1921
|
+
if (this.parent.allowTaskbarDragAndDrop && !this.updatePosition) {
|
|
1922
|
+
this.leftValue = this.leftValue + 30;
|
|
1923
|
+
this.updatePosition = true;
|
|
1924
|
+
}
|
|
1575
1925
|
if (this.taskBarEditAction !== 'ConnectorPointRightDrag' &&
|
|
1576
1926
|
this.taskBarEditAction !== 'ConnectorPointLeftDrag') {
|
|
1577
1927
|
if (this.taskBarEditAction !== 'ParentResizing' && this.taskBarEditAction !== 'ManualParentDrag') {
|
|
1578
1928
|
if (segmentedTaskBarContainer && !isNullOrUndefined(item.segments)
|
|
1579
1929
|
&& (this.taskBarEditAction === 'RightResizing' || this.segmentIndex !== 0)) {
|
|
1580
1930
|
if (!isNullOrUndefined(resizeLine)) {
|
|
1581
|
-
|
|
1931
|
+
if (!this.parent.allowTaskbarDragAndDrop || (this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule && this.taskBarEditAction !== 'ChildDrag' &&
|
|
1932
|
+
this.taskBarEditAction !== 'ParentDrag')) {
|
|
1933
|
+
resizeLine.style.width = (segment.width) + "px";
|
|
1934
|
+
}
|
|
1582
1935
|
}
|
|
1583
1936
|
this.taskBarEditElement.style.width = (segment.width) + 'px';
|
|
1584
1937
|
if (this.parent.enableRtl) {
|
|
@@ -1587,7 +1940,10 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1587
1940
|
else {
|
|
1588
1941
|
this.taskBarEditElement.style.left = (segment.left) + 'px';
|
|
1589
1942
|
if (!isNullOrUndefined(resizeLine)) {
|
|
1590
|
-
|
|
1943
|
+
if (!this.parent.allowTaskbarDragAndDrop || (this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule && this.taskBarEditAction !== 'ChildDrag'
|
|
1944
|
+
&& this.taskBarEditAction !== 'ParentDrag')) {
|
|
1945
|
+
resizeLine.style.left = (segment.left + this.editElement.parentElement.offsetLeft) + "px";
|
|
1946
|
+
}
|
|
1591
1947
|
}
|
|
1592
1948
|
}
|
|
1593
1949
|
}
|
|
@@ -1596,9 +1952,10 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1596
1952
|
if (segmentedTaskBarContainer && segmentConnectorPointRight) {
|
|
1597
1953
|
segmentConnectorPointRight.style.left = (this.parent.isAdaptive ? (width + 10) : (width + 2)) + 'px';
|
|
1598
1954
|
}
|
|
1599
|
-
if (this.parent.
|
|
1600
|
-
|
|
1601
|
-
|
|
1955
|
+
if (this.parent.allowTaskbarDragAndDrop && this.parent.rowDragAndDropModule && this.taskBarEditAction !== 'LeftResizing' &&
|
|
1956
|
+
this.taskBarEditAction !== 'RightResizing' && this.taskBarEditAction !== 'ProgressResizing') {
|
|
1957
|
+
var addTop = this.parent.taskbarHeight / 2;
|
|
1958
|
+
taskBarMainContainer.style.setProperty('top', (this.topValue + addTop) + 'px');
|
|
1602
1959
|
taskBarMainContainer.style.zIndex = '4';
|
|
1603
1960
|
}
|
|
1604
1961
|
if (this.taskBarEditAction === 'LeftResizing' && this.segmentIndex === 0) {
|
|
@@ -1621,7 +1978,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1621
1978
|
}
|
|
1622
1979
|
}
|
|
1623
1980
|
}
|
|
1624
|
-
if (this.taskBarEditAction === 'ChildDrag' && this.segmentIndex === 0) {
|
|
1981
|
+
if (this.taskBarEditAction === 'ChildDrag' && (this.segmentIndex === 0 || (this.segmentIndex !== -1 && this.parent.allowTaskbarDragAndDrop))) {
|
|
1625
1982
|
resizeLine.style.width = (width) + "px";
|
|
1626
1983
|
resizeLine.style.setProperty(position, item.left + 'px');
|
|
1627
1984
|
taskBarMainContainer.style.setProperty("opacity", '.75');
|
|
@@ -1636,7 +1993,7 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1636
1993
|
}
|
|
1637
1994
|
}
|
|
1638
1995
|
if (this.taskBarEditAction === 'MilestoneDrag' || item.isMilestone) {
|
|
1639
|
-
taskBarMainContainer.style.setProperty(position, (item.left - (width / 2)) + 'px');
|
|
1996
|
+
taskBarMainContainer.style.setProperty(position, (this.parent.allowTaskbarDragAndDrop ? this.leftValue : (item.left - (width / 2))) + 'px');
|
|
1640
1997
|
resizeLine.style.setProperty(position, (item.left - (width / 2)) + 'px');
|
|
1641
1998
|
resizeLine.style.width = (width) + "px";
|
|
1642
1999
|
}
|
|
@@ -1693,6 +2050,11 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1693
2050
|
resizeLine.style.width = (item.width) + 'px';
|
|
1694
2051
|
resizeLine.style.setProperty(position, item.left + 'px');
|
|
1695
2052
|
manualParentTaskbar.style.setProperty(position, item.left - item.autoLeft + 'px');
|
|
2053
|
+
if (this.parent.allowTaskbarDragAndDrop) {
|
|
2054
|
+
manualParentTaskbar.style.setProperty(position, this.leftValue + 'px');
|
|
2055
|
+
manualParentTaskbar.style.setProperty('top', (this.topValue) + 'px');
|
|
2056
|
+
manualParentTaskbar.style.zIndex = '4';
|
|
2057
|
+
}
|
|
1696
2058
|
}
|
|
1697
2059
|
else {
|
|
1698
2060
|
if (!isNullOrUndefined(traceChildTaskBar) && !segmentedTaskBarContainer) {
|
|
@@ -1719,6 +2081,15 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1719
2081
|
}
|
|
1720
2082
|
}
|
|
1721
2083
|
}
|
|
2084
|
+
if (this.parent.allowTaskbarDragAndDrop && (this.taskBarEditAction === 'ChildDrag' || this.taskBarEditAction === 'ParentDrag' || this.taskBarEditAction === 'ManualParentDrag' || this.taskBarEditAction === 'MilestoneDrag')) {
|
|
2085
|
+
var resizeValue = this.parent.enableRtl ? parseInt(resizeLine.style.right) : parseInt(resizeLine.style.left);
|
|
2086
|
+
if (this.parent.enableRtl) {
|
|
2087
|
+
resizeLine.style.right = (resizeValue - 30) + 'px';
|
|
2088
|
+
}
|
|
2089
|
+
else {
|
|
2090
|
+
resizeLine.style.left = (resizeValue + 30) + 'px';
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
1722
2093
|
};
|
|
1723
2094
|
/**
|
|
1724
2095
|
* To handle mouse up event in chart
|
|
@@ -1732,14 +2103,31 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1732
2103
|
this.previousMouseMove = null;
|
|
1733
2104
|
this.editTooltip.showHideTaskbarEditTooltip(false, this.segmentIndex);
|
|
1734
2105
|
if (this.taskBarEditAction && this.isMouseDragged) {
|
|
1735
|
-
if ((!this.dragMouseLeave && this.taskBarEditedAction) || (this.parent.
|
|
1736
|
-
this.parent.allowTaskbarDragAndDrop)) {
|
|
2106
|
+
if ((!this.dragMouseLeave && this.taskBarEditedAction) || (this.parent.allowTaskbarDragAndDrop)) {
|
|
1737
2107
|
if (e.type === 'touchmove' || e.type === 'touchstart' || e.type === 'touchend') {
|
|
1738
2108
|
var coordinates = this.getCoordinate(e);
|
|
1739
2109
|
this['droppedTarget'] = document.elementFromPoint(coordinates.pageX, coordinates.pageY);
|
|
1740
2110
|
}
|
|
1741
2111
|
else {
|
|
1742
|
-
this
|
|
2112
|
+
if (this.taskBarEditRecord.hasChildRecords && !this.taskBarEditRecord.ganttProperties.isAutoSchedule) {
|
|
2113
|
+
var taskbarPosition = this.parent.getOffsetRect(this.taskBarEditElement);
|
|
2114
|
+
var left = (!isNullOrUndefined(document.body.className) && document.body.className.includes("e-bigger")) ? 12 : 0;
|
|
2115
|
+
var pointerLeft = (3 + this.parent.chartRowsModule.connectorPointWidth + left);
|
|
2116
|
+
var xValue = void 0;
|
|
2117
|
+
if (this.parent.enableRtl) {
|
|
2118
|
+
xValue = Math.abs(taskbarPosition.left + pointerLeft + 1);
|
|
2119
|
+
}
|
|
2120
|
+
else {
|
|
2121
|
+
xValue = Math.abs(Math.abs(taskbarPosition.left - pointerLeft - 1) - this.parent.ganttChartModule.scrollElement.scrollLeft);
|
|
2122
|
+
}
|
|
2123
|
+
this['droppedTarget'] = document.elementFromPoint(xValue, e.y);
|
|
2124
|
+
}
|
|
2125
|
+
else {
|
|
2126
|
+
this['droppedTarget'] = document.elementFromPoint(e.x, e.y);
|
|
2127
|
+
}
|
|
2128
|
+
if (this['droppedTarget'] && this['droppedTarget'].classList.contains('e-span-label')) {
|
|
2129
|
+
this['droppedTarget'] = document.elementFromPoint(e.x + this['droppedTarget']['offsetWidth'], e.y);
|
|
2130
|
+
}
|
|
1743
2131
|
}
|
|
1744
2132
|
this.taskBarEditedAction(e);
|
|
1745
2133
|
this.isMouseDragged = false;
|
|
@@ -1852,27 +2240,54 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1852
2240
|
var ganttRecord = args.data;
|
|
1853
2241
|
var taskData = ganttRecord.ganttProperties;
|
|
1854
2242
|
var draggedRecIndex = this.parent.flatData.indexOf(ganttRecord);
|
|
1855
|
-
if (
|
|
1856
|
-
&& this.parent.allowTaskbarDragAndDrop && this.dragMoveY > 0) {
|
|
2243
|
+
if (this.parent.allowTaskbarDragAndDrop && this.dragMoveY > 0 && ((this.parent.viewType === 'ResourceView' && !ganttRecord.hasChildRecords) || this.parent.viewType === 'ProjectView')) {
|
|
1857
2244
|
if (this.parent.rowDragAndDropModule) {
|
|
1858
2245
|
var flatRecordCol = this.parent.currentViewData;
|
|
1859
|
-
if (flatRecordCol[this.taskBarEditRecord.parentItem.index] && ((this.parent.editedRecords.indexOf(flatRecordCol[this.taskBarEditRecord.parentItem.index]) === -1))) {
|
|
2246
|
+
if (this.taskBarEditRecord.parentItem && flatRecordCol[this.taskBarEditRecord.parentItem.index] && ((this.parent.editedRecords.indexOf(flatRecordCol[this.taskBarEditRecord.parentItem.index]) === -1))) {
|
|
1860
2247
|
this.parent.editedRecords.push(flatRecordCol[this.taskBarEditRecord.parentItem.index]);
|
|
1861
2248
|
}
|
|
1862
|
-
|
|
2249
|
+
this.removeChildBorder();
|
|
2250
|
+
this.removeErrorElem();
|
|
2251
|
+
this.removetopOrBottomBorder();
|
|
2252
|
+
var droppedRecord = void 0;
|
|
2253
|
+
this.updatePosition = false;
|
|
1863
2254
|
this.draggedRecordMarginTop = this.taskBarEditElement.style.marginTop;
|
|
1864
2255
|
var row = closest(this.droppedTarget, 'tr.' + cls.chartRow);
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
var
|
|
1869
|
-
var
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
this.
|
|
2256
|
+
if (row) {
|
|
2257
|
+
var recordIndex = parseInt(row.getAttribute('data-rowindex'));
|
|
2258
|
+
droppedRecord = this.parent.flatData[recordIndex];
|
|
2259
|
+
var droppedParentRecordIndex = this.parent.getRootParent(droppedRecord, 0).index;
|
|
2260
|
+
var draggedParentRecordIndex = this.parent.getRootParent(this.taskBarEditRecord, 0).index;
|
|
2261
|
+
var e = {
|
|
2262
|
+
cancel: false,
|
|
2263
|
+
data: this.taskBarEditRecord,
|
|
2264
|
+
fromIndex: this.taskBarEditRecord.index,
|
|
2265
|
+
dropIndex: droppedRecord.index,
|
|
2266
|
+
dropPosition: this.parent.rowDragAndDropModule['dropPosition'],
|
|
2267
|
+
dropRecord: droppedRecord,
|
|
2268
|
+
};
|
|
2269
|
+
this.parent.trigger('rowDrop', e);
|
|
2270
|
+
if (!e['cancel'] && droppedRecord && recordIndex !== draggedRecIndex && ((droppedParentRecordIndex !== draggedParentRecordIndex || (this.taskBarEditRecord.hasChildRecords && droppedRecord.hasChildRecords)) || !this.taskBarEditRecord.hasChildRecords)) {
|
|
2271
|
+
var droppedRecordIndex = this.parent.flatData.indexOf(droppedRecord);
|
|
2272
|
+
var position = void 0;
|
|
2273
|
+
if (this.parent.viewType === 'ProjectView') {
|
|
2274
|
+
position = this.parent.rowDragAndDropModule['dropPosition'];
|
|
2275
|
+
}
|
|
2276
|
+
else {
|
|
2277
|
+
position = (droppedRecord.hasChildRecords || (!droppedRecord.parentItem &&
|
|
2278
|
+
droppedRecord.childRecords.length == 0)) ? 'child' : this.parent.rowDragAndDropModule['dropPosition'];
|
|
2279
|
+
}
|
|
2280
|
+
if (this.parent.rowDragAndDropModule) {
|
|
2281
|
+
if (this.parent.viewType === 'ResourceView' && (position === 'child' && !droppedRecord.hasChildRecords)) {
|
|
2282
|
+
position = 'Invalid';
|
|
2283
|
+
this.parent.rowDragAndDropModule['dropPosition'] = 'Invalid';
|
|
2284
|
+
}
|
|
2285
|
+
this.parent.rowDragAndDropModule.reorderRows([draggedRecIndex], droppedRecordIndex, position);
|
|
2286
|
+
}
|
|
2287
|
+
this.dragMoveY = 0;
|
|
1873
2288
|
}
|
|
1874
|
-
this.dragMoveY = 0;
|
|
1875
2289
|
}
|
|
2290
|
+
this.isClonedElement = false;
|
|
1876
2291
|
}
|
|
1877
2292
|
if (this.parent.viewType === 'ResourceView' && this.parent.showOverAllocation) {
|
|
1878
2293
|
this.parent.ganttChartModule.renderOverAllocationContainer();
|
|
@@ -1912,35 +2327,55 @@ var TaskbarEdit = /** @class */ (function (_super) {
|
|
|
1912
2327
|
cEndDate.setHours(cEndDate.getHours() + 1);
|
|
1913
2328
|
}
|
|
1914
2329
|
else {
|
|
2330
|
+
cStartDate.setDate(cStartDate.getDate());
|
|
2331
|
+
cEndDate.setDate(cEndDate.getDate());
|
|
2332
|
+
}
|
|
2333
|
+
if (this.parent.includeWeekend) {
|
|
1915
2334
|
sDate.setHours(0, 0, 0, 0);
|
|
1916
2335
|
eDate.setHours(0, 0, 0, 0);
|
|
1917
2336
|
cStartDate.setDate(cStartDate.getDate() - 1);
|
|
1918
2337
|
cEndDate.setDate(cEndDate.getDate() + 1);
|
|
1919
2338
|
cStartDate.setHours(0, 0, 0, 0);
|
|
1920
2339
|
cEndDate.setHours(0, 0, 0, 0);
|
|
2340
|
+
if (cStartDate.getTime() <= eDate.getTime() && !isNullOrUndefined(previousSegment) && !isNullOrUndefined(segment)) {
|
|
2341
|
+
var segmentIndexes_1 = [
|
|
2342
|
+
{ 'firstSegmentIndex': previousSegment.segmentIndex, 'secondSegmentIndex': segment.segmentIndex }
|
|
2343
|
+
];
|
|
2344
|
+
this.parent.chartRowsModule.mergeTask(ganttProp.taskId, segmentIndexes_1);
|
|
2345
|
+
}
|
|
2346
|
+
else if (cEndDate.getTime() >= sDate.getTime() && this.segmentIndex !== segments.length - 1) {
|
|
2347
|
+
var segmentIndexes_2 = [
|
|
2348
|
+
{ 'firstSegmentIndex': segment.segmentIndex, 'secondSegmentIndex': nextSegment.segmentIndex }
|
|
2349
|
+
];
|
|
2350
|
+
this.parent.chartRowsModule.mergeTask(ganttProp.taskId, segmentIndexes_2);
|
|
2351
|
+
}
|
|
2352
|
+
else if (cEndDate.getTime() >= sDate.getTime()) {
|
|
2353
|
+
segment.endDate.setDate(this.parent.cloneProjectEndDate.getDate() - 1);
|
|
2354
|
+
segment.startDate = this.parent.dataOperation.getStartDate(segment.endDate, segment.duration, ganttProp.durationUnit, ganttProp);
|
|
2355
|
+
// eslint-disable-next-line
|
|
2356
|
+
for (var i = segments.length - 2; i >= 0; i++) {
|
|
2357
|
+
var segment_5 = segments[i];
|
|
2358
|
+
var eDate_1 = segment_5.endDate;
|
|
2359
|
+
eDate_1.setDate(eDate_1.getDate() - segment_5.offsetDuration);
|
|
2360
|
+
segment_5.endDate = eDate_1;
|
|
2361
|
+
segment_5.startDate = this.parent.dataOperation.getStartDate(segment_5.endDate, segment_5.duration, ganttProp.durationUnit, ganttProp);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
1921
2364
|
}
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
segment.startDate = this.parent.dataOperation.getStartDate(segment.endDate, segment.duration, ganttProp.durationUnit, ganttProp);
|
|
1937
|
-
// eslint-disable-next-line
|
|
1938
|
-
for (var i = segments.length - 2; i >= 0; i++) {
|
|
1939
|
-
var segment_5 = segments[i];
|
|
1940
|
-
var eDate_1 = segment_5.endDate;
|
|
1941
|
-
eDate_1.setDate(eDate_1.getDate() - segment_5.offsetDuration);
|
|
1942
|
-
segment_5.endDate = eDate_1;
|
|
1943
|
-
segment_5.startDate = this.parent.dataOperation.getStartDate(segment_5.endDate, segment_5.duration, ganttProp.durationUnit, ganttProp);
|
|
2365
|
+
else {
|
|
2366
|
+
//Hits while dragging taskbar toward right & taskbar rightside resizing:
|
|
2367
|
+
if (cEndDate.getTime() <= sDate.getTime() && this.segmentIndex !== segments.length - 1 && !this.parent.includeWeekend && this.parent.dataOperation.getDuration((this.parent.dataOperation.checkStartDate(cEndDate, taskData, false)), sDate, taskData.durationUnit, false, false) === 0) {
|
|
2368
|
+
var segmentIndexes = [
|
|
2369
|
+
{ 'firstSegmentIndex': segment.segmentIndex, 'secondSegmentIndex': nextSegment.segmentIndex }
|
|
2370
|
+
];
|
|
2371
|
+
this.parent.chartRowsModule.mergeTask(ganttProp.taskId, segmentIndexes);
|
|
2372
|
+
}
|
|
2373
|
+
//Hits while dragging taskbar toward left & taskbar leftside resizing:
|
|
2374
|
+
else if (cStartDate.getTime() >= eDate.getTime() && !isNullOrUndefined(previousSegment) && !isNullOrUndefined(segment) && !this.parent.includeWeekend && this.parent.dataOperation.getDuration((this.parent.dataOperation.checkEndDate(cStartDate, taskData, false)), eDate, taskData.durationUnit, false, false) === 0) {
|
|
2375
|
+
var segmentIndexes = [
|
|
2376
|
+
{ 'firstSegmentIndex': previousSegment.segmentIndex, 'secondSegmentIndex': segment.segmentIndex }
|
|
2377
|
+
];
|
|
2378
|
+
this.parent.chartRowsModule.mergeTask(ganttProp.taskId, segmentIndexes);
|
|
1944
2379
|
}
|
|
1945
2380
|
}
|
|
1946
2381
|
}
|