@syncfusion/ej2-richtexteditor 22.1.36 → 22.1.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.
@@ -13450,7 +13450,8 @@ class InsertHtml {
13450
13450
  static findDetachEmptyElem(element) {
13451
13451
  let removableElement;
13452
13452
  if (!isNullOrUndefined(element.parentElement)) {
13453
- if (element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true') {
13453
+ if (element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
13454
+ isNullOrUndefined(element.parentElement.querySelector('img'))) {
13454
13455
  removableElement = this.findDetachEmptyElem(element.parentElement);
13455
13456
  }
13456
13457
  else {
@@ -29674,7 +29675,6 @@ class Table {
29674
29675
  const differenceWidth = currentTableWidth - this.convertPixelToPercentage(tableWidth + mouseX, widthCompare);
29675
29676
  for (let i = 0; i < lastColumnsCell.length; i++) {
29676
29677
  if (this.curTable.rows[i].cells[this.colIndex]) {
29677
- // eslint-disable-next-line
29678
29678
  this.curTable.rows[i].cells[this.curTable.rows[i].cells.length === this.colIndex ?
29679
29679
  this.colIndex - 1 : this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
29680
29680
  }
@@ -29687,32 +29687,34 @@ class Table {
29687
29687
  const totalwid = parseFloat(this.columnEle.offsetWidth.toString()) +
29688
29688
  parseFloat(cellColl[this.colIndex - 1].offsetWidth.toString());
29689
29689
  for (let i = 0; i < this.curTable.rows.length; i++) {
29690
- if ((totalwid - actualwid) > 20 && actualwid > 20 && this.curTable.rows[i].cells[i]) {
29690
+ const currentRow = this.curTable.rows[i];
29691
+ if ((totalwid - actualwid) > 20 && actualwid > 20) {
29691
29692
  const leftColumnWidth = totalwid - actualwid;
29692
29693
  const rightColWidth = actualwid;
29693
29694
  let index;
29694
29695
  let isMergedEleResize = false;
29695
29696
  let leftTableCell;
29696
29697
  let rightTableCell;
29697
- /* eslint-disable */
29698
- for (let j = 0; j < this.curTable.rows[i].cells.length; j++) {
29699
- if (this.curTable.rows[i].cells[j].hasAttribute('rowspan') && j <= this.colIndex) {
29698
+ for (let j = 0; j < currentRow.cells.length; j++) {
29699
+ if (currentRow.cells[j].hasAttribute('rowspan') && j <= this.colIndex) {
29700
29700
  isRowCellsMerged = true;
29701
29701
  mergedCellIndex = i;
29702
- mergedElement = this.curTable.rows[i].cells[j];
29702
+ mergedElement = currentRow.cells[j];
29703
29703
  }
29704
29704
  }
29705
- if (this.curTable.rows[i].cells[i].hasAttribute('colspan')) {
29706
- index = parseInt(this.curTable.rows[i].cells[i].getAttribute('colspan'), 10) - 1;
29705
+ if (!isNullOrUndefined(currentRow.cells[i]) && currentRow.cells[i].hasAttribute('colspan')) {
29706
+ index = parseInt(currentRow.cells[i].getAttribute('colspan'), 10) - 1;
29707
29707
  }
29708
29708
  else {
29709
29709
  index = this.colIndex;
29710
29710
  }
29711
29711
  if (isRowCellsMerged) {
29712
29712
  let currentResizeRow;
29713
- if (this.curTable.rows[i].cells.length < cellColl.length) {
29714
- index = this.curTable.rows[i].cells.length === this.colIndex ? this.colIndex - 1 : this.colIndex - (this.colIndex - 1);
29715
- currentResizeRow = this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ? mergedCellIndex : this.colIndex - 1];
29713
+ if (currentRow.cells.length < cellColl.length) {
29714
+ index = currentRow.cells.length === this.colIndex ?
29715
+ this.colIndex - 1 : this.colIndex - (this.colIndex - 1);
29716
+ currentResizeRow = this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ?
29717
+ mergedCellIndex : this.colIndex - 1];
29716
29718
  if (currentResizeRow && (currentResizeRow.cells[this.colIndex - 1] === mergedElement ||
29717
29719
  currentResizeRow.cells[currentResizeRow.cells.length - 1] === mergedElement)) {
29718
29720
  isMergedEleResize = true;
@@ -29724,15 +29726,15 @@ class Table {
29724
29726
  else {
29725
29727
  index = this.colIndex;
29726
29728
  }
29727
- leftTableCell = !isMergedEleResize ? this.curTable.rows[i].cells[index - 1] : (currentResizeRow &&
29728
- currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ? currentResizeRow.cells[this.colIndex - 1] :
29729
- this.curTable.rows[i].cells[this.curTable.rows[i].cells.length - 1];
29730
- rightTableCell = !isMergedEleResize ? this.curTable.rows[i].cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
29731
- rightTableCell : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ? this.curTable.rows[i].cells[index - 1] :
29732
- currentResizeRow.cells[currentResizeRow.cells.length - 1];
29729
+ leftTableCell = !isMergedEleResize ? currentRow.cells[index - 1] : (currentResizeRow &&
29730
+ currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ?
29731
+ currentResizeRow.cells[this.colIndex - 1] : currentRow.cells[currentRow.cells.length - 1];
29732
+ rightTableCell = !isMergedEleResize ? currentRow.cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
29733
+ rightTableCell : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ?
29734
+ currentRow.cells[index - 1] : currentResizeRow.cells[currentResizeRow.cells.length - 1];
29733
29735
  }
29734
- if (!isNullOrUndefined(this.curTable.rows[i].cells[index - 1]) && !isRowCellsMerged) {
29735
- this.curTable.rows[i].cells[index - 1].style.width =
29736
+ if (!isNullOrUndefined(currentRow.cells[index - 1]) && !isRowCellsMerged) {
29737
+ currentRow.cells[index - 1].style.width =
29736
29738
  this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
29737
29739
  }
29738
29740
  else {
@@ -29741,8 +29743,8 @@ class Table {
29741
29743
  this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
29742
29744
  }
29743
29745
  }
29744
- if (!isNullOrUndefined(this.curTable.rows[i].cells[index]) && !isRowCellsMerged) {
29745
- this.curTable.rows[i].cells[index].style.width =
29746
+ if (!isNullOrUndefined(currentRow.cells[index]) && !isRowCellsMerged) {
29747
+ currentRow.cells[index].style.width =
29746
29748
  this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
29747
29749
  }
29748
29750
  else {
@@ -29751,7 +29753,6 @@ class Table {
29751
29753
  this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
29752
29754
  }
29753
29755
  }
29754
- /* eslint-enable */
29755
29756
  }
29756
29757
  }
29757
29758
  }
@@ -29775,8 +29776,8 @@ class Table {
29775
29776
  EventHandler.remove(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper);
29776
29777
  }
29777
29778
  if (currentTdElement) {
29778
- // eslint-disable-next-line max-len
29779
- const tableBoxPosition = this.curTable.getBoundingClientRect().left - currentTdElement.getBoundingClientRect().left;
29779
+ const tableBoxPosition = this.curTable.getBoundingClientRect().left
29780
+ - currentTdElement.getBoundingClientRect().left;
29780
29781
  maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
29781
29782
  this.curTable.style.maxWidth = maxiumWidth + 'px';
29782
29783
  }