@univerjs/sheets-conditional-formatting-ui 0.2.11 → 0.2.13

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.
package/lib/es/index.js CHANGED
@@ -2,18 +2,18 @@ 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, 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
- import { MenuItemType, MenuGroup, MenuPosition, getMenuHiddenObservable, useObservable, ComponentManager, TextEditor, ILayoutService, useScrollYOverContainer, RangeSelector, IMenuService, ISidebarService } from "@univerjs/ui";
9
- import { Observable, merge, debounceTime as debounceTime$1 } from "rxjs";
10
- import { debounceTime, bufferTime, filter } from "rxjs/operators";
11
- import { getCurrentRangeDisable$, useHighlightRange, SheetSkeletonManagerService, COPY_TYPE, rangeToDiscreteRange, PREDEFINED_HOOK_NAME, virtualizeDiscreteRanges, getRepeatRange, ISheetClipboardService, SheetPermissionInterceptorBaseController, IAutoFillService, APPLY_TYPE, getAutoFillRepeatRange, IEditorBridgeService } from "@univerjs/sheets-ui";
5
+ import { CommandType, ICommandService, IUniverInstanceService, IUndoRedoService, ObjectMatrix, Range, sequenceExecute, ColorKit, BooleanNumber, Disposable, OnLifecycle, LifecycleStages, Inject, LocaleService, useDependency, Injector, UniverInstanceType, Rectangle, createInterceptorKey, createInternalEditorID, Tools, InterceptorManager, generateRandomId, toDisposable, Plugin, DependentOn, IConfigService } from "@univerjs/core";
6
+ import { ConditionalFormattingRuleModel, CFRuleType, CFSubRuleType, AddConditionalRuleMutation, CFNumberOperator, setConditionalRuleMutationUndoFactory, SetConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, DeleteConditionalRuleMutation, transformSupportSymmetryAnchor, MoveConditionalRuleMutationUndoFactory, MoveConditionalRuleMutation, 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, SetSelectionsOperation, checkRangesEditablePermission, RemoveSheetMutation, setEndForRange, INTERCEPTOR_POINT, SheetInterceptorService, RefRangeService, handleDefaultRangeChangeWithEffectRefCommands, WorkbookEditablePermission, RangeProtectionPermissionEditPoint, WorksheetEditPermission, WorksheetSetCellStylePermission, ClearSelectionFormatCommand, ClearSelectionAllCommand, RangeMergeUtil } from "@univerjs/sheets";
8
+ import { useObservable, ComponentManager, TextEditor, ILayoutService, useScrollYOverContainer, RangeSelector, ISidebarService, MenuItemType, getMenuHiddenObservable, RibbonStartGroup, IMenuManagerService } from "@univerjs/ui";
12
9
  import require$$0, { forwardRef, useRef, createElement, useMemo, useState, useEffect } from "react";
13
10
  import { Select, Tooltip, Dropdown, ColorPicker as ColorPicker$1, InputNumber, RadioGroup, Radio, Checkbox, Input, Button } from "@univerjs/design";
11
+ import { useHighlightRange, SheetSkeletonManagerService, COPY_TYPE, rangeToDiscreteRange, PREDEFINED_HOOK_NAME, virtualizeDiscreteRanges, getRepeatRange, ISheetClipboardService, SheetPermissionInterceptorBaseController, IAutoFillService, APPLY_TYPE, getAutoFillRepeatRange, IEditorBridgeService, getCurrentRangeDisable$, IFormatPainterService, FormatPainterStatus } from "@univerjs/sheets-ui";
14
12
  import { serializeRange } from "@univerjs/engine-formula";
15
13
  import cl from "clsx";
16
14
  import require$$2$1 from "react-dom";
15
+ import { Observable, debounceTime, merge } from "rxjs";
16
+ import { bufferTime, filter, debounceTime as debounceTime$1 } from "rxjs/operators";
17
17
  import { IRenderManagerService } from "@univerjs/engine-render";
18
18
  const AddAverageCfCommand = {
19
19
  type: CommandType.COMMAND,
@@ -236,12 +236,12 @@ const AddAverageCfCommand = {
236
236
  type: CommandType.COMMAND,
237
237
  id: "sheet.command.clear-range-conditional-rule",
238
238
  handler(accessor, params) {
239
- var _a13;
239
+ var _a15;
240
240
  if (!params)
241
241
  return !1;
242
242
  const conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel), univerInstanceService = accessor.get(IUniverInstanceService), commandService = accessor.get(ICommandService), undoRedoService = accessor.get(IUndoRedoService), selectionManagerService = accessor.get(SheetsSelectionsService), target = getSheetCommandTarget(univerInstanceService, params);
243
243
  if (!target) return !1;
244
- const { unitId, subUnitId } = target, ranges = ((_a13 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a13.map((selection) => selection.range)) || [], allRuleList = conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
244
+ const { unitId, subUnitId } = target, ranges = ((_a15 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a15.map((selection) => selection.range)) || [], allRuleList = conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId);
245
245
  if (!(allRuleList != null && allRuleList.length) || !ranges.length)
246
246
  return !1;
247
247
  const redos = [], undos = [];
@@ -288,107 +288,7 @@ const AddAverageCfCommand = {
288
288
  undoMutations: undos
289
289
  }), result;
290
290
  }
291
- }, commandList = [SetWorksheetActiveOperation.id, AddConditionalRuleMutation.id, SetConditionalRuleMutation.id, DeleteConditionalRuleMutation.id, MoveConditionalRuleMutation.id], FactoryManageConditionalFormattingRule = /* @__PURE__ */ __name((accessor) => {
292
- const commonSelections = [
293
- {
294
- label: "sheet.cf.ruleType.highlightCell",
295
- value: CF_MENU_OPERATION.highlightCell
296
- },
297
- {
298
- label: "sheet.cf.panel.rankAndAverage",
299
- value: CF_MENU_OPERATION.rank
300
- },
301
- {
302
- label: "sheet.cf.ruleType.formula",
303
- value: CF_MENU_OPERATION.formula
304
- },
305
- {
306
- label: "sheet.cf.ruleType.colorScale",
307
- value: CF_MENU_OPERATION.colorScale
308
- },
309
- {
310
- label: "sheet.cf.ruleType.dataBar",
311
- value: CF_MENU_OPERATION.dataBar
312
- },
313
- {
314
- label: "sheet.cf.ruleType.iconSet",
315
- value: CF_MENU_OPERATION.icon
316
- },
317
- {
318
- label: "sheet.cf.menu.manageConditionalFormatting",
319
- value: CF_MENU_OPERATION.viewRule
320
- },
321
- {
322
- label: "sheet.cf.menu.createConditionalFormatting",
323
- value: CF_MENU_OPERATION.createRule
324
- },
325
- {
326
- label: "sheet.cf.menu.clearRangeRules",
327
- value: CF_MENU_OPERATION.clearRangeRules,
328
- disabled: !1
329
- },
330
- {
331
- label: "sheet.cf.menu.clearWorkSheetRules",
332
- value: CF_MENU_OPERATION.clearWorkSheetRules
333
- }
334
- ], selectionManagerService = accessor.get(SheetsSelectionsService), commandService = accessor.get(ICommandService), univerInstanceService = accessor.get(IUniverInstanceService), conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel), clearRangeEnable$ = new Observable((subscriber) => merge(
335
- selectionManagerService.selectionMoveEnd$,
336
- new Observable((commandSubscribe) => {
337
- const disposable = commandService.onCommandExecuted((commandInfo) => {
338
- var _a13;
339
- const { id, params } = commandInfo, unitId = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a13.getUnitId();
340
- commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
341
- });
342
- return () => disposable.dispose();
343
- })
344
- ).pipe(debounceTime(16)).subscribe(() => {
345
- var _a13;
346
- const ranges = ((_a13 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a13.map((selection) => selection.range)) || [], workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
347
- if (!workbook) return;
348
- const worksheet = workbook.getActiveSheet();
349
- if (!worksheet) return;
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);
352
- })), clearSheetEnable$ = new Observable(
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(() => {
361
- const workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
362
- if (!workbook) return;
363
- const worksheet = workbook.getActiveSheet();
364
- if (!worksheet) return;
365
- const allRule = conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId()) || [];
366
- if (!allRule.length)
367
- return subscriber.next(!1), !1;
368
- const hasPermission = allRule.map((rule) => rule.ranges).every((ranges) => checkRangesEditablePermission(accessor, workbook.getUnitId(), worksheet.getSheetId(), ranges));
369
- subscriber.next(hasPermission);
370
- })
371
- ), selections$ = new Observable((subscriber) => {
372
- clearRangeEnable$.subscribe((v) => {
373
- const item2 = commonSelections.find((item22) => item22.value === CF_MENU_OPERATION.clearRangeRules);
374
- item2 && (item2.disabled = !v, subscriber.next(commonSelections));
375
- }), clearSheetEnable$.subscribe((v) => {
376
- const item2 = commonSelections.find((item22) => item22.value === CF_MENU_OPERATION.clearWorkSheetRules);
377
- item2 && (item2.disabled = !v, subscriber.next(commonSelections));
378
- }), subscriber.next(commonSelections);
379
- });
380
- return {
381
- id: OpenConditionalFormattingOperator.id,
382
- type: MenuItemType.SELECTOR,
383
- group: MenuGroup.TOOLBAR_FORMULAS_INSERT,
384
- positions: [MenuPosition.TOOLBAR_START],
385
- icon: "Conditions",
386
- tooltip: "sheet.cf.title",
387
- selections: selections$,
388
- hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
389
- disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetSetCellStylePermission, WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })
390
- };
391
- }, "FactoryManageConditionalFormattingRule");
291
+ };
392
292
  var commonjsGlobal = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
393
293
  function getDefaultExportFromCjs(x) {
394
294
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
@@ -486,15 +386,15 @@ function replaceRuntimeIdsAndExtInAttrs(node, runtimeProps, extend) {
486
386
  var attrs = __assign({}, node.attrs);
487
387
  extend != null && extend.colorChannel1 && attrs.fill === "colorChannel1" && (attrs.fill = extend.colorChannel1);
488
388
  var defIds = runtimeProps.defIds;
489
- return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a13) {
490
- var key = _a13[0], value = _a13[1];
389
+ return !defIds || defIds.length === 0 || (node.tag === "use" && attrs["xlink:href"] && (attrs["xlink:href"] = attrs["xlink:href"] + runtimeProps.idSuffix), Object.entries(attrs).forEach(function(_a15) {
390
+ var key = _a15[0], value = _a15[1];
491
391
  typeof value == "string" && (attrs[key] = value.replace(/url\(#(.*)\)/, "url(#$1".concat(runtimeProps.idSuffix, ")")));
492
392
  })), attrs;
493
393
  }
494
394
  __name(replaceRuntimeIdsAndExtInAttrs, "replaceRuntimeIdsAndExtInAttrs");
495
395
  function replaceRuntimeIdsInDefs(node, runtimeProps) {
496
- var _a13, defIds = runtimeProps.defIds;
497
- return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a13 = node.children) === null || _a13 === void 0) && _a13.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
396
+ var _a15, defIds = runtimeProps.defIds;
397
+ return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a15 = node.children) === null || _a15 === void 0) && _a15.length) ? __assign(__assign({}, node), { children: node.children.map(function(child) {
498
398
  return typeof child.attrs.id == "string" && defIds && defIds.indexOf(child.attrs.id) > -1 ? __assign(__assign({}, child), { attrs: __assign(__assign({}, child.attrs), { id: child.attrs.id + runtimeProps.idSuffix }) }) : child;
499
399
  }) }) : node;
500
400
  }
@@ -590,8 +490,8 @@ var reactGridLayout = { exports: {} }, ReactGridLayout$1 = {}, fastEquals = { ex
590
490
  }
591
491
  __name(sameValueZeroEqual, "sameValueZeroEqual");
592
492
  var ARGUMENTS_TAG = "[object Arguments]", BOOLEAN_TAG = "[object Boolean]", DATE_TAG = "[object Date]", REG_EXP_TAG = "[object RegExp]", MAP_TAG = "[object Map]", NUMBER_TAG = "[object Number]", OBJECT_TAG = "[object Object]", SET_TAG = "[object Set]", STRING_TAG = "[object String]", toString2 = Object.prototype.toString;
593
- function createComparator(_a13) {
594
- var areArraysEqual2 = _a13.areArraysEqual, areDatesEqual2 = _a13.areDatesEqual, areMapsEqual2 = _a13.areMapsEqual, areObjectsEqual2 = _a13.areObjectsEqual, areRegExpsEqual2 = _a13.areRegExpsEqual, areSetsEqual2 = _a13.areSetsEqual, createIsNestedEqual = _a13.createIsNestedEqual, isEqual = createIsNestedEqual(comparator);
493
+ function createComparator(_a15) {
494
+ var areArraysEqual2 = _a15.areArraysEqual, areDatesEqual2 = _a15.areDatesEqual, areMapsEqual2 = _a15.areMapsEqual, areObjectsEqual2 = _a15.areObjectsEqual, areRegExpsEqual2 = _a15.areRegExpsEqual, areSetsEqual2 = _a15.areSetsEqual, createIsNestedEqual = _a15.createIsNestedEqual, isEqual = createIsNestedEqual(comparator);
595
495
  function comparator(a, b, meta) {
596
496
  if (a === b)
597
497
  return !0;
@@ -3578,9 +3478,9 @@ const _ReactGridLayout = class _ReactGridLayout extends React$2.Component {
3578
3478
  resizing: !1
3579
3479
  }), this.onLayoutMaybeChanged(newLayout, oldLayout);
3580
3480
  }), _defineProperty$2(this, "onDragOver", (e) => {
3581
- var _a13;
3481
+ var _a15;
3582
3482
  if (e.preventDefault(), e.stopPropagation(), isFirefox && // $FlowIgnore can't figure this out
3583
- !((_a13 = e.nativeEvent.target) != null && _a13.classList.contains(layoutClassName$1)))
3483
+ !((_a15 = e.nativeEvent.target) != null && _a15.classList.contains(layoutClassName$1)))
3584
3484
  return !1;
3585
3485
  const {
3586
3486
  droppingItem,
@@ -4192,8 +4092,8 @@ var WidthProvider = {}, MapShim = function() {
4192
4092
  this.__entries__.splice(0);
4193
4093
  }, class_1.prototype.forEach = function(callback, ctx) {
4194
4094
  ctx === void 0 && (ctx = null);
4195
- for (var _i = 0, _a13 = this.__entries__; _i < _a13.length; _i++) {
4196
- var entry = _a13[_i];
4095
+ for (var _i = 0, _a15 = this.__entries__; _i < _a15.length; _i++) {
4096
+ var entry = _a15[_i];
4197
4097
  callback.call(ctx, entry[1], entry[0]);
4198
4098
  }
4199
4099
  }, class_1;
@@ -4260,8 +4160,8 @@ var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "wid
4260
4160
  })) : (document.addEventListener("DOMSubtreeModified", this.refresh), this.mutationEventsAdded_ = !0), this.connected_ = !0);
4261
4161
  }, ResizeObserverController2.prototype.disconnect_ = function() {
4262
4162
  !isBrowser || !this.connected_ || (document.removeEventListener("transitionend", this.onTransitionEnd_), window.removeEventListener("resize", this.refresh), this.mutationsObserver_ && this.mutationsObserver_.disconnect(), this.mutationEventsAdded_ && document.removeEventListener("DOMSubtreeModified", this.refresh), this.mutationsObserver_ = null, this.mutationEventsAdded_ = !1, this.connected_ = !1);
4263
- }, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a13) {
4264
- var _b = _a13.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
4163
+ }, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a15) {
4164
+ var _b = _a15.propertyName, propertyName = _b === void 0 ? "" : _b, isReflowProperty = transitionKeys.some(function(key) {
4265
4165
  return !!~propertyName.indexOf(key);
4266
4166
  });
4267
4167
  isReflowProperty && this.refresh();
@@ -4270,8 +4170,8 @@ var REFRESH_DELAY = 20, transitionKeys = ["top", "right", "bottom", "left", "wid
4270
4170
  }, ResizeObserverController2.instance_ = null, ResizeObserverController2;
4271
4171
  }()
4272
4172
  ), defineConfigurable = /* @__PURE__ */ __name(function(target, props) {
4273
- for (var _i = 0, _a13 = Object.keys(props); _i < _a13.length; _i++) {
4274
- var key = _a13[_i];
4173
+ for (var _i = 0, _a15 = Object.keys(props); _i < _a15.length; _i++) {
4174
+ var key = _a15[_i];
4275
4175
  Object.defineProperty(target, key, {
4276
4176
  value: props[key],
4277
4177
  enumerable: !1,
@@ -4337,8 +4237,8 @@ function getContentRect(target) {
4337
4237
  return isBrowser ? isSVGGraphicsElement(target) ? getSVGContentRect(target) : getHTMLElementContentRect(target) : emptyRect;
4338
4238
  }
4339
4239
  __name(getContentRect, "getContentRect");
4340
- function createReadOnlyRect(_a13) {
4341
- var x = _a13.x, y = _a13.y, width2 = _a13.width, height2 = _a13.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
4240
+ function createReadOnlyRect(_a15) {
4241
+ var x = _a15.x, y = _a15.y, width2 = _a15.width, height2 = _a15.height, Constr = typeof DOMRectReadOnly < "u" ? DOMRectReadOnly : Object, rect = Object.create(Constr.prototype);
4342
4242
  return defineConfigurable(rect, {
4343
4243
  x,
4344
4244
  y,
@@ -4444,8 +4344,8 @@ var ResizeObservation = (
4444
4344
  "disconnect"
4445
4345
  ].forEach(function(method) {
4446
4346
  ResizeObserver.prototype[method] = function() {
4447
- var _a13;
4448
- return (_a13 = observers.get(this))[method].apply(_a13, arguments);
4347
+ var _a15;
4348
+ return (_a15 = observers.get(this))[method].apply(_a15, arguments);
4449
4349
  };
4450
4350
  });
4451
4351
  var index = function() {
@@ -4518,9 +4418,9 @@ function _toPrimitive(input, hint) {
4518
4418
  __name(_toPrimitive, "_toPrimitive");
4519
4419
  const layoutClassName = "react-grid-layout";
4520
4420
  function WidthProvideRGL(ComposedComponent) {
4521
- var _a13;
4421
+ var _a15;
4522
4422
  var _class;
4523
- return _class = (_a13 = class extends React.Component {
4423
+ return _class = (_a15 = class extends React.Component {
4524
4424
  constructor() {
4525
4425
  super(...arguments), _defineProperty(this, "state", {
4526
4426
  width: 1280
@@ -4556,7 +4456,7 @@ function WidthProvideRGL(ComposedComponent) {
4556
4456
  innerRef: this.elementRef
4557
4457
  }, rest, this.state));
4558
4458
  }
4559
- }, __name(_a13, "WidthProvider"), _a13), _defineProperty(_class, "defaultProps", {
4459
+ }, __name(_a15, "WidthProvider"), _a15), _defineProperty(_class, "defaultProps", {
4560
4460
  measureBeforeMount: !1
4561
4461
  }), _defineProperty(_class, "propTypes", {
4562
4462
  // If true, will not render children until mounted. Useful for getting the exact width before
@@ -4601,7 +4501,7 @@ const GridLayout = /* @__PURE__ */ getDefaultExportFromCjs(reactGridLayoutExport
4601
4501
  }, cfPreview = "univer-cf-preview", styles$4 = {
4602
4502
  cfPreview
4603
4503
  }, Preview = /* @__PURE__ */ __name((props) => {
4604
- var _a13, _b;
4504
+ var _a15, _b;
4605
4505
  const rule = props.rule;
4606
4506
  if (!rule)
4607
4507
  return null;
@@ -4631,7 +4531,7 @@ const GridLayout = /* @__PURE__ */ getDefaultExportFromCjs(reactGridLayoutExport
4631
4531
  case CFRuleType.iconSet:
4632
4532
  return iconSet2 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$4.cfPreview, children: iconSet2.map((base64, index2) => base64 ? /* @__PURE__ */ jsxRuntimeExports.jsx("img", { style: { height: "100%" }, src: base64 }, index2) : /* @__PURE__ */ jsxRuntimeExports.jsx(SlashSingle, {}, index2)) });
4633
4533
  case CFRuleType.highlightCell: {
4634
- const { ul, st, it, bl, bg, cl: cl2 } = rule.style, isUnderline = (ul == null ? void 0 : ul.s) === BooleanNumber.TRUE, isStrikethrough = (st == null ? void 0 : st.s) === BooleanNumber.TRUE, isItalic = it === BooleanNumber.TRUE, isBold = bl === BooleanNumber.TRUE, bgColor = (_a13 = bg == null ? void 0 : bg.rgb) != null ? _a13 : DEFAULT_BG_COLOR, fontColor = (_b = cl2 == null ? void 0 : cl2.rgb) != null ? _b : DEFAULT_FONT_COLOR, style = {
4534
+ const { ul, st, it, bl, bg, cl: cl2 } = rule.style, isUnderline = (ul == null ? void 0 : ul.s) === BooleanNumber.TRUE, isStrikethrough = (st == null ? void 0 : st.s) === BooleanNumber.TRUE, isItalic = it === BooleanNumber.TRUE, isBold = bl === BooleanNumber.TRUE, bgColor = (_a15 = bg == null ? void 0 : bg.rgb) != null ? _a15 : DEFAULT_BG_COLOR, fontColor = (_b = cl2 == null ? void 0 : cl2.rgb) != null ? _b : DEFAULT_FONT_COLOR, style = {
4635
4535
  fontWeight: isBold ? "bold" : void 0,
4636
4536
  fontStyle: isItalic ? "italic" : void 0,
4637
4537
  textDecoration: `${isUnderline ? "underline" : ""} ${isStrikethrough ? "line-through" : ""}`.replace(/^ /, "") || void 0,
@@ -4643,11 +4543,11 @@ const GridLayout = /* @__PURE__ */ getDefaultExportFromCjs(reactGridLayoutExport
4643
4543
  }
4644
4544
  return null;
4645
4545
  }, "Preview");
4646
- var __defProp$a = Object.defineProperty, __getOwnPropDesc$a = Object.getOwnPropertyDescriptor, __decorateClass$a = /* @__PURE__ */ __name((decorators, target, key, kind) => {
4647
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
4546
+ var __defProp$c = Object.defineProperty, __getOwnPropDesc$c = Object.getOwnPropertyDescriptor, __decorateClass$c = /* @__PURE__ */ __name((decorators, target, key, kind) => {
4547
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$c(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
4648
4548
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
4649
- return kind && result && __defProp$a(target, key, result), result;
4650
- }, "__decorateClass$a"), __decorateParam$a = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$a"), _a2;
4549
+ return kind && result && __defProp$c(target, key, result), result;
4550
+ }, "__decorateClass$c"), __decorateParam$c = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$c"), _a2;
4651
4551
  let ConditionalFormattingI18nController = (_a2 = class extends Disposable {
4652
4552
  constructor(_localeService) {
4653
4553
  super();
@@ -4685,9 +4585,9 @@ let ConditionalFormattingI18nController = (_a2 = class extends Disposable {
4685
4585
  return [];
4686
4586
  }
4687
4587
  }, __name(_a2, "ConditionalFormattingI18nController"), _a2);
4688
- ConditionalFormattingI18nController = __decorateClass$a([
4588
+ ConditionalFormattingI18nController = __decorateClass$c([
4689
4589
  OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingI18nController),
4690
- __decorateParam$a(0, Inject(LocaleService))
4590
+ __decorateParam$c(0, Inject(LocaleService))
4691
4591
  ], ConditionalFormattingI18nController);
4692
4592
  const cfRuleList = "univer-cf-rule-list", ruleSelector = "univer-rule-selector", select = "univer-select", selectSelector = "univer-select-selector", selectSelectionItem = "univer-select-selection-item", selectSelectionSearchInput = "univer-select-selection-search-input", btnList$1 = "univer-btn-list", gap = "univer-gap", icon$1 = "univer-icon", disabled = "univer-disabled", ruleItem = "univer-rule-item", ruleDescribe = "univer-rule-describe", ruleType = "univer-rule-type", ruleRange = "univer-rule-range", active = "univer-active", draggableHandle = "univer-draggableHandle", deleteItem = "univer-delete-item", gridLayoutWrap = "univer-grid-layout-wrap", reactGridItem = "univer-react-grid-item", styles$3 = {
4693
4593
  cfRuleList,
@@ -4785,7 +4685,7 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4785
4685
  commandList2.includes(id) && params.unitId === unitId2 && commandSubscribe.next(null);
4786
4686
  });
4787
4687
  return () => disposable.dispose();
4788
- }).pipe(debounceTime$1(16)).subscribe(() => {
4688
+ }).pipe(debounceTime(16)).subscribe(() => {
4789
4689
  ruleListSet(getRuleList);
4790
4690
  });
4791
4691
  return () => {
@@ -4798,8 +4698,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4798
4698
  return () => dispose.unsubscribe();
4799
4699
  }, [conditionalFormattingRuleModel]), useEffect(() => {
4800
4700
  const getWidth = /* @__PURE__ */ __name(() => {
4801
- var _a13;
4802
- const width2 = Math.max(0, (((_a13 = layoutContainerRef.current) == null ? void 0 : _a13.getBoundingClientRect().width) || 0) - 8);
4701
+ var _a15;
4702
+ const width2 = Math.max(0, (((_a15 = layoutContainerRef.current) == null ? void 0 : _a15.getBoundingClientRect().width) || 0) - 8);
4803
4703
  return defaultWidth = width2, width2;
4804
4704
  }, "getWidth"), subscription = new Observable((subscribe) => {
4805
4705
  const targetElement = document.querySelector(".univer-sidebar");
@@ -4816,7 +4716,7 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4816
4716
  clearTime(), targetElement.removeEventListener("transitionend", handle);
4817
4717
  };
4818
4718
  }
4819
- }).pipe(debounceTime$1(16)).subscribe(() => {
4719
+ }).pipe(debounceTime(16)).subscribe(() => {
4820
4720
  layoutWidthSet(getWidth());
4821
4721
  });
4822
4722
  return () => {
@@ -4824,17 +4724,17 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4824
4724
  };
4825
4725
  }, []);
4826
4726
  const handleDelete = /* @__PURE__ */ __name((rule) => {
4827
- var _a13;
4828
- const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId();
4727
+ var _a15;
4728
+ const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId();
4829
4729
  if (!unitId2 || !subUnitId2)
4830
4730
  throw new Error("No active sheet found");
4831
4731
  commandService.executeCommand(DeleteCfCommand.id, { unitId: unitId2, subUnitId: subUnitId2, cfId: rule.cfId });
4832
4732
  }, "handleDelete"), handleDragStart = /* @__PURE__ */ __name((_layout, from) => {
4833
4733
  draggingIdSet(from.y);
4834
4734
  }, "handleDragStart"), handleDragStop = /* @__PURE__ */ __name((_layout, from, to) => {
4835
- var _a13;
4735
+ var _a15;
4836
4736
  draggingIdSet(-1);
4837
- const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId();
4737
+ const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId();
4838
4738
  if (!unitId2 || !subUnitId2)
4839
4739
  throw new Error("No active sheet found");
4840
4740
  const getSaveIndex = /* @__PURE__ */ __name((index2) => {
@@ -4996,8 +4896,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
4996
4896
  width100,
4997
4897
  stress
4998
4898
  }, createOptionItem$2 = /* @__PURE__ */ __name((text2, localeService) => ({ label: localeService.t(`sheet.cf.valueType.${text2}`), value: text2 }), "createOptionItem$2"), TextInput$1 = /* @__PURE__ */ __name((props) => {
4999
- var _a13;
5000
- const { type: type2, className, onChange, id, value } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId(), formulaInitValue = useMemo(() => String(value).startsWith("=") ? String(value) : "=", [value]), config = useMemo(() => [CFValueType.max, CFValueType.min, "none"].includes(type2) ? { disabled: !0 } : [CFValueType.percent, CFValueType.percentile].includes(type2) ? {
4899
+ var _a15;
4900
+ const { type: type2, className, onChange, id, value } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId(), formulaInitValue = useMemo(() => String(value).startsWith("=") ? String(value) : "=", [value]), config = useMemo(() => [CFValueType.max, CFValueType.min, "none"].includes(type2) ? { disabled: !0 } : [CFValueType.percent, CFValueType.percentile].includes(type2) ? {
5001
4901
  min: 0,
5002
4902
  max: 100
5003
4903
  } : {
@@ -5020,48 +4920,48 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5020
4920
  }
5021
4921
  ) : /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { className, value: Number(props.value) || 0, onChange: /* @__PURE__ */ __name((v) => props.onChange(v || 0), "onChange"), ...config });
5022
4922
  }, "TextInput$1"), ColorScaleStyleEditor = /* @__PURE__ */ __name((props) => {
5023
- var _a13;
5024
- const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a13 = props.rule) == null ? void 0 : _a13.type) === CFRuleType.colorScale ? props.rule : void 0, commonOptions = [createOptionItem$2(CFValueType.num, localeService), createOptionItem$2(CFValueType.percent, localeService), createOptionItem$2(CFValueType.percentile, localeService), createOptionItem$2(CFValueType.formula, localeService)], minOptions = [createOptionItem$2(CFValueType.min, localeService), ...commonOptions], medianOptions = [createOptionItem$2("none", localeService), ...commonOptions], maxOptions = [createOptionItem$2(CFValueType.max, localeService), ...commonOptions], [minType, minTypeSet] = useState(() => {
5025
- var _a14;
4923
+ var _a15;
4924
+ const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a15 = props.rule) == null ? void 0 : _a15.type) === CFRuleType.colorScale ? props.rule : void 0, commonOptions = [createOptionItem$2(CFValueType.num, localeService), createOptionItem$2(CFValueType.percent, localeService), createOptionItem$2(CFValueType.percentile, localeService), createOptionItem$2(CFValueType.formula, localeService)], minOptions = [createOptionItem$2(CFValueType.min, localeService), ...commonOptions], medianOptions = [createOptionItem$2("none", localeService), ...commonOptions], maxOptions = [createOptionItem$2(CFValueType.max, localeService), ...commonOptions], [minType, minTypeSet] = useState(() => {
4925
+ var _a16;
5026
4926
  const defaultV = CFValueType.min;
5027
- return rule && ((_a14 = rule.config[0]) == null ? void 0 : _a14.value.type) || defaultV;
4927
+ return rule && ((_a16 = rule.config[0]) == null ? void 0 : _a16.value.type) || defaultV;
5028
4928
  }), [medianType, medianTypeSet] = useState(() => {
5029
- var _a14;
4929
+ var _a16;
5030
4930
  const defaultV = "none";
5031
- return !rule || rule.config.length !== 3 ? defaultV : ((_a14 = rule.config[1]) == null ? void 0 : _a14.value.type) || defaultV;
4931
+ return !rule || rule.config.length !== 3 ? defaultV : ((_a16 = rule.config[1]) == null ? void 0 : _a16.value.type) || defaultV;
5032
4932
  }), [maxType, maxTypeSet] = useState(() => {
5033
- var _a14;
4933
+ var _a16;
5034
4934
  const defaultV = CFValueType.max;
5035
- return rule && ((_a14 = rule.config[rule.config.length - 1]) == null ? void 0 : _a14.value.type) || defaultV;
4935
+ return rule && ((_a16 = rule.config[rule.config.length - 1]) == null ? void 0 : _a16.value.type) || defaultV;
5036
4936
  }), [minValue, minValueSet] = useState(() => {
5037
4937
  if (!rule)
5038
4938
  return 10;
5039
4939
  const valueConfig = rule.config[0];
5040
4940
  return (valueConfig == null ? void 0 : valueConfig.value.value) === void 0 ? 10 : valueConfig == null ? void 0 : valueConfig.value.value;
5041
4941
  }), [medianValue, medianValueSet] = useState(() => {
5042
- var _a14;
4942
+ var _a16;
5043
4943
  if (!rule || rule.config.length !== 3)
5044
4944
  return 50;
5045
- const v = (_a14 = rule.config[1]) == null ? void 0 : _a14.value.value;
4945
+ const v = (_a16 = rule.config[1]) == null ? void 0 : _a16.value.value;
5046
4946
  return v === void 0 ? 50 : v;
5047
4947
  }), [maxValue, maxValueSet] = useState(() => {
5048
- var _a14;
4948
+ var _a16;
5049
4949
  if (!rule)
5050
4950
  return 90;
5051
- const v = (_a14 = rule.config[rule.config.length - 1]) == null ? void 0 : _a14.value.value;
4951
+ const v = (_a16 = rule.config[rule.config.length - 1]) == null ? void 0 : _a16.value.value;
5052
4952
  return v === void 0 ? 90 : v;
5053
4953
  }), [minColor, minColorSet] = useState(() => {
5054
- var _a14;
4954
+ var _a16;
5055
4955
  const defaultV = "#d0d9fb";
5056
- return rule && ((_a14 = rule.config[0]) == null ? void 0 : _a14.color) || defaultV;
4956
+ return rule && ((_a16 = rule.config[0]) == null ? void 0 : _a16.color) || defaultV;
5057
4957
  }), [medianColor, medianColorSet] = useState(() => {
5058
- var _a14;
4958
+ var _a16;
5059
4959
  const defaultV = "#7790f3";
5060
- return !rule || rule.config.length !== 3 ? defaultV : ((_a14 = rule.config[1]) == null ? void 0 : _a14.color) || defaultV;
4960
+ return !rule || rule.config.length !== 3 ? defaultV : ((_a16 = rule.config[1]) == null ? void 0 : _a16.color) || defaultV;
5061
4961
  }), [maxColor, maxColorSet] = useState(() => {
5062
- var _a14;
4962
+ var _a16;
5063
4963
  const defaultV = "#2e55ef";
5064
- return rule && ((_a14 = rule.config[rule.config.length - 1]) == null ? void 0 : _a14.color) || defaultV;
4964
+ return rule && ((_a16 = rule.config[rule.config.length - 1]) == null ? void 0 : _a16.color) || defaultV;
5065
4965
  }), getResult = useMemo(() => (option) => {
5066
4966
  const {
5067
4967
  minType: minType2,
@@ -5200,8 +5100,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5200
5100
  ] })
5201
5101
  ] });
5202
5102
  }, "ColorScaleStyleEditor"), createOptionItem$1 = /* @__PURE__ */ __name((text2, localeService) => ({ label: localeService.t(`sheet.cf.valueType.${text2}`), value: text2 }), "createOptionItem$1"), InputText = /* @__PURE__ */ __name((props) => {
5203
- var _a13;
5204
- const { onChange, className, value, type: type2, id, disabled: disabled2 = !1 } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId(), _value = useRef(value), config = useMemo(() => [CFValueType.percentile, CFValueType.percent].includes(type2) ? {
5103
+ var _a15;
5104
+ const { onChange, className, value, type: type2, id, disabled: disabled2 = !1 } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId(), _value = useRef(value), config = useMemo(() => [CFValueType.percentile, CFValueType.percent].includes(type2) ? {
5205
5105
  max: 100,
5206
5106
  min: 0
5207
5107
  } : {
@@ -5239,36 +5139,36 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5239
5139
  }
5240
5140
  );
5241
5141
  }, "InputText"), DataBarStyleEditor = /* @__PURE__ */ __name((props) => {
5242
- var _a13;
5243
- const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a13 = props.rule) == null ? void 0 : _a13.type) === CFRuleType.dataBar ? props.rule : void 0, [isGradient, isGradientSet] = useState(() => {
5244
- var _a14;
5142
+ var _a15;
5143
+ const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a15 = props.rule) == null ? void 0 : _a15.type) === CFRuleType.dataBar ? props.rule : void 0, [isGradient, isGradientSet] = useState(() => {
5144
+ var _a16;
5245
5145
  const defaultV = "0";
5246
- return rule ? (_a14 = rule.config) != null && _a14.isGradient ? "1" : "0" : defaultV;
5146
+ return rule ? (_a16 = rule.config) != null && _a16.isGradient ? "1" : "0" : defaultV;
5247
5147
  }), [positiveColor, positiveColorSet] = useState(() => {
5248
- var _a14;
5249
- return rule ? ((_a14 = rule.config) == null ? void 0 : _a14.positiveColor) || defaultDataBarPositiveColor : defaultDataBarPositiveColor;
5148
+ var _a16;
5149
+ return rule ? ((_a16 = rule.config) == null ? void 0 : _a16.positiveColor) || defaultDataBarPositiveColor : defaultDataBarPositiveColor;
5250
5150
  }), [nativeColor, nativeColorSet] = useState(() => {
5251
- var _a14;
5252
- return rule ? ((_a14 = rule.config) == null ? void 0 : _a14.nativeColor) || defaultDataBarNativeColor : defaultDataBarNativeColor;
5151
+ var _a16;
5152
+ return rule ? ((_a16 = rule.config) == null ? void 0 : _a16.nativeColor) || defaultDataBarNativeColor : defaultDataBarNativeColor;
5253
5153
  }), 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(() => {
5254
- var _a14;
5154
+ var _a16;
5255
5155
  const defaultV = minOptions[0].value;
5256
- return rule && ((_a14 = rule.config) == null ? void 0 : _a14.min.type) || defaultV;
5156
+ return rule && ((_a16 = rule.config) == null ? void 0 : _a16.min.type) || defaultV;
5257
5157
  }), [maxValueType, maxValueTypeSet] = useState(() => {
5258
- var _a14;
5158
+ var _a16;
5259
5159
  const defaultV = maxOptions[0].value;
5260
- return rule && ((_a14 = rule.config) == null ? void 0 : _a14.max.type) || defaultV;
5160
+ return rule && ((_a16 = rule.config) == null ? void 0 : _a16.max.type) || defaultV;
5261
5161
  }), [minValue, minValueSet] = useState(() => {
5262
- var _a14;
5162
+ var _a16;
5263
5163
  if (!rule)
5264
5164
  return 0;
5265
- const value = ((_a14 = rule.config) == null ? void 0 : _a14.min) || {};
5165
+ const value = ((_a16 = rule.config) == null ? void 0 : _a16.min) || {};
5266
5166
  return value.type === CFValueType.formula ? value.value || "=" : value.value || 0;
5267
5167
  }), [maxValue, maxValueSet] = useState(() => {
5268
- var _a14;
5168
+ var _a16;
5269
5169
  if (!rule)
5270
5170
  return 100;
5271
- const value = ((_a14 = rule.config) == null ? void 0 : _a14.max) || {};
5171
+ const value = ((_a16 = rule.config) == null ? void 0 : _a16.max) || {};
5272
5172
  return value.type === CFValueType.formula ? value.value || "=" : value.value === void 0 ? 100 : value.value;
5273
5173
  }), [isShowValue, isShowValueSet] = useState(() => rule ? rule.isShowValue === void 0 ? !0 : !!rule.isShowValue : !0), getResult = /* @__PURE__ */ __name((option) => ({ config: {
5274
5174
  min: { type: option.minValueType, value: option.minValue },
@@ -5424,13 +5324,13 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5424
5324
  if (style != null && style.st)
5425
5325
  return style.st.s;
5426
5326
  }), [fontColor, fontColorSet] = useState(() => {
5427
- var _a13;
5327
+ var _a15;
5428
5328
  const defaultV = "#2f56ef";
5429
- return (_a13 = style == null ? void 0 : style.cl) != null && _a13.rgb ? style.cl.rgb : defaultV;
5329
+ return (_a15 = style == null ? void 0 : style.cl) != null && _a15.rgb ? style.cl.rgb : defaultV;
5430
5330
  }), [bgColor, bgColorSet] = useState(() => {
5431
- var _a13;
5331
+ var _a15;
5432
5332
  const defaultV = "#e8ecfc";
5433
- return (_a13 = style == null ? void 0 : style.bg) != null && _a13.rgb ? style.bg.rgb : defaultV;
5333
+ return (_a15 = style == null ? void 0 : style.bg) != null && _a15.rgb ? style.bg.rgb : defaultV;
5434
5334
  }), BoldSingleIcon = componentManager.get("BoldSingle"), ItalicSingleIcon = componentManager.get("ItalicSingle"), UnderlineSingleIcon = componentManager.get("UnderlineSingle"), StrikethroughSingle = componentManager.get("StrikethroughSingle");
5435
5335
  return useEffect(() => {
5436
5336
  const resultStyle = {
@@ -5447,8 +5347,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5447
5347
  /* @__PURE__ */ jsxRuntimeExports.jsx(ColorPicker, { color: bgColor, onChange: bgColorSet, iconId: "PaintBucket" })
5448
5348
  ] });
5449
5349
  }, "ConditionalStyleEditor"), RankStyleEditor = /* @__PURE__ */ __name((props) => {
5450
- var _a13;
5451
- const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a13 = props.rule) == null ? void 0 : _a13.type) === CFRuleType.highlightCell ? props.rule : void 0, options = [
5350
+ var _a15;
5351
+ const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a15 = props.rule) == null ? void 0 : _a15.type) === CFRuleType.highlightCell ? props.rule : void 0, options = [
5452
5352
  { label: localeService.t("sheet.cf.panel.isNotBottom"), value: "isNotBottom" },
5453
5353
  { label: localeService.t("sheet.cf.panel.isBottom"), value: "isBottom" },
5454
5354
  { label: localeService.t("sheet.cf.panel.greaterThanAverage"), value: "greaterThanAverage" },
@@ -5719,8 +5619,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5719
5619
  ];
5720
5620
  }
5721
5621
  }, "getOperatorOptions"), HighlightCellStyleEditor = /* @__PURE__ */ __name((props) => {
5722
- var _a13;
5723
- const { interceptorManager, onChange } = props, localeService = useDependency(LocaleService), rule = ((_a13 = props.rule) == null ? void 0 : _a13.type) === CFRuleType.highlightCell ? props.rule : void 0, [subType, subTypeSet] = useState(() => {
5622
+ var _a15;
5623
+ const { interceptorManager, onChange } = props, localeService = useDependency(LocaleService), rule = ((_a15 = props.rule) == null ? void 0 : _a15.type) === CFRuleType.highlightCell ? props.rule : void 0, [subType, subTypeSet] = useState(() => {
5724
5624
  const defaultV = CFSubRuleType.text;
5725
5625
  return rule && rule.subType || defaultV;
5726
5626
  }), typeOptions = [
@@ -5748,11 +5648,11 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5748
5648
  const defaultV = operatorOptions ? operatorOptions[0].value : void 0;
5749
5649
  return rule && rule.operator || defaultV;
5750
5650
  }), [value, valueSet] = useState(() => {
5751
- var _a14;
5651
+ var _a16;
5752
5652
  const defaultV = "";
5753
- return rule ? (_a14 = rule.value) != null ? _a14 : createDefaultValue(rule.subType, rule.operator) : defaultV;
5653
+ return rule ? (_a16 = rule.value) != null ? _a16 : createDefaultValue(rule.subType, rule.operator) : defaultV;
5754
5654
  }), [style, styleSet] = useState({}), getResult = useMemo(() => (option) => {
5755
- var _a14, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
5655
+ var _a16, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
5756
5656
  switch (option.subType || subType) {
5757
5657
  case CFSubRuleType.text: {
5758
5658
  if ([
@@ -5765,7 +5665,7 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5765
5665
  ].includes(operator))
5766
5666
  return {
5767
5667
  type: CFRuleType.highlightCell,
5768
- subType: (_a14 = option.subType) != null ? _a14 : subType,
5668
+ subType: (_a16 = option.subType) != null ? _a16 : subType,
5769
5669
  operator: (_b = option.operator) != null ? _b : operator,
5770
5670
  style: (_c = option.style) != null ? _c : style,
5771
5671
  value: (_d = option.value) != null ? _d : value
@@ -5840,8 +5740,8 @@ const RuleList = /* @__PURE__ */ __name((props) => {
5840
5740
  )
5841
5741
  ] });
5842
5742
  }, "HighlightCellStyleEditor"), FormulaStyleEditor = /* @__PURE__ */ __name((props) => {
5843
- var _a13;
5844
- const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), workbook = useDependency(IUniverInstanceService).getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet(), rule = ((_a13 = props.rule) == null ? void 0 : _a13.type) === CFRuleType.highlightCell ? props.rule : void 0, [style, styleSet] = useState({}), [formula, formulaSet] = useState(() => (rule == null ? void 0 : rule.subType) === CFSubRuleType.formula ? rule.value : "="), [formulaError, formulaErrorSet] = useState(""), getResult = /* @__PURE__ */ __name((config) => ({
5743
+ var _a15;
5744
+ const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), workbook = useDependency(IUniverInstanceService).getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet(), rule = ((_a15 = props.rule) == null ? void 0 : _a15.type) === CFRuleType.highlightCell ? props.rule : void 0, [style, styleSet] = useState({}), [formula, formulaSet] = useState(() => (rule == null ? void 0 : rule.subType) === CFSubRuleType.formula ? rule.value : "="), [formulaError, formulaErrorSet] = useState(""), getResult = /* @__PURE__ */ __name((config) => ({
5845
5745
  style: config.style,
5846
5746
  value: formula,
5847
5747
  type: CFRuleType.highlightCell,
@@ -6449,8 +6349,8 @@ function get(object, path, defaultValue) {
6449
6349
  __name(get, "get");
6450
6350
  var lodash_get = get;
6451
6351
  const get$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_get), getIcon = /* @__PURE__ */ __name((iconType, iconId) => (iconMap[iconType] || [])[Number(iconId)] || "", "getIcon"), TextInput = /* @__PURE__ */ __name((props) => {
6452
- var _a13;
6453
- const univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId(), className = useMemo(() => props.error ? styles$1.errorInput : "", [props.error]);
6352
+ var _a15;
6353
+ const univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId(), className = useMemo(() => props.error ? styles$1.errorInput : "", [props.error]);
6454
6354
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.positionRelative, children: props.type !== CFValueType.formula ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
6455
6355
  /* @__PURE__ */ jsxRuntimeExports.jsx(InputNumber, { className, value: Number(props.value) || 0, onChange: /* @__PURE__ */ __name((v) => props.onChange(v != null ? v : 0), "onChange") }),
6456
6356
  props.error && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1.errorText, children: props.error })
@@ -6583,8 +6483,8 @@ const get$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_get), getIcon = /*
6583
6483
  ] }, index2);
6584
6484
  }), [configList, errorMap]);
6585
6485
  }, "IconSetRuleEdit"), IconSet = /* @__PURE__ */ __name((props) => {
6586
- var _a13;
6587
- const { interceptorManager } = props, rule = ((_a13 = props.rule) == null ? void 0 : _a13.type) === CFRuleType.iconSet ? props.rule : void 0, localeService = useDependency(LocaleService), [errorMap, errorMapSet] = useState({}), [currentIconType, currentIconTypeSet] = useState(() => {
6486
+ var _a15;
6487
+ const { interceptorManager } = props, rule = ((_a15 = props.rule) == null ? void 0 : _a15.type) === CFRuleType.iconSet ? props.rule : void 0, localeService = useDependency(LocaleService), [errorMap, errorMapSet] = useState({}), [currentIconType, currentIconTypeSet] = useState(() => {
6588
6488
  const defaultV = Object.keys(iconMap)[0];
6589
6489
  if (rule && rule.config.length) {
6590
6490
  const type2 = rule.config[0].iconType;
@@ -6675,13 +6575,13 @@ const get$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_get), getIcon = /*
6675
6575
  /* @__PURE__ */ jsxRuntimeExports.jsx(IconSetRuleEdit, { errorMap, onChange: handleChange, configList })
6676
6576
  ] });
6677
6577
  }, "IconSet"), getUnitId = /* @__PURE__ */ __name((univerInstanceService) => univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), "getUnitId"), getSubUnitId = /* @__PURE__ */ __name((univerInstanceService) => {
6678
- var _a13;
6679
- return (_a13 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId();
6578
+ var _a15;
6579
+ return (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId();
6680
6580
  }, "getSubUnitId"), RuleEdit = /* @__PURE__ */ __name((props) => {
6681
- var _a13, _b, _c;
6682
- const localeService = useDependency(LocaleService), commandService = useDependency(ICommandService), univerInstanceService = useDependency(IUniverInstanceService), conditionalFormattingRuleModel = useDependency(ConditionalFormattingRuleModel), selectionManagerService = useDependency(SheetsSelectionsService), unitId = getUnitId(univerInstanceService), subUnitId = getSubUnitId(univerInstanceService), rangeResult = useRef((_b = (_a13 = props.rule) == null ? void 0 : _a13.ranges) != null ? _b : []), rangeString = useMemo(() => {
6683
- var _a14, _b2, _c2;
6684
- let ranges = (_a14 = props.rule) == null ? void 0 : _a14.ranges;
6581
+ var _a15, _b, _c;
6582
+ const localeService = useDependency(LocaleService), commandService = useDependency(ICommandService), univerInstanceService = useDependency(IUniverInstanceService), conditionalFormattingRuleModel = useDependency(ConditionalFormattingRuleModel), selectionManagerService = useDependency(SheetsSelectionsService), unitId = getUnitId(univerInstanceService), subUnitId = getSubUnitId(univerInstanceService), rangeResult = useRef((_b = (_a15 = props.rule) == null ? void 0 : _a15.ranges) != null ? _b : []), rangeString = useMemo(() => {
6583
+ var _a16, _b2, _c2;
6584
+ let ranges = (_a16 = props.rule) == null ? void 0 : _a16.ranges;
6685
6585
  return ranges != null && ranges.length || (ranges = (_c2 = (_b2 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _b2.map((s) => s.range)) != null ? _c2 : []), rangeResult.current = ranges, ranges != null && ranges.length ? ranges.map((range) => {
6686
6586
  const v = serializeRange(range);
6687
6587
  return v === "NaN" ? "" : v;
@@ -6694,8 +6594,8 @@ const get$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_get), getIcon = /*
6694
6594
  { label: localeService.t("sheet.cf.ruleType.formula"), value: "5" },
6695
6595
  { label: localeService.t("sheet.cf.ruleType.iconSet"), value: "6" }
6696
6596
  ], [ruleType2, ruleTypeSet] = useState(() => {
6697
- var _a14, _b2;
6698
- const type2 = (_a14 = props.rule) == null ? void 0 : _a14.rule.type, defaultType = options[0].value;
6597
+ var _a16, _b2;
6598
+ const type2 = (_a16 = props.rule) == null ? void 0 : _a16.rule.type, defaultType = options[0].value;
6699
6599
  if (!type2)
6700
6600
  return defaultType;
6701
6601
  switch (type2) {
@@ -6807,21 +6707,21 @@ const get$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodash_get), getIcon = /*
6807
6707
  }, "handleRuleClick");
6808
6708
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$5.conditionalFormattingWrap, children: isShowRuleEditor ? /* @__PURE__ */ jsxRuntimeExports.jsx(RuleEdit, { onCancel: handleCancel, rule: currentEditRule }) : /* @__PURE__ */ jsxRuntimeExports.jsx(RuleList, { onClick: handleRuleClick, onCreate: createCfRule }) });
6809
6709
  }, "ConditionFormattingPanel");
6810
- var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
6811
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
6710
+ var __defProp$b = Object.defineProperty, __getOwnPropDesc$b = Object.getOwnPropertyDescriptor, __decorateClass$b = /* @__PURE__ */ __name((decorators, target, key, kind) => {
6711
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
6812
6712
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
6813
- return kind && result && __defProp$9(target, key, result), result;
6814
- }, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$9");
6815
- const DefaultSheetConditionalFormattingUiConfig = {}, CF_PANEL_KEY = "sheet.conditional.formatting.panel";
6713
+ return kind && result && __defProp$b(target, key, result), result;
6714
+ }, "__decorateClass$b"), __decorateParam$b = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$b");
6715
+ const CF_PANEL_KEY = "sheet.conditional.formatting.panel";
6816
6716
  var _a3;
6817
- let ConditionalFormattingMenuController = (_a3 = class extends Disposable {
6818
- constructor(_config, _univerInstanceService, _injector, _componentManager, _menuService, _sidebarService, _localeService) {
6717
+ let ConditionalFormattingPanelController = (_a3 = class extends Disposable {
6718
+ constructor(_univerInstanceService, _injector, _componentManager, _sidebarService, _localeService) {
6819
6719
  super();
6820
6720
  __publicField(this, "_sidebarDisposable", null);
6821
- this._config = _config, this._univerInstanceService = _univerInstanceService, this._injector = _injector, this._componentManager = _componentManager, this._menuService = _menuService, this._sidebarService = _sidebarService, this._localeService = _localeService, this._initMenu(), this._initPanel(), this.disposeWithMe(
6721
+ this._univerInstanceService = _univerInstanceService, this._injector = _injector, this._componentManager = _componentManager, this._sidebarService = _sidebarService, this._localeService = _localeService, this._initPanel(), this.disposeWithMe(
6822
6722
  this._univerInstanceService.getCurrentTypeOfUnit$(UniverInstanceType.UNIVER_SHEET).subscribe((sheet) => {
6823
- var _a13;
6824
- sheet || (_a13 = this._sidebarDisposable) == null || _a13.dispose();
6723
+ var _a15;
6724
+ sheet || (_a15 = this._sidebarDisposable) == null || _a15.dispose();
6825
6725
  })
6826
6726
  );
6827
6727
  }
@@ -6831,36 +6731,31 @@ let ConditionalFormattingMenuController = (_a3 = class extends Disposable {
6831
6731
  children: {
6832
6732
  label: CF_PANEL_KEY,
6833
6733
  rule,
6834
- key: Tools.generateRandomId(4)
6734
+ key: generateRandomId(4)
6835
6735
  },
6836
6736
  onClose: /* @__PURE__ */ __name(() => this._sidebarDisposable = null, "onClose")
6837
6737
  };
6838
6738
  this._sidebarDisposable = this._sidebarService.open(props);
6839
6739
  }
6840
- _initMenu() {
6841
- const { menu = {} } = this._config;
6842
- this._menuService.addMenuItem(FactoryManageConditionalFormattingRule(this._injector), menu);
6843
- }
6844
6740
  _initPanel() {
6845
6741
  this._componentManager.register(CF_PANEL_KEY, ConditionFormattingPanel);
6846
6742
  }
6847
- }, __name(_a3, "ConditionalFormattingMenuController"), _a3);
6848
- ConditionalFormattingMenuController = __decorateClass$9([
6849
- OnLifecycle(LifecycleStages.Ready, ConditionalFormattingMenuController),
6850
- __decorateParam$9(1, IUniverInstanceService),
6851
- __decorateParam$9(2, Inject(Injector)),
6852
- __decorateParam$9(3, Inject(ComponentManager)),
6853
- __decorateParam$9(4, Inject(IMenuService)),
6854
- __decorateParam$9(5, Inject(ISidebarService)),
6855
- __decorateParam$9(6, Inject(LocaleService))
6856
- ], ConditionalFormattingMenuController);
6743
+ }, __name(_a3, "ConditionalFormattingPanelController"), _a3);
6744
+ ConditionalFormattingPanelController = __decorateClass$b([
6745
+ OnLifecycle(LifecycleStages.Ready, ConditionalFormattingPanelController),
6746
+ __decorateParam$b(0, IUniverInstanceService),
6747
+ __decorateParam$b(1, Inject(Injector)),
6748
+ __decorateParam$b(2, Inject(ComponentManager)),
6749
+ __decorateParam$b(3, Inject(ISidebarService)),
6750
+ __decorateParam$b(4, Inject(LocaleService))
6751
+ ], ConditionalFormattingPanelController);
6857
6752
  var CF_MENU_OPERATION = /* @__PURE__ */ ((CF_MENU_OPERATION2) => (CF_MENU_OPERATION2[CF_MENU_OPERATION2.createRule = 1] = "createRule", CF_MENU_OPERATION2[CF_MENU_OPERATION2.viewRule = 2] = "viewRule", CF_MENU_OPERATION2[CF_MENU_OPERATION2.highlightCell = 3] = "highlightCell", CF_MENU_OPERATION2[CF_MENU_OPERATION2.rank = 4] = "rank", CF_MENU_OPERATION2[CF_MENU_OPERATION2.formula = 5] = "formula", CF_MENU_OPERATION2[CF_MENU_OPERATION2.colorScale = 6] = "colorScale", CF_MENU_OPERATION2[CF_MENU_OPERATION2.dataBar = 7] = "dataBar", CF_MENU_OPERATION2[CF_MENU_OPERATION2.icon = 8] = "icon", CF_MENU_OPERATION2[CF_MENU_OPERATION2.clearRangeRules = 9] = "clearRangeRules", CF_MENU_OPERATION2[CF_MENU_OPERATION2.clearWorkSheetRules = 10] = "clearWorkSheetRules", CF_MENU_OPERATION2))(CF_MENU_OPERATION || {});
6858
6753
  const OpenConditionalFormattingOperator = {
6859
6754
  id: "sheet.operation.open.conditional.formatting.panel",
6860
6755
  type: CommandType.OPERATION,
6861
6756
  handler: /* @__PURE__ */ __name((accessor, params) => {
6862
- var _a13;
6863
- const conditionalFormattingMenuController = accessor.get(ConditionalFormattingMenuController), selectionManagerService = accessor.get(SheetsSelectionsService), commandService = accessor.get(ICommandService), ranges = ((_a13 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a13.map((s) => s.range)) || [];
6757
+ var _a15;
6758
+ const conditionalFormattingMenuController = accessor.get(ConditionalFormattingPanelController), selectionManagerService = accessor.get(SheetsSelectionsService), commandService = accessor.get(ICommandService), ranges = ((_a15 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a15.map((s) => s.range)) || [];
6864
6759
  switch (params.value) {
6865
6760
  case 3: {
6866
6761
  conditionalFormattingMenuController.openPanel({ ...createDefaultRule(), ranges });
@@ -6948,37 +6843,45 @@ const OpenConditionalFormattingOperator = {
6948
6843
  return !0;
6949
6844
  }, "handler")
6950
6845
  };
6951
- var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
6952
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
6846
+ var __defProp$a = Object.defineProperty, __getOwnPropDesc$a = Object.getOwnPropertyDescriptor, __decorateClass$a = /* @__PURE__ */ __name((decorators, target, key, kind) => {
6847
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
6953
6848
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
6954
- return kind && result && __defProp$8(target, key, result), result;
6955
- }, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$8"), _a4;
6849
+ return kind && result && __defProp$a(target, key, result), result;
6850
+ }, "__decorateClass$a"), __decorateParam$a = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$a"), _a4;
6956
6851
  let SheetsCfRenderController = (_a4 = class extends Disposable {
6957
6852
  constructor(_sheetInterceptorService, _conditionalFormattingService, _univerInstanceService, _renderManagerService, _conditionalFormattingViewModel, _conditionalFormattingRuleModel) {
6958
- 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();
6853
+ super();
6854
+ /**
6855
+ * When a set operation is triggered multiple times over a short period of time, it may result in some callbacks not being disposed,and caused a render cache exception.
6856
+ * The solution here is to store all the asynchronous tasks and focus on processing after the last callback
6857
+ */
6858
+ __publicField(this, "_ruleChangeCacheMap", /* @__PURE__ */ new Map());
6859
+ this._sheetInterceptorService = _sheetInterceptorService, this._conditionalFormattingService = _conditionalFormattingService, this._univerInstanceService = _univerInstanceService, this._renderManagerService = _renderManagerService, this._conditionalFormattingViewModel = _conditionalFormattingViewModel, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._initViewModelInterceptor(), this._initViewModel(), this._initSkeleton(), this._initVmEffectByRule(), this.disposeWithMe(() => {
6860
+ this._ruleChangeCacheMap.clear();
6861
+ });
6862
+ }
6863
+ markDirtySkeleton() {
6864
+ var _a15, _b, _c;
6865
+ const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId();
6866
+ (_a15 = this._renderManagerService.getRenderById(unitId)) == null || _a15.with(SheetSkeletonManagerService).reCalculate(), (_c = (_b = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _b.mainComponent) == null || _c.makeDirty();
6959
6867
  }
6960
6868
  _initSkeleton() {
6961
- const markDirtySkeleton = /* @__PURE__ */ __name(() => {
6962
- var _a13, _b, _c;
6963
- const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId();
6964
- (_a13 = this._renderManagerService.getRenderById(unitId)) == null || _a13.with(SheetSkeletonManagerService).reCalculate(), (_c = (_b = this._renderManagerService.getRenderById(unitId)) == null ? void 0 : _b.mainComponent) == null || _c.makeDirty();
6965
- }, "markDirtySkeleton");
6966
6869
  this.disposeWithMe(this._conditionalFormattingViewModel.markDirty$.pipe(bufferTime(16), filter((v) => {
6967
6870
  const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
6968
6871
  if (!workbook) return !1;
6969
6872
  const worksheet = workbook.getActiveSheet();
6970
6873
  return worksheet ? v.filter((item2) => item2.unitId === workbook.getUnitId() && item2.subUnitId === worksheet.getSheetId()).length > 0 : !1;
6971
- })).subscribe(markDirtySkeleton)), this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(bufferTime(16), filter((v) => {
6874
+ })).subscribe(() => this.markDirtySkeleton())), this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.pipe(bufferTime(16), filter((v) => {
6972
6875
  const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
6973
6876
  if (!workbook) return !1;
6974
6877
  const worksheet = workbook.getActiveSheet();
6975
6878
  return worksheet ? v.filter((item2) => ["sort", "delete"].includes(item2.type) && item2.unitId === workbook.getUnitId() && item2.subUnitId === worksheet.getSheetId()).length > 0 : !1;
6976
- })).subscribe(markDirtySkeleton)), this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(bufferTime(16), filter((v) => {
6879
+ })).subscribe(() => this.markDirtySkeleton())), this.disposeWithMe(this._conditionalFormattingService.ruleComputeStatus$.pipe(bufferTime(16), filter((v) => {
6977
6880
  const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
6978
6881
  if (!workbook) return !1;
6979
6882
  const worksheet = workbook.getActiveSheet();
6980
6883
  return worksheet ? v.filter((item2) => item2.unitId === workbook.getUnitId() && item2.subUnitId === worksheet.getSheetId()).length > 0 : !1;
6981
- })).subscribe(markDirtySkeleton));
6884
+ })).subscribe(() => this.markDirtySkeleton()));
6982
6885
  }
6983
6886
  _initVmEffectByRule() {
6984
6887
  this.disposeWithMe(
@@ -6986,12 +6889,7 @@ let SheetsCfRenderController = (_a4 = class extends Disposable {
6986
6889
  const { rule, unitId, subUnitId } = config;
6987
6890
  switch (config.type) {
6988
6891
  case "add": {
6989
- const cfPriorityMap = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId).map((item2) => item2.cfId).reduce((map, cur, index2) => (map.set(cur, index2), map), /* @__PURE__ */ new Map());
6990
- rule.ranges.forEach((range) => {
6991
- Range.foreach(range, (row, col) => {
6992
- this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, rule.cfId), this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
6993
- });
6994
- }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
6892
+ this._handleRuleAdd(unitId, subUnitId, rule);
6995
6893
  return;
6996
6894
  }
6997
6895
  case "delete": {
@@ -7003,28 +6901,7 @@ let SheetsCfRenderController = (_a4 = class extends Disposable {
7003
6901
  return;
7004
6902
  }
7005
6903
  case "set": {
7006
- 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, {
7007
- handler: /* @__PURE__ */ __name((config2, _, next) => {
7008
- if (unitId === (config2 == null ? void 0 : config2.unitId) && subUnitId === config2.subUnitId && oldRule.cfId === config2.cfId) {
7009
- oldRule.ranges.forEach((range) => {
7010
- Range.foreach(range, (row, col) => {
7011
- this._conditionalFormattingViewModel.deleteCellCf(unitId, subUnitId, row, col, oldRule.cfId);
7012
- });
7013
- }), rule.ranges.forEach((range) => {
7014
- Range.foreach(range, (row, col) => {
7015
- this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, oldRule.cfId), this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
7016
- });
7017
- }), dispose();
7018
- return;
7019
- }
7020
- next(config2);
7021
- }, "handler")
7022
- });
7023
- rule.ranges.forEach((range) => {
7024
- Range.foreach(range, (row, col) => {
7025
- this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, oldRule.cfId);
7026
- });
7027
- }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
6904
+ this._handleRuleChange(unitId, subUnitId, rule, config.oldRule);
7028
6905
  return;
7029
6906
  }
7030
6907
  case "sort": {
@@ -7039,6 +6916,57 @@ let SheetsCfRenderController = (_a4 = class extends Disposable {
7039
6916
  })
7040
6917
  );
7041
6918
  }
6919
+ _initViewModel() {
6920
+ let isNeedMark = !1;
6921
+ this._univerInstanceService.getAllUnitsForType(UniverInstanceType.UNIVER_SHEET).forEach((workbook) => {
6922
+ const unitId = workbook.getUnitId(), subRuleMap = this._conditionalFormattingRuleModel.getUnitRules(unitId);
6923
+ subRuleMap && [...subRuleMap.keys()].forEach((subUnitId) => {
6924
+ subRuleMap.get(subUnitId).forEach((rule) => {
6925
+ this._handleRuleAdd(unitId, subUnitId, rule), isNeedMark = !0;
6926
+ });
6927
+ });
6928
+ }), isNeedMark && this.markDirtySkeleton();
6929
+ }
6930
+ _handleRuleAdd(unitId, subUnitId, rule) {
6931
+ const cfPriorityMap = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId).map((item2) => item2.cfId).reduce((map, cur, index2) => (map.set(cur, index2), map), /* @__PURE__ */ new Map());
6932
+ rule.ranges.forEach((range) => {
6933
+ Range.foreach(range, (row, col) => {
6934
+ this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, rule.cfId), this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
6935
+ });
6936
+ }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
6937
+ }
6938
+ _handleRuleChange(unitId, subUnitId, rule, oldRule) {
6939
+ const cfPriorityMap = this._conditionalFormattingRuleModel.getSubunitRules(unitId, subUnitId).map((item2) => item2.cfId).reduce((map, cur, index2) => (map.set(cur, index2), map), /* @__PURE__ */ new Map()), handleChange = /* @__PURE__ */ __name((oldRule2, newRule) => {
6940
+ oldRule2.ranges.forEach((range) => {
6941
+ Range.foreach(range, (row, col) => {
6942
+ this._conditionalFormattingViewModel.deleteCellCf(unitId, subUnitId, row, col, oldRule2.cfId);
6943
+ });
6944
+ }), newRule.ranges.forEach((range) => {
6945
+ Range.foreach(range, (row, col) => {
6946
+ this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, oldRule2.cfId), this._conditionalFormattingViewModel.sortCellCf(unitId, subUnitId, row, col, cfPriorityMap);
6947
+ });
6948
+ });
6949
+ }, "handleChange"), dispose = this._conditionalFormattingService.interceptorManager.intercept(this._conditionalFormattingService.interceptorManager.getInterceptPoints().beforeUpdateRuleResult, {
6950
+ handler: /* @__PURE__ */ __name((config, _, next) => {
6951
+ if (unitId === (config == null ? void 0 : config.unitId) && subUnitId === config.subUnitId && oldRule.cfId === config.cfId) {
6952
+ (this._ruleChangeCacheMap.get(config.cfId) || []).forEach((config2) => {
6953
+ handleChange(config2.oldRule, config2.rule), config2.dispose();
6954
+ }), this._ruleChangeCacheMap.delete(config.cfId);
6955
+ return;
6956
+ }
6957
+ next(config);
6958
+ }, "handler")
6959
+ });
6960
+ if (oldRule.cfId === rule.cfId) {
6961
+ let list2 = this._ruleChangeCacheMap.get(oldRule.cfId);
6962
+ list2 || (list2 = [], this._ruleChangeCacheMap.set(oldRule.cfId, list2)), list2.push({ oldRule, rule, dispose });
6963
+ }
6964
+ rule.ranges.forEach((range) => {
6965
+ Range.foreach(range, (row, col) => {
6966
+ this._conditionalFormattingViewModel.pushCellCf(unitId, subUnitId, row, col, oldRule.cfId);
6967
+ });
6968
+ }), this._conditionalFormattingViewModel.markRuleDirty(unitId, subUnitId, rule);
6969
+ }
7042
6970
  _initViewModelInterceptor() {
7043
6971
  this.disposeWithMe(this._sheetInterceptorService.intercept(INTERCEPTOR_POINT.CELL_CONTENT, {
7044
6972
  handler: /* @__PURE__ */ __name((cell, context, next) => {
@@ -7052,20 +6980,20 @@ let SheetsCfRenderController = (_a4 = class extends Disposable {
7052
6980
  }));
7053
6981
  }
7054
6982
  }, __name(_a4, "SheetsCfRenderController"), _a4);
7055
- SheetsCfRenderController = __decorateClass$8([
6983
+ SheetsCfRenderController = __decorateClass$a([
7056
6984
  OnLifecycle(LifecycleStages.Starting, SheetsCfRenderController),
7057
- __decorateParam$8(0, Inject(SheetInterceptorService)),
7058
- __decorateParam$8(1, Inject(ConditionalFormattingService)),
7059
- __decorateParam$8(2, Inject(IUniverInstanceService)),
7060
- __decorateParam$8(3, Inject(IRenderManagerService)),
7061
- __decorateParam$8(4, Inject(ConditionalFormattingViewModel)),
7062
- __decorateParam$8(5, Inject(ConditionalFormattingRuleModel))
6985
+ __decorateParam$a(0, Inject(SheetInterceptorService)),
6986
+ __decorateParam$a(1, Inject(ConditionalFormattingService)),
6987
+ __decorateParam$a(2, Inject(IUniverInstanceService)),
6988
+ __decorateParam$a(3, Inject(IRenderManagerService)),
6989
+ __decorateParam$a(4, Inject(ConditionalFormattingViewModel)),
6990
+ __decorateParam$a(5, Inject(ConditionalFormattingRuleModel))
7063
6991
  ], SheetsCfRenderController);
7064
- var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7065
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
6992
+ var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
6993
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7066
6994
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7067
- return kind && result && __defProp$7(target, key, result), result;
7068
- }, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$7"), _a5;
6995
+ return kind && result && __defProp$9(target, key, result), result;
6996
+ }, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$9"), _a5;
7069
6997
  let ConditionalFormattingCopyPasteController = (_a5 = class extends Disposable {
7070
6998
  constructor(_sheetClipboardService, _conditionalFormattingRuleModel, _injector, _conditionalFormattingViewModel, _univerInstanceService) {
7071
6999
  super();
@@ -7219,19 +7147,19 @@ let ConditionalFormattingCopyPasteController = (_a5 = class extends Disposable {
7219
7147
  };
7220
7148
  }
7221
7149
  }, __name(_a5, "ConditionalFormattingCopyPasteController"), _a5);
7222
- ConditionalFormattingCopyPasteController = __decorateClass$7([
7150
+ ConditionalFormattingCopyPasteController = __decorateClass$9([
7223
7151
  OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingCopyPasteController),
7224
- __decorateParam$7(0, Inject(ISheetClipboardService)),
7225
- __decorateParam$7(1, Inject(ConditionalFormattingRuleModel)),
7226
- __decorateParam$7(2, Inject(Injector)),
7227
- __decorateParam$7(3, Inject(ConditionalFormattingViewModel)),
7228
- __decorateParam$7(4, Inject(IUniverInstanceService))
7152
+ __decorateParam$9(0, Inject(ISheetClipboardService)),
7153
+ __decorateParam$9(1, Inject(ConditionalFormattingRuleModel)),
7154
+ __decorateParam$9(2, Inject(Injector)),
7155
+ __decorateParam$9(3, Inject(ConditionalFormattingViewModel)),
7156
+ __decorateParam$9(4, Inject(IUniverInstanceService))
7229
7157
  ], ConditionalFormattingCopyPasteController);
7230
- var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7231
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7158
+ var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7159
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7232
7160
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7233
- return kind && result && __defProp$6(target, key, result), result;
7234
- }, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$6"), _a6;
7161
+ return kind && result && __defProp$8(target, key, result), result;
7162
+ }, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$8"), _a6;
7235
7163
  let SheetsCfRefRangeController = (_a6 = class extends Disposable {
7236
7164
  constructor(_conditionalFormattingRuleModel, _univerInstanceService, _injector, _refRangeService) {
7237
7165
  super(), this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._univerInstanceService = _univerInstanceService, this._injector = _injector, this._refRangeService = _refRangeService, this._initRefRange();
@@ -7280,18 +7208,18 @@ let SheetsCfRefRangeController = (_a6 = class extends Disposable {
7280
7208
  }));
7281
7209
  }
7282
7210
  }, __name(_a6, "SheetsCfRefRangeController"), _a6);
7283
- SheetsCfRefRangeController = __decorateClass$6([
7211
+ SheetsCfRefRangeController = __decorateClass$8([
7284
7212
  OnLifecycle(LifecycleStages.Rendered, SheetsCfRefRangeController),
7285
- __decorateParam$6(0, Inject(ConditionalFormattingRuleModel)),
7286
- __decorateParam$6(1, Inject(IUniverInstanceService)),
7287
- __decorateParam$6(2, Inject(Injector)),
7288
- __decorateParam$6(3, Inject(RefRangeService))
7213
+ __decorateParam$8(0, Inject(ConditionalFormattingRuleModel)),
7214
+ __decorateParam$8(1, Inject(IUniverInstanceService)),
7215
+ __decorateParam$8(2, Inject(Injector)),
7216
+ __decorateParam$8(3, Inject(RefRangeService))
7289
7217
  ], SheetsCfRefRangeController);
7290
- var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7291
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7218
+ var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7219
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7292
7220
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7293
- return kind && result && __defProp$5(target, key, result), result;
7294
- }, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$5"), _a7;
7221
+ return kind && result && __defProp$7(target, key, result), result;
7222
+ }, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$7"), _a7;
7295
7223
  let ConditionalFormattingPermissionController = (_a7 = class extends Disposable {
7296
7224
  constructor(_localeService, _commandService, _sheetPermissionInterceptorBaseController) {
7297
7225
  super(), this._localeService = _localeService, this._commandService = _commandService, this._sheetPermissionInterceptorBaseController = _sheetPermissionInterceptorBaseController, this._commandExecutedListener();
@@ -7308,20 +7236,23 @@ let ConditionalFormattingPermissionController = (_a7 = class extends Disposable
7308
7236
  );
7309
7237
  }
7310
7238
  }, __name(_a7, "ConditionalFormattingPermissionController"), _a7);
7311
- ConditionalFormattingPermissionController = __decorateClass$5([
7239
+ ConditionalFormattingPermissionController = __decorateClass$7([
7312
7240
  OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingPermissionController),
7313
- __decorateParam$5(0, Inject(LocaleService)),
7314
- __decorateParam$5(1, ICommandService),
7315
- __decorateParam$5(2, Inject(SheetPermissionInterceptorBaseController))
7241
+ __decorateParam$7(0, Inject(LocaleService)),
7242
+ __decorateParam$7(1, ICommandService),
7243
+ __decorateParam$7(2, Inject(SheetPermissionInterceptorBaseController))
7316
7244
  ], ConditionalFormattingPermissionController);
7317
- var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp$1"), __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7318
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7245
+ const PLUGIN_CONFIG_KEY = "sheets-conditional-formatting-ui.config", defaultPluginConfig = {};
7246
+ var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp$1"), __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7247
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7319
7248
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7320
- return kind && result && __defProp$4(target, key, result), result;
7321
- }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$4"), __publicField$1 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField$1"), _a8;
7249
+ return kind && result && __defProp$6(target, key, result), result;
7250
+ }, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$6"), __publicField$1 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp$1(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField$1"), _a8;
7322
7251
  let UniverSheetsConditionalFormattingMobileUIPlugin = (_a8 = class extends Plugin {
7323
- constructor(_config = {}, _injector, _commandService) {
7324
- super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this._config = Tools.deepMerge({}, DefaultSheetConditionalFormattingUiConfig, this._config), this._initCommand(), this._injector.add([SheetsCfRenderController]), this._injector.add([SheetsCfRefRangeController]), this._injector.add([ConditionalFormattingCopyPasteController]), this._injector.add([ConditionalFormattingPermissionController]), this._injector.add([ConditionalFormattingI18nController]);
7252
+ constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
7253
+ super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this._configService = _configService;
7254
+ const { menu, ...rest } = this._config;
7255
+ menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), this._initCommand(), this._injector.add([SheetsCfRenderController]), this._injector.add([SheetsCfRefRangeController]), this._injector.add([ConditionalFormattingCopyPasteController]), this._injector.add([ConditionalFormattingPermissionController]), this._injector.add([ConditionalFormattingI18nController]);
7325
7256
  }
7326
7257
  _initCommand() {
7327
7258
  [
@@ -7348,16 +7279,17 @@ let UniverSheetsConditionalFormattingMobileUIPlugin = (_a8 = class extends Plugi
7348
7279
  }, __name(_a8, "UniverSheetsConditionalFormattingMobileUIPlugin"), _a8);
7349
7280
  __publicField$1(UniverSheetsConditionalFormattingMobileUIPlugin, "pluginName", `${SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);
7350
7281
  __publicField$1(UniverSheetsConditionalFormattingMobileUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
7351
- UniverSheetsConditionalFormattingMobileUIPlugin = __decorateClass$4([
7282
+ UniverSheetsConditionalFormattingMobileUIPlugin = __decorateClass$6([
7352
7283
  DependentOn(UniverSheetsConditionalFormattingPlugin),
7353
- __decorateParam$4(1, Inject(Injector)),
7354
- __decorateParam$4(2, Inject(ICommandService))
7284
+ __decorateParam$6(1, Inject(Injector)),
7285
+ __decorateParam$6(2, Inject(ICommandService)),
7286
+ __decorateParam$6(3, IConfigService)
7355
7287
  ], UniverSheetsConditionalFormattingMobileUIPlugin);
7356
- var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7357
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7288
+ var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7289
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7358
7290
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7359
- return kind && result && __defProp$3(target, key, result), result;
7360
- }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$3"), _a9;
7291
+ return kind && result && __defProp$5(target, key, result), result;
7292
+ }, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$5"), _a9;
7361
7293
  let ConditionalFormattingAutoFillController = (_a9 = class extends Disposable {
7362
7294
  constructor(_injector, _univerInstanceService, _autoFillService, _conditionalFormattingRuleModel, _conditionalFormattingViewModel) {
7363
7295
  super(), this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._autoFillService = _autoFillService, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._conditionalFormattingViewModel = _conditionalFormattingViewModel, this._initAutoFill();
@@ -7365,8 +7297,8 @@ let ConditionalFormattingAutoFillController = (_a9 = class extends Disposable {
7365
7297
  // eslint-disable-next-line max-lines-per-function
7366
7298
  _initAutoFill() {
7367
7299
  const noopReturnFunc = /* @__PURE__ */ __name(() => ({ redos: [], undos: [] }), "noopReturnFunc"), loopFunc = /* @__PURE__ */ __name((sourceStartCell, targetStartCell, relativeRange, matrixMap, mapFunc) => {
7368
- var _a13;
7369
- const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a13 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a13.getSheetId();
7300
+ var _a15;
7301
+ const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a15 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a15.getSheetId();
7370
7302
  if (!unitId || !subUnitId)
7371
7303
  return;
7372
7304
  const sourceRange = {
@@ -7437,8 +7369,8 @@ let ConditionalFormattingAutoFillController = (_a9 = class extends Disposable {
7437
7369
  });
7438
7370
  });
7439
7371
  }, "loopFunc"), generalApplyFunc = /* @__PURE__ */ __name((sourceRange, targetRange) => {
7440
- var _a13, _b, _c;
7441
- const unitId = (_a13 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a13.getUnitId(), subUnitId = (_c = (_b = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _b.getActiveSheet()) == null ? void 0 : _c.getSheetId(), matrixMap = /* @__PURE__ */ new Map(), redos = [], undos = [];
7372
+ var _a15, _b, _c;
7373
+ const unitId = (_a15 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a15.getUnitId(), subUnitId = (_c = (_b = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _b.getActiveSheet()) == null ? void 0 : _c.getSheetId(), matrixMap = /* @__PURE__ */ new Map(), redos = [], undos = [];
7442
7374
  if (!unitId || !subUnitId)
7443
7375
  return noopReturnFunc();
7444
7376
  const virtualRange = virtualizeDiscreteRanges([sourceRange, targetRange]), [vSourceRange, vTargetRange] = virtualRange.ranges, { mapFunc } = virtualRange, sourceStartCell = {
@@ -7484,76 +7416,30 @@ let ConditionalFormattingAutoFillController = (_a9 = class extends Disposable {
7484
7416
  this.disposeWithMe(this._autoFillService.addHook(hook));
7485
7417
  }
7486
7418
  }, __name(_a9, "ConditionalFormattingAutoFillController"), _a9);
7487
- ConditionalFormattingAutoFillController = __decorateClass$3([
7419
+ ConditionalFormattingAutoFillController = __decorateClass$5([
7488
7420
  OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingAutoFillController),
7489
- __decorateParam$3(0, Inject(Injector)),
7490
- __decorateParam$3(1, Inject(IUniverInstanceService)),
7491
- __decorateParam$3(2, Inject(IAutoFillService)),
7492
- __decorateParam$3(3, Inject(ConditionalFormattingRuleModel)),
7493
- __decorateParam$3(4, Inject(ConditionalFormattingViewModel))
7421
+ __decorateParam$5(0, Inject(Injector)),
7422
+ __decorateParam$5(1, Inject(IUniverInstanceService)),
7423
+ __decorateParam$5(2, Inject(IAutoFillService)),
7424
+ __decorateParam$5(3, Inject(ConditionalFormattingRuleModel)),
7425
+ __decorateParam$5(4, Inject(ConditionalFormattingViewModel))
7494
7426
  ], ConditionalFormattingAutoFillController);
7495
- var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7496
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7497
- (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7498
- return kind && result && __defProp$2(target, key, result), result;
7499
- }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$2"), _a10;
7500
- let ConditionalFormattingEditorController = (_a10 = class extends Disposable {
7501
- constructor(_editorBridgeService, _conditionalFormattingService) {
7502
- super(), this._editorBridgeService = _editorBridgeService, this._conditionalFormattingService = _conditionalFormattingService, this._initInterceptorEditorEnd();
7503
- }
7504
- /**
7505
- * Process the values after edit
7506
- * @private
7507
- * @memberof NumfmtService
7508
- */
7509
- _initInterceptorEditorEnd() {
7510
- this.disposeWithMe(
7511
- toDisposable(
7512
- this._editorBridgeService.interceptor.intercept(
7513
- this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
7514
- {
7515
- handler: /* @__PURE__ */ __name((value, context, next) => {
7516
- const result = this._conditionalFormattingService.composeStyle(context.unitId, context.subUnitId, context.row, context.col);
7517
- if (result != null && result.style && (value != null && value.p)) {
7518
- const keys = Object.keys(result == null ? void 0 : result.style);
7519
- if (keys.length > 0) {
7520
- const v = getStringFromDataStream(value.p), s = { ...(typeof value.s == "string" ? context.workbook.getStyles().get(value.s) : value.s) || {} };
7521
- keys.forEach((key) => {
7522
- delete s[key];
7523
- });
7524
- const cellData = { ...value, s: { ...s }, v };
7525
- return delete cellData.p, next(cellData);
7526
- }
7527
- }
7528
- return next(value);
7529
- }, "handler")
7530
- }
7531
- )
7532
- )
7533
- );
7534
- }
7535
- }, __name(_a10, "ConditionalFormattingEditorController"), _a10);
7536
- ConditionalFormattingEditorController = __decorateClass$2([
7537
- OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingEditorController),
7538
- __decorateParam$2(0, Inject(IEditorBridgeService)),
7539
- __decorateParam$2(1, Inject(ConditionalFormattingService))
7540
- ], ConditionalFormattingEditorController);
7541
- var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7542
- for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7427
+ var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7428
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7543
7429
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7544
- return kind && result && __defProp$1(target, key, result), result;
7545
- }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$1"), _a11;
7546
- let ConditionalFormattingClearController = (_a11 = class extends Disposable {
7430
+ return kind && result && __defProp$4(target, key, result), result;
7431
+ }, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$4"), _a10;
7432
+ let ConditionalFormattingClearController = (_a10 = class extends Disposable {
7547
7433
  constructor(_injector, _univerInstanceService, _sheetInterceptorService, _selectionManagerService, _conditionalFormattingRuleModel) {
7548
7434
  super(), this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._sheetInterceptorService = _sheetInterceptorService, this._selectionManagerService = _selectionManagerService, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._init();
7549
7435
  }
7550
7436
  _init() {
7551
7437
  this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
7552
7438
  getMutations: /* @__PURE__ */ __name((commandInfo) => {
7553
- var _a13;
7439
+ var _a15;
7554
7440
  const redos = [], undos = [], defaultV = { redos, undos };
7555
7441
  if ([ClearSelectionFormatCommand.id, ClearSelectionAllCommand.id].includes(commandInfo.id)) {
7556
- const ranges = (_a13 = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : _a13.map((s) => s.range);
7442
+ const ranges = (_a15 = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : _a15.map((s) => s.range);
7557
7443
  if (!ranges)
7558
7444
  return defaultV;
7559
7445
  const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet();
@@ -7580,14 +7466,14 @@ let ConditionalFormattingClearController = (_a11 = class extends Disposable {
7580
7466
  }, "getMutations")
7581
7467
  }));
7582
7468
  }
7583
- }, __name(_a11, "ConditionalFormattingClearController"), _a11);
7584
- ConditionalFormattingClearController = __decorateClass$1([
7469
+ }, __name(_a10, "ConditionalFormattingClearController"), _a10);
7470
+ ConditionalFormattingClearController = __decorateClass$4([
7585
7471
  OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingClearController),
7586
- __decorateParam$1(0, Inject(Injector)),
7587
- __decorateParam$1(1, Inject(IUniverInstanceService)),
7588
- __decorateParam$1(2, Inject(SheetInterceptorService)),
7589
- __decorateParam$1(3, Inject(SheetsSelectionsService)),
7590
- __decorateParam$1(4, Inject(ConditionalFormattingRuleModel))
7472
+ __decorateParam$4(0, Inject(Injector)),
7473
+ __decorateParam$4(1, Inject(IUniverInstanceService)),
7474
+ __decorateParam$4(2, Inject(SheetInterceptorService)),
7475
+ __decorateParam$4(3, Inject(SheetsSelectionsService)),
7476
+ __decorateParam$4(4, Inject(ConditionalFormattingRuleModel))
7591
7477
  ], ConditionalFormattingClearController);
7592
7478
  function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId) {
7593
7479
  const redos = [], undos = [];
@@ -7617,19 +7503,408 @@ function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId)
7617
7503
  }), { redos, undos };
7618
7504
  }
7619
7505
  __name(generateClearCfMutations, "generateClearCfMutations");
7506
+ var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7507
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7508
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7509
+ return kind && result && __defProp$3(target, key, result), result;
7510
+ }, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$3"), _a11;
7511
+ let ConditionalFormattingEditorController = (_a11 = class extends Disposable {
7512
+ constructor(_editorBridgeService, _conditionalFormattingService) {
7513
+ super(), this._editorBridgeService = _editorBridgeService, this._conditionalFormattingService = _conditionalFormattingService, this._initInterceptorEditorEnd();
7514
+ }
7515
+ /**
7516
+ * Process the values after edit
7517
+ * @private
7518
+ * @memberof NumfmtService
7519
+ */
7520
+ _initInterceptorEditorEnd() {
7521
+ this.disposeWithMe(
7522
+ toDisposable(
7523
+ this._editorBridgeService.interceptor.intercept(
7524
+ this._editorBridgeService.interceptor.getInterceptPoints().AFTER_CELL_EDIT,
7525
+ {
7526
+ handler: /* @__PURE__ */ __name((value, context, next) => {
7527
+ const result = this._conditionalFormattingService.composeStyle(context.unitId, context.subUnitId, context.row, context.col);
7528
+ if (result != null && result.style && (value != null && value.p)) {
7529
+ const keys = Object.keys(result == null ? void 0 : result.style);
7530
+ if (keys.length > 0) {
7531
+ const v = getStringFromDataStream(value.p), s = { ...(typeof value.s == "string" ? context.workbook.getStyles().get(value.s) : value.s) || {} };
7532
+ keys.forEach((key) => {
7533
+ delete s[key];
7534
+ });
7535
+ const cellData = { ...value, s: { ...s }, v };
7536
+ return delete cellData.p, next(cellData);
7537
+ }
7538
+ }
7539
+ return next(value);
7540
+ }, "handler")
7541
+ }
7542
+ )
7543
+ )
7544
+ );
7545
+ }
7546
+ }, __name(_a11, "ConditionalFormattingEditorController"), _a11);
7547
+ ConditionalFormattingEditorController = __decorateClass$3([
7548
+ OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingEditorController),
7549
+ __decorateParam$3(0, Inject(IEditorBridgeService)),
7550
+ __decorateParam$3(1, Inject(ConditionalFormattingService))
7551
+ ], ConditionalFormattingEditorController);
7552
+ const commandList = [
7553
+ SetWorksheetActiveOperation.id,
7554
+ AddConditionalRuleMutation.id,
7555
+ SetConditionalRuleMutation.id,
7556
+ DeleteConditionalRuleMutation.id,
7557
+ MoveConditionalRuleMutation.id
7558
+ ], commonSelections = [
7559
+ {
7560
+ label: "sheet.cf.ruleType.highlightCell",
7561
+ value: CF_MENU_OPERATION.highlightCell
7562
+ },
7563
+ {
7564
+ label: "sheet.cf.panel.rankAndAverage",
7565
+ value: CF_MENU_OPERATION.rank
7566
+ },
7567
+ {
7568
+ label: "sheet.cf.ruleType.formula",
7569
+ value: CF_MENU_OPERATION.formula
7570
+ },
7571
+ {
7572
+ label: "sheet.cf.ruleType.colorScale",
7573
+ value: CF_MENU_OPERATION.colorScale
7574
+ },
7575
+ {
7576
+ label: "sheet.cf.ruleType.dataBar",
7577
+ value: CF_MENU_OPERATION.dataBar
7578
+ },
7579
+ {
7580
+ label: "sheet.cf.ruleType.iconSet",
7581
+ value: CF_MENU_OPERATION.icon
7582
+ },
7583
+ {
7584
+ label: "sheet.cf.menu.manageConditionalFormatting",
7585
+ value: CF_MENU_OPERATION.viewRule
7586
+ },
7587
+ {
7588
+ label: "sheet.cf.menu.createConditionalFormatting",
7589
+ value: CF_MENU_OPERATION.createRule
7590
+ },
7591
+ {
7592
+ label: "sheet.cf.menu.clearRangeRules",
7593
+ value: CF_MENU_OPERATION.clearRangeRules,
7594
+ disabled: !1
7595
+ },
7596
+ {
7597
+ label: "sheet.cf.menu.clearWorkSheetRules",
7598
+ value: CF_MENU_OPERATION.clearWorkSheetRules
7599
+ }
7600
+ ], FactoryManageConditionalFormattingRule = /* @__PURE__ */ __name((accessor) => {
7601
+ const selectionManagerService = accessor.get(SheetsSelectionsService), commandService = accessor.get(ICommandService), univerInstanceService = accessor.get(IUniverInstanceService), conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel), clearRangeEnable$ = new Observable((subscriber) => merge(
7602
+ selectionManagerService.selectionMoveEnd$,
7603
+ new Observable((commandSubscribe) => {
7604
+ const disposable = commandService.onCommandExecuted((commandInfo) => {
7605
+ var _a15;
7606
+ const { id, params } = commandInfo, unitId = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a15.getUnitId();
7607
+ commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
7608
+ });
7609
+ return () => disposable.dispose();
7610
+ })
7611
+ ).pipe(debounceTime$1(16)).subscribe(() => {
7612
+ var _a15;
7613
+ const ranges = ((_a15 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a15.map((selection) => selection.range)) || [], workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
7614
+ if (!workbook) return;
7615
+ const worksheet = workbook.getActiveSheet();
7616
+ if (!worksheet) return;
7617
+ 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));
7618
+ subscriber.next(hasPermission);
7619
+ })), clearSheetEnable$ = new Observable(
7620
+ (subscriber) => new Observable((commandSubscribe) => {
7621
+ const disposable = commandService.onCommandExecuted((commandInfo) => {
7622
+ var _a15;
7623
+ const { id, params } = commandInfo, unitId = (_a15 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a15.getUnitId();
7624
+ commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
7625
+ });
7626
+ return () => disposable.dispose();
7627
+ }).pipe(debounceTime$1(16)).subscribe(() => {
7628
+ const workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
7629
+ if (!workbook) return;
7630
+ const worksheet = workbook.getActiveSheet();
7631
+ if (!worksheet) return;
7632
+ const allRule = conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId()) || [];
7633
+ if (!allRule.length)
7634
+ return subscriber.next(!1), !1;
7635
+ const hasPermission = allRule.map((rule) => rule.ranges).every((ranges) => checkRangesEditablePermission(accessor, workbook.getUnitId(), worksheet.getSheetId(), ranges));
7636
+ subscriber.next(hasPermission);
7637
+ })
7638
+ ), selections$ = new Observable((subscriber) => {
7639
+ clearRangeEnable$.subscribe((v) => {
7640
+ const item2 = commonSelections.find((item22) => item22.value === CF_MENU_OPERATION.clearRangeRules);
7641
+ item2 && (item2.disabled = !v, subscriber.next(commonSelections));
7642
+ }), clearSheetEnable$.subscribe((v) => {
7643
+ const item2 = commonSelections.find((item22) => item22.value === CF_MENU_OPERATION.clearWorkSheetRules);
7644
+ item2 && (item2.disabled = !v, subscriber.next(commonSelections));
7645
+ }), subscriber.next(commonSelections);
7646
+ });
7647
+ return {
7648
+ id: OpenConditionalFormattingOperator.id,
7649
+ type: MenuItemType.SELECTOR,
7650
+ icon: "Conditions",
7651
+ tooltip: "sheet.cf.title",
7652
+ selections: selections$,
7653
+ hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
7654
+ disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetSetCellStylePermission, WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })
7655
+ };
7656
+ }, "FactoryManageConditionalFormattingRule"), menuSchema = {
7657
+ [RibbonStartGroup.FORMULAS_INSERT]: {
7658
+ [OpenConditionalFormattingOperator.id]: {
7659
+ order: 0,
7660
+ menuItemFactory: FactoryManageConditionalFormattingRule
7661
+ }
7662
+ }
7663
+ };
7664
+ var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7665
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7666
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7667
+ return kind && result && __defProp$2(target, key, result), result;
7668
+ }, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$2"), _a12;
7669
+ let ConditionalFormattingMenuController = (_a12 = class extends Disposable {
7670
+ constructor(_injector, _menuManagerService) {
7671
+ super();
7672
+ __publicField(this, "_sidebarDisposable", null);
7673
+ this._injector = _injector, this._menuManagerService = _menuManagerService, this._menuManagerService.mergeMenu(menuSchema);
7674
+ }
7675
+ }, __name(_a12, "ConditionalFormattingMenuController"), _a12);
7676
+ ConditionalFormattingMenuController = __decorateClass$2([
7677
+ OnLifecycle(LifecycleStages.Ready, ConditionalFormattingMenuController),
7678
+ __decorateParam$2(0, Inject(Injector)),
7679
+ __decorateParam$2(1, IMenuManagerService)
7680
+ ], ConditionalFormattingMenuController);
7681
+ var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPropertyDescriptor, __decorateClass$1 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
7682
+ for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7683
+ (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7684
+ return kind && result && __defProp$1(target, key, result), result;
7685
+ }, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$1");
7686
+ const repeatByRange = /* @__PURE__ */ __name((sourceRange, targetRange) => {
7687
+ const getRowLength = /* @__PURE__ */ __name((range) => range.endRow - range.startRow + 1, "getRowLength"), getColLength = /* @__PURE__ */ __name((range) => range.endColumn - range.startColumn + 1, "getColLength"), rowMod = getRowLength(targetRange) % getRowLength(sourceRange), colMod = getColLength(targetRange) % getColLength(sourceRange), repeatRow = Math.floor(getRowLength(targetRange) / getRowLength(sourceRange)), repeatCol = Math.floor(getColLength(targetRange) / getColLength(sourceRange)), repeatList = [], repeatRelativeRange = {
7688
+ startRow: 0,
7689
+ endRow: getRowLength(sourceRange) - 1,
7690
+ startColumn: 0,
7691
+ endColumn: getColLength(sourceRange) - 1
7692
+ };
7693
+ if (getRowLength(targetRange) === 1 && getColLength(targetRange) === 1) {
7694
+ const startRange = {
7695
+ startRow: targetRange.startRow,
7696
+ endRow: targetRange.startRow,
7697
+ startColumn: targetRange.startColumn,
7698
+ endColumn: targetRange.startColumn
7699
+ };
7700
+ return repeatList.push({ repeatRelativeRange, startRange }), repeatList;
7701
+ }
7702
+ for (let countRow = 0; countRow < repeatRow + (rowMod ? 0.1 : 0); countRow++)
7703
+ for (let countCol = 0; countCol < repeatCol + (colMod ? 0.1 : 0); countCol++) {
7704
+ const row = getRowLength(sourceRange) * countRow, col = getColLength(sourceRange) * countCol, startRange = {
7705
+ startRow: row + targetRange.startRow,
7706
+ endRow: row + targetRange.startRow,
7707
+ startColumn: col + targetRange.startColumn,
7708
+ endColumn: col + targetRange.startColumn
7709
+ };
7710
+ let _repeatRelativeRange = repeatRelativeRange;
7711
+ countRow === repeatRow && rowMod && (_repeatRelativeRange = { ..._repeatRelativeRange }, _repeatRelativeRange.endRow = _repeatRelativeRange.endRow - (getRowLength(sourceRange) - rowMod)), countCol === repeatCol && colMod && (_repeatRelativeRange = { ..._repeatRelativeRange }, _repeatRelativeRange.endColumn = _repeatRelativeRange.endColumn - (getColLength(sourceRange) - colMod)), repeatList.push({ repeatRelativeRange: _repeatRelativeRange, startRange });
7712
+ }
7713
+ return repeatList;
7714
+ }, "repeatByRange");
7715
+ var _a13;
7716
+ let ConditionalFormattingPainterController = (_a13 = class extends Disposable {
7717
+ constructor(_injector, _univerInstanceService, _formatPainterService, _sheetsSelectionsService, _conditionalFormattingRuleModel, _conditionalFormattingViewModel) {
7718
+ super();
7719
+ __publicField(this, "_painterConfig", null);
7720
+ this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._formatPainterService = _formatPainterService, this._sheetsSelectionsService = _sheetsSelectionsService, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._conditionalFormattingViewModel = _conditionalFormattingViewModel, this._initFormattingPainter();
7721
+ }
7722
+ // eslint-disable-next-line max-lines-per-function
7723
+ _initFormattingPainter() {
7724
+ const noopReturnFunc = /* @__PURE__ */ __name(() => ({ redos: [], undos: [] }), "noopReturnFunc"), loopFunc = /* @__PURE__ */ __name((sourceStartCell, targetStartCell, relativeRange, matrixMap, config) => {
7725
+ const { unitId: sourceUnitId, subUnitId: sourceSubUnitId } = this._painterConfig, { targetUnitId, targetSubUnitId } = config, sourceRange = {
7726
+ startRow: sourceStartCell.row,
7727
+ startColumn: sourceStartCell.col,
7728
+ endColumn: sourceStartCell.col,
7729
+ endRow: sourceStartCell.row
7730
+ }, targetRange = {
7731
+ startRow: targetStartCell.row,
7732
+ startColumn: targetStartCell.col,
7733
+ endColumn: targetStartCell.col,
7734
+ endRow: targetStartCell.row
7735
+ };
7736
+ Range.foreach(relativeRange, (row, col) => {
7737
+ const sourcePositionRange = Rectangle.getPositionRange(
7738
+ {
7739
+ startRow: row,
7740
+ startColumn: col,
7741
+ endColumn: col,
7742
+ endRow: row
7743
+ },
7744
+ sourceRange
7745
+ ), targetPositionRange = Rectangle.getPositionRange(
7746
+ {
7747
+ startRow: row,
7748
+ startColumn: col,
7749
+ endColumn: col,
7750
+ endRow: row
7751
+ },
7752
+ targetRange
7753
+ ), sourceCellCf = this._conditionalFormattingViewModel.getCellCf(
7754
+ sourceUnitId,
7755
+ sourceSubUnitId,
7756
+ sourcePositionRange.startRow,
7757
+ sourcePositionRange.startColumn
7758
+ ), targetCellCf = this._conditionalFormattingViewModel.getCellCf(
7759
+ targetUnitId,
7760
+ targetSubUnitId,
7761
+ targetPositionRange.startRow,
7762
+ targetPositionRange.startColumn
7763
+ );
7764
+ targetCellCf && targetCellCf.cfList.forEach((cf) => {
7765
+ let matrix = matrixMap.get(cf.cfId);
7766
+ if (!matrixMap.get(cf.cfId)) {
7767
+ const rule = this._conditionalFormattingRuleModel.getRule(targetUnitId, targetSubUnitId, cf.cfId);
7768
+ if (!rule)
7769
+ return;
7770
+ matrix = new ObjectMatrix(), rule.ranges.forEach((range) => {
7771
+ Range.foreach(range, (row2, col2) => {
7772
+ matrix.setValue(row2, col2, 1);
7773
+ });
7774
+ }), matrixMap.set(cf.cfId, matrix);
7775
+ }
7776
+ matrix.realDeleteValue(targetPositionRange.startRow, targetPositionRange.startColumn);
7777
+ }), sourceCellCf && sourceCellCf.cfList.forEach((cf) => {
7778
+ const matrix = matrixMap.get(cf.cfId);
7779
+ matrix && matrix.setValue(targetPositionRange.startRow, targetPositionRange.startColumn, 1);
7780
+ });
7781
+ });
7782
+ }, "loopFunc"), generalApplyFunc = /* @__PURE__ */ __name((targetUnitId, targetSubUnitId, targetRange) => {
7783
+ var _a15;
7784
+ const { range: sourceRange, unitId: sourceUnitId, subUnitId: sourceSubUnitId } = this._painterConfig, isSkipSheet = targetUnitId !== sourceUnitId || sourceSubUnitId !== targetSubUnitId, matrixMap = /* @__PURE__ */ new Map(), redos = [], undos = [];
7785
+ if (!targetUnitId || !targetSubUnitId || !sourceUnitId || !sourceSubUnitId)
7786
+ return noopReturnFunc();
7787
+ const ruleList = (_a15 = this._conditionalFormattingRuleModel.getSubunitRules(sourceUnitId, sourceSubUnitId)) != null ? _a15 : [];
7788
+ ruleList == null || ruleList.forEach((rule) => {
7789
+ const { ranges, cfId } = rule;
7790
+ if (ranges.some((range) => Rectangle.intersects(sourceRange, range))) {
7791
+ const matrix = new ObjectMatrix();
7792
+ isSkipSheet || ranges.forEach((range) => {
7793
+ Range.foreach(range, (row, col) => {
7794
+ matrix.setValue(row, col, 1);
7795
+ });
7796
+ }), matrixMap.set(cfId, matrix);
7797
+ }
7798
+ });
7799
+ const sourceStartCell = {
7800
+ row: sourceRange.startRow,
7801
+ col: sourceRange.startColumn
7802
+ };
7803
+ return repeatByRange(sourceRange, targetRange).forEach((repeat) => {
7804
+ loopFunc(sourceStartCell, { row: repeat.startRange.startRow, col: repeat.startRange.startColumn }, repeat.repeatRelativeRange, matrixMap, { targetUnitId, targetSubUnitId });
7805
+ }), matrixMap.forEach((item2, cfId) => {
7806
+ if (isSkipSheet) {
7807
+ const rule = this._conditionalFormattingRuleModel.getRule(targetUnitId, targetSubUnitId, cfId), ranges = findAllRectangle(createTopMatrixFromMatrix(item2));
7808
+ if (rule)
7809
+ if (ranges.length) {
7810
+ const params = {
7811
+ unitId: targetUnitId,
7812
+ subUnitId: targetSubUnitId,
7813
+ rule: { ...rule, ranges }
7814
+ };
7815
+ redos.push({ id: SetConditionalRuleMutation.id, params }), undos.push(...setConditionalRuleMutationUndoFactory(this._injector, params));
7816
+ } else {
7817
+ const params = {
7818
+ unitId: targetUnitId,
7819
+ subUnitId: targetSubUnitId,
7820
+ cfId: rule.cfId
7821
+ };
7822
+ redos.push({ id: DeleteConditionalRuleMutation.id, params }), undos.push(...DeleteConditionalRuleMutationUndoFactory(this._injector, params));
7823
+ }
7824
+ else if (ranges.length) {
7825
+ const sourceRule = this._conditionalFormattingRuleModel.getRule(sourceUnitId, sourceSubUnitId, cfId);
7826
+ if (sourceRule) {
7827
+ const params = {
7828
+ unitId: targetUnitId,
7829
+ subUnitId: targetSubUnitId,
7830
+ rule: {
7831
+ ...Tools.deepClone(sourceRule),
7832
+ cfId: this._conditionalFormattingRuleModel.createCfId(targetUnitId, targetSubUnitId),
7833
+ ranges
7834
+ }
7835
+ };
7836
+ redos.push({ id: AddConditionalRuleMutation.id, params }), undos.push(AddConditionalRuleMutationUndoFactory(this._injector, params));
7837
+ }
7838
+ }
7839
+ } else {
7840
+ const rule = this._conditionalFormattingRuleModel.getRule(sourceUnitId, sourceSubUnitId, cfId);
7841
+ if (!rule)
7842
+ return;
7843
+ const ranges = findAllRectangle(createTopMatrixFromMatrix(item2));
7844
+ if (ranges.length) {
7845
+ const params = {
7846
+ unitId: sourceUnitId,
7847
+ subUnitId: sourceSubUnitId,
7848
+ rule: { ...rule, ranges }
7849
+ };
7850
+ redos.push({ id: SetConditionalRuleMutation.id, params }), undos.push(...setConditionalRuleMutationUndoFactory(this._injector, params));
7851
+ } else {
7852
+ const params = {
7853
+ unitId: sourceUnitId,
7854
+ subUnitId: sourceSubUnitId,
7855
+ cfId: rule.cfId
7856
+ };
7857
+ redos.push({ id: DeleteConditionalRuleMutation.id, params }), undos.push(...DeleteConditionalRuleMutationUndoFactory(this._injector, params));
7858
+ }
7859
+ }
7860
+ }), {
7861
+ undos,
7862
+ redos
7863
+ };
7864
+ }, "generalApplyFunc"), hook = {
7865
+ id: SHEET_CONDITIONAL_FORMATTING_PLUGIN,
7866
+ onStatusChange: /* @__PURE__ */ __name((status) => {
7867
+ var _a15, _b, _c;
7868
+ switch (status) {
7869
+ case FormatPainterStatus.INFINITE:
7870
+ case FormatPainterStatus.ONCE: {
7871
+ const unitId = (_a15 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a15.getUnitId(), subUnitId = (_c = (_b = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _b.getActiveSheet()) == null ? void 0 : _c.getSheetId(), selection = this._sheetsSelectionsService.getCurrentLastSelection(), range = selection == null ? void 0 : selection.range;
7872
+ unitId && subUnitId && range && (this._painterConfig = { unitId, subUnitId, range });
7873
+ break;
7874
+ }
7875
+ case FormatPainterStatus.OFF: {
7876
+ this._painterConfig = null;
7877
+ break;
7878
+ }
7879
+ }
7880
+ }, "onStatusChange"),
7881
+ onApply: /* @__PURE__ */ __name((unitId, subUnitId, targetRange) => this._painterConfig ? generalApplyFunc(unitId, subUnitId, targetRange) : {
7882
+ redos: [],
7883
+ undos: []
7884
+ }, "onApply")
7885
+ };
7886
+ this._formatPainterService.addHook(hook);
7887
+ }
7888
+ }, __name(_a13, "ConditionalFormattingPainterController"), _a13);
7889
+ ConditionalFormattingPainterController = __decorateClass$1([
7890
+ OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingPainterController),
7891
+ __decorateParam$1(0, Inject(Injector)),
7892
+ __decorateParam$1(1, Inject(IUniverInstanceService)),
7893
+ __decorateParam$1(2, Inject(IFormatPainterService)),
7894
+ __decorateParam$1(3, Inject(SheetsSelectionsService)),
7895
+ __decorateParam$1(4, Inject(ConditionalFormattingRuleModel)),
7896
+ __decorateParam$1(5, Inject(ConditionalFormattingViewModel))
7897
+ ], ConditionalFormattingPainterController);
7620
7898
  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) => {
7621
7899
  for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
7622
7900
  (decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
7623
7901
  return kind && result && __defProp2(target, key, result), result;
7624
- }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam"), __publicField2 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField"), _a12;
7625
- let UniverSheetsConditionalFormattingUIPlugin = (_a12 = class extends Plugin {
7626
- constructor(_config = {}, _injector, _commandService) {
7627
- super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this._config = Tools.deepMerge({}, DefaultSheetConditionalFormattingUiConfig, this._config), this._initCommand(), this._injector.add([SheetsCfRenderController]), this._injector.add([SheetsCfRefRangeController]), this._injector.add([ConditionalFormattingCopyPasteController]), this._injector.add([ConditionalFormattingAutoFillController]), this._injector.add([ConditionalFormattingPermissionController]), this._injector.add([
7628
- ConditionalFormattingMenuController,
7629
- {
7630
- useFactory: /* @__PURE__ */ __name(() => this._injector.createInstance(ConditionalFormattingMenuController, this._config), "useFactory")
7631
- }
7632
- ]), this._injector.add([ConditionalFormattingI18nController]), this._injector.add([ConditionalFormattingEditorController]), this._injector.add([ConditionalFormattingClearController]);
7902
+ }, "__decorateClass"), __decorateParam = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam"), __publicField2 = /* @__PURE__ */ __name((obj, key, value) => __defNormalProp2(obj, typeof key != "symbol" ? key + "" : key, value), "__publicField"), _a14;
7903
+ let UniverSheetsConditionalFormattingUIPlugin = (_a14 = class extends Plugin {
7904
+ constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
7905
+ super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this._configService = _configService;
7906
+ const { menu, ...rest } = this._config;
7907
+ menu && this._configService.setConfig("menu", menu, { merge: !0 }), this._configService.setConfig(PLUGIN_CONFIG_KEY, rest), this._initCommand(), this._injector.add([SheetsCfRenderController]), this._injector.add([SheetsCfRefRangeController]), this._injector.add([ConditionalFormattingCopyPasteController]), this._injector.add([ConditionalFormattingAutoFillController]), this._injector.add([ConditionalFormattingPermissionController]), this._injector.add([ConditionalFormattingPanelController]), this._injector.add([ConditionalFormattingMenuController]), this._injector.add([ConditionalFormattingI18nController]), this._injector.add([ConditionalFormattingEditorController]), this._injector.add([ConditionalFormattingClearController]), this._injector.add([ConditionalFormattingPainterController]);
7633
7908
  }
7634
7909
  _initCommand() {
7635
7910
  [
@@ -7653,13 +7928,14 @@ let UniverSheetsConditionalFormattingUIPlugin = (_a12 = class extends Plugin {
7653
7928
  this._commandService.registerCommand(m2);
7654
7929
  });
7655
7930
  }
7656
- }, __name(_a12, "UniverSheetsConditionalFormattingUIPlugin"), _a12);
7931
+ }, __name(_a14, "UniverSheetsConditionalFormattingUIPlugin"), _a14);
7657
7932
  __publicField2(UniverSheetsConditionalFormattingUIPlugin, "pluginName", `${SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);
7658
7933
  __publicField2(UniverSheetsConditionalFormattingUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
7659
7934
  UniverSheetsConditionalFormattingUIPlugin = __decorateClass([
7660
7935
  DependentOn(UniverSheetsConditionalFormattingPlugin),
7661
7936
  __decorateParam(1, Inject(Injector)),
7662
- __decorateParam(2, Inject(ICommandService))
7937
+ __decorateParam(2, Inject(ICommandService)),
7938
+ __decorateParam(3, IConfigService)
7663
7939
  ], UniverSheetsConditionalFormattingUIPlugin);
7664
7940
  export {
7665
7941
  AddAverageCfCommand,