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