sheet-happens 0.0.19 → 0.0.20

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.
@@ -580,14 +580,10 @@ function renderOnCanvas(context, rowSizes, columnSizes, cellStyle, cellWidth, ce
580
580
 
581
581
  if (rowSelectionActive) {
582
582
  var p1x = Math.max(-100, p1.x);
583
- var p1y = Math.max(-100, p1.y);
584
- context.fillRect(p1x, p1y, 100000, p2.y - p1.y);
583
+ context.fillRect(p1x, p1.y, 100000, p2.y - p1.y);
585
584
  } else if (colSelectionActive) {
586
- var _p1x = Math.max(-100, p1.x);
587
-
588
- var _p1y = Math.max(-100, p1.y);
589
-
590
- context.fillRect(_p1x, _p1y, p2.x - p1.x, 100000);
585
+ var p1y = Math.max(0, p1.y);
586
+ context.fillRect(p1.x, p1y, p2.x - p1.x, 100000);
591
587
  } else {
592
588
  context.fillRect(p1.x, p1.y, p2.x - p1.x, p2.y - p1.y);
593
589
  }
@@ -714,17 +710,13 @@ function renderOnCanvas(context, rowSizes, columnSizes, cellStyle, cellWidth, ce
714
710
  context.beginPath();
715
711
 
716
712
  if (rowSelectionActive) {
717
- var _p1x2 = Math.max(-100, p1.x);
718
-
719
- var _p1y2 = Math.max(-100, p1.y);
713
+ var _p1x = Math.max(-100, p1.x);
720
714
 
721
- context.rect(_p1x2, _p1y2, 100000, p2.y - p1.y);
715
+ context.rect(_p1x, p1.y, 100000, p2.y - p1.y);
722
716
  } else if (colSelectionActive) {
723
- var _p1x3 = Math.max(-100, p1.x);
724
-
725
- var _p1y3 = Math.max(-100, p1.y);
717
+ var _p1y = Math.max(-100, p1.y);
726
718
 
727
- context.rect(_p1x3, _p1y3, p2.x - p1.x, 100000);
719
+ context.rect(p1.x, _p1y, p2.x - p1.x, 100000);
728
720
  } else {
729
721
  context.rect(p1.x, p1.y, p2.x - p1.x, p2.y - p1.y);
730
722
  }
@@ -1333,12 +1325,12 @@ function Sheet(props) {
1333
1325
  var clipboardData = e.clipboardData || window.clipboardData;
1334
1326
  var types = clipboardData.types;
1335
1327
 
1336
- if (types.includes('text/rtf') && types.includes('text/plain') || types.includes('text/plain') && !types.includes('text/html')) {
1337
- var text = clipboardData.getData('text/plain');
1338
- parsePastedText(text);
1339
- } else if (types.includes('text/html')) {
1328
+ if (types.includes('text/html')) {
1340
1329
  var pastedHtml = clipboardData.getData('text/html');
1341
1330
  parsePastedHtml(pastedHtml);
1331
+ } else if (types.includes('text/plain')) {
1332
+ var text = clipboardData.getData('text/plain');
1333
+ parsePastedText(text);
1342
1334
  }
1343
1335
  };
1344
1336
 
@@ -1419,12 +1411,12 @@ function Sheet(props) {
1419
1411
  var p = td.children[0];
1420
1412
 
1421
1413
  if (p.children.length !== 0 && p.children[0].nodeName === 'FONT') {
1422
- str = p.children[0].innerHTML;
1414
+ str = p.children[0].textContent.trim();
1423
1415
  } else {
1424
- str = p.innerHTML;
1416
+ str = p.textContent.trim();
1425
1417
  }
1426
1418
  } else {
1427
- str = td.innerHTML;
1419
+ str = td.textContent.trim();
1428
1420
  }
1429
1421
 
1430
1422
  str = str.replaceAll('\n', '');