@leankylin-sheet/core 5.2.1 → 5.2.3

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.
@@ -9,6 +9,7 @@ export declare function hideSheet(ctx: Context, sheetId: string): void;
9
9
  export declare function showSheet(ctx: Context, sheetId: string): void;
10
10
  export declare function copySheet(ctx: Context, sheetId: string, hooks: Hooks): void;
11
11
  export declare function calculateSheetFromula(ctx: Context, id: string): void;
12
+ export declare function updateFunctionGroup(ctx: Context, id: string): void;
12
13
  export declare function calculateSheetByCells(ctx: Context, cells: {
13
14
  r: number;
14
15
  c: number;
package/dist/index.esm.js CHANGED
@@ -46603,7 +46603,6 @@ function calculateSheetFromula(ctx, id) {
46603
46603
  setCellValue$1(ctx, r, c, result[1], null, {
46604
46604
  id: id
46605
46605
  });
46606
- insertUpdateFunctionGroup(ctx, r, c, id);
46607
46606
  }
46608
46607
  }
46609
46608
  file.calcChain = uniqBy(calcChain, function (item) {
@@ -46612,6 +46611,34 @@ function calculateSheetFromula(ctx, id) {
46612
46611
  ctx.luckysheetfile = luckysheetfile;
46613
46612
  console.timeEnd("calcTime:".concat(id));
46614
46613
  }
46614
+ function updateFunctionGroup(ctx, id) {
46615
+ var index = getSheetIndex(ctx, id);
46616
+ var luckysheetfile = ctx.luckysheetfile;
46617
+ var file = luckysheetfile[index];
46618
+ var calcChain = file.calcChain;
46619
+ if (_.isNil(calcChain)) {
46620
+ calcChain = [];
46621
+ }
46622
+ if (!ctx.luckysheetfile[index].data) return;
46623
+ for (var r = 0; r < ctx.luckysheetfile[index].data.length; r += 1) {
46624
+ for (var c = 0; c < ctx.luckysheetfile[index].data[r].length; c += 1) {
46625
+ var cell = ctx.luckysheetfile[index].data[r][c];
46626
+ if (!(cell === null || cell === void 0 ? void 0 : cell.f)) {
46627
+ continue;
46628
+ }
46629
+ var cc = {
46630
+ r: r,
46631
+ c: c,
46632
+ id: id
46633
+ };
46634
+ calcChain.push(cc);
46635
+ }
46636
+ }
46637
+ file.calcChain = uniqBy(calcChain, function (item) {
46638
+ return item.r + item.c + item.id;
46639
+ });
46640
+ ctx.luckysheetfile = luckysheetfile;
46641
+ }
46615
46642
  function parseCellReferences(expression) {
46616
46643
  if (typeof expression !== "string" || expression.trim() === "") {
46617
46644
  return [];
@@ -56404,6 +56431,7 @@ var index = /*#__PURE__*/Object.freeze({
56404
56431
  showSheet: showSheet,
56405
56432
  copySheet: copySheet,
56406
56433
  calculateSheetFromula: calculateSheetFromula,
56434
+ updateFunctionGroup: updateFunctionGroup,
56407
56435
  calculateSheetByCells: calculateSheetByCells,
56408
56436
  addSheet: addSheet$1,
56409
56437
  deleteSheet: deleteSheet$1,
package/dist/index.js CHANGED
@@ -46613,7 +46613,6 @@ function calculateSheetFromula(ctx, id) {
46613
46613
  setCellValue$1(ctx, r, c, result[1], null, {
46614
46614
  id: id
46615
46615
  });
46616
- insertUpdateFunctionGroup(ctx, r, c, id);
46617
46616
  }
46618
46617
  }
46619
46618
  file.calcChain = _.uniqBy(calcChain, function (item) {
@@ -46622,6 +46621,34 @@ function calculateSheetFromula(ctx, id) {
46622
46621
  ctx.luckysheetfile = luckysheetfile;
46623
46622
  console.timeEnd("calcTime:".concat(id));
46624
46623
  }
46624
+ function updateFunctionGroup(ctx, id) {
46625
+ var index = getSheetIndex(ctx, id);
46626
+ var luckysheetfile = ctx.luckysheetfile;
46627
+ var file = luckysheetfile[index];
46628
+ var calcChain = file.calcChain;
46629
+ if (___default['default'].isNil(calcChain)) {
46630
+ calcChain = [];
46631
+ }
46632
+ if (!ctx.luckysheetfile[index].data) return;
46633
+ for (var r = 0; r < ctx.luckysheetfile[index].data.length; r += 1) {
46634
+ for (var c = 0; c < ctx.luckysheetfile[index].data[r].length; c += 1) {
46635
+ var cell = ctx.luckysheetfile[index].data[r][c];
46636
+ if (!(cell === null || cell === void 0 ? void 0 : cell.f)) {
46637
+ continue;
46638
+ }
46639
+ var cc = {
46640
+ r: r,
46641
+ c: c,
46642
+ id: id
46643
+ };
46644
+ calcChain.push(cc);
46645
+ }
46646
+ }
46647
+ file.calcChain = _.uniqBy(calcChain, function (item) {
46648
+ return item.r + item.c + item.id;
46649
+ });
46650
+ ctx.luckysheetfile = luckysheetfile;
46651
+ }
46625
46652
  function parseCellReferences(expression) {
46626
46653
  if (typeof expression !== "string" || expression.trim() === "") {
46627
46654
  return [];
@@ -56414,6 +56441,7 @@ var index = /*#__PURE__*/Object.freeze({
56414
56441
  showSheet: showSheet,
56415
56442
  copySheet: copySheet,
56416
56443
  calculateSheetFromula: calculateSheetFromula,
56444
+ updateFunctionGroup: updateFunctionGroup,
56417
56445
  calculateSheetByCells: calculateSheetByCells,
56418
56446
  addSheet: addSheet$1,
56419
56447
  deleteSheet: deleteSheet$1,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "5.2.1",
3
+ "version": "5.2.3",
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.1",
16
+ "@leankylin-sheet/formula-parser": "5.2.3",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",