@univerjs/sheets-conditional-formatting-ui 0.2.6 → 0.2.8

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 (50) hide show
  1. package/lib/cjs/index.js +2 -2
  2. package/lib/es/index.js +149 -98
  3. package/lib/types/commands/commands/add-average-cf.command.d.ts +0 -1
  4. package/lib/types/commands/commands/add-cf.command.d.ts +0 -1
  5. package/lib/types/commands/commands/add-color-scale-cf.command.d.ts +0 -1
  6. package/lib/types/commands/commands/add-data-bar-cf.command.d.ts +0 -1
  7. package/lib/types/commands/commands/add-duplicate-values-cf.command.d.ts +0 -1
  8. package/lib/types/commands/commands/add-number-cf.command.d.ts +0 -1
  9. package/lib/types/commands/commands/add-rank-cf.command.d.ts +0 -1
  10. package/lib/types/commands/commands/add-text-cf.command.d.ts +0 -1
  11. package/lib/types/commands/commands/add-time-period-cf.command.d.ts +0 -1
  12. package/lib/types/commands/commands/add-unique-values-cf.command.d.ts +0 -1
  13. package/lib/types/commands/commands/clear-range-cf.command.d.ts +0 -1
  14. package/lib/types/commands/commands/clear-worksheet-cf.command.d.ts +0 -1
  15. package/lib/types/commands/commands/delete-cf.command.d.ts +0 -1
  16. package/lib/types/commands/commands/move-cf.command.d.ts +0 -1
  17. package/lib/types/commands/commands/set-cf.command.d.ts +0 -1
  18. package/lib/types/commands/operations/open-conditional-formatting-panel.d.ts +0 -1
  19. package/lib/types/components/color-picker/index.d.ts +0 -1
  20. package/lib/types/components/conditional-style-editor/index.d.ts +0 -1
  21. package/lib/types/components/panel/index.d.ts +0 -1
  22. package/lib/types/components/panel/rule-edit/colorScale.d.ts +0 -1
  23. package/lib/types/components/panel/rule-edit/dataBar.d.ts +0 -1
  24. package/lib/types/components/panel/rule-edit/formula.d.ts +0 -1
  25. package/lib/types/components/panel/rule-edit/highlightCell.d.ts +0 -1
  26. package/lib/types/components/panel/rule-edit/iconSet.d.ts +0 -1
  27. package/lib/types/components/panel/rule-edit/index.d.ts +0 -1
  28. package/lib/types/components/panel/rule-edit/rank.d.ts +0 -1
  29. package/lib/types/components/panel/rule-edit/type.d.ts +0 -1
  30. package/lib/types/components/panel/rule-list/index.d.ts +0 -1
  31. package/lib/types/components/preview/index.d.ts +0 -1
  32. package/lib/types/components/wrapper-error/WrapperError.d.ts +0 -1
  33. package/lib/types/controllers/cf.auto-fill.controller.d.ts +0 -1
  34. package/lib/types/controllers/cf.clear.controller.d.ts +6 -3
  35. package/lib/types/controllers/cf.copy-paste.controller.d.ts +0 -1
  36. package/lib/types/controllers/cf.editor.controller.d.ts +0 -1
  37. package/lib/types/controllers/cf.i18n.controller.d.ts +0 -1
  38. package/lib/types/controllers/cf.menu.controller.d.ts +0 -1
  39. package/lib/types/controllers/cf.permission.controller.d.ts +0 -1
  40. package/lib/types/controllers/cf.ref-range.controller.d.ts +0 -1
  41. package/lib/types/controllers/cf.render.controller.d.ts +1 -1
  42. package/lib/types/locale/en-US.d.ts +0 -1
  43. package/lib/types/locale/ru-RU.d.ts +0 -1
  44. package/lib/types/locale/vi-VN.d.ts +0 -1
  45. package/lib/types/locale/zh-TW.d.ts +0 -1
  46. package/lib/types/menu/manage-rule.d.ts +0 -1
  47. package/lib/types/mobile-plugin.d.ts +0 -1
  48. package/lib/types/plugin.d.ts +0 -1
  49. package/lib/umd/index.js +2 -2
  50. package/package.json +23 -23
package/lib/es/index.js CHANGED
@@ -2,9 +2,9 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
3
  var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
4
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
- import { CommandType, ICommandService, IUniverInstanceService, IUndoRedoService, ObjectMatrix, Range, sequenceExecute, UniverInstanceType, Rectangle, ColorKit, BooleanNumber, Disposable, OnLifecycle, LifecycleStages, Inject, LocaleService, useDependency, createInterceptorKey, createInternalEditorID, Tools, InterceptorManager, Injector, toDisposable, Plugin, DependentOn } from "@univerjs/core";
6
- import { ConditionalFormattingRuleModel, CFRuleType, CFSubRuleType, AddConditionalRuleMutation, CFNumberOperator, setConditionalRuleMutationUndoFactory, SetConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, DeleteConditionalRuleMutation, MoveConditionalRuleMutation, transformSupportSymmetryAnchor, MoveConditionalRuleMutationUndoFactory, getColorScaleFromValue, iconMap, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, AddConditionalRuleMutationUndoFactory, CFValueType, createDefaultValueByValueType, SHEET_CONDITIONAL_FORMATTING_PLUGIN, removeUndefinedAttr, createDefaultValue, CFTextOperator, CFTimePeriodOperator, iconGroup, getOppositeOperator, compareWithNumber, EMPTY_ICON_TYPE, createDefaultRule, DEFAULT_PADDING, DEFAULT_WIDTH, ConditionalFormattingService, ConditionalFormattingViewModel, isRangesEqual, UniverSheetsConditionalFormattingPlugin, getStringFromDataStream } from "@univerjs/sheets-conditional-formatting";
7
- import { getSheetCommandTarget, SheetsSelectionsService, findAllRectangle, createTopMatrixFromMatrix, SetWorksheetActiveOperation, WorkbookEditablePermission, WorksheetSetCellStylePermission, WorksheetEditPermission, RangeProtectionPermissionEditPoint, SetSelectionsOperation, RemoveSheetMutation, setEndForRange, INTERCEPTOR_POINT, SheetInterceptorService, RefRangeService, handleDefaultRangeChangeWithEffectRefCommands, ClearSelectionFormatCommand, ClearSelectionAllCommand, RangeMergeUtil } from "@univerjs/sheets";
5
+ import { CommandType, ICommandService, IUniverInstanceService, IUndoRedoService, ObjectMatrix, Range, sequenceExecute, UniverInstanceType, Rectangle, ColorKit, BooleanNumber, Disposable, OnLifecycle, LifecycleStages, Inject, LocaleService, useDependency, Injector, createInterceptorKey, createInternalEditorID, Tools, InterceptorManager, toDisposable, Plugin, DependentOn } from "@univerjs/core";
6
+ import { ConditionalFormattingRuleModel, CFRuleType, CFSubRuleType, AddConditionalRuleMutation, CFNumberOperator, setConditionalRuleMutationUndoFactory, SetConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, DeleteConditionalRuleMutation, MoveConditionalRuleMutation, transformSupportSymmetryAnchor, MoveConditionalRuleMutationUndoFactory, getColorScaleFromValue, iconMap, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, defaultDataBarPositiveColor, defaultDataBarNativeColor, AddConditionalRuleMutationUndoFactory, CFValueType, createDefaultValueByValueType, SHEET_CONDITIONAL_FORMATTING_PLUGIN, removeUndefinedAttr, createDefaultValue, CFTextOperator, CFTimePeriodOperator, iconGroup, getOppositeOperator, compareWithNumber, EMPTY_ICON_TYPE, createDefaultRule, DEFAULT_PADDING, DEFAULT_WIDTH, ConditionalFormattingService, ConditionalFormattingViewModel, isRangesEqual, UniverSheetsConditionalFormattingPlugin, getStringFromDataStream } from "@univerjs/sheets-conditional-formatting";
7
+ import { getSheetCommandTarget, SheetsSelectionsService, findAllRectangle, createTopMatrixFromMatrix, SetWorksheetActiveOperation, checkRangesEditablePermission, WorkbookEditablePermission, WorksheetSetCellStylePermission, WorksheetEditPermission, RangeProtectionPermissionEditPoint, SetSelectionsOperation, RemoveSheetMutation, setEndForRange, INTERCEPTOR_POINT, SheetInterceptorService, RefRangeService, handleDefaultRangeChangeWithEffectRefCommands, ClearSelectionFormatCommand, ClearSelectionAllCommand, RangeMergeUtil } from "@univerjs/sheets";
8
8
  import { MenuItemType, MenuGroup, MenuPosition, getMenuHiddenObservable, useObservable, ComponentManager, TextEditor, ILayoutService, useScrollYOverContainer, RangeSelector, IMenuService, ISidebarService } from "@univerjs/ui";
9
9
  import { Observable, merge, debounceTime as debounceTime$1 } from "rxjs";
10
10
  import { debounceTime, bufferTime, filter } from "rxjs/operators";
@@ -288,9 +288,7 @@ const AddAverageCfCommand = {
288
288
  undoMutations: undos
289
289
  }), result;
290
290
  }
291
- };
292
- var P = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(P || {});
293
- const commandList = [SetWorksheetActiveOperation.id, AddConditionalRuleMutation.id, SetConditionalRuleMutation.id, DeleteConditionalRuleMutation.id, MoveConditionalRuleMutation.id], FactoryManageConditionalFormattingRule = /* @__PURE__ */ __name((accessor) => {
291
+ }, commandList = [SetWorksheetActiveOperation.id, AddConditionalRuleMutation.id, SetConditionalRuleMutation.id, DeleteConditionalRuleMutation.id, MoveConditionalRuleMutation.id], FactoryManageConditionalFormattingRule = /* @__PURE__ */ __name((accessor) => {
294
292
  const commonSelections = [
295
293
  {
296
294
  label: "sheet.cf.ruleType.highlightCell",
@@ -349,20 +347,17 @@ const commandList = [SetWorksheetActiveOperation.id, AddConditionalRuleMutation.
349
347
  if (!workbook) return;
350
348
  const worksheet = workbook.getActiveSheet();
351
349
  if (!worksheet) return;
352
- const ruleList = (conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId()) || []).filter((rule) => rule.ranges.some((ruleRange2) => ranges.some((range) => Rectangle.intersects(range, ruleRange2))));
353
- subscriber.next(!!ruleList.length);
350
+ const hasPermission = (conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId()) || []).filter((rule) => rule.ranges.some((ruleRange2) => ranges.some((range) => Rectangle.intersects(range, ruleRange2)))).map((rule) => rule.ranges).every((ranges2) => checkRangesEditablePermission(accessor, workbook.getUnitId(), worksheet.getSheetId(), ranges2));
351
+ subscriber.next(hasPermission);
354
352
  })), clearSheetEnable$ = new Observable(
355
- (subscriber) => merge(
356
- selectionManagerService.selectionMoveEnd$,
357
- new Observable((commandSubscribe) => {
358
- const disposable = commandService.onCommandExecuted((commandInfo) => {
359
- var _a13;
360
- const { id, params } = commandInfo, unitId = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a13.getUnitId();
361
- commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
362
- });
363
- return () => disposable.dispose();
364
- })
365
- ).pipe(debounceTime(16)).subscribe(() => {
353
+ (subscriber) => new Observable((commandSubscribe) => {
354
+ const disposable = commandService.onCommandExecuted((commandInfo) => {
355
+ var _a13;
356
+ const { id, params } = commandInfo, unitId = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a13.getUnitId();
357
+ commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
358
+ });
359
+ return () => disposable.dispose();
360
+ }).pipe(debounceTime(16)).subscribe(() => {
366
361
  const workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
367
362
  if (!workbook) return;
368
363
  const worksheet = workbook.getActiveSheet();
@@ -370,18 +365,8 @@ const commandList = [SetWorksheetActiveOperation.id, AddConditionalRuleMutation.
370
365
  const allRule = conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId()) || [];
371
366
  if (!allRule.length)
372
367
  return subscriber.next(!1), !1;
373
- const hasNotPermission = allRule.some((rule) => rule.ranges.some((range) => {
374
- var _a13, _b;
375
- const { startRow, startColumn, endRow, endColumn } = range;
376
- for (let row = startRow; row <= endRow; row++)
377
- for (let col = startColumn; col <= endColumn; col++) {
378
- const permission = (_b = (_a13 = worksheet.getCell(row, col)) == null ? void 0 : _a13.selectionProtection) == null ? void 0 : _b[0];
379
- if ((permission == null ? void 0 : permission[P.Edit]) === !1 || (permission == null ? void 0 : permission[P.View]) === !1)
380
- return !0;
381
- }
382
- return !1;
383
- }));
384
- subscriber.next(!hasNotPermission);
368
+ const hasPermission = allRule.map((rule) => rule.ranges).every((ranges) => checkRangesEditablePermission(accessor, workbook.getUnitId(), worksheet.getSheetId(), ranges));
369
+ subscriber.next(hasPermission);
385
370
  })
386
371
  ), selections$ = new Observable((subscriber) => {
387
372
  clearRangeEnable$.subscribe((v) => {
@@ -4635,10 +4620,10 @@ const GridLayout = /* @__PURE__ */ getDefaultExportFromCjs(reactGridLayoutExport
4635
4620
  }, [rule]);
4636
4621
  switch (rule.type) {
4637
4622
  case CFRuleType.dataBar: {
4638
- const { isGradient } = rule.config, commonStyle = { width: "50%", height: "100%" }, positiveColor = isGradient ? `linear-gradient(to right, ${rule.config.positiveColor}, rgb(255 255 255))` : rule.config.positiveColor, nativeColor = isGradient ? `linear-gradient(to right, rgb(255 255 255),${rule.config.nativeColor})` : rule.config.nativeColor;
4623
+ const { isGradient } = rule.config, commonStyle = { width: "50%", height: "100%" }, positiveColor = isGradient ? `linear-gradient(to right, ${rule.config.positiveColor || defaultDataBarPositiveColor}, rgb(255 255 255))` : rule.config.positiveColor, nativeColor = isGradient ? `linear-gradient(to right, rgb(255 255 255),${rule.config.nativeColor || defaultDataBarNativeColor})` : rule.config.nativeColor;
4639
4624
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$4.cfPreview, children: [
4640
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...commonStyle, background: nativeColor, border: `1px solid ${rule.config.nativeColor}` } }),
4641
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...commonStyle, background: positiveColor, border: `1px solid ${rule.config.positiveColor}` } })
4625
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...commonStyle, background: nativeColor, border: `1px solid ${rule.config.nativeColor || defaultDataBarNativeColor}` } }),
4626
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { ...commonStyle, background: positiveColor, border: `1px solid ${rule.config.positiveColor || defaultDataBarPositiveColor}` } })
4642
4627
  ] });
4643
4628
  }
4644
4629
  case CFRuleType.colorScale:
@@ -4764,7 +4749,7 @@ const cfRuleList = "univer-cf-rule-list", ruleSelector = "univer-rule-selector",
4764
4749
  }, "getRuleDescribe");
4765
4750
  let defaultWidth = 0;
4766
4751
  const RuleList = /* @__PURE__ */ __name((props) => {
4767
- const { onClick } = props, conditionalFormattingRuleModel = useDependency(ConditionalFormattingRuleModel), univerInstanceService = useDependency(IUniverInstanceService), selectionManagerService = useDependency(SheetsSelectionsService), commandService = useDependency(ICommandService), localeService = useDependency(LocaleService), conditionalFormattingI18nController = useDependency(ConditionalFormattingI18nController), workbook = useObservable(() => univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET), void 0, void 0, []), unitId = workbook.getUnitId(), worksheet = workbook.getActiveSheet();
4752
+ const { onClick } = props, conditionalFormattingRuleModel = useDependency(ConditionalFormattingRuleModel), univerInstanceService = useDependency(IUniverInstanceService), selectionManagerService = useDependency(SheetsSelectionsService), commandService = useDependency(ICommandService), localeService = useDependency(LocaleService), injector = useDependency(Injector), conditionalFormattingI18nController = useDependency(ConditionalFormattingI18nController), workbook = useObservable(() => univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET), void 0, void 0, []), unitId = workbook.getUnitId(), worksheet = workbook.getActiveSheet();
4768
4753
  if (!worksheet)
4769
4754
  throw new Error("No active sheet found");
4770
4755
  const subUnitId = worksheet.getSheetId(), [currentRuleRanges, currentRuleRangesSet] = useState([]), [selectValue, selectValueSet] = useState("2"), [fetchRuleListId, fetchRuleListIdSet] = useState(0), [draggingId, draggingIdSet] = useState(-1), [layoutWidth, layoutWidthSet] = useState(defaultWidth), layoutContainerRef = useRef(null), selectOption = [
@@ -4781,25 +4766,9 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4781
4766
  const range = selection.range;
4782
4767
  return ruleList2.filter((rule) => rule.ranges.some((ruleRange2) => Rectangle.intersects(ruleRange2, range)));
4783
4768
  } else if (selectValue === "2")
4784
- return ruleList2;
4769
+ return [...ruleList2];
4785
4770
  return [];
4786
- }, "getRuleList"), getConditionalFormattingRulesByPermissionCorrect = /* @__PURE__ */ __name((rules) => {
4787
- const worksheet2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet();
4788
- return rules.map((rule) => {
4789
- const ranges = rule.ranges;
4790
- return (ranges == null ? void 0 : ranges.some((range) => {
4791
- var _a13, _b;
4792
- const { startRow, startColumn, endRow, endColumn } = range;
4793
- for (let row = startRow; row <= endRow; row++)
4794
- for (let col = startColumn; col <= endColumn; col++) {
4795
- const permission = (_b = (_a13 = worksheet2 == null ? void 0 : worksheet2.getCell(row, col)) == null ? void 0 : _a13.selectionProtection) == null ? void 0 : _b[0];
4796
- if ((permission == null ? void 0 : permission[P.Edit]) === !1 || (permission == null ? void 0 : permission[P.View]) === !1)
4797
- return !0;
4798
- }
4799
- return !1;
4800
- })) ? { ...rule, disable: !0 } : { ...rule };
4801
- });
4802
- }, "getConditionalFormattingRulesByPermissionCorrect"), [ruleList, ruleListSet] = useState(getRuleList);
4771
+ }, "getRuleList"), [ruleList, ruleListSet] = useState(getRuleList);
4803
4772
  useHighlightRange(currentRuleRanges), useEffect(() => {
4804
4773
  const disposable = commandService.onCommandExecuted((commandInfo) => {
4805
4774
  commandInfo.id === SetWorksheetActiveOperation.id && fetchRuleListIdSet(Math.random());
@@ -4879,7 +4848,19 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4879
4848
  selectValue === "2" ? commandService.executeCommand(ClearWorksheetCfCommand.id) : selectValue === "1" && ruleList.map((rule) => ({ unitId, subUnitId, cfId: rule.cfId })).forEach((config) => {
4880
4849
  commandService.executeCommand(DeleteCfCommand.id, config);
4881
4850
  });
4882
- }, "handleClear"), layout = ruleList.map((rule, index2) => ({ i: rule.cfId, x: 0, w: 12, y: index2, h: 1, isResizable: !1 })), ruleListByPermissionCheck = getConditionalFormattingRulesByPermissionCorrect(ruleList), hasDisableRule = ruleListByPermissionCheck == null ? void 0 : ruleListByPermissionCheck.some((rule) => rule.disable);
4851
+ }, "handleClear"), ruleListByPermissionCheck = useMemo(() => {
4852
+ const workbook2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet2 = workbook2.getActiveSheet();
4853
+ return ruleList.filter((rule) => {
4854
+ const ranges = rule.ranges;
4855
+ return checkRangesEditablePermission(injector, workbook2.getUnitId(), worksheet2.getSheetId(), ranges);
4856
+ });
4857
+ }, [ruleList]), layout = ruleListByPermissionCheck.map((rule, index2) => ({ i: rule.cfId, x: 0, w: 12, y: index2, h: 1, isResizable: !1 })), isHasAllRuleEditPermission = useMemo(() => {
4858
+ const workbook2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet2 = workbook2.getActiveSheet();
4859
+ return ruleList.every((rule) => {
4860
+ const ranges = rule.ranges;
4861
+ return checkRangesEditablePermission(injector, workbook2.getUnitId(), worksheet2.getSheetId(), ranges);
4862
+ });
4863
+ }, [ruleList]);
4883
4864
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.cfRuleList, children: [
4884
4865
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.ruleSelector, children: [
4885
4866
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: conditionalFormattingI18nController.tWithReactNode(
@@ -4890,7 +4871,7 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4890
4871
  ).map((ele, index2) => /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: ele }, index2)) }),
4891
4872
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$3.btnList, children: [
4892
4873
  /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: localeService.t("sheet.cf.panel.createRule"), placement: "bottom", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$3.icon}`, onClick: handleCreate, children: /* @__PURE__ */ jsxRuntimeExports.jsx(IncreaseSingle, {}) }) }),
4893
- ruleList.length && !hasDisableRule ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: localeService.t("sheet.cf.panel.clear"), placement: "bottom", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$3.gap} ${styles$3.icon}`, onClick: handleClear, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteSingle, {}) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$3.gap} ${styles$3.disabled}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteSingle, {}) })
4874
+ ruleList.length && isHasAllRuleEditPermission ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { title: localeService.t("sheet.cf.panel.clear"), placement: "bottom", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$3.gap} ${styles$3.icon}`, onClick: handleClear, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteSingle, {}) }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `${styles$3.gap} ${styles$3.disabled}`, children: /* @__PURE__ */ jsxRuntimeExports.jsx(DeleteSingle, {}) })
4894
4875
  ] })
4895
4876
  ] }),
4896
4877
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: layoutContainerRef, className: styles$3.gridLayoutWrap, children: layoutWidth ? /* @__PURE__ */ jsxRuntimeExports.jsx(
@@ -4912,7 +4893,7 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4912
4893
  }, "onMouseMove"),
4913
4894
  onMouseLeave: /* @__PURE__ */ __name(() => currentRuleRangesSet([]), "onMouseLeave"),
4914
4895
  onClick: /* @__PURE__ */ __name(() => {
4915
- rule.disable || onClick(rule);
4896
+ onClick(rule);
4916
4897
  }, "onClick"),
4917
4898
  className: `${styles$3.ruleItem} ${draggingId === index2 ? styles$3.active : ""}`,
4918
4899
  children: [
@@ -4929,7 +4910,7 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4929
4910
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.ruleRange, children: rule.ranges.map((range) => serializeRange(range)).join(",") })
4930
4911
  ] }),
4931
4912
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$3.preview, children: /* @__PURE__ */ jsxRuntimeExports.jsx(Preview, { rule: rule.rule }) }),
4932
- !rule.disable && /* @__PURE__ */ jsxRuntimeExports.jsx(
4913
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
4933
4914
  "div",
4934
4915
  {
4935
4916
  className: `${styles$3.deleteItem} ${draggingId === index2 ? styles$3.active : ""}`,
@@ -5265,12 +5246,10 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5265
5246
  return rule ? (_a14 = rule.config) != null && _a14.isGradient ? "1" : "0" : defaultV;
5266
5247
  }), [positiveColor, positiveColorSet] = useState(() => {
5267
5248
  var _a14;
5268
- const defaultV = "#abd91a";
5269
- return rule && ((_a14 = rule.config) == null ? void 0 : _a14.positiveColor) || defaultV;
5249
+ return rule ? ((_a14 = rule.config) == null ? void 0 : _a14.positiveColor) || defaultDataBarPositiveColor : defaultDataBarPositiveColor;
5270
5250
  }), [nativeColor, nativeColorSet] = useState(() => {
5271
5251
  var _a14;
5272
- const defaultV = "#ffbe38";
5273
- return rule && ((_a14 = rule.config) == null ? void 0 : _a14.nativeColor) || defaultV;
5252
+ return rule ? ((_a14 = rule.config) == null ? void 0 : _a14.nativeColor) || defaultDataBarNativeColor : defaultDataBarNativeColor;
5274
5253
  }), commonOptions = [createOptionItem$1(CFValueType.num, localeService), createOptionItem$1(CFValueType.percent, localeService), createOptionItem$1(CFValueType.percentile, localeService), createOptionItem$1(CFValueType.formula, localeService)], minOptions = [createOptionItem$1(CFValueType.min, localeService), ...commonOptions], maxOptions = [createOptionItem$1(CFValueType.max, localeService), ...commonOptions], [minValueType, minValueTypeSet] = useState(() => {
5275
5254
  var _a14;
5276
5255
  const defaultV = minOptions[0].value;
@@ -5295,8 +5274,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5295
5274
  min: { type: option.minValueType, value: option.minValue },
5296
5275
  max: { type: option.maxValueType, value: option.maxValue },
5297
5276
  isGradient: option.isGradient === "1",
5298
- positiveColor: option.positiveColor,
5299
- nativeColor: option.nativeColor
5277
+ positiveColor: option.positiveColor || defaultDataBarPositiveColor,
5278
+ nativeColor: option.nativeColor || defaultDataBarNativeColor
5300
5279
  }, type: CFRuleType.dataBar, isShowValue: option.isShowValue }), "getResult");
5301
5280
  useEffect(() => interceptorManager.intercept(interceptorManager.getInterceptPoints().submit, {
5302
5281
  handler() {
@@ -5864,11 +5843,9 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5864
5843
  handler() {
5865
5844
  return getResult({ style, formula });
5866
5845
  }
5867
- }), [style, formula, interceptorManager]), useEffect(() => {
5868
- interceptorManager.intercept(interceptorManager.getInterceptPoints().beforeSubmit, {
5869
- handler: /* @__PURE__ */ __name((v, _c, next) => !formula || formula.length === 1 || !formulaError.startsWith("=") ? (formulaErrorSet(localeService.t("sheet.cf.errorMessage.formulaError")), !1) : next(v), "handler")
5870
- });
5871
- }, [formula]);
5846
+ }), [style, formula, interceptorManager]), useEffect(() => interceptorManager.intercept(interceptorManager.getInterceptPoints().beforeSubmit, {
5847
+ handler: /* @__PURE__ */ __name((v, _c, next) => !formula || formula.length === 1 || !formula.startsWith("=") ? (formulaErrorSet(localeService.t("sheet.cf.errorMessage.formulaError")), !1) : next(v), "handler")
5848
+ }), [formula]);
5872
5849
  const _onChange = /* @__PURE__ */ __name((config) => {
5873
5850
  onChange(getResult(config));
5874
5851
  }, "_onChange");
@@ -6970,7 +6947,7 @@ var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPrope
6970
6947
  }, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$8"), _a4;
6971
6948
  let SheetsCfRenderController = (_a4 = class extends Disposable {
6972
6949
  constructor(_sheetInterceptorService, _conditionalFormattingService, _univerInstanceService, _renderManagerService, _conditionalFormattingViewModel, _conditionalFormattingRuleModel) {
6973
- super(), this._sheetInterceptorService = _sheetInterceptorService, this._conditionalFormattingService = _conditionalFormattingService, this._univerInstanceService = _univerInstanceService, this._renderManagerService = _renderManagerService, this._conditionalFormattingViewModel = _conditionalFormattingViewModel, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._initViewModelInterceptor(), this._initSkeleton();
6950
+ super(), this._sheetInterceptorService = _sheetInterceptorService, this._conditionalFormattingService = _conditionalFormattingService, this._univerInstanceService = _univerInstanceService, this._renderManagerService = _renderManagerService, this._conditionalFormattingViewModel = _conditionalFormattingViewModel, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._initViewModelInterceptor(), this._initSkeleton(), this._initVmEffectByRule();
6974
6951
  }
6975
6952
  _initSkeleton() {
6976
6953
  const markDirtySkeleton = /* @__PURE__ */ __name(() => {
@@ -6995,6 +6972,65 @@ let SheetsCfRenderController = (_a4 = class extends Disposable {
6995
6972
  return worksheet ? v.filter((item2) => item2.unitId === workbook.getUnitId() && item2.subUnitId === worksheet.getSheetId()).length > 0 : !1;
6996
6973
  })).subscribe(markDirtySkeleton));
6997
6974
  }
6975
+ _initVmEffectByRule() {
6976
+ this.disposeWithMe(
6977
+ this._conditionalFormattingRuleModel.$ruleChange.subscribe((config) => {
6978
+ const { rule, unitId, subUnitId } = config;
6979
+ switch (config.type) {
6980
+ case "add": {
6981
+ const cfPriorityMap = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId).map((item2) => item2.cfId).reduce((map, cur, index2) => (map.set(cur, index2), map), /* @__PURE__ */ new Map());
6982
+ rule.ranges.forEach((range) => {
6983
+ Range.foreach(range, (row, col) => {
6984
+ this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, rule.cfId), this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
6985
+ });
6986
+ }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
6987
+ return;
6988
+ }
6989
+ case "delete": {
6990
+ rule.ranges.forEach((range) => {
6991
+ Range.foreach(range, (row, col) => {
6992
+ this._conditionalFormattingViewModel.deleteCellCf(unitId, subUnitId, row, col, rule.cfId);
6993
+ });
6994
+ }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
6995
+ return;
6996
+ }
6997
+ case "set": {
6998
+ const oldRule = config.oldRule, cfPriorityMap = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId).map((item2) => item2.cfId).reduce((map, cur, index2) => (map.set(cur, index2), map), /* @__PURE__ */ new Map()), dispose = this._conditionalFormattingService.interceptorManager.intercept(this._conditionalFormattingService.interceptorManager.getInterceptPoints().beforeUpdateRuleResult, {
6999
+ handler: /* @__PURE__ */ __name((config2, _, next) => {
7000
+ if (unitId === (config2 == null ? void 0 : config2.unitId) && subUnitId === config2.subUnitId && oldRule.cfId === config2.cfId) {
7001
+ oldRule.ranges.forEach((range) => {
7002
+ Range.foreach(range, (row, col) => {
7003
+ this._conditionalFormattingViewModel.deleteCellCf(unitId, subUnitId, row, col, oldRule.cfId);
7004
+ });
7005
+ }), rule.ranges.forEach((range) => {
7006
+ Range.foreach(range, (row, col) => {
7007
+ this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, oldRule.cfId), this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
7008
+ });
7009
+ }), dispose();
7010
+ return;
7011
+ }
7012
+ next(config2);
7013
+ }, "handler")
7014
+ });
7015
+ rule.ranges.forEach((range) => {
7016
+ Range.foreach(range, (row, col) => {
7017
+ this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, oldRule.cfId);
7018
+ });
7019
+ }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
7020
+ return;
7021
+ }
7022
+ case "sort": {
7023
+ const cfPriorityMap = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId).map((item2) => item2.cfId).reduce((map, cur, index2) => (map.set(cur, index2), map), /* @__PURE__ */ new Map());
7024
+ rule.ranges.forEach((range) => {
7025
+ Range.foreach(range, (row, col) => {
7026
+ this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
7027
+ });
7028
+ });
7029
+ }
7030
+ }
7031
+ })
7032
+ );
7033
+ }
6998
7034
  _initViewModelInterceptor() {
6999
7035
  this.disposeWithMe(this._sheetInterceptorService.intercept(INTERCEPTOR_POINT.CELL_CONTENT, {
7000
7036
  handler: /* @__PURE__ */ __name((cell, context, next) => {
@@ -7009,7 +7045,7 @@ let SheetsCfRenderController = (_a4 = class extends Disposable {
7009
7045
  }
7010
7046
  }, __name(_a4, "SheetsCfRenderController"), _a4);
7011
7047
  SheetsCfRenderController = __decorateClass$8([
7012
- OnLifecycle(LifecycleStages.Rendered, SheetsCfRenderController),
7048
+ OnLifecycle(LifecycleStages.Starting, SheetsCfRenderController),
7013
7049
  __decorateParam$8(0, Inject(SheetInterceptorService)),
7014
7050
  __decorateParam$8(1, Inject(ConditionalFormattingService)),
7015
7051
  __decorateParam$8(2, Inject(IUniverInstanceService)),
@@ -7053,9 +7089,7 @@ let ConditionalFormattingCopyPasteController = (_a5 = class extends Disposable {
7053
7089
  const model = this._conditionalFormattingViewModel.getMatrix(unitId, subUnitId);
7054
7090
  if (!model)
7055
7091
  return;
7056
- const accessor = {
7057
- get: this._injector.get.bind(this._injector)
7058
- }, discreteRange = rangeToDiscreteRange(range, accessor, unitId, subUnitId);
7092
+ const discreteRange = this._injector.invoke((accessor) => rangeToDiscreteRange(range, accessor, unitId, subUnitId));
7059
7093
  if (!discreteRange)
7060
7094
  return;
7061
7095
  const { rows, cols } = discreteRange, cfIdSet = /* @__PURE__ */ new Set();
@@ -7517,36 +7551,25 @@ let ConditionalFormattingClearController = (_a11 = class extends Disposable {
7517
7551
  const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet();
7518
7552
  if (!worksheet)
7519
7553
  return defaultV;
7520
- const allRules = this._conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId());
7554
+ const unitId = workbook.getUnitId(), subUnitId = worksheet.getSheetId(), allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
7521
7555
  if (!allRules || !allRules.length)
7522
7556
  return defaultV;
7523
- allRules.filter((rule) => ranges.some((range) => rule.ranges.some((ruleRange2) => Rectangle.getIntersects(ruleRange2, range)))).forEach((rule) => {
7524
- const mergeRanges = new RangeMergeUtil().add(...rule.ranges).subtract(...ranges).merge();
7525
- if (mergeRanges.length) {
7526
- const redo = {
7527
- id: SetConditionalRuleMutation.id,
7528
- params: {
7529
- unitId: workbook.getUnitId(),
7530
- subUnitId: worksheet.getSheetId(),
7531
- rule: { ...rule, ranges: mergeRanges }
7532
- }
7533
- }, undo = setConditionalRuleMutationUndoFactory(this._injector, redo.params);
7534
- redos.push(redo), undos.push(...undo);
7535
- } else {
7536
- const redo = {
7537
- id: DeleteConditionalRuleMutation.id,
7538
- params: {
7539
- unitId: workbook.getUnitId(),
7540
- subUnitId: worksheet.getSheetId(),
7541
- cfId: rule.cfId
7542
- }
7543
- }, undo = DeleteConditionalRuleMutationUndoFactory(this._injector, redo.params);
7544
- redos.push(redo), undos.push(...undo);
7545
- }
7546
- });
7557
+ const { redos: interceptRedos, undos: interceptUndos } = generateClearCfMutations(this._injector, allRules, ranges, unitId, subUnitId);
7558
+ redos.push(...interceptRedos), undos.push(...interceptUndos);
7547
7559
  }
7548
7560
  return defaultV;
7549
7561
  }, "getMutations")
7562
+ })), this.disposeWithMe(this._sheetInterceptorService.interceptRanges({
7563
+ getMutations: /* @__PURE__ */ __name(({ unitId, subUnitId, ranges }) => {
7564
+ const redos = [], undos = [], emptyInterceptorArr = { redos, undos };
7565
+ if (!ranges || !ranges.length)
7566
+ return emptyInterceptorArr;
7567
+ const allRules = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
7568
+ if (!allRules || !allRules.length)
7569
+ return emptyInterceptorArr;
7570
+ const { redos: interceptRedos, undos: interceptUndos } = generateClearCfMutations(this._injector, allRules, ranges, unitId, subUnitId);
7571
+ return redos.push(...interceptRedos), undos.push(...interceptUndos), emptyInterceptorArr;
7572
+ }, "getMutations")
7550
7573
  }));
7551
7574
  }
7552
7575
  }, __name(_a11, "ConditionalFormattingClearController"), _a11);
@@ -7558,6 +7581,34 @@ ConditionalFormattingClearController = __decorateClass$1([
7558
7581
  __decorateParam$1(3, Inject(SheetsSelectionsService)),
7559
7582
  __decorateParam$1(4, Inject(ConditionalFormattingRuleModel))
7560
7583
  ], ConditionalFormattingClearController);
7584
+ function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId) {
7585
+ const redos = [], undos = [];
7586
+ return allRules.filter((rule) => ranges.some((range) => rule.ranges.some((ruleRange2) => Rectangle.getIntersects(ruleRange2, range)))).forEach((rule) => {
7587
+ const mergeRanges = new RangeMergeUtil().add(...rule.ranges).subtract(...ranges).merge();
7588
+ if (mergeRanges.length) {
7589
+ const redo = {
7590
+ id: SetConditionalRuleMutation.id,
7591
+ params: {
7592
+ unitId,
7593
+ subUnitId,
7594
+ rule: { ...rule, ranges: mergeRanges }
7595
+ }
7596
+ }, undo = setConditionalRuleMutationUndoFactory(injector, redo.params);
7597
+ redos.push(redo), undos.push(...undo);
7598
+ } else {
7599
+ const redo = {
7600
+ id: DeleteConditionalRuleMutation.id,
7601
+ params: {
7602
+ unitId,
7603
+ subUnitId,
7604
+ cfId: rule.cfId
7605
+ }
7606
+ }, undo = DeleteConditionalRuleMutationUndoFactory(injector, redo.params);
7607
+ redos.push(redo), undos.push(...undo);
7608
+ }
7609
+ }), { redos, undos };
7610
+ }
7611
+ __name(generateClearCfMutations, "generateClearCfMutations");
7561
7612
  var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __defNormalProp2 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp"), __decorateClass = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7562
7613
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7563
7614
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { IAverageHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddAverageCfParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand } from '@univerjs/core';
2
2
  import { IConditionFormattingRule, MakePropertyOptional } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  export interface IAddCfCommandParams {
5
4
  unitId?: string;
6
5
  subUnitId?: string;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { IColorScale } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddColorScaleConditionalRuleParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { IDataBar } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddUniqueValuesConditionalRuleParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { IHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddDuplicateValuesConditionalRuleParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { INumberHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddNumberCfParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { IRankHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddRankCfParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { ITextHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddAverageCfParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { ITimePeriodHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddTimePeriodCf {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,6 +1,5 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
2
  import { IHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IAddUniqueValuesConditionalRuleParams {
5
4
  ranges: IRange[];
6
5
  stopIfTrue?: boolean;
@@ -1,5 +1,4 @@
1
1
  import { ICommand, IRange } from '@univerjs/core';
2
-
3
2
  export interface IClearRangeCfParams {
4
3
  ranges?: IRange[];
5
4
  unitId?: string;
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export interface IClearWorksheetCfParams {
4
3
  unitId?: string;
5
4
  subUnitId?: string;
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export interface IDeleteCfCommandParams {
4
3
  unitId?: string;
5
4
  subUnitId?: string;
@@ -1,6 +1,5 @@
1
1
  import { ICommand } from '@univerjs/core';
2
2
  import { IAnchor } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  export interface IMoveCfCommand {
5
4
  unitId?: string;
6
5
  subUnitId?: string;
@@ -1,6 +1,5 @@
1
1
  import { ICommand } from '@univerjs/core';
2
2
  import { IConditionFormattingRule } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  export interface ISetCfCommandParams {
5
4
  unitId?: string;
6
5
  subUnitId?: string;
@@ -1,5 +1,4 @@
1
1
  import { ICommand } from '@univerjs/core';
2
-
3
2
  export declare enum CF_MENU_OPERATION {
4
3
  createRule = 1,
5
4
  viewRule = 2,
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
-
3
2
  interface IColorPickerProps {
4
3
  color: string;
5
4
  onChange: (color: string) => void;
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IConditionalStyleEditorProps {
5
4
  className?: string;
6
5
  style?: IHighlightCell['style'];
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IConditionFormattingRule } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IConditionFormattingPanelProps {
5
4
  rule?: IConditionFormattingRule;
6
5
  }
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IStyleEditorProps } from './type';
3
-
4
3
  export declare const ColorScaleStyleEditor: (props: IStyleEditorProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IStyleEditorProps } from './type';
3
-
4
3
  export declare const DataBarStyleEditor: (props: IStyleEditorProps) => React.JSX.Element;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IStyleEditorProps } from './type';
3
-
4
3
  export declare const FormulaStyleEditor: (props: IStyleEditorProps) => React.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { INumberHighlightCell, ITextHighlightCell, ITimePeriodHighlightCell } from '@univerjs/sheets-conditional-formatting';
3
3
  import { IStyleEditorProps } from './type';
4
-
5
4
  export declare const HighlightCellStyleEditor: (props: IStyleEditorProps<any, ITextHighlightCell | INumberHighlightCell | ITimePeriodHighlightCell>) => React.JSX.Element;
@@ -1,5 +1,4 @@
1
1
  import { default as React } from 'react';
2
2
  import { IIconSet } from '@univerjs/sheets-conditional-formatting';
3
3
  import { IStyleEditorProps } from './type';
4
-
5
4
  export declare const IconSet: (props: IStyleEditorProps<unknown, IIconSet>) => React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IConditionFormattingRule } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IRuleEditProps {
5
4
  rule?: IConditionFormattingRule;
6
5
  onCancel: () => void;
@@ -1,4 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { IStyleEditorProps } from './type';
3
-
4
3
  export declare const RankStyleEditor: (props: IStyleEditorProps) => React.JSX.Element;
@@ -1,6 +1,5 @@
1
1
  import { InterceptorManager } from '@univerjs/core';
2
2
  import { IConditionalFormattingRuleConfig } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  export declare const beforeSubmit: import('@univerjs/core').IInterceptor<boolean, null>;
5
4
  export declare const submit: import('@univerjs/core').IInterceptor<any, null>;
6
5
  export interface IStyleEditorProps<S = any, R = IConditionalFormattingRuleConfig> {
@@ -1,6 +1,5 @@
1
1
  import { default as React } from 'react';
2
2
  import { IConditionFormattingRule } from '@univerjs/sheets-conditional-formatting';
3
-
4
3
  interface IRuleListProps {
5
4
  onClick: (rule: IConditionFormattingRule) => void;
6
5
  onCreate: () => void;