@syncfusion/ej2-gantt 19.4.55 → 19.4.56
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 +14 -1
- 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 +77 -74
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +81 -74
- 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 +11 -11
- package/src/gantt/actions/edit.js +33 -15
- package/src/gantt/actions/selection.js +3 -2
- package/src/gantt/base/gantt-chart.js +28 -2
- package/src/gantt/base/gantt.js +14 -55
- package/src/gantt/renderer/timeline.js +3 -0
|
@@ -4323,7 +4323,19 @@ var GanttChart = /** @__PURE__ @class */ (function () {
|
|
|
4323
4323
|
//empty row height
|
|
4324
4324
|
var emptydivHeight = 36;
|
|
4325
4325
|
var emptyHeight = this.parent.contentHeight === 0 ? this.parent.flatData.length > 1 ? emptydivHeight : 0 : this.parent.contentHeight;
|
|
4326
|
-
this.
|
|
4326
|
+
var contentElement = this.parent.element.getElementsByClassName('e-chart-scroll-container e-content')[0];
|
|
4327
|
+
if (emptyHeight >= contentElement['offsetHeight']) {
|
|
4328
|
+
this.chartBodyContent.style.height = formatUnit(emptyHeight);
|
|
4329
|
+
}
|
|
4330
|
+
else {
|
|
4331
|
+
var scrollHeight = this.parent.element.getElementsByClassName('e-chart-rows-container')[0]['offsetHeight'];
|
|
4332
|
+
if (contentElement['offsetHeight'] >= scrollHeight) {
|
|
4333
|
+
this.chartBodyContent.style.height = contentElement['offsetHeight'] - 17 + 'px';
|
|
4334
|
+
}
|
|
4335
|
+
else {
|
|
4336
|
+
this.chartBodyContent.style.height = contentElement['offsetHeight'] + 'px';
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4327
4339
|
//let element: HTMLElement = this.chartTimelineContainer.querySelector('.' + cls.timelineHeaderTableContainer);
|
|
4328
4340
|
this.chartBodyContent.style.width = formatUnit(this.parent.timelineModule.totalTimelineWidth);
|
|
4329
4341
|
this.setVirtualHeight();
|
|
@@ -4356,7 +4368,21 @@ var GanttChart = /** @__PURE__ @class */ (function () {
|
|
|
4356
4368
|
if (this.chartBodyContent.clientHeight < this.chartBodyContainer.clientHeight) {
|
|
4357
4369
|
if (lastRow) {
|
|
4358
4370
|
addClass(lastRow.querySelectorAll('td'), 'e-lastrow');
|
|
4359
|
-
|
|
4371
|
+
var emptydivHeight = 36;
|
|
4372
|
+
var emptyHeight = this.parent.contentHeight === 0 ? this.parent.flatData.length > 1 ? emptydivHeight : 0 : this.parent.contentHeight;
|
|
4373
|
+
var contentElement = this.parent.element.getElementsByClassName('e-chart-scroll-container e-content')[0];
|
|
4374
|
+
if (emptyHeight >= contentElement['offsetHeight']) {
|
|
4375
|
+
this.chartBodyContent.style.height = formatUnit(emptyHeight);
|
|
4376
|
+
}
|
|
4377
|
+
else {
|
|
4378
|
+
var scrollHeight = this.parent.element.getElementsByClassName('e-chart-rows-container')[0]['offsetHeight'];
|
|
4379
|
+
if (contentElement['offsetHeight'] >= scrollHeight) {
|
|
4380
|
+
this.chartBodyContent.style.height = contentElement['offsetHeight'] - 17 + 'px';
|
|
4381
|
+
}
|
|
4382
|
+
else {
|
|
4383
|
+
this.chartBodyContent.style.height = contentElement['offsetHeight'] + 'px';
|
|
4384
|
+
}
|
|
4385
|
+
}
|
|
4360
4386
|
}
|
|
4361
4387
|
}
|
|
4362
4388
|
}
|
|
@@ -5433,6 +5459,9 @@ var Timeline = /** @__PURE__ @class */ (function () {
|
|
|
5433
5459
|
}
|
|
5434
5460
|
}
|
|
5435
5461
|
}
|
|
5462
|
+
currentLevel = this.parent.zoomingLevels.findIndex(function (tempLevel) {
|
|
5463
|
+
return tempLevel.level === currentLevel;
|
|
5464
|
+
});
|
|
5436
5465
|
var newTimeline = this.parent.zoomingLevels[currentLevel];
|
|
5437
5466
|
var args = {
|
|
5438
5467
|
requestType: isZoomIn ? 'beforeZoomIn' : 'beforeZoomOut',
|
|
@@ -12742,25 +12771,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
12742
12771
|
* @returns {void} .
|
|
12743
12772
|
*/
|
|
12744
12773
|
Gantt.prototype.calculateDimensions = function () {
|
|
12745
|
-
var settingsHeight;
|
|
12746
|
-
if (typeof (this.height) !== 'number' && this.height.indexOf('%') !== -1 && (this.element.parentElement &&
|
|
12747
|
-
!this.element.parentElement.style.height || this.element.parentElement.style.height.indexOf('%') !== -1)) {
|
|
12748
|
-
var ganttHeight = void 0;
|
|
12749
|
-
if (this.element.parentElement.style.height.indexOf('%') == -1) {
|
|
12750
|
-
ganttHeight = Number(this.height.split("%")[0]);
|
|
12751
|
-
}
|
|
12752
|
-
else {
|
|
12753
|
-
ganttHeight = Number(this.element.parentElement.style.height.split("%")[0]);
|
|
12754
|
-
}
|
|
12755
|
-
ganttHeight = (ganttHeight * window.innerHeight) / 100;
|
|
12756
|
-
if (this.height === '100%') {
|
|
12757
|
-
ganttHeight = ganttHeight - 16;
|
|
12758
|
-
}
|
|
12759
|
-
settingsHeight = this.validateDimentionValue(ganttHeight);
|
|
12760
|
-
}
|
|
12761
|
-
else {
|
|
12762
|
-
settingsHeight = this.validateDimentionValue(this.height);
|
|
12763
|
-
}
|
|
12774
|
+
var settingsHeight = this.validateDimentionValue(this.height);
|
|
12764
12775
|
var settingsWidth = this.validateDimentionValue(this.width);
|
|
12765
12776
|
if (!isNullOrUndefined(this.width) && typeof (this.width) === 'string' && this.width.indexOf('%') !== -1) {
|
|
12766
12777
|
settingsWidth = this.width;
|
|
@@ -12903,40 +12914,6 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
12903
12914
|
*/
|
|
12904
12915
|
Gantt.prototype.windowResize = function () {
|
|
12905
12916
|
if (!isNullOrUndefined(this.element)) {
|
|
12906
|
-
var settingsHeight = void 0;
|
|
12907
|
-
if (this.height.indexOf('%') !== -1) {
|
|
12908
|
-
var ganttHeight = Number(this.height.split("%")[0]);
|
|
12909
|
-
if (this.element.parentElement && (this.element.parentElement.style.height)) {
|
|
12910
|
-
var containerHeight = void 0;
|
|
12911
|
-
if (this.element.parentElement.style.height.indexOf('%') == -1) {
|
|
12912
|
-
containerHeight = Number(this.element.parentElement.style.height.split("px")[0]);
|
|
12913
|
-
ganttHeight = (ganttHeight * containerHeight) / 100;
|
|
12914
|
-
}
|
|
12915
|
-
else {
|
|
12916
|
-
containerHeight = Number(this.element.parentElement.style.height.split("%")[0]);
|
|
12917
|
-
ganttHeight = (window.innerHeight * containerHeight) / 100;
|
|
12918
|
-
}
|
|
12919
|
-
}
|
|
12920
|
-
else {
|
|
12921
|
-
ganttHeight = Number(this.height.split("%")[0]);
|
|
12922
|
-
ganttHeight = (ganttHeight * window.innerHeight) / 100;
|
|
12923
|
-
}
|
|
12924
|
-
if (this.height === '100%') {
|
|
12925
|
-
ganttHeight = ganttHeight - 16;
|
|
12926
|
-
}
|
|
12927
|
-
var toolbarHeight = 0;
|
|
12928
|
-
if (!isNullOrUndefined(this.toolbarModule) && !isNullOrUndefined(this.toolbarModule.element)) {
|
|
12929
|
-
toolbarHeight = this.toolbarModule.element.offsetHeight;
|
|
12930
|
-
}
|
|
12931
|
-
var contentHeight = ganttHeight - this.ganttChartModule.chartTimelineContainer.offsetHeight - toolbarHeight;
|
|
12932
|
-
settingsHeight = this.validateDimentionValue(ganttHeight);
|
|
12933
|
-
this.element.style.height = settingsHeight;
|
|
12934
|
-
this.element.querySelectorAll('.e-content')[0]['style'].height = contentHeight + 'px';
|
|
12935
|
-
this.element.querySelectorAll('.e-content')[2]['style'].height = contentHeight + 'px';
|
|
12936
|
-
}
|
|
12937
|
-
else {
|
|
12938
|
-
settingsHeight = this.validateDimentionValue(this.height);
|
|
12939
|
-
}
|
|
12940
12917
|
this.updateContentHeight();
|
|
12941
12918
|
this.ganttChartModule.updateWidthAndHeight(); // Updating chart scroll conatiner height for row mismatch
|
|
12942
12919
|
this.treeGridModule.ensureScrollBar();
|
|
@@ -13282,6 +13259,18 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
13282
13259
|
* @private
|
|
13283
13260
|
*/
|
|
13284
13261
|
Gantt.prototype.treeDataBound = function (args) {
|
|
13262
|
+
this.element.getElementsByClassName('e-chart-root-container')[0]['style'].height = '100%';
|
|
13263
|
+
var gridHeight = this.element.getElementsByClassName('e-gridcontent')[0]['style'].height;
|
|
13264
|
+
var timelineContainer = this.element.getElementsByClassName('e-timeline-header-container')[0]['offsetHeight'];
|
|
13265
|
+
gridHeight = 'calc(100% - ' + timelineContainer + 'px)';
|
|
13266
|
+
// eslint-disable-next-line
|
|
13267
|
+
this.element.getElementsByClassName('e-chart-scroll-container e-content')[0]['style'].height = 'calc(100% - ' + timelineContainer + 'px)';
|
|
13268
|
+
if (!isNullOrUndefined(this.toolbarModule)) {
|
|
13269
|
+
this.splitterElement.style.height = 'calc(100% - ' + this.toolbarModule.element.offsetHeight + 'px)';
|
|
13270
|
+
}
|
|
13271
|
+
else {
|
|
13272
|
+
this.splitterElement.style.height = '100%';
|
|
13273
|
+
}
|
|
13285
13274
|
if (this.isLoad) {
|
|
13286
13275
|
this.updateCurrentViewData();
|
|
13287
13276
|
if (!this.enableVirtualization) {
|
|
@@ -13301,8 +13290,7 @@ var Gantt = /** @__PURE__ @class */ (function (_super) {
|
|
|
13301
13290
|
removeClass(this.treeGrid.element.querySelectorAll('.e-headercell'), timelineSingleHeaderOuterDiv);
|
|
13302
13291
|
removeClass(this.treeGrid.element.querySelectorAll('.e-columnheader'), timelineSingleHeaderOuterDiv);
|
|
13303
13292
|
}
|
|
13304
|
-
this.treeGrid.height =
|
|
13305
|
-
this.treeGrid.grid.getHeaderContent().offsetHeight;
|
|
13293
|
+
this.treeGrid.height = '100%';
|
|
13306
13294
|
this.notify('tree-grid-created', {});
|
|
13307
13295
|
this.createGanttPopUpElement();
|
|
13308
13296
|
this.hideSpinner();
|
|
@@ -23701,23 +23689,22 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23701
23689
|
}
|
|
23702
23690
|
/* data Source update */
|
|
23703
23691
|
if (!isNullOrUndefined(parentItem)) {
|
|
23704
|
-
|
|
23705
|
-
|
|
23692
|
+
if (rowPosition == 'Above') {
|
|
23693
|
+
childIndex = parentItem.childRecords.indexOf(this.addRowSelectedItem);
|
|
23694
|
+
}
|
|
23695
|
+
else if (rowPosition == 'Below') {
|
|
23696
|
+
childIndex = parentItem.childRecords.indexOf(this.addRowSelectedItem) + 1;
|
|
23697
|
+
}
|
|
23698
|
+
else {
|
|
23699
|
+
childIndex = parentItem.childRecords.length;
|
|
23700
|
+
} /*Child collection update*/
|
|
23706
23701
|
parentItem.childRecords.splice(childIndex, 0, record);
|
|
23707
23702
|
if ((this.parent.dataSource instanceof DataManager &&
|
|
23708
23703
|
isNullOrUndefined(parentItem.taskData[this.parent.taskFields.parentID])) ||
|
|
23709
23704
|
!isNullOrUndefined(this.parent.dataSource)) {
|
|
23710
23705
|
var child = this.parent.taskFields.child;
|
|
23711
23706
|
if (parentItem.taskData[child] && parentItem.taskData[child].length > 0) {
|
|
23712
|
-
|
|
23713
|
-
parentItem.taskData[child].splice(childIndex, 0, record.taskData);
|
|
23714
|
-
}
|
|
23715
|
-
else if (rowPosition === 'Below') {
|
|
23716
|
-
parentItem.taskData[child].splice(childIndex + 1, 0, record.taskData);
|
|
23717
|
-
}
|
|
23718
|
-
else {
|
|
23719
|
-
parentItem.taskData[child].push(record.taskData);
|
|
23720
|
-
}
|
|
23707
|
+
parentItem.taskData[child].splice(childIndex, 0, record.taskData);
|
|
23721
23708
|
}
|
|
23722
23709
|
else {
|
|
23723
23710
|
parentItem.taskData[child] = [];
|
|
@@ -23780,11 +23767,27 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
23780
23767
|
}
|
|
23781
23768
|
};
|
|
23782
23769
|
Edit$$1.prototype.refreshRecordInImmutableMode = function () {
|
|
23770
|
+
var _loop_1 = function (i) {
|
|
23771
|
+
var originalData = this_1.parent.modifiedRecords[i];
|
|
23772
|
+
var treeIndex = this_1.parent.allowRowDragAndDrop ? 1 : 0;
|
|
23773
|
+
var uniqueTaskID = this_1.parent.taskFields.id;
|
|
23774
|
+
originalIndex = this_1.parent.currentViewData.findIndex(function (data) {
|
|
23775
|
+
return (data[uniqueTaskID] == originalData[uniqueTaskID]);
|
|
23776
|
+
});
|
|
23777
|
+
if (this_1.parent.treeGrid.getRows()[originalIndex]) {
|
|
23778
|
+
this_1.parent.treeGrid.renderModule.cellRender({
|
|
23779
|
+
data: originalData, cell: this_1.parent.treeGrid.getRows()[originalIndex].cells[this_1.parent.treeColumnIndex + treeIndex],
|
|
23780
|
+
column: this_1.parent.treeGrid.grid.getColumns()[this_1.parent.treeColumnIndex],
|
|
23781
|
+
requestType: 'rowDragAndDrop'
|
|
23782
|
+
});
|
|
23783
|
+
this_1.parent.treeGrid.renderModule.RowModifier({
|
|
23784
|
+
data: originalData, row: this_1.parent.treeGrid.getRows()[originalIndex], rowHeight: this_1.parent.rowHeight
|
|
23785
|
+
});
|
|
23786
|
+
}
|
|
23787
|
+
};
|
|
23788
|
+
var this_1 = this, originalIndex;
|
|
23783
23789
|
for (var i = 0; i < this.parent.modifiedRecords.length; i++) {
|
|
23784
|
-
|
|
23785
|
-
var dataId = this.parent.viewType === 'ProjectView' ?
|
|
23786
|
-
originalData.ganttProperties.taskId : originalData.ganttProperties.rowUniqueID;
|
|
23787
|
-
this.parent.treeGrid.grid.setRowData(dataId, originalData);
|
|
23790
|
+
_loop_1(i);
|
|
23788
23791
|
}
|
|
23789
23792
|
};
|
|
23790
23793
|
/**
|
|
@@ -24538,15 +24541,18 @@ var Edit$2 = /** @__PURE__ @class */ (function () {
|
|
|
24538
24541
|
if (this.dropPosition === 'topSegment' || this.dropPosition === 'bottomSegment') {
|
|
24539
24542
|
draggedRec[this.parent.taskFields.parentID] = droppedRec[this.parent.taskFields.parentID];
|
|
24540
24543
|
draggedRec.taskData[this.parent.taskFields.parentID] = droppedRec[this.parent.taskFields.parentID];
|
|
24544
|
+
draggedRec.ganttProperties['parentId'] = droppedRec[this.parent.taskFields.parentID];
|
|
24541
24545
|
}
|
|
24542
24546
|
else {
|
|
24543
24547
|
draggedRec[this.parent.taskFields.parentID] = droppedRec[this.parent.taskFields.id];
|
|
24544
24548
|
draggedRec.taskData[this.parent.taskFields.parentID] = droppedRec[this.parent.taskFields.id];
|
|
24549
|
+
draggedRec.ganttProperties['parentId'] = droppedRec[this.parent.taskFields.id];
|
|
24545
24550
|
}
|
|
24546
24551
|
}
|
|
24547
24552
|
else {
|
|
24548
24553
|
draggedRec[this.parent.taskFields.parentID] = null;
|
|
24549
24554
|
draggedRec.taskData[this.parent.taskFields.parentID] = null;
|
|
24555
|
+
draggedRec.ganttProperties['parentId'] = null;
|
|
24550
24556
|
}
|
|
24551
24557
|
}
|
|
24552
24558
|
};
|
|
@@ -25408,8 +25414,9 @@ var Selection$1 = /** @__PURE__ @class */ (function () {
|
|
|
25408
25414
|
}
|
|
25409
25415
|
this.addRemoveClass(index);
|
|
25410
25416
|
this.selectedRowIndexes = extend([], this.getSelectedRowIndexes(), [], true);
|
|
25411
|
-
|
|
25412
|
-
|
|
25417
|
+
this.parent.setProperties({ selectedRowIndex: -1 }, true);
|
|
25418
|
+
if (this.selectedRowIndexes.length === 1) {
|
|
25419
|
+
this.parent.setProperties({ selectedRowIndex: this.selectedRowIndexes[0] }, true);
|
|
25413
25420
|
}
|
|
25414
25421
|
if (!isNullOrUndefined(this.parent.toolbarModule)) {
|
|
25415
25422
|
this.parent.toolbarModule.refreshToolbarItems();
|