@fileverse-dev/fortune-core 1.1.80 → 1.1.82
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 +11 -2
- package/es/modules/cell.js +6 -2
- package/es/utils/index.js +1 -1
- package/lib/api/sheet.js +10 -1
- package/lib/modules/cell.js +6 -2
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
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,16 @@ 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
|
-
|
|
124
|
+
var isValueArray = Array.isArray(result[1]);
|
|
125
|
+
if (isValueArray) {
|
|
126
|
+
var value = {
|
|
127
|
+
f: result[2],
|
|
128
|
+
v: result[1]
|
|
129
|
+
};
|
|
130
|
+
spillSortResult(ctx, r, c, value, getFlowdata(ctx));
|
|
131
|
+
} else {
|
|
132
|
+
api.setCellValue(ctx, r, c, result[1], null);
|
|
133
|
+
}
|
|
125
134
|
insertUpdateFunctionGroup(ctx, r, c, id);
|
|
126
135
|
}
|
|
127
136
|
}
|
package/es/modules/cell.js
CHANGED
|
@@ -282,6 +282,7 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
282
282
|
});
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
+
console.log(fa, vupdate, "heeere or not");
|
|
285
286
|
var mask = update(fa, vupdate);
|
|
286
287
|
if (mask === vupdate) {
|
|
287
288
|
mask = genarate(vupdate);
|
|
@@ -309,14 +310,14 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
309
310
|
var strValue = String(vupdate);
|
|
310
311
|
var format = getNumberFormat(strValue, commaPresent);
|
|
311
312
|
cell.m = v.m ? v.m : update(format, cell.v);
|
|
312
|
-
cell.ht = 2;
|
|
313
|
+
cell.ht = (v === null || v === void 0 ? void 0 : v.ct) ? cell.ht : 2;
|
|
313
314
|
cell.ct = {
|
|
314
315
|
fa: format,
|
|
315
316
|
t: "n"
|
|
316
317
|
};
|
|
317
318
|
if (cell.v === Infinity || cell.v === -Infinity) {
|
|
318
319
|
cell.m = cell.v.toString();
|
|
319
|
-
} else if (cell.v != null) {
|
|
320
|
+
} else if (cell.v != null && !cell.m) {
|
|
320
321
|
var mask = genarate(cell.v);
|
|
321
322
|
if (mask) {
|
|
322
323
|
if (v.m) {
|
|
@@ -331,6 +332,9 @@ export function setCellValue(ctx, r, c, d, v) {
|
|
|
331
332
|
if (mask) {
|
|
332
333
|
cell.m = mask[0].toString();
|
|
333
334
|
cell.ct = mask[1], cell.v = mask[2];
|
|
335
|
+
if ((v === null || v === void 0 ? void 0 : v.ct) && v.ct.t === "n" && (cell === null || cell === void 0 ? void 0 : cell.ct) && cell.ct.t !== "n" && (cell === null || cell === void 0 ? void 0 : cell.ht) === 2) {
|
|
336
|
+
cell.ht = 1;
|
|
337
|
+
}
|
|
334
338
|
}
|
|
335
339
|
}
|
|
336
340
|
}
|
package/es/utils/index.js
CHANGED
package/lib/api/sheet.js
CHANGED
|
@@ -138,7 +138,16 @@ 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
|
-
|
|
141
|
+
var isValueArray = Array.isArray(result[1]);
|
|
142
|
+
if (isValueArray) {
|
|
143
|
+
var value = {
|
|
144
|
+
f: result[2],
|
|
145
|
+
v: result[1]
|
|
146
|
+
};
|
|
147
|
+
(0, _2.spillSortResult)(ctx, r, c, value, (0, _2.getFlowdata)(ctx));
|
|
148
|
+
} else {
|
|
149
|
+
_2.api.setCellValue(ctx, r, c, result[1], null);
|
|
150
|
+
}
|
|
142
151
|
(0, _2.insertUpdateFunctionGroup)(ctx, r, c, id);
|
|
143
152
|
}
|
|
144
153
|
}
|
package/lib/modules/cell.js
CHANGED
|
@@ -315,6 +315,7 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
315
315
|
});
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
|
+
console.log(fa, vupdate, "heeere or not");
|
|
318
319
|
var mask = (0, _format.update)(fa, vupdate);
|
|
319
320
|
if (mask === vupdate) {
|
|
320
321
|
mask = (0, _format.genarate)(vupdate);
|
|
@@ -342,14 +343,14 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
342
343
|
var strValue = String(vupdate);
|
|
343
344
|
var format = (0, _utils.getNumberFormat)(strValue, commaPresent);
|
|
344
345
|
cell.m = v.m ? v.m : (0, _format.update)(format, cell.v);
|
|
345
|
-
cell.ht = 2;
|
|
346
|
+
cell.ht = (v === null || v === void 0 ? void 0 : v.ct) ? cell.ht : 2;
|
|
346
347
|
cell.ct = {
|
|
347
348
|
fa: format,
|
|
348
349
|
t: "n"
|
|
349
350
|
};
|
|
350
351
|
if (cell.v === Infinity || cell.v === -Infinity) {
|
|
351
352
|
cell.m = cell.v.toString();
|
|
352
|
-
} else if (cell.v != null) {
|
|
353
|
+
} else if (cell.v != null && !cell.m) {
|
|
353
354
|
var mask = (0, _format.genarate)(cell.v);
|
|
354
355
|
if (mask) {
|
|
355
356
|
if (v.m) {
|
|
@@ -364,6 +365,9 @@ function setCellValue(ctx, r, c, d, v) {
|
|
|
364
365
|
if (mask) {
|
|
365
366
|
cell.m = mask[0].toString();
|
|
366
367
|
cell.ct = mask[1], cell.v = mask[2];
|
|
368
|
+
if ((v === null || v === void 0 ? void 0 : v.ct) && v.ct.t === "n" && (cell === null || cell === void 0 ? void 0 : cell.ct) && cell.ct.t !== "n" && (cell === null || cell === void 0 ? void 0 : cell.ht) === 2) {
|
|
369
|
+
cell.ht = 1;
|
|
370
|
+
}
|
|
367
371
|
}
|
|
368
372
|
}
|
|
369
373
|
}
|
package/lib/utils/index.js
CHANGED