@leankylin-sheet/core 4.0.57 → 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/README.md CHANGED
@@ -1,19 +1,19 @@
1
- # @leankylin-sheet/core
2
-
3
- LeankylinSheet is a drop-in javascript spreadsheet library that provides rich features like Excel and Google Sheets
4
-
5
- See our repo [leankylin-sheet](http://114.55.85.79:19999/leankylin-front/leankylin-sheet) for more information.
6
-
7
- ## Install
8
-
9
- Using npm:
10
-
11
- ```bash
12
- $ npm install --save @leankylin-sheet/core
13
- ```
14
-
15
- or using yarn:
16
-
17
- ```bash
18
- $ yarn add @leankylin-sheet/core
19
- ```
1
+ # @leankylin-sheet/core
2
+
3
+ LeankylinSheet is a drop-in javascript spreadsheet library that provides rich features like Excel and Google Sheets
4
+
5
+ See our repo [leankylin-sheet](http://114.55.85.79:19999/leankylin-front/leankylin-sheet) for more information.
6
+
7
+ ## Install
8
+
9
+ Using npm:
10
+
11
+ ```bash
12
+ $ npm install --save @leankylin-sheet/core
13
+ ```
14
+
15
+ or using yarn:
16
+
17
+ ```bash
18
+ $ yarn add @leankylin-sheet/core
19
+ ```
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';
@@ -33798,13 +33798,13 @@ var make_ssf = function make_ssf(SSF) {
33798
33798
  return general_fmt_num_base;
33799
33799
  }();
33800
33800
  SSF._general_num = general_fmt_num;
33801
- /*
33802
- "General" rules:
33803
- - text is passed through ("@")
33804
- - booleans are rendered as TRUE/FALSE
33805
- - "up to 11 characters" displayed for numbers
33806
- - Default date format (code 14) used for Dates
33807
- TODO: technically the display depends on the width of the cell
33801
+ /*
33802
+ "General" rules:
33803
+ - text is passed through ("@")
33804
+ - booleans are rendered as TRUE/FALSE
33805
+ - "up to 11 characters" displayed for numbers
33806
+ - Default date format (code 14) used for Dates
33807
+ TODO: technically the display depends on the width of the cell
33808
33808
  */
33809
33809
  function general_fmt(v, opts) {
33810
33810
  switch (_typeof(v)) {
@@ -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) {
@@ -56222,6 +56240,7 @@ var index = /*#__PURE__*/Object.freeze({
56222
56240
  });
56223
56241
 
56224
56242
  var defaultSettings = {
56243
+ renderSubToolbar: undefined,
56225
56244
  headerBgColor: "#fff",
56226
56245
  toolbarRightRender: undefined,
56227
56246
  onClickContentEditable: undefined,
package/dist/index.js CHANGED
@@ -33808,13 +33808,13 @@ var make_ssf = function make_ssf(SSF) {
33808
33808
  return general_fmt_num_base;
33809
33809
  }();
33810
33810
  SSF._general_num = general_fmt_num;
33811
- /*
33812
- "General" rules:
33813
- - text is passed through ("@")
33814
- - booleans are rendered as TRUE/FALSE
33815
- - "up to 11 characters" displayed for numbers
33816
- - Default date format (code 14) used for Dates
33817
- TODO: technically the display depends on the width of the cell
33811
+ /*
33812
+ "General" rules:
33813
+ - text is passed through ("@")
33814
+ - booleans are rendered as TRUE/FALSE
33815
+ - "up to 11 characters" displayed for numbers
33816
+ - Default date format (code 14) used for Dates
33817
+ TODO: technically the display depends on the width of the cell
33818
33818
  */
33819
33819
  function general_fmt(v, opts) {
33820
33820
  switch (_typeof(v)) {
@@ -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) {
@@ -56232,6 +56250,7 @@ var index = /*#__PURE__*/Object.freeze({
56232
56250
  });
56233
56251
 
56234
56252
  var defaultSettings = {
56253
+ renderSubToolbar: undefined,
56235
56254
  headerBgColor: "#fff",
56236
56255
  toolbarRightRender: undefined,
56237
56256
  onClickContentEditable: undefined,
@@ -89,6 +89,7 @@ export type Hooks = {
89
89
  export type Settings = {
90
90
  headerBgColor?: string;
91
91
  toolbarRightRender?: any;
92
+ renderSubToolbar?: any;
92
93
  onClickContentEditable?: any;
93
94
  renderCustomColor?: any;
94
95
  renderFormulaHint?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "4.0.57",
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.57",
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",