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