Skip to content

Commit 8c15cf9

Browse files
committed
[update] version 7.0.4
1 parent 65e1162 commit 8c15cf9

16 files changed

+127
-49
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# dhtmlxGantt #
22

33
[![dhtmlx.com](https://img.shields.io/badge/made%20by-DHTMLX-blue)](https://dhtmlx.com/)
4-
[![npm: v.7.0.3](https://img.shields.io/badge/npm-v.7.0.3-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt)
4+
[![npm: v.7.0.4](https://img.shields.io/badge/npm-v.7.0.4-blue.svg)](https://www.npmjs.com/package/dhtmlx-gantt)
55
[![License: GPL v2](https://img.shields.io/badge/license-GPL%20v2-blue.svg)](https://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
66

77
[Getting started](#getting-started) | [Features](#features) | [Follow us](#followus) | [License](#license) | [Useful links](#links)
@@ -128,7 +128,7 @@ Like our page on [Facebook](https://www.facebook.com/dhtmlx/) :thumbsup:
128128
<a name="license"></a>
129129
## License ##
130130

131-
dhtmlxGantt v.7.0.3 Standard
131+
dhtmlxGantt v.7.0.4 Standard
132132

133133
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
134134

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gantt",
3-
"version": "7.0.3",
3+
"version": "7.0.4",
44
"homepage": "https://dhtmlx.com/docs/products/dhtmlxGantt/",
55
"description": "An open source JavaScript Gantt chart that helps you illustrate a project schedule in a nice-looking chart.",
66
"main": [

codebase/dhtmlxgantt.d.ts

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for dhtmlxGantt 7.0.3
1+
// Type definitions for dhtmlxGantt 7.0.4
22
// Project: https://dhtmlx.com/docs/products/dhtmlxGantt
33

44
type GanttCallback = (...args: any[]) => any;
@@ -36,7 +36,7 @@ export interface GanttTemplates {
3636
drag_link_class(from: string|number, from_start: boolean, to: string|number, to_start: boolean): string;
3737

3838
/**
39-
* сonverts a date object to a date string. Used to send data back to the server
39+
* converts a date object to a date string. Used to send data back to the server
4040
* @param date the date which needs formatting
4141
*/
4242
format_date(date: Date): string;
@@ -1063,6 +1063,11 @@ export interface GanttConfigOptions {
10631063
*/
10641064
wai_aria_attributes: boolean;
10651065

1066+
/**
1067+
* sets both the section and its label on the same line
1068+
*/
1069+
wide_form: boolean;
1070+
10661071
/**
10671072
* enables calculating the duration of tasks in working time instead of calendar time
10681073
*/
@@ -1483,7 +1488,7 @@ export interface GanttStatic {
14831488
* returns the index of the column by the date
14841489
* @param date a date object
14851490
*/
1486-
columnIndexByDate(date: Date): void;
1491+
columnIndexByDate(date: Date): number;
14871492

14881493
/**
14891494
* calls a confirm message box
@@ -1510,7 +1515,7 @@ export interface GanttStatic {
15101515
createCalendar(parentCalendar?: any): void;
15111516

15121517
/**
1513-
* сreates a new dataProcessor instance and attaches it to gantt
1518+
* creates a new dataProcessor instance and attaches it to gantt
15141519
* @param config dataProcessor configuration object
15151520
*/
15161521
createDataProcessor(config: any): any;
@@ -2474,8 +2479,9 @@ export interface GanttStatic {
24742479
/**
24752480
* updates the specified task
24762481
* @param id the task id
2482+
* @param newState the new values of the task
24772483
*/
2478-
updateTask(id: string): void;
2484+
updateTask(id: string, newState: any): void;
24792485
}
24802486

24812487
declare var gantt: GanttStatic;

codebase/dhtmlxgantt.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/dhtmlxgantt.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codebase/sources/dhtmlxgantt.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.0.3 Standard
4+
dhtmlxGantt v.7.0.4 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/dhtmlxgantt.js

+85-29
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33

4-
dhtmlxGantt v.7.0.3 Standard
4+
dhtmlxGantt v.7.0.4 Standard
55

66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

@@ -8400,6 +8400,7 @@ var DataProcessor = /** @class */ (function () {
84008400
if (utils.defined(mode.payload)) {
84018401
this._payload = mode.payload;
84028402
}
8403+
this._tSend = !!total;
84038404
}
84048405
else {
84058406
this._tMode = mode;
@@ -8414,7 +8415,12 @@ var DataProcessor = /** @class */ (function () {
84148415
this._endnm = true;
84158416
this._serializeAsJson = true;
84168417
this._headers = this._headers || {};
8417-
this._headers["Content-type"] = "application/json";
8418+
this._headers["Content-Type"] = "application/json";
8419+
}
8420+
else {
8421+
if (this._headers && !this._headers["Content-Type"]) {
8422+
this._headers["Content-Type"] = "application/x-www-form-urlencoded";
8423+
}
84188424
}
84198425
if (this._tMode === "CUSTOM") {
84208426
this._tSend = false;
@@ -10197,7 +10203,10 @@ function initDataStores(gantt){
1019710203
}
1019810204

1019910205
if(action == "add" || action == "move" || action == "delete"){
10200-
gantt.$layout.resize();
10206+
if(gantt.$layout){
10207+
gantt.$layout.resize();
10208+
}
10209+
1020110210
}else if(!id){
1020210211
linksStore.refresh();
1020310212
}
@@ -11287,12 +11296,18 @@ function extend(gantt){
1128711296
delete this.$root.gantt;
1128811297
}
1128911298

11290-
this._eventRemoveAll();
11299+
if(this._eventRemoveAll){
11300+
this._eventRemoveAll();
11301+
}
11302+
1129111303
if(this.$layout){
1129211304
this.$layout.destructor();
1129311305
}
1129411306

11295-
this.resetLightbox();
11307+
if(this.resetLightbox){
11308+
this.resetLightbox();
11309+
}
11310+
1129611311

1129711312
if(this._dp && this._dp.destructor){
1129811313
this._dp.destructor();
@@ -11479,20 +11494,33 @@ var createDatastoreFacade = function(){
1147911494

1148011495
refreshTask: function (taskId, refresh_links) {
1148111496
var task = this.getTask(taskId);
11482-
if (task && this.isTaskVisible(taskId)) {
11483-
11484-
this.$data.tasksStore.refresh(taskId, !!this.getState().drag_id);// do quick refresh during drag and drop
11485-
11497+
var self = this;
11498+
function refreshLinks(){
1148611499
if (refresh_links !== undefined && !refresh_links)
1148711500
return;
1148811501
for (var i = 0; i < task.$source.length; i++) {
11489-
this.refreshLink(task.$source[i]);
11502+
self.refreshLink(task.$source[i]);
1149011503
}
1149111504
for (var i = 0; i < task.$target.length; i++) {
11492-
this.refreshLink(task.$target[i]);
11505+
self.refreshLink(task.$target[i]);
1149311506
}
11507+
}
11508+
11509+
if (task && this.isTaskVisible(taskId)) {
11510+
this.$data.tasksStore.refresh(taskId, !!this.getState().drag_id);// do quick refresh during drag and drop
11511+
refreshLinks();
1149411512
}else if(this.isTaskExists(taskId) && this.isTaskExists(this.getParent(taskId))){
1149511513
this.refreshTask(this.getParent(taskId));
11514+
11515+
var hasSplitParent = false;
11516+
this.eachParent(function(parent){
11517+
if(hasSplitParent || this.isSplitTask(parent)){
11518+
hasSplitParent = true;
11519+
}
11520+
}, taskId);
11521+
if(hasSplitParent){
11522+
refreshLinks();
11523+
}
1149611524
}
1149711525

1149811526
},
@@ -14193,6 +14221,7 @@ function create(gantt){
1419314221
var updateTaskDateProperties = linkedPropertiesProcessor(gantt);
1419414222

1419514223
var handlers = [];
14224+
var ganttHandlers = [];
1419614225
var store = null;
1419714226
var controller = {
1419814227
_itemId: null,
@@ -14232,6 +14261,12 @@ function create(gantt){
1423214261
}
1423314262
}));
1423414263

14264+
ganttHandlers.push(gantt.attachEvent("onDataRender", function(){
14265+
if(self._editor && self._placeholder && !domHelpers.isChildOf(self._placeholder, gantt.$root)){
14266+
grid.$grid_data.appendChild(self._placeholder);
14267+
}
14268+
}));
14269+
1423514270
this.init = function(){};
1423614271
},
1423714272

@@ -14371,7 +14406,7 @@ function create(gantt){
1437114406
this._editorType = null;
1437214407
if (!this._placeholder) return;
1437314408

14374-
if (this._editor) {
14409+
if (this._editor && this._editor.hide) {
1437514410
this._editor.hide(this._placeholder);
1437614411
}
1437714412
this._editor = null;
@@ -14404,7 +14439,7 @@ function create(gantt){
1440414439
oldValue: this._getItemValue()
1440514440
};
1440614441
if (this.callEvent("onBeforeSave", [editorState]) !== false) {
14407-
if (this._editor.is_valid(editorState.newValue, editorState.id, editorState.columnName, this._placeholder)) {
14442+
if (!this._editor.is_valid || this._editor.is_valid(editorState.newValue, editorState.id, editorState.columnName, this._placeholder)) {
1440814443

1440914444
var mapTo = editorConfig.map_to;
1441014445
var value = editorState.newValue;
@@ -14510,6 +14545,13 @@ function create(gantt){
1451014545
handlers.forEach(function(handlerId){
1451114546
store.detachEvent(handlerId);
1451214547
});
14548+
14549+
ganttHandlers.forEach(function(handlerId){
14550+
gantt.detachEvent(handlerId);
14551+
});
14552+
handlers = [];
14553+
ganttHandlers = [];
14554+
1451314555
store = null;
1451414556
this.hide();
1451514557
this.detachAllEvents();
@@ -17338,8 +17380,8 @@ var Cell = (function () {
1733817380
gravity: this.$config.gravity || 1,
1733917381
minHeight: this.$config.minHeight || 0,
1734017382
minWidth: this.$config.minWidth || 0,
17341-
maxHeight: this.$config.maxHeight || 100000,
17342-
maxWidth: this.$config.maxWidth || 100000
17383+
maxHeight: this.$config.maxHeight || 100000000000,
17384+
maxWidth: this.$config.maxWidth || 100000000000
1734317385
};
1734417386
if (this.$config.collapsed) {
1734517387
var mode = this.$config.mode === "x";
@@ -17991,9 +18033,9 @@ var Layout = (function (_super) {
1799118033
this._sizes = [];
1799218034
var width = 0;
1799318035
var minWidth = 0;
17994-
var maxWidth = 100000;
18036+
var maxWidth = 100000000000;
1799518037
var height = 0;
17996-
var maxHeight = 100000;
18038+
var maxHeight = 100000000000;
1799718039
var minHeight = 0;
1799818040

1799918041
for (var i = 0; i < this.$cells.length; i++) {
@@ -21754,7 +21796,13 @@ module.exports = function(gantt){
2175421796
return false;
2175521797
}
2175621798

21757-
var box = domHelpers.getNodePosition(getAutoscrollContainer());
21799+
var container = getAutoscrollContainer();
21800+
if(!container){
21801+
return;
21802+
}
21803+
21804+
var box = domHelpers.getNodePosition(container);
21805+
2175821806
var posX = eventPos.x - box.x;
2175921807
var posY = eventPos.y - box.y;
2176021808

@@ -21836,6 +21884,10 @@ module.exports = function(gantt){
2183621884
}
2183721885
});
2183821886

21887+
gantt.attachEvent("onDestroy", function(){
21888+
defineScrollInterval(false);
21889+
});
21890+
2183921891
};
2184021892

2184121893
/***/ }),
@@ -26219,7 +26271,7 @@ function createTaskDND(timeline, gantt) {
2621926271
this._domEvents.attach(data, "mousedown", gantt.bind(function(e) {
2622026272
this.on_mouse_down(e);
2622126273
}, this));
26222-
this._domEvents.attach(gantt.$root, "mouseup", gantt.bind(function(e) {
26274+
this._domEvents.attach(document.body, "mouseup", gantt.bind(function(e) {
2622326275
this.on_mouse_up(e);
2622426276
}, this));
2622526277
},
@@ -28687,25 +28739,26 @@ module.exports = function(gantt) {
2868728739

2868828740
gantt.locate = function(e) {
2868928741
var trg = domHelpers.getTargetNode(e);
28690-
28691-
//ignore empty cells
28692-
var className = domHelpers.getClassName(trg);
28693-
if ((className || "").indexOf("gantt_task_cell") >= 0) return null;
28694-
28742+
28743+
// ignore empty rows/cells of the timeline
28744+
if(domHelpers.closest(trg, ".gantt_task_row")){
28745+
return null;
28746+
}
28747+
2869528748
var targetAttribute = arguments[1] || this.config.task_attribute;
28696-
28749+
2869728750
var node = domHelpers.locateAttribute(trg, targetAttribute);
2869828751
if(node){
2869928752
return node.getAttribute(targetAttribute);
2870028753
}else{
2870128754
return null;
2870228755
}
2870328756
};
28704-
28757+
2870528758
gantt._locate_css = function(e, classname, strict){
2870628759
return domHelpers.locateClassName(e, classname, strict);
2870728760
};
28708-
28761+
2870928762
gantt._locateHTML = function(e, attribute) {
2871028763
return domHelpers.locateAttribute(e, attribute || this.config.task_attribute);
2871128764
};
@@ -29604,6 +29657,9 @@ CalendarWorkTimeStrategy.prototype = {
2960429657
_getMinutesPerHour: function (date) {
2960529658
var hourStart = this._getTimeOfDayStamp(date);
2960629659
var hourEnd = this._getTimeOfDayStamp(this._nextDate(date, "hour", 1));
29660+
if (hourEnd === 0){
29661+
hourEnd = 24 * 60 * 60;
29662+
}
2960729663
var worktimes = this._getWorkHours(date);
2960829664

2960929665
for(var i = 0; i < worktimes.length; i++){
@@ -33252,7 +33308,7 @@ module.exports = function(gantt) {
3325233308

3325333309
gantt.scrollTo(null, pos.top - height * 5);
3325433310

33255-
} else if (gantt.config.show_chart && (pos.left < scroll.x || pos.left > (scroll.x + viewWidth))) {
33311+
} else if (gantt.config.scroll_on_click && gantt.config.show_chart && (pos.left < scroll.x || pos.left > (scroll.x + viewWidth))) {
3325633312
gantt.scrollTo(pos.left - gantt.config.task_scroll_offset);
3325733313

3325833314
}
@@ -35470,7 +35526,7 @@ exports.Undo = Undo;
3547035526

3547135527
function DHXGantt(){
3547235528
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
35473-
this.version = "7.0.3";
35529+
this.version = "7.0.4";
3547435530
this.license = "gpl";
3547535531
this.templates = {};
3547635532
this.ext = {};

codebase/sources/skins/dhtmlxgantt_broadway.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.0.3 Standard
4+
dhtmlxGantt v.7.0.4 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_contrast_black.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.0.3 Standard
4+
dhtmlxGantt v.7.0.4 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

codebase/sources/skins/dhtmlxgantt_contrast_white.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
@license
33
4-
dhtmlxGantt v.7.0.3 Standard
4+
dhtmlxGantt v.7.0.4 Standard
55
66
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
77

0 commit comments

Comments
 (0)