@leankylin-sheet/core 4.0.58 → 4.0.59

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
@@ -1,4 +1,4 @@
1
- import _, { isPlainObject, pick } from 'lodash';
1
+ import _, { isPlainObject, uniqBy, pick } from 'lodash';
2
2
  import numeral from 'numeral';
3
3
  import dayjs from 'dayjs';
4
4
  import { Parser, ERROR_REF } from '@leankylin-sheet/formula-parser';
@@ -46540,6 +46540,12 @@ function copySheet(ctx, sheetId, hooks) {
46540
46540
  }
46541
46541
  function calculateSheetFromula(ctx, id) {
46542
46542
  var index$1 = getSheetIndex(ctx, id);
46543
+ var luckysheetfile = ctx.luckysheetfile;
46544
+ var file = luckysheetfile[index$1];
46545
+ var calcChain = file.calcChain;
46546
+ if (_.isNil(calcChain)) {
46547
+ calcChain = [];
46548
+ }
46543
46549
  if (!ctx.luckysheetfile[index$1].data) return;
46544
46550
  for (var r = 0; r < ctx.luckysheetfile[index$1].data.length; r += 1) {
46545
46551
  for (var c = 0; c < ctx.luckysheetfile[index$1].data[r].length; c += 1) {
@@ -46547,13 +46553,25 @@ function calculateSheetFromula(ctx, id) {
46547
46553
  if (!((_ctx$luckysheetfile$i = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i === void 0 ? void 0 : _ctx$luckysheetfile$i.f)) {
46548
46554
  continue;
46549
46555
  }
46550
- var result = execfunction(ctx, (_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : _ctx$luckysheetfile$i2.f, r, c, id);
46556
+ var result = execfunction(ctx, (_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : _ctx$luckysheetfile$i2.f, r, c, id, undefined, true);
46551
46557
  setCellValue$1(ctx, r, c, result[1], null, {
46552
46558
  id: id
46553
46559
  });
46554
- insertUpdateFunctionGroup(ctx, r, c, id);
46560
+ if (_.isNil(id)) {
46561
+ id = ctx.currentSheetId;
46562
+ }
46563
+ var cc = {
46564
+ r: r,
46565
+ c: c,
46566
+ id: id
46567
+ };
46568
+ calcChain.push(cc);
46555
46569
  }
46556
46570
  }
46571
+ file.calcChain = uniqBy(calcChain, function (item) {
46572
+ return item.r + item.c + item.id;
46573
+ });
46574
+ ctx.luckysheetfile = luckysheetfile;
46557
46575
  }
46558
46576
 
46559
46577
  function storeSheetParam(ctx) {
package/dist/index.js CHANGED
@@ -46550,6 +46550,12 @@ function copySheet(ctx, sheetId, hooks) {
46550
46550
  }
46551
46551
  function calculateSheetFromula(ctx, id) {
46552
46552
  var index$1 = getSheetIndex(ctx, id);
46553
+ var luckysheetfile = ctx.luckysheetfile;
46554
+ var file = luckysheetfile[index$1];
46555
+ var calcChain = file.calcChain;
46556
+ if (___default['default'].isNil(calcChain)) {
46557
+ calcChain = [];
46558
+ }
46553
46559
  if (!ctx.luckysheetfile[index$1].data) return;
46554
46560
  for (var r = 0; r < ctx.luckysheetfile[index$1].data.length; r += 1) {
46555
46561
  for (var c = 0; c < ctx.luckysheetfile[index$1].data[r].length; c += 1) {
@@ -46557,13 +46563,25 @@ function calculateSheetFromula(ctx, id) {
46557
46563
  if (!((_ctx$luckysheetfile$i = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i === void 0 ? void 0 : _ctx$luckysheetfile$i.f)) {
46558
46564
  continue;
46559
46565
  }
46560
- var result = execfunction(ctx, (_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : _ctx$luckysheetfile$i2.f, r, c, id);
46566
+ var result = execfunction(ctx, (_ctx$luckysheetfile$i2 = ctx.luckysheetfile[index$1].data[r][c]) === null || _ctx$luckysheetfile$i2 === void 0 ? void 0 : _ctx$luckysheetfile$i2.f, r, c, id, undefined, true);
46561
46567
  setCellValue$1(ctx, r, c, result[1], null, {
46562
46568
  id: id
46563
46569
  });
46564
- insertUpdateFunctionGroup(ctx, r, c, id);
46570
+ if (___default['default'].isNil(id)) {
46571
+ id = ctx.currentSheetId;
46572
+ }
46573
+ var cc = {
46574
+ r: r,
46575
+ c: c,
46576
+ id: id
46577
+ };
46578
+ calcChain.push(cc);
46565
46579
  }
46566
46580
  }
46581
+ file.calcChain = _.uniqBy(calcChain, function (item) {
46582
+ return item.r + item.c + item.id;
46583
+ });
46584
+ ctx.luckysheetfile = luckysheetfile;
46567
46585
  }
46568
46586
 
46569
46587
  function storeSheetParam(ctx) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "4.0.58",
3
+ "version": "4.0.59",
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": "4.0.58",
16
+ "@leankylin-sheet/formula-parser": "4.0.59",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",