@fileverse-dev/fortune-core 1.1.66-error-1 → 1.1.66-error-2

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.
@@ -5,7 +5,7 @@ import { getSheetIndex, indexToColumnChar, rgbToHex, processArray, getContentInP
5
5
  import { checkCF, getComputeMap } from "./ConditionFormat";
6
6
  import { getFailureText, validateCellData } from "./dataVerification";
7
7
  import { genarate, update } from "./format";
8
- import { getRowHeight } from "../api";
8
+ import { clearCellError, getRowHeight } from "../api";
9
9
  import { delFunctionGroup, execfunction, execFunctionGroup, functionHTMLGenerate, getcellrange, iscelldata } from "./formula";
10
10
  import { attrToCssName, convertSpanToShareString, isInlineStringCell, isInlineStringCT } from "./inline-string";
11
11
  import { isRealNull, isRealNum, valueIsError } from "./validation";
@@ -633,8 +633,10 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
633
633
  Object.keys(value).forEach(function (attr) {
634
634
  curv[attr] = value[attr];
635
635
  });
636
+ clearCellError(ctx, r, c);
636
637
  }
637
638
  } else {
639
+ clearCellError(ctx, r, c);
638
640
  delFunctionGroup(ctx, r, c);
639
641
  curv = _.cloneDeep(((_e = d === null || d === void 0 ? void 0 : d[r]) === null || _e === void 0 ? void 0 : _e[c]) || {});
640
642
  curv.v = value;
@@ -708,12 +710,14 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
708
710
  dynamicArrayItem = v[3].data;
709
711
  }
710
712
  } else {
713
+ clearCellError(ctx, r, c);
711
714
  var v = curv;
712
715
  if (_.isNil(value.v)) {
713
716
  value.v = v;
714
717
  }
715
718
  }
716
719
  } else {
720
+ clearCellError(ctx, r, c);
717
721
  delFunctionGroup(ctx, r, c);
718
722
  execFunctionGroup(ctx, r, c, value);
719
723
  isRunExecFunction = false;
@@ -15,7 +15,7 @@ import { colLocation, rowLocation } from "./location";
15
15
  import { mergeBorder } from "./cell";
16
16
  export function overShowError(ctx, e, scrollX, scrollY, container) {
17
17
  var _a, _b, _c;
18
- var _d, _e, _f, _g;
18
+ var _d, _e, _f, _g, _h;
19
19
  var flowdata = getFlowdata(ctx);
20
20
  if (!flowdata) return;
21
21
  var scrollLeft = scrollX.scrollLeft;
@@ -30,8 +30,15 @@ export function overShowError(ctx, e, scrollX, scrollY, container) {
30
30
  _a = merge.row, r = _a[2];
31
31
  _b = merge.column, c = _b[2];
32
32
  }
33
+ var firstSelection = (_d = ctx.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[0];
34
+ var row_focus = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
35
+ var col_focus = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
36
+ if (r === row_focus && c === col_focus) {
37
+ ctx.hoverErrorBox = undefined;
38
+ return;
39
+ }
33
40
  var row_column = "".concat(r, "_").concat(c);
34
- var cell = (_d = flowdata[r]) === null || _d === void 0 ? void 0 : _d[c];
41
+ var cell = (_e = flowdata[r]) === null || _e === void 0 ? void 0 : _e[c];
35
42
  var err = cell === null || cell === void 0 ? void 0 : cell.error;
36
43
  var errorAlreadyListed = Array.isArray(ctx.errorBoxes) ? _.findIndex(ctx.errorBoxes, function (v) {
37
44
  return v.row_column === row_column;
@@ -40,7 +47,7 @@ export function overShowError(ctx, e, scrollX, scrollY, container) {
40
47
  ctx.hoverErrorBox = undefined;
41
48
  return;
42
49
  }
43
- if (((_e = ctx.hoverErrorBox) === null || _e === void 0 ? void 0 : _e.row_column) === row_column) return;
50
+ if (((_f = ctx.hoverErrorBox) === null || _f === void 0 ? void 0 : _f.row_column) === row_column) return;
44
51
  var rowTop = r - 1 === -1 ? 0 : ctx.visibledatarow[r - 1];
45
52
  var colLeft = ctx.visibledatacolumn[c];
46
53
  if (merge) {
@@ -57,8 +64,8 @@ export function overShowError(ctx, e, scrollX, scrollY, container) {
57
64
  row_column: row_column,
58
65
  left: left,
59
66
  top: top,
60
- title: ((_f = cell.error) === null || _f === void 0 ? void 0 : _f.title) || "Error",
61
- message: ((_g = cell.error) === null || _g === void 0 ? void 0 : _g.message) || "Default error message"
67
+ title: ((_g = cell.error) === null || _g === void 0 ? void 0 : _g.title) || "Error",
68
+ message: ((_h = cell.error) === null || _h === void 0 ? void 0 : _h.message) || "Default error message"
62
69
  };
63
70
  }
64
71
  export function setCellError(ctx, r, c, err) {
@@ -663,8 +663,10 @@ function updateCell(ctx, r, c, $input, value, canvas) {
663
663
  Object.keys(value).forEach(function (attr) {
664
664
  curv[attr] = value[attr];
665
665
  });
666
+ (0, _api.clearCellError)(ctx, r, c);
666
667
  }
667
668
  } else {
669
+ (0, _api.clearCellError)(ctx, r, c);
668
670
  (0, _formula.delFunctionGroup)(ctx, r, c);
669
671
  curv = _lodash.default.cloneDeep(((_e = d === null || d === void 0 ? void 0 : d[r]) === null || _e === void 0 ? void 0 : _e[c]) || {});
670
672
  curv.v = value;
@@ -738,12 +740,14 @@ function updateCell(ctx, r, c, $input, value, canvas) {
738
740
  dynamicArrayItem = v[3].data;
739
741
  }
740
742
  } else {
743
+ (0, _api.clearCellError)(ctx, r, c);
741
744
  var v = curv;
742
745
  if (_lodash.default.isNil(value.v)) {
743
746
  value.v = v;
744
747
  }
745
748
  }
746
749
  } else {
750
+ (0, _api.clearCellError)(ctx, r, c);
747
751
  (0, _formula.delFunctionGroup)(ctx, r, c);
748
752
  (0, _formula.execFunctionGroup)(ctx, r, c, value);
749
753
  isRunExecFunction = false;
@@ -25,7 +25,7 @@ var __assign = void 0 && (void 0).__assign || function () {
25
25
  };
26
26
  function overShowError(ctx, e, scrollX, scrollY, container) {
27
27
  var _a, _b, _c;
28
- var _d, _e, _f, _g;
28
+ var _d, _e, _f, _g, _h;
29
29
  var flowdata = (0, _context.getFlowdata)(ctx);
30
30
  if (!flowdata) return;
31
31
  var scrollLeft = scrollX.scrollLeft;
@@ -40,8 +40,15 @@ function overShowError(ctx, e, scrollX, scrollY, container) {
40
40
  _a = merge.row, r = _a[2];
41
41
  _b = merge.column, c = _b[2];
42
42
  }
43
+ var firstSelection = (_d = ctx.luckysheet_select_save) === null || _d === void 0 ? void 0 : _d[0];
44
+ var row_focus = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.row_focus;
45
+ var col_focus = firstSelection === null || firstSelection === void 0 ? void 0 : firstSelection.column_focus;
46
+ if (r === row_focus && c === col_focus) {
47
+ ctx.hoverErrorBox = undefined;
48
+ return;
49
+ }
43
50
  var row_column = "".concat(r, "_").concat(c);
44
- var cell = (_d = flowdata[r]) === null || _d === void 0 ? void 0 : _d[c];
51
+ var cell = (_e = flowdata[r]) === null || _e === void 0 ? void 0 : _e[c];
45
52
  var err = cell === null || cell === void 0 ? void 0 : cell.error;
46
53
  var errorAlreadyListed = Array.isArray(ctx.errorBoxes) ? _lodash.default.findIndex(ctx.errorBoxes, function (v) {
47
54
  return v.row_column === row_column;
@@ -50,7 +57,7 @@ function overShowError(ctx, e, scrollX, scrollY, container) {
50
57
  ctx.hoverErrorBox = undefined;
51
58
  return;
52
59
  }
53
- if (((_e = ctx.hoverErrorBox) === null || _e === void 0 ? void 0 : _e.row_column) === row_column) return;
60
+ if (((_f = ctx.hoverErrorBox) === null || _f === void 0 ? void 0 : _f.row_column) === row_column) return;
54
61
  var rowTop = r - 1 === -1 ? 0 : ctx.visibledatarow[r - 1];
55
62
  var colLeft = ctx.visibledatacolumn[c];
56
63
  if (merge) {
@@ -67,8 +74,8 @@ function overShowError(ctx, e, scrollX, scrollY, container) {
67
74
  row_column: row_column,
68
75
  left: left,
69
76
  top: top,
70
- title: ((_f = cell.error) === null || _f === void 0 ? void 0 : _f.title) || "Error",
71
- message: ((_g = cell.error) === null || _g === void 0 ? void 0 : _g.message) || "Default error message"
77
+ title: ((_g = cell.error) === null || _g === void 0 ? void 0 : _g.title) || "Error",
78
+ message: ((_h = cell.error) === null || _h === void 0 ? void 0 : _h.message) || "Default error message"
72
79
  };
73
80
  }
74
81
  function setCellError(ctx, r, c, err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.66-error-1",
3
+ "version": "1.1.66-error-2",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",