@gridsheet/preact-core 2.0.1 → 2.0.2
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/dist/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2614,13 +2614,13 @@ class PasteAction extends CoreAction {
|
|
|
2614
2614
|
const { wire } = dstTable;
|
|
2615
2615
|
const { copyingSheetId, copyingZone, cutting } = wire;
|
|
2616
2616
|
const srcTable = dstTable.getTableBySheetId(copyingSheetId);
|
|
2617
|
-
if (!srcTable) {
|
|
2618
|
-
return store;
|
|
2619
|
-
}
|
|
2620
2617
|
let selectingArea = zoneToArea(selectingZone);
|
|
2621
2618
|
const copyingArea = zoneToArea(copyingZone);
|
|
2622
2619
|
const { matrix, onlyValue } = payload;
|
|
2623
2620
|
if (cutting) {
|
|
2621
|
+
if (!srcTable) {
|
|
2622
|
+
return store;
|
|
2623
|
+
}
|
|
2624
2624
|
const src = copyingArea;
|
|
2625
2625
|
const { height: h2, width: w } = areaShape(copyingArea);
|
|
2626
2626
|
const dst = selectingArea.top !== -1 ? {
|
|
@@ -2693,6 +2693,9 @@ class PasteAction extends CoreAction {
|
|
|
2693
2693
|
}
|
|
2694
2694
|
});
|
|
2695
2695
|
} else {
|
|
2696
|
+
if (srcTable == null) {
|
|
2697
|
+
return store;
|
|
2698
|
+
}
|
|
2696
2699
|
let { height, width } = areaShape(copyingArea);
|
|
2697
2700
|
if (selectingArea.top !== -1) {
|
|
2698
2701
|
y = selectingArea.top;
|
|
@@ -3704,10 +3707,14 @@ function parseStyleString(element) {
|
|
|
3704
3707
|
const styleString = element.getAttribute("style") ?? "";
|
|
3705
3708
|
const styleObj = {};
|
|
3706
3709
|
styleString.split(";").forEach((d) => {
|
|
3707
|
-
|
|
3710
|
+
let [rawKey, rawValue] = d.split(":");
|
|
3708
3711
|
if (!rawKey || !rawValue) {
|
|
3709
3712
|
return;
|
|
3710
3713
|
}
|
|
3714
|
+
rawKey = rawKey.trim();
|
|
3715
|
+
if (rawKey === "height" || rawKey === "width") {
|
|
3716
|
+
return;
|
|
3717
|
+
}
|
|
3711
3718
|
const key = rawKey.trim().replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
3712
3719
|
if (key === "float" || key === "display" || key.startsWith("padding")) {
|
|
3713
3720
|
return;
|