@fileverse-dev/fortune-core 1.2.75 → 1.2.77-patch-1

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.
@@ -1004,32 +1004,34 @@ export function compute(ctx, ruleArr, d) {
1004
1004
  return computeMap;
1005
1005
  }
1006
1006
  export function getComputeMap(ctx) {
1007
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1007
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1008
1008
  var index = getSheetIndex(ctx, ctx.currentSheetId);
1009
1009
  var ruleArr = ((_a = ctx.luckysheetfile[index]) === null || _a === void 0 ? void 0 : _a.luckysheet_conditionformat_save) ? __spreadArray([], (_b = ctx.luckysheetfile[index]) === null || _b === void 0 ? void 0 : _b.luckysheet_conditionformat_save, true) : [];
1010
1010
  var data = ctx.luckysheetfile[index].data;
1011
1011
  if (_.isNil(data)) return null;
1012
- if (ctx.luckysheet_select_save && ((_c = ctx.luckysheetfile[index].conditionRules) === null || _c === void 0 ? void 0 : _c.rulesValue) !== "") {
1013
- var editKey = (_d = ctx.luckysheetfile[index].conditionRules) === null || _d === void 0 ? void 0 : _d.editKey;
1014
- if (editKey !== null) {
1012
+ var editKey = (_c = ctx.luckysheetfile[index].conditionRules) === null || _c === void 0 ? void 0 : _c.editKey;
1013
+ console.log("before", editKey, ruleArr);
1014
+ if (ctx.luckysheet_select_save) {
1015
+ if (editKey !== null && editKey !== undefined) {
1015
1016
  ruleArr.splice(Number(editKey), 1);
1016
1017
  }
1017
1018
  ruleArr.push({
1018
1019
  type: "default",
1019
1020
  cellrange: ctx.luckysheet_select_save,
1020
1021
  format: {
1021
- textColor: (_e = ctx.luckysheetfile[index].conditionRules) === null || _e === void 0 ? void 0 : _e.textColor.color,
1022
- cellColor: (_f = ctx.luckysheetfile[index].conditionRules) === null || _f === void 0 ? void 0 : _f.cellColor.color,
1023
- bold: (_g = ctx.luckysheetfile[index].conditionRules) === null || _g === void 0 ? void 0 : _g.font.bold,
1024
- italic: (_h = ctx.luckysheetfile[index].conditionRules) === null || _h === void 0 ? void 0 : _h.font.italic,
1025
- underline: (_j = ctx.luckysheetfile[index].conditionRules) === null || _j === void 0 ? void 0 : _j.font.underline,
1026
- strikethrough: (_k = ctx.luckysheetfile[index].conditionRules) === null || _k === void 0 ? void 0 : _k.font.strikethrough
1022
+ textColor: (_d = ctx.luckysheetfile[index].conditionRules) === null || _d === void 0 ? void 0 : _d.textColor.color,
1023
+ cellColor: (_e = ctx.luckysheetfile[index].conditionRules) === null || _e === void 0 ? void 0 : _e.cellColor.color,
1024
+ bold: (_f = ctx.luckysheetfile[index].conditionRules) === null || _f === void 0 ? void 0 : _f.font.bold,
1025
+ italic: (_g = ctx.luckysheetfile[index].conditionRules) === null || _g === void 0 ? void 0 : _g.font.italic,
1026
+ underline: (_h = ctx.luckysheetfile[index].conditionRules) === null || _h === void 0 ? void 0 : _h.font.underline,
1027
+ strikethrough: (_j = ctx.luckysheetfile[index].conditionRules) === null || _j === void 0 ? void 0 : _j.font.strikethrough
1027
1028
  },
1028
- conditionName: (_l = ctx.luckysheetfile[index].conditionRules) === null || _l === void 0 ? void 0 : _l.rulesType,
1029
+ conditionName: (_k = ctx.luckysheetfile[index].conditionRules) === null || _k === void 0 ? void 0 : _k.rulesType,
1029
1030
  conditionRange: [],
1030
- conditionValue: [(_m = ctx.luckysheetfile[index].conditionRules) === null || _m === void 0 ? void 0 : _m.rulesValue]
1031
+ conditionValue: [(_l = ctx.luckysheetfile[index].conditionRules) === null || _l === void 0 ? void 0 : _l.rulesValue]
1031
1032
  });
1032
1033
  }
1034
+ console.log("after", editKey, ruleArr);
1033
1035
  var computeMap = compute(ctx, ruleArr, data);
1034
1036
  return computeMap;
1035
1037
  }
@@ -1019,32 +1019,34 @@ function compute(ctx, ruleArr, d) {
1019
1019
  return computeMap;
1020
1020
  }
1021
1021
  function getComputeMap(ctx) {
1022
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
1022
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
1023
1023
  var index = (0, _utils.getSheetIndex)(ctx, ctx.currentSheetId);
1024
1024
  var ruleArr = ((_a = ctx.luckysheetfile[index]) === null || _a === void 0 ? void 0 : _a.luckysheet_conditionformat_save) ? __spreadArray([], (_b = ctx.luckysheetfile[index]) === null || _b === void 0 ? void 0 : _b.luckysheet_conditionformat_save, true) : [];
1025
1025
  var data = ctx.luckysheetfile[index].data;
1026
1026
  if (_lodash.default.isNil(data)) return null;
1027
- if (ctx.luckysheet_select_save && ((_c = ctx.luckysheetfile[index].conditionRules) === null || _c === void 0 ? void 0 : _c.rulesValue) !== "") {
1028
- var editKey = (_d = ctx.luckysheetfile[index].conditionRules) === null || _d === void 0 ? void 0 : _d.editKey;
1029
- if (editKey !== null) {
1027
+ var editKey = (_c = ctx.luckysheetfile[index].conditionRules) === null || _c === void 0 ? void 0 : _c.editKey;
1028
+ console.log("before", editKey, ruleArr);
1029
+ if (ctx.luckysheet_select_save) {
1030
+ if (editKey !== null && editKey !== undefined) {
1030
1031
  ruleArr.splice(Number(editKey), 1);
1031
1032
  }
1032
1033
  ruleArr.push({
1033
1034
  type: "default",
1034
1035
  cellrange: ctx.luckysheet_select_save,
1035
1036
  format: {
1036
- textColor: (_e = ctx.luckysheetfile[index].conditionRules) === null || _e === void 0 ? void 0 : _e.textColor.color,
1037
- cellColor: (_f = ctx.luckysheetfile[index].conditionRules) === null || _f === void 0 ? void 0 : _f.cellColor.color,
1038
- bold: (_g = ctx.luckysheetfile[index].conditionRules) === null || _g === void 0 ? void 0 : _g.font.bold,
1039
- italic: (_h = ctx.luckysheetfile[index].conditionRules) === null || _h === void 0 ? void 0 : _h.font.italic,
1040
- underline: (_j = ctx.luckysheetfile[index].conditionRules) === null || _j === void 0 ? void 0 : _j.font.underline,
1041
- strikethrough: (_k = ctx.luckysheetfile[index].conditionRules) === null || _k === void 0 ? void 0 : _k.font.strikethrough
1037
+ textColor: (_d = ctx.luckysheetfile[index].conditionRules) === null || _d === void 0 ? void 0 : _d.textColor.color,
1038
+ cellColor: (_e = ctx.luckysheetfile[index].conditionRules) === null || _e === void 0 ? void 0 : _e.cellColor.color,
1039
+ bold: (_f = ctx.luckysheetfile[index].conditionRules) === null || _f === void 0 ? void 0 : _f.font.bold,
1040
+ italic: (_g = ctx.luckysheetfile[index].conditionRules) === null || _g === void 0 ? void 0 : _g.font.italic,
1041
+ underline: (_h = ctx.luckysheetfile[index].conditionRules) === null || _h === void 0 ? void 0 : _h.font.underline,
1042
+ strikethrough: (_j = ctx.luckysheetfile[index].conditionRules) === null || _j === void 0 ? void 0 : _j.font.strikethrough
1042
1043
  },
1043
- conditionName: (_l = ctx.luckysheetfile[index].conditionRules) === null || _l === void 0 ? void 0 : _l.rulesType,
1044
+ conditionName: (_k = ctx.luckysheetfile[index].conditionRules) === null || _k === void 0 ? void 0 : _k.rulesType,
1044
1045
  conditionRange: [],
1045
- conditionValue: [(_m = ctx.luckysheetfile[index].conditionRules) === null || _m === void 0 ? void 0 : _m.rulesValue]
1046
+ conditionValue: [(_l = ctx.luckysheetfile[index].conditionRules) === null || _l === void 0 ? void 0 : _l.rulesValue]
1046
1047
  });
1047
1048
  }
1049
+ console.log("after", editKey, ruleArr);
1048
1050
  var computeMap = compute(ctx, ruleArr, data);
1049
1051
  return computeMap;
1050
1052
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.2.75",
3
+ "version": "1.2.77-patch-1",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -15,7 +15,7 @@
15
15
  "dev": "father-build --watch"
16
16
  },
17
17
  "dependencies": {
18
- "@fileverse-dev/formula-parser": "0.2.87",
18
+ "@fileverse-dev/formula-parser": "0.2.88",
19
19
  "dayjs": "^1.11.0",
20
20
  "immer": "^9.0.12",
21
21
  "lodash": "^4.17.21",