@syncfusion/ej2-gantt 19.3.45 → 19.3.53
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 +43 -0
- 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 +76 -13
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +129 -56
- 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 +18 -18
- package/src/gantt/actions/context-menu.js +5 -0
- package/src/gantt/actions/dialog-edit.js +6 -6
- package/src/gantt/actions/edit.js +3 -2
- package/src/gantt/actions/rowdragdrop.js +74 -41
- package/src/gantt/actions/taskbar-edit.js +3 -1
- package/src/gantt/base/date-processor.js +4 -1
- package/src/gantt/base/gantt.js +20 -0
- package/src/gantt/base/task-processor.js +11 -2
- package/src/gantt/base/utils.js +3 -3
- package/styles/bootstrap-dark.css +95 -99
- package/styles/bootstrap.css +95 -99
- package/styles/bootstrap4.css +100 -99
- package/styles/bootstrap5-dark.css +101 -99
- package/styles/bootstrap5.css +101 -99
- package/styles/fabric-dark.css +95 -99
- package/styles/fabric.css +95 -99
- package/styles/gantt/_bootstrap-dark-definition.scss +0 -1
- package/styles/gantt/_bootstrap-definition.scss +0 -1
- package/styles/gantt/_bootstrap4-definition.scss +0 -1
- package/styles/gantt/_bootstrap5-definition.scss +0 -1
- package/styles/gantt/_fabric-dark-definition.scss +0 -1
- package/styles/gantt/_fabric-definition.scss +0 -1
- package/styles/gantt/_highcontrast-definition.scss +0 -1
- package/styles/gantt/_highcontrast-light-definition.scss +0 -1
- package/styles/gantt/_layout.scss +94 -93
- package/styles/gantt/_material-dark-definition.scss +0 -1
- package/styles/gantt/_material-definition.scss +0 -1
- package/styles/gantt/_tailwind-definition.scss +0 -1
- package/styles/gantt/_theme.scss +76 -81
- package/styles/gantt/bootstrap-dark.css +95 -99
- package/styles/gantt/bootstrap.css +95 -99
- package/styles/gantt/bootstrap4.css +100 -99
- package/styles/gantt/bootstrap5-dark.css +101 -99
- package/styles/gantt/bootstrap5.css +101 -99
- package/styles/gantt/fabric-dark.css +95 -99
- package/styles/gantt/fabric.css +95 -99
- package/styles/gantt/highcontrast-light.css +95 -99
- package/styles/gantt/highcontrast.css +95 -99
- package/styles/gantt/material-dark.css +95 -99
- package/styles/gantt/material.css +95 -99
- package/styles/gantt/tailwind-dark.css +95 -99
- package/styles/gantt/tailwind.css +95 -99
- package/styles/highcontrast-light.css +95 -99
- package/styles/highcontrast.css +95 -99
- package/styles/material-dark.css +95 -99
- package/styles/material.css +95 -99
- package/styles/tailwind-dark.css +95 -99
- package/styles/tailwind.css +95 -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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -16108,6 +16139,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
16108
16139
|
showHideTaskBarEditingElements(element, secondElement, fadeConnectorLine) {
|
|
16109
16140
|
secondElement = secondElement ? secondElement : this.editElement;
|
|
16110
16141
|
let isShowProgressResizer = this.parent.taskFields.progress ? true : false;
|
|
16142
|
+
let isShowConnectorPoints = true;
|
|
16111
16143
|
if (this.parent.readOnly) {
|
|
16112
16144
|
return;
|
|
16113
16145
|
}
|
|
@@ -16117,6 +16149,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
16117
16149
|
if (!isNullOrUndefined(parentRecord)) {
|
|
16118
16150
|
if (!parentRecord.expanded) {
|
|
16119
16151
|
isShowProgressResizer = false;
|
|
16152
|
+
isShowConnectorPoints = false;
|
|
16120
16153
|
}
|
|
16121
16154
|
}
|
|
16122
16155
|
}
|
|
@@ -16143,7 +16176,7 @@ class TaskbarEdit extends DateProcessor {
|
|
|
16143
16176
|
if (!isNullOrUndefined(this.parent.taskFields.dependency)
|
|
16144
16177
|
&& (element.querySelector('.' + connectorPointLeft)
|
|
16145
16178
|
|| element.parentElement.querySelector('.' + connectorPointLeft))
|
|
16146
|
-
&&
|
|
16179
|
+
&& isShowConnectorPoints) {
|
|
16147
16180
|
const connectorElement = !isNullOrUndefined(element.querySelector('.' + connectorPointLeft)) ?
|
|
16148
16181
|
element : element.parentElement;
|
|
16149
16182
|
addClass([connectorElement.querySelector('.' + connectorPointLeft)], [connectorPointLeftHover]);
|
|
@@ -18045,7 +18078,7 @@ class DialogEdit {
|
|
|
18045
18078
|
dialogModel.position = position;
|
|
18046
18079
|
//dialogModel.width = '750px';
|
|
18047
18080
|
dialogModel.height = this.parent.isAdaptive ? '100%' : 'auto';
|
|
18048
|
-
dialogModel.target =
|
|
18081
|
+
dialogModel.target = document.body;
|
|
18049
18082
|
dialogModel.close = this.dialogClose.bind(this);
|
|
18050
18083
|
dialogModel.closeOnEscape = true;
|
|
18051
18084
|
dialogModel.open = (args) => {
|
|
@@ -18331,15 +18364,15 @@ class DialogEdit {
|
|
|
18331
18364
|
this.resourceSelection(id);
|
|
18332
18365
|
}
|
|
18333
18366
|
else if (id === ganttObj.element.id + 'NotesTabContainer') {
|
|
18334
|
-
|
|
18367
|
+
document.getElementById(id).ej2_instances[0].refresh();
|
|
18335
18368
|
}
|
|
18336
18369
|
else if (id === ganttObj.element.id + 'SegmentsTabContainer') {
|
|
18337
18370
|
if (isNullOrUndefined(this.beforeOpenArgs.rowData.ganttProperties.startDate)) {
|
|
18338
|
-
|
|
18371
|
+
document.getElementById(id).ej2_instances[0]
|
|
18339
18372
|
.enableToolbarItems([this.parent.element.id + 'SegmentsTabContainer' + '_add'], false);
|
|
18340
18373
|
}
|
|
18341
18374
|
else {
|
|
18342
|
-
|
|
18375
|
+
document.getElementById(id).ej2_instances[0]
|
|
18343
18376
|
.enableToolbarItems([this.parent.element.id + 'SegmentsTabContainer' + '_add'], true);
|
|
18344
18377
|
}
|
|
18345
18378
|
}
|
|
@@ -19286,7 +19319,7 @@ class DialogEdit {
|
|
|
19286
19319
|
updateResourceCollection(args, resourceTreeGridId) {
|
|
19287
19320
|
if (!isNullOrUndefined(args.data) && Object.keys(args.data).length) {
|
|
19288
19321
|
const ganttObj = this.parent;
|
|
19289
|
-
const treeGridId =
|
|
19322
|
+
const treeGridId = document.querySelector('#' + resourceTreeGridId);
|
|
19290
19323
|
const resourceTreeGrid = treeGridId.ej2_instances[0];
|
|
19291
19324
|
if (!isNullOrUndefined(resourceTreeGrid) && resourceTreeGrid.getSelectedRecords().length > 0) {
|
|
19292
19325
|
const tempRecords = resourceTreeGrid.getSelectedRecords();
|
|
@@ -19359,7 +19392,7 @@ class DialogEdit {
|
|
|
19359
19392
|
return divElement;
|
|
19360
19393
|
}
|
|
19361
19394
|
resourceSelection(id) {
|
|
19362
|
-
const resourceTreeGrid =
|
|
19395
|
+
const resourceTreeGrid = document.querySelector('#' + id).ej2_instances[0];
|
|
19363
19396
|
let currentViewData = resourceTreeGrid.getCurrentViewRecords();
|
|
19364
19397
|
let resources = this.ganttResources;
|
|
19365
19398
|
if (resources && resources.length > 0) {
|
|
@@ -21734,6 +21767,7 @@ class Edit$2 {
|
|
|
21734
21767
|
let eventArgs = {};
|
|
21735
21768
|
eventArgs.requestType = 'beforeSave';
|
|
21736
21769
|
eventArgs.data = args.data;
|
|
21770
|
+
eventArgs.cancel = false;
|
|
21737
21771
|
eventArgs.modifiedRecords = this.parent.editedRecords;
|
|
21738
21772
|
if (!isNullOrUndefined(args.target)) {
|
|
21739
21773
|
eventArgs.target = args.target;
|
|
@@ -22563,13 +22597,13 @@ class Edit$2 {
|
|
|
22563
22597
|
changedRecords: eventArg.modifiedTaskData
|
|
22564
22598
|
};
|
|
22565
22599
|
const adaptor = data.adaptor;
|
|
22600
|
+
const query = this.parent.query instanceof Query ? this.parent.query : new Query();
|
|
22566
22601
|
if (!(adaptor instanceof WebApiAdaptor && adaptor instanceof ODataAdaptor) || data.dataSource.batchUrl) {
|
|
22567
|
-
const crud = data.saveChanges(updatedData, this.parent.taskFields.id);
|
|
22602
|
+
const crud = data.saveChanges(updatedData, this.parent.taskFields.id, null, query);
|
|
22568
22603
|
crud.then(() => this.deleteSuccess(args))
|
|
22569
22604
|
.catch((e) => this.dmFailure(e, args));
|
|
22570
22605
|
}
|
|
22571
22606
|
else {
|
|
22572
|
-
const query = this.parent.query instanceof Query ? this.parent.query : new Query();
|
|
22573
22607
|
const deletedRecords = 'deletedRecords';
|
|
22574
22608
|
let deleteCrud = null;
|
|
22575
22609
|
for (let i = 0; i < updatedData[deletedRecords].length; i++) {
|
|
@@ -26027,6 +26061,11 @@ class ContextMenu$2 {
|
|
|
26027
26061
|
const target = args.event ? args.event.target :
|
|
26028
26062
|
!this.parent.focusModule ? this.parent.focusModule.getActiveElement() :
|
|
26029
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
|
+
}
|
|
26030
26069
|
if (!isNullOrUndefined(args.element) && args.element.id === this.parent.element.id + '_contextmenu') {
|
|
26031
26070
|
this.clickedPosition = getValue('event', args).clientX;
|
|
26032
26071
|
}
|
|
@@ -26786,6 +26825,30 @@ class RowDD$1 {
|
|
|
26786
26825
|
this.updateParentRecords.push(draggedRecord.parentItem);
|
|
26787
26826
|
}
|
|
26788
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
|
+
}
|
|
26789
26852
|
gObj.rowDragAndDropModule.refreshDataSource();
|
|
26790
26853
|
}
|
|
26791
26854
|
if (this.dropPosition === 'middleSegment') {
|