@syncfusion/ej2-layouts 20.3.56 → 20.3.58

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.
@@ -158,6 +158,9 @@ 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
+ if (this.isReact) {
162
+ this.clearTemplate();
163
+ }
161
164
  for (var i = 0; i < paneCounts.length; i++) {
162
165
  var index = parseInt(Object.keys(newProp.paneSettings)[i], 10);
163
166
  var changedPropsCount = Object.keys(newProp.paneSettings[index]).length;
@@ -1044,9 +1047,11 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
1044
1047
  }
1045
1048
  var avgDiffWidth = diff / flexPaneIndexes.length;
1046
1049
  for (var j = 0, len = flexPaneIndexes.length; j < len; j++) {
1047
- this.allPanes[flexPaneIndexes[j]].style.flexBasis = this.orientation === 'Horizontal' ?
1048
- (this.allPanes[flexPaneIndexes[j]].offsetWidth + avgDiffWidth) + 'px' :
1049
- (this.allPanes[flexPaneIndexes[j]].offsetHeight + avgDiffWidth) + 'px';
1050
+ if (this.allPanes[flexPaneIndexes[j]].style.flexBasis !== '') {
1051
+ this.allPanes[flexPaneIndexes[j]].style.flexBasis = this.orientation === 'Horizontal' ?
1052
+ (this.allPanes[flexPaneIndexes[j]].offsetWidth + avgDiffWidth) + 'px' :
1053
+ (this.allPanes[flexPaneIndexes[j]].offsetHeight + avgDiffWidth) + 'px';
1054
+ }
1050
1055
  }
1051
1056
  if (this.allPanes.length === 2 && iswindowResize) {
1052
1057
  var paneCount = this.allPanes.length;
@@ -1569,6 +1574,7 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
1569
1574
  return (value / offsetValue) * 100;
1570
1575
  };
1571
1576
  Splitter.prototype.convertPixelToNumber = function (value) {
1577
+ value = value.toString();
1572
1578
  if (value.indexOf('p') > -1) {
1573
1579
  return parseFloat(value.slice(0, value.indexOf('p')));
1574
1580
  }
@@ -1722,7 +1728,10 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
1722
1728
  this.nextPaneHeightWidth =
1723
1729
  (typeof (this.nextPaneHeightWidth) === 'string' && this.nextPaneHeightWidth.indexOf('p') > -1) ?
1724
1730
  this.convertPixelToNumber(this.nextPaneHeightWidth) : parseInt(this.nextPaneHeightWidth, 10);
1725
- this.prevPaneCurrentWidth = separatorNewPosition + this.convertPixelToNumber(this.previousPaneHeightWidth);
1731
+ this.previousPaneHeightWidth =
1732
+ (typeof (this.previousPaneHeightWidth) === 'string' && this.previousPaneHeightWidth.indexOf('p') > -1) ?
1733
+ this.convertPixelToNumber(this.previousPaneHeightWidth) : parseInt(this.previousPaneHeightWidth, 10);
1734
+ this.prevPaneCurrentWidth = separatorNewPosition + this.previousPaneHeightWidth;
1726
1735
  this.nextPaneCurrentWidth = this.nextPaneHeightWidth - separatorNewPosition;
1727
1736
  this.validateMinMaxValues();
1728
1737
  if (this.nextPaneCurrentWidth < 0) {
@@ -1749,9 +1758,45 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
1749
1758
  }
1750
1759
  this.calculateCurrentDimensions();
1751
1760
  this.addStaticPaneClass();
1752
- this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
1753
- this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
1754
- if (!(this.allPanes.length > 2)) {
1761
+ var flexPaneCount = 0;
1762
+ for (var i = 0; i < this.paneSettings.length; i++) {
1763
+ if (this.paneSettings[i].size === '') {
1764
+ flexPaneCount = flexPaneCount + 1;
1765
+ }
1766
+ }
1767
+ var allFlexiblePanes = flexPaneCount === this.allPanes.length;
1768
+ // Two flexible Pane Case.
1769
+ if (this.previousPane.style.flexBasis == '' && this.nextPane.style.flexBasis == '' && !allFlexiblePanes) {
1770
+ var middlePaneIndex = this.allPanes.length % this.allBars.length;
1771
+ if (this.prevPaneIndex === middlePaneIndex) {
1772
+ this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
1773
+ addClass([this.nextPane], STATIC_PANE);
1774
+ }
1775
+ else if (this.nextPaneIndex == middlePaneIndex) {
1776
+ this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
1777
+ addClass([this.previousPane], STATIC_PANE);
1778
+ }
1779
+ else {
1780
+ this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
1781
+ addClass([this.nextPane], STATIC_PANE);
1782
+ }
1783
+ } // All panes are flexible
1784
+ else if (allFlexiblePanes) {
1785
+ this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
1786
+ addClass([this.previousPane], STATIC_PANE);
1787
+ this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
1788
+ addClass([this.nextPane], STATIC_PANE);
1789
+ } // Two Panesa are Static Pane
1790
+ else {
1791
+ if (this.previousPane.style.flexBasis !== "" && this.previousPane.classList.contains(STATIC_PANE)) {
1792
+ this.previousPane.style.flexBasis = this.prevPaneCurrentWidth;
1793
+ }
1794
+ if (this.nextPane.style.flexBasis !== "" && this.nextPane.classList.contains(STATIC_PANE)) {
1795
+ this.nextPane.style.flexBasis = this.nextPaneCurrentWidth;
1796
+ }
1797
+ }
1798
+ var isStaticPanes = this.previousPane.style.flexBasis !== "" && this.nextPane.style.flexBasis !== "";
1799
+ if (!(this.allPanes.length > 2) && isStaticPanes) {
1755
1800
  this.updateSplitterSize();
1756
1801
  }
1757
1802
  };
@@ -1855,10 +1900,10 @@ var Splitter = /** @__PURE__ @class */ (function (_super) {
1855
1900
  }
1856
1901
  };
1857
1902
  Splitter.prototype.addStaticPaneClass = function () {
1858
- if (!this.previousPane.classList.contains(STATIC_PANE)) {
1903
+ if (!this.previousPane.classList.contains(STATIC_PANE) && !(this.previousPane.style.flexBasis === '') && !this.previousPane.classList.contains(EXPAND_PANE)) {
1859
1904
  this.previousPane.classList.add(STATIC_PANE);
1860
1905
  }
1861
- if (!this.nextPane.classList.contains(STATIC_PANE)) {
1906
+ if (!this.nextPane.classList.contains(STATIC_PANE) && !(this.nextPane.style.flexBasis === '') && !this.nextPane.classList.contains(EXPAND_PANE)) {
1862
1907
  this.nextPane.classList.add(STATIC_PANE);
1863
1908
  }
1864
1909
  };
@@ -2607,6 +2652,9 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
2607
2652
  if (document.querySelectorAll(template).length) {
2608
2653
  return compile(document.querySelector(template).innerHTML.trim());
2609
2654
  }
2655
+ else {
2656
+ return compile(template);
2657
+ }
2610
2658
  }
2611
2659
  catch (error) {
2612
2660
  var sanitizedValue = SanitizeHtmlHelper.sanitize(template);
@@ -2896,7 +2944,12 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
2896
2944
  currentX = this.getMaxWidth(panelModel) - this.elementWidth;
2897
2945
  this.mOffX = dX - currentX;
2898
2946
  }
2947
+ var initialWidth = this.elementWidth;
2899
2948
  this.elementWidth += currentX;
2949
+ var newSizeX = this.pixelsToColumns(this.elementWidth - (panelModel.sizeX) * this.cellSpacing[1], true);
2950
+ if (this.columns < panelModel.col + newSizeX) {
2951
+ this.elementWidth = initialWidth;
2952
+ }
2900
2953
  }
2901
2954
  el.style.top = this.elementY + 'px';
2902
2955
  el.style.left = this.elementX + 'px';
@@ -2993,8 +3046,8 @@ var DashboardLayout = /** @__PURE__ @class */ (function (_super) {
2993
3046
  sizeY = this.pixelsToRows(this.elementHeight - (sizeY) * this.cellSpacing[0], true);
2994
3047
  }
2995
3048
  }
2996
- if (item.col + item.sizeX > this.columns) {
2997
- item.sizeX = item.sizeX - 1;
3049
+ if (item.col + sizeX > this.columns) {
3050
+ item.sizeX = sizeX - 1;
2998
3051
  }
2999
3052
  var canOccupy = row > -1 && col > -1 && sizeX + col <= this.maxCol() && sizeY + row <= this.maxRow();
3000
3053
  if (canOccupy && (this.collisions(row, col, sizeX, sizeY, this.getPanelBase(item.id)).length === 0)