@syncfusion/ej2-gantt 20.2.46 → 20.2.50

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.2.46
3
+ * version : 20.2.50
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-gantt@*",
3
- "_id": "@syncfusion/ej2-gantt@20.2.45",
3
+ "_id": "@syncfusion/ej2-gantt@20.2.49",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-ajQDPydpNT3nPoQsgQbNvzpYTsTRNCTDPtZiSUAwNJvMOpc7kCnsctSdfoZlO2MUz3rIGiJUIHeLjIpCytU4rw==",
5
+ "_integrity": "sha512-j65MRf6oB1NnWXX/PvaUdFJYznLcj5VFQ5XbkkhrekSkk1PH7Vd9ipxZQrIdaVqDRnACWmBClPe6+WmNUy2OxQ==",
6
6
  "_location": "/@syncfusion/ej2-gantt",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -23,8 +23,8 @@
23
23
  "/@syncfusion/ej2-react-gantt",
24
24
  "/@syncfusion/ej2-vue-gantt"
25
25
  ],
26
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-20.2.45.tgz",
27
- "_shasum": "04dc5c6523a85ba8ecadcd80d6b9e43c7f202fd8",
26
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-gantt/-/ej2-gantt-20.2.49.tgz",
27
+ "_shasum": "2cf74a3f9e016c1e63b363b06ee8755bddc929fb",
28
28
  "_spec": "@syncfusion/ej2-gantt@*",
29
29
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
30
30
  "author": {
@@ -35,19 +35,19 @@
35
35
  },
36
36
  "bundleDependencies": false,
37
37
  "dependencies": {
38
- "@syncfusion/ej2-base": "~20.2.46",
38
+ "@syncfusion/ej2-base": "~20.2.48",
39
39
  "@syncfusion/ej2-buttons": "~20.2.46",
40
- "@syncfusion/ej2-calendars": "~20.2.46",
40
+ "@syncfusion/ej2-calendars": "~20.2.50",
41
41
  "@syncfusion/ej2-data": "~20.2.45",
42
- "@syncfusion/ej2-dropdowns": "~20.2.46",
43
- "@syncfusion/ej2-grids": "~20.2.46",
44
- "@syncfusion/ej2-inputs": "~20.2.45",
42
+ "@syncfusion/ej2-dropdowns": "~20.2.50",
43
+ "@syncfusion/ej2-grids": "~20.2.49",
44
+ "@syncfusion/ej2-inputs": "~20.2.48",
45
45
  "@syncfusion/ej2-layouts": "~20.2.46",
46
46
  "@syncfusion/ej2-lists": "~20.2.46",
47
- "@syncfusion/ej2-navigations": "~20.2.46",
48
- "@syncfusion/ej2-popups": "~20.2.45",
49
- "@syncfusion/ej2-richtexteditor": "~20.2.46",
50
- "@syncfusion/ej2-treegrid": "~20.2.46"
47
+ "@syncfusion/ej2-navigations": "~20.2.50",
48
+ "@syncfusion/ej2-popups": "~20.2.49",
49
+ "@syncfusion/ej2-richtexteditor": "~20.2.50",
50
+ "@syncfusion/ej2-treegrid": "~20.2.49"
51
51
  },
52
52
  "deprecated": false,
53
53
  "description": "Essential JS 2 Gantt Component",
@@ -75,6 +75,6 @@
75
75
  "url": "git+https://github.com/syncfusion/ej2-gantt.git"
76
76
  },
77
77
  "typings": "index.d.ts",
78
- "version": "20.2.46",
78
+ "version": "20.2.50",
79
79
  "sideEffects": false
80
80
  }
@@ -1671,7 +1671,20 @@ var DialogEdit = /** @class */ (function () {
1671
1671
  var rowResource = ganttData.ganttProperties.resourceInfo;
1672
1672
  var inputModel = this.beforeOpenArgs[itemName];
1673
1673
  var resourceTreeGridId = ganttObj.element.id + '' + itemName + 'TabContainer';
1674
- var resourceData = extend([], [], ganttObj.resources, true);
1674
+ var resourceData = [];
1675
+ if (this.parent.viewType === 'ResourceView') {
1676
+ for (var i = 0; i < ganttObj.currentViewData.length; i++) {
1677
+ for (var j = 0; j < ganttObj.resources.length; j++) {
1678
+ if (ganttObj.currentViewData[i][ganttObj.taskFields.id] === ganttObj.resources[j][resourceSettings.id] &&
1679
+ (ganttObj.currentViewData[i].hasChildRecords || isNullOrUndefined(ganttObj.currentViewData[i].parentItem))) {
1680
+ resourceData.push(ganttObj.resources[j]);
1681
+ }
1682
+ }
1683
+ }
1684
+ }
1685
+ else {
1686
+ resourceData = extend([], [], ganttObj.resources, true);
1687
+ }
1675
1688
  this.parent.dataOperation.updateResourceUnit(resourceData);
1676
1689
  if (!isNullOrUndefined(rowResource)) {
1677
1690
  var count = void 0;
@@ -497,7 +497,7 @@ var Edit = /** @class */ (function () {
497
497
  this.parent.dataOperation.updateMappingData(ganttData, 'duration');
498
498
  this.parent.dataOperation.updateMappingData(ganttData, 'endDate');
499
499
  }
500
- else if (key === 'taskType') {
500
+ else if (key === tasks.type) {
501
501
  ganttObj.setRecordValue('taskType', data[key], ganttData.ganttProperties, true);
502
502
  //this.parent.dataOperation.updateMappingData(ganttData, 'taskType');
503
503
  }
@@ -1589,14 +1589,22 @@ var Edit = /** @class */ (function () {
1589
1589
  */
1590
1590
  Edit.prototype.deleteResourceRecords = function (selectedRecords) {
1591
1591
  var deleteRecords = [];
1592
- for (var i = 0; i < selectedRecords.length; i++) {
1592
+ var _loop_1 = function (i) {
1593
1593
  if (selectedRecords[i].parentItem) {
1594
1594
  var data = selectedRecords[i];
1595
- var ids = data.ganttProperties.sharedTaskUniqueIds;
1596
- for (var j = 0; j < ids.length; j++) {
1597
- deleteRecords.push(this.parent.flatData[this.parent.ids.indexOf(ids[j].toString())]);
1598
- }
1595
+ deleteRecords.push(this_1.parent.flatData[this_1.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
1599
1596
  }
1597
+ else {
1598
+ var resourceParent = this_1.parent.flatData.filter(function (data) {
1599
+ return (parseInt(data.ganttProperties.taskId) == parseInt(selectedRecords[i].ganttProperties.taskId) &&
1600
+ data.hasChildRecords);
1601
+ })[0];
1602
+ deleteRecords.push(resourceParent);
1603
+ }
1604
+ };
1605
+ var this_1 = this;
1606
+ for (var i = 0; i < selectedRecords.length; i++) {
1607
+ _loop_1(i);
1600
1608
  }
1601
1609
  this.deleteRow(deleteRecords);
1602
1610
  };
@@ -2043,6 +2051,14 @@ var Edit = /** @class */ (function () {
2043
2051
  eventArgs.modifiedTaskData = getTaskData(args.updatedRecordCollection, null, null, this.parent);
2044
2052
  setValue('action', args.action, eventArgs);
2045
2053
  this.parent.isOnDelete = false;
2054
+ if (this.parent.viewType === 'ResourceView') {
2055
+ var updateUnAssignedResources = eventArgs.data.filter(function (data) {
2056
+ return !data.hasChildRecords;
2057
+ });
2058
+ for (var i = 0; i < updateUnAssignedResources.length; i++) {
2059
+ this.checkWithUnassignedTask(updateUnAssignedResources[i]);
2060
+ }
2061
+ }
2046
2062
  this.parent.trigger('actionComplete', eventArgs);
2047
2063
  this.deletedTaskDetails = [];
2048
2064
  this.parent.initiateEditAction(false);
@@ -2460,27 +2476,27 @@ var Edit = /** @class */ (function () {
2460
2476
  }
2461
2477
  }
2462
2478
  }
2463
- var _loop_1 = function (i) {
2464
- var originalData = this_1.parent.modifiedRecords[i];
2465
- var treeIndex = this_1.parent.allowRowDragAndDrop ? 1 : 0;
2466
- var uniqueTaskID = this_1.parent.taskFields.id;
2467
- originalIndex = this_1.parent.currentViewData.findIndex(function (data) {
2479
+ var _loop_2 = function (i) {
2480
+ var originalData = this_2.parent.modifiedRecords[i];
2481
+ var treeIndex = this_2.parent.allowRowDragAndDrop ? 1 : 0;
2482
+ var uniqueTaskID = this_2.parent.taskFields.id;
2483
+ originalIndex = this_2.parent.currentViewData.findIndex(function (data) {
2468
2484
  return (data[uniqueTaskID] == originalData[uniqueTaskID]);
2469
2485
  });
2470
- if (this_1.parent.treeGrid.getRows()[originalIndex]) {
2471
- this_1.parent.treeGrid.renderModule.cellRender({
2472
- data: originalData, cell: this_1.parent.treeGrid.getRows()[originalIndex].cells[this_1.parent.treeColumnIndex + treeIndex],
2473
- column: this_1.parent.treeGrid.grid.getColumns()[this_1.parent.treeColumnIndex],
2486
+ if (this_2.parent.treeGrid.getRows()[originalIndex]) {
2487
+ this_2.parent.treeGrid.renderModule.cellRender({
2488
+ data: originalData, cell: this_2.parent.treeGrid.getRows()[originalIndex].cells[this_2.parent.treeColumnIndex + treeIndex],
2489
+ column: this_2.parent.treeGrid.grid.getColumns()[this_2.parent.treeColumnIndex],
2474
2490
  requestType: 'rowDragAndDrop'
2475
2491
  });
2476
- this_1.parent.treeGrid.renderModule.RowModifier({
2477
- data: originalData, row: this_1.parent.treeGrid.getRows()[originalIndex], rowHeight: this_1.parent.rowHeight
2492
+ this_2.parent.treeGrid.renderModule.RowModifier({
2493
+ data: originalData, row: this_2.parent.treeGrid.getRows()[originalIndex], rowHeight: this_2.parent.rowHeight
2478
2494
  });
2479
2495
  }
2480
2496
  };
2481
- var this_1 = this, originalIndex;
2497
+ var this_2 = this, originalIndex;
2482
2498
  for (var i = 0; i < this.parent.modifiedRecords.length; i++) {
2483
- _loop_1(i);
2499
+ _loop_2(i);
2484
2500
  }
2485
2501
  };
2486
2502
  /**
@@ -36,7 +36,6 @@ export declare class Filter {
36
36
  private actionBegin;
37
37
  closeFilterOnContextClick(element: Element): void;
38
38
  private actionComplete;
39
- private setPosition;
40
39
  private updateFilterMenuPosition;
41
40
  private removeEventListener;
42
41
  /**
@@ -1,5 +1,5 @@
1
1
  import { TreeGrid, Filter as TreeGridFilter } from '@syncfusion/ej2-treegrid';
2
- import { filterAfterOpen, getFilterMenuPostion } from '@syncfusion/ej2-grids';
2
+ import { filterAfterOpen } from '@syncfusion/ej2-grids';
3
3
  import { getActualProperties, getCustomDateFormat } from '@syncfusion/ej2-grids';
4
4
  import { getValue, isNullOrUndefined, remove, createElement, addClass, closest } from '@syncfusion/ej2-base';
5
5
  import { TextBox } from '@syncfusion/ej2-inputs';
@@ -229,45 +229,9 @@ var Filter = /** @class */ (function () {
229
229
  }
230
230
  }
231
231
  };
232
- Filter.prototype.setPosition = function (li, ul) {
233
- var gridPos = this.parent.element.getBoundingClientRect();
234
- var liPos = li.getBoundingClientRect();
235
- var left = liPos.right + window.scrollX;
236
- var top = liPos.top + window.scrollY;
237
- if (gridPos.right < (left + ul.offsetWidth)) {
238
- if ((liPos.left - ul.offsetWidth) > gridPos.left) {
239
- left = (liPos.left - ul.offsetWidth);
240
- }
241
- else {
242
- left -= (left + ul.offsetWidth) - gridPos.right;
243
- }
244
- }
245
- ul.style.top = top + 'px';
246
- ul.style.left = left + 'px';
247
- };
248
232
  Filter.prototype.updateFilterMenuPosition = function (element, args) {
249
233
  addClass([element], 'e-gantt');
250
- document.querySelector('#' + this.parent.controlId).appendChild(element);
251
- var targetElement;
252
- if (this.parent.showColumnMenu) {
253
- targetElement = document.querySelector('#treeGrid' + this.parent.controlId + '_gridcontrol_colmenu_Filter');
254
- element.style.zIndex = targetElement.parentElement.style.zIndex;
255
- if (this.parent.treeGrid.filterSettings.type === 'Menu') {
256
- this.setPosition(targetElement, getValue('filterModel.dlgObj.element', args));
257
- }
258
- else {
259
- this.setPosition(targetElement, getValue('filterModel.dialogObj.element', args));
260
- }
261
- }
262
- else {
263
- targetElement = this.parent.treeGrid.grid.getColumnHeaderByField(args.columnName).querySelector('.e-filtermenudiv');
264
- if (this.parent.treeGrid.filterSettings.type === 'Menu') {
265
- getFilterMenuPostion(targetElement, getValue('filterModel.dlgObj', args));
266
- }
267
- else {
268
- getFilterMenuPostion(targetElement, getValue('filterModel.dialogObj', args));
269
- }
270
- }
234
+ document.querySelector('#' + this.parent.treeGrid.grid.element.id).appendChild(element);
271
235
  if (this.parent.treeGrid.filterSettings.type === 'Menu') {
272
236
  element.querySelector('.e-valid-input').focus();
273
237
  }
@@ -405,7 +405,7 @@ var Toolbar = /** @class */ (function () {
405
405
  var isDeleteSelected = gObj.selectionModule ? gObj.selectionModule.selectedRowIndexes.length > 0 ||
406
406
  gObj.selectionModule.getSelectedRowCellIndexes().length > 0 ? true : false : false;
407
407
  // eslint-disable-next-line
408
- edit.allowDeleting && isResouceParent && hasData && isDeleteSelected && !touchEdit ?
408
+ edit.allowDeleting && hasData && isDeleteSelected && !touchEdit ?
409
409
  enableItems.push(gID + '_delete') : disableItems.push(gID + '_delete');
410
410
  if (gObj.editSettings.mode === 'Auto' && !isNullOrUndefined(gObj.editModule.cellEditModule)
411
411
  && gObj.editModule.cellEditModule.isCellEdit) {
@@ -451,6 +451,9 @@ var DateProcessor = /** @class */ (function () {
451
451
  */
452
452
  DateProcessor.prototype.getProjectStartDate = function (ganttProp, isLoad) {
453
453
  if (!isNullOrUndefined(this.parent.cloneProjectStartDate)) {
454
+ if (typeof this.parent.cloneProjectStartDate === 'string') {
455
+ this.parent.cloneProjectStartDate = this.getDateFromFormat(this.parent.cloneProjectStartDate);
456
+ }
454
457
  var cloneStartDate = this.checkStartDate(this.parent.cloneProjectStartDate);
455
458
  this.parent.cloneProjectStartDate = cloneStartDate;
456
459
  return new Date(cloneStartDate.getTime());