@syncfusion/ej2-gantt 19.3.43 → 19.3.47

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 (58) hide show
  1. package/CHANGELOG.md +35 -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 +61 -27
  5. package/dist/es6/ej2-gantt.es2015.js.map +1 -1
  6. package/dist/es6/ej2-gantt.es5.js +64 -29
  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 +18 -18
  12. package/src/gantt/actions/cell-edit.js +1 -0
  13. package/src/gantt/actions/dialog-edit.js +6 -6
  14. package/src/gantt/actions/edit.js +7 -3
  15. package/src/gantt/base/date-processor.js +4 -1
  16. package/src/gantt/base/gantt.js +20 -0
  17. package/src/gantt/base/task-processor.js +11 -2
  18. package/src/gantt/base/utils.js +3 -3
  19. package/src/gantt/export/export-helper.js +12 -14
  20. package/styles/bootstrap-dark.css +99 -99
  21. package/styles/bootstrap.css +99 -99
  22. package/styles/bootstrap4.css +104 -99
  23. package/styles/bootstrap5-dark.css +104 -99
  24. package/styles/bootstrap5.css +104 -99
  25. package/styles/fabric-dark.css +99 -99
  26. package/styles/fabric.css +99 -99
  27. package/styles/gantt/_bootstrap-dark-definition.scss +0 -1
  28. package/styles/gantt/_bootstrap-definition.scss +0 -1
  29. package/styles/gantt/_bootstrap4-definition.scss +0 -1
  30. package/styles/gantt/_bootstrap5-definition.scss +0 -1
  31. package/styles/gantt/_fabric-dark-definition.scss +0 -1
  32. package/styles/gantt/_fabric-definition.scss +0 -1
  33. package/styles/gantt/_highcontrast-definition.scss +0 -1
  34. package/styles/gantt/_highcontrast-light-definition.scss +0 -1
  35. package/styles/gantt/_layout.scss +100 -95
  36. package/styles/gantt/_material-dark-definition.scss +0 -1
  37. package/styles/gantt/_material-definition.scss +0 -1
  38. package/styles/gantt/_tailwind-definition.scss +0 -1
  39. package/styles/gantt/_theme.scss +76 -81
  40. package/styles/gantt/bootstrap-dark.css +99 -99
  41. package/styles/gantt/bootstrap.css +99 -99
  42. package/styles/gantt/bootstrap4.css +104 -99
  43. package/styles/gantt/bootstrap5-dark.css +104 -99
  44. package/styles/gantt/bootstrap5.css +104 -99
  45. package/styles/gantt/fabric-dark.css +99 -99
  46. package/styles/gantt/fabric.css +99 -99
  47. package/styles/gantt/highcontrast-light.css +99 -99
  48. package/styles/gantt/highcontrast.css +99 -99
  49. package/styles/gantt/material-dark.css +99 -99
  50. package/styles/gantt/material.css +99 -99
  51. package/styles/gantt/tailwind-dark.css +99 -99
  52. package/styles/gantt/tailwind.css +99 -99
  53. package/styles/highcontrast-light.css +99 -99
  54. package/styles/highcontrast.css +99 -99
  55. package/styles/material-dark.css +99 -99
  56. package/styles/material.css +99 -99
  57. package/styles/tailwind-dark.css +99 -99
  58. 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
  }
@@ -18044,7 +18076,7 @@ class DialogEdit {
18044
18076
  dialogModel.position = position;
18045
18077
  //dialogModel.width = '750px';
18046
18078
  dialogModel.height = this.parent.isAdaptive ? '100%' : 'auto';
18047
- dialogModel.target = this.parent.element;
18079
+ dialogModel.target = document.body;
18048
18080
  dialogModel.close = this.dialogClose.bind(this);
18049
18081
  dialogModel.closeOnEscape = true;
18050
18082
  dialogModel.open = (args) => {
@@ -18330,15 +18362,15 @@ class DialogEdit {
18330
18362
  this.resourceSelection(id);
18331
18363
  }
18332
18364
  else if (id === ganttObj.element.id + 'NotesTabContainer') {
18333
- ganttObj.element.querySelector('#' + id).ej2_instances[0].refresh();
18365
+ document.getElementById(id).ej2_instances[0].refresh();
18334
18366
  }
18335
18367
  else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
18336
18368
  if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {
18337
- ganttObj.element.querySelector('#' + id).ej2_instances[0]
18369
+ document.getElementById(id).ej2_instances[0]
18338
18370
  .enableToolbarItems([this.parent.element.id + 'SegmentsTabContainer' + '_add'], false);
18339
18371
  }
18340
18372
  else {
18341
- ganttObj.element.querySelector('#' + id).ej2_instances[0]
18373
+ document.getElementById(id).ej2_instances[0]
18342
18374
  .enableToolbarItems([this.parent.element.id + 'SegmentsTabContainer' + '_add'], true);
18343
18375
  }
18344
18376
  }
@@ -19285,7 +19317,7 @@ class DialogEdit {
19285
19317
  updateResourceCollection(args, resourceTreeGridId) {
19286
19318
  if (!isNullOrUndefined(args.data) && Object.keys(args.data).length) {
19287
19319
  const ganttObj = this.parent;
19288
- const treeGridId = ganttObj.element.querySelector('#' + resourceTreeGridId);
19320
+ const treeGridId = document.querySelector('#' + resourceTreeGridId);
19289
19321
  const resourceTreeGrid = treeGridId.ej2_instances[0];
19290
19322
  if (!isNullOrUndefined(resourceTreeGrid) && resourceTreeGrid.getSelectedRecords().length > 0) {
19291
19323
  const tempRecords = resourceTreeGrid.getSelectedRecords();
@@ -19358,7 +19390,7 @@ class DialogEdit {
19358
19390
  return divElement;
19359
19391
  }
19360
19392
  resourceSelection(id) {
19361
- const resourceTreeGrid = this.parent.element.querySelector('#' + id).ej2_instances[0];
19393
+ const resourceTreeGrid = document.querySelector('#' + id).ej2_instances[0];
19362
19394
  let currentViewData = resourceTreeGrid.getCurrentViewRecords();
19363
19395
  let resources = this.ganttResources;
19364
19396
  if (resources && resources.length > 0) {
@@ -21168,7 +21200,10 @@ class Edit$2 {
21168
21200
  if (ganttProp.work > 0 || column === 'work') {
21169
21201
  switch (taskType) {
21170
21202
  case 'FixedUnit':
21171
- if (isAutoSchedule && ganttProp.resourceInfo.length &&
21203
+ if (ganttProp.resourceInfo.length === 0) {
21204
+ return;
21205
+ }
21206
+ else if (isAutoSchedule && ganttProp.resourceInfo.length &&
21172
21207
  (column === 'work' || (column === 'resource'))) {
21173
21208
  this.parent.dataOperation.updateDurationWithWork(currentData);
21174
21209
  }
@@ -21730,6 +21765,7 @@ class Edit$2 {
21730
21765
  let eventArgs = {};
21731
21766
  eventArgs.requestType = 'beforeSave';
21732
21767
  eventArgs.data = args.data;
21768
+ eventArgs.cancel = false;
21733
21769
  eventArgs.modifiedRecords = this.parent.editedRecords;
21734
21770
  if (!isNullOrUndefined(args.target)) {
21735
21771
  eventArgs.target = args.target;
@@ -22559,13 +22595,13 @@ class Edit$2 {
22559
22595
  changedRecords: eventArg.modifiedTaskData
22560
22596
  };
22561
22597
  const adaptor = data.adaptor;
22598
+ const query = this.parent.query instanceof Query ? this.parent.query : new Query();
22562
22599
  if (!(adaptor instanceof WebApiAdaptor && adaptor instanceof ODataAdaptor) || data.dataSource.batchUrl) {
22563
- const crud = data.saveChanges(updatedData, this.parent.taskFields.id);
22600
+ const crud = data.saveChanges(updatedData, this.parent.taskFields.id, null, query);
22564
22601
  crud.then(() => this.deleteSuccess(args))
22565
22602
  .catch((e) => this.dmFailure(e, args));
22566
22603
  }
22567
22604
  else {
22568
- const query = this.parent.query instanceof Query ? this.parent.query : new Query();
22569
22605
  const deletedRecords = 'deletedRecords';
22570
22606
  let deleteCrud = null;
22571
22607
  for (let i = 0; i < updatedData[deletedRecords].length; i++) {
@@ -29558,7 +29594,7 @@ class ExportHelper {
29558
29594
  const taskFields = this.parent.taskFields;
29559
29595
  const ganttProps = data.ganttProperties;
29560
29596
  if (column.editType === 'datepickeredit' || column.editType === 'datetimepickeredit') {
29561
- cell.value = this.parent.getFormatedDate(data[column.field], this.parent.getDateFormat());
29597
+ cell.value = data[column.field];
29562
29598
  }
29563
29599
  else if (column.field === taskFields.duration) {
29564
29600
  cell.value = this.parent.getDurationString(ganttProps.duration, ganttProps.durationUnit);
@@ -29581,20 +29617,18 @@ class ExportHelper {
29581
29617
  else {
29582
29618
  cell.style.format.paragraphIndent = cell.row.level * 10;
29583
29619
  }
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;
29620
+ const args = {
29621
+ data: data,
29622
+ value: cell.value,
29623
+ column: column,
29624
+ style: cell.style,
29625
+ cell: cell
29626
+ };
29627
+ args.value = this.exportValueFormatter.formatCellValue(args);
29628
+ if (this.parent.pdfQueryCellInfo) {
29629
+ this.parent.trigger('pdfQueryCellInfo', args);
29597
29630
  }
29631
+ cell.value = args.value;
29598
29632
  }
29599
29633
  /**
29600
29634
  * Method for create the taskbar collection for rendering