Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

feat(sheets-conditional-formatting-ui): refactor manage rule selection options

白熱ba56b60960d1
diff --git a/packages/sheets-conditional-formatting-ui/src/menu/manage-rule.ts b/packages/sheets-conditional-formatting-ui/src/menu/manage-rule.ts
index e74e68dba6..43496729bb 100644
--- a/packages/sheets-conditional-formatting-ui/src/menu/manage-rule.ts
+++ b/packages/sheets-conditional-formatting-ui/src/menu/manage-rule.ts
@@ -24,54 +24,53 @@ import { debounceTime } from 'rxjs/operators';
import type { Workbook } from '@univerjs/core';
import { ICommandService, IUniverInstanceService, Rectangle, UniverInstanceType } from '@univerjs/core';
import { AddConditionalRuleMutation, ConditionalFormattingRuleModel, DeleteConditionalRuleMutation, MoveConditionalRuleMutation, SetConditionalRuleMutation } from '@univerjs/sheets-conditional-formatting';
-
import { CF_MENU_OPERATION, OpenConditionalFormattingOperator } from '../commands/operations/open-conditional-formatting-panel';
const commandList = [SetWorksheetActiveOperation.id, AddConditionalRuleMutation.id, SetConditionalRuleMutation.id, DeleteConditionalRuleMutation.id, MoveConditionalRuleMutation.id];
-const commonSelections = [
- {
- label: 'sheet.cf.ruleType.highlightCell',
- value: CF_MENU_OPERATION.highlightCell,
- },
- {
- label: 'sheet.cf.panel.rankAndAverage',
- value: CF_MENU_OPERATION.rank,
- },
- {
- label: 'sheet.cf.ruleType.formula',
- value: CF_MENU_OPERATION.formula,
- },
- {
- label: 'sheet.cf.ruleType.colorScale',
- value: CF_MENU_OPERATION.colorScale,
- },
- {
- label: 'sheet.cf.ruleType.dataBar',
- value: CF_MENU_OPERATION.dataBar,
- }, {
- label: 'sheet.cf.ruleType.iconSet',
- value: CF_MENU_OPERATION.icon,
- },
- {
- label: 'sheet.cf.menu.manageConditionalFormatting',
- value: CF_MENU_OPERATION.viewRule,
- }, {
- label: 'sheet.cf.menu.createConditionalFormatting',
- value: CF_MENU_OPERATION.createRule,
- },
- {
- label: 'sheet.cf.menu.clearRangeRules',
- value: CF_MENU_OPERATION.clearRangeRules,
- disabled: false,
- },
- {
- label: 'sheet.cf.menu.clearWorkSheetRules',
- value: CF_MENU_OPERATION.clearWorkSheetRules,
- },
-];
-
export const FactoryManageConditionalFormattingRule = (accessor: IAccessor): IMenuSelectorItem => {
+ const commonSelections = [
+ {
+ label: 'sheet.cf.ruleType.highlightCell',
+ value: CF_MENU_OPERATION.highlightCell,
+ },
+ {
+ label: 'sheet.cf.panel.rankAndAverage',
+ value: CF_MENU_OPERATION.rank,
+ },
+ {
+ label: 'sheet.cf.ruleType.formula',
+ value: CF_MENU_OPERATION.formula,
+ },
+ {
+ label: 'sheet.cf.ruleType.colorScale',
+ value: CF_MENU_OPERATION.colorScale,
+ },
+ {
+ label: 'sheet.cf.ruleType.dataBar',
+ value: CF_MENU_OPERATION.dataBar,
+ }, {
+ label: 'sheet.cf.ruleType.iconSet',
+ value: CF_MENU_OPERATION.icon,
+ },
+ {
+ label: 'sheet.cf.menu.manageConditionalFormatting',
+ value: CF_MENU_OPERATION.viewRule,
+ }, {
+ label: 'sheet.cf.menu.createConditionalFormatting',
+ value: CF_MENU_OPERATION.createRule,
+ },
+ {
+ label: 'sheet.cf.menu.clearRangeRules',
+ value: CF_MENU_OPERATION.clearRangeRules,
+ disabled: false,
+ },
+ {
+ label: 'sheet.cf.menu.clearWorkSheetRules',
+ value: CF_MENU_OPERATION.clearWorkSheetRules,
+ },
+ ];
+
const selectionManagerService = accessor.get(SelectionManagerService);
const commandService = accessor.get(ICommandService);
const univerInstanceService = accessor.get(IUniverInstanceService);