@univerjs/sheets-conditional-formatting-ui 0.24.0 → 0.25.0-insiders.20260608-e4336f7

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.
Files changed (107) hide show
  1. package/lib/cjs/index.js +253 -228
  2. package/lib/cjs/locale/ar-SA.js +159 -0
  3. package/lib/cjs/locale/ca-ES.js +4 -3
  4. package/lib/cjs/locale/de-DE.js +159 -0
  5. package/lib/cjs/locale/en-US.js +4 -3
  6. package/lib/cjs/locale/es-ES.js +4 -3
  7. package/lib/cjs/locale/fa-IR.js +4 -3
  8. package/lib/cjs/locale/fr-FR.js +4 -3
  9. package/lib/cjs/locale/id-ID.js +159 -0
  10. package/lib/cjs/locale/it-IT.js +159 -0
  11. package/lib/cjs/locale/ja-JP.js +4 -3
  12. package/lib/cjs/locale/ko-KR.js +4 -3
  13. package/lib/cjs/locale/pl-PL.js +159 -0
  14. package/lib/cjs/locale/pt-BR.js +159 -0
  15. package/lib/cjs/locale/ru-RU.js +4 -3
  16. package/lib/cjs/locale/sk-SK.js +4 -3
  17. package/lib/cjs/locale/vi-VN.js +4 -3
  18. package/lib/cjs/locale/zh-CN.js +4 -3
  19. package/lib/cjs/locale/zh-HK.js +159 -0
  20. package/lib/cjs/locale/zh-TW.js +4 -3
  21. package/lib/es/index.js +255 -230
  22. package/lib/es/locale/ar-SA.js +158 -0
  23. package/lib/es/locale/ca-ES.js +4 -3
  24. package/lib/es/locale/de-DE.js +158 -0
  25. package/lib/es/locale/en-US.js +4 -3
  26. package/lib/es/locale/es-ES.js +4 -3
  27. package/lib/es/locale/fa-IR.js +4 -3
  28. package/lib/es/locale/fr-FR.js +4 -3
  29. package/lib/es/locale/id-ID.js +158 -0
  30. package/lib/es/locale/it-IT.js +158 -0
  31. package/lib/es/locale/ja-JP.js +4 -3
  32. package/lib/es/locale/ko-KR.js +4 -3
  33. package/lib/es/locale/pl-PL.js +158 -0
  34. package/lib/es/locale/pt-BR.js +158 -0
  35. package/lib/es/locale/ru-RU.js +4 -3
  36. package/lib/es/locale/sk-SK.js +4 -3
  37. package/lib/es/locale/vi-VN.js +4 -3
  38. package/lib/es/locale/zh-CN.js +4 -3
  39. package/lib/es/locale/zh-HK.js +158 -0
  40. package/lib/es/locale/zh-TW.js +4 -3
  41. package/lib/index.js +255 -230
  42. package/lib/locale/ar-SA.js +158 -0
  43. package/lib/locale/ca-ES.js +4 -3
  44. package/lib/locale/de-DE.js +158 -0
  45. package/lib/locale/en-US.js +4 -3
  46. package/lib/locale/es-ES.js +4 -3
  47. package/lib/locale/fa-IR.js +4 -3
  48. package/lib/locale/fr-FR.js +4 -3
  49. package/lib/locale/id-ID.js +158 -0
  50. package/lib/locale/it-IT.js +158 -0
  51. package/lib/locale/ja-JP.js +4 -3
  52. package/lib/locale/ko-KR.js +4 -3
  53. package/lib/locale/pl-PL.js +158 -0
  54. package/lib/locale/pt-BR.js +158 -0
  55. package/lib/locale/ru-RU.js +4 -3
  56. package/lib/locale/sk-SK.js +4 -3
  57. package/lib/locale/vi-VN.js +4 -3
  58. package/lib/locale/zh-CN.js +4 -3
  59. package/lib/locale/zh-HK.js +158 -0
  60. package/lib/locale/zh-TW.js +4 -3
  61. package/lib/types/components/color-picker/index.d.ts +1 -1
  62. package/lib/types/components/conditional-style-editor/index.d.ts +1 -1
  63. package/lib/types/components/panel/index.d.ts +1 -1
  64. package/lib/types/components/panel/rule-edit/ColorScale.d.ts +1 -1
  65. package/lib/types/components/panel/rule-edit/DataBar.d.ts +1 -1
  66. package/lib/types/components/panel/rule-edit/Formula.d.ts +1 -1
  67. package/lib/types/components/panel/rule-edit/HighlightCell.d.ts +1 -1
  68. package/lib/types/components/panel/rule-edit/IconSet.d.ts +1 -1
  69. package/lib/types/components/panel/rule-edit/Rank.d.ts +1 -1
  70. package/lib/types/components/panel/rule-edit/index.d.ts +1 -1
  71. package/lib/types/components/panel/rule-list/index.d.ts +1 -1
  72. package/lib/types/components/preview/index.d.ts +1 -1
  73. package/lib/types/components/wrapper-error/WrapperError.d.ts +1 -1
  74. package/lib/types/controllers/cf.auto-fill.controller.d.ts +3 -2
  75. package/lib/types/controllers/cf.clear.controller.d.ts +3 -3
  76. package/lib/types/controllers/cf.copy-paste.controller.d.ts +3 -2
  77. package/lib/types/controllers/cf.painter.controller.d.ts +3 -2
  78. package/lib/types/locale/ar-SA.d.ts +18 -0
  79. package/lib/types/locale/de-DE.d.ts +18 -0
  80. package/lib/types/locale/en-US.d.ts +130 -127
  81. package/lib/types/locale/id-ID.d.ts +18 -0
  82. package/lib/types/locale/it-IT.d.ts +18 -0
  83. package/lib/types/locale/pl-PL.d.ts +18 -0
  84. package/lib/types/locale/pt-BR.d.ts +18 -0
  85. package/lib/types/locale/zh-HK.d.ts +18 -0
  86. package/lib/umd/index.js +3 -3
  87. package/lib/umd/locale/ar-SA.js +1 -0
  88. package/lib/umd/locale/ca-ES.js +1 -1
  89. package/lib/umd/locale/de-DE.js +1 -0
  90. package/lib/umd/locale/en-US.js +1 -1
  91. package/lib/umd/locale/es-ES.js +1 -1
  92. package/lib/umd/locale/fa-IR.js +1 -1
  93. package/lib/umd/locale/fr-FR.js +1 -1
  94. package/lib/umd/locale/id-ID.js +1 -0
  95. package/lib/umd/locale/it-IT.js +1 -0
  96. package/lib/umd/locale/ja-JP.js +1 -1
  97. package/lib/umd/locale/ko-KR.js +1 -1
  98. package/lib/umd/locale/pl-PL.js +1 -0
  99. package/lib/umd/locale/pt-BR.js +1 -0
  100. package/lib/umd/locale/ru-RU.js +1 -1
  101. package/lib/umd/locale/sk-SK.js +1 -1
  102. package/lib/umd/locale/vi-VN.js +1 -1
  103. package/lib/umd/locale/zh-CN.js +1 -1
  104. package/lib/umd/locale/zh-HK.js +1 -0
  105. package/lib/umd/locale/zh-TW.js +1 -1
  106. package/package.json +15 -15
  107. package/LICENSE +0 -176
package/lib/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { BooleanNumber, ColorKit, CommandType, DependentOn, Disposable, DisposableCollection, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LocaleService, ObjectMatrix, Plugin, Range, Rectangle, Tools, UniverInstanceType, createInterceptorKey, generateRandomId, get, merge, registerDependencies, set, toDisposable, touchDependencies } from "@univerjs/core";
2
- import { AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AutoFillTools, ClearSelectionAllCommand, ClearSelectionFormatCommand, IAutoFillService, INTERCEPTOR_POINT, RangeMergeUtil, RangeProtectionPermissionEditPoint, RemoveSheetMutation, SetSelectionsOperation, SetWorksheetActiveOperation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, createTopMatrixFromMatrix, findAllRectangle, getSheetCommandTarget, rangeToDiscreteRange, setEndForRange } from "@univerjs/sheets";
3
- import { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, IIconSetType, MoveCfCommand, MoveConditionalRuleMutation, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, defaultDataBarNativeColor, defaultDataBarPositiveColor, getColorScaleFromValue, getOppositeOperator, iconGroup, iconMap, removeUndefinedAttr, setConditionalRuleMutationUndoFactory } from "@univerjs/sheets-conditional-formatting";
2
+ import { AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AutoFillTools, ClearSelectionAllCommand, ClearSelectionFormatCommand, IAutoFillService, INTERCEPTOR_POINT, RangeProtectionPermissionEditPoint, RemoveSheetMutation, SetSelectionsOperation, SetWorksheetActiveOperation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, getSheetCommandTarget, rangeToDiscreteRange, setEndForRange } from "@univerjs/sheets";
3
+ import { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRangeIndexModel, ConditionalFormattingRangeTransformService, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, IIconSetType, MoveCfCommand, MoveConditionalRuleMutation, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, defaultDataBarNativeColor, defaultDataBarPositiveColor, getColorScaleFromValue, getOppositeOperator, iconGroup, iconMap, removeUndefinedAttr, setConditionalRuleMutationUndoFactory } from "@univerjs/sheets-conditional-formatting";
4
4
  import { ComponentManager, ILayoutService, IMenuManagerService, ISidebarService, MenuItemType, RibbonDataGroup, getMenuHiddenObservable, useDependency, useObservable, useScrollYOverContainer, useSidebarClick } from "@univerjs/ui";
5
5
  import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
6
6
  import { Button, Checkbox, ColorPicker, DraggableList, Dropdown, Input, InputNumber, Radio, RadioGroup, Select, Tooltip, borderClassName, clsx } from "@univerjs/design";
@@ -467,7 +467,7 @@ const previewClassName = clsx("univer-mt-5 univer-px-1 univer-py-2 univer-rounde
467
467
  //#endregion
468
468
  //#region src/components/panel/rule-edit/ColorScale.tsx
469
469
  const createOptionItem$2 = (text, localeService) => ({
470
- label: localeService.t(`sheet.cf.valueType.${text}`),
470
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${text}`),
471
471
  value: text
472
472
  });
473
473
  const TextInput$1 = (props) => {
@@ -660,7 +660,7 @@ const ColorScaleStyleEditor = (props) => {
660
660
  return /* @__PURE__ */ jsxs("div", { children: [
661
661
  /* @__PURE__ */ jsx("div", {
662
662
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
663
- children: localeService.t("sheet.cf.panel.styleRule")
663
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
664
664
  }),
665
665
  /* @__PURE__ */ jsx("div", {
666
666
  className: previewClassName,
@@ -678,7 +678,7 @@ const ColorScaleStyleEditor = (props) => {
678
678
  }),
679
679
  /* @__PURE__ */ jsx("div", {
680
680
  className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
681
- children: localeService.t("sheet.cf.valueType.min")
681
+ children: localeService.t("sheets-conditional-formatting-ui.valueType.min")
682
682
  }),
683
683
  /* @__PURE__ */ jsxs("div", {
684
684
  className: "univer-mt-3 univer-flex univer-h-8 univer-items-center",
@@ -746,7 +746,7 @@ const ColorScaleStyleEditor = (props) => {
746
746
  }),
747
747
  /* @__PURE__ */ jsx("div", {
748
748
  className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
749
- children: localeService.t("sheet.cf.panel.medianValue")
749
+ children: localeService.t("sheets-conditional-formatting-ui.panel.medianValue")
750
750
  }),
751
751
  /* @__PURE__ */ jsxs("div", {
752
752
  className: "univer-mt-3 univer-flex univer-h-8 univer-items-center",
@@ -814,7 +814,7 @@ const ColorScaleStyleEditor = (props) => {
814
814
  }),
815
815
  /* @__PURE__ */ jsx("div", {
816
816
  className: "univer-mt-3 univer-text-xs univer-text-gray-600 dark:!univer-text-gray-200",
817
- children: localeService.t("sheet.cf.valueType.max")
817
+ children: localeService.t("sheets-conditional-formatting-ui.valueType.max")
818
818
  }),
819
819
  /* @__PURE__ */ jsxs("div", {
820
820
  className: "univer-mt-3 univer-flex univer-h-8 univer-items-center",
@@ -886,7 +886,7 @@ const ColorScaleStyleEditor = (props) => {
886
886
  //#endregion
887
887
  //#region src/components/panel/rule-edit/DataBar.tsx
888
888
  const createOptionItem$1 = (text, localeService) => ({
889
- label: localeService.t(`sheet.cf.valueType.${text}`),
889
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${text}`),
890
890
  value: text
891
891
  });
892
892
  const InputText = (props) => {
@@ -1080,7 +1080,7 @@ const DataBarStyleEditor = (props) => {
1080
1080
  return /* @__PURE__ */ jsxs("div", { children: [
1081
1081
  /* @__PURE__ */ jsx("div", {
1082
1082
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1083
- children: localeService.t("sheet.cf.panel.styleRule")
1083
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
1084
1084
  }),
1085
1085
  /* @__PURE__ */ jsx("div", {
1086
1086
  className: previewClassName,
@@ -1097,7 +1097,7 @@ const DataBarStyleEditor = (props) => {
1097
1097
  }),
1098
1098
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
1099
1099
  className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1100
- children: localeService.t("sheet.cf.panel.fillType")
1100
+ children: localeService.t("sheets-conditional-formatting-ui.panel.fillType")
1101
1101
  }), /* @__PURE__ */ jsxs("div", {
1102
1102
  className: "univer-ml-1 univer-mt-3 univer-flex univer-items-center",
1103
1103
  children: [/* @__PURE__ */ jsxs(RadioGroup, {
@@ -1119,13 +1119,13 @@ const DataBarStyleEditor = (props) => {
1119
1119
  value: "0",
1120
1120
  children: /* @__PURE__ */ jsx("span", {
1121
1121
  className: "univer-text-xs",
1122
- children: localeService.t("sheet.cf.panel.pureColor")
1122
+ children: localeService.t("sheets-conditional-formatting-ui.panel.pureColor")
1123
1123
  })
1124
1124
  }), /* @__PURE__ */ jsx(Radio, {
1125
1125
  value: "1",
1126
1126
  children: /* @__PURE__ */ jsx("span", {
1127
1127
  className: "univer-text-xs",
1128
- children: localeService.t("sheet.cf.panel.gradient")
1128
+ children: localeService.t("sheets-conditional-formatting-ui.panel.gradient")
1129
1129
  })
1130
1130
  })]
1131
1131
  }), /* @__PURE__ */ jsxs("div", {
@@ -1145,19 +1145,19 @@ const DataBarStyleEditor = (props) => {
1145
1145
  isShowValue: !v
1146
1146
  });
1147
1147
  }
1148
- }), localeService.t("sheet.cf.panel.onlyShowDataBar")]
1148
+ }), localeService.t("sheets-conditional-formatting-ui.panel.onlyShowDataBar")]
1149
1149
  })]
1150
1150
  })] }),
1151
1151
  /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("div", {
1152
1152
  className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1153
- children: localeService.t("sheet.cf.panel.colorSet")
1153
+ children: localeService.t("sheets-conditional-formatting-ui.panel.colorSet")
1154
1154
  }), /* @__PURE__ */ jsxs("div", {
1155
1155
  className: "univer-ml-1 univer-mt-3 univer-flex univer-items-center",
1156
1156
  children: [/* @__PURE__ */ jsxs("div", {
1157
1157
  className: "univer-flex univer-items-center",
1158
1158
  children: [/* @__PURE__ */ jsx("div", {
1159
1159
  className: "univer-text-xs",
1160
- children: localeService.t("sheet.cf.panel.native")
1160
+ children: localeService.t("sheets-conditional-formatting-ui.panel.native")
1161
1161
  }), /* @__PURE__ */ jsx(ColorPicker$1, {
1162
1162
  color: nativeColor,
1163
1163
  onChange: handleNativeColorChange
@@ -1166,7 +1166,7 @@ const DataBarStyleEditor = (props) => {
1166
1166
  className: "univer-ml-3 univer-flex univer-items-center",
1167
1167
  children: [/* @__PURE__ */ jsx("div", {
1168
1168
  className: "univer-text-xs",
1169
- children: localeService.t("sheet.cf.panel.positive")
1169
+ children: localeService.t("sheets-conditional-formatting-ui.panel.positive")
1170
1170
  }), /* @__PURE__ */ jsx(ColorPicker$1, {
1171
1171
  color: positiveColor,
1172
1172
  onChange: handlePositiveColorChange
@@ -1176,7 +1176,7 @@ const DataBarStyleEditor = (props) => {
1176
1176
  /* @__PURE__ */ jsxs("div", { children: [
1177
1177
  /* @__PURE__ */ jsx("div", {
1178
1178
  className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1179
- children: localeService.t("sheet.cf.valueType.min")
1179
+ children: localeService.t("sheets-conditional-formatting-ui.valueType.min")
1180
1180
  }),
1181
1181
  /* @__PURE__ */ jsxs("div", {
1182
1182
  className: "univer-mt-3 univer-flex univer-items-center",
@@ -1222,7 +1222,7 @@ const DataBarStyleEditor = (props) => {
1222
1222
  }),
1223
1223
  /* @__PURE__ */ jsx("div", {
1224
1224
  className: "univer-mt-3 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1225
- children: localeService.t("sheet.cf.valueType.max")
1225
+ children: localeService.t("sheets-conditional-formatting-ui.valueType.max")
1226
1226
  }),
1227
1227
  /* @__PURE__ */ jsxs("div", {
1228
1228
  className: "univer-mt-3 univer-flex univer-items-center",
@@ -1279,23 +1279,19 @@ const getBooleanFromNumber = (v) => v !== BooleanNumber.FALSE;
1279
1279
  const ConditionalStyleEditor = (props) => {
1280
1280
  const { style, onChange, className } = props;
1281
1281
  const [isBold, setIsBold] = useState(() => {
1282
- const defaultV = void 0;
1283
- if (!(style === null || style === void 0 ? void 0 : style.bl)) return defaultV;
1282
+ if (!(style === null || style === void 0 ? void 0 : style.bl)) return;
1284
1283
  return style.bl;
1285
1284
  });
1286
1285
  const [isItalic, setIsItalic] = useState(() => {
1287
- const defaultV = void 0;
1288
- if (!(style === null || style === void 0 ? void 0 : style.it)) return defaultV;
1286
+ if (!(style === null || style === void 0 ? void 0 : style.it)) return;
1289
1287
  return style.it;
1290
1288
  });
1291
1289
  const [isUnderline, setIsUnderline] = useState(() => {
1292
- const defaultV = void 0;
1293
- if (!(style === null || style === void 0 ? void 0 : style.ul)) return defaultV;
1290
+ if (!(style === null || style === void 0 ? void 0 : style.ul)) return;
1294
1291
  return style.ul.s;
1295
1292
  });
1296
1293
  const [isStrikethrough, setIsStrikethrough] = useState(() => {
1297
- const defaultV = void 0;
1298
- if (!(style === null || style === void 0 ? void 0 : style.st)) return defaultV;
1294
+ if (!(style === null || style === void 0 ? void 0 : style.st)) return;
1299
1295
  return style.st.s;
1300
1296
  });
1301
1297
  const [fontColor, setFontColor] = useState(() => {
@@ -1406,7 +1402,7 @@ const FormulaStyleEditor = (props) => {
1406
1402
  useEffect(() => {
1407
1403
  return interceptorManager.intercept(interceptorManager.getInterceptPoints().beforeSubmit, { handler: (v, _c, next) => {
1408
1404
  if (formulaError || formula.length === 1 || !formula.startsWith("=")) {
1409
- setFormulaError(localeService.t("sheet.cf.errorMessage.formulaError"));
1405
+ setFormulaError(localeService.t("sheets-conditional-formatting-ui.errorMessage.formulaError"));
1410
1406
  return false;
1411
1407
  }
1412
1408
  return next(v);
@@ -1424,7 +1420,7 @@ const FormulaStyleEditor = (props) => {
1424
1420
  children: [
1425
1421
  /* @__PURE__ */ jsx("div", {
1426
1422
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1427
- children: localeService.t("sheet.cf.panel.styleRule")
1423
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
1428
1424
  }),
1429
1425
  /* @__PURE__ */ jsx("div", {
1430
1426
  className: "univer-mt-3",
@@ -1447,7 +1443,7 @@ const FormulaStyleEditor = (props) => {
1447
1443
  });
1448
1444
  },
1449
1445
  onVerify: (result, formula) => {
1450
- if (!result || formula.length === 1) setFormulaError(localeService.t("sheet.cf.errorMessage.formulaError"));
1446
+ if (!result || formula.length === 1) setFormulaError(localeService.t("sheets-conditional-formatting-ui.errorMessage.formulaError"));
1451
1447
  else setFormulaError(void 0);
1452
1448
  }
1453
1449
  })
@@ -1489,10 +1485,10 @@ const WrapperError = (props) => {
1489
1485
  //#endregion
1490
1486
  //#region src/components/panel/rule-edit/HighlightCell.tsx
1491
1487
  const createOptionItem = (text, localeService) => ({
1492
- label: localeService.t(`sheet.cf.operator.${text}`),
1488
+ label: localeService.t(`sheets-conditional-formatting-ui.operator.${text}`),
1493
1489
  value: text
1494
1490
  });
1495
- const HighlightCellInput = (props) => {
1491
+ function HighlightCellInput(props) {
1496
1492
  const { type, operator, onChange, value, interceptorManager } = props;
1497
1493
  const localeService = useDependency(LocaleService);
1498
1494
  const [inputNumberValue, setInputNumberValue] = useState(() => typeof value === "number" ? value : 0);
@@ -1540,7 +1536,7 @@ const HighlightCellInput = (props) => {
1540
1536
  CFTextOperator.equal
1541
1537
  ].includes(operator)) {
1542
1538
  if (!inputTextValue) {
1543
- setTextError(localeService.t("sheet.cf.errorMessage.notBlank"));
1539
+ setTextError(localeService.t("sheets-conditional-formatting-ui.errorMessage.notBlank"));
1544
1540
  return false;
1545
1541
  }
1546
1542
  return next(v);
@@ -1649,7 +1645,7 @@ const HighlightCellInput = (props) => {
1649
1645
  }
1650
1646
  }
1651
1647
  return null;
1652
- };
1648
+ }
1653
1649
  const getOperatorOptions = (type, localeService) => {
1654
1650
  switch (type) {
1655
1651
  case CFSubRuleType.text: return [
@@ -1701,23 +1697,23 @@ const HighlightCellStyleEditor = (props) => {
1701
1697
  const typeOptions = [
1702
1698
  {
1703
1699
  value: CFSubRuleType.text,
1704
- label: localeService.t("sheet.cf.subRuleType.text")
1700
+ label: localeService.t("sheets-conditional-formatting-ui.subRuleType.text")
1705
1701
  },
1706
1702
  {
1707
1703
  value: CFSubRuleType.number,
1708
- label: localeService.t("sheet.cf.subRuleType.number")
1704
+ label: localeService.t("sheets-conditional-formatting-ui.subRuleType.number")
1709
1705
  },
1710
1706
  {
1711
1707
  value: CFSubRuleType.timePeriod,
1712
- label: localeService.t("sheet.cf.subRuleType.timePeriod")
1708
+ label: localeService.t("sheets-conditional-formatting-ui.subRuleType.timePeriod")
1713
1709
  },
1714
1710
  {
1715
1711
  value: CFSubRuleType.duplicateValues,
1716
- label: localeService.t("sheet.cf.subRuleType.duplicateValues")
1712
+ label: localeService.t("sheets-conditional-formatting-ui.subRuleType.duplicateValues")
1717
1713
  },
1718
1714
  {
1719
1715
  value: CFSubRuleType.uniqueValues,
1720
- label: localeService.t("sheet.cf.subRuleType.uniqueValues")
1716
+ label: localeService.t("sheets-conditional-formatting-ui.subRuleType.uniqueValues")
1721
1717
  }
1722
1718
  ];
1723
1719
  const operatorOptions = useMemo(() => getOperatorOptions(subType, localeService), [subType]);
@@ -1832,7 +1828,7 @@ const HighlightCellStyleEditor = (props) => {
1832
1828
  return /* @__PURE__ */ jsxs("div", { children: [
1833
1829
  /* @__PURE__ */ jsx("div", {
1834
1830
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
1835
- children: localeService.t("sheet.cf.panel.styleRule")
1831
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
1836
1832
  }),
1837
1833
  /* @__PURE__ */ jsxs("div", {
1838
1834
  className: "univer-flex univer-justify-between univer-gap-4",
@@ -2008,27 +2004,27 @@ const IconSetRuleEdit = (props) => {
2008
2004
  const { onChange, configList, errorMap = {} } = props;
2009
2005
  const localeService = useDependency(LocaleService);
2010
2006
  const options = [{
2011
- label: localeService.t(`sheet.cf.symbol.${CFNumberOperator.greaterThan}`),
2007
+ label: localeService.t(`sheets-conditional-formatting-ui.symbol.${CFNumberOperator.greaterThan}`),
2012
2008
  value: CFNumberOperator.greaterThan
2013
2009
  }, {
2014
- label: localeService.t(`sheet.cf.symbol.${CFNumberOperator.greaterThanOrEqual}`),
2010
+ label: localeService.t(`sheets-conditional-formatting-ui.symbol.${CFNumberOperator.greaterThanOrEqual}`),
2015
2011
  value: CFNumberOperator.greaterThanOrEqual
2016
2012
  }];
2017
2013
  const valueTypeOptions = [
2018
2014
  {
2019
- label: localeService.t(`sheet.cf.valueType.${CFValueType.num}`),
2015
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.num}`),
2020
2016
  value: CFValueType.num
2021
2017
  },
2022
2018
  {
2023
- label: localeService.t(`sheet.cf.valueType.${CFValueType.percent}`),
2019
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.percent}`),
2024
2020
  value: CFValueType.percent
2025
2021
  },
2026
2022
  {
2027
- label: localeService.t(`sheet.cf.valueType.${CFValueType.percentile}`),
2023
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.percentile}`),
2028
2024
  value: CFValueType.percentile
2029
2025
  },
2030
2026
  {
2031
- label: localeService.t(`sheet.cf.valueType.${CFValueType.formula}`),
2027
+ label: localeService.t(`sheets-conditional-formatting-ui.valueType.${CFValueType.formula}`),
2032
2028
  value: CFValueType.formula
2033
2029
  }
2034
2030
  ];
@@ -2059,7 +2055,7 @@ const IconSetRuleEdit = (props) => {
2059
2055
  const isEnd = index === configList.length - 1;
2060
2056
  const isFirst = index === 0;
2061
2057
  const preItem = configList[index - 1];
2062
- const lessThanText = (preItem === null || preItem === void 0 ? void 0 : preItem.value.type) === CFValueType.formula ? localeService.t("sheet.cf.valueType.formula") : preItem === null || preItem === void 0 ? void 0 : preItem.value.value;
2058
+ const lessThanText = (preItem === null || preItem === void 0 ? void 0 : preItem.value.type) === CFValueType.formula ? localeService.t("sheets-conditional-formatting-ui.valueType.formula") : preItem === null || preItem === void 0 ? void 0 : preItem.value.value;
2063
2059
  const handleIconClick = (iconType, iconId) => {
2064
2060
  const value = {
2065
2061
  ...item,
@@ -2075,16 +2071,16 @@ const IconSetRuleEdit = (props) => {
2075
2071
  className: "univer-mt-3 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
2076
2072
  children: [/* @__PURE__ */ jsxs("div", {
2077
2073
  className: "univer-w-[45%]",
2078
- children: [localeService.t("sheet.cf.iconSet.icon"), index + 1]
2074
+ children: [localeService.t("sheets-conditional-formatting-ui.iconSet.icon"), index + 1]
2079
2075
  }), /* @__PURE__ */ jsx("div", {
2080
2076
  className: "univer-w-[45%]",
2081
- children: /* @__PURE__ */ jsxs(Fragment, { children: [!isFirst && !isEnd && localeService.t("sheet.cf.iconSet.rule"), !isFirst && !isEnd && /* @__PURE__ */ jsxs("span", {
2077
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [!isFirst && !isEnd && localeService.t("sheets-conditional-formatting-ui.iconSet.rule"), !isFirst && !isEnd && /* @__PURE__ */ jsxs("span", {
2082
2078
  className: "univer-font-medium univer-text-gray-600 dark:!univer-text-gray-200",
2083
2079
  children: [
2084
- localeService.t("sheet.cf.iconSet.when"),
2085
- localeService.t(`sheet.cf.symbol.${getOppositeOperator(preItem.operator)}`),
2080
+ localeService.t("sheets-conditional-formatting-ui.iconSet.when"),
2081
+ localeService.t(`sheets-conditional-formatting-ui.symbol.${getOppositeOperator(preItem.operator)}`),
2086
2082
  lessThanText,
2087
- isEnd ? "" : ` ${localeService.t("sheet.cf.iconSet.and")} `
2083
+ isEnd ? "" : ` ${localeService.t("sheets-conditional-formatting-ui.iconSet.and")} `
2088
2084
  ]
2089
2085
  })] })
2090
2086
  })]
@@ -2119,20 +2115,20 @@ const IconSetRuleEdit = (props) => {
2119
2115
  }
2120
2116
  }) : /* @__PURE__ */ jsxs("div", {
2121
2117
  className: "univer-mt-0 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
2122
- children: [localeService.t("sheet.cf.iconSet.rule"), /* @__PURE__ */ jsxs("span", {
2118
+ children: [localeService.t("sheets-conditional-formatting-ui.iconSet.rule"), /* @__PURE__ */ jsxs("span", {
2123
2119
  className: "univer-font-medium",
2124
2120
  children: [
2125
- localeService.t("sheet.cf.iconSet.when"),
2126
- localeService.t(`sheet.cf.symbol.${getOppositeOperator(preItem.operator)}`),
2121
+ localeService.t("sheets-conditional-formatting-ui.iconSet.when"),
2122
+ localeService.t(`sheets-conditional-formatting-ui.symbol.${getOppositeOperator(preItem.operator)}`),
2127
2123
  lessThanText,
2128
- isEnd ? "" : ` ${localeService.t("sheet.cf.iconSet.and")} `
2124
+ isEnd ? "" : ` ${localeService.t("sheets-conditional-formatting-ui.iconSet.and")} `
2129
2125
  ]
2130
2126
  })]
2131
2127
  })]
2132
2128
  }),
2133
2129
  !isEnd ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
2134
2130
  className: "univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
2135
- children: [/* @__PURE__ */ jsx("div", { children: localeService.t("sheet.cf.iconSet.type") }), /* @__PURE__ */ jsx("div", { children: localeService.t("sheet.cf.iconSet.value") })]
2131
+ children: [/* @__PURE__ */ jsx("div", { children: localeService.t("sheets-conditional-formatting-ui.iconSet.type") }), /* @__PURE__ */ jsx("div", { children: localeService.t("sheets-conditional-formatting-ui.iconSet.value") })]
2136
2132
  }), /* @__PURE__ */ jsxs("div", {
2137
2133
  className: "univer-mt-3 univer-grid univer-grid-cols-2 univer-gap-4",
2138
2134
  children: [/* @__PURE__ */ jsx(Select, {
@@ -2232,7 +2228,7 @@ const IconSet = (props) => {
2232
2228
  if (!compareWithNumber({
2233
2229
  operator: preOperator,
2234
2230
  value: preItem.value.value
2235
- }, item.value.value)) result[index] = `${localeService.t(`sheet.cf.form.${preOperator}`, String(preItem.value.value))} `;
2231
+ }, item.value.value)) result[index] = `${localeService.t(`sheets-conditional-formatting-ui.form.${preOperator}`, String(preItem.value.value))} `;
2236
2232
  });
2237
2233
  return result;
2238
2234
  }
@@ -2296,7 +2292,7 @@ const IconSet = (props) => {
2296
2292
  return /* @__PURE__ */ jsxs("div", { children: [
2297
2293
  /* @__PURE__ */ jsx("div", {
2298
2294
  className: "univer-mt-4 univer-text-sm univer-text-gray-600",
2299
- children: localeService.t("sheet.cf.panel.styleRule")
2295
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
2300
2296
  }),
2301
2297
  /* @__PURE__ */ jsx("div", {
2302
2298
  className: "univer-mt-3",
@@ -2321,7 +2317,7 @@ const IconSet = (props) => {
2321
2317
  className: "univer-mt-3 univer-flex univer-items-center univer-text-xs",
2322
2318
  children: [/* @__PURE__ */ jsxs("div", {
2323
2319
  className: "univer-flex univer-items-center univer-text-xs",
2324
- children: [/* @__PURE__ */ jsx(Checkbox, { onChange: reverseIcon }), localeService.t("sheet.cf.iconSet.reverseIconOrder")]
2320
+ children: [/* @__PURE__ */ jsx(Checkbox, { onChange: reverseIcon }), localeService.t("sheets-conditional-formatting-ui.iconSet.reverseIconOrder")]
2325
2321
  }), /* @__PURE__ */ jsxs("div", {
2326
2322
  className: "univer-ml-6 univer-flex univer-items-center univer-text-xs",
2327
2323
  children: [/* @__PURE__ */ jsx(Checkbox, {
@@ -2329,7 +2325,7 @@ const IconSet = (props) => {
2329
2325
  onChange: (v) => {
2330
2326
  setIsShowValue(!v);
2331
2327
  }
2332
- }), localeService.t("sheet.cf.iconSet.onlyShowIcon")]
2328
+ }), localeService.t("sheets-conditional-formatting-ui.iconSet.onlyShowIcon")]
2333
2329
  })]
2334
2330
  }),
2335
2331
  /* @__PURE__ */ jsx(IconSetRuleEdit, {
@@ -2349,19 +2345,19 @@ const RankStyleEditor = (props) => {
2349
2345
  const rule = ((_props$rule = props.rule) === null || _props$rule === void 0 ? void 0 : _props$rule.type) === CFRuleType.highlightCell ? props.rule : void 0;
2350
2346
  const options = [
2351
2347
  {
2352
- label: localeService.t("sheet.cf.panel.isNotBottom"),
2348
+ label: localeService.t("sheets-conditional-formatting-ui.panel.isNotBottom"),
2353
2349
  value: "isNotBottom"
2354
2350
  },
2355
2351
  {
2356
- label: localeService.t("sheet.cf.panel.isBottom"),
2352
+ label: localeService.t("sheets-conditional-formatting-ui.panel.isBottom"),
2357
2353
  value: "isBottom"
2358
2354
  },
2359
2355
  {
2360
- label: localeService.t("sheet.cf.panel.greaterThanAverage"),
2356
+ label: localeService.t("sheets-conditional-formatting-ui.panel.greaterThanAverage"),
2361
2357
  value: "greaterThanAverage"
2362
2358
  },
2363
2359
  {
2364
- label: localeService.t("sheet.cf.panel.lessThanAverage"),
2360
+ label: localeService.t("sheets-conditional-formatting-ui.panel.lessThanAverage"),
2365
2361
  value: "lessThanAverage"
2366
2362
  }
2367
2363
  ];
@@ -2457,7 +2453,7 @@ const RankStyleEditor = (props) => {
2457
2453
  return /* @__PURE__ */ jsxs("div", { children: [
2458
2454
  /* @__PURE__ */ jsx("div", {
2459
2455
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
2460
- children: localeService.t("sheet.cf.panel.styleRule")
2456
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleRule")
2461
2457
  }),
2462
2458
  /* @__PURE__ */ jsx(Select, {
2463
2459
  className: "univer-mt-3 univer-w-full",
@@ -2502,7 +2498,7 @@ const RankStyleEditor = (props) => {
2502
2498
  style
2503
2499
  });
2504
2500
  }
2505
- }), localeService.t("sheet.cf.valueType.percent")]
2501
+ }), localeService.t("sheets-conditional-formatting-ui.valueType.percent")]
2506
2502
  })]
2507
2503
  }),
2508
2504
  /* @__PURE__ */ jsx("div", {
@@ -2569,27 +2565,27 @@ const RuleEdit = (props) => {
2569
2565
  }, [props.rule]);
2570
2566
  const options = [
2571
2567
  {
2572
- label: localeService.t("sheet.cf.ruleType.highlightCell"),
2568
+ label: localeService.t("sheets-conditional-formatting-ui.ruleType.highlightCell"),
2573
2569
  value: "1"
2574
2570
  },
2575
2571
  {
2576
- label: localeService.t("sheet.cf.panel.rankAndAverage"),
2572
+ label: localeService.t("sheets-conditional-formatting-ui.panel.rankAndAverage"),
2577
2573
  value: "2"
2578
2574
  },
2579
2575
  {
2580
- label: localeService.t("sheet.cf.ruleType.dataBar"),
2576
+ label: localeService.t("sheets-conditional-formatting-ui.ruleType.dataBar"),
2581
2577
  value: "3"
2582
2578
  },
2583
2579
  {
2584
- label: localeService.t("sheet.cf.ruleType.colorScale"),
2580
+ label: localeService.t("sheets-conditional-formatting-ui.ruleType.colorScale"),
2585
2581
  value: "4"
2586
2582
  },
2587
2583
  {
2588
- label: localeService.t("sheet.cf.ruleType.formula"),
2584
+ label: localeService.t("sheets-conditional-formatting-ui.ruleType.formula"),
2589
2585
  value: "5"
2590
2586
  },
2591
2587
  {
2592
- label: localeService.t("sheet.cf.ruleType.iconSet"),
2588
+ label: localeService.t("sheets-conditional-formatting-ui.ruleType.iconSet"),
2593
2589
  value: "6"
2594
2590
  }
2595
2591
  ];
@@ -2700,14 +2696,14 @@ const RuleEdit = (props) => {
2700
2696
  props.onCancel();
2701
2697
  };
2702
2698
  const handleVerify = (v, rangeText) => {
2703
- if (v) if (rangeText.length < 1) setErrorText(localeService.t("sheet.cf.errorMessage.rangeError"));
2699
+ if (v) if (rangeText.length < 1) setErrorText(localeService.t("sheets-conditional-formatting-ui.errorMessage.rangeError"));
2704
2700
  else setErrorText(void 0);
2705
- else setErrorText(localeService.t("sheet.cf.errorMessage.rangeError"));
2701
+ else setErrorText(localeService.t("sheets-conditional-formatting-ui.errorMessage.rangeError"));
2706
2702
  };
2707
2703
  return /* @__PURE__ */ jsxs("div", { children: [
2708
2704
  /* @__PURE__ */ jsx("div", {
2709
2705
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
2710
- children: localeService.t("sheet.cf.panel.range")
2706
+ children: localeService.t("sheets-conditional-formatting-ui.panel.range")
2711
2707
  }),
2712
2708
  /* @__PURE__ */ jsxs("div", {
2713
2709
  className: "univer-mt-4",
@@ -2724,7 +2720,7 @@ const RuleEdit = (props) => {
2724
2720
  }),
2725
2721
  /* @__PURE__ */ jsx("div", {
2726
2722
  className: "univer-mt-4 univer-text-sm univer-text-gray-600 dark:!univer-text-gray-200",
2727
- children: localeService.t("sheet.cf.panel.styleType")
2723
+ children: localeService.t("sheets-conditional-formatting-ui.panel.styleType")
2728
2724
  }),
2729
2725
  /* @__PURE__ */ jsx(Select, {
2730
2726
  className: "univer-mt-4 univer-w-full",
@@ -2741,19 +2737,19 @@ const RuleEdit = (props) => {
2741
2737
  className: "univer-mt-4 univer-flex univer-justify-end",
2742
2738
  children: [/* @__PURE__ */ jsx(Button, {
2743
2739
  onClick: handleCancel,
2744
- children: localeService.t("sheet.cf.panel.cancel")
2740
+ children: localeService.t("sheets-conditional-formatting-ui.panel.cancel")
2745
2741
  }), /* @__PURE__ */ jsx(Button, {
2746
2742
  className: "univer-ml-3",
2747
2743
  variant: "primary",
2748
2744
  onClick: handleSubmit,
2749
- children: localeService.t("sheet.cf.panel.submit")
2745
+ children: localeService.t("sheets-conditional-formatting-ui.panel.submit")
2750
2746
  })]
2751
2747
  })
2752
2748
  ] });
2753
2749
  };
2754
2750
 
2755
2751
  //#endregion
2756
- //#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
2752
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/typeof.js
2757
2753
  function _typeof(o) {
2758
2754
  "@babel/helpers - typeof";
2759
2755
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -2764,7 +2760,7 @@ function _typeof(o) {
2764
2760
  }
2765
2761
 
2766
2762
  //#endregion
2767
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
2763
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPrimitive.js
2768
2764
  function toPrimitive(t, r) {
2769
2765
  if ("object" != _typeof(t) || !t) return t;
2770
2766
  var e = t[Symbol.toPrimitive];
@@ -2777,14 +2773,14 @@ function toPrimitive(t, r) {
2777
2773
  }
2778
2774
 
2779
2775
  //#endregion
2780
- //#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
2776
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/toPropertyKey.js
2781
2777
  function toPropertyKey(t) {
2782
2778
  var i = toPrimitive(t, "string");
2783
2779
  return "symbol" == _typeof(i) ? i : i + "";
2784
2780
  }
2785
2781
 
2786
2782
  //#endregion
2787
- //#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
2783
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/defineProperty.js
2788
2784
  function _defineProperty(e, r, t) {
2789
2785
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
2790
2786
  value: t,
@@ -2795,7 +2791,7 @@ function _defineProperty(e, r, t) {
2795
2791
  }
2796
2792
 
2797
2793
  //#endregion
2798
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
2794
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorateParam.js
2799
2795
  function __decorateParam(paramIndex, decorator) {
2800
2796
  return function(target, key) {
2801
2797
  decorator(target, key, paramIndex);
@@ -2803,7 +2799,7 @@ function __decorateParam(paramIndex, decorator) {
2803
2799
  }
2804
2800
 
2805
2801
  //#endregion
2806
- //#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
2802
+ //#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorate.js
2807
2803
  function __decorate(decorators, target, key, desc) {
2808
2804
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2809
2805
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -2867,33 +2863,33 @@ ConditionalFormattingI18nController = __decorate([__decorateParam(0, Inject(Loca
2867
2863
  const getRuleDescribe = (rule, localeService) => {
2868
2864
  const ruleConfig = rule.rule;
2869
2865
  switch (ruleConfig.type) {
2870
- case CFRuleType.colorScale: return localeService.t("sheet.cf.ruleType.colorScale");
2871
- case CFRuleType.dataBar: return localeService.t("sheet.cf.ruleType.dataBar");
2872
- case CFRuleType.iconSet: return localeService.t("sheet.cf.ruleType.iconSet");
2866
+ case CFRuleType.colorScale: return localeService.t("sheets-conditional-formatting-ui.ruleType.colorScale");
2867
+ case CFRuleType.dataBar: return localeService.t("sheets-conditional-formatting-ui.ruleType.dataBar");
2868
+ case CFRuleType.iconSet: return localeService.t("sheets-conditional-formatting-ui.ruleType.iconSet");
2873
2869
  case CFRuleType.highlightCell: switch (ruleConfig.subType) {
2874
2870
  case CFSubRuleType.average: {
2875
2871
  const operator = ruleConfig.operator;
2876
- return localeService.t(`sheet.cf.preview.describe.${operator}`, localeService.t("sheet.cf.subRuleType.average"));
2872
+ return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`, localeService.t("sheets-conditional-formatting-ui.subRuleType.average"));
2877
2873
  }
2878
- case CFSubRuleType.duplicateValues: return localeService.t("sheet.cf.subRuleType.duplicateValues");
2879
- case CFSubRuleType.uniqueValues: return localeService.t("sheet.cf.subRuleType.uniqueValues");
2874
+ case CFSubRuleType.duplicateValues: return localeService.t("sheets-conditional-formatting-ui.subRuleType.duplicateValues");
2875
+ case CFSubRuleType.uniqueValues: return localeService.t("sheets-conditional-formatting-ui.subRuleType.uniqueValues");
2880
2876
  case CFSubRuleType.number: {
2881
2877
  const operator = ruleConfig.operator;
2882
- return localeService.t(`sheet.cf.preview.describe.${operator}`, ...Array.isArray(ruleConfig.value) ? ruleConfig.value.map((e) => String(e)) : [String(ruleConfig.value || "")]);
2878
+ return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`, ...Array.isArray(ruleConfig.value) ? ruleConfig.value.map((e) => String(e)) : [String(ruleConfig.value || "")]);
2883
2879
  }
2884
2880
  case CFSubRuleType.text: {
2885
2881
  const operator = ruleConfig.operator;
2886
- return localeService.t(`sheet.cf.preview.describe.${operator}`, ruleConfig.value || "");
2882
+ return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`, ruleConfig.value || "");
2887
2883
  }
2888
2884
  case CFSubRuleType.timePeriod: {
2889
2885
  const operator = ruleConfig.operator;
2890
- return localeService.t(`sheet.cf.preview.describe.${operator}`);
2886
+ return localeService.t(`sheets-conditional-formatting-ui.preview.describe.${operator}`);
2891
2887
  }
2892
- case CFSubRuleType.rank: if (ruleConfig.isPercent) if (ruleConfig.isBottom) return localeService.t("sheet.cf.preview.describe.bottomNPercent", String(ruleConfig.value));
2893
- else return localeService.t("sheet.cf.preview.describe.topNPercent", String(ruleConfig.value));
2894
- else if (ruleConfig.isBottom) return localeService.t("sheet.cf.preview.describe.bottomN", String(ruleConfig.value));
2895
- else return localeService.t("sheet.cf.preview.describe.topN", String(ruleConfig.value));
2896
- case CFSubRuleType.formula: return localeService.t("sheet.cf.ruleType.formula");
2888
+ case CFSubRuleType.rank: if (ruleConfig.isPercent) if (ruleConfig.isBottom) return localeService.t("sheets-conditional-formatting-ui.preview.describe.bottomNPercent", String(ruleConfig.value));
2889
+ else return localeService.t("sheets-conditional-formatting-ui.preview.describe.topNPercent", String(ruleConfig.value));
2890
+ else if (ruleConfig.isBottom) return localeService.t("sheets-conditional-formatting-ui.preview.describe.bottomN", String(ruleConfig.value));
2891
+ else return localeService.t("sheets-conditional-formatting-ui.preview.describe.topN", String(ruleConfig.value));
2892
+ case CFSubRuleType.formula: return localeService.t("sheets-conditional-formatting-ui.ruleType.formula");
2897
2893
  }
2898
2894
  }
2899
2895
  };
@@ -2916,10 +2912,10 @@ const RuleList = (props) => {
2916
2912
  const [fetchRuleListId, setFetchRuleListId] = useState(0);
2917
2913
  const [draggingId, setDraggingId] = useState("");
2918
2914
  const selectOption = [{
2919
- label: localeService.t("sheet.cf.panel.workSheet"),
2915
+ label: localeService.t("sheets-conditional-formatting-ui.panel.workSheet"),
2920
2916
  value: "2"
2921
2917
  }, {
2922
- label: localeService.t("sheet.cf.panel.selectedRange"),
2918
+ label: localeService.t("sheets-conditional-formatting-ui.panel.selectedRange"),
2923
2919
  value: "1"
2924
2920
  }];
2925
2921
  const getRuleList = () => {
@@ -3060,7 +3056,7 @@ const RuleList = (props) => {
3060
3056
  className: "\n univer-mb-2 univer-flex univer-items-center univer-justify-between univer-gap-2 univer-text-sm\n ",
3061
3057
  children: [/* @__PURE__ */ jsx("div", {
3062
3058
  className: "univer-flex univer-items-center univer-gap-2",
3063
- children: conditionalFormattingI18nController.tWithReactNode("sheet.cf.panel.managerRuleSelect", /* @__PURE__ */ jsx(Select, {
3059
+ children: conditionalFormattingI18nController.tWithReactNode("sheets-conditional-formatting-ui.panel.managerRuleSelect", /* @__PURE__ */ jsx(Select, {
3064
3060
  className: "univer-w-36",
3065
3061
  options: selectOption,
3066
3062
  value: selectValue,
@@ -3071,7 +3067,7 @@ const RuleList = (props) => {
3071
3067
  }), /* @__PURE__ */ jsxs("div", {
3072
3068
  className: "univer-flex univer-justify-end univer-space-x-2",
3073
3069
  children: [/* @__PURE__ */ jsx(Tooltip, {
3074
- title: localeService.t("sheet.cf.panel.createRule"),
3070
+ title: localeService.t("sheets-conditional-formatting-ui.panel.createRule"),
3075
3071
  placement: "bottom",
3076
3072
  children: /* @__PURE__ */ jsx("a", {
3077
3073
  className: "univer-size-5 univer-cursor-pointer",
@@ -3079,7 +3075,7 @@ const RuleList = (props) => {
3079
3075
  children: /* @__PURE__ */ jsx(IncreaseIcon, {})
3080
3076
  })
3081
3077
  }), ruleList.length && isHasAllRuleEditPermission ? /* @__PURE__ */ jsx(Tooltip, {
3082
- title: localeService.t("sheet.cf.panel.clear"),
3078
+ title: localeService.t("sheets-conditional-formatting-ui.panel.clear"),
3083
3079
  placement: "bottom",
3084
3080
  children: /* @__PURE__ */ jsx("a", {
3085
3081
  className: "univer-size-5 univer-cursor-pointer",
@@ -3194,7 +3190,7 @@ let ConditionalFormattingPanelController = class ConditionalFormattingPanelContr
3194
3190
  openPanel(rule) {
3195
3191
  const props = {
3196
3192
  id: CF_PANEL_KEY,
3197
- header: { title: this._localeService.t("sheet.cf.title") },
3193
+ header: { title: this._localeService.t("sheets-conditional-formatting-ui.title") },
3198
3194
  children: {
3199
3195
  label: CF_PANEL_KEY,
3200
3196
  rule,
@@ -3319,13 +3315,13 @@ const OpenConditionalFormattingOperator = {
3319
3315
  //#endregion
3320
3316
  //#region src/controllers/cf.clear.controller.ts
3321
3317
  let ConditionalFormattingClearController = class ConditionalFormattingClearController extends Disposable {
3322
- constructor(_injector, _univerInstanceService, _sheetInterceptorService, _selectionManagerService, _conditionalFormattingRuleModel) {
3318
+ constructor(_injector, _univerInstanceService, _sheetInterceptorService, _selectionManagerService, _conditionalFormattingRangeIndexModel) {
3323
3319
  super();
3324
3320
  this._injector = _injector;
3325
3321
  this._univerInstanceService = _univerInstanceService;
3326
3322
  this._sheetInterceptorService = _sheetInterceptorService;
3327
3323
  this._selectionManagerService = _selectionManagerService;
3328
- this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
3324
+ this._conditionalFormattingRangeIndexModel = _conditionalFormattingRangeIndexModel;
3329
3325
  this._init();
3330
3326
  }
3331
3327
  _init() {
@@ -3345,7 +3341,7 @@ let ConditionalFormattingClearController = class ConditionalFormattingClearContr
3345
3341
  if (!worksheet) return defaultV;
3346
3342
  const unitId = workbook.getUnitId();
3347
3343
  const subUnitId = worksheet.getSheetId();
3348
- const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
3344
+ const allRules = this._conditionalFormattingRangeIndexModel.getRulesByRanges(unitId, subUnitId, ranges);
3349
3345
  if (!allRules || !allRules.length) return defaultV;
3350
3346
  const { redos: interceptRedos, undos: interceptUndos } = generateClearCfMutations(this._injector, allRules, ranges, unitId, subUnitId);
3351
3347
  redos.push(...interceptRedos);
@@ -3361,7 +3357,7 @@ let ConditionalFormattingClearController = class ConditionalFormattingClearContr
3361
3357
  undos
3362
3358
  };
3363
3359
  if (!ranges || !ranges.length) return emptyInterceptorArr;
3364
- const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
3360
+ const allRules = this._conditionalFormattingRangeIndexModel.getRulesByRanges(unitId, subUnitId, ranges);
3365
3361
  if (!allRules || !allRules.length) return emptyInterceptorArr;
3366
3362
  const { redos: interceptRedos, undos: interceptUndos } = generateClearCfMutations(this._injector, allRules, ranges, unitId, subUnitId);
3367
3363
  redos.push(...interceptRedos);
@@ -3375,15 +3371,14 @@ ConditionalFormattingClearController = __decorate([
3375
3371
  __decorateParam(1, Inject(IUniverInstanceService)),
3376
3372
  __decorateParam(2, Inject(SheetInterceptorService)),
3377
3373
  __decorateParam(3, Inject(SheetsSelectionsService)),
3378
- __decorateParam(4, Inject(ConditionalFormattingRuleModel))
3374
+ __decorateParam(4, Inject(ConditionalFormattingRangeIndexModel))
3379
3375
  ], ConditionalFormattingClearController);
3380
3376
  function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId) {
3381
3377
  const redos = [];
3382
3378
  const undos = [];
3383
- allRules.filter((rule) => {
3384
- return ranges.some((range) => rule.ranges.some((ruleRange) => Rectangle.getIntersects(ruleRange, range)));
3385
- }).forEach((rule) => {
3386
- const mergeRanges = new RangeMergeUtil().add(...rule.ranges).subtract(...ranges).merge();
3379
+ const rangeTransformService = injector.get(ConditionalFormattingRangeTransformService);
3380
+ allRules.forEach((rule) => {
3381
+ const mergeRanges = rangeTransformService.subtractRanges(rule.ranges, ranges);
3387
3382
  if (mergeRanges.length) {
3388
3383
  const redo = {
3389
3384
  id: SetConditionalRuleMutation.id,
@@ -3422,7 +3417,7 @@ function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId)
3422
3417
  //#endregion
3423
3418
  //#region package.json
3424
3419
  var name = "@univerjs/sheets-conditional-formatting-ui";
3425
- var version = "0.24.0";
3420
+ var version = "0.25.0-insiders.20260608-e4336f7";
3426
3421
 
3427
3422
  //#endregion
3428
3423
  //#region src/config/config.ts
@@ -3619,13 +3614,14 @@ const specialPastes = [
3619
3614
  PREDEFINED_HOOK_NAME_PASTE.SPECIAL_PASTE_BESIDES_BORDER
3620
3615
  ];
3621
3616
  let ConditionalFormattingCopyPasteController = class ConditionalFormattingCopyPasteController extends Disposable {
3622
- constructor(_sheetClipboardService, _conditionalFormattingRuleModel, _injector, _conditionalFormattingViewModel, _univerInstanceService) {
3617
+ constructor(_sheetClipboardService, _conditionalFormattingRuleModel, _injector, _conditionalFormattingViewModel, _univerInstanceService, _conditionalFormattingRangeTransformService) {
3623
3618
  super();
3624
3619
  this._sheetClipboardService = _sheetClipboardService;
3625
3620
  this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
3626
3621
  this._injector = _injector;
3627
3622
  this._conditionalFormattingViewModel = _conditionalFormattingViewModel;
3628
3623
  this._univerInstanceService = _univerInstanceService;
3624
+ this._conditionalFormattingRangeTransformService = _conditionalFormattingRangeTransformService;
3629
3625
  _defineProperty(this, "_copyInfo", void 0);
3630
3626
  this._initClipboardHook();
3631
3627
  }
@@ -3692,47 +3688,51 @@ let ConditionalFormattingCopyPasteController = class ConditionalFormattingCopyPa
3692
3688
  }
3693
3689
  const { ranges: [vCopyRange, vPastedRange], mapFunc } = virtualizeDiscreteRanges([copyRange, pastedRange]);
3694
3690
  const repeatRange = getRepeatRange(vCopyRange, vPastedRange, true);
3695
- const effectedConditionalFormattingRuleMatrix = {};
3691
+ const effectedConditionalFormattingRuleRanges = {};
3696
3692
  Range.foreach(vPastedRange, (row, col) => {
3697
3693
  const { row: realRow, col: realCol } = mapFunc(row, col);
3698
3694
  const cellCfList = this._conditionalFormattingViewModel.getCellCfs(pastedUnitId, pastedSubUnitId, realRow, realCol);
3699
3695
  if (cellCfList) cellCfList.forEach((item) => {
3700
- if (!effectedConditionalFormattingRuleMatrix[item.cfId]) {
3701
- const ruleMatrix = new ObjectMatrix();
3702
- effectedConditionalFormattingRuleMatrix[item.cfId] = {
3696
+ if (!effectedConditionalFormattingRuleRanges[item.cfId]) {
3697
+ const rule = this._conditionalFormattingRuleModel.getRule(pastedUnitId, pastedSubUnitId, item.cfId);
3698
+ if (!rule) return;
3699
+ effectedConditionalFormattingRuleRanges[item.cfId] = {
3703
3700
  unitId: pastedUnitId,
3704
3701
  subUnitId: pastedSubUnitId,
3705
- ruleMatrix
3702
+ ranges: rule.ranges,
3703
+ add: [],
3704
+ remove: []
3706
3705
  };
3707
- const rule = this._conditionalFormattingRuleModel.getRule(pastedUnitId, pastedSubUnitId, item.cfId);
3708
- rule === null || rule === void 0 || rule.ranges.forEach((range) => {
3709
- Range.foreach(range, (row, col) => {
3710
- ruleMatrix.setValue(row, col, 1);
3711
- });
3712
- });
3713
3706
  }
3714
- effectedConditionalFormattingRuleMatrix[item.cfId].ruleMatrix.realDeleteValue(realRow, realCol);
3707
+ effectedConditionalFormattingRuleRanges[item.cfId].remove.push({
3708
+ startRow: realRow,
3709
+ endRow: realRow,
3710
+ startColumn: realCol,
3711
+ endColumn: realCol
3712
+ });
3715
3713
  });
3716
3714
  });
3717
3715
  if (copyType === COPY_TYPE.CUT && (pastedUnitId !== copyUnitId || pastedSubUnitId !== copySubUnitId)) Range.foreach(vCopyRange, (row, col) => {
3718
3716
  const { row: realRow, col: realCol } = mapFunc(row, col);
3719
3717
  const cellCfList = this._conditionalFormattingViewModel.getCellCfs(copyUnitId, copySubUnitId, realRow, realCol);
3720
3718
  if (cellCfList) cellCfList.forEach((item) => {
3721
- if (!effectedConditionalFormattingRuleMatrix[item.cfId]) {
3722
- const ruleMatrix = new ObjectMatrix();
3723
- effectedConditionalFormattingRuleMatrix[item.cfId] = {
3719
+ if (!effectedConditionalFormattingRuleRanges[item.cfId]) {
3720
+ const rule = this._conditionalFormattingRuleModel.getRule(copyUnitId, copySubUnitId, item.cfId);
3721
+ if (!rule) return;
3722
+ effectedConditionalFormattingRuleRanges[item.cfId] = {
3724
3723
  unitId: copyUnitId,
3725
3724
  subUnitId: copySubUnitId,
3726
- ruleMatrix
3725
+ ranges: rule.ranges,
3726
+ add: [],
3727
+ remove: []
3727
3728
  };
3728
- const rule = this._conditionalFormattingRuleModel.getRule(copyUnitId, copySubUnitId, item.cfId);
3729
- rule === null || rule === void 0 || rule.ranges.forEach((range) => {
3730
- Range.foreach(range, (row, col) => {
3731
- ruleMatrix.setValue(row, col, 1);
3732
- });
3733
- });
3734
3729
  }
3735
- effectedConditionalFormattingRuleMatrix[item.cfId].ruleMatrix.realDeleteValue(realRow, realCol);
3730
+ effectedConditionalFormattingRuleRanges[item.cfId].remove.push({
3731
+ startRow: realRow,
3732
+ endRow: realRow,
3733
+ startColumn: realCol,
3734
+ endColumn: realCol
3735
+ });
3736
3736
  });
3737
3737
  });
3738
3738
  const { matrix, info } = this._copyInfo;
@@ -3769,28 +3769,27 @@ let ConditionalFormattingCopyPasteController = class ConditionalFormattingCopyPa
3769
3769
  const { row: _row, col: _col } = mapFunc(range.startRow, range.startColumn);
3770
3770
  copyRangeCfIdList.forEach((cfId) => {
3771
3771
  const rule = cacheCfIdMap[cfId] || getCurrentSheetCfRule(cfId);
3772
- if (!effectedConditionalFormattingRuleMatrix[rule.cfId]) {
3773
- const ruleMatrix = new ObjectMatrix();
3774
- effectedConditionalFormattingRuleMatrix[rule.cfId] = {
3775
- unitId: pastedUnitId,
3776
- subUnitId: pastedSubUnitId,
3777
- ruleMatrix
3778
- };
3779
- rule.ranges.forEach((range) => {
3780
- Range.foreach(range, (row, col) => {
3781
- ruleMatrix.setValue(row, col, 1);
3782
- });
3783
- });
3784
- }
3785
- effectedConditionalFormattingRuleMatrix[rule.cfId].ruleMatrix.setValue(_row, _col, 1);
3772
+ if (!effectedConditionalFormattingRuleRanges[rule.cfId]) effectedConditionalFormattingRuleRanges[rule.cfId] = {
3773
+ unitId: pastedUnitId,
3774
+ subUnitId: pastedSubUnitId,
3775
+ ranges: rule.ranges,
3776
+ add: [],
3777
+ remove: []
3778
+ };
3779
+ effectedConditionalFormattingRuleRanges[rule.cfId].add.push({
3780
+ startRow: _row,
3781
+ endRow: _row,
3782
+ startColumn: _col,
3783
+ endColumn: _col
3784
+ });
3786
3785
  });
3787
3786
  });
3788
3787
  });
3789
3788
  const redos = [];
3790
3789
  const undos = [];
3791
- for (const cfId in effectedConditionalFormattingRuleMatrix) {
3792
- const { unitId, subUnitId, ruleMatrix } = effectedConditionalFormattingRuleMatrix[cfId];
3793
- const ranges = findAllRectangle(createTopMatrixFromMatrix(ruleMatrix));
3790
+ for (const cfId in effectedConditionalFormattingRuleRanges) {
3791
+ const { unitId, subUnitId, ranges: sourceRanges, add, remove } = effectedConditionalFormattingRuleRanges[cfId];
3792
+ const ranges = this._conditionalFormattingRangeTransformService.applyRangeDelta(sourceRanges, remove, add);
3794
3793
  if (!ranges.length) {
3795
3794
  const deleteParams = {
3796
3795
  unitId,
@@ -3846,7 +3845,8 @@ ConditionalFormattingCopyPasteController = __decorate([
3846
3845
  __decorateParam(1, Inject(ConditionalFormattingRuleModel)),
3847
3846
  __decorateParam(2, Inject(Injector)),
3848
3847
  __decorateParam(3, Inject(ConditionalFormattingViewModel)),
3849
- __decorateParam(4, Inject(IUniverInstanceService))
3848
+ __decorateParam(4, Inject(IUniverInstanceService)),
3849
+ __decorateParam(5, Inject(ConditionalFormattingRangeTransformService))
3850
3850
  ], ConditionalFormattingCopyPasteController);
3851
3851
 
3852
3852
  //#endregion
@@ -3867,7 +3867,7 @@ let ConditionalFormattingPermissionController = class ConditionalFormattingPermi
3867
3867
  workbookTypes: [WorkbookEditablePermission],
3868
3868
  rangeTypes: [RangeProtectionPermissionEditPoint],
3869
3869
  worksheetTypes: [WorksheetEditPermission, WorksheetSetCellStylePermission]
3870
- }, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr"));
3870
+ }, ranges, unitId, subUnitId)) this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("sheets-conditional-formatting-ui.permission.dialog.setStyleErr"));
3871
3871
  }
3872
3872
  }));
3873
3873
  }
@@ -4001,13 +4001,14 @@ UniverSheetsConditionalFormattingMobileUIPlugin = __decorate([
4001
4001
  //#endregion
4002
4002
  //#region src/controllers/cf.auto-fill.controller.ts
4003
4003
  let ConditionalFormattingAutoFillController = class ConditionalFormattingAutoFillController extends Disposable {
4004
- constructor(_injector, _univerInstanceService, _autoFillService, _conditionalFormattingRuleModel, _conditionalFormattingViewModel) {
4004
+ constructor(_injector, _univerInstanceService, _autoFillService, _conditionalFormattingRuleModel, _conditionalFormattingViewModel, _conditionalFormattingRangeTransformService) {
4005
4005
  super();
4006
4006
  this._injector = _injector;
4007
4007
  this._univerInstanceService = _univerInstanceService;
4008
4008
  this._autoFillService = _autoFillService;
4009
4009
  this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
4010
4010
  this._conditionalFormattingViewModel = _conditionalFormattingViewModel;
4011
+ this._conditionalFormattingRangeTransformService = _conditionalFormattingRangeTransformService;
4011
4012
  this._initAutoFill();
4012
4013
  }
4013
4014
  _initAutoFill() {
@@ -4015,11 +4016,29 @@ let ConditionalFormattingAutoFillController = class ConditionalFormattingAutoFil
4015
4016
  redos: [],
4016
4017
  undos: []
4017
4018
  });
4018
- const loopFunc = (sourceStartCell, targetStartCell, relativeRange, matrixMap, mapFunc) => {
4019
+ const loopFunc = (sourceStartCell, targetStartCell, relativeRange, rangeMap, rangeDeltaMap, mapFunc) => {
4019
4020
  var _getActiveSheet;
4020
4021
  const unitId = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET).getUnitId();
4021
4022
  const subUnitId = (_getActiveSheet = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) === null || _getActiveSheet === void 0 ? void 0 : _getActiveSheet.getSheetId();
4022
4023
  if (!unitId || !subUnitId) return;
4024
+ const getRangeDelta = (cfId) => {
4025
+ let rangeDelta = rangeDeltaMap.get(cfId);
4026
+ if (!rangeDelta) {
4027
+ rangeDelta = {
4028
+ add: [],
4029
+ remove: []
4030
+ };
4031
+ rangeDeltaMap.set(cfId, rangeDelta);
4032
+ }
4033
+ return rangeDelta;
4034
+ };
4035
+ const ensureRuleRanges = (cfId) => {
4036
+ if (rangeMap.has(cfId)) return true;
4037
+ const rule = this._conditionalFormattingRuleModel.getRule(unitId, subUnitId, cfId);
4038
+ if (!rule) return false;
4039
+ rangeMap.set(cfId, rule.ranges);
4040
+ return true;
4041
+ };
4023
4042
  const sourceRange = {
4024
4043
  startRow: sourceStartCell.row,
4025
4044
  startColumn: sourceStartCell.col,
@@ -4050,34 +4069,22 @@ let ConditionalFormattingAutoFillController = class ConditionalFormattingAutoFil
4050
4069
  const { row: targetRow, col: targetCol } = mapFunc(targetPositionRange.startRow, targetPositionRange.startColumn);
4051
4070
  const targetCellCf = this._conditionalFormattingViewModel.getCellCfs(unitId, subUnitId, targetRow, targetCol);
4052
4071
  if (targetCellCf) targetCellCf.forEach((cf) => {
4053
- let matrix = matrixMap.get(cf.cfId);
4054
- if (!matrixMap.get(cf.cfId)) {
4055
- const rule = this._conditionalFormattingRuleModel.getRule(unitId, subUnitId, cf.cfId);
4056
- if (!rule) return;
4057
- matrix = new ObjectMatrix();
4058
- rule.ranges.forEach((range) => {
4059
- Range.foreach(range, (row, col) => {
4060
- matrix.setValue(row, col, 1);
4061
- });
4062
- });
4063
- matrixMap.set(cf.cfId, matrix);
4064
- }
4065
- matrix.realDeleteValue(targetRow, targetCol);
4072
+ if (!ensureRuleRanges(cf.cfId)) return;
4073
+ getRangeDelta(cf.cfId).remove.push({
4074
+ startRow: targetRow,
4075
+ endRow: targetRow,
4076
+ startColumn: targetCol,
4077
+ endColumn: targetCol
4078
+ });
4066
4079
  });
4067
4080
  if (sourceCellCf) sourceCellCf.forEach((cf) => {
4068
- let matrix = matrixMap.get(cf.cfId);
4069
- if (!matrixMap.get(cf.cfId)) {
4070
- const rule = this._conditionalFormattingRuleModel.getRule(unitId, subUnitId, cf.cfId);
4071
- if (!rule) return;
4072
- matrix = new ObjectMatrix();
4073
- rule.ranges.forEach((range) => {
4074
- Range.foreach(range, (row, col) => {
4075
- matrix.setValue(row, col, 1);
4076
- });
4077
- });
4078
- matrixMap.set(cf.cfId, matrix);
4079
- }
4080
- matrix.setValue(targetRow, targetCol, 1);
4081
+ if (!ensureRuleRanges(cf.cfId)) return;
4082
+ getRangeDelta(cf.cfId).add.push({
4083
+ startRow: targetRow,
4084
+ endRow: targetRow,
4085
+ startColumn: targetCol,
4086
+ endColumn: targetCol
4087
+ });
4081
4088
  });
4082
4089
  });
4083
4090
  };
@@ -4085,7 +4092,8 @@ let ConditionalFormattingAutoFillController = class ConditionalFormattingAutoFil
4085
4092
  var _this$_univerInstance, _this$_univerInstance2;
4086
4093
  const unitId = (_this$_univerInstance = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance === void 0 ? void 0 : _this$_univerInstance.getUnitId();
4087
4094
  const subUnitId = (_this$_univerInstance2 = this._univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET)) === null || _this$_univerInstance2 === void 0 || (_this$_univerInstance2 = _this$_univerInstance2.getActiveSheet()) === null || _this$_univerInstance2 === void 0 ? void 0 : _this$_univerInstance2.getSheetId();
4088
- const matrixMap = /* @__PURE__ */ new Map();
4095
+ const rangeMap = /* @__PURE__ */ new Map();
4096
+ const rangeDeltaMap = /* @__PURE__ */ new Map();
4089
4097
  const redos = [];
4090
4098
  const undos = [];
4091
4099
  if (!unitId || !subUnitId) return noopReturnFunc();
@@ -4097,12 +4105,16 @@ let ConditionalFormattingAutoFillController = class ConditionalFormattingAutoFil
4097
4105
  col: vSourceRange.startColumn
4098
4106
  };
4099
4107
  AutoFillTools.getAutoFillRepeatRange(vSourceRange, vTargetRange).forEach((repeat) => {
4100
- loopFunc(sourceStartCell, repeat.repeatStartCell, repeat.relativeRange, matrixMap, mapFunc);
4108
+ loopFunc(sourceStartCell, repeat.repeatStartCell, repeat.relativeRange, rangeMap, rangeDeltaMap, mapFunc);
4109
+ });
4110
+ rangeDeltaMap.forEach((rangeDelta, cfId) => {
4111
+ const ranges = rangeMap.get(cfId);
4112
+ if (!ranges) return;
4113
+ rangeMap.set(cfId, this._conditionalFormattingRangeTransformService.applyRangeDelta(ranges, rangeDelta.remove, rangeDelta.add));
4101
4114
  });
4102
- matrixMap.forEach((item, cfId) => {
4115
+ rangeMap.forEach((ranges, cfId) => {
4103
4116
  const rule = this._conditionalFormattingRuleModel.getRule(unitId, subUnitId, cfId);
4104
4117
  if (!rule) return;
4105
- const ranges = findAllRectangle(createTopMatrixFromMatrix(item));
4106
4118
  if (ranges.length) {
4107
4119
  const params = {
4108
4120
  unitId,
@@ -4153,7 +4165,8 @@ ConditionalFormattingAutoFillController = __decorate([
4153
4165
  __decorateParam(1, Inject(IUniverInstanceService)),
4154
4166
  __decorateParam(2, Inject(IAutoFillService)),
4155
4167
  __decorateParam(3, Inject(ConditionalFormattingRuleModel)),
4156
- __decorateParam(4, Inject(ConditionalFormattingViewModel))
4168
+ __decorateParam(4, Inject(ConditionalFormattingViewModel)),
4169
+ __decorateParam(5, Inject(ConditionalFormattingRangeTransformService))
4157
4170
  ], ConditionalFormattingAutoFillController);
4158
4171
 
4159
4172
  //#endregion
@@ -4271,7 +4284,7 @@ const repeatByRange = (sourceRange, targetRange) => {
4271
4284
  return repeatList;
4272
4285
  };
4273
4286
  let ConditionalFormattingPainterController = class ConditionalFormattingPainterController extends Disposable {
4274
- constructor(_injector, _univerInstanceService, _formatPainterService, _sheetsSelectionsService, _conditionalFormattingRuleModel, _conditionalFormattingViewModel) {
4287
+ constructor(_injector, _univerInstanceService, _formatPainterService, _sheetsSelectionsService, _conditionalFormattingRuleModel, _conditionalFormattingViewModel, _conditionalFormattingRangeTransformService) {
4275
4288
  super();
4276
4289
  this._injector = _injector;
4277
4290
  this._univerInstanceService = _univerInstanceService;
@@ -4279,6 +4292,7 @@ let ConditionalFormattingPainterController = class ConditionalFormattingPainterC
4279
4292
  this._sheetsSelectionsService = _sheetsSelectionsService;
4280
4293
  this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel;
4281
4294
  this._conditionalFormattingViewModel = _conditionalFormattingViewModel;
4295
+ this._conditionalFormattingRangeTransformService = _conditionalFormattingRangeTransformService;
4282
4296
  _defineProperty(this, "_painterConfig", null);
4283
4297
  this._initFormattingPainter();
4284
4298
  }
@@ -4287,9 +4301,20 @@ let ConditionalFormattingPainterController = class ConditionalFormattingPainterC
4287
4301
  redos: [],
4288
4302
  undos: []
4289
4303
  });
4290
- const loopFunc = (sourceStartCell, targetStartCell, relativeRange, matrixMap, config) => {
4304
+ const loopFunc = (sourceStartCell, targetStartCell, relativeRange, rangeMap, rangeDeltaMap, config) => {
4291
4305
  const { unitId: sourceUnitId, subUnitId: sourceSubUnitId } = this._painterConfig;
4292
4306
  const { targetUnitId, targetSubUnitId } = config;
4307
+ const getRangeDelta = (cfId) => {
4308
+ let rangeDelta = rangeDeltaMap.get(cfId);
4309
+ if (!rangeDelta) {
4310
+ rangeDelta = {
4311
+ add: [],
4312
+ remove: []
4313
+ };
4314
+ rangeDeltaMap.set(cfId, rangeDelta);
4315
+ }
4316
+ return rangeDelta;
4317
+ };
4293
4318
  const sourceRange = {
4294
4319
  startRow: sourceStartCell.row,
4295
4320
  startColumn: sourceStartCell.col,
@@ -4318,23 +4343,26 @@ let ConditionalFormattingPainterController = class ConditionalFormattingPainterC
4318
4343
  const sourceCellCf = this._conditionalFormattingViewModel.getCellCfs(sourceUnitId, sourceSubUnitId, sourcePositionRange.startRow, sourcePositionRange.startColumn);
4319
4344
  const targetCellCf = this._conditionalFormattingViewModel.getCellCfs(targetUnitId, targetSubUnitId, targetPositionRange.startRow, targetPositionRange.startColumn);
4320
4345
  if (targetCellCf) targetCellCf.forEach((cf) => {
4321
- let matrix = matrixMap.get(cf.cfId);
4322
- if (!matrixMap.get(cf.cfId)) {
4346
+ if (!rangeMap.has(cf.cfId)) {
4323
4347
  const rule = this._conditionalFormattingRuleModel.getRule(targetUnitId, targetSubUnitId, cf.cfId);
4324
4348
  if (!rule) return;
4325
- matrix = new ObjectMatrix();
4326
- rule.ranges.forEach((range) => {
4327
- Range.foreach(range, (row, col) => {
4328
- matrix.setValue(row, col, 1);
4329
- });
4330
- });
4331
- matrixMap.set(cf.cfId, matrix);
4349
+ rangeMap.set(cf.cfId, rule.ranges);
4332
4350
  }
4333
- matrix.realDeleteValue(targetPositionRange.startRow, targetPositionRange.startColumn);
4351
+ getRangeDelta(cf.cfId).remove.push({
4352
+ startRow: targetPositionRange.startRow,
4353
+ endRow: targetPositionRange.startRow,
4354
+ startColumn: targetPositionRange.startColumn,
4355
+ endColumn: targetPositionRange.startColumn
4356
+ });
4334
4357
  });
4335
4358
  if (sourceCellCf) sourceCellCf.forEach((cf) => {
4336
- const matrix = matrixMap.get(cf.cfId);
4337
- matrix && matrix.setValue(targetPositionRange.startRow, targetPositionRange.startColumn, 1);
4359
+ if (!rangeMap.has(cf.cfId)) return;
4360
+ getRangeDelta(cf.cfId).add.push({
4361
+ startRow: targetPositionRange.startRow,
4362
+ endRow: targetPositionRange.startRow,
4363
+ startColumn: targetPositionRange.startColumn,
4364
+ endColumn: targetPositionRange.startColumn
4365
+ });
4338
4366
  });
4339
4367
  });
4340
4368
  };
@@ -4342,22 +4370,15 @@ let ConditionalFormattingPainterController = class ConditionalFormattingPainterC
4342
4370
  var _this$_conditionalFor;
4343
4371
  const { range: sourceRange, unitId: sourceUnitId, subUnitId: sourceSubUnitId } = this._painterConfig;
4344
4372
  const isSkipSheet = targetUnitId !== sourceUnitId || sourceSubUnitId !== targetSubUnitId;
4345
- const matrixMap = /* @__PURE__ */ new Map();
4373
+ const rangeMap = /* @__PURE__ */ new Map();
4374
+ const rangeDeltaMap = /* @__PURE__ */ new Map();
4346
4375
  const redos = [];
4347
4376
  const undos = [];
4348
4377
  if (!targetUnitId || !targetSubUnitId || !sourceUnitId || !sourceSubUnitId) return noopReturnFunc();
4349
4378
  const ruleList = (_this$_conditionalFor = this._conditionalFormattingRuleModel.getSubunitRules(sourceUnitId, sourceSubUnitId)) !== null && _this$_conditionalFor !== void 0 ? _this$_conditionalFor : [];
4350
4379
  ruleList === null || ruleList === void 0 || ruleList.forEach((rule) => {
4351
4380
  const { ranges, cfId } = rule;
4352
- if (ranges.some((range) => Rectangle.intersects(sourceRange, range))) {
4353
- const matrix = new ObjectMatrix();
4354
- if (!isSkipSheet) ranges.forEach((range) => {
4355
- Range.foreach(range, (row, col) => {
4356
- matrix.setValue(row, col, 1);
4357
- });
4358
- });
4359
- matrixMap.set(cfId, matrix);
4360
- }
4381
+ if (ranges.some((range) => Rectangle.intersects(sourceRange, range))) rangeMap.set(cfId, isSkipSheet ? [] : ranges);
4361
4382
  });
4362
4383
  const sourceStartCell = {
4363
4384
  row: sourceRange.startRow,
@@ -4367,16 +4388,20 @@ let ConditionalFormattingPainterController = class ConditionalFormattingPainterC
4367
4388
  loopFunc(sourceStartCell, {
4368
4389
  row: repeat.startRange.startRow,
4369
4390
  col: repeat.startRange.startColumn
4370
- }, repeat.repeatRelativeRange, matrixMap, {
4391
+ }, repeat.repeatRelativeRange, rangeMap, rangeDeltaMap, {
4371
4392
  targetUnitId,
4372
4393
  targetSubUnitId
4373
4394
  });
4374
4395
  });
4375
- matrixMap.forEach((item, cfId) => {
4396
+ rangeDeltaMap.forEach((rangeDelta, cfId) => {
4397
+ const ranges = rangeMap.get(cfId);
4398
+ if (!ranges) return;
4399
+ rangeMap.set(cfId, this._conditionalFormattingRangeTransformService.applyRangeDelta(ranges, rangeDelta.remove, rangeDelta.add));
4400
+ });
4401
+ rangeMap.forEach((ranges, cfId) => {
4376
4402
  if (!isSkipSheet) {
4377
4403
  const rule = this._conditionalFormattingRuleModel.getRule(sourceUnitId, sourceSubUnitId, cfId);
4378
4404
  if (!rule) return;
4379
- const ranges = findAllRectangle(createTopMatrixFromMatrix(item));
4380
4405
  if (ranges.length) {
4381
4406
  const params = {
4382
4407
  unitId: sourceUnitId,
@@ -4405,7 +4430,6 @@ let ConditionalFormattingPainterController = class ConditionalFormattingPainterC
4405
4430
  }
4406
4431
  } else {
4407
4432
  const rule = this._conditionalFormattingRuleModel.getRule(targetUnitId, targetSubUnitId, cfId);
4408
- const ranges = findAllRectangle(createTopMatrixFromMatrix(item));
4409
4433
  if (!rule) {
4410
4434
  if (ranges.length) {
4411
4435
  const sourceRule = this._conditionalFormattingRuleModel.getRule(sourceUnitId, sourceSubUnitId, cfId);
@@ -4499,7 +4523,8 @@ ConditionalFormattingPainterController = __decorate([
4499
4523
  __decorateParam(2, Inject(IFormatPainterService)),
4500
4524
  __decorateParam(3, Inject(SheetsSelectionsService)),
4501
4525
  __decorateParam(4, Inject(ConditionalFormattingRuleModel)),
4502
- __decorateParam(5, Inject(ConditionalFormattingViewModel))
4526
+ __decorateParam(5, Inject(ConditionalFormattingViewModel)),
4527
+ __decorateParam(6, Inject(ConditionalFormattingRangeTransformService))
4503
4528
  ], ConditionalFormattingPainterController);
4504
4529
 
4505
4530
  //#endregion
@@ -4564,63 +4589,63 @@ const commandList = [
4564
4589
  const commonSelections = [
4565
4590
  {
4566
4591
  label: {
4567
- name: "sheet.cf.ruleType.highlightCell",
4592
+ name: "sheets-conditional-formatting-ui.ruleType.highlightCell",
4568
4593
  selectable: false
4569
4594
  },
4570
4595
  value: 3
4571
4596
  },
4572
4597
  {
4573
4598
  label: {
4574
- name: "sheet.cf.panel.rankAndAverage",
4599
+ name: "sheets-conditional-formatting-ui.panel.rankAndAverage",
4575
4600
  selectable: false
4576
4601
  },
4577
4602
  value: 4
4578
4603
  },
4579
4604
  {
4580
4605
  label: {
4581
- name: "sheet.cf.ruleType.formula",
4606
+ name: "sheets-conditional-formatting-ui.ruleType.formula",
4582
4607
  selectable: false
4583
4608
  },
4584
4609
  value: 5
4585
4610
  },
4586
4611
  {
4587
4612
  label: {
4588
- name: "sheet.cf.ruleType.colorScale",
4613
+ name: "sheets-conditional-formatting-ui.ruleType.colorScale",
4589
4614
  selectable: false
4590
4615
  },
4591
4616
  value: 6
4592
4617
  },
4593
4618
  {
4594
4619
  label: {
4595
- name: "sheet.cf.ruleType.dataBar",
4620
+ name: "sheets-conditional-formatting-ui.ruleType.dataBar",
4596
4621
  selectable: false
4597
4622
  },
4598
4623
  value: 7
4599
4624
  },
4600
4625
  {
4601
4626
  label: {
4602
- name: "sheet.cf.ruleType.iconSet",
4627
+ name: "sheets-conditional-formatting-ui.ruleType.iconSet",
4603
4628
  selectable: false
4604
4629
  },
4605
4630
  value: 8
4606
4631
  },
4607
4632
  {
4608
4633
  label: {
4609
- name: "sheet.cf.menu.manageConditionalFormatting",
4634
+ name: "sheets-conditional-formatting-ui.menu.manageConditionalFormatting",
4610
4635
  selectable: false
4611
4636
  },
4612
4637
  value: 2
4613
4638
  },
4614
4639
  {
4615
4640
  label: {
4616
- name: "sheet.cf.menu.createConditionalFormatting",
4641
+ name: "sheets-conditional-formatting-ui.menu.createConditionalFormatting",
4617
4642
  selectable: false
4618
4643
  },
4619
4644
  value: 1
4620
4645
  },
4621
4646
  {
4622
4647
  label: {
4623
- name: "sheet.cf.menu.clearRangeRules",
4648
+ name: "sheets-conditional-formatting-ui.menu.clearRangeRules",
4624
4649
  selectable: false
4625
4650
  },
4626
4651
  value: 9,
@@ -4628,7 +4653,7 @@ const commonSelections = [
4628
4653
  },
4629
4654
  {
4630
4655
  label: {
4631
- name: "sheet.cf.menu.clearWorkSheetRules",
4656
+ name: "sheets-conditional-formatting-ui.menu.clearWorkSheetRules",
4632
4657
  selectable: false
4633
4658
  },
4634
4659
  value: 10
@@ -4703,7 +4728,7 @@ const FactoryManageConditionalFormattingRule = (accessor) => {
4703
4728
  id: OpenConditionalFormattingOperator.id,
4704
4729
  type: MenuItemType.SELECTOR,
4705
4730
  icon: "ConditionsDoubleIcon",
4706
- tooltip: "sheet.cf.title",
4731
+ tooltip: "sheets-conditional-formatting-ui.title",
4707
4732
  selections: selections$,
4708
4733
  hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
4709
4734
  disabled$: getCurrentRangeDisable$(accessor, {