@syncfusion/ej2-layouts 20.3.57 → 20.4.38
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/.eslintrc.json +16 -1
- package/CHANGELOG.md +0 -8
- package/dist/ej2-layouts.min.js +2 -2
- package/dist/ej2-layouts.umd.min.js +2 -2
- package/dist/ej2-layouts.umd.min.js.map +1 -1
- package/dist/es6/ej2-layouts.es2015.js +82 -20
- package/dist/es6/ej2-layouts.es2015.js.map +1 -1
- package/dist/es6/ej2-layouts.es5.js +80 -18
- package/dist/es6/ej2-layouts.es5.js.map +1 -1
- package/dist/global/ej2-layouts.min.js +2 -2
- package/dist/global/ej2-layouts.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +6 -6
- package/src/dashboard-layout/dashboard-layout.js +9 -4
- package/src/splitter/splitter.js +71 -15
@@ -158,6 +158,19 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
158
158
|
case 'paneSettings': {
|
159
159
|
if (!(newProp.paneSettings instanceof Array && oldProp.paneSettings instanceof Array)) {
|
160
160
|
var paneCounts = Object.keys(newProp.paneSettings);
|
161
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
162
|
+
if (this.isReact) {
|
163
|
+
var cPaneCount = 0;
|
164
|
+
for (var k = 0; k < this.paneSettings.length; k++) {
|
165
|
+
if (typeof (this.paneSettings[k].content) === 'function') {
|
166
|
+
cPaneCount = cPaneCount + 1;
|
167
|
+
}
|
168
|
+
}
|
169
|
+
var hasAllContent = cPaneCount === this.paneSettings.length;
|
170
|
+
if (hasAllContent) {
|
171
|
+
this.clearTemplate();
|
172
|
+
}
|
173
|
+
}
|
161
174
|
for (var i = 0; i < paneCounts.length; i++) {
|
162
175
|
var index = parseInt(Object.keys(newProp.paneSettings)[i], 10);
|
163
176
|
var changedPropsCount = Object.keys(newProp.paneSettings[index]).length;
|
@@ -165,7 +178,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
165
178
|
var property = Object.keys(newProp.paneSettings[index])[j];
|
166
179
|
switch (property) {
|
167
180
|
case 'content': {
|
168
|
-
var newValue = Object(newProp.paneSettings[index])[property];
|
181
|
+
var newValue = Object(newProp.paneSettings[index])["" + property];
|
169
182
|
if (!isNullOrUndefined(newValue)) {
|
170
183
|
this.allPanes[index].innerHTML = '';
|
171
184
|
this.setTemplate(newValue, this.allPanes[index]);
|
@@ -173,7 +186,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
173
186
|
break;
|
174
187
|
}
|
175
188
|
case 'resizable': {
|
176
|
-
var newVal = Object(newProp.paneSettings[index])[property];
|
189
|
+
var newVal = Object(newProp.paneSettings[index])["" + property];
|
177
190
|
this.resizableModel(index, newVal);
|
178
191
|
break;
|
179
192
|
}
|
@@ -185,10 +198,11 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
185
198
|
newProp.paneSettings[index].collapsed ? this.isCollapsed(index) : this.collapsedOnchange(index);
|
186
199
|
break;
|
187
200
|
case 'cssClass':
|
201
|
+
// eslint-disable-next-line max-len
|
188
202
|
this.setCssClass(this.allPanes[index], newProp.paneSettings[index].cssClass);
|
189
203
|
break;
|
190
204
|
case 'size': {
|
191
|
-
var newValSize = Object(newProp.paneSettings[index])[property];
|
205
|
+
var newValSize = Object(newProp.paneSettings[index])["" + property];
|
192
206
|
if (newValSize !== '' && !isNullOrUndefined(newValSize)) {
|
193
207
|
this.updatePaneSize(newValSize, index);
|
194
208
|
}
|
@@ -398,7 +412,6 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
398
412
|
}
|
399
413
|
};
|
400
414
|
Splitter.prototype.getMinInPixel = function (minValue) {
|
401
|
-
var min;
|
402
415
|
if (isNullOrUndefined(minValue)) {
|
403
416
|
return 0;
|
404
417
|
}
|
@@ -406,7 +419,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
406
419
|
if (minValue.indexOf('%') > 0) {
|
407
420
|
paneMinRange = this.convertPercentageToPixel(minValue);
|
408
421
|
}
|
409
|
-
min = this.convertPixelToNumber((paneMinRange).toString());
|
422
|
+
var min = this.convertPixelToNumber((paneMinRange).toString());
|
410
423
|
return min;
|
411
424
|
};
|
412
425
|
/**
|
@@ -640,6 +653,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
640
653
|
_this.updateIsCollapsed(index, _this.targetArrows().collapseArrow, _this.targetArrows().lastBarArrow);
|
641
654
|
for (var i = 0; i < collapsedindex.length; i++) {
|
642
655
|
if (!_this.allPanes[collapsedindex[i]].classList.contains(COLLAPSE_PANE)) {
|
656
|
+
// eslint-disable-next-line max-len
|
643
657
|
_this.updateIsCollapsed(collapsedindex[i], _this.targetArrows().collapseArrow, _this.targetArrows().lastBarArrow);
|
644
658
|
}
|
645
659
|
}
|
@@ -1029,6 +1043,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
1029
1043
|
}
|
1030
1044
|
for (var j = 0, len = this.allBars.length; j < len; j++) {
|
1031
1045
|
totalWidth += this.orientation === 'Horizontal' ? parseInt(getComputedStyle(this.allBars[j]).marginLeft, 10) +
|
1046
|
+
// eslint-disable-next-line max-len
|
1032
1047
|
parseInt(getComputedStyle(this.allBars[j]).marginLeft, 10) : parseInt(getComputedStyle(this.allBars[j]).marginTop, 10) +
|
1033
1048
|
parseInt(getComputedStyle(this.allBars[j]).marginBottom, 10);
|
1034
1049
|
}
|
@@ -1044,9 +1059,11 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
1044
1059
|
}
|
1045
1060
|
var avgDiffWidth = diff / flexPaneIndexes.length;
|
1046
1061
|
for (var j = 0, len = flexPaneIndexes.length; j < len; j++) {
|
1047
|
-
this.allPanes[flexPaneIndexes[j]].style.flexBasis
|
1048
|
-
|
1049
|
-
|
1062
|
+
if (this.allPanes[flexPaneIndexes[j]].style.flexBasis !== '') {
|
1063
|
+
this.allPanes[flexPaneIndexes[j]].style.flexBasis = this.orientation === 'Horizontal' ?
|
1064
|
+
(this.allPanes[flexPaneIndexes[j]].offsetWidth + avgDiffWidth) + 'px' :
|
1065
|
+
(this.allPanes[flexPaneIndexes[j]].offsetHeight + avgDiffWidth) + 'px';
|
1066
|
+
}
|
1050
1067
|
}
|
1051
1068
|
if (this.allPanes.length === 2 && iswindowResize) {
|
1052
1069
|
var paneCount = this.allPanes.length;
|
@@ -1569,6 +1586,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
1569
1586
|
return (value / offsetValue) * 100;
|
1570
1587
|
};
|
1571
1588
|
Splitter.prototype.convertPixelToNumber = function (value) {
|
1589
|
+
value = value.toString();
|
1572
1590
|
if (value.indexOf('p') > -1) {
|
1573
1591
|
return parseFloat(value.slice(0, value.indexOf('p')));
|
1574
1592
|
}
|
@@ -1722,7 +1740,10 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
1722
1740
|
this.nextPaneHeightWidth =
|
1723
1741
|
(typeof (this.nextPaneHeightWidth) === 'string' && this.nextPaneHeightWidth.indexOf('p') > -1) ?
|
1724
1742
|
this.convertPixelToNumber(this.nextPaneHeightWidth) : parseInt(this.nextPaneHeightWidth, 10);
|
1725
|
-
this.
|
1743
|
+
this.previousPaneHeightWidth =
|
1744
|
+
(typeof (this.previousPaneHeightWidth) === 'string' && this.previousPaneHeightWidth.indexOf('p') > -1) ?
|
1745
|
+
this.convertPixelToNumber(this.previousPaneHeightWidth) : parseInt(this.previousPaneHeightWidth, 10);
|
1746
|
+
this.prevPaneCurrentWidth = separatorNewPosition + this.previousPaneHeightWidth;
|
1726
1747
|
this.nextPaneCurrentWidth = this.nextPaneHeightWidth - separatorNewPosition;
|
1727
1748
|
this.validateMinMaxValues();
|
1728
1749
|
if (this.nextPaneCurrentWidth < 0) {
|
@@ -1749,9 +1770,45 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
1749
1770
|
}
|
1750
1771
|
this.calculateCurrentDimensions();
|
1751
1772
|
this.addStaticPaneClass();
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1773
|
+
var flexPaneCount = 0;
|
1774
|
+
for (var i = 0; i < this.paneSettings.length; i++) {
|
1775
|
+
if (this.paneSettings[i].size === '') {
|
1776
|
+
flexPaneCount = flexPaneCount + 1;
|
1777
|
+
}
|
1778
|
+
}
|
1779
|
+
var allFlexiblePanes = flexPaneCount === this.allPanes.length;
|
1780
|
+
// Two flexible Pane Case.
|
1781
|
+
if (this.previousPane.style.flexBasis === '' && this.nextPane.style.flexBasis == '' && !allFlexiblePanes) {
|
1782
|
+
var middlePaneIndex = this.allPanes.length % this.allBars.length;
|
1783
|
+
if (this.prevPaneIndex === middlePaneIndex) {
|
1784
|
+
this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
|
1785
|
+
addClass([this.nextPane], STATIC_PANE);
|
1786
|
+
}
|
1787
|
+
else if (this.nextPaneIndex === middlePaneIndex) {
|
1788
|
+
this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
|
1789
|
+
addClass([this.previousPane], STATIC_PANE);
|
1790
|
+
}
|
1791
|
+
else {
|
1792
|
+
this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
|
1793
|
+
addClass([this.nextPane], STATIC_PANE);
|
1794
|
+
}
|
1795
|
+
} // All panes are flexible
|
1796
|
+
else if (allFlexiblePanes) {
|
1797
|
+
this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
|
1798
|
+
addClass([this.previousPane], STATIC_PANE);
|
1799
|
+
this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
|
1800
|
+
addClass([this.nextPane], STATIC_PANE);
|
1801
|
+
} // Two Panesa are Static Pane
|
1802
|
+
else {
|
1803
|
+
if (this.previousPane.style.flexBasis !== '' && this.previousPane.classList.contains(STATIC_PANE)) {
|
1804
|
+
this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
|
1805
|
+
}
|
1806
|
+
if (this.nextPane.style.flexBasis !== '' && this.nextPane.classList.contains(STATIC_PANE)) {
|
1807
|
+
this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
|
1808
|
+
}
|
1809
|
+
}
|
1810
|
+
var isStaticPanes = this.previousPane.style.flexBasis !== '' && this.nextPane.style.flexBasis !== '';
|
1811
|
+
if (!(this.allPanes.length > 2) && isStaticPanes) {
|
1755
1812
|
this.updateSplitterSize();
|
1756
1813
|
}
|
1757
1814
|
};
|
@@ -1855,10 +1912,10 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
|
|
1855
1912
|
}
|
1856
1913
|
};
|
1857
1914
|
Splitter.prototype.addStaticPaneClass = function () {
|
1858
|
-
if (!this.previousPane.classList.contains(STATIC_PANE)) {
|
1915
|
+
if (!this.previousPane.classList.contains(STATIC_PANE) && !(this.previousPane.style.flexBasis === '') && !this.previousPane.classList.contains(EXPAND_PANE)) {
|
1859
1916
|
this.previousPane.classList.add(STATIC_PANE);
|
1860
1917
|
}
|
1861
|
-
if (!this.nextPane.classList.contains(STATIC_PANE)) {
|
1918
|
+
if (!this.nextPane.classList.contains(STATIC_PANE) && !(this.nextPane.style.flexBasis === '') && !this.nextPane.classList.contains(EXPAND_PANE)) {
|
1862
1919
|
this.nextPane.classList.add(STATIC_PANE);
|
1863
1920
|
}
|
1864
1921
|
};
|
@@ -2899,7 +2956,12 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
|
|
2899
2956
|
currentX = this.getMaxWidth(panelModel) - this.elementWidth;
|
2900
2957
|
this.mOffX = dX - currentX;
|
2901
2958
|
}
|
2959
|
+
var initialWidth = this.elementWidth;
|
2902
2960
|
this.elementWidth += currentX;
|
2961
|
+
var newSizeX = this.pixelsToColumns(this.elementWidth - (panelModel.sizeX) * this.cellSpacing[1], true);
|
2962
|
+
if (this.columns < panelModel.col + newSizeX) {
|
2963
|
+
this.elementWidth = initialWidth;
|
2964
|
+
}
|
2903
2965
|
}
|
2904
2966
|
el.style.top = this.elementY + 'px';
|
2905
2967
|
el.style.left = this.elementX + 'px';
|
@@ -2996,8 +3058,8 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
|
|
2996
3058
|
sizeY = this.pixelsToRows(this.elementHeight - (sizeY) * this.cellSpacing[0], true);
|
2997
3059
|
}
|
2998
3060
|
}
|
2999
|
-
if (item.col +
|
3000
|
-
item.sizeX =
|
3061
|
+
if (item.col + sizeX > this.columns) {
|
3062
|
+
item.sizeX = sizeX - 1;
|
3001
3063
|
}
|
3002
3064
|
var canOccupy = row > -1 && col > -1 && sizeX + col <= this.maxCol() && sizeY + row <= this.maxRow();
|
3003
3065
|
if (canOccupy && (this.collisions(row, col, sizeX, sizeY, this.getPanelBase(item.id)).length === 0)
|
@@ -4011,7 +4073,7 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
|
|
4011
4073
|
if (this.collisionChecker[this.panels[i].id] && this.collisionChecker[this.panels[i].id] !== null) {
|
4012
4074
|
this.overlapElement = [this.collisionChecker[this.panels[i].id].ele];
|
4013
4075
|
var key = this.panels[i].id;
|
4014
|
-
this.updateRowColumn(this.collisionChecker[key].row, this.overlapElement, this.collisionChecker[key].srcEle);
|
4076
|
+
this.updateRowColumn(this.collisionChecker["" + key].row, this.overlapElement, this.collisionChecker["" + key].srcEle);
|
4015
4077
|
}
|
4016
4078
|
}
|
4017
4079
|
};
|
@@ -4401,7 +4463,7 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
|
|
4401
4463
|
}
|
4402
4464
|
// eslint-disable-next-line guard-for-in
|
4403
4465
|
for (var k in source[i]) {
|
4404
|
-
target[i][k] = source[i][k];
|
4466
|
+
target[i]["" + k] = source[i]["" + k];
|
4405
4467
|
}
|
4406
4468
|
}
|
4407
4469
|
return target;
|