@fileverse-dev/fortune-core 1.2.68 → 1.2.69

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.
package/es/canvas.js CHANGED
@@ -1,3 +1,13 @@
1
+ var __assign = this && this.__assign || function () {
2
+ __assign = Object.assign || function (t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
6
+ }
7
+ return t;
8
+ };
9
+ return __assign.apply(this, arguments);
10
+ };
1
11
  import _ from "lodash";
2
12
  import { getFlowdata } from "./context";
3
13
  import { getRealCellValue, normalizedAttr } from "./modules/cell";
@@ -1136,6 +1146,26 @@ var Canvas = function () {
1136
1146
  renderCtx.rect(pos_x, pos_y, cellWidth, cellHeight);
1137
1147
  renderCtx.clip();
1138
1148
  renderCtx.scale(this.sheetCtx.zoomRatio, this.sheetCtx.zoomRatio);
1149
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.strikethrough) {
1150
+ cell = __assign(__assign({}, cell), {
1151
+ cl: 1
1152
+ });
1153
+ }
1154
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.italic) {
1155
+ cell = __assign(__assign({}, cell), {
1156
+ it: 1
1157
+ });
1158
+ }
1159
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.underline) {
1160
+ cell = __assign(__assign({}, cell), {
1161
+ un: 1
1162
+ });
1163
+ }
1164
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.bold) {
1165
+ cell = __assign(__assign({}, cell), {
1166
+ bl: 1
1167
+ });
1168
+ }
1139
1169
  var textInfo = cell ? getCellTextInfo(cell, renderCtx, this.sheetCtx, {
1140
1170
  cellWidth: cellWidth,
1141
1171
  cellHeight: cellHeight,
package/es/context.js CHANGED
@@ -163,6 +163,12 @@ export function defaultContext(refs) {
163
163
  check: true,
164
164
  color: "#000000"
165
165
  },
166
+ font: {
167
+ bold: false,
168
+ italic: false,
169
+ underline: false,
170
+ strikethrough: false
171
+ },
166
172
  betweenValue: {
167
173
  value1: "",
168
174
  value2: ""
@@ -12,7 +12,8 @@ var localeObj = {
12
12
  };
13
13
  function locale(ctx) {
14
14
  var _a;
15
- var langsToTry = [ctx.lang || "", ((_a = ctx.lang) === null || _a === void 0 ? void 0 : _a.split("-")[0]) || ""];
15
+ console.log(ctx === null || ctx === void 0 ? void 0 : ctx.lang);
16
+ var langsToTry = [(ctx === null || ctx === void 0 ? void 0 : ctx.lang) || "", ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.lang) === null || _a === void 0 ? void 0 : _a.split("-")[0]) || ""];
16
17
  for (var i = 0; i < langsToTry.length; i += 1) {
17
18
  if (langsToTry[i] in localeObj) {
18
19
  return localeObj[langsToTry[i]];
@@ -245,7 +245,11 @@ export function setConditionRules(ctx, protection, generalDialog, conditionforma
245
245
  cellrange: (_a = ctx.luckysheet_select_save) !== null && _a !== void 0 ? _a : [],
246
246
  format: {
247
247
  textColor: textColor,
248
- cellColor: cellColor
248
+ cellColor: cellColor,
249
+ bold: rules.font.bold,
250
+ italic: rules.font.italic,
251
+ underline: rules.font.underline,
252
+ strikethrough: rules.font.strikethrough
249
253
  },
250
254
  conditionName: conditionName,
251
255
  conditionRange: conditionRange,
@@ -546,7 +550,11 @@ export function compute(ctx, ruleArr, d) {
546
550
  var conditionValue0 = ruleArr[i].conditionValue[0];
547
551
  var conditionValue1 = ruleArr[i].conditionValue[1];
548
552
  var textColor_1 = format.textColor,
549
- cellColor_1 = format.cellColor;
553
+ cellColor_1 = format.cellColor,
554
+ bold_1 = format.bold,
555
+ italic_1 = format.italic,
556
+ underline_1 = format.underline,
557
+ strikethrough_1 = format.strikethrough;
550
558
  for (var s = 0; s < cellrange.length; s += 1) {
551
559
  if (conditionName === "greaterThan" || conditionName === "greaterThanOrEqual" || conditionName === "lessThan" || conditionName === "lessThanOrEqual" || conditionName === "equal" || conditionName === "textContains") {
552
560
  for (var r = cellrange[s].row[0]; r <= cellrange[s].row[1]; r += 1) {
@@ -562,60 +570,105 @@ export function compute(ctx, ruleArr, d) {
562
570
  if ("".concat(r, "_").concat(c) in computeMap) {
563
571
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
564
572
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
573
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
574
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
575
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
576
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
565
577
  } else {
566
578
  computeMap["".concat(r, "_").concat(c)] = {
567
579
  textColor: textColor_1,
568
- cellColor: cellColor_1
580
+ cellColor: cellColor_1,
581
+ bold: bold_1,
582
+ italic: italic_1,
583
+ underline: underline_1,
584
+ strikethrough: strikethrough_1
569
585
  };
570
586
  }
571
587
  } else if (conditionName === "greaterThanOrEqual" && compareGreaterThan(cell.v, conditionValue0, ">=")) {
572
588
  if ("".concat(r, "_").concat(c) in computeMap) {
573
589
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
574
590
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
591
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
592
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
593
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
594
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
575
595
  } else {
576
596
  computeMap["".concat(r, "_").concat(c)] = {
577
597
  textColor: textColor_1,
578
- cellColor: cellColor_1
598
+ cellColor: cellColor_1,
599
+ bold: bold_1
579
600
  };
580
601
  }
581
602
  } else if (conditionName === "lessThan" && compareLessThan(cell.v, conditionValue0, "<")) {
582
603
  if ("".concat(r, "_").concat(c) in computeMap) {
583
604
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
584
605
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
606
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
607
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
608
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
609
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
585
610
  } else {
586
611
  computeMap["".concat(r, "_").concat(c)] = {
587
612
  textColor: textColor_1,
588
- cellColor: cellColor_1
613
+ cellColor: cellColor_1,
614
+ bold: bold_1,
615
+ italic: italic_1,
616
+ underline: underline_1,
617
+ strikethrough: strikethrough_1
589
618
  };
590
619
  }
591
620
  } else if (conditionName === "lessThanOrEqual" && compareLessThan(cell.v, conditionValue0, "<=")) {
592
621
  if ("".concat(r, "_").concat(c) in computeMap) {
593
622
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
594
623
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
624
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
625
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
626
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
627
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
595
628
  } else {
596
629
  computeMap["".concat(r, "_").concat(c)] = {
597
630
  textColor: textColor_1,
598
- cellColor: cellColor_1
631
+ cellColor: cellColor_1,
632
+ bold: bold_1,
633
+ italic: italic_1,
634
+ underline: underline_1,
635
+ strikethrough: strikethrough_1
599
636
  };
600
637
  }
601
638
  } else if (conditionName === "equal" && cell.v.toString() === conditionValue0) {
602
639
  if ("".concat(r, "_").concat(c) in computeMap) {
603
640
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
604
641
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
642
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
643
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
644
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
645
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
605
646
  } else {
606
647
  computeMap["".concat(r, "_").concat(c)] = {
607
648
  textColor: textColor_1,
608
- cellColor: cellColor_1
649
+ cellColor: cellColor_1,
650
+ bold: bold_1,
651
+ italic: italic_1,
652
+ underline: underline_1,
653
+ strikethrough: strikethrough_1
609
654
  };
610
655
  }
611
656
  } else if (conditionName === "textContains" && cell.v.toString().indexOf(conditionValue0) !== -1) {
612
657
  if ("".concat(r, "_").concat(c) in computeMap) {
613
658
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
614
659
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
660
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
661
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
662
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
663
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
615
664
  } else {
616
665
  computeMap["".concat(r, "_").concat(c)] = {
617
666
  textColor: textColor_1,
618
- cellColor: cellColor_1
667
+ cellColor: cellColor_1,
668
+ bold: bold_1,
669
+ italic: italic_1,
670
+ underline: underline_1,
671
+ strikethrough: strikethrough_1
619
672
  };
620
673
  }
621
674
  }
@@ -635,10 +688,18 @@ export function compute(ctx, ruleArr, d) {
635
688
  if ("".concat(r, "_").concat(c) in computeMap) {
636
689
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
637
690
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
691
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
692
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
693
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
694
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
638
695
  } else {
639
696
  computeMap["".concat(r, "_").concat(c)] = {
640
697
  textColor: textColor_1,
641
- cellColor: cellColor_1
698
+ cellColor: cellColor_1,
699
+ bold: bold_1,
700
+ italic: italic_1,
701
+ underline: underline_1,
702
+ strikethrough: strikethrough_1
642
703
  };
643
704
  }
644
705
  }
@@ -666,10 +727,18 @@ export function compute(ctx, ruleArr, d) {
666
727
  if ("".concat(r, "_").concat(c) in computeMap) {
667
728
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
668
729
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
730
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
731
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
732
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
733
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
669
734
  } else {
670
735
  computeMap["".concat(r, "_").concat(c)] = {
671
736
  textColor: textColor_1,
672
- cellColor: cellColor_1
737
+ cellColor: cellColor_1,
738
+ bold: bold_1,
739
+ italic: italic_1,
740
+ underline: underline_1,
741
+ strikethrough: strikethrough_1
673
742
  };
674
743
  }
675
744
  }
@@ -688,6 +757,9 @@ export function compute(ctx, ruleArr, d) {
688
757
  r: r,
689
758
  c: c
690
759
  });
760
+ computeMap["".concat(r, "_").concat(c)] = __assign(__assign({}, computeMap["".concat(r, "_").concat(c)]), {
761
+ bold: bold_1
762
+ });
691
763
  }
692
764
  }
693
765
  if (conditionValue0 === "0") {
@@ -697,10 +769,18 @@ export function compute(ctx, ruleArr, d) {
697
769
  if ("".concat(x[j].r, "_").concat(x[j].c) in computeMap) {
698
770
  computeMap["".concat(x[j].r, "_").concat(x[j].c)].textColor = textColor_1;
699
771
  computeMap["".concat(x[j].r, "_").concat(x[j].c)].cellColor = cellColor_1;
772
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].bold = bold_1;
773
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].italic = italic_1;
774
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].underline = underline_1;
775
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].strikethrough = strikethrough_1;
700
776
  } else {
701
777
  computeMap["".concat(x[j].r, "_").concat(x[j].c)] = {
702
778
  textColor: textColor_1,
703
- cellColor: cellColor_1
779
+ cellColor: cellColor_1,
780
+ bold: bold_1,
781
+ italic: italic_1,
782
+ underline: underline_1,
783
+ strikethrough: strikethrough_1
704
784
  };
705
785
  }
706
786
  }
@@ -712,10 +792,18 @@ export function compute(ctx, ruleArr, d) {
712
792
  if ("".concat(x[0].r, "_").concat(x[0].c) in computeMap) {
713
793
  computeMap["".concat(x[0].r, "_").concat(x[0].c)].textColor = textColor_1;
714
794
  computeMap["".concat(x[0].r, "_").concat(x[0].c)].cellColor = cellColor_1;
795
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].bold = bold_1;
796
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].italic = italic_1;
797
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].underline = underline_1;
798
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].strikethrough = strikethrough_1;
715
799
  } else {
716
800
  computeMap["".concat(x[0].r, "_").concat(x[0].c)] = {
717
801
  textColor: textColor_1,
718
- cellColor: cellColor_1
802
+ cellColor: cellColor_1,
803
+ bold: bold_1,
804
+ italic: italic_1,
805
+ underline: underline_1,
806
+ strikethrough: strikethrough_1
719
807
  };
720
808
  }
721
809
  }
@@ -763,10 +851,18 @@ export function compute(ctx, ruleArr, d) {
763
851
  if ("".concat(r, "_").concat(c) in computeMap) {
764
852
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
765
853
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
854
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
855
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
856
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
857
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
766
858
  } else {
767
859
  computeMap["".concat(r, "_").concat(c)] = {
768
860
  textColor: textColor_1,
769
- cellColor: cellColor_1
861
+ cellColor: cellColor_1,
862
+ bold: bold_1,
863
+ italic: italic_1,
864
+ underline: underline_1,
865
+ strikethrough: strikethrough_1
770
866
  };
771
867
  }
772
868
  }
@@ -789,10 +885,18 @@ export function compute(ctx, ruleArr, d) {
789
885
  if ("".concat(r, "_").concat(c) in computeMap) {
790
886
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
791
887
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
888
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
889
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
890
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
891
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
792
892
  } else {
793
893
  computeMap["".concat(r, "_").concat(c)] = {
794
894
  textColor: textColor_1,
795
- cellColor: cellColor_1
895
+ cellColor: cellColor_1,
896
+ bold: bold_1,
897
+ italic: italic_1,
898
+ underline: underline_1,
899
+ strikethrough: strikethrough_1
796
900
  };
797
901
  }
798
902
  }
@@ -809,10 +913,18 @@ export function compute(ctx, ruleArr, d) {
809
913
  if ("".concat(r, "_").concat(c) in computeMap) {
810
914
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
811
915
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
916
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
917
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
918
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
919
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
812
920
  } else {
813
921
  computeMap["".concat(r, "_").concat(c)] = {
814
922
  textColor: textColor_1,
815
- cellColor: cellColor_1
923
+ cellColor: cellColor_1,
924
+ bold: bold_1,
925
+ italic: italic_1,
926
+ underline: underline_1,
927
+ strikethrough: strikethrough_1
816
928
  };
817
929
  }
818
930
  }
@@ -851,10 +963,18 @@ export function compute(ctx, ruleArr, d) {
851
963
  if ("".concat(r, "_").concat(c) in computeMap) {
852
964
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
853
965
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
966
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
967
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
968
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
969
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
854
970
  } else {
855
971
  computeMap["".concat(r, "_").concat(c)] = {
856
972
  textColor: textColor_1,
857
- cellColor: cellColor_1
973
+ cellColor: cellColor_1,
974
+ bold: bold_1,
975
+ italic: italic_1,
976
+ underline: underline_1,
977
+ strikethrough: strikethrough_1
858
978
  };
859
979
  }
860
980
  }
package/es/types.d.ts CHANGED
@@ -144,6 +144,12 @@ export type ConditionRulesProps = {
144
144
  check: boolean;
145
145
  color: string;
146
146
  };
147
+ font: {
148
+ bold: boolean;
149
+ italic: boolean;
150
+ underline: boolean;
151
+ strikethrough: boolean;
152
+ };
147
153
  betweenValue: {
148
154
  value1: string;
149
155
  value2: string;
package/lib/canvas.js CHANGED
@@ -15,6 +15,16 @@ var _border = require("./modules/border");
15
15
  var _modules = require("./modules");
16
16
  var _animate = require("./animate");
17
17
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
+ var __assign = void 0 && (void 0).__assign || function () {
19
+ __assign = Object.assign || function (t) {
20
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
21
+ s = arguments[i];
22
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
23
+ }
24
+ return t;
25
+ };
26
+ return __assign.apply(this, arguments);
27
+ };
18
28
  var defaultStyle = exports.defaultStyle = {
19
29
  fillStyle: "#000000",
20
30
  textBaseline: "middle",
@@ -1143,6 +1153,26 @@ var Canvas = exports.Canvas = function () {
1143
1153
  renderCtx.rect(pos_x, pos_y, cellWidth, cellHeight);
1144
1154
  renderCtx.clip();
1145
1155
  renderCtx.scale(this.sheetCtx.zoomRatio, this.sheetCtx.zoomRatio);
1156
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.strikethrough) {
1157
+ cell = __assign(__assign({}, cell), {
1158
+ cl: 1
1159
+ });
1160
+ }
1161
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.italic) {
1162
+ cell = __assign(__assign({}, cell), {
1163
+ it: 1
1164
+ });
1165
+ }
1166
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.underline) {
1167
+ cell = __assign(__assign({}, cell), {
1168
+ un: 1
1169
+ });
1170
+ }
1171
+ if (checksCF === null || checksCF === void 0 ? void 0 : checksCF.bold) {
1172
+ cell = __assign(__assign({}, cell), {
1173
+ bl: 1
1174
+ });
1175
+ }
1146
1176
  var textInfo = cell ? (0, _text.getCellTextInfo)(cell, renderCtx, this.sheetCtx, {
1147
1177
  cellWidth: cellWidth,
1148
1178
  cellHeight: cellHeight,
package/lib/context.js CHANGED
@@ -175,6 +175,12 @@ function defaultContext(refs) {
175
175
  check: true,
176
176
  color: "#000000"
177
177
  },
178
+ font: {
179
+ bold: false,
180
+ italic: false,
181
+ underline: false,
182
+ strikethrough: false
183
+ },
178
184
  betweenValue: {
179
185
  value1: "",
180
186
  value2: ""
@@ -19,7 +19,8 @@ var localeObj = {
19
19
  };
20
20
  function locale(ctx) {
21
21
  var _a;
22
- var langsToTry = [ctx.lang || "", ((_a = ctx.lang) === null || _a === void 0 ? void 0 : _a.split("-")[0]) || ""];
22
+ console.log(ctx === null || ctx === void 0 ? void 0 : ctx.lang);
23
+ var langsToTry = [(ctx === null || ctx === void 0 ? void 0 : ctx.lang) || "", ((_a = ctx === null || ctx === void 0 ? void 0 : ctx.lang) === null || _a === void 0 ? void 0 : _a.split("-")[0]) || ""];
23
24
  for (var i = 0; i < langsToTry.length; i += 1) {
24
25
  if (langsToTry[i] in localeObj) {
25
26
  return localeObj[langsToTry[i]];
@@ -260,7 +260,11 @@ function setConditionRules(ctx, protection, generalDialog, conditionformat, rule
260
260
  cellrange: (_a = ctx.luckysheet_select_save) !== null && _a !== void 0 ? _a : [],
261
261
  format: {
262
262
  textColor: textColor,
263
- cellColor: cellColor
263
+ cellColor: cellColor,
264
+ bold: rules.font.bold,
265
+ italic: rules.font.italic,
266
+ underline: rules.font.underline,
267
+ strikethrough: rules.font.strikethrough
264
268
  },
265
269
  conditionName: conditionName,
266
270
  conditionRange: conditionRange,
@@ -561,7 +565,11 @@ function compute(ctx, ruleArr, d) {
561
565
  var conditionValue0 = ruleArr[i].conditionValue[0];
562
566
  var conditionValue1 = ruleArr[i].conditionValue[1];
563
567
  var textColor_1 = format.textColor,
564
- cellColor_1 = format.cellColor;
568
+ cellColor_1 = format.cellColor,
569
+ bold_1 = format.bold,
570
+ italic_1 = format.italic,
571
+ underline_1 = format.underline,
572
+ strikethrough_1 = format.strikethrough;
565
573
  for (var s = 0; s < cellrange.length; s += 1) {
566
574
  if (conditionName === "greaterThan" || conditionName === "greaterThanOrEqual" || conditionName === "lessThan" || conditionName === "lessThanOrEqual" || conditionName === "equal" || conditionName === "textContains") {
567
575
  for (var r = cellrange[s].row[0]; r <= cellrange[s].row[1]; r += 1) {
@@ -577,60 +585,105 @@ function compute(ctx, ruleArr, d) {
577
585
  if ("".concat(r, "_").concat(c) in computeMap) {
578
586
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
579
587
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
588
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
589
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
590
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
591
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
580
592
  } else {
581
593
  computeMap["".concat(r, "_").concat(c)] = {
582
594
  textColor: textColor_1,
583
- cellColor: cellColor_1
595
+ cellColor: cellColor_1,
596
+ bold: bold_1,
597
+ italic: italic_1,
598
+ underline: underline_1,
599
+ strikethrough: strikethrough_1
584
600
  };
585
601
  }
586
602
  } else if (conditionName === "greaterThanOrEqual" && compareGreaterThan(cell.v, conditionValue0, ">=")) {
587
603
  if ("".concat(r, "_").concat(c) in computeMap) {
588
604
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
589
605
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
606
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
607
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
608
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
609
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
590
610
  } else {
591
611
  computeMap["".concat(r, "_").concat(c)] = {
592
612
  textColor: textColor_1,
593
- cellColor: cellColor_1
613
+ cellColor: cellColor_1,
614
+ bold: bold_1
594
615
  };
595
616
  }
596
617
  } else if (conditionName === "lessThan" && compareLessThan(cell.v, conditionValue0, "<")) {
597
618
  if ("".concat(r, "_").concat(c) in computeMap) {
598
619
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
599
620
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
621
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
622
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
623
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
624
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
600
625
  } else {
601
626
  computeMap["".concat(r, "_").concat(c)] = {
602
627
  textColor: textColor_1,
603
- cellColor: cellColor_1
628
+ cellColor: cellColor_1,
629
+ bold: bold_1,
630
+ italic: italic_1,
631
+ underline: underline_1,
632
+ strikethrough: strikethrough_1
604
633
  };
605
634
  }
606
635
  } else if (conditionName === "lessThanOrEqual" && compareLessThan(cell.v, conditionValue0, "<=")) {
607
636
  if ("".concat(r, "_").concat(c) in computeMap) {
608
637
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
609
638
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
639
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
640
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
641
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
642
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
610
643
  } else {
611
644
  computeMap["".concat(r, "_").concat(c)] = {
612
645
  textColor: textColor_1,
613
- cellColor: cellColor_1
646
+ cellColor: cellColor_1,
647
+ bold: bold_1,
648
+ italic: italic_1,
649
+ underline: underline_1,
650
+ strikethrough: strikethrough_1
614
651
  };
615
652
  }
616
653
  } else if (conditionName === "equal" && cell.v.toString() === conditionValue0) {
617
654
  if ("".concat(r, "_").concat(c) in computeMap) {
618
655
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
619
656
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
657
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
658
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
659
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
660
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
620
661
  } else {
621
662
  computeMap["".concat(r, "_").concat(c)] = {
622
663
  textColor: textColor_1,
623
- cellColor: cellColor_1
664
+ cellColor: cellColor_1,
665
+ bold: bold_1,
666
+ italic: italic_1,
667
+ underline: underline_1,
668
+ strikethrough: strikethrough_1
624
669
  };
625
670
  }
626
671
  } else if (conditionName === "textContains" && cell.v.toString().indexOf(conditionValue0) !== -1) {
627
672
  if ("".concat(r, "_").concat(c) in computeMap) {
628
673
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
629
674
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
675
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
676
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
677
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
678
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
630
679
  } else {
631
680
  computeMap["".concat(r, "_").concat(c)] = {
632
681
  textColor: textColor_1,
633
- cellColor: cellColor_1
682
+ cellColor: cellColor_1,
683
+ bold: bold_1,
684
+ italic: italic_1,
685
+ underline: underline_1,
686
+ strikethrough: strikethrough_1
634
687
  };
635
688
  }
636
689
  }
@@ -650,10 +703,18 @@ function compute(ctx, ruleArr, d) {
650
703
  if ("".concat(r, "_").concat(c) in computeMap) {
651
704
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
652
705
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
706
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
707
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
708
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
709
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
653
710
  } else {
654
711
  computeMap["".concat(r, "_").concat(c)] = {
655
712
  textColor: textColor_1,
656
- cellColor: cellColor_1
713
+ cellColor: cellColor_1,
714
+ bold: bold_1,
715
+ italic: italic_1,
716
+ underline: underline_1,
717
+ strikethrough: strikethrough_1
657
718
  };
658
719
  }
659
720
  }
@@ -681,10 +742,18 @@ function compute(ctx, ruleArr, d) {
681
742
  if ("".concat(r, "_").concat(c) in computeMap) {
682
743
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
683
744
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
745
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
746
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
747
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
748
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
684
749
  } else {
685
750
  computeMap["".concat(r, "_").concat(c)] = {
686
751
  textColor: textColor_1,
687
- cellColor: cellColor_1
752
+ cellColor: cellColor_1,
753
+ bold: bold_1,
754
+ italic: italic_1,
755
+ underline: underline_1,
756
+ strikethrough: strikethrough_1
688
757
  };
689
758
  }
690
759
  }
@@ -703,6 +772,9 @@ function compute(ctx, ruleArr, d) {
703
772
  r: r,
704
773
  c: c
705
774
  });
775
+ computeMap["".concat(r, "_").concat(c)] = __assign(__assign({}, computeMap["".concat(r, "_").concat(c)]), {
776
+ bold: bold_1
777
+ });
706
778
  }
707
779
  }
708
780
  if (conditionValue0 === "0") {
@@ -712,10 +784,18 @@ function compute(ctx, ruleArr, d) {
712
784
  if ("".concat(x[j].r, "_").concat(x[j].c) in computeMap) {
713
785
  computeMap["".concat(x[j].r, "_").concat(x[j].c)].textColor = textColor_1;
714
786
  computeMap["".concat(x[j].r, "_").concat(x[j].c)].cellColor = cellColor_1;
787
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].bold = bold_1;
788
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].italic = italic_1;
789
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].underline = underline_1;
790
+ computeMap["".concat(x[j].r, "_").concat(x[j].c)].strikethrough = strikethrough_1;
715
791
  } else {
716
792
  computeMap["".concat(x[j].r, "_").concat(x[j].c)] = {
717
793
  textColor: textColor_1,
718
- cellColor: cellColor_1
794
+ cellColor: cellColor_1,
795
+ bold: bold_1,
796
+ italic: italic_1,
797
+ underline: underline_1,
798
+ strikethrough: strikethrough_1
719
799
  };
720
800
  }
721
801
  }
@@ -727,10 +807,18 @@ function compute(ctx, ruleArr, d) {
727
807
  if ("".concat(x[0].r, "_").concat(x[0].c) in computeMap) {
728
808
  computeMap["".concat(x[0].r, "_").concat(x[0].c)].textColor = textColor_1;
729
809
  computeMap["".concat(x[0].r, "_").concat(x[0].c)].cellColor = cellColor_1;
810
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].bold = bold_1;
811
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].italic = italic_1;
812
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].underline = underline_1;
813
+ computeMap["".concat(x[0].r, "_").concat(x[0].c)].strikethrough = strikethrough_1;
730
814
  } else {
731
815
  computeMap["".concat(x[0].r, "_").concat(x[0].c)] = {
732
816
  textColor: textColor_1,
733
- cellColor: cellColor_1
817
+ cellColor: cellColor_1,
818
+ bold: bold_1,
819
+ italic: italic_1,
820
+ underline: underline_1,
821
+ strikethrough: strikethrough_1
734
822
  };
735
823
  }
736
824
  }
@@ -778,10 +866,18 @@ function compute(ctx, ruleArr, d) {
778
866
  if ("".concat(r, "_").concat(c) in computeMap) {
779
867
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
780
868
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
869
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
870
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
871
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
872
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
781
873
  } else {
782
874
  computeMap["".concat(r, "_").concat(c)] = {
783
875
  textColor: textColor_1,
784
- cellColor: cellColor_1
876
+ cellColor: cellColor_1,
877
+ bold: bold_1,
878
+ italic: italic_1,
879
+ underline: underline_1,
880
+ strikethrough: strikethrough_1
785
881
  };
786
882
  }
787
883
  }
@@ -804,10 +900,18 @@ function compute(ctx, ruleArr, d) {
804
900
  if ("".concat(r, "_").concat(c) in computeMap) {
805
901
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
806
902
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
903
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
904
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
905
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
906
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
807
907
  } else {
808
908
  computeMap["".concat(r, "_").concat(c)] = {
809
909
  textColor: textColor_1,
810
- cellColor: cellColor_1
910
+ cellColor: cellColor_1,
911
+ bold: bold_1,
912
+ italic: italic_1,
913
+ underline: underline_1,
914
+ strikethrough: strikethrough_1
811
915
  };
812
916
  }
813
917
  }
@@ -824,10 +928,18 @@ function compute(ctx, ruleArr, d) {
824
928
  if ("".concat(r, "_").concat(c) in computeMap) {
825
929
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
826
930
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
931
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
932
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
933
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
934
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
827
935
  } else {
828
936
  computeMap["".concat(r, "_").concat(c)] = {
829
937
  textColor: textColor_1,
830
- cellColor: cellColor_1
938
+ cellColor: cellColor_1,
939
+ bold: bold_1,
940
+ italic: italic_1,
941
+ underline: underline_1,
942
+ strikethrough: strikethrough_1
831
943
  };
832
944
  }
833
945
  }
@@ -866,10 +978,18 @@ function compute(ctx, ruleArr, d) {
866
978
  if ("".concat(r, "_").concat(c) in computeMap) {
867
979
  computeMap["".concat(r, "_").concat(c)].textColor = textColor_1;
868
980
  computeMap["".concat(r, "_").concat(c)].cellColor = cellColor_1;
981
+ computeMap["".concat(r, "_").concat(c)].bold = bold_1;
982
+ computeMap["".concat(r, "_").concat(c)].italic = italic_1;
983
+ computeMap["".concat(r, "_").concat(c)].underline = underline_1;
984
+ computeMap["".concat(r, "_").concat(c)].strikethrough = strikethrough_1;
869
985
  } else {
870
986
  computeMap["".concat(r, "_").concat(c)] = {
871
987
  textColor: textColor_1,
872
- cellColor: cellColor_1
988
+ cellColor: cellColor_1,
989
+ bold: bold_1,
990
+ italic: italic_1,
991
+ underline: underline_1,
992
+ strikethrough: strikethrough_1
873
993
  };
874
994
  }
875
995
  }
package/lib/types.d.ts CHANGED
@@ -144,6 +144,12 @@ export type ConditionRulesProps = {
144
144
  check: boolean;
145
145
  color: string;
146
146
  };
147
+ font: {
148
+ bold: boolean;
149
+ italic: boolean;
150
+ underline: boolean;
151
+ strikethrough: boolean;
152
+ };
147
153
  betweenValue: {
148
154
  value1: string;
149
155
  value2: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fileverse-dev/fortune-core",
3
- "version": "1.2.68",
3
+ "version": "1.2.69",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.js",
6
6
  "typings": "lib/index.d.ts",