@leankylin-sheet/core 5.2.23 → 5.2.25

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/dist/index.esm.js CHANGED
@@ -35545,7 +35545,10 @@ var FormulaCache = /*#__PURE__*/function () {
35545
35545
  key: "tryGetCellAsNumber",
35546
35546
  value: function tryGetCellAsNumber(cell) {
35547
35547
  var _cell$ct;
35548
- if ((cell === null || cell === void 0 ? void 0 : (_cell$ct = cell.ct) === null || _cell$ct === void 0 ? void 0 : _cell$ct.t) === "n") {
35548
+ if (_.isNil(cell === null || cell === void 0 ? void 0 : cell.v)) {
35549
+ return null;
35550
+ }
35551
+ if ((cell === null || cell === void 0 ? void 0 : (_cell$ct = cell.ct) === null || _cell$ct === void 0 ? void 0 : _cell$ct.t) === "n" && (cell === null || cell === void 0 ? void 0 : cell.v)) {
35549
35552
  var n = Number(cell === null || cell === void 0 ? void 0 : cell.v);
35550
35553
  return Number.isNaN(n) ? cell.v : n;
35551
35554
  }
@@ -46587,15 +46590,15 @@ function copySheet(ctx, sheetId, hooks) {
46587
46590
  }
46588
46591
  function calculateSheetFromula(ctx, id, isrefresh) {
46589
46592
  console.time("calcTime:".concat(id));
46590
- var index$1 = getSheetIndex(ctx, id);
46591
- var luckysheetfile = ctx.luckysheetfile;
46592
- var sheetData = luckysheetfile[index$1].data;
46593
- if (!sheetData) return;
46594
- var calcChain = luckysheetfile[index$1].calcChain || [];
46595
- if (isrefresh && calcChain.length > 0) {
46596
- execFunctionGroup(ctx, null, null, null, id, sheetData, true);
46593
+ if (isrefresh) {
46594
+ execFunctionGroup(ctx, null, null, null, id, [], true);
46597
46595
  groupValuesRefresh(ctx);
46598
46596
  } else {
46597
+ var index$1 = getSheetIndex(ctx, id);
46598
+ var luckysheetfile = ctx.luckysheetfile;
46599
+ var sheetData = luckysheetfile[index$1].data;
46600
+ if (!sheetData) return;
46601
+ var calcChain = luckysheetfile[index$1].calcChain || [];
46599
46602
  var cellsToUpdate = [];
46600
46603
  for (var i = 0; i < calcChain.length; i += 1) {
46601
46604
  var _calcChain$i = calcChain[i],
@@ -46626,7 +46629,6 @@ function calculateSheetFromula(ctx, id, isrefresh) {
46626
46629
  });
46627
46630
  }
46628
46631
  }
46629
- ctx.luckysheetfile = luckysheetfile;
46630
46632
  console.timeEnd("calcTime:".concat(id));
46631
46633
  }
46632
46634
  function updateFunctionGroup(ctx) {
package/dist/index.js CHANGED
@@ -35555,7 +35555,10 @@ var FormulaCache = /*#__PURE__*/function () {
35555
35555
  key: "tryGetCellAsNumber",
35556
35556
  value: function tryGetCellAsNumber(cell) {
35557
35557
  var _cell$ct;
35558
- if ((cell === null || cell === void 0 ? void 0 : (_cell$ct = cell.ct) === null || _cell$ct === void 0 ? void 0 : _cell$ct.t) === "n") {
35558
+ if (___default['default'].isNil(cell === null || cell === void 0 ? void 0 : cell.v)) {
35559
+ return null;
35560
+ }
35561
+ if ((cell === null || cell === void 0 ? void 0 : (_cell$ct = cell.ct) === null || _cell$ct === void 0 ? void 0 : _cell$ct.t) === "n" && (cell === null || cell === void 0 ? void 0 : cell.v)) {
35559
35562
  var n = Number(cell === null || cell === void 0 ? void 0 : cell.v);
35560
35563
  return Number.isNaN(n) ? cell.v : n;
35561
35564
  }
@@ -46597,15 +46600,15 @@ function copySheet(ctx, sheetId, hooks) {
46597
46600
  }
46598
46601
  function calculateSheetFromula(ctx, id, isrefresh) {
46599
46602
  console.time("calcTime:".concat(id));
46600
- var index$1 = getSheetIndex(ctx, id);
46601
- var luckysheetfile = ctx.luckysheetfile;
46602
- var sheetData = luckysheetfile[index$1].data;
46603
- if (!sheetData) return;
46604
- var calcChain = luckysheetfile[index$1].calcChain || [];
46605
- if (isrefresh && calcChain.length > 0) {
46606
- execFunctionGroup(ctx, null, null, null, id, sheetData, true);
46603
+ if (isrefresh) {
46604
+ execFunctionGroup(ctx, null, null, null, id, [], true);
46607
46605
  groupValuesRefresh(ctx);
46608
46606
  } else {
46607
+ var index$1 = getSheetIndex(ctx, id);
46608
+ var luckysheetfile = ctx.luckysheetfile;
46609
+ var sheetData = luckysheetfile[index$1].data;
46610
+ if (!sheetData) return;
46611
+ var calcChain = luckysheetfile[index$1].calcChain || [];
46609
46612
  var cellsToUpdate = [];
46610
46613
  for (var i = 0; i < calcChain.length; i += 1) {
46611
46614
  var _calcChain$i = calcChain[i],
@@ -46636,7 +46639,6 @@ function calculateSheetFromula(ctx, id, isrefresh) {
46636
46639
  });
46637
46640
  }
46638
46641
  }
46639
- ctx.luckysheetfile = luckysheetfile;
46640
46642
  console.timeEnd("calcTime:".concat(id));
46641
46643
  }
46642
46644
  function updateFunctionGroup(ctx) {
@@ -25,7 +25,7 @@ export declare class FormulaCache {
25
25
  execFunctionExist?: any[];
26
26
  execFunctionGlobalData: any;
27
27
  constructor();
28
- tryGetCellAsNumber(cell: Cell): string | number | boolean | undefined;
28
+ tryGetCellAsNumber(cell: Cell): string | number | boolean | null;
29
29
  }
30
30
  export declare function iscelldata(txt: string): boolean;
31
31
  export declare function getcellrange(ctx: Context, txt: string, formulaId?: string): any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "5.2.23",
3
+ "version": "5.2.25",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -13,7 +13,7 @@
13
13
  "build": "father-build"
14
14
  },
15
15
  "dependencies": {
16
- "@leankylin-sheet/formula-parser": "5.2.23",
16
+ "@leankylin-sheet/formula-parser": "5.2.25",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",