el-text-editor 0.0.57 → 0.0.59
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/esm2020/lib/el-text-editor.component.mjs +11 -7
- package/fesm2015/el-text-editor.mjs +10 -6
- package/fesm2015/el-text-editor.mjs.map +1 -1
- package/fesm2020/el-text-editor.mjs +10 -6
- package/fesm2020/el-text-editor.mjs.map +1 -1
- package/lib/el-text-editor.component.d.ts +1 -0
- package/package.json +1 -1
@@ -1297,13 +1297,10 @@ class ElTextEditorComponent {
|
|
1297
1297
|
onPaste(event) {
|
1298
1298
|
event.preventDefault();
|
1299
1299
|
const clipboardData = event.clipboardData;
|
1300
|
-
console.log('clipboardData: =>> ', clipboardData);
|
1301
1300
|
if (clipboardData) {
|
1302
1301
|
for (let i = 0; i < clipboardData.items.length; i++) {
|
1303
1302
|
const item = clipboardData.items[i];
|
1304
|
-
console.log(`Item ${i}: Type = ${item.type}`);
|
1305
1303
|
if (item.type.startsWith("image/")) {
|
1306
|
-
console.log("Image data detected!");
|
1307
1304
|
// Handle image paste
|
1308
1305
|
const file = item.getAsFile();
|
1309
1306
|
if (file) {
|
@@ -1317,7 +1314,6 @@ class ElTextEditorComponent {
|
|
1317
1314
|
}
|
1318
1315
|
}
|
1319
1316
|
else if (item.type === "text/html") {
|
1320
|
-
console.log("HTML data detected!");
|
1321
1317
|
// Handle HTML paste
|
1322
1318
|
// const htmlData = clipboardData.getData("text/html");
|
1323
1319
|
if (this.isTableData(clipboardData.getData('text/html'))) {
|
@@ -1331,7 +1327,6 @@ class ElTextEditorComponent {
|
|
1331
1327
|
return;
|
1332
1328
|
}
|
1333
1329
|
else if (item.type === "text/plain") {
|
1334
|
-
console.log("Plain text detected!");
|
1335
1330
|
// Handle plain text paste
|
1336
1331
|
if (this.isTableData(clipboardData.getData('text/plain'))) {
|
1337
1332
|
const html = this.convertTextToTable(clipboardData.getData('text/plain'));
|
@@ -1365,7 +1360,7 @@ class ElTextEditorComponent {
|
|
1365
1360
|
const rows = text.split('\n').filter(row => row.trim() !== '');
|
1366
1361
|
const tableRows = rows.map(row => {
|
1367
1362
|
const cells = row.split('\t').map(cell => `<td class="px-1 py-1" >${cell}</td>`).join('');
|
1368
|
-
return `<tr >${cells}</tr>`;
|
1363
|
+
return `<tr class="table-border-top" style="border-top: ${this.themeModeTableBorderTop()}">${cells}</tr>`;
|
1369
1364
|
}).join('');
|
1370
1365
|
return `<table>${tableRows}</table>`;
|
1371
1366
|
}
|
@@ -1384,6 +1379,15 @@ class ElTextEditorComponent {
|
|
1384
1379
|
range.collapse(false);
|
1385
1380
|
}
|
1386
1381
|
}
|
1382
|
+
themeModeTableBorderTop() {
|
1383
|
+
const clrMode = document.body.getAttribute('data-layout-color');
|
1384
|
+
if (clrMode == 'dark') {
|
1385
|
+
return '1px solid #D0D0D0; !important';
|
1386
|
+
}
|
1387
|
+
else {
|
1388
|
+
return '1px solid #414141 !important';
|
1389
|
+
}
|
1390
|
+
}
|
1387
1391
|
openFullscreen() {
|
1388
1392
|
var elem = document.getElementById("textEditor");
|
1389
1393
|
this.isFullScreen = true;
|