@univerjs/sheets-conditional-formatting-ui 1.2.0 → 1.3.0

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 (84) hide show
  1. package/lib/cjs/index.js +34 -13
  2. package/lib/cjs/locale/ar-SA.js +1 -0
  3. package/lib/cjs/locale/ca-ES.js +1 -0
  4. package/lib/cjs/locale/de-DE.js +1 -0
  5. package/lib/cjs/locale/en-US.js +1 -0
  6. package/lib/cjs/locale/es-ES.js +1 -0
  7. package/lib/cjs/locale/fa-IR.js +1 -0
  8. package/lib/cjs/locale/fr-FR.js +1 -0
  9. package/lib/cjs/locale/id-ID.js +1 -0
  10. package/lib/cjs/locale/it-IT.js +1 -0
  11. package/lib/cjs/locale/ja-JP.js +1 -0
  12. package/lib/cjs/locale/ko-KR.js +1 -0
  13. package/lib/cjs/locale/pl-PL.js +1 -0
  14. package/lib/cjs/locale/pt-BR.js +1 -0
  15. package/lib/cjs/locale/ru-RU.js +1 -0
  16. package/lib/cjs/locale/sk-SK.js +1 -0
  17. package/lib/cjs/locale/vi-VN.js +1 -0
  18. package/lib/cjs/locale/zh-CN.js +1 -0
  19. package/lib/cjs/locale/zh-HK.js +1 -0
  20. package/lib/cjs/locale/zh-TW.js +1 -0
  21. package/lib/es/index.js +34 -13
  22. package/lib/es/locale/ar-SA.js +1 -0
  23. package/lib/es/locale/ca-ES.js +1 -0
  24. package/lib/es/locale/de-DE.js +1 -0
  25. package/lib/es/locale/en-US.js +1 -0
  26. package/lib/es/locale/es-ES.js +1 -0
  27. package/lib/es/locale/fa-IR.js +1 -0
  28. package/lib/es/locale/fr-FR.js +1 -0
  29. package/lib/es/locale/id-ID.js +1 -0
  30. package/lib/es/locale/it-IT.js +1 -0
  31. package/lib/es/locale/ja-JP.js +1 -0
  32. package/lib/es/locale/ko-KR.js +1 -0
  33. package/lib/es/locale/pl-PL.js +1 -0
  34. package/lib/es/locale/pt-BR.js +1 -0
  35. package/lib/es/locale/ru-RU.js +1 -0
  36. package/lib/es/locale/sk-SK.js +1 -0
  37. package/lib/es/locale/vi-VN.js +1 -0
  38. package/lib/es/locale/zh-CN.js +1 -0
  39. package/lib/es/locale/zh-HK.js +1 -0
  40. package/lib/es/locale/zh-TW.js +1 -0
  41. package/lib/index.css +4 -0
  42. package/lib/index.js +34 -13
  43. package/lib/locale/ar-SA.js +1 -0
  44. package/lib/locale/ca-ES.js +1 -0
  45. package/lib/locale/de-DE.js +1 -0
  46. package/lib/locale/en-US.js +1 -0
  47. package/lib/locale/es-ES.js +1 -0
  48. package/lib/locale/fa-IR.js +1 -0
  49. package/lib/locale/fr-FR.js +1 -0
  50. package/lib/locale/id-ID.js +1 -0
  51. package/lib/locale/it-IT.js +1 -0
  52. package/lib/locale/ja-JP.js +1 -0
  53. package/lib/locale/ko-KR.js +1 -0
  54. package/lib/locale/pl-PL.js +1 -0
  55. package/lib/locale/pt-BR.js +1 -0
  56. package/lib/locale/ru-RU.js +1 -0
  57. package/lib/locale/sk-SK.js +1 -0
  58. package/lib/locale/vi-VN.js +1 -0
  59. package/lib/locale/zh-CN.js +1 -0
  60. package/lib/locale/zh-HK.js +1 -0
  61. package/lib/locale/zh-TW.js +1 -0
  62. package/lib/types/locale/en-US.d.ts +1 -0
  63. package/lib/types/views/panel/RuleEdit.d.ts +1 -1
  64. package/lib/umd/index.js +1 -1
  65. package/lib/umd/locale/ar-SA.js +1 -1
  66. package/lib/umd/locale/ca-ES.js +1 -1
  67. package/lib/umd/locale/de-DE.js +1 -1
  68. package/lib/umd/locale/en-US.js +1 -1
  69. package/lib/umd/locale/es-ES.js +1 -1
  70. package/lib/umd/locale/fa-IR.js +1 -1
  71. package/lib/umd/locale/fr-FR.js +1 -1
  72. package/lib/umd/locale/id-ID.js +1 -1
  73. package/lib/umd/locale/it-IT.js +1 -1
  74. package/lib/umd/locale/ja-JP.js +1 -1
  75. package/lib/umd/locale/ko-KR.js +1 -1
  76. package/lib/umd/locale/pl-PL.js +1 -1
  77. package/lib/umd/locale/pt-BR.js +1 -1
  78. package/lib/umd/locale/ru-RU.js +1 -1
  79. package/lib/umd/locale/sk-SK.js +1 -1
  80. package/lib/umd/locale/vi-VN.js +1 -1
  81. package/lib/umd/locale/zh-CN.js +1 -1
  82. package/lib/umd/locale/zh-HK.js +1 -1
  83. package/lib/umd/locale/zh-TW.js +1 -1
  84. package/package.json +12 -12
package/lib/cjs/index.js CHANGED
@@ -1007,7 +1007,7 @@ const menuSchema = {
1007
1007
  //#endregion
1008
1008
  //#region package.json
1009
1009
  var name = "@univerjs/sheets-conditional-formatting-ui";
1010
- var version = "1.2.0";
1010
+ var version = "1.3.0";
1011
1011
 
1012
1012
  //#endregion
1013
1013
  //#region src/config/config.ts
@@ -3996,7 +3996,7 @@ const getSubUnitId = (univerInstanceService) => {
3996
3996
  return (_getActiveSheet = univerInstanceService.getCurrentUnitOfType(_univerjs_core.UniverInstanceType.UNIVER_SHEET).getActiveSheet()) === null || _getActiveSheet === void 0 ? void 0 : _getActiveSheet.getSheetId();
3997
3997
  };
3998
3998
  const RuleEdit = (props) => {
3999
- var _props$rule, _props$rule5;
3999
+ var _props$rule, _props$rule2, _props$rule6;
4000
4000
  const { SelectComponent = _univerjs_design.Select, DropdownComponent, ColorPickerComponent, RangeSelectorComponent = _univerjs_sheets_formula_ui.RangeSelector, FormulaEditorComponent = _univerjs_sheets_formula_ui.FormulaEditor } = props;
4001
4001
  const localeService = (0, _univerjs_ui.useDependency)(_univerjs_core.LocaleService);
4002
4002
  const commandService = (0, _univerjs_ui.useDependency)(_univerjs_core.ICommandService);
@@ -4006,11 +4006,12 @@ const RuleEdit = (props) => {
4006
4006
  const unitId = getUnitId(univerInstanceService);
4007
4007
  const subUnitId = getSubUnitId(univerInstanceService);
4008
4008
  const [errorText, setErrorText] = (0, react.useState)(void 0);
4009
- const rangeResult = (0, react.useRef)(((_props$rule = props.rule) === null || _props$rule === void 0 ? void 0 : _props$rule.ranges) ?? []);
4009
+ const [stopIfTrue, setStopIfTrue] = (0, react.useState)(!!((_props$rule = props.rule) === null || _props$rule === void 0 ? void 0 : _props$rule.stopIfTrue));
4010
+ const rangeResult = (0, react.useRef)(((_props$rule2 = props.rule) === null || _props$rule2 === void 0 ? void 0 : _props$rule2.ranges) ?? []);
4010
4011
  const rangeSelectorTouched = (0, react.useRef)(false);
4011
4012
  const rangeString = (0, react.useMemo)(() => {
4012
- var _props$rule2;
4013
- let ranges = (_props$rule2 = props.rule) === null || _props$rule2 === void 0 ? void 0 : _props$rule2.ranges;
4013
+ var _props$rule3;
4014
+ let ranges = (_props$rule3 = props.rule) === null || _props$rule3 === void 0 ? void 0 : _props$rule3.ranges;
4014
4015
  if (!(ranges === null || ranges === void 0 ? void 0 : ranges.length)) {
4015
4016
  var _selectionManagerServ;
4016
4017
  ranges = ((_selectionManagerServ = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range)) ?? [];
@@ -4049,14 +4050,14 @@ const RuleEdit = (props) => {
4049
4050
  }
4050
4051
  ];
4051
4052
  const [ruleType, setRuleType] = (0, react.useState)(() => {
4052
- var _props$rule3;
4053
- const type = (_props$rule3 = props.rule) === null || _props$rule3 === void 0 ? void 0 : _props$rule3.rule.type;
4053
+ var _props$rule4;
4054
+ const type = (_props$rule4 = props.rule) === null || _props$rule4 === void 0 ? void 0 : _props$rule4.rule.type;
4054
4055
  const defaultType = options[0].value;
4055
4056
  if (!type) return defaultType;
4056
4057
  switch (type) {
4057
4058
  case _univerjs_sheets_conditional_formatting.CFRuleType.highlightCell:
4058
- var _props$rule4;
4059
- switch ((_props$rule4 = props.rule) === null || _props$rule4 === void 0 ? void 0 : _props$rule4.rule.subType) {
4059
+ var _props$rule5;
4060
+ switch ((_props$rule5 = props.rule) === null || _props$rule5 === void 0 ? void 0 : _props$rule5.rule.subType) {
4060
4061
  case _univerjs_sheets_conditional_formatting.CFSubRuleType.number:
4061
4062
  case _univerjs_sheets_conditional_formatting.CFSubRuleType.text:
4062
4063
  case _univerjs_sheets_conditional_formatting.CFSubRuleType.duplicateValues:
@@ -4091,6 +4092,7 @@ const RuleEdit = (props) => {
4091
4092
  default: return HighlightCellStyleEditor;
4092
4093
  }
4093
4094
  }, [ruleType]);
4095
+ const supportsStopIfTrue = StyleEditor === HighlightCellStyleEditor || StyleEditor === RankStyleEditor || StyleEditor === FormulaStyleEditor;
4094
4096
  (0, react.useEffect)(() => {
4095
4097
  const disposable = commandService.onCommandExecuted((commandInfo) => {
4096
4098
  if (commandInfo.id === _univerjs_sheets.RemoveSheetMutation.id) {
@@ -4132,7 +4134,8 @@ const RuleEdit = (props) => {
4132
4134
  rule = {
4133
4135
  ...props.rule,
4134
4136
  ranges,
4135
- rule: result
4137
+ rule: result,
4138
+ stopIfTrue: result.type === _univerjs_sheets_conditional_formatting.CFRuleType.highlightCell && stopIfTrue
4136
4139
  };
4137
4140
  commandService.executeCommand(_univerjs_sheets_conditional_formatting.SetCfCommand.id, {
4138
4141
  unitId,
@@ -4145,7 +4148,7 @@ const RuleEdit = (props) => {
4145
4148
  cfId: conditionalFormattingRuleModel.createCfId(unitId, subUnitId),
4146
4149
  ranges,
4147
4150
  rule: result,
4148
- stopIfTrue: false
4151
+ stopIfTrue: result.type === _univerjs_sheets_conditional_formatting.CFRuleType.highlightCell && stopIfTrue
4149
4152
  };
4150
4153
  commandService.executeCommand(_univerjs_sheets_conditional_formatting.AddCfCommand.id, {
4151
4154
  unitId,
@@ -4200,13 +4203,21 @@ const RuleEdit = (props) => {
4200
4203
  }),
4201
4204
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyleEditor, {
4202
4205
  interceptorManager,
4203
- rule: (_props$rule5 = props.rule) === null || _props$rule5 === void 0 ? void 0 : _props$rule5.rule,
4206
+ rule: (_props$rule6 = props.rule) === null || _props$rule6 === void 0 ? void 0 : _props$rule6.rule,
4204
4207
  onChange: onStyleChange,
4205
4208
  SelectComponent,
4206
4209
  DropdownComponent,
4207
4210
  ColorPickerComponent,
4208
4211
  FormulaEditorComponent
4209
4212
  }),
4213
+ supportsStopIfTrue && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4214
+ className: "univer-mt-4",
4215
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
4216
+ checked: stopIfTrue,
4217
+ onChange: (checked) => setStopIfTrue(!!checked),
4218
+ children: localeService.t("sheets-conditional-formatting-ui.panel.stopIfTrue")
4219
+ })
4220
+ }),
4210
4221
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4211
4222
  className: "univer-mt-4 univer-flex univer-justify-end univer-gap-2",
4212
4223
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Button, {
@@ -4438,7 +4449,7 @@ function RuleList(props) {
4438
4449
  onDragStop: handleDragStop,
4439
4450
  onDragStart: handleDragStart,
4440
4451
  itemRender: (rule) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4441
- className: (0, _univerjs_design.clsx)("univer-group univer-relative univer-flex univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100 rtl:univer-pl-8 rtl:univer-pr-5 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-100 dark:!univer-bg-gray-700": draggingId === rule.cfId }),
4452
+ className: (0, _univerjs_design.clsx)("univer-group univer-relative univer-flex univer-flex-wrap univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100 rtl:univer-pl-8 rtl:univer-pr-5 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-100 dark:!univer-bg-gray-700": draggingId === rule.cfId }),
4442
4453
  onMouseMove: () => {
4443
4454
  rule.ranges !== currentRuleRanges && setCurrentRuleRanges(rule.ranges);
4444
4455
  },
@@ -4463,6 +4474,16 @@ function RuleList(props) {
4463
4474
  })]
4464
4475
  }),
4465
4476
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConditionalFormattingRulePreview, { rule: rule.rule }) }),
4477
+ rule.rule.type === _univerjs_sheets_conditional_formatting.CFRuleType.highlightCell && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4478
+ className: "univer-pointer-events-none univer-mt-2 univer-w-full",
4479
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Checkbox, {
4480
+ className: "univer-max-w-full",
4481
+ contentClassName: "univer-min-w-0",
4482
+ checked: !!rule.stopIfTrue,
4483
+ disabled: true,
4484
+ children: localeService.t("sheets-conditional-formatting-ui.panel.stopIfTrue")
4485
+ })
4486
+ }),
4466
4487
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4467
4488
  className: (0, _univerjs_design.clsx)("univer-absolute univer-right-1 univer-hidden univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-red-500 group-hover:univer-flex hover:univer-bg-gray-200 rtl:univer-left-1 rtl:univer-right-auto", { "univer-flex univer-items-center univer-justify-center": draggingId === rule.cfId }),
4468
4489
  onClick: (e) => {
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "الإيقاف إذا تحقق الشرط",
37
38
  createRule: "إنشاء قاعدة",
38
39
  clear: "مسح كل القواعد",
39
40
  range: "نطاق التطبيق",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Atura si és cert",
37
38
  createRule: "Crea regla",
38
39
  clear: "Esborra totes les regles",
39
40
  range: "Aplica rang",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Anhalten, wenn wahr",
37
38
  createRule: "Regel erstellen",
38
39
  clear: "Alle Regeln löschen",
39
40
  range: "Bereich anwenden",
@@ -49,6 +49,7 @@ const locale = { "sheets-conditional-formatting-ui": {
49
49
  lessThanOrEqual: "<="
50
50
  },
51
51
  panel: {
52
+ stopIfTrue: "Stop If True",
52
53
  createRule: "Create Rule",
53
54
  clear: "Clear All Rules",
54
55
  range: "Apply Range",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Detener si es verdadero",
37
38
  createRule: "Crear regla",
38
39
  clear: "Borrar todas las reglas",
39
40
  range: "Aplicar rango",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "توقف در صورت درست بودن",
37
38
  createRule: "ایجاد قانون",
38
39
  clear: "پاک کردن همه قوانین",
39
40
  range: "اعمال محدوده",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Interrompre si vrai",
37
38
  createRule: "Créer une règle",
38
39
  clear: "Effacer toutes les règles",
39
40
  range: "Appliquer la plage",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Hentikan Jika Benar",
37
38
  createRule: "Buat Aturan",
38
39
  clear: "Hapus Semua Aturan",
39
40
  range: "Terapkan Rentang",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Interrompi se vero",
37
38
  createRule: "Crea Regola",
38
39
  clear: "Cancella Tutte le Regole",
39
40
  range: "Applica Intervallo",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "≤"
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "条件を満たす場合は停止",
37
38
  createRule: "新しいルール",
38
39
  clear: "ルールのクリア",
39
40
  range: "適用先",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "≤"
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "참이면 중지",
37
38
  createRule: "규칙 만들기",
38
39
  clear: "모든 규칙 지우기",
39
40
  range: "적용 범위",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Zatrzymaj, gdy warunek jest prawdziwy",
37
38
  createRule: "Utwórz regułę",
38
39
  clear: "Wyczyść wszystkie reguły",
39
40
  range: "Zakres zastosowania",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Parar se Verdadeiro",
37
38
  createRule: "Criar Regra",
38
39
  clear: "Limpar Todas as Regras",
39
40
  range: "Aplicar ao Intervalo",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Остановить, если истина",
37
38
  createRule: "Создать правило",
38
39
  clear: "Очистить все правила",
39
40
  range: "Применить диапазон",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Zastaviť, ak je pravda",
37
38
  createRule: "Vytvoriť pravidlo",
38
39
  clear: "Vymazať všetky pravidlá",
39
40
  range: "Rozsah použitia",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Dừng nếu đúng",
37
38
  createRule: "Tạo quy tắc mới",
38
39
  clear: "Xóa tất cả quy tắc",
39
40
  range: "Phạm vi áp dụng",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "如果为真则停止",
37
38
  createRule: "新增规则",
38
39
  clear: "清空所有规则",
39
40
  range: "应用范围",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "若為真則停止",
37
38
  createRule: "新增規則",
38
39
  clear: "清空所有規則",
39
40
  range: "應用範圍",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "若為真則停止",
37
38
  createRule: "新增規則",
38
39
  clear: "清空所有規則",
39
40
  range: "應用範圍",
package/lib/es/index.js CHANGED
@@ -1006,7 +1006,7 @@ const menuSchema = {
1006
1006
  //#endregion
1007
1007
  //#region package.json
1008
1008
  var name = "@univerjs/sheets-conditional-formatting-ui";
1009
- var version = "1.2.0";
1009
+ var version = "1.3.0";
1010
1010
 
1011
1011
  //#endregion
1012
1012
  //#region src/config/config.ts
@@ -3995,7 +3995,7 @@ const getSubUnitId = (univerInstanceService) => {
3995
3995
  return (_getActiveSheet = univerInstanceService.getCurrentUnitOfType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) === null || _getActiveSheet === void 0 ? void 0 : _getActiveSheet.getSheetId();
3996
3996
  };
3997
3997
  const RuleEdit = (props) => {
3998
- var _props$rule, _props$rule5;
3998
+ var _props$rule, _props$rule2, _props$rule6;
3999
3999
  const { SelectComponent = Select, DropdownComponent, ColorPickerComponent, RangeSelectorComponent = RangeSelector, FormulaEditorComponent = FormulaEditor } = props;
4000
4000
  const localeService = useDependency(LocaleService);
4001
4001
  const commandService = useDependency(ICommandService);
@@ -4005,11 +4005,12 @@ const RuleEdit = (props) => {
4005
4005
  const unitId = getUnitId(univerInstanceService);
4006
4006
  const subUnitId = getSubUnitId(univerInstanceService);
4007
4007
  const [errorText, setErrorText] = useState(void 0);
4008
- const rangeResult = useRef(((_props$rule = props.rule) === null || _props$rule === void 0 ? void 0 : _props$rule.ranges) ?? []);
4008
+ const [stopIfTrue, setStopIfTrue] = useState(!!((_props$rule = props.rule) === null || _props$rule === void 0 ? void 0 : _props$rule.stopIfTrue));
4009
+ const rangeResult = useRef(((_props$rule2 = props.rule) === null || _props$rule2 === void 0 ? void 0 : _props$rule2.ranges) ?? []);
4009
4010
  const rangeSelectorTouched = useRef(false);
4010
4011
  const rangeString = useMemo(() => {
4011
- var _props$rule2;
4012
- let ranges = (_props$rule2 = props.rule) === null || _props$rule2 === void 0 ? void 0 : _props$rule2.ranges;
4012
+ var _props$rule3;
4013
+ let ranges = (_props$rule3 = props.rule) === null || _props$rule3 === void 0 ? void 0 : _props$rule3.ranges;
4013
4014
  if (!(ranges === null || ranges === void 0 ? void 0 : ranges.length)) {
4014
4015
  var _selectionManagerServ;
4015
4016
  ranges = ((_selectionManagerServ = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range)) ?? [];
@@ -4048,14 +4049,14 @@ const RuleEdit = (props) => {
4048
4049
  }
4049
4050
  ];
4050
4051
  const [ruleType, setRuleType] = useState(() => {
4051
- var _props$rule3;
4052
- const type = (_props$rule3 = props.rule) === null || _props$rule3 === void 0 ? void 0 : _props$rule3.rule.type;
4052
+ var _props$rule4;
4053
+ const type = (_props$rule4 = props.rule) === null || _props$rule4 === void 0 ? void 0 : _props$rule4.rule.type;
4053
4054
  const defaultType = options[0].value;
4054
4055
  if (!type) return defaultType;
4055
4056
  switch (type) {
4056
4057
  case CFRuleType.highlightCell:
4057
- var _props$rule4;
4058
- switch ((_props$rule4 = props.rule) === null || _props$rule4 === void 0 ? void 0 : _props$rule4.rule.subType) {
4058
+ var _props$rule5;
4059
+ switch ((_props$rule5 = props.rule) === null || _props$rule5 === void 0 ? void 0 : _props$rule5.rule.subType) {
4059
4060
  case CFSubRuleType.number:
4060
4061
  case CFSubRuleType.text:
4061
4062
  case CFSubRuleType.duplicateValues:
@@ -4090,6 +4091,7 @@ const RuleEdit = (props) => {
4090
4091
  default: return HighlightCellStyleEditor;
4091
4092
  }
4092
4093
  }, [ruleType]);
4094
+ const supportsStopIfTrue = StyleEditor === HighlightCellStyleEditor || StyleEditor === RankStyleEditor || StyleEditor === FormulaStyleEditor;
4093
4095
  useEffect(() => {
4094
4096
  const disposable = commandService.onCommandExecuted((commandInfo) => {
4095
4097
  if (commandInfo.id === RemoveSheetMutation.id) {
@@ -4131,7 +4133,8 @@ const RuleEdit = (props) => {
4131
4133
  rule = {
4132
4134
  ...props.rule,
4133
4135
  ranges,
4134
- rule: result
4136
+ rule: result,
4137
+ stopIfTrue: result.type === CFRuleType.highlightCell && stopIfTrue
4135
4138
  };
4136
4139
  commandService.executeCommand(SetCfCommand.id, {
4137
4140
  unitId,
@@ -4144,7 +4147,7 @@ const RuleEdit = (props) => {
4144
4147
  cfId: conditionalFormattingRuleModel.createCfId(unitId, subUnitId),
4145
4148
  ranges,
4146
4149
  rule: result,
4147
- stopIfTrue: false
4150
+ stopIfTrue: result.type === CFRuleType.highlightCell && stopIfTrue
4148
4151
  };
4149
4152
  commandService.executeCommand(AddCfCommand.id, {
4150
4153
  unitId,
@@ -4199,13 +4202,21 @@ const RuleEdit = (props) => {
4199
4202
  }),
4200
4203
  /* @__PURE__ */ jsx(StyleEditor, {
4201
4204
  interceptorManager,
4202
- rule: (_props$rule5 = props.rule) === null || _props$rule5 === void 0 ? void 0 : _props$rule5.rule,
4205
+ rule: (_props$rule6 = props.rule) === null || _props$rule6 === void 0 ? void 0 : _props$rule6.rule,
4203
4206
  onChange: onStyleChange,
4204
4207
  SelectComponent,
4205
4208
  DropdownComponent,
4206
4209
  ColorPickerComponent,
4207
4210
  FormulaEditorComponent
4208
4211
  }),
4212
+ supportsStopIfTrue && /* @__PURE__ */ jsx("div", {
4213
+ className: "univer-mt-4",
4214
+ children: /* @__PURE__ */ jsx(Checkbox, {
4215
+ checked: stopIfTrue,
4216
+ onChange: (checked) => setStopIfTrue(!!checked),
4217
+ children: localeService.t("sheets-conditional-formatting-ui.panel.stopIfTrue")
4218
+ })
4219
+ }),
4209
4220
  /* @__PURE__ */ jsxs("div", {
4210
4221
  className: "univer-mt-4 univer-flex univer-justify-end univer-gap-2",
4211
4222
  children: [/* @__PURE__ */ jsx(Button, {
@@ -4437,7 +4448,7 @@ function RuleList(props) {
4437
4448
  onDragStop: handleDragStop,
4438
4449
  onDragStart: handleDragStart,
4439
4450
  itemRender: (rule) => /* @__PURE__ */ jsxs("div", {
4440
- className: clsx("univer-group univer-relative univer-flex univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100 rtl:univer-pl-8 rtl:univer-pr-5 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-100 dark:!univer-bg-gray-700": draggingId === rule.cfId }),
4451
+ className: clsx("univer-group univer-relative univer-flex univer-flex-wrap univer-items-center univer-justify-between univer-rounded univer-py-2 univer-pl-5 univer-pr-8 hover:univer-bg-gray-100 rtl:univer-pl-8 rtl:univer-pr-5 dark:hover:!univer-bg-gray-700", { "univer-bg-gray-100 dark:!univer-bg-gray-700": draggingId === rule.cfId }),
4441
4452
  onMouseMove: () => {
4442
4453
  rule.ranges !== currentRuleRanges && setCurrentRuleRanges(rule.ranges);
4443
4454
  },
@@ -4462,6 +4473,16 @@ function RuleList(props) {
4462
4473
  })]
4463
4474
  }),
4464
4475
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(ConditionalFormattingRulePreview, { rule: rule.rule }) }),
4476
+ rule.rule.type === CFRuleType.highlightCell && /* @__PURE__ */ jsx("div", {
4477
+ className: "univer-pointer-events-none univer-mt-2 univer-w-full",
4478
+ children: /* @__PURE__ */ jsx(Checkbox, {
4479
+ className: "univer-max-w-full",
4480
+ contentClassName: "univer-min-w-0",
4481
+ checked: !!rule.stopIfTrue,
4482
+ disabled: true,
4483
+ children: localeService.t("sheets-conditional-formatting-ui.panel.stopIfTrue")
4484
+ })
4485
+ }),
4465
4486
  /* @__PURE__ */ jsx("div", {
4466
4487
  className: clsx("univer-absolute univer-right-1 univer-hidden univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-red-500 group-hover:univer-flex hover:univer-bg-gray-200 rtl:univer-left-1 rtl:univer-right-auto", { "univer-flex univer-items-center univer-justify-center": draggingId === rule.cfId }),
4467
4488
  onClick: (e) => {
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "الإيقاف إذا تحقق الشرط",
37
38
  createRule: "إنشاء قاعدة",
38
39
  clear: "مسح كل القواعد",
39
40
  range: "نطاق التطبيق",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Atura si és cert",
37
38
  createRule: "Crea regla",
38
39
  clear: "Esborra totes les regles",
39
40
  range: "Aplica rang",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Anhalten, wenn wahr",
37
38
  createRule: "Regel erstellen",
38
39
  clear: "Alle Regeln löschen",
39
40
  range: "Bereich anwenden",
@@ -49,6 +49,7 @@ const locale = { "sheets-conditional-formatting-ui": {
49
49
  lessThanOrEqual: "<="
50
50
  },
51
51
  panel: {
52
+ stopIfTrue: "Stop If True",
52
53
  createRule: "Create Rule",
53
54
  clear: "Clear All Rules",
54
55
  range: "Apply Range",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Detener si es verdadero",
37
38
  createRule: "Crear regla",
38
39
  clear: "Borrar todas las reglas",
39
40
  range: "Aplicar rango",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "توقف در صورت درست بودن",
37
38
  createRule: "ایجاد قانون",
38
39
  clear: "پاک کردن همه قوانین",
39
40
  range: "اعمال محدوده",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Interrompre si vrai",
37
38
  createRule: "Créer une règle",
38
39
  clear: "Effacer toutes les règles",
39
40
  range: "Appliquer la plage",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Hentikan Jika Benar",
37
38
  createRule: "Buat Aturan",
38
39
  clear: "Hapus Semua Aturan",
39
40
  range: "Terapkan Rentang",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Interrompi se vero",
37
38
  createRule: "Crea Regola",
38
39
  clear: "Cancella Tutte le Regole",
39
40
  range: "Applica Intervallo",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "≤"
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "条件を満たす場合は停止",
37
38
  createRule: "新しいルール",
38
39
  clear: "ルールのクリア",
39
40
  range: "適用先",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "≤"
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "참이면 중지",
37
38
  createRule: "규칙 만들기",
38
39
  clear: "모든 규칙 지우기",
39
40
  range: "적용 범위",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Zatrzymaj, gdy warunek jest prawdziwy",
37
38
  createRule: "Utwórz regułę",
38
39
  clear: "Wyczyść wszystkie reguły",
39
40
  range: "Zakres zastosowania",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Parar se Verdadeiro",
37
38
  createRule: "Criar Regra",
38
39
  clear: "Limpar Todas as Regras",
39
40
  range: "Aplicar ao Intervalo",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Остановить, если истина",
37
38
  createRule: "Создать правило",
38
39
  clear: "Очистить все правила",
39
40
  range: "Применить диапазон",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Zastaviť, ak je pravda",
37
38
  createRule: "Vytvoriť pravidlo",
38
39
  clear: "Vymazať všetky pravidlá",
39
40
  range: "Rozsah použitia",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "Dừng nếu đúng",
37
38
  createRule: "Tạo quy tắc mới",
38
39
  clear: "Xóa tất cả quy tắc",
39
40
  range: "Phạm vi áp dụng",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "如果为真则停止",
37
38
  createRule: "新增规则",
38
39
  clear: "清空所有规则",
39
40
  range: "应用范围",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "若為真則停止",
37
38
  createRule: "新增規則",
38
39
  clear: "清空所有規則",
39
40
  range: "應用範圍",
@@ -34,6 +34,7 @@ const locale = { "sheets-conditional-formatting-ui": {
34
34
  lessThanOrEqual: "<="
35
35
  },
36
36
  panel: {
37
+ stopIfTrue: "若為真則停止",
37
38
  createRule: "新增規則",
38
39
  clear: "清空所有規則",
39
40
  range: "應用範圍",
package/lib/index.css CHANGED
@@ -51,6 +51,10 @@
51
51
  margin-top: .25rem;
52
52
  }
53
53
 
54
+ .univer-mt-2 {
55
+ margin-top: .5rem;
56
+ }
57
+
54
58
  .univer-mt-3 {
55
59
  margin-top: .75rem;
56
60
  }