@univerjs/sheets-conditional-formatting-ui 1.0.0-alpha.7 → 1.0.0-alpha.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/cjs/index.js CHANGED
@@ -6,8 +6,8 @@ let _univerjs_ui = require("@univerjs/ui");
6
6
  let _univerjs_sheets_ui = require("@univerjs/sheets-ui");
7
7
  let rxjs = require("rxjs");
8
8
  let rxjs_operators = require("rxjs/operators");
9
- let _univerjs_sheets_formula = require("@univerjs/sheets-formula");
10
9
  let _univerjs_engine_render = require("@univerjs/engine-render");
10
+ let _univerjs_sheets_formula = require("@univerjs/sheets-formula");
11
11
  let _univerjs_icons = require("@univerjs/icons");
12
12
  let react = require("react");
13
13
  let _univerjs_design = require("@univerjs/design");
@@ -366,7 +366,7 @@ const AddUniqueValuesCfCommand = {
366
366
  };
367
367
 
368
368
  //#endregion
369
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
369
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
370
370
  function _typeof(o) {
371
371
  "@babel/helpers - typeof";
372
372
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -377,7 +377,7 @@ function _typeof(o) {
377
377
  }
378
378
 
379
379
  //#endregion
380
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
380
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
381
381
  function toPrimitive(t, r) {
382
382
  if ("object" != _typeof(t) || !t) return t;
383
383
  var e = t[Symbol.toPrimitive];
@@ -390,14 +390,14 @@ function toPrimitive(t, r) {
390
390
  }
391
391
 
392
392
  //#endregion
393
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
393
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
394
394
  function toPropertyKey(t) {
395
395
  var i = toPrimitive(t, "string");
396
396
  return "symbol" == _typeof(i) ? i : i + "";
397
397
  }
398
398
 
399
399
  //#endregion
400
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
400
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
401
401
  function _defineProperty(e, r, t) {
402
402
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
403
403
  value: t,
@@ -408,7 +408,7 @@ function _defineProperty(e, r, t) {
408
408
  }
409
409
 
410
410
  //#endregion
411
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
411
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
412
412
  function __decorateParam(paramIndex, decorator) {
413
413
  return function(target, key) {
414
414
  decorator(target, key, paramIndex);
@@ -416,7 +416,7 @@ function __decorateParam(paramIndex, decorator) {
416
416
  }
417
417
 
418
418
  //#endregion
419
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
419
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
420
420
  function __decorate(decorators, target, key, desc) {
421
421
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
422
422
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -987,7 +987,7 @@ const menuSchema = {
987
987
  //#endregion
988
988
  //#region package.json
989
989
  var name = "@univerjs/sheets-conditional-formatting-ui";
990
- var version = "1.0.0-alpha.7";
990
+ var version = "1.0.0-alpha.8";
991
991
 
992
992
  //#endregion
993
993
  //#region src/config/config.ts
@@ -1544,7 +1544,7 @@ let SheetsCfRenderController = class SheetsCfRenderController extends _univerjs_
1544
1544
  if (!workbook || !worksheet) return;
1545
1545
  const unitId = workbook.getUnitId();
1546
1546
  const subUnitId = worksheet.getSheetId();
1547
- const render = this._renderManagerService.getRenderById(unitId);
1547
+ const render = this._renderManagerService.getRenderUnitById(unitId);
1548
1548
  const skeletonManagerService = render === null || render === void 0 ? void 0 : render.with(_univerjs_sheets_ui.SheetSkeletonManagerService);
1549
1549
  const currentSkeleton = skeletonManagerService === null || skeletonManagerService === void 0 ? void 0 : skeletonManagerService.getCurrentSkeleton();
1550
1550
  const dirtyRanges = this._intersectDirtyRangesWithRenderedRange(this._collectDirtyRanges(items, unitId, subUnitId), currentSkeleton === null || currentSkeleton === void 0 ? void 0 : currentSkeleton.rowColumnSegment);
@@ -1658,7 +1658,7 @@ _defineProperty(UniverSheetsConditionalFormattingMobileUIPlugin, "packageName",
1658
1658
  _defineProperty(UniverSheetsConditionalFormattingMobileUIPlugin, "version", version);
1659
1659
  _defineProperty(UniverSheetsConditionalFormattingMobileUIPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
1660
1660
  UniverSheetsConditionalFormattingMobileUIPlugin = __decorate([
1661
- (0, _univerjs_core.DependentOn)(_univerjs_sheets_conditional_formatting.UniverSheetsConditionalFormattingPlugin),
1661
+ (0, _univerjs_core.DependentOn)(_univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_sheets.UniverSheetsPlugin, _univerjs_sheets_formula.UniverSheetsFormulaPlugin, _univerjs_sheets_conditional_formatting.UniverSheetsConditionalFormattingPlugin, _univerjs_sheets_ui.UniverSheetsMobileUIPlugin),
1662
1662
  __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
1663
1663
  __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_core.ICommandService)),
1664
1664
  __decorateParam(3, _univerjs_core.IConfigService)
@@ -2210,7 +2210,7 @@ let ConditionalFormattingViewportController = class ConditionalFormattingViewpor
2210
2210
  this._unitDisposable.dispose();
2211
2211
  this._unitDisposable = new _univerjs_core.DisposableCollection();
2212
2212
  const unitId = unit.getUnitId();
2213
- const render = this._renderManagerService.getRenderById(unitId);
2213
+ const render = this._renderManagerService.getRenderUnitById(unitId);
2214
2214
  if (!render) return;
2215
2215
  const sheetSkeletonManagerService = render.with(_univerjs_sheets_ui.SheetSkeletonManagerService);
2216
2216
  this._unitDisposable.add(sheetSkeletonManagerService.currentSkeleton$.subscribe((s) => {
@@ -2249,10 +2249,11 @@ const ColorPicker = (props) => {
2249
2249
  const { color, onChange, disable = false, Icon = _univerjs_icons.PaintBucketDoubleIcon, className } = props;
2250
2250
  const colorKit = (0, react.useMemo)(() => new _univerjs_core.ColorKit(color), [color]);
2251
2251
  const renderIcon = () => {
2252
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, {
2252
+ const iconProps = {
2253
2253
  className: (0, _univerjs_design.clsx)("univer-fill-primary-600", disable && className),
2254
2254
  extend: { colorChannel1: colorKit.isValid ? color : "" }
2255
- });
2255
+ };
2256
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { ...iconProps });
2256
2257
  };
2257
2258
  return !disable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_univerjs_design.Dropdown, {
2258
2259
  overlay: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -2411,7 +2412,7 @@ const TextInput$1 = (props) => {
2411
2412
  const [isFocusFormulaEditor, setIsFocusFormulaEditor] = (0, react.useState)(false);
2412
2413
  (0, _univerjs_ui.useSidebarClick)((e) => {
2413
2414
  var _formulaEditorRef$cur;
2414
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2415
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2415
2416
  });
2416
2417
  if (type === _univerjs_sheets_conditional_formatting.CFValueType.formula) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2417
2418
  className: "univer-ml-1 univer-w-full",
@@ -2819,7 +2820,7 @@ const InputText = (props) => {
2819
2820
  const [isFocusFormulaEditor, setIsFocusFormulaEditor] = (0, react.useState)(false);
2820
2821
  (0, _univerjs_ui.useSidebarClick)((e) => {
2821
2822
  var _formulaEditorRef$cur;
2822
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2823
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2823
2824
  });
2824
2825
  const _value = (0, react.useRef)(value);
2825
2826
  const config = (0, react.useMemo)(() => {
@@ -3345,7 +3346,7 @@ const FormulaStyleEditor = (props) => {
3345
3346
  };
3346
3347
  (0, _univerjs_ui.useSidebarClick)((e) => {
3347
3348
  var _formulaEditorRef$cur;
3348
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3349
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3349
3350
  });
3350
3351
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3351
3352
  ref: divEleRef,
@@ -3821,7 +3822,7 @@ const TextInput = (props) => {
3821
3822
  const [isFocusFormulaEditor, setIsFocusFormulaEditor] = (0, react.useState)(false);
3822
3823
  (0, _univerjs_ui.useSidebarClick)((e) => {
3823
3824
  var _formulaEditorRef$cur;
3824
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3825
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3825
3826
  });
3826
3827
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3827
3828
  className: "univer-relative",
@@ -3981,7 +3982,8 @@ const IconSetRuleEdit = (props) => {
3981
3982
  };
3982
3983
  const handleOperatorChange = (operator, index) => {
3983
3984
  onChange([String(index), "operator"], operator);
3984
- handleValueValueChange((0, _univerjs_sheets_conditional_formatting.createDefaultValue)(_univerjs_sheets_conditional_formatting.CFSubRuleType.number, operator), index);
3985
+ const defaultValue = (0, _univerjs_sheets_conditional_formatting.createDefaultValue)(_univerjs_sheets_conditional_formatting.CFSubRuleType.number, operator);
3986
+ handleValueValueChange(defaultValue, index);
3985
3987
  };
3986
3988
  const handleValueTypeChange = (v, index) => {
3987
3989
  onChange([
@@ -3990,7 +3992,8 @@ const IconSetRuleEdit = (props) => {
3990
3992
  "type"
3991
3993
  ], v);
3992
3994
  const item = configList[index];
3993
- handleValueValueChange((0, _univerjs_sheets_conditional_formatting.createDefaultValue)(_univerjs_sheets_conditional_formatting.CFSubRuleType.number, item.operator), index);
3995
+ const defaultValue = (0, _univerjs_sheets_conditional_formatting.createDefaultValue)(_univerjs_sheets_conditional_formatting.CFSubRuleType.number, item.operator);
3996
+ handleValueValueChange(defaultValue, index);
3994
3997
  };
3995
3998
  return (0, react.useMemo)(() => {
3996
3999
  return configList.map((item, index) => {
@@ -4229,7 +4232,8 @@ const IconSet = (props) => {
4229
4232
  const reverseIcon = () => {
4230
4233
  const iconList = configList.map((item) => ({ ...item }));
4231
4234
  configList.forEach((item, index) => {
4232
- const newIcon = iconList[configList.length - 1 - index];
4235
+ const mirrorIndex = configList.length - 1 - index;
4236
+ const newIcon = iconList[mirrorIndex];
4233
4237
  item.iconId = newIcon.iconId;
4234
4238
  item.iconType = newIcon.iconType;
4235
4239
  });
@@ -4605,7 +4609,8 @@ const RuleEdit = (props) => {
4605
4609
  const onRangeSelectorChange = (rangeString) => {
4606
4610
  if (!rangeSelectorTouched.current && rangeString.length < 1 && rangeResult.current.length > 0) return;
4607
4611
  rangeSelectorTouched.current = true;
4608
- rangeResult.current = rangeString.split(",").filter((e) => !!e).map(_univerjs_engine_formula.deserializeRangeWithSheet).map((item) => item.range);
4612
+ const result = rangeString.split(",").filter((e) => !!e).map(_univerjs_engine_formula.deserializeRangeWithSheet).map((item) => item.range);
4613
+ rangeResult.current = result;
4609
4614
  };
4610
4615
  const handleSubmit = () => {
4611
4616
  const getRanges = () => {
@@ -5129,7 +5134,7 @@ _defineProperty(UniverSheetsConditionalFormattingUIPlugin, "packageName", name);
5129
5134
  _defineProperty(UniverSheetsConditionalFormattingUIPlugin, "version", version);
5130
5135
  _defineProperty(UniverSheetsConditionalFormattingUIPlugin, "type", _univerjs_core.UniverInstanceType.UNIVER_SHEET);
5131
5136
  UniverSheetsConditionalFormattingUIPlugin = __decorate([
5132
- (0, _univerjs_core.DependentOn)(_univerjs_sheets_conditional_formatting.UniverSheetsConditionalFormattingPlugin, _univerjs_sheets_formula.UniverSheetsFormulaPlugin),
5137
+ (0, _univerjs_core.DependentOn)(_univerjs_engine_render.UniverRenderEnginePlugin, _univerjs_sheets.UniverSheetsPlugin, _univerjs_ui.UniverUIPlugin, _univerjs_sheets_formula.UniverSheetsFormulaPlugin, _univerjs_sheets_conditional_formatting.UniverSheetsConditionalFormattingPlugin, _univerjs_sheets_ui.UniverSheetsUIPlugin),
5133
5138
  __decorateParam(1, (0, _univerjs_core.Inject)(_univerjs_core.Injector)),
5134
5139
  __decorateParam(2, (0, _univerjs_core.Inject)(_univerjs_core.ICommandService)),
5135
5140
  __decorateParam(3, _univerjs_core.IConfigService)
@@ -88,9 +88,9 @@ const locale = { "sheets-conditional-formatting-ui": {
88
88
  lastWeek: "Semana pasada",
89
89
  nextWeek: "Semana siguiente",
90
90
  today: "Hoy",
91
- topN: "Top {0}",
91
+ topN: "Principales {0}",
92
92
  bottomN: "Inferior {0}",
93
- topNPercent: "Top {0}%",
93
+ topNPercent: "Principales {0}%",
94
94
  bottomNPercent: "Inferior {0}%"
95
95
  } },
96
96
  operator: {
@@ -151,7 +151,7 @@ const locale = { "sheets-conditional-formatting-ui": {
151
151
  errorMessage: {
152
152
  notBlank: "شرط نمی‌تواند خالی باشد",
153
153
  formulaError: "فرمول اشتباه",
154
- rangeError: "Bad selection"
154
+ rangeError: "انتخاب نامعتبر"
155
155
  },
156
156
  permission: { dialog: { setStyleErr: "محدوده محافظت شده است و شما مجوز تنظیم سبک‌ها را ندارید. برای تنظیم سبک‌ها، لطفا با سازنده تماس بگیرید." } }
157
157
  } };
@@ -88,9 +88,9 @@ const locale = { "sheets-conditional-formatting-ui": {
88
88
  lastWeek: "Poprzedni tydzień",
89
89
  nextWeek: "Następny tydzień",
90
90
  today: "Dzisiaj",
91
- topN: "Top {0}",
91
+ topN: "Górne {0}",
92
92
  bottomN: "Ostatnie {0}",
93
- topNPercent: "Top {0}%",
93
+ topNPercent: "Górne {0}%",
94
94
  bottomNPercent: "Ostatnie {0}%"
95
95
  } },
96
96
  operator: {
@@ -88,9 +88,9 @@ const locale = { "sheets-conditional-formatting-ui": {
88
88
  lastWeek: "Tuần trước",
89
89
  nextWeek: "Tuần sau",
90
90
  today: "Hôm nay",
91
- topN: "Top {0}",
91
+ topN: "Trên cùng {0}",
92
92
  bottomN: "Cuối {0}",
93
- topNPercent: "Top {0}%",
93
+ topNPercent: "Trên cùng {0}%",
94
94
  bottomNPercent: "Cuối {0}%"
95
95
  } },
96
96
  operator: {
@@ -151,7 +151,7 @@ const locale = { "sheets-conditional-formatting-ui": {
151
151
  errorMessage: {
152
152
  notBlank: "Điều kiện không được để trống",
153
153
  formulaError: "Lỗi công thức",
154
- rangeError: "Bad selection"
154
+ rangeError: "Lựa chọn không hợp lệ"
155
155
  },
156
156
  permission: { dialog: { setStyleErr: "Phạm vi này đã được bảo vệ, hiện không có quyền thiết lập kiểu. Nếu cần thiết lập kiểu, vui lòng liên hệ với người tạo." } }
157
157
  } };
package/lib/es/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { BooleanNumber, ColorKit, CommandType, DependentOn, Disposable, DisposableCollection, ICommandService, IConfigService, IUniverInstanceService, Inject, Injector, InterceptorEffectEnum, InterceptorManager, LocaleService, ObjectMatrix, Plugin, Range, Rectangle, Tools, UniverInstanceType, createInterceptorKey, generateRandomId, get, merge, registerDependencies, set, toDisposable, touchDependencies } from "@univerjs/core";
2
- import { AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AutoFillTools, ClearSelectionAllCommand, ClearSelectionFormatCommand, IAutoFillService, INTERCEPTOR_POINT, RangeProtectionPermissionEditPoint, RemoveSheetMutation, SetSelectionsOperation, SetWorksheetActiveOperation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, getSheetCommandTarget, rangeToDiscreteRange, setEndForRange } from "@univerjs/sheets";
2
+ import { AFTER_CELL_EDIT, AUTO_FILL_APPLY_TYPE, AutoFillTools, ClearSelectionAllCommand, ClearSelectionFormatCommand, IAutoFillService, INTERCEPTOR_POINT, RangeProtectionPermissionEditPoint, RemoveSheetMutation, SetSelectionsOperation, SetWorksheetActiveOperation, SheetInterceptorService, SheetPermissionCheckController, SheetsSelectionsService, UniverSheetsPlugin, WorkbookEditablePermission, WorksheetEditPermission, WorksheetSetCellStylePermission, checkRangesEditablePermission, getSheetCommandTarget, rangeToDiscreteRange, setEndForRange } from "@univerjs/sheets";
3
3
  import { AddCfCommand, AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRangeIndexModel, ConditionalFormattingRangeTransformService, ConditionalFormattingRuleModel, ConditionalFormattingService, ConditionalFormattingViewModel, DEFAULT_BG_COLOR, DEFAULT_FONT_COLOR, DEFAULT_PADDING, DEFAULT_WIDTH, DeleteCfCommand, DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, IIconSetType, MoveCfCommand, MoveConditionalRuleMutation, SHEET_CONDITIONAL_FORMATTING_PLUGIN, SetCfCommand, SetConditionalRuleMutation, UniverSheetsConditionalFormattingPlugin, compareWithNumber, createCfId, createDefaultRule, createDefaultValue, createDefaultValueByValueType, defaultDataBarNativeColor, defaultDataBarPositiveColor, getColorScaleFromValue, getOppositeOperator, iconGroup, iconMap, removeUndefinedAttr, setConditionalRuleMutationUndoFactory } from "@univerjs/sheets-conditional-formatting";
4
- import { ComponentManager, IMenuManagerService, ISidebarService, IconManager, MenuItemType, RibbonDataGroup, RibbonInsertGroup, getMenuHiddenObservable, useDependency, useObservable, useSidebarClick } from "@univerjs/ui";
5
- import { COPY_TYPE, FormatPainterStatus, IFormatPainterService, ISheetClipboardService, PREDEFINED_HOOK_NAME_PASTE, SheetSkeletonManagerService, getCurrentRangeDisable$, getRepeatRange, useHighlightRange, virtualizeDiscreteRanges } from "@univerjs/sheets-ui";
4
+ import { ComponentManager, IMenuManagerService, ISidebarService, IconManager, MenuItemType, RibbonDataGroup, RibbonInsertGroup, UniverUIPlugin, getMenuHiddenObservable, useDependency, useObservable, useSidebarClick } from "@univerjs/ui";
5
+ import { COPY_TYPE, FormatPainterStatus, IFormatPainterService, ISheetClipboardService, PREDEFINED_HOOK_NAME_PASTE, SheetSkeletonManagerService, UniverSheetsMobileUIPlugin, UniverSheetsUIPlugin, getCurrentRangeDisable$, getRepeatRange, useHighlightRange, virtualizeDiscreteRanges } from "@univerjs/sheets-ui";
6
6
  import { Observable, debounceTime, filter, map, merge as merge$1, share, startWith } from "rxjs";
7
7
  import { bufferTime, debounceTime as debounceTime$1, filter as filter$1 } from "rxjs/operators";
8
+ import { IRenderManagerService, UniverRenderEnginePlugin } from "@univerjs/engine-render";
8
9
  import { FormulaRefRangeService, UniverSheetsFormulaPlugin } from "@univerjs/sheets-formula";
9
- import { IRenderManagerService } from "@univerjs/engine-render";
10
10
  import { BoldIcon, ConditionsDoubleIcon, DataBarIcon, DeleteIcon, FontColorDoubleIcon, GripVerticalIcon, IncreaseIcon, ItalicIcon, MoreDownIcon, PaintBucketDoubleIcon, RatingIcon, SlashDoubleIcon, StrikethroughIcon, UnderlineIcon } from "@univerjs/icons";
11
11
  import { useEffect, useMemo, useRef, useState } from "react";
12
12
  import { Button, Checkbox, ColorPicker, DraggableList, Dropdown, Input, InputNumber, Radio, RadioGroup, Select, Tooltip, borderClassName, clsx } from "@univerjs/design";
@@ -365,7 +365,7 @@ const AddUniqueValuesCfCommand = {
365
365
  };
366
366
 
367
367
  //#endregion
368
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/typeof.js
368
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/typeof.js
369
369
  function _typeof(o) {
370
370
  "@babel/helpers - typeof";
371
371
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
@@ -376,7 +376,7 @@ function _typeof(o) {
376
376
  }
377
377
 
378
378
  //#endregion
379
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPrimitive.js
379
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPrimitive.js
380
380
  function toPrimitive(t, r) {
381
381
  if ("object" != _typeof(t) || !t) return t;
382
382
  var e = t[Symbol.toPrimitive];
@@ -389,14 +389,14 @@ function toPrimitive(t, r) {
389
389
  }
390
390
 
391
391
  //#endregion
392
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/toPropertyKey.js
392
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/toPropertyKey.js
393
393
  function toPropertyKey(t) {
394
394
  var i = toPrimitive(t, "string");
395
395
  return "symbol" == _typeof(i) ? i : i + "";
396
396
  }
397
397
 
398
398
  //#endregion
399
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/defineProperty.js
399
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/defineProperty.js
400
400
  function _defineProperty(e, r, t) {
401
401
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
402
402
  value: t,
@@ -407,7 +407,7 @@ function _defineProperty(e, r, t) {
407
407
  }
408
408
 
409
409
  //#endregion
410
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorateParam.js
410
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorateParam.js
411
411
  function __decorateParam(paramIndex, decorator) {
412
412
  return function(target, key) {
413
413
  decorator(target, key, paramIndex);
@@ -415,7 +415,7 @@ function __decorateParam(paramIndex, decorator) {
415
415
  }
416
416
 
417
417
  //#endregion
418
- //#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
418
+ //#region \0@oxc-project+runtime@0.140.0/helpers/esm/decorate.js
419
419
  function __decorate(decorators, target, key, desc) {
420
420
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
421
421
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@@ -986,7 +986,7 @@ const menuSchema = {
986
986
  //#endregion
987
987
  //#region package.json
988
988
  var name = "@univerjs/sheets-conditional-formatting-ui";
989
- var version = "1.0.0-alpha.7";
989
+ var version = "1.0.0-alpha.8";
990
990
 
991
991
  //#endregion
992
992
  //#region src/config/config.ts
@@ -1543,7 +1543,7 @@ let SheetsCfRenderController = class SheetsCfRenderController extends Disposable
1543
1543
  if (!workbook || !worksheet) return;
1544
1544
  const unitId = workbook.getUnitId();
1545
1545
  const subUnitId = worksheet.getSheetId();
1546
- const render = this._renderManagerService.getRenderById(unitId);
1546
+ const render = this._renderManagerService.getRenderUnitById(unitId);
1547
1547
  const skeletonManagerService = render === null || render === void 0 ? void 0 : render.with(SheetSkeletonManagerService);
1548
1548
  const currentSkeleton = skeletonManagerService === null || skeletonManagerService === void 0 ? void 0 : skeletonManagerService.getCurrentSkeleton();
1549
1549
  const dirtyRanges = this._intersectDirtyRangesWithRenderedRange(this._collectDirtyRanges(items, unitId, subUnitId), currentSkeleton === null || currentSkeleton === void 0 ? void 0 : currentSkeleton.rowColumnSegment);
@@ -1657,7 +1657,7 @@ _defineProperty(UniverSheetsConditionalFormattingMobileUIPlugin, "packageName",
1657
1657
  _defineProperty(UniverSheetsConditionalFormattingMobileUIPlugin, "version", version);
1658
1658
  _defineProperty(UniverSheetsConditionalFormattingMobileUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
1659
1659
  UniverSheetsConditionalFormattingMobileUIPlugin = __decorate([
1660
- DependentOn(UniverSheetsConditionalFormattingPlugin),
1660
+ DependentOn(UniverRenderEnginePlugin, UniverSheetsPlugin, UniverSheetsFormulaPlugin, UniverSheetsConditionalFormattingPlugin, UniverSheetsMobileUIPlugin),
1661
1661
  __decorateParam(1, Inject(Injector)),
1662
1662
  __decorateParam(2, Inject(ICommandService)),
1663
1663
  __decorateParam(3, IConfigService)
@@ -2209,7 +2209,7 @@ let ConditionalFormattingViewportController = class ConditionalFormattingViewpor
2209
2209
  this._unitDisposable.dispose();
2210
2210
  this._unitDisposable = new DisposableCollection();
2211
2211
  const unitId = unit.getUnitId();
2212
- const render = this._renderManagerService.getRenderById(unitId);
2212
+ const render = this._renderManagerService.getRenderUnitById(unitId);
2213
2213
  if (!render) return;
2214
2214
  const sheetSkeletonManagerService = render.with(SheetSkeletonManagerService);
2215
2215
  this._unitDisposable.add(sheetSkeletonManagerService.currentSkeleton$.subscribe((s) => {
@@ -2248,10 +2248,11 @@ const ColorPicker$1 = (props) => {
2248
2248
  const { color, onChange, disable = false, Icon = PaintBucketDoubleIcon, className } = props;
2249
2249
  const colorKit = useMemo(() => new ColorKit(color), [color]);
2250
2250
  const renderIcon = () => {
2251
- return /* @__PURE__ */ jsx(Icon, {
2251
+ const iconProps = {
2252
2252
  className: clsx("univer-fill-primary-600", disable && className),
2253
2253
  extend: { colorChannel1: colorKit.isValid ? color : "" }
2254
- });
2254
+ };
2255
+ return /* @__PURE__ */ jsx(Icon, { ...iconProps });
2255
2256
  };
2256
2257
  return !disable ? /* @__PURE__ */ jsx(Dropdown, {
2257
2258
  overlay: /* @__PURE__ */ jsx("div", {
@@ -2410,7 +2411,7 @@ const TextInput$1 = (props) => {
2410
2411
  const [isFocusFormulaEditor, setIsFocusFormulaEditor] = useState(false);
2411
2412
  useSidebarClick((e) => {
2412
2413
  var _formulaEditorRef$cur;
2413
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2414
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2414
2415
  });
2415
2416
  if (type === CFValueType.formula) return /* @__PURE__ */ jsx("div", {
2416
2417
  className: "univer-ml-1 univer-w-full",
@@ -2818,7 +2819,7 @@ const InputText = (props) => {
2818
2819
  const [isFocusFormulaEditor, setIsFocusFormulaEditor] = useState(false);
2819
2820
  useSidebarClick((e) => {
2820
2821
  var _formulaEditorRef$cur;
2821
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2822
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
2822
2823
  });
2823
2824
  const _value = useRef(value);
2824
2825
  const config = useMemo(() => {
@@ -3344,7 +3345,7 @@ const FormulaStyleEditor = (props) => {
3344
3345
  };
3345
3346
  useSidebarClick((e) => {
3346
3347
  var _formulaEditorRef$cur;
3347
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3348
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3348
3349
  });
3349
3350
  return /* @__PURE__ */ jsxs("div", {
3350
3351
  ref: divEleRef,
@@ -3820,7 +3821,7 @@ const TextInput = (props) => {
3820
3821
  const [isFocusFormulaEditor, setIsFocusFormulaEditor] = useState(false);
3821
3822
  useSidebarClick((e) => {
3822
3823
  var _formulaEditorRef$cur;
3823
- !((_formulaEditorRef$cur = formulaEditorRef.current) === null || _formulaEditorRef$cur === void 0) && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3824
+ (_formulaEditorRef$cur = formulaEditorRef.current) !== null && _formulaEditorRef$cur !== void 0 && _formulaEditorRef$cur.isClickOutSide(e) && setIsFocusFormulaEditor(false);
3824
3825
  });
3825
3826
  return /* @__PURE__ */ jsx("div", {
3826
3827
  className: "univer-relative",
@@ -3980,7 +3981,8 @@ const IconSetRuleEdit = (props) => {
3980
3981
  };
3981
3982
  const handleOperatorChange = (operator, index) => {
3982
3983
  onChange([String(index), "operator"], operator);
3983
- handleValueValueChange(createDefaultValue(CFSubRuleType.number, operator), index);
3984
+ const defaultValue = createDefaultValue(CFSubRuleType.number, operator);
3985
+ handleValueValueChange(defaultValue, index);
3984
3986
  };
3985
3987
  const handleValueTypeChange = (v, index) => {
3986
3988
  onChange([
@@ -3989,7 +3991,8 @@ const IconSetRuleEdit = (props) => {
3989
3991
  "type"
3990
3992
  ], v);
3991
3993
  const item = configList[index];
3992
- handleValueValueChange(createDefaultValue(CFSubRuleType.number, item.operator), index);
3994
+ const defaultValue = createDefaultValue(CFSubRuleType.number, item.operator);
3995
+ handleValueValueChange(defaultValue, index);
3993
3996
  };
3994
3997
  return useMemo(() => {
3995
3998
  return configList.map((item, index) => {
@@ -4228,7 +4231,8 @@ const IconSet = (props) => {
4228
4231
  const reverseIcon = () => {
4229
4232
  const iconList = configList.map((item) => ({ ...item }));
4230
4233
  configList.forEach((item, index) => {
4231
- const newIcon = iconList[configList.length - 1 - index];
4234
+ const mirrorIndex = configList.length - 1 - index;
4235
+ const newIcon = iconList[mirrorIndex];
4232
4236
  item.iconId = newIcon.iconId;
4233
4237
  item.iconType = newIcon.iconType;
4234
4238
  });
@@ -4604,7 +4608,8 @@ const RuleEdit = (props) => {
4604
4608
  const onRangeSelectorChange = (rangeString) => {
4605
4609
  if (!rangeSelectorTouched.current && rangeString.length < 1 && rangeResult.current.length > 0) return;
4606
4610
  rangeSelectorTouched.current = true;
4607
- rangeResult.current = rangeString.split(",").filter((e) => !!e).map(deserializeRangeWithSheet).map((item) => item.range);
4611
+ const result = rangeString.split(",").filter((e) => !!e).map(deserializeRangeWithSheet).map((item) => item.range);
4612
+ rangeResult.current = result;
4608
4613
  };
4609
4614
  const handleSubmit = () => {
4610
4615
  const getRanges = () => {
@@ -5128,7 +5133,7 @@ _defineProperty(UniverSheetsConditionalFormattingUIPlugin, "packageName", name);
5128
5133
  _defineProperty(UniverSheetsConditionalFormattingUIPlugin, "version", version);
5129
5134
  _defineProperty(UniverSheetsConditionalFormattingUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
5130
5135
  UniverSheetsConditionalFormattingUIPlugin = __decorate([
5131
- DependentOn(UniverSheetsConditionalFormattingPlugin, UniverSheetsFormulaPlugin),
5136
+ DependentOn(UniverRenderEnginePlugin, UniverSheetsPlugin, UniverUIPlugin, UniverSheetsFormulaPlugin, UniverSheetsConditionalFormattingPlugin, UniverSheetsUIPlugin),
5132
5137
  __decorateParam(1, Inject(Injector)),
5133
5138
  __decorateParam(2, Inject(ICommandService)),
5134
5139
  __decorateParam(3, IConfigService)
@@ -87,9 +87,9 @@ const locale = { "sheets-conditional-formatting-ui": {
87
87
  lastWeek: "Semana pasada",
88
88
  nextWeek: "Semana siguiente",
89
89
  today: "Hoy",
90
- topN: "Top {0}",
90
+ topN: "Principales {0}",
91
91
  bottomN: "Inferior {0}",
92
- topNPercent: "Top {0}%",
92
+ topNPercent: "Principales {0}%",
93
93
  bottomNPercent: "Inferior {0}%"
94
94
  } },
95
95
  operator: {
@@ -150,7 +150,7 @@ const locale = { "sheets-conditional-formatting-ui": {
150
150
  errorMessage: {
151
151
  notBlank: "شرط نمی‌تواند خالی باشد",
152
152
  formulaError: "فرمول اشتباه",
153
- rangeError: "Bad selection"
153
+ rangeError: "انتخاب نامعتبر"
154
154
  },
155
155
  permission: { dialog: { setStyleErr: "محدوده محافظت شده است و شما مجوز تنظیم سبک‌ها را ندارید. برای تنظیم سبک‌ها، لطفا با سازنده تماس بگیرید." } }
156
156
  } };
@@ -87,9 +87,9 @@ const locale = { "sheets-conditional-formatting-ui": {
87
87
  lastWeek: "Poprzedni tydzień",
88
88
  nextWeek: "Następny tydzień",
89
89
  today: "Dzisiaj",
90
- topN: "Top {0}",
90
+ topN: "Górne {0}",
91
91
  bottomN: "Ostatnie {0}",
92
- topNPercent: "Top {0}%",
92
+ topNPercent: "Górne {0}%",
93
93
  bottomNPercent: "Ostatnie {0}%"
94
94
  } },
95
95
  operator: {
@@ -87,9 +87,9 @@ const locale = { "sheets-conditional-formatting-ui": {
87
87
  lastWeek: "Tuần trước",
88
88
  nextWeek: "Tuần sau",
89
89
  today: "Hôm nay",
90
- topN: "Top {0}",
90
+ topN: "Trên cùng {0}",
91
91
  bottomN: "Cuối {0}",
92
- topNPercent: "Top {0}%",
92
+ topNPercent: "Trên cùng {0}%",
93
93
  bottomNPercent: "Cuối {0}%"
94
94
  } },
95
95
  operator: {
@@ -150,7 +150,7 @@ const locale = { "sheets-conditional-formatting-ui": {
150
150
  errorMessage: {
151
151
  notBlank: "Điều kiện không được để trống",
152
152
  formulaError: "Lỗi công thức",
153
- rangeError: "Bad selection"
153
+ rangeError: "Lựa chọn không hợp lệ"
154
154
  },
155
155
  permission: { dialog: { setStyleErr: "Phạm vi này đã được bảo vệ, hiện không có quyền thiết lập kiểu. Nếu cần thiết lập kiểu, vui lòng liên hệ với người tạo." } }
156
156
  } };