@syncfusion/ej2-richtexteditor 22.1.36 → 22.1.39
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/CHANGELOG.md +18 -0
- package/dist/ej2-richtexteditor.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js +2 -2
- package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es2015.js +39 -29
- package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
- package/dist/es6/ej2-richtexteditor.es5.js +39 -29
- package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
- package/dist/global/ej2-richtexteditor.min.js +2 -2
- package/dist/global/ej2-richtexteditor.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +12 -12
- package/src/editor-manager/plugin/inserthtml.js +2 -1
- package/src/editor-manager/plugin/ms-word-clean-up.js +2 -1
- package/src/rich-text-editor/actions/base-quick-toolbar.js +3 -1
- package/src/rich-text-editor/actions/emoji-picker.js +5 -1
- package/src/rich-text-editor/renderer/table-module.js +24 -24
- package/src/rich-text-editor/renderer/toolbar-renderer.js +3 -1
|
@@ -3409,7 +3409,9 @@ class ToolbarRenderer {
|
|
|
3409
3409
|
target: '#' + this.parent.getID() + '_toolbar_wrapper [title]',
|
|
3410
3410
|
showTipPointer: true,
|
|
3411
3411
|
openDelay: 400,
|
|
3412
|
-
cssClass: this.parent.cssClass
|
|
3412
|
+
cssClass: this.parent.cssClass,
|
|
3413
|
+
windowCollision: true,
|
|
3414
|
+
position: 'BottomCenter'
|
|
3413
3415
|
});
|
|
3414
3416
|
this.tooltip.appendTo(args.target);
|
|
3415
3417
|
}
|
|
@@ -6102,7 +6104,9 @@ class BaseQuickToolbar {
|
|
|
6102
6104
|
this.tooltip = new Tooltip({
|
|
6103
6105
|
target: '#' + this.element.id + ' [title]',
|
|
6104
6106
|
openDelay: 400,
|
|
6105
|
-
showTipPointer: true
|
|
6107
|
+
showTipPointer: true,
|
|
6108
|
+
windowCollision: true,
|
|
6109
|
+
position: 'BottomCenter'
|
|
6106
6110
|
});
|
|
6107
6111
|
this.tooltip.appendTo(this.element);
|
|
6108
6112
|
}
|
|
@@ -13450,7 +13454,8 @@ class InsertHtml {
|
|
|
13450
13454
|
static findDetachEmptyElem(element) {
|
|
13451
13455
|
let removableElement;
|
|
13452
13456
|
if (!isNullOrUndefined(element.parentElement)) {
|
|
13453
|
-
if (element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true'
|
|
13457
|
+
if (element.parentElement.textContent.trim() === '' && element.parentElement.contentEditable !== 'true' &&
|
|
13458
|
+
isNullOrUndefined(element.parentElement.querySelector('img'))) {
|
|
13454
13459
|
removableElement = this.findDetachEmptyElem(element.parentElement);
|
|
13455
13460
|
}
|
|
13456
13461
|
else {
|
|
@@ -17462,7 +17467,8 @@ class MsWordPaste {
|
|
|
17462
17467
|
imgElem[i].getAttribute('v:shapes').indexOf('圖片') < 0 &&
|
|
17463
17468
|
imgElem[i].getAttribute('v:shapes').indexOf('Grafik') < 0 &&
|
|
17464
17469
|
imgElem[i].getAttribute('v:shapes').toLowerCase().indexOf('image') < 0 &&
|
|
17465
|
-
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0
|
|
17470
|
+
imgElem[i].getAttribute('v:shapes').indexOf('Graphic') < 0 &&
|
|
17471
|
+
imgElem[i].getAttribute('v:shapes').indexOf('_x0000_s') < 0) {
|
|
17466
17472
|
detach(imgElem[i]);
|
|
17467
17473
|
}
|
|
17468
17474
|
}
|
|
@@ -23125,7 +23131,11 @@ class EmojiPicker {
|
|
|
23125
23131
|
return;
|
|
23126
23132
|
}
|
|
23127
23133
|
targetEle.focus();
|
|
23128
|
-
|
|
23134
|
+
const startOffset = this.save.startOffset;
|
|
23135
|
+
const textContent = this.save.range.startContainer.textContent;
|
|
23136
|
+
const previousText = textContent.substring(startOffset, startOffset + 1);
|
|
23137
|
+
// When toolbar action is clicked then only restore the range.
|
|
23138
|
+
if (!isNullOrUndefined(this.clickEvent) || previousText !== ':') {
|
|
23129
23139
|
this.save.restore();
|
|
23130
23140
|
}
|
|
23131
23141
|
if (this.popupObj) {
|
|
@@ -29674,7 +29684,6 @@ class Table {
|
|
|
29674
29684
|
const differenceWidth = currentTableWidth - this.convertPixelToPercentage(tableWidth + mouseX, widthCompare);
|
|
29675
29685
|
for (let i = 0; i < lastColumnsCell.length; i++) {
|
|
29676
29686
|
if (this.curTable.rows[i].cells[this.colIndex]) {
|
|
29677
|
-
// eslint-disable-next-line
|
|
29678
29687
|
this.curTable.rows[i].cells[this.curTable.rows[i].cells.length === this.colIndex ?
|
|
29679
29688
|
this.colIndex - 1 : this.colIndex].style.width = (currentColumnCellWidth - differenceWidth) + '%';
|
|
29680
29689
|
}
|
|
@@ -29687,32 +29696,34 @@ class Table {
|
|
|
29687
29696
|
const totalwid = parseFloat(this.columnEle.offsetWidth.toString()) +
|
|
29688
29697
|
parseFloat(cellColl[this.colIndex - 1].offsetWidth.toString());
|
|
29689
29698
|
for (let i = 0; i < this.curTable.rows.length; i++) {
|
|
29690
|
-
|
|
29699
|
+
const currentRow = this.curTable.rows[i];
|
|
29700
|
+
if ((totalwid - actualwid) > 20 && actualwid > 20) {
|
|
29691
29701
|
const leftColumnWidth = totalwid - actualwid;
|
|
29692
29702
|
const rightColWidth = actualwid;
|
|
29693
29703
|
let index;
|
|
29694
29704
|
let isMergedEleResize = false;
|
|
29695
29705
|
let leftTableCell;
|
|
29696
29706
|
let rightTableCell;
|
|
29697
|
-
|
|
29698
|
-
|
|
29699
|
-
if (this.curTable.rows[i].cells[j].hasAttribute('rowspan') && j <= this.colIndex) {
|
|
29707
|
+
for (let j = 0; j < currentRow.cells.length; j++) {
|
|
29708
|
+
if (currentRow.cells[j].hasAttribute('rowspan') && j <= this.colIndex) {
|
|
29700
29709
|
isRowCellsMerged = true;
|
|
29701
29710
|
mergedCellIndex = i;
|
|
29702
|
-
mergedElement =
|
|
29711
|
+
mergedElement = currentRow.cells[j];
|
|
29703
29712
|
}
|
|
29704
29713
|
}
|
|
29705
|
-
if (
|
|
29706
|
-
index = parseInt(
|
|
29714
|
+
if (!isNullOrUndefined(currentRow.cells[i]) && currentRow.cells[i].hasAttribute('colspan')) {
|
|
29715
|
+
index = parseInt(currentRow.cells[i].getAttribute('colspan'), 10) - 1;
|
|
29707
29716
|
}
|
|
29708
29717
|
else {
|
|
29709
29718
|
index = this.colIndex;
|
|
29710
29719
|
}
|
|
29711
29720
|
if (isRowCellsMerged) {
|
|
29712
29721
|
let currentResizeRow;
|
|
29713
|
-
if (
|
|
29714
|
-
index =
|
|
29715
|
-
|
|
29722
|
+
if (currentRow.cells.length < cellColl.length) {
|
|
29723
|
+
index = currentRow.cells.length === this.colIndex ?
|
|
29724
|
+
this.colIndex - 1 : this.colIndex - (this.colIndex - 1);
|
|
29725
|
+
currentResizeRow = this.curTable.rows[!isNullOrUndefined(mergedCellIndex) ?
|
|
29726
|
+
mergedCellIndex : this.colIndex - 1];
|
|
29716
29727
|
if (currentResizeRow && (currentResizeRow.cells[this.colIndex - 1] === mergedElement ||
|
|
29717
29728
|
currentResizeRow.cells[currentResizeRow.cells.length - 1] === mergedElement)) {
|
|
29718
29729
|
isMergedEleResize = true;
|
|
@@ -29724,15 +29735,15 @@ class Table {
|
|
|
29724
29735
|
else {
|
|
29725
29736
|
index = this.colIndex;
|
|
29726
29737
|
}
|
|
29727
|
-
leftTableCell = !isMergedEleResize ?
|
|
29728
|
-
currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ?
|
|
29729
|
-
|
|
29730
|
-
rightTableCell = !isMergedEleResize ?
|
|
29731
|
-
rightTableCell : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ?
|
|
29732
|
-
currentResizeRow.cells[currentResizeRow.cells.length - 1];
|
|
29738
|
+
leftTableCell = !isMergedEleResize ? currentRow.cells[index - 1] : (currentResizeRow &&
|
|
29739
|
+
currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement) ?
|
|
29740
|
+
currentResizeRow.cells[this.colIndex - 1] : currentRow.cells[currentRow.cells.length - 1];
|
|
29741
|
+
rightTableCell = !isMergedEleResize ? currentRow.cells[index] : rightTableCell && rightTableCell.hasAttribute('rowspan') ?
|
|
29742
|
+
rightTableCell : currentResizeRow && currentResizeRow.cells[currentResizeRow.cells.length - 1] !== mergedElement ?
|
|
29743
|
+
currentRow.cells[index - 1] : currentResizeRow.cells[currentResizeRow.cells.length - 1];
|
|
29733
29744
|
}
|
|
29734
|
-
if (!isNullOrUndefined(
|
|
29735
|
-
|
|
29745
|
+
if (!isNullOrUndefined(currentRow.cells[index - 1]) && !isRowCellsMerged) {
|
|
29746
|
+
currentRow.cells[index - 1].style.width =
|
|
29736
29747
|
this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
29737
29748
|
}
|
|
29738
29749
|
else {
|
|
@@ -29741,8 +29752,8 @@ class Table {
|
|
|
29741
29752
|
this.convertPixelToPercentage(leftColumnWidth, tableWidth) + '%';
|
|
29742
29753
|
}
|
|
29743
29754
|
}
|
|
29744
|
-
if (!isNullOrUndefined(
|
|
29745
|
-
|
|
29755
|
+
if (!isNullOrUndefined(currentRow.cells[index]) && !isRowCellsMerged) {
|
|
29756
|
+
currentRow.cells[index].style.width =
|
|
29746
29757
|
this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
29747
29758
|
}
|
|
29748
29759
|
else {
|
|
@@ -29751,7 +29762,6 @@ class Table {
|
|
|
29751
29762
|
this.convertPixelToPercentage(rightColWidth, tableWidth) + '%';
|
|
29752
29763
|
}
|
|
29753
29764
|
}
|
|
29754
|
-
/* eslint-enable */
|
|
29755
29765
|
}
|
|
29756
29766
|
}
|
|
29757
29767
|
}
|
|
@@ -29775,8 +29785,8 @@ class Table {
|
|
|
29775
29785
|
EventHandler.remove(this.contentModule.getEditPanel(), 'mouseover', this.resizeHelper);
|
|
29776
29786
|
}
|
|
29777
29787
|
if (currentTdElement) {
|
|
29778
|
-
|
|
29779
|
-
|
|
29788
|
+
const tableBoxPosition = this.curTable.getBoundingClientRect().left
|
|
29789
|
+
- currentTdElement.getBoundingClientRect().left;
|
|
29780
29790
|
maxiumWidth = Math.abs(tableBoxPosition - currentTdElement.getBoundingClientRect().width) - 5;
|
|
29781
29791
|
this.curTable.style.maxWidth = maxiumWidth + 'px';
|
|
29782
29792
|
}
|