@syncfusion/ej2-gantt 19.3.44 → 19.3.48

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/ej2-gantt.umd.min.js +2 -2
  3. package/dist/ej2-gantt.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-gantt.es2015.js +93 -28
  5. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es5.js +146 -71
  7. package/dist/es6/ej2-gantt.es5.js.map +1 -1
  8. package/dist/global/ej2-gantt.min.js +2 -2
  9. package/dist/global/ej2-gantt.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +17 -17
  12. package/src/gantt/actions/cell-edit.js +1 -0
  13. package/src/gantt/actions/context-menu.js +5 -0
  14. package/src/gantt/actions/dialog-edit.js +6 -6
  15. package/src/gantt/actions/edit.js +7 -3
  16. package/src/gantt/actions/rowdragdrop.js +74 -41
  17. package/src/gantt/actions/taskbar-edit.js +3 -1
  18. package/src/gantt/base/date-processor.js +4 -1
  19. package/src/gantt/base/gantt.js +20 -0
  20. package/src/gantt/base/task-processor.js +11 -2
  21. package/src/gantt/base/utils.js +3 -3
  22. package/src/gantt/export/export-helper.js +12 -14
  23. package/styles/bootstrap-dark.css +99 -99
  24. package/styles/bootstrap.css +99 -99
  25. package/styles/bootstrap4.css +104 -99
  26. package/styles/bootstrap5-dark.css +104 -99
  27. package/styles/bootstrap5.css +104 -99
  28. package/styles/fabric-dark.css +99 -99
  29. package/styles/fabric.css +99 -99
  30. package/styles/gantt/_bootstrap-dark-definition.scss +0 -1
  31. package/styles/gantt/_bootstrap-definition.scss +0 -1
  32. package/styles/gantt/_bootstrap4-definition.scss +0 -1
  33. package/styles/gantt/_bootstrap5-definition.scss +0 -1
  34. package/styles/gantt/_fabric-dark-definition.scss +0 -1
  35. package/styles/gantt/_fabric-definition.scss +0 -1
  36. package/styles/gantt/_highcontrast-definition.scss +0 -1
  37. package/styles/gantt/_highcontrast-light-definition.scss +0 -1
  38. package/styles/gantt/_layout.scss +100 -95
  39. package/styles/gantt/_material-dark-definition.scss +0 -1
  40. package/styles/gantt/_material-definition.scss +0 -1
  41. package/styles/gantt/_tailwind-definition.scss +0 -1
  42. package/styles/gantt/_theme.scss +76 -81
  43. package/styles/gantt/bootstrap-dark.css +99 -99
  44. package/styles/gantt/bootstrap.css +99 -99
  45. package/styles/gantt/bootstrap4.css +104 -99
  46. package/styles/gantt/bootstrap5-dark.css +104 -99
  47. package/styles/gantt/bootstrap5-dark.scss +1 -0
  48. package/styles/gantt/bootstrap5.css +104 -99
  49. package/styles/gantt/bootstrap5.scss +1 -0
  50. package/styles/gantt/fabric-dark.css +99 -99
  51. package/styles/gantt/fabric.css +99 -99
  52. package/styles/gantt/highcontrast-light.css +99 -99
  53. package/styles/gantt/highcontrast.css +99 -99
  54. package/styles/gantt/material-dark.css +99 -99
  55. package/styles/gantt/material.css +99 -99
  56. package/styles/gantt/tailwind-dark.css +99 -99
  57. package/styles/gantt/tailwind.css +99 -99
  58. package/styles/highcontrast-light.css +99 -99
  59. package/styles/highcontrast.css +99 -99
  60. package/styles/material-dark.css +99 -99
  61. package/styles/material.css +99 -99
  62. package/styles/tailwind-dark.css +99 -99
  63. package/styles/tailwind.css +99 -99
@@ -1,7 +1,7 @@
1
1
  import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, addClass, append, classList, closest, compile, createElement, deleteObject, extend, formatUnit, getValue, isNullOrUndefined, isObject, isObjectArray, isUndefined, merge, remove, removeClass, setValue } from '@syncfusion/ej2-base';
2
2
  import { Dialog, Tooltip, createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
3
3
  import { Edit, ForeignKey, Grid, Page, Predicate, Toolbar, ValueFormatter, click, filterAfterOpen, getActualProperties, getCustomDateFormat, getFilterMenuPostion, getForeignData, getObject, getUid, parentsUntil, setCssInGridPopUp } from '@syncfusion/ej2-grids';
4
- import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, ODataV4Adaptor, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
4
+ import { CacheAdaptor, DataManager, DataUtil, Deferred, ODataAdaptor, ODataV4Adaptor, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
5
  import { ColumnMenu, ContextMenu, Edit as Edit$1, ExcelExport, Filter, Reorder, Resize, RowDD, Selection, Sort, TreeGrid, VirtualScroll } from '@syncfusion/ej2-treegrid';
6
6
  import { Splitter } from '@syncfusion/ej2-layouts';
7
7
  import { ContextMenu as ContextMenu$1, Tab, Toolbar as Toolbar$1 } from '@syncfusion/ej2-navigations';
@@ -85,7 +85,7 @@ function isRemoteData(dataSource) {
85
85
  return (adaptor instanceof ODataAdaptor || (adaptor instanceof ODataV4Adaptor) ||
86
86
  (adaptor instanceof WebApiAdaptor) || (adaptor instanceof WebMethodAdaptor) ||
87
87
  (adaptor instanceof CacheAdaptor) || (adaptor instanceof RemoteSaveAdaptor) ||
88
- (adaptor instanceof JsonAdaptor) || adaptor instanceof UrlAdaptor);
88
+ adaptor instanceof UrlAdaptor);
89
89
  }
90
90
  return false;
91
91
  }
@@ -113,7 +113,7 @@ function getTaskData(records, isNotExtend, eventArgs, parent) {
113
113
  for (let i = 0; i < records.length; i++) {
114
114
  let data;
115
115
  if (!isNullOrUndefined(parent) && parent.timezone) {
116
- this.updateDates(records[i], parent);
116
+ updateDates(records[i], parent);
117
117
  }
118
118
  // eslint-disable-next-line
119
119
  data = isNotExtend ? (records[i].taskData) : extend({}, records[i].taskData, {}, true);
@@ -1207,7 +1207,10 @@ class DateProcessor {
1207
1207
  }
1208
1208
  }
1209
1209
  remove(date, timezone) {
1210
- return this.reverse(date, timezone, date.getTimezoneOffset());
1210
+ if (!isNullOrUndefined(date)) {
1211
+ date = this.reverse(date, timezone, date.getTimezoneOffset());
1212
+ }
1213
+ return date;
1211
1214
  }
1212
1215
  reverse(date, fromOffset, toOffset) {
1213
1216
  if (typeof fromOffset === 'string') {
@@ -2113,6 +2116,13 @@ class TaskProcessor extends DateProcessor {
2113
2116
  const id = data[taskSettings.id];
2114
2117
  const index = this.taskIds.indexOf(id.toString());
2115
2118
  const tempData = (index > -1) ? this.dataArray[index] : {};
2119
+ if (!isNullOrUndefined(this.parent.taskFields.segmentId)) {
2120
+ const segmentDataCollection = this.segmentCollection.
2121
+ filter((x) => x.key === tempData[this.parent.taskFields.id]);
2122
+ if (segmentDataCollection.length > 0) {
2123
+ tempData[this.parent.taskFields.segments] = segmentDataCollection[0].items;
2124
+ }
2125
+ }
2116
2126
  this.parent.setRecordValue('taskData', tempData, ganttData);
2117
2127
  }
2118
2128
  else {
@@ -2313,6 +2323,7 @@ class TaskProcessor extends DateProcessor {
2313
2323
  if (!isNullOrUndefined(ganttProperties.duration)) {
2314
2324
  this.parent.setRecordValue('duration', updatedDuration, ganttProperties, true);
2315
2325
  }
2326
+ this.parent.dataOperation.updateMappingData(ganttData, 'duration');
2316
2327
  }
2317
2328
  }
2318
2329
  /**
@@ -13007,6 +13018,9 @@ let Gantt = class Gantt extends Component {
13007
13018
  if (this.keyboardModule) {
13008
13019
  this.keyboardModule.destroy();
13009
13020
  }
13021
+ if (this.editModule && this.editModule.dialogModule) {
13022
+ this.editModule.dialogModule.destroy();
13023
+ }
13010
13024
  super.destroy();
13011
13025
  this.chartVerticalLineContainer = null;
13012
13026
  this.element.innerHTML = '';
@@ -13253,6 +13267,23 @@ let Gantt = class Gantt extends Component {
13253
13267
  this.treeGrid.height = this.ganttHeight - toolbarHeight -
13254
13268
  this.treeGrid.grid.getHeaderContent().offsetHeight;
13255
13269
  this.splitterModule.splitterObject.height = (this.ganttHeight - toolbarHeight).toString();
13270
+ if (!isNullOrUndefined(this.chartVerticalLineContainer)) {
13271
+ this.chartVerticalLineContainer.style.height = this.ganttHeight + 'px';
13272
+ }
13273
+ if (!isNullOrUndefined(this.dayMarkersModule)) {
13274
+ const holidayContainer$$1 = getValue('nonworkingDayRender.holidayContainer', this.dayMarkersModule);
13275
+ const weekendContainer$$1 = getValue('nonworkingDayRender.weekendContainer', this.dayMarkersModule);
13276
+ const eventMarkersContainer$$1 = getValue('eventMarkerRender.eventMarkersContainer', this.dayMarkersModule);
13277
+ if (holidayContainer$$1) {
13278
+ holidayContainer$$1.style.height = this.ganttHeight + 'px';
13279
+ }
13280
+ if (weekendContainer$$1) {
13281
+ weekendContainer$$1.style.height = this.ganttHeight + 'px';
13282
+ }
13283
+ if (eventMarkersContainer$$1) {
13284
+ eventMarkersContainer$$1.style.height = this.ganttHeight + 'px';
13285
+ }
13286
+ }
13256
13287
  this.splitterModule.splitterObject.width = this.ganttWidth.toString();
13257
13288
  this.ganttChartModule.scrollObject.
13258
13289
  setHeight(this.ganttHeight - this.ganttChartModule.chartTimelineContainer.offsetHeight - toolbarHeight);
@@ -15538,6 +15569,7 @@ class CellEdit {
15538
15569
  this.parent.editModule.dialogModule.isResourceUpdate = true;
15539
15570
  this.parent.editModule.dialogModule.previousResource = previousResource;
15540
15571
  }
15572
+ this.updateDates(args);
15541
15573
  this.updateEditedRecord(args);
15542
15574
  }
15543
15575
  }
@@ -16107,6 +16139,7 @@ class TaskbarEdit extends DateProcessor {
16107
16139
  showHideTaskBarEditingElements(element, secondElement, fadeConnectorLine) {
16108
16140
  secondElement = secondElement ? secondElement : this.editElement;
16109
16141
  let isShowProgressResizer = this.parent.taskFields.progress ? true : false;
16142
+ let isShowConnectorPoints = true;
16110
16143
  if (this.parent.readOnly) {
16111
16144
  return;
16112
16145
  }
@@ -16116,6 +16149,7 @@ class TaskbarEdit extends DateProcessor {
16116
16149
  if (!isNullOrUndefined(parentRecord)) {
16117
16150
  if (!parentRecord.expanded) {
16118
16151
  isShowProgressResizer = false;
16152
+ isShowConnectorPoints = false;
16119
16153
  }
16120
16154
  }
16121
16155
  }
@@ -16142,7 +16176,7 @@ class TaskbarEdit extends DateProcessor {
16142
16176
  if (!isNullOrUndefined(this.parent.taskFields.dependency)
16143
16177
  && (element.querySelector('.' + connectorPointLeft)
16144
16178
  || element.parentElement.querySelector('.' + connectorPointLeft))
16145
- && isShowProgressResizer) {
16179
+ && isShowConnectorPoints) {
16146
16180
  const connectorElement = !isNullOrUndefined(element.querySelector('.' + connectorPointLeft)) ?
16147
16181
  element : element.parentElement;
16148
16182
  addClass([connectorElement.querySelector('.' + connectorPointLeft)], [connectorPointLeftHover]);
@@ -18044,7 +18078,7 @@ class DialogEdit {
18044
18078
  dialogModel.position = position;
18045
18079
  //dialogModel.width = '750px';
18046
18080
  dialogModel.height = this.parent.isAdaptive ? '100%' : 'auto';
18047
- dialogModel.target = this.parent.element;
18081
+ dialogModel.target = document.body;
18048
18082
  dialogModel.close = this.dialogClose.bind(this);
18049
18083
  dialogModel.closeOnEscape = true;
18050
18084
  dialogModel.open = (args) => {
@@ -18330,15 +18364,15 @@ class DialogEdit {
18330
18364
  this.resourceSelection(id);
18331
18365
  }
18332
18366
  else if (id === ganttObj.element.id + 'NotesTabContainer') {
18333
- ganttObj.element.querySelector('#' + id).ej2_instances[0].refresh();
18367
+ document.getElementById(id).ej2_instances[0].refresh();
18334
18368
  }
18335
18369
  else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
18336
18370
  if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {
18337
- ganttObj.element.querySelector('#' + id).ej2_instances[0]
18371
+ document.getElementById(id).ej2_instances[0]
18338
18372
  .enableToolbarItems([this.parent.element.id + 'SegmentsTabContainer' + '_add'], false);
18339
18373
  }
18340
18374
  else {
18341
- ganttObj.element.querySelector('#' + id).ej2_instances[0]
18375
+ document.getElementById(id).ej2_instances[0]
18342
18376
  .enableToolbarItems([this.parent.element.id + 'SegmentsTabContainer' + '_add'], true);
18343
18377
  }
18344
18378
  }
@@ -19285,7 +19319,7 @@ class DialogEdit {
19285
19319
  updateResourceCollection(args, resourceTreeGridId) {
19286
19320
  if (!isNullOrUndefined(args.data) && Object.keys(args.data).length) {
19287
19321
  const ganttObj = this.parent;
19288
- const treeGridId = ganttObj.element.querySelector('#' + resourceTreeGridId);
19322
+ const treeGridId = document.querySelector('#' + resourceTreeGridId);
19289
19323
  const resourceTreeGrid = treeGridId.ej2_instances[0];
19290
19324
  if (!isNullOrUndefined(resourceTreeGrid) && resourceTreeGrid.getSelectedRecords().length > 0) {
19291
19325
  const tempRecords = resourceTreeGrid.getSelectedRecords();
@@ -19358,7 +19392,7 @@ class DialogEdit {
19358
19392
  return divElement;
19359
19393
  }
19360
19394
  resourceSelection(id) {
19361
- const resourceTreeGrid = this.parent.element.querySelector('#' + id).ej2_instances[0];
19395
+ const resourceTreeGrid = document.querySelector('#' + id).ej2_instances[0];
19362
19396
  let currentViewData = resourceTreeGrid.getCurrentViewRecords();
19363
19397
  let resources = this.ganttResources;
19364
19398
  if (resources && resources.length > 0) {
@@ -21168,7 +21202,10 @@ class Edit$2 {
21168
21202
  if (ganttProp.work > 0 || column === 'work') {
21169
21203
  switch (taskType) {
21170
21204
  case 'FixedUnit':
21171
- if (isAutoSchedule && ganttProp.resourceInfo.length &&
21205
+ if (ganttProp.resourceInfo.length === 0) {
21206
+ return;
21207
+ }
21208
+ else if (isAutoSchedule && ganttProp.resourceInfo.length &&
21172
21209
  (column === 'work' || (column === 'resource'))) {
21173
21210
  this.parent.dataOperation.updateDurationWithWork(currentData);
21174
21211
  }
@@ -21730,6 +21767,7 @@ class Edit$2 {
21730
21767
  let eventArgs = {};
21731
21768
  eventArgs.requestType = 'beforeSave';
21732
21769
  eventArgs.data = args.data;
21770
+ eventArgs.cancel = false;
21733
21771
  eventArgs.modifiedRecords = this.parent.editedRecords;
21734
21772
  if (!isNullOrUndefined(args.target)) {
21735
21773
  eventArgs.target = args.target;
@@ -22559,13 +22597,13 @@ class Edit$2 {
22559
22597
  changedRecords: eventArg.modifiedTaskData
22560
22598
  };
22561
22599
  const adaptor = data.adaptor;
22600
+ const query = this.parent.query instanceof Query ? this.parent.query : new Query();
22562
22601
  if (!(adaptor instanceof WebApiAdaptor && adaptor instanceof ODataAdaptor) || data.dataSource.batchUrl) {
22563
- const crud = data.saveChanges(updatedData, this.parent.taskFields.id);
22602
+ const crud = data.saveChanges(updatedData, this.parent.taskFields.id, null, query);
22564
22603
  crud.then(() => this.deleteSuccess(args))
22565
22604
  .catch((e) => this.dmFailure(e, args));
22566
22605
  }
22567
22606
  else {
22568
- const query = this.parent.query instanceof Query ? this.parent.query : new Query();
22569
22607
  const deletedRecords = 'deletedRecords';
22570
22608
  let deleteCrud = null;
22571
22609
  for (let i = 0; i < updatedData[deletedRecords].length; i++) {
@@ -26023,6 +26061,11 @@ class ContextMenu$2 {
26023
26061
  const target = args.event ? args.event.target :
26024
26062
  !this.parent.focusModule ? this.parent.focusModule.getActiveElement() :
26025
26063
  this.parent.ganttChartModule.targetElement;
26064
+ // Closed edited cell before opening context menu
26065
+ // eslint-disable-next-line
26066
+ if (!isNullOrUndefined(this.parent.editModule) && this.parent.editModule.cellEditModule && this.parent.editModule.cellEditModule.isCellEdit && target.parentElement.classList.contains('e-row')) {
26067
+ this.parent.treeGrid.closeEdit();
26068
+ }
26026
26069
  if (!isNullOrUndefined(args.element) && args.element.id === this.parent.element.id + '_contextmenu') {
26027
26070
  this.clickedPosition = getValue('event', args).clientX;
26028
26071
  }
@@ -26782,6 +26825,30 @@ class RowDD$1 {
26782
26825
  this.updateParentRecords.push(draggedRecord.parentItem);
26783
26826
  }
26784
26827
  }
26828
+ if (!this.parent.enableVirtualization) {
26829
+ let data = gObj.flatData;
26830
+ let startIndex;
26831
+ let endIndex;
26832
+ if (draggedRecord.index < droppedRecord.index) {
26833
+ startIndex = draggedRecord.index;
26834
+ endIndex = droppedRecord.index;
26835
+ }
26836
+ else {
26837
+ startIndex = droppedRecord.index;
26838
+ endIndex = draggedRecord.index;
26839
+ }
26840
+ for (let i = startIndex; i <= endIndex; i++) {
26841
+ if (!isNullOrUndefined(data[i])) {
26842
+ data[i].index = i;
26843
+ if (!isNullOrUndefined(data[i].parentItem)) {
26844
+ let updatedParent = data.filter((e) => {
26845
+ return e.uniqueID === data[i].parentUniqueID;
26846
+ })[0];
26847
+ data[i].parentItem.index = updatedParent.index;
26848
+ }
26849
+ }
26850
+ }
26851
+ }
26785
26852
  gObj.rowDragAndDropModule.refreshDataSource();
26786
26853
  }
26787
26854
  if (this.dropPosition === 'middleSegment') {
@@ -29558,7 +29625,7 @@ class ExportHelper {
29558
29625
  const taskFields = this.parent.taskFields;
29559
29626
  const ganttProps = data.ganttProperties;
29560
29627
  if (column.editType === 'datepickeredit' || column.editType === 'datetimepickeredit') {
29561
- cell.value = this.parent.getFormatedDate(data[column.field], this.parent.getDateFormat());
29628
+ cell.value = data[column.field];
29562
29629
  }
29563
29630
  else if (column.field === taskFields.duration) {
29564
29631
  cell.value = this.parent.getDurationString(ganttProps.duration, ganttProps.durationUnit);
@@ -29581,20 +29648,18 @@ class ExportHelper {
29581
29648
  else {
29582
29649
  cell.style.format.paragraphIndent = cell.row.level * 10;
29583
29650
  }
29584
- if (this.parent.pdfQueryCellInfo != null) {
29585
- const args = {
29586
- data: data,
29587
- value: cell.value,
29588
- column: column,
29589
- style: cell.style,
29590
- cell: cell
29591
- };
29592
- args.value = this.exportValueFormatter.formatCellValue(args);
29593
- if (this.parent.pdfQueryCellInfo) {
29594
- this.parent.trigger('pdfQueryCellInfo', args);
29595
- }
29596
- cell.value = args.value;
29651
+ const args = {
29652
+ data: data,
29653
+ value: cell.value,
29654
+ column: column,
29655
+ style: cell.style,
29656
+ cell: cell
29657
+ };
29658
+ args.value = this.exportValueFormatter.formatCellValue(args);
29659
+ if (this.parent.pdfQueryCellInfo) {
29660
+ this.parent.trigger('pdfQueryCellInfo', args);
29597
29661
  }
29662
+ cell.value = args.value;
29598
29663
  }
29599
29664
  /**
29600
29665
  * Method for create the taskbar collection for rendering