@leankylin-sheet/core 4.0.46 → 4.0.48

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
@@ -37660,6 +37660,7 @@ function functionCopy(ctx, txt, mode, step) {
37660
37660
  txt = txt.substring(1);
37661
37661
  }
37662
37662
  var funcstack = txt.split("");
37663
+ console.log("funcstack", funcstack);
37663
37664
  var i = 0;
37664
37665
  var str = "";
37665
37666
  var function_str = "";
@@ -37669,20 +37670,26 @@ function functionCopy(ctx, txt, mode, step) {
37669
37670
  squote: 0,
37670
37671
  dquote: 0
37671
37672
  };
37672
- while (i < funcstack.length) {
37673
+ var _loop3 = function _loop3() {
37673
37674
  var s = funcstack[i];
37674
37675
  var nextS = funcstack[i + 1];
37675
37676
  if (s === "{" && nextS === "{") {
37677
+ var hasCell = false;
37676
37678
  var nextI = funcstack === null || funcstack === void 0 ? void 0 : funcstack.findIndex(function (__, index) {
37679
+ if (i < index && funcstack[index - 1] === "!") {
37680
+ hasCell = true;
37681
+ return true;
37682
+ }
37677
37683
  if (i < index && funcstack[index] === "}" && funcstack[index + 1] === "}") {
37678
37684
  return true;
37679
37685
  }
37680
37686
  return false;
37681
37687
  });
37682
37688
  if (nextI !== -1) {
37683
- function_str += txt.substring(i, nextI + 2);
37684
- i = nextI + 2;
37685
- continue;
37689
+ var nestPositionI = hasCell ? nextI : nextI + 2;
37690
+ function_str += txt.substring(i, nestPositionI);
37691
+ i = nestPositionI;
37692
+ return 1; // continue
37686
37693
  }
37687
37694
  }
37688
37695
  if (s === "(" && matchConfig.dquote === 0) {
@@ -37747,6 +37754,9 @@ function functionCopy(ctx, txt, mode, step) {
37747
37754
  function_str += s;
37748
37755
  }
37749
37756
  }
37757
+ } else if (s === "}") {
37758
+ function_str += "".concat(functionCopy(ctx, str, mode, step), "}");
37759
+ str = "";
37750
37760
  } else {
37751
37761
  str += s;
37752
37762
  }
@@ -37766,6 +37776,9 @@ function functionCopy(ctx, txt, mode, step) {
37766
37776
  }
37767
37777
  }
37768
37778
  i += 1;
37779
+ };
37780
+ while (i < funcstack.length) {
37781
+ if (_loop3()) continue;
37769
37782
  }
37770
37783
  return function_str;
37771
37784
  }
package/dist/index.js CHANGED
@@ -37670,6 +37670,7 @@ function functionCopy(ctx, txt, mode, step) {
37670
37670
  txt = txt.substring(1);
37671
37671
  }
37672
37672
  var funcstack = txt.split("");
37673
+ console.log("funcstack", funcstack);
37673
37674
  var i = 0;
37674
37675
  var str = "";
37675
37676
  var function_str = "";
@@ -37679,20 +37680,26 @@ function functionCopy(ctx, txt, mode, step) {
37679
37680
  squote: 0,
37680
37681
  dquote: 0
37681
37682
  };
37682
- while (i < funcstack.length) {
37683
+ var _loop3 = function _loop3() {
37683
37684
  var s = funcstack[i];
37684
37685
  var nextS = funcstack[i + 1];
37685
37686
  if (s === "{" && nextS === "{") {
37687
+ var hasCell = false;
37686
37688
  var nextI = funcstack === null || funcstack === void 0 ? void 0 : funcstack.findIndex(function (__, index) {
37689
+ if (i < index && funcstack[index - 1] === "!") {
37690
+ hasCell = true;
37691
+ return true;
37692
+ }
37687
37693
  if (i < index && funcstack[index] === "}" && funcstack[index + 1] === "}") {
37688
37694
  return true;
37689
37695
  }
37690
37696
  return false;
37691
37697
  });
37692
37698
  if (nextI !== -1) {
37693
- function_str += txt.substring(i, nextI + 2);
37694
- i = nextI + 2;
37695
- continue;
37699
+ var nestPositionI = hasCell ? nextI : nextI + 2;
37700
+ function_str += txt.substring(i, nestPositionI);
37701
+ i = nestPositionI;
37702
+ return 1; // continue
37696
37703
  }
37697
37704
  }
37698
37705
  if (s === "(" && matchConfig.dquote === 0) {
@@ -37757,6 +37764,9 @@ function functionCopy(ctx, txt, mode, step) {
37757
37764
  function_str += s;
37758
37765
  }
37759
37766
  }
37767
+ } else if (s === "}") {
37768
+ function_str += "".concat(functionCopy(ctx, str, mode, step), "}");
37769
+ str = "";
37760
37770
  } else {
37761
37771
  str += s;
37762
37772
  }
@@ -37776,6 +37786,9 @@ function functionCopy(ctx, txt, mode, step) {
37776
37786
  }
37777
37787
  }
37778
37788
  i += 1;
37789
+ };
37790
+ while (i < funcstack.length) {
37791
+ if (_loop3()) continue;
37779
37792
  }
37780
37793
  return function_str;
37781
37794
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leankylin-sheet/core",
3
- "version": "4.0.46",
3
+ "version": "4.0.48",
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.46",
16
+ "@leankylin-sheet/formula-parser": "4.0.48",
17
17
  "dayjs": "^1.11.0",
18
18
  "immer": "^9.0.12",
19
19
  "lodash": "^4.17.21",