@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.
- package/CHANGELOG.md +18 -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 +37 -45
- package/dist/es6/ej2-gantt.es2015.js.map +1 -1
- package/dist/es6/ej2-gantt.es5.js +55 -59
- 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 +14 -14
- package/src/gantt/actions/dialog-edit.js +14 -1
- package/src/gantt/actions/edit.js +35 -19
- package/src/gantt/actions/filter.d.ts +0 -1
- package/src/gantt/actions/filter.js +2 -38
- package/src/gantt/actions/toolbar.js +1 -1
- package/src/gantt/base/date-processor.js +3 -0
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
import { Edit, ForeignKey, Grid, Page, Predicate, Toolbar, ValueFormatter, click, filterAfterOpen, getActualProperties, getCustomDateFormat,
|
|
3
|
+
import { Edit, ForeignKey, Grid, Page, Predicate, Toolbar, ValueFormatter, click, filterAfterOpen, getActualProperties, getCustomDateFormat, getForeignData, getObject, getUid, parentsUntil, setCssInGridPopUp } from '@syncfusion/ej2-grids';
|
|
4
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';
|
|
@@ -652,6 +652,9 @@ class DateProcessor {
|
|
|
652
652
|
*/
|
|
653
653
|
getProjectStartDate(ganttProp, isLoad) {
|
|
654
654
|
if (!isNullOrUndefined(this.parent.cloneProjectStartDate)) {
|
|
655
|
+
if (typeof this.parent.cloneProjectStartDate === 'string') {
|
|
656
|
+
this.parent.cloneProjectStartDate = this.getDateFromFormat(this.parent.cloneProjectStartDate);
|
|
657
|
+
}
|
|
655
658
|
const cloneStartDate = this.checkStartDate(this.parent.cloneProjectStartDate);
|
|
656
659
|
this.parent.cloneProjectStartDate = cloneStartDate;
|
|
657
660
|
return new Date(cloneStartDate.getTime());
|
|
@@ -19941,7 +19944,20 @@ class DialogEdit {
|
|
|
19941
19944
|
const rowResource = ganttData.ganttProperties.resourceInfo;
|
|
19942
19945
|
const inputModel = this.beforeOpenArgs[itemName];
|
|
19943
19946
|
const resourceTreeGridId = ganttObj.element.id + '' + itemName + 'TabContainer';
|
|
19944
|
-
|
|
19947
|
+
let resourceData = [];
|
|
19948
|
+
if (this.parent.viewType === 'ResourceView') {
|
|
19949
|
+
for (let i = 0; i < ganttObj.currentViewData.length; i++) {
|
|
19950
|
+
for (let j = 0; j < ganttObj.resources.length; j++) {
|
|
19951
|
+
if (ganttObj.currentViewData[i][ganttObj.taskFields.id] === ganttObj.resources[j][resourceSettings.id] &&
|
|
19952
|
+
(ganttObj.currentViewData[i].hasChildRecords || isNullOrUndefined(ganttObj.currentViewData[i].parentItem))) {
|
|
19953
|
+
resourceData.push(ganttObj.resources[j]);
|
|
19954
|
+
}
|
|
19955
|
+
}
|
|
19956
|
+
}
|
|
19957
|
+
}
|
|
19958
|
+
else {
|
|
19959
|
+
resourceData = extend([], [], ganttObj.resources, true);
|
|
19960
|
+
}
|
|
19945
19961
|
this.parent.dataOperation.updateResourceUnit(resourceData);
|
|
19946
19962
|
if (!isNullOrUndefined(rowResource)) {
|
|
19947
19963
|
let count;
|
|
@@ -21783,7 +21799,7 @@ class Edit$2 {
|
|
|
21783
21799
|
this.parent.dataOperation.updateMappingData(ganttData, 'duration');
|
|
21784
21800
|
this.parent.dataOperation.updateMappingData(ganttData, 'endDate');
|
|
21785
21801
|
}
|
|
21786
|
-
else if (key ===
|
|
21802
|
+
else if (key === tasks.type) {
|
|
21787
21803
|
ganttObj.setRecordValue('taskType', data[key], ganttData.ganttProperties, true);
|
|
21788
21804
|
//this.parent.dataOperation.updateMappingData(ganttData, 'taskType');
|
|
21789
21805
|
}
|
|
@@ -22877,10 +22893,14 @@ class Edit$2 {
|
|
|
22877
22893
|
for (let i = 0; i < selectedRecords.length; i++) {
|
|
22878
22894
|
if (selectedRecords[i].parentItem) {
|
|
22879
22895
|
const data = selectedRecords[i];
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22896
|
+
deleteRecords.push(this.parent.flatData[this.parent.ids.indexOf(data.ganttProperties.rowUniqueID)]);
|
|
22897
|
+
}
|
|
22898
|
+
else {
|
|
22899
|
+
const resourceParent = this.parent.flatData.filter((data) => {
|
|
22900
|
+
return (parseInt(data.ganttProperties.taskId) == parseInt(selectedRecords[i].ganttProperties.taskId) &&
|
|
22901
|
+
data.hasChildRecords);
|
|
22902
|
+
})[0];
|
|
22903
|
+
deleteRecords.push(resourceParent);
|
|
22884
22904
|
}
|
|
22885
22905
|
}
|
|
22886
22906
|
this.deleteRow(deleteRecords);
|
|
@@ -23327,6 +23347,14 @@ class Edit$2 {
|
|
|
23327
23347
|
eventArgs.modifiedTaskData = getTaskData(args.updatedRecordCollection, null, null, this.parent);
|
|
23328
23348
|
setValue('action', args.action, eventArgs);
|
|
23329
23349
|
this.parent.isOnDelete = false;
|
|
23350
|
+
if (this.parent.viewType === 'ResourceView') {
|
|
23351
|
+
const updateUnAssignedResources = eventArgs.data.filter((data) => {
|
|
23352
|
+
return !data.hasChildRecords;
|
|
23353
|
+
});
|
|
23354
|
+
for (let i = 0; i < updateUnAssignedResources.length; i++) {
|
|
23355
|
+
this.checkWithUnassignedTask(updateUnAssignedResources[i]);
|
|
23356
|
+
}
|
|
23357
|
+
}
|
|
23330
23358
|
this.parent.trigger('actionComplete', eventArgs);
|
|
23331
23359
|
this.deletedTaskDetails = [];
|
|
23332
23360
|
this.parent.initiateEditAction(false);
|
|
@@ -25106,45 +25134,9 @@ class Filter$1 {
|
|
|
25106
25134
|
}
|
|
25107
25135
|
}
|
|
25108
25136
|
}
|
|
25109
|
-
setPosition(li, ul) {
|
|
25110
|
-
const gridPos = this.parent.element.getBoundingClientRect();
|
|
25111
|
-
const liPos = li.getBoundingClientRect();
|
|
25112
|
-
let left = liPos.right + window.scrollX;
|
|
25113
|
-
const top = liPos.top + window.scrollY;
|
|
25114
|
-
if (gridPos.right < (left + ul.offsetWidth)) {
|
|
25115
|
-
if ((liPos.left - ul.offsetWidth) > gridPos.left) {
|
|
25116
|
-
left = (liPos.left - ul.offsetWidth);
|
|
25117
|
-
}
|
|
25118
|
-
else {
|
|
25119
|
-
left -= (left + ul.offsetWidth) - gridPos.right;
|
|
25120
|
-
}
|
|
25121
|
-
}
|
|
25122
|
-
ul.style.top = top + 'px';
|
|
25123
|
-
ul.style.left = left + 'px';
|
|
25124
|
-
}
|
|
25125
25137
|
updateFilterMenuPosition(element, args) {
|
|
25126
25138
|
addClass([element], 'e-gantt');
|
|
25127
|
-
document.querySelector('#' + this.parent.
|
|
25128
|
-
let targetElement;
|
|
25129
|
-
if (this.parent.showColumnMenu) {
|
|
25130
|
-
targetElement = document.querySelector('#treeGrid' + this.parent.controlId + '_gridcontrol_colmenu_Filter');
|
|
25131
|
-
element.style.zIndex = targetElement.parentElement.style.zIndex;
|
|
25132
|
-
if (this.parent.treeGrid.filterSettings.type === 'Menu') {
|
|
25133
|
-
this.setPosition(targetElement, getValue('filterModel.dlgObj.element', args));
|
|
25134
|
-
}
|
|
25135
|
-
else {
|
|
25136
|
-
this.setPosition(targetElement, getValue('filterModel.dialogObj.element', args));
|
|
25137
|
-
}
|
|
25138
|
-
}
|
|
25139
|
-
else {
|
|
25140
|
-
targetElement = this.parent.treeGrid.grid.getColumnHeaderByField(args.columnName).querySelector('.e-filtermenudiv');
|
|
25141
|
-
if (this.parent.treeGrid.filterSettings.type === 'Menu') {
|
|
25142
|
-
getFilterMenuPostion(targetElement, getValue('filterModel.dlgObj', args));
|
|
25143
|
-
}
|
|
25144
|
-
else {
|
|
25145
|
-
getFilterMenuPostion(targetElement, getValue('filterModel.dialogObj', args));
|
|
25146
|
-
}
|
|
25147
|
-
}
|
|
25139
|
+
document.querySelector('#' + this.parent.treeGrid.grid.element.id).appendChild(element);
|
|
25148
25140
|
if (this.parent.treeGrid.filterSettings.type === 'Menu') {
|
|
25149
25141
|
element.querySelector('.e-valid-input').focus();
|
|
25150
25142
|
}
|
|
@@ -26168,7 +26160,7 @@ class Toolbar$3 {
|
|
|
26168
26160
|
const isDeleteSelected = gObj.selectionModule ? gObj.selectionModule.selectedRowIndexes.length > 0 ||
|
|
26169
26161
|
gObj.selectionModule.getSelectedRowCellIndexes().length > 0 ? true : false : false;
|
|
26170
26162
|
// eslint-disable-next-line
|
|
26171
|
-
edit.allowDeleting &&
|
|
26163
|
+
edit.allowDeleting && hasData && isDeleteSelected && !touchEdit ?
|
|
26172
26164
|
enableItems.push(gID + '_delete') : disableItems.push(gID + '_delete');
|
|
26173
26165
|
if (gObj.editSettings.mode === 'Auto' && !isNullOrUndefined(gObj.editModule.cellEditModule)
|
|
26174
26166
|
&& gObj.editModule.cellEditModule.isCellEdit) {
|