@fileverse-dev/fortune-core 1.1.71 → 1.1.72

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,9 +504,6 @@ 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
- }
510
507
  var index = getSheetIndex(ctx, ctx.currentSheetId);
511
508
  var dataVerification = ctx.luckysheetfile[index].dataVerification;
512
509
  if (!_.isNil(dataVerification)) {
@@ -563,6 +560,10 @@ export function updateCell(ctx, r, c, $input, value, canvas) {
563
560
  }
564
561
  }
565
562
  value = value || ($input === null || $input === void 0 ? void 0 : $input.innerText);
563
+ var shouldClearError = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.f) ? oldValue.f !== value : (oldValue === null || oldValue === void 0 ? void 0 : oldValue.v) !== value;
564
+ if (shouldClearError) {
565
+ clearCellError(ctx, r, c);
566
+ }
566
567
  if (((_b = (_a = ctx.hooks).beforeUpdateCell) === null || _b === void 0 ? void 0 : _b.call(_a, r, c, value)) === false) {
567
568
  cancelNormalSelected(ctx);
568
569
  return;
@@ -537,9 +537,6 @@ 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
- }
543
540
  var index = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
544
541
  var dataVerification = ctx.luckysheetfile[index].dataVerification;
545
542
  if (!_lodash.default.isNil(dataVerification)) {
@@ -596,6 +593,10 @@ function updateCell(ctx, r, c, $input, value, canvas) {
596
593
  }
597
594
  }
598
595
  value = value || ($input === null || $input === void 0 ? void 0 : $input.innerText);
596
+ var shouldClearError = (oldValue === null || oldValue === void 0 ? void 0 : oldValue.f) ? oldValue.f !== value : (oldValue === null || oldValue === void 0 ? void 0 : oldValue.v) !== value;
597
+ if (shouldClearError) {
598
+ (0, _api.clearCellError)(ctx, r, c);
599
+ }
599
600
  if (((_b = (_a = ctx.hooks).beforeUpdateCell) === null || _b === void 0 ? void 0 : _b.call(_a, r, c, value)) === false) {
600
601
  cancelNormalSelected(ctx);
601
602
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.1.71",
3
+ "version": "1.1.72",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",