@fileverse-dev/fortune-core 1.1.68 → 1.1.70

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.
@@ -504,6 +504,9 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
504
504
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
505
505
  var flowdata = getFlowdata(ctx);
506
506
  if (!flowdata) return;
507
+ if (!(value === null || value === void 0 ? void 0 : value.toString())) {
508
+ clearCellError(ctx, r, c);
509
+ }
507
510
  var index = getSheetIndex(ctx, ctx.currentSheetId);
508
511
  var dataVerification = ctx.luckysheetfile[index].dataVerification;
509
512
  if (!_.isNil(dataVerification)) {
@@ -23,7 +23,7 @@ import _ from "lodash";
23
23
  import { getFlowdata } from "../context";
24
24
  import { columnCharToIndex, escapeScriptTag, getSheetIndex, indexToColumnChar, getSheetIdByName, escapeHTMLTag } from "../utils";
25
25
  import { getcellFormula, getRangetxt, mergeMoveMain, setCellValue } from "./cell";
26
- import { customErrorMessage, error, detectErrorFromValue } from "./validation";
26
+ import { error, detectErrorFromValue } from "./validation";
27
27
  import { locale } from "../locale";
28
28
  import { colors } from "./color";
29
29
  import { colLocation, mousePosition, rowLocation } from "./location";
@@ -740,7 +740,7 @@ export function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notIns
740
740
  } else {
741
741
  clearCellError(ctx, r, c);
742
742
  }
743
- return [true, !isError ? finalResult : customErrorMessage(formulaError), txt];
743
+ return [true, !isError ? finalResult : "#ERROR", txt];
744
744
  }
745
745
  function insertUpdateDynamicArray(ctx, dynamicArrayItem) {
746
746
  var r = dynamicArrayItem.r,
@@ -11,7 +11,6 @@ export declare const error: {
11
11
  };
12
12
  export declare const errorMessagesFromValue: Record<string, string>;
13
13
  export declare function detectErrorFromValue(input: string): string;
14
- export declare function customErrorMessage(errorMessage: string): string;
15
14
  export declare function valueIsError(value: string): boolean;
16
15
  export declare function isRealNull(val: any): boolean;
17
16
  export declare function isHexValue(str: string): boolean;
@@ -1,7 +1,7 @@
1
1
  var _a;
2
2
  import dayjs from "dayjs";
3
3
  import _ from "lodash";
4
- import { error as cellErrorMessages, ERROR_NAME, ERROR_DIV_ZERO, ERROR_NULL, ERROR_NUM, ERROR_REF, ERROR_VALUE, ERROR } from "@fileverse-dev/formula-parser";
4
+ import { ERROR_NAME, ERROR_DIV_ZERO, ERROR_NULL, ERROR_NUM, ERROR_REF, ERROR_VALUE, ERROR } from "@fileverse-dev/formula-parser";
5
5
  import { hasChinaword } from "./text";
6
6
  export var error = {
7
7
  v: "#VALUE!",
@@ -17,12 +17,6 @@ export var errorMessagesFromValue = (_a = {}, _a[ERROR_DIV_ZERO] = "Invalid calc
17
17
  export function detectErrorFromValue(input) {
18
18
  return errorMessagesFromValue[input];
19
19
  }
20
- export function customErrorMessage(errorMessage) {
21
- if (errorMessage === cellErrorMessages(ERROR_NAME)) {
22
- return "#ERROR";
23
- }
24
- return errorMessage;
25
- }
26
20
  var errorValues = Object.values(error);
27
21
  export function valueIsError(value) {
28
22
  return errorValues.includes(value);
@@ -537,6 +537,9 @@ function updateCell(ctx, r, c, $input, value, canvas) {
537
537
  var inputHtml = $input === null || $input === void 0 ? void 0 : $input.innerHTML;
538
538
  var flowdata = (0, _context.getFlowdata)(ctx);
539
539
  if (!flowdata) return;
540
+ if (!(value === null || value === void 0 ? void 0 : value.toString())) {
541
+ (0, _api.clearCellError)(ctx, r, c);
542
+ }
540
543
  var index = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
541
544
  var dataVerification = ctx.luckysheetfile[index].dataVerification;
542
545
  if (!_lodash.default.isNil(dataVerification)) {
@@ -770,7 +770,7 @@ function execfunction(ctx, txt, r, c, id, calcChainSet, isrefresh, notInsertFunc
770
770
  } else {
771
771
  (0, _2.clearCellError)(ctx, r, c);
772
772
  }
773
- return [true, !isError ? finalResult : (0, _validation.customErrorMessage)(formulaError), txt];
773
+ return [true, !isError ? finalResult : "#ERROR", txt];
774
774
  }
775
775
  function insertUpdateDynamicArray(ctx, dynamicArrayItem) {
776
776
  var r = dynamicArrayItem.r,
@@ -11,7 +11,6 @@ export declare const error: {
11
11
  };
12
12
  export declare const errorMessagesFromValue: Record<string, string>;
13
13
  export declare function detectErrorFromValue(input: string): string;
14
- export declare function customErrorMessage(errorMessage: string): string;
15
14
  export declare function valueIsError(value: string): boolean;
16
15
  export declare function isRealNull(val: any): boolean;
17
16
  export declare function isHexValue(str: string): boolean;
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.customErrorMessage = customErrorMessage;
7
6
  exports.detectErrorFromValue = detectErrorFromValue;
8
7
  exports.diff = diff;
9
8
  exports.errorMessagesFromValue = exports.error = void 0;
@@ -35,12 +34,6 @@ var errorMessagesFromValue = exports.errorMessagesFromValue = (_a = {}, _a[_form
35
34
  function detectErrorFromValue(input) {
36
35
  return errorMessagesFromValue[input];
37
36
  }
38
- function customErrorMessage(errorMessage) {
39
- if (errorMessage === (0, _formulaParser.error)(_formulaParser.ERROR_NAME)) {
40
- return "#ERROR";
41
- }
42
- return errorMessage;
43
- }
44
37
  var errorValues = Object.values(error);
45
38
  function valueIsError(value) {
46
39
  return errorValues.includes(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.68",
3
+ "version": "1.1.70",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",