@fileverse-dev/fortune-core 1.0.85 → 1.0.86

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.
@@ -476,7 +476,7 @@ export function cancelNormalSelected(ctx) {
476
476
  ctx.formulaCache.rangedrag_row_start = false;
477
477
  }
478
478
  export function updateCell(ctx, r, c, $input, value, canvas) {
479
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
479
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
480
480
  var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
481
481
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
482
482
  var flowdata = getFlowdata(ctx);
@@ -617,10 +617,10 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
617
617
  curv.v = value;
618
618
  delete curv.f;
619
619
  delete curv.spl;
620
- var decemialCount_1 = ((_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _f === void 0 ? void 0 : _f.toString().includes(".")) ? (_g = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _g === void 0 ? void 0 : _g.toString().split(" ")[0].split(".")[1].length : 0;
621
- var coin_1 = (_h = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _h === void 0 ? void 0 : _h.toString().split(" ")[1];
620
+ var decemialCount_1 = ((_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _f === void 0 ? void 0 : _f.toString().includes(".")) ? (_h = (_g = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _g === void 0 ? void 0 : _g.toString().split(" ")[0].split(".")[1]) === null || _h === void 0 ? void 0 : _h.length : 0;
621
+ var coin_1 = (_j = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _j === void 0 ? void 0 : _j.toString().split(" ")[1];
622
622
  if (_typeof(curv) === "object" && (curv === null || curv === void 0 ? void 0 : curv.baseValue)) {
623
- curv.m = "".concat((parseFloat(value) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount_1), " ").concat(coin_1);
623
+ curv.m = "".concat((parseFloat(value) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount_1 || 2), " ").concat(coin_1);
624
624
  curv.baseValue = value;
625
625
  }
626
626
  execFunctionGroup(ctx, r, c, curv);
@@ -681,10 +681,10 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
681
681
  isRunExecFunction = false;
682
682
  }
683
683
  }
684
- var decemialCount = ((_j = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _j === void 0 ? void 0 : _j.toString().includes(".")) ? (_k = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _k === void 0 ? void 0 : _k.toString().split(" ")[0].split(".")[1].length : 0;
685
- var coin = (_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().split(" ")[1];
684
+ var decemialCount = ((_k = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _k === void 0 ? void 0 : _k.toString().includes(".")) ? (_m = (_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().split(" ")[0].split(".")[1]) === null || _m === void 0 ? void 0 : _m.length : 0;
685
+ var coin = (_o = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _o === void 0 ? void 0 : _o.toString().split(" ")[1];
686
686
  if (_typeof(value) === "object" && value.baseValue && !(value === null || value === void 0 ? void 0 : value.m)) {
687
- value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount), " ").concat(coin);
687
+ value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount || 2), " ").concat(coin);
688
688
  }
689
689
  if (typeof value === "string") {
690
690
  value = {
@@ -703,8 +703,8 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
703
703
  if ((curv === null || curv === void 0 ? void 0 : curv.tb) === "2" && curv.v || isInlineStringCell(d[r][c])) {
704
704
  var defaultrowlen = ctx.defaultrowlen;
705
705
  var cfg = ctx.luckysheetfile[getSheetIndex(ctx, ctx.currentSheetId)].config || {};
706
- if (!(((_m = cfg.columnlen) === null || _m === void 0 ? void 0 : _m[c]) && ((_o = cfg.rowlen) === null || _o === void 0 ? void 0 : _o[r]))) {
707
- var cellWidth = ((_p = cfg.columnlen) === null || _p === void 0 ? void 0 : _p[c]) || ctx.defaultcollen;
706
+ if (!(((_p = cfg.columnlen) === null || _p === void 0 ? void 0 : _p[c]) && ((_q = cfg.rowlen) === null || _q === void 0 ? void 0 : _q[r]))) {
707
+ var cellWidth = ((_r = cfg.columnlen) === null || _r === void 0 ? void 0 : _r[c]) || ctx.defaultcollen;
708
708
  var textInfo = canvas ? getCellTextInfo(d[r][c], canvas, ctx, {
709
709
  r: r,
710
710
  c: c,
@@ -715,7 +715,7 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
715
715
  currentRowLen = textInfo.textHeightAll + 2;
716
716
  }
717
717
  var previousRowHeight = getRowHeight(ctx, [r])[r];
718
- if (currentRowLen > defaultrowlen && !((_q = cfg.customHeight) === null || _q === void 0 ? void 0 : _q[r]) && previousRowHeight < currentRowLen) {
718
+ if (currentRowLen > defaultrowlen && !((_s = cfg.customHeight) === null || _s === void 0 ? void 0 : _s[r]) && previousRowHeight < currentRowLen) {
719
719
  if (_.isNil(cfg.rowlen)) cfg.rowlen = {};
720
720
  cfg.rowlen[r] = currentRowLen;
721
721
  }
@@ -70,7 +70,7 @@ var FormulaCache = function () {
70
70
  done(v);
71
71
  });
72
72
  this.parser.on("callRangeValue", function (startCellCoord, endCellCoord, options, done) {
73
- var _a, _b, _c, _d, _e, _f, _g;
73
+ var _a, _b, _c, _d, _e, _f, _g, _h;
74
74
  var context = that.parser.context;
75
75
  var id = startCellCoord.sheetName == null ? options.sheetId : getSheetIdByName(context, startCellCoord.sheetName);
76
76
  if (id == null) throw Error(ERROR_REF);
@@ -108,7 +108,7 @@ var FormulaCache = function () {
108
108
  } else {
109
109
  cryptoDenomination = visualString[1];
110
110
  }
111
- cryptoDecimal = visualString[0].includes(".") ? visualString[0].split(".")[1].length : 0;
111
+ cryptoDecimal = visualString[0].includes(".") ? (_h = visualString[0].split(".")[1]) === null || _h === void 0 ? void 0 : _h.length : 0;
112
112
  }
113
113
  colFragment.push(v);
114
114
  }
@@ -506,7 +506,7 @@ function cancelNormalSelected(ctx) {
506
506
  ctx.formulaCache.rangedrag_row_start = false;
507
507
  }
508
508
  function updateCell(ctx, r, c, $input, value, canvas) {
509
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
509
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
510
510
  var inputText = $input === null || $input === void 0 ? void 0 : $input.innerText;
511
511
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
512
512
  var flowdata = (0, _context.getFlowdata)(ctx);
@@ -647,10 +647,10 @@ function updateCell(ctx, r, c, $input, value, canvas) {
647
647
  curv.v = value;
648
648
  delete curv.f;
649
649
  delete curv.spl;
650
- var decemialCount_1 = ((_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _f === void 0 ? void 0 : _f.toString().includes(".")) ? (_g = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _g === void 0 ? void 0 : _g.toString().split(" ")[0].split(".")[1].length : 0;
651
- var coin_1 = (_h = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _h === void 0 ? void 0 : _h.toString().split(" ")[1];
650
+ var decemialCount_1 = ((_f = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _f === void 0 ? void 0 : _f.toString().includes(".")) ? (_h = (_g = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _g === void 0 ? void 0 : _g.toString().split(" ")[0].split(".")[1]) === null || _h === void 0 ? void 0 : _h.length : 0;
651
+ var coin_1 = (_j = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _j === void 0 ? void 0 : _j.toString().split(" ")[1];
652
652
  if (_typeof(curv) === "object" && (curv === null || curv === void 0 ? void 0 : curv.baseValue)) {
653
- curv.m = "".concat((parseFloat(value) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount_1), " ").concat(coin_1);
653
+ curv.m = "".concat((parseFloat(value) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount_1 || 2), " ").concat(coin_1);
654
654
  curv.baseValue = value;
655
655
  }
656
656
  (0, _formula.execFunctionGroup)(ctx, r, c, curv);
@@ -711,10 +711,10 @@ function updateCell(ctx, r, c, $input, value, canvas) {
711
711
  isRunExecFunction = false;
712
712
  }
713
713
  }
714
- var decemialCount = ((_j = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _j === void 0 ? void 0 : _j.toString().includes(".")) ? (_k = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _k === void 0 ? void 0 : _k.toString().split(" ")[0].split(".")[1].length : 0;
715
- var coin = (_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().split(" ")[1];
714
+ var decemialCount = ((_k = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _k === void 0 ? void 0 : _k.toString().includes(".")) ? (_m = (_l = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _l === void 0 ? void 0 : _l.toString().split(" ")[0].split(".")[1]) === null || _m === void 0 ? void 0 : _m.length : 0;
715
+ var coin = (_o = oldValue === null || oldValue === void 0 ? void 0 : oldValue.m) === null || _o === void 0 ? void 0 : _o.toString().split(" ")[1];
716
716
  if (_typeof(value) === "object" && value.baseValue && !(value === null || value === void 0 ? void 0 : value.m)) {
717
- value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount), " ").concat(coin);
717
+ value.m = "".concat((parseFloat(value === null || value === void 0 ? void 0 : value.v) / (oldValue === null || oldValue === void 0 ? void 0 : oldValue.baseCurrencyPrice)).toFixed(decemialCount || 2), " ").concat(coin);
718
718
  }
719
719
  if (typeof value === "string") {
720
720
  value = {
@@ -733,8 +733,8 @@ function updateCell(ctx, r, c, $input, value, canvas) {
733
733
  if ((curv === null || curv === void 0 ? void 0 : curv.tb) === "2" && curv.v || (0, _inlineString.isInlineStringCell)(d[r][c])) {
734
734
  var defaultrowlen = ctx.defaultrowlen;
735
735
  var cfg = ctx.luckysheetfile[(0, _utils.getSheetIndex)(ctx, ctx.currentSheetId)].config || {};
736
- if (!(((_m = cfg.columnlen) === null || _m === void 0 ? void 0 : _m[c]) && ((_o = cfg.rowlen) === null || _o === void 0 ? void 0 : _o[r]))) {
737
- var cellWidth = ((_p = cfg.columnlen) === null || _p === void 0 ? void 0 : _p[c]) || ctx.defaultcollen;
736
+ if (!(((_p = cfg.columnlen) === null || _p === void 0 ? void 0 : _p[c]) && ((_q = cfg.rowlen) === null || _q === void 0 ? void 0 : _q[r]))) {
737
+ var cellWidth = ((_r = cfg.columnlen) === null || _r === void 0 ? void 0 : _r[c]) || ctx.defaultcollen;
738
738
  var textInfo = canvas ? (0, _text.getCellTextInfo)(d[r][c], canvas, ctx, {
739
739
  r: r,
740
740
  c: c,
@@ -745,7 +745,7 @@ function updateCell(ctx, r, c, $input, value, canvas) {
745
745
  currentRowLen = textInfo.textHeightAll + 2;
746
746
  }
747
747
  var previousRowHeight = (0, _api.getRowHeight)(ctx, [r])[r];
748
- if (currentRowLen > defaultrowlen && !((_q = cfg.customHeight) === null || _q === void 0 ? void 0 : _q[r]) && previousRowHeight < currentRowLen) {
748
+ if (currentRowLen > defaultrowlen && !((_s = cfg.customHeight) === null || _s === void 0 ? void 0 : _s[r]) && previousRowHeight < currentRowLen) {
749
749
  if (_lodash.default.isNil(cfg.rowlen)) cfg.rowlen = {};
750
750
  cfg.rowlen[r] = currentRowLen;
751
751
  }
@@ -100,7 +100,7 @@ var FormulaCache = exports.FormulaCache = function () {
100
100
  done(v);
101
101
  });
102
102
  this.parser.on("callRangeValue", function (startCellCoord, endCellCoord, options, done) {
103
- var _a, _b, _c, _d, _e, _f, _g;
103
+ var _a, _b, _c, _d, _e, _f, _g, _h;
104
104
  var context = that.parser.context;
105
105
  var id = startCellCoord.sheetName == null ? options.sheetId : (0, _utils.getSheetIdByName)(context, startCellCoord.sheetName);
106
106
  if (id == null) throw Error(_formulaParser.ERROR_REF);
@@ -138,7 +138,7 @@ var FormulaCache = exports.FormulaCache = function () {
138
138
  } else {
139
139
  cryptoDenomination = visualString[1];
140
140
  }
141
- cryptoDecimal = visualString[0].includes(".") ? visualString[0].split(".")[1].length : 0;
141
+ cryptoDecimal = visualString[0].includes(".") ? (_h = visualString[0].split(".")[1]) === null || _h === void 0 ? void 0 : _h.length : 0;
142
142
  }
143
143
  colFragment.push(v);
144
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.0.85",
3
+ "version": "1.0.86",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",