1
1
/*
2
2
@license
3
3
4
- dhtmlxGantt v.7.1.4 Standard
4
+ dhtmlxGantt v.7.1.5 Standard
5
5
6
6
This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
7
7
@@ -15936,21 +15936,16 @@ module.exports = function (gantt) {
15936
15936
15937
15937
var utils = __webpack_require__(/*! ../../utils/utils */ "./sources/utils/utils.js");
15938
15938
15939
- function ViewSettings(config) {
15940
- utils.mixin(this, config, true);
15941
- }
15942
-
15943
15939
function extendSettings(store, parentSettings) {
15944
15940
var own = this.$config[store];
15945
15941
15946
15942
if (own) {
15947
- if (own instanceof ViewSettings) {
15948
- return own;
15949
- } else {
15950
- ViewSettings.prototype = parentSettings;
15951
- this.$config[store] = new ViewSettings(own);
15952
- return this.$config[store];
15943
+ if (!own.$extendedConfig) {
15944
+ own.$extendedConfig = true;
15945
+ Object.setPrototypeOf(own, parentSettings);
15953
15946
}
15947
+
15948
+ return own;
15954
15949
} else {
15955
15950
return parentSettings;
15956
15951
}
@@ -16180,7 +16175,7 @@ function create(gantt) {
16180
16175
var row = domHelpers.locateAttribute(node, grid.$config.item_attribute);
16181
16176
var cell = domHelpers.locateAttribute(node, "data-column-name");
16182
16177
16183
- if (cell) {
16178
+ if (row && cell) {
16184
16179
var columnName = cell.getAttribute("data-column-name");
16185
16180
var id = row.getAttribute(grid.$config.item_attribute);
16186
16181
return {
@@ -18156,7 +18151,7 @@ Grid.prototype = {
18156
18151
18157
18152
var ariaAttrs = gantt._waiAria.gridScaleCellAttrString(col, label);
18158
18153
18159
- var cell = "<div class='" + cssClass + "' style='" + style + "' " + ariaAttrs + " data-column-id='" + col.name + "' column_id='" + col.name + "'>" + label + sort + "</div>";
18154
+ var cell = "<div class='" + cssClass + "' style='" + style + "' " + ariaAttrs + " data-column-id='" + col.name + "' column_id='" + col.name + "'" + " data-column-name='" + col.name + "' data-column-index='" + i + "'" + " >" + label + sort + "</div>";
18160
18155
cells.push(cell);
18161
18156
}
18162
18157
@@ -18811,12 +18806,23 @@ function _init_dnd(gantt, grid) {
18811
18806
var scrollPos = grid.$state.scrollTop || 0;
18812
18807
var maxBottom = gantt.$grid_data.getBoundingClientRect().height + scrollPos;
18813
18808
var minTop = scrollPos;
18814
- var firstVisibleTaskPos = grid.$state.scrollTop / grid.getItemHeight();
18809
+ var firstVisibleTaskIndex = grid.getItemIndexByTopPosition(grid.$state.scrollTop);
18810
+
18811
+ if (!store.exists(firstVisibleTaskIndex)) {
18812
+ firstVisibleTaskIndex = store.countVisible() - 1;
18813
+ }
18814
+
18815
+ if (firstVisibleTaskIndex < 0) {
18816
+ return store.$getRootId();
18817
+ }
18818
+
18819
+ var firstVisibleTaskId = store.getIdByIndex(firstVisibleTaskIndex);
18820
+ var firstVisibleTaskPos = grid.$state.scrollTop / grid.getItemHeight(firstVisibleTaskId);
18815
18821
var hiddenTaskPart = firstVisibleTaskPos - Math.floor(firstVisibleTaskPos);
18816
18822
18817
18823
if (hiddenTaskPart > 0.1 && hiddenTaskPart < 0.9) {
18818
- maxBottom = maxBottom - grid.getItemHeight() * hiddenTaskPart;
18819
- minTop = minTop + grid.getItemHeight() * (1 - hiddenTaskPart);
18824
+ maxBottom = maxBottom - grid.getItemHeight(firstVisibleTaskId ) * hiddenTaskPart;
18825
+ minTop = minTop + grid.getItemHeight(firstVisibleTaskId ) * (1 - hiddenTaskPart);
18820
18826
}
18821
18827
18822
18828
if (y >= maxBottom) {
@@ -18825,9 +18831,9 @@ function _init_dnd(gantt, grid) {
18825
18831
y = minTop;
18826
18832
}
18827
18833
18828
- var index = Math.floor(y / grid.getItemHeight() );
18834
+ var index = grid.getItemIndexByTopPosition(y );
18829
18835
18830
- if (index > store.countVisible() - 1) {
18836
+ if (index > store.countVisible() - 1 || index < 0 ) {
18831
18837
return store.$getRootId();
18832
18838
}
18833
18839
@@ -19825,7 +19831,7 @@ var Layout = function (_super) {
19825
19831
Layout.prototype._resizeScrollbars = function (autosize, scrollbars) {
19826
19832
var scrollChanged = false;
19827
19833
var visibleScrollbars = [],
19828
- hiddenSrollbars = [];
19834
+ hiddenScrollbars = [];
19829
19835
19830
19836
function showScrollbar(scrollbar) {
19831
19837
scrollbar.$parent.show();
@@ -19836,7 +19842,7 @@ var Layout = function (_super) {
19836
19842
function hideScrollbar(scrollbar) {
19837
19843
scrollbar.$parent.hide();
19838
19844
scrollChanged = true;
19839
- hiddenSrollbars .push(scrollbar);
19845
+ hiddenScrollbars .push(scrollbar);
19840
19846
}
19841
19847
19842
19848
var scrollbar;
@@ -19854,7 +19860,7 @@ var Layout = function (_super) {
19854
19860
if (scrollbar.isVisible()) {
19855
19861
visibleScrollbars.push(scrollbar);
19856
19862
} else {
19857
- hiddenSrollbars .push(scrollbar);
19863
+ hiddenScrollbars .push(scrollbar);
19858
19864
}
19859
19865
}
19860
19866
}
@@ -19867,8 +19873,8 @@ var Layout = function (_super) {
19867
19873
}
19868
19874
}
19869
19875
19870
- for (var i = 0; i < hiddenSrollbars .length; i++) {
19871
- scrollbar = hiddenSrollbars [i];
19876
+ for (var i = 0; i < hiddenScrollbars .length; i++) {
19877
+ scrollbar = hiddenScrollbars [i];
19872
19878
19873
19879
if (scrollbar.$config.group && visibleGroups[scrollbar.$config.group]) {
19874
19880
showScrollbar(scrollbar); // GS-707 If the scrollbar was hidden then showed, the container resize shouldn't happen because of that
@@ -20475,10 +20481,15 @@ var Layout = function (_super) {
20475
20481
var firstCall = !this._visibleCells;
20476
20482
var visibleCells = {};
20477
20483
var cell;
20484
+ var parentVisibility = [];
20478
20485
20479
20486
for (var i = 0; i < this._sizes.length; i++) {
20480
20487
cell = this.$cells[i];
20481
20488
20489
+ if (cell.$config.hide_empty) {
20490
+ parentVisibility.push(cell);
20491
+ }
20492
+
20482
20493
if (!firstCall && cell.$config.hidden && oldVisibleCells[cell.$id]) {
20483
20494
cell._hide(true);
20484
20495
} else if (!cell.$config.hidden && !oldVisibleCells[cell.$id]) {
@@ -20490,7 +20501,19 @@ var Layout = function (_super) {
20490
20501
}
20491
20502
}
20492
20503
20493
- this._visibleCells = visibleCells;
20504
+ this._visibleCells = visibleCells; // GS-27. A way to hide the whole cell if all its children are hidden
20505
+
20506
+ for (var i = 0; i < parentVisibility.length; i++) {
20507
+ var cell = parentVisibility[i];
20508
+ var children = cell.$cells;
20509
+ var hideCell = true;
20510
+ children.forEach(function (child) {
20511
+ if (!child.$config.hidden && !child.$config.resizer) {
20512
+ hideCell = false;
20513
+ }
20514
+ });
20515
+ cell.$config.hidden = hideCell;
20516
+ }
20494
20517
};
20495
20518
20496
20519
Layout.prototype.setSize = function (x, y) {
@@ -23366,20 +23389,16 @@ var initializer = function () {
23366
23389
if (mainTimeline) mainTimeline.$config.hidden = mainTimeline.$parent.$config.hidden = !gantt.config.show_chart;
23367
23390
var mainGrid = gantt.$ui.getView("grid");
23368
23391
if (!mainGrid) return;
23369
- var showGrid = gantt.config.show_grid;
23370
23392
23371
- if (first) {
23372
- var colsWidth = mainGrid._getColsTotalWidth();
23393
+ var colsWidth = mainGrid._getColsTotalWidth();
23373
23394
23374
- if (colsWidth !== false) {
23375
- gantt.config.grid_width = colsWidth;
23376
- }
23395
+ var hideGrid = !gantt.config.show_grid || !gantt.config.grid_width || colsWidth === 0;
23377
23396
23378
- showGrid = showGrid && !!gantt.config.grid_width;
23379
- gantt.config.show_grid = showGrid ;
23397
+ if (first && !hideGrid && colsWidth !== false) {
23398
+ gantt.config.grid_width = colsWidth ;
23380
23399
}
23381
23400
23382
- mainGrid.$config.hidden = mainGrid.$parent.$config.hidden = !showGrid ;
23401
+ mainGrid.$config.hidden = mainGrid.$parent.$config.hidden = hideGrid ;
23383
23402
23384
23403
if (!mainGrid.$config.hidden) {
23385
23404
/* restrict grid width due to min_width, max_width, min_grid_column_width */
@@ -39532,7 +39551,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
39532
39551
39533
39552
function DHXGantt() {
39534
39553
this.constants = __webpack_require__(/*! ../constants */ "./sources/constants/index.js");
39535
- this.version = "7.1.4 ";
39554
+ this.version = "7.1.5 ";
39536
39555
this.license = "gpl";
39537
39556
this.templates = {};
39538
39557
this.ext = {};
0 commit comments