@fileverse-dev/fortune-core 1.1.80-patch-test-5 → 1.1.80-patch-test-7

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/api/sheet.js CHANGED
@@ -2,7 +2,7 @@ import _ from "lodash";
2
2
  import { v4 as uuidv4 } from "uuid";
3
3
  import { dataToCelldata, getSheet } from "./common";
4
4
  import { getSheetIndex } from "../utils";
5
- import { api, execfunction, insertUpdateFunctionGroup, locale } from "..";
5
+ import { api, execfunction, getFlowdata, insertUpdateFunctionGroup, locale, spillSortResult } from "..";
6
6
  export function getAllSheets(ctx) {
7
7
  return ctx.luckysheetfile;
8
8
  }
@@ -121,7 +121,17 @@ export function calculateSheetFromula(ctx, id) {
121
121
  continue;
122
122
  }
123
123
  var result = execfunction(ctx, (_c = ctx.luckysheetfile[index].data[r][c]) === null || _c === void 0 ? void 0 : _c.f, r, c, id);
124
- api.setCellValue(ctx, r, c, result[1], null);
124
+ console.log("Formula result", result);
125
+ var isValueArray = Array.isArray(result[1]);
126
+ if (isValueArray) {
127
+ var value = {
128
+ f: result[2],
129
+ v: result[1]
130
+ };
131
+ spillSortResult(ctx, r, c, value, getFlowdata(ctx));
132
+ } else {
133
+ api.setCellValue(ctx, r, c, result[1], null);
134
+ }
125
135
  insertUpdateFunctionGroup(ctx, r, c, id);
126
136
  }
127
137
  }
package/lib/api/sheet.js CHANGED
@@ -138,7 +138,17 @@ function calculateSheetFromula(ctx, id) {
138
138
  continue;
139
139
  }
140
140
  var result = (0, _2.execfunction)(ctx, (_c = ctx.luckysheetfile[index].data[r][c]) === null || _c === void 0 ? void 0 : _c.f, r, c, id);
141
- _2.api.setCellValue(ctx, r, c, result[1], null);
141
+ console.log("Formula result", result);
142
+ var isValueArray = Array.isArray(result[1]);
143
+ if (isValueArray) {
144
+ var value = {
145
+ f: result[2],
146
+ v: result[1]
147
+ };
148
+ (0, _2.spillSortResult)(ctx, r, c, value, (0, _2.getFlowdata)(ctx));
149
+ } else {
150
+ _2.api.setCellValue(ctx, r, c, result[1], null);
151
+ }
142
152
  (0, _2.insertUpdateFunctionGroup)(ctx, r, c, id);
143
153
  }
144
154
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.80-patch-test-5",
3
+ "version": "1.1.80-patch-test-7",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",