@syncfusion/ej2-layouts 21.1.37 → 21.2.6

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.
@@ -320,7 +320,7 @@ let Splitter = class Splitter extends Component {
320
320
  const prePaneSize = this.orientation === 'Horizontal' ? this.previousPane.offsetWidth : this.previousPane.offsetHeight;
321
321
  const nextPaneSize = this.orientation === 'Horizontal' ? this.nextPane.offsetWidth : this.nextPane.offsetHeight;
322
322
  const splitBarSize = isNullOrUndefined(this.separatorSize) ? BAR_SIZE_DEFAULT : this.separatorSize;
323
- if ((this.previousPane.style.flexBasis.indexOf('%') > 0 || this.nextPane.style.flexBasis.indexOf('%') > 0)) {
323
+ if ((this.previousPane.style.flexBasis.indexOf('%') > 0 || this.previousPane.style.flexBasis.indexOf('p') > 0 || this.nextPane.style.flexBasis.indexOf('%') > 0)) {
324
324
  const previousFlexBasis = this.updatePaneFlexBasis(this.previousPane);
325
325
  const nextFlexBasis = this.updatePaneFlexBasis(this.nextPane);
326
326
  this.totalPercent = previousFlexBasis + nextFlexBasis;
@@ -1071,8 +1071,10 @@ let Splitter = class Splitter extends Component {
1071
1071
  updatePane.style.flexBasis = isPercent ? this.convertPixelToPercentage(updatePaneOffset + sizeDiff) + '%'
1072
1072
  : (updatePaneOffset + sizeDiff) + 'px';
1073
1073
  const flexPaneOffset = this.orientation === 'Horizontal' ? flexPane.offsetWidth : flexPane.offsetHeight;
1074
- flexPane.style.flexBasis = flexPane.style.flexBasis.indexOf('%') > -1 ?
1075
- this.convertPixelToPercentage(flexPaneOffset - sizeDiff) + '%' : (flexPaneOffset - sizeDiff) + 'px';
1074
+ if (flexPane.style.flexBasis !== '') {
1075
+ flexPane.style.flexBasis = flexPane.style.flexBasis.indexOf('%') > -1 ?
1076
+ this.convertPixelToPercentage(flexPaneOffset - sizeDiff) + '%' : (flexPaneOffset - sizeDiff) + 'px';
1077
+ }
1076
1078
  }
1077
1079
  }
1078
1080
  }
@@ -2536,7 +2538,8 @@ let DashboardLayout = class DashboardLayout extends Component {
2536
2538
  for (let i = 0; i < this.panels.length; i++) {
2537
2539
  const panelElement = this.element.querySelector('#' + this.panels[i].id);
2538
2540
  this.setMinMaxValues(this.panels[i]);
2539
- if (this.maxColumnValue < this.panels[i].col || this.maxColumnValue < (this.panels[i].col + this.panels[i].sizeX)) {
2541
+ if (this.maxColumnValue < this.panels[i].col ||
2542
+ this.maxColumnValue < (this.panels[i].col + this.panels[i].sizeX)) {
2540
2543
  const colValue = this.maxColumnValue - this.panels[i].sizeX;
2541
2544
  this.panelPropertyChange(this.panels[i], { col: colValue < 0 ? 0 : colValue });
2542
2545
  }
@@ -2640,7 +2643,6 @@ let DashboardLayout = class DashboardLayout extends Component {
2640
2643
  }
2641
2644
  return element;
2642
2645
  }
2643
- // eslint-disable-next-line
2644
2646
  templateParser(template) {
2645
2647
  if (template) {
2646
2648
  try {
@@ -2659,7 +2661,6 @@ let DashboardLayout = class DashboardLayout extends Component {
2659
2661
  return undefined;
2660
2662
  }
2661
2663
  renderTemplate(content, appendElement, type, isStringTemplate, prop) {
2662
- // eslint-disable-next-line
2663
2664
  const templateFn = this.templateParser(content);
2664
2665
  const templateElements = [];
2665
2666
  if ((content[0] === '.' || content[0] === '#') &&
@@ -2938,9 +2939,9 @@ let DashboardLayout = class DashboardLayout extends Component {
2938
2939
  currentX = this.getMaxWidth(panelModel) - this.elementWidth;
2939
2940
  this.mOffX = dX - currentX;
2940
2941
  }
2941
- let initialWidth = this.elementWidth;
2942
+ const initialWidth = this.elementWidth;
2942
2943
  this.elementWidth += currentX;
2943
- let newSizeX = this.pixelsToColumns(this.elementWidth - (panelModel.sizeX) * this.cellSpacing[1], true);
2944
+ const newSizeX = this.pixelsToColumns(this.elementWidth - (panelModel.sizeX) * this.cellSpacing[1], true);
2944
2945
  if (this.columns < panelModel.col + newSizeX) {
2945
2946
  this.elementWidth = initialWidth;
2946
2947
  }
@@ -3176,6 +3177,7 @@ let DashboardLayout = class DashboardLayout extends Component {
3176
3177
  else {
3177
3178
  if (this.element.classList.contains(responsive)) {
3178
3179
  removeClass([this.element], [responsive]);
3180
+ // eslint-disable-next-line
3179
3181
  const internalPanels = this.element.querySelectorAll(((this.element.id) ? '#' + this.element.id + ' > ' : '') + '.e-panel');
3180
3182
  for (let i = 0; i < internalPanels.length; i++) {
3181
3183
  const ele = internalPanels[i];
@@ -3411,7 +3413,8 @@ let DashboardLayout = class DashboardLayout extends Component {
3411
3413
  for (let j = 0; j < cells.length; j++) {
3412
3414
  this.gridPanelCollection.push(cells[j]);
3413
3415
  this.setMinMaxValues(cells[j]);
3414
- if (this.maxColumnValue < cells[j].col || this.maxColumnValue < (cells[j].col + cells[j].sizeX)) {
3416
+ if (this.maxColumnValue < cells[j].col ||
3417
+ this.maxColumnValue < (cells[j].col + cells[j].sizeX)) {
3415
3418
  this.panelPropertyChange(cells[j], { col: this.maxColumnValue - cells[j].sizeX });
3416
3419
  }
3417
3420
  const cell = this.renderCell(cells[j], false, j);
@@ -3865,7 +3868,8 @@ let DashboardLayout = class DashboardLayout extends Component {
3865
3868
  }
3866
3869
  let isSwappable = false;
3867
3870
  for (let count1 = 0; count1 < collisions.length; count1++) {
3868
- if (collisions.length >= 1 && this.cloneObject[this.mainElement.id] && this.cloneObject[this.mainElement.id].row === this.oldRowCol[this.mainElement.id].row) {
3871
+ if (collisions.length >= 1 && this.cloneObject[this.mainElement.id] &&
3872
+ this.cloneObject[this.mainElement.id].row === this.oldRowCol[this.mainElement.id].row) {
3869
3873
  return false;
3870
3874
  }
3871
3875
  }
@@ -4205,7 +4209,7 @@ let DashboardLayout = class DashboardLayout extends Component {
4205
4209
  }
4206
4210
  setResizingClass(ele, container) {
4207
4211
  this.availableClasses = this.resizableHandles;
4208
- if (!ele.querySelector(".e-resize")) {
4212
+ if (!ele.querySelector('.e-resize')) {
4209
4213
  for (let j = 0; j < this.availableClasses.length; j++) {
4210
4214
  const spanEle = this.createElement('span');
4211
4215
  let addClassValue;
@@ -4273,7 +4277,8 @@ let DashboardLayout = class DashboardLayout extends Component {
4273
4277
  for (let i = 0; i < this.panels.length; i++) {
4274
4278
  if (((!isNullOrUndefined(added) ? (this.panels[i].id !== added[0].id) : true) &&
4275
4279
  (!isNullOrUndefined(removed) ? (this.panels[i].id !== removed[0].id) : true)) &&
4276
- (this.panels[i].row !== this.panelsInitialModel[i].row || this.panels[i].col !== this.panelsInitialModel[i].col)) {
4280
+ (this.panels[i].row !== this.panelsInitialModel[i].row ||
4281
+ this.panels[i].col !== this.panelsInitialModel[i].col)) {
4277
4282
  changedPanels.push(this.panels[i]);
4278
4283
  }
4279
4284
  }
@@ -4356,7 +4361,7 @@ let DashboardLayout = class DashboardLayout extends Component {
4356
4361
  this.updateDragArea();
4357
4362
  }
4358
4363
  else {
4359
- let currentPanel = this.getCellInstance(this.mainElement.id);
4364
+ const currentPanel = this.getCellInstance(this.mainElement.id);
4360
4365
  for (i = 0; i < this.panels.length; i++) {
4361
4366
  if (this.panels[i].id === currentPanel.id) {
4362
4367
  args.element.setAttribute('data-col', this.panelsInitialModel[i].col.toString());
@@ -4407,6 +4412,7 @@ let DashboardLayout = class DashboardLayout extends Component {
4407
4412
  }
4408
4413
  onDraggingStart(args) {
4409
4414
  const dragArgs = args;
4415
+ // eslint-disable-next-line
4410
4416
  this.trigger('dragStart', dragArgs, (dragArgs) => {
4411
4417
  if (isNullOrUndefined(args.cancel)) {
4412
4418
  args.cancel = false;
@@ -4747,9 +4753,10 @@ let DashboardLayout = class DashboardLayout extends Component {
4747
4753
  const customObject = [];
4748
4754
  for (let i = 0; i < cloneModel.length; i++) {
4749
4755
  customObject.push({
4750
- id: cloneModel[i].id, row: cloneModel[i].row, col: cloneModel[i].col, sizeX: cloneModel[i].sizeX,
4751
- sizeY: cloneModel[i].sizeY, minSizeX: cloneModel[i].minSizeX, minSizeY: cloneModel[i].minSizeY,
4752
- maxSizeX: cloneModel[i].maxSizeX, maxSizeY: cloneModel[i].maxSizeY
4756
+ id: cloneModel[i].id, row: cloneModel[i].row, col: cloneModel[i].col,
4757
+ sizeX: cloneModel[i].sizeX, sizeY: cloneModel[i].sizeY, minSizeX: cloneModel[i].minSizeX,
4758
+ minSizeY: cloneModel[i].minSizeY, maxSizeX: cloneModel[i].maxSizeX,
4759
+ maxSizeY: cloneModel[i].maxSizeY
4753
4760
  });
4754
4761
  }
4755
4762
  return (customObject);