@fileverse-dev/fortune-core 1.0.69 → 1.0.71
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/es/events/paste.js +13 -3
- package/lib/events/paste.js +13 -3
- package/package.json +2 -2
package/es/events/paste.js
CHANGED
|
@@ -855,7 +855,8 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
855
855
|
var value = null;
|
|
856
856
|
if ((_f = copyData[h - mth]) === null || _f === void 0 ? void 0 : _f[c - mtc]) {
|
|
857
857
|
value = _.cloneDeep(copyData[h - mth][c - mtc]);
|
|
858
|
-
|
|
858
|
+
console.log("value", value);
|
|
859
|
+
if ((value === null || value === void 0 ? void 0 : value.v) && (value === null || value === void 0 ? void 0 : value.f) && (value === null || value === void 0 ? void 0 : value.isDataBlockFormula) && arr.length === 1) {
|
|
859
860
|
value.m = "Loading...";
|
|
860
861
|
}
|
|
861
862
|
}
|
|
@@ -875,6 +876,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
875
876
|
}
|
|
876
877
|
var funcV = execfunction(ctx, func, h, c, undefined, undefined, true);
|
|
877
878
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
879
|
+
console.log("fortune about to call afterUpdateCell");
|
|
878
880
|
if (afterUpdateCell && arr.length === 1) {
|
|
879
881
|
afterUpdateCell(h, c, null, __assign(__assign({}, value), {
|
|
880
882
|
v: funcV[1],
|
|
@@ -977,9 +979,17 @@ function handleFormulaStringPaste(ctx, formulaStr) {
|
|
|
977
979
|
d[r][c].m = isDataBlockRespose ? "Loading..." : val.toString();
|
|
978
980
|
d[r][c].v = val;
|
|
979
981
|
d[r][c].f = formulaStr;
|
|
982
|
+
var cellTemp = {
|
|
983
|
+
m: "",
|
|
984
|
+
v: "",
|
|
985
|
+
f: ""
|
|
986
|
+
};
|
|
987
|
+
cellTemp.m = isDataBlockRespose ? "Loading..." : val.toString();
|
|
988
|
+
cellTemp.v = val;
|
|
989
|
+
cellTemp.f = formulaStr;
|
|
980
990
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
981
991
|
if (afterUpdateCell && isDataBlockRespose) {
|
|
982
|
-
afterUpdateCell(r, c, null,
|
|
992
|
+
afterUpdateCell(r, c, null, cellTemp);
|
|
983
993
|
}
|
|
984
994
|
}
|
|
985
995
|
export function handlePaste(ctx, e) {
|
|
@@ -1374,7 +1384,7 @@ export function handlePasteByClick(ctx, clipboardData, triggerType) {
|
|
|
1374
1384
|
}
|
|
1375
1385
|
} else if (data.indexOf("fortune-copy-action-image") > -1) {} else if (triggerType !== "btn") {
|
|
1376
1386
|
var isExcelFormula = clipboardData.startsWith("=");
|
|
1377
|
-
if (isExcelFormula
|
|
1387
|
+
if (isExcelFormula) {
|
|
1378
1388
|
handleFormulaStringPaste(ctx, clipboardData);
|
|
1379
1389
|
} else {
|
|
1380
1390
|
pasteHandler(ctx, clipboardData);
|
package/lib/events/paste.js
CHANGED
|
@@ -863,7 +863,8 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
863
863
|
var value = null;
|
|
864
864
|
if ((_f = copyData[h - mth]) === null || _f === void 0 ? void 0 : _f[c - mtc]) {
|
|
865
865
|
value = _lodash.default.cloneDeep(copyData[h - mth][c - mtc]);
|
|
866
|
-
|
|
866
|
+
console.log("value", value);
|
|
867
|
+
if ((value === null || value === void 0 ? void 0 : value.v) && (value === null || value === void 0 ? void 0 : value.f) && (value === null || value === void 0 ? void 0 : value.isDataBlockFormula) && arr.length === 1) {
|
|
867
868
|
value.m = "Loading...";
|
|
868
869
|
}
|
|
869
870
|
}
|
|
@@ -883,6 +884,7 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
883
884
|
}
|
|
884
885
|
var funcV = (0, _formula.execfunction)(ctx, func, h, c, undefined, undefined, true);
|
|
885
886
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
887
|
+
console.log("fortune about to call afterUpdateCell");
|
|
886
888
|
if (afterUpdateCell && arr.length === 1) {
|
|
887
889
|
afterUpdateCell(h, c, null, __assign(__assign({}, value), {
|
|
888
890
|
v: funcV[1],
|
|
@@ -985,9 +987,17 @@ function handleFormulaStringPaste(ctx, formulaStr) {
|
|
|
985
987
|
d[r][c].m = isDataBlockRespose ? "Loading..." : val.toString();
|
|
986
988
|
d[r][c].v = val;
|
|
987
989
|
d[r][c].f = formulaStr;
|
|
990
|
+
var cellTemp = {
|
|
991
|
+
m: "",
|
|
992
|
+
v: "",
|
|
993
|
+
f: ""
|
|
994
|
+
};
|
|
995
|
+
cellTemp.m = isDataBlockRespose ? "Loading..." : val.toString();
|
|
996
|
+
cellTemp.v = val;
|
|
997
|
+
cellTemp.f = formulaStr;
|
|
988
998
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
989
999
|
if (afterUpdateCell && isDataBlockRespose) {
|
|
990
|
-
afterUpdateCell(r, c, null,
|
|
1000
|
+
afterUpdateCell(r, c, null, cellTemp);
|
|
991
1001
|
}
|
|
992
1002
|
}
|
|
993
1003
|
function handlePaste(ctx, e) {
|
|
@@ -1382,7 +1392,7 @@ function handlePasteByClick(ctx, clipboardData, triggerType) {
|
|
|
1382
1392
|
}
|
|
1383
1393
|
} else if (data.indexOf("fortune-copy-action-image") > -1) {} else if (triggerType !== "btn") {
|
|
1384
1394
|
var isExcelFormula = clipboardData.startsWith("=");
|
|
1385
|
-
if (isExcelFormula
|
|
1395
|
+
if (isExcelFormula) {
|
|
1386
1396
|
handleFormulaStringPaste(ctx, clipboardData);
|
|
1387
1397
|
} else {
|
|
1388
1398
|
pasteHandler(ctx, clipboardData);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fileverse-dev/fortune-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dev": "father-build --watch"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@fileverse-dev/formula-parser": "0.2.
|
|
18
|
+
"@fileverse-dev/formula-parser": "0.2.48",
|
|
19
19
|
"dayjs": "^1.11.0",
|
|
20
20
|
"immer": "^9.0.12",
|
|
21
21
|
"lodash": "^4.17.21",
|