@fileverse-dev/fortune-core 1.1.81 → 1.1.83

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.
@@ -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
@@ -313,7 +313,7 @@ export function getNumberFormat(strValue, commaPresent) {
313
313
  } else if (hasComma) {
314
314
  format = "#,##0";
315
315
  } else {
316
- format = "0";
316
+ format = "General";
317
317
  }
318
318
  return format;
319
319
  }
@@ -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
  }
@@ -385,7 +385,7 @@ function getNumberFormat(strValue, commaPresent) {
385
385
  } else if (hasComma) {
386
386
  format = "#,##0";
387
387
  } else {
388
- format = "0";
388
+ format = "General";
389
389
  }
390
390
  return format;
391
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.81",
3
+ "version": "1.1.83",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",