@fileverse-dev/fortune-core 1.2.22-cell-ref-adjustment-1 → 1.2.22-cell-ref-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/es/events/paste.js +15 -1
- package/lib/events/paste.js +14 -0
- package/package.json +1 -1
package/es/events/paste.js
CHANGED
|
@@ -21,7 +21,7 @@ import { hasPartMC, isRealNum } from "../modules/validation";
|
|
|
21
21
|
import { getBorderInfoCompute } from "../modules/border";
|
|
22
22
|
import { expandRowsAndColumns, storeSheetParamALL } from "../modules/sheet";
|
|
23
23
|
import { jfrefreshgrid } from "../modules/refresh";
|
|
24
|
-
import { CFSplitRange, sanitizeDuneUrl, saveHyperlink } from "../modules";
|
|
24
|
+
import { CFSplitRange, sanitizeDuneUrl, saveHyperlink, spillSortResult } from "../modules";
|
|
25
25
|
import clipboard from "../modules/clipboard";
|
|
26
26
|
import { calculateRangeCellSize, updateSheetCellSizes } from "../paste-helpers/calculate-range-cell-size";
|
|
27
27
|
export function columnLabelIndex(label) {
|
|
@@ -899,6 +899,20 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
899
899
|
var adjustedFormula = adjustFormulaForPaste(value.f.startsWith("=") ? value.f : "=".concat(value.f), c_c1, c_r1, c, h);
|
|
900
900
|
var funcV = execfunction(ctx, adjustedFormula, h, c, undefined, undefined, true);
|
|
901
901
|
value.f = adjustedFormula;
|
|
902
|
+
if (!(funcV[1] instanceof Promise)) {
|
|
903
|
+
if (Array.isArray(funcV[1])) {
|
|
904
|
+
var formulaResultValue = funcV[1];
|
|
905
|
+
value.m = String(formulaResultValue[0][0]);
|
|
906
|
+
spillSortResult(ctx, h, c, {
|
|
907
|
+
m: String(formulaResultValue[0][0]),
|
|
908
|
+
f: value.f,
|
|
909
|
+
v: formulaResultValue
|
|
910
|
+
}, d);
|
|
911
|
+
} else {
|
|
912
|
+
value.m = String(funcV[1]);
|
|
913
|
+
value.v = String(funcV[1]);
|
|
914
|
+
}
|
|
915
|
+
}
|
|
902
916
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
903
917
|
if (afterUpdateCell) {
|
|
904
918
|
afterUpdateCell(h, c, null, __assign(__assign({}, value), {
|
package/lib/events/paste.js
CHANGED
|
@@ -911,6 +911,20 @@ function pasteHandlerOfCopyPaste(ctx, copyRange) {
|
|
|
911
911
|
var adjustedFormula = adjustFormulaForPaste(value.f.startsWith("=") ? value.f : "=".concat(value.f), c_c1, c_r1, c, h);
|
|
912
912
|
var funcV = (0, _formula.execfunction)(ctx, adjustedFormula, h, c, undefined, undefined, true);
|
|
913
913
|
value.f = adjustedFormula;
|
|
914
|
+
if (!(funcV[1] instanceof Promise)) {
|
|
915
|
+
if (Array.isArray(funcV[1])) {
|
|
916
|
+
var formulaResultValue = funcV[1];
|
|
917
|
+
value.m = String(formulaResultValue[0][0]);
|
|
918
|
+
(0, _modules.spillSortResult)(ctx, h, c, {
|
|
919
|
+
m: String(formulaResultValue[0][0]),
|
|
920
|
+
f: value.f,
|
|
921
|
+
v: formulaResultValue
|
|
922
|
+
}, d);
|
|
923
|
+
} else {
|
|
924
|
+
value.m = String(funcV[1]);
|
|
925
|
+
value.v = String(funcV[1]);
|
|
926
|
+
}
|
|
927
|
+
}
|
|
914
928
|
var afterUpdateCell = ctx.hooks.afterUpdateCell;
|
|
915
929
|
if (afterUpdateCell) {
|
|
916
930
|
afterUpdateCell(h, c, null, __assign(__assign({}, value), {
|