@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.
@@ -13548,7 +13548,8 @@ var InsertHtml = /** @__PURE__ @class */ (function () {
13548
13548
  InsertHtml.findDetachEmptyElem = function (element) {
13549
13549
  var removableElement;
13550
13550
  if (!isNullOrUndefined(element.parentElement)) {
13551
- if (element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true') {
13551
+ if (element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
13552
+ isNullOrUndefined(element.parentElement.querySelector('img'))) {
13552
13553
  removableElement = this.findDetachEmptyElem(element.parentElement);
13553
13554
  }
13554
13555
  else {
@@ -29809,7 +29810,6 @@ var Table = /** @__PURE__ @class */ (function () {
29809
29810
  var differenceWidth = currentTableWidth - _this.convertPixelToPercentage(tableWidth + mouseX, widthCompare);
29810
29811
  for (var i = 0; i < lastColumnsCell.length; i++) {
29811
29812
  if (_this.curTable.rows[i].cells[_this.colIndex]) {
29812
- // eslint-disable-next-line
29813
29813
  _this.curTable.rows[i].cells[_this.curTable.rows[i].cells.length === _this.colIndex ?
29814
29814
  _this.colIndex - 1 : _this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
29815
29815
  }
@@ -29822,32 +29822,34 @@ var Table = /** @__PURE__ @class */ (function () {
29822
29822
  var totalwid = parseFloat(_this.columnEle.offsetWidth.toString()) +
29823
29823
  parseFloat(cellColl[_this.colIndex - 1].offsetWidth.toString());
29824
29824
  for (var i = 0; i < _this.curTable.rows.length; i++) {
29825
- if ((totalwid - actualwid) > 20 && actualwid > 20 && _this.curTable.rows[i].cells[i]) {
29825
+ var currentRow = _this.curTable.rows[i];
29826
+ if ((totalwid - actualwid) > 20 && actualwid > 20) {
29826
29827
  var leftColumnWidth = totalwid - actualwid;
29827
29828
  var rightColWidth = actualwid;
29828
29829
  var index = void 0;
29829
29830
  var isMergedEleResize = false;
29830
29831
  var leftTableCell = void 0;
29831
29832
  var rightTableCell = void 0;
29832
- /* eslint-disable */
29833
- for (var j = 0; j < _this.curTable.rows[i].cells.length; j++) {
29834
- if (_this.curTable.rows[i].cells[j].hasAttribute('rowspan') && j <= _this.colIndex) {
29833
+ for (var j = 0; j < currentRow.cells.length; j++) {
29834
+ if (currentRow.cells[j].hasAttribute('rowspan') && j <= _this.colIndex) {
29835
29835
  isRowCellsMerged = true;
29836
29836
  mergedCellIndex = i;
29837
- mergedElement = _this.curTable.rows[i].cells[j];
29837
+ mergedElement = currentRow.cells[j];
29838
29838
  }
29839
29839
  }
29840
- if (_this.curTable.rows[i].cells[i].hasAttribute('colspan')) {
29841
- index = parseInt(_this.curTable.rows[i].cells[i].getAttribute('colspan'), 10) - 1;
29840
+ if (!isNullOrUndefined(currentRow.cells[i]) && currentRow.cells[i].hasAttribute('colspan')) {
29841
+ index = parseInt(currentRow.cells[i].getAttribute('colspan'), 10) - 1;
29842
29842
  }
29843
29843
  else {
29844
29844
  index = _this.colIndex;
29845
29845
  }
29846
29846
  if (isRowCellsMerged) {
29847
29847
  var currentResizeRow = void 0;
29848
- if (_this.curTable.rows[i].cells.length < cellColl.length) {
29849
- index = _this.curTable.rows[i].cells.length === _this.colIndex ? _this.colIndex - 1 : _this.colIndex - (_this.colIndex - 1);
29850
- currentResizeRow = _this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ? mergedCellIndex : _this.colIndex - 1];
29848
+ if (currentRow.cells.length < cellColl.length) {
29849
+ index = currentRow.cells.length === _this.colIndex ?
29850
+ _this.colIndex - 1 : _this.colIndex - (_this.colIndex - 1);
29851
+ currentResizeRow = _this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ?
29852
+ mergedCellIndex : _this.colIndex - 1];
29851
29853
  if (currentResizeRow && (currentResizeRow.cells[_this.colIndex - 1] === mergedElement ||
29852
29854
  currentResizeRow.cells[currentResizeRow.cells.length - 1] === mergedElement)) {
29853
29855
  isMergedEleResize = true;
@@ -29859,15 +29861,15 @@ var Table = /** @__PURE__ @class */ (function () {
29859
29861
  else {
29860
29862
  index = _this.colIndex;
29861
29863
  }
29862
- leftTableCell = !isMergedEleResize ? _this.curTable.rows[i].cells[index - 1] : (currentResizeRow &&
29863
- currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ? currentResizeRow.cells[_this.colIndex - 1] :
29864
- _this.curTable.rows[i].cells[_this.curTable.rows[i].cells.length - 1];
29865
- rightTableCell = !isMergedEleResize ? _this.curTable.rows[i].cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
29866
- rightTableCell : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ? _this.curTable.rows[i].cells[index - 1] :
29867
- currentResizeRow.cells[currentResizeRow.cells.length - 1];
29864
+ leftTableCell = !isMergedEleResize ? currentRow.cells[index - 1] : (currentResizeRow &&
29865
+ currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ?
29866
+ currentResizeRow.cells[_this.colIndex - 1] : currentRow.cells[currentRow.cells.length - 1];
29867
+ rightTableCell = !isMergedEleResize ? currentRow.cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
29868
+ rightTableCell : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ?
29869
+ currentRow.cells[index - 1] : currentResizeRow.cells[currentResizeRow.cells.length - 1];
29868
29870
  }
29869
- if (!isNullOrUndefined(_this.curTable.rows[i].cells[index - 1]) && !isRowCellsMerged) {
29870
- _this.curTable.rows[i].cells[index - 1].style.width =
29871
+ if (!isNullOrUndefined(currentRow.cells[index - 1]) && !isRowCellsMerged) {
29872
+ currentRow.cells[index - 1].style.width =
29871
29873
  _this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
29872
29874
  }
29873
29875
  else {
@@ -29876,8 +29878,8 @@ var Table = /** @__PURE__ @class */ (function () {
29876
29878
  _this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
29877
29879
  }
29878
29880
  }
29879
- if (!isNullOrUndefined(_this.curTable.rows[i].cells[index]) && !isRowCellsMerged) {
29880
- _this.curTable.rows[i].cells[index].style.width =
29881
+ if (!isNullOrUndefined(currentRow.cells[index]) && !isRowCellsMerged) {
29882
+ currentRow.cells[index].style.width =
29881
29883
  _this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
29882
29884
  }
29883
29885
  else {
@@ -29886,7 +29888,6 @@ var Table = /** @__PURE__ @class */ (function () {
29886
29888
  _this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
29887
29889
  }
29888
29890
  }
29889
- /* eslint-enable */
29890
29891
  }
29891
29892
  }
29892
29893
  }
@@ -29910,8 +29911,8 @@ var Table = /** @__PURE__ @class */ (function () {
29910
29911
  EventHandler.remove(_this.contentModule.getEditPanel(), 'mouseover', _this.resizeHelper);
29911
29912
  }
29912
29913
  if (currentTdElement) {
29913
- // eslint-disable-next-line max-len
29914
- var tableBoxPosition = _this.curTable.getBoundingClientRect().left - currentTdElement.getBoundingClientRect().left;
29914
+ var tableBoxPosition = _this.curTable.getBoundingClientRect().left
29915
+ - currentTdElement.getBoundingClientRect().left;
29915
29916
  maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
29916
29917
  _this.curTable.style.maxWidth = maxiumWidth + 'px';
29917
29918
  }