@univerjs/sheets-conditional-formatting-ui 0.2.11 → 0.2.12
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 +3 -3
- package/lib/es/index.js +414 -355
- package/lib/types/controllers/cf.menu.controller.d.ts +4 -17
- package/lib/types/controllers/cf.panel.controller.d.ts +14 -0
- package/lib/types/controllers/cf.render.controller.d.ts +9 -0
- package/lib/types/controllers/config.schema.d.ts +7 -0
- package/lib/types/controllers/menu.schema.d.ts +2 -0
- package/lib/types/mobile-plugin.d.ts +4 -3
- package/lib/types/plugin.d.ts +4 -3
- package/lib/umd/index.js +2 -2
- package/package.json +18 -18
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,
|
|
6
|
-
import { ConditionalFormattingRuleModel, CFRuleType, CFSubRuleType, AddConditionalRuleMutation, CFNumberOperator, setConditionalRuleMutationUndoFactory, SetConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, DeleteConditionalRuleMutation,
|
|
7
|
-
import { getSheetCommandTarget, SheetsSelectionsService, findAllRectangle, createTopMatrixFromMatrix, SetWorksheetActiveOperation,
|
|
8
|
-
import {
|
|
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, getCurrentRangeDisable$, IEditorBridgeService } 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
|
|
239
|
+
var _a14;
|
|
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 = ((
|
|
244
|
+
const { unitId, subUnitId } = target, ranges = ((_a14 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a14.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
|
-
}
|
|
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(
|
|
490
|
-
var key =
|
|
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(_a14) {
|
|
390
|
+
var key = _a14[0], value = _a14[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
|
|
497
|
-
return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((
|
|
396
|
+
var _a14, defIds = runtimeProps.defIds;
|
|
397
|
+
return !defIds || defIds.length === 0 ? node : node.tag === "defs" && (!((_a14 = node.children) === null || _a14 === void 0) && _a14.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(
|
|
594
|
-
var areArraysEqual2 =
|
|
493
|
+
function createComparator(_a14) {
|
|
494
|
+
var areArraysEqual2 = _a14.areArraysEqual, areDatesEqual2 = _a14.areDatesEqual, areMapsEqual2 = _a14.areMapsEqual, areObjectsEqual2 = _a14.areObjectsEqual, areRegExpsEqual2 = _a14.areRegExpsEqual, areSetsEqual2 = _a14.areSetsEqual, createIsNestedEqual = _a14.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
|
|
3481
|
+
var _a14;
|
|
3582
3482
|
if (e.preventDefault(), e.stopPropagation(), isFirefox && // $FlowIgnore can't figure this out
|
|
3583
|
-
!((
|
|
3483
|
+
!((_a14 = e.nativeEvent.target) != null && _a14.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,
|
|
4196
|
-
var entry =
|
|
4095
|
+
for (var _i = 0, _a14 = this.__entries__; _i < _a14.length; _i++) {
|
|
4096
|
+
var entry = _a14[_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(
|
|
4264
|
-
var _b =
|
|
4163
|
+
}, ResizeObserverController2.prototype.onTransitionEnd_ = function(_a14) {
|
|
4164
|
+
var _b = _a14.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,
|
|
4274
|
-
var key =
|
|
4173
|
+
for (var _i = 0, _a14 = Object.keys(props); _i < _a14.length; _i++) {
|
|
4174
|
+
var key = _a14[_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(
|
|
4341
|
-
var x =
|
|
4240
|
+
function createReadOnlyRect(_a14) {
|
|
4241
|
+
var x = _a14.x, y = _a14.y, width2 = _a14.width, height2 = _a14.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
|
|
4448
|
-
return (
|
|
4347
|
+
var _a14;
|
|
4348
|
+
return (_a14 = observers.get(this))[method].apply(_a14, 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
|
|
4421
|
+
var _a14;
|
|
4522
4422
|
var _class;
|
|
4523
|
-
return _class = (
|
|
4423
|
+
return _class = (_a14 = 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(
|
|
4459
|
+
}, __name(_a14, "WidthProvider"), _a14), _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
|
|
4504
|
+
var _a14, _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 = (
|
|
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 = (_a14 = bg == null ? void 0 : bg.rgb) != null ? _a14 : 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$
|
|
4647
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
4546
|
+
var __defProp$b = Object.defineProperty, __getOwnPropDesc$b = Object.getOwnPropertyDescriptor, __decorateClass$b = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
4547
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$b(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$
|
|
4650
|
-
}, "__decorateClass$
|
|
4549
|
+
return kind && result && __defProp$b(target, key, result), result;
|
|
4550
|
+
}, "__decorateClass$b"), __decorateParam$b = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$b"), _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$
|
|
4588
|
+
ConditionalFormattingI18nController = __decorateClass$b([
|
|
4689
4589
|
OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingI18nController),
|
|
4690
|
-
__decorateParam$
|
|
4590
|
+
__decorateParam$b(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
|
|
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
|
|
4802
|
-
const width2 = Math.max(0, (((
|
|
4701
|
+
var _a14;
|
|
4702
|
+
const width2 = Math.max(0, (((_a14 = layoutContainerRef.current) == null ? void 0 : _a14.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
|
|
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
|
|
4828
|
-
const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (
|
|
4727
|
+
var _a14;
|
|
4728
|
+
const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.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
|
|
4735
|
+
var _a14;
|
|
4836
4736
|
draggingIdSet(-1);
|
|
4837
|
-
const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (
|
|
4737
|
+
const unitId2 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId2 = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.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
|
|
5000
|
-
const { type: type2, className, onChange, id, value } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (
|
|
4899
|
+
var _a14;
|
|
4900
|
+
const { type: type2, className, onChange, id, value } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.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
|
|
5024
|
-
const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((
|
|
5025
|
-
var
|
|
4923
|
+
var _a14;
|
|
4924
|
+
const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a14 = props.rule) == null ? void 0 : _a14.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 _a15;
|
|
5026
4926
|
const defaultV = CFValueType.min;
|
|
5027
|
-
return rule && ((
|
|
4927
|
+
return rule && ((_a15 = rule.config[0]) == null ? void 0 : _a15.value.type) || defaultV;
|
|
5028
4928
|
}), [medianType, medianTypeSet] = useState(() => {
|
|
5029
|
-
var
|
|
4929
|
+
var _a15;
|
|
5030
4930
|
const defaultV = "none";
|
|
5031
|
-
return !rule || rule.config.length !== 3 ? defaultV : ((
|
|
4931
|
+
return !rule || rule.config.length !== 3 ? defaultV : ((_a15 = rule.config[1]) == null ? void 0 : _a15.value.type) || defaultV;
|
|
5032
4932
|
}), [maxType, maxTypeSet] = useState(() => {
|
|
5033
|
-
var
|
|
4933
|
+
var _a15;
|
|
5034
4934
|
const defaultV = CFValueType.max;
|
|
5035
|
-
return rule && ((
|
|
4935
|
+
return rule && ((_a15 = rule.config[rule.config.length - 1]) == null ? void 0 : _a15.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
|
|
4942
|
+
var _a15;
|
|
5043
4943
|
if (!rule || rule.config.length !== 3)
|
|
5044
4944
|
return 50;
|
|
5045
|
-
const v = (
|
|
4945
|
+
const v = (_a15 = rule.config[1]) == null ? void 0 : _a15.value.value;
|
|
5046
4946
|
return v === void 0 ? 50 : v;
|
|
5047
4947
|
}), [maxValue, maxValueSet] = useState(() => {
|
|
5048
|
-
var
|
|
4948
|
+
var _a15;
|
|
5049
4949
|
if (!rule)
|
|
5050
4950
|
return 90;
|
|
5051
|
-
const v = (
|
|
4951
|
+
const v = (_a15 = rule.config[rule.config.length - 1]) == null ? void 0 : _a15.value.value;
|
|
5052
4952
|
return v === void 0 ? 90 : v;
|
|
5053
4953
|
}), [minColor, minColorSet] = useState(() => {
|
|
5054
|
-
var
|
|
4954
|
+
var _a15;
|
|
5055
4955
|
const defaultV = "#d0d9fb";
|
|
5056
|
-
return rule && ((
|
|
4956
|
+
return rule && ((_a15 = rule.config[0]) == null ? void 0 : _a15.color) || defaultV;
|
|
5057
4957
|
}), [medianColor, medianColorSet] = useState(() => {
|
|
5058
|
-
var
|
|
4958
|
+
var _a15;
|
|
5059
4959
|
const defaultV = "#7790f3";
|
|
5060
|
-
return !rule || rule.config.length !== 3 ? defaultV : ((
|
|
4960
|
+
return !rule || rule.config.length !== 3 ? defaultV : ((_a15 = rule.config[1]) == null ? void 0 : _a15.color) || defaultV;
|
|
5061
4961
|
}), [maxColor, maxColorSet] = useState(() => {
|
|
5062
|
-
var
|
|
4962
|
+
var _a15;
|
|
5063
4963
|
const defaultV = "#2e55ef";
|
|
5064
|
-
return rule && ((
|
|
4964
|
+
return rule && ((_a15 = rule.config[rule.config.length - 1]) == null ? void 0 : _a15.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
|
|
5204
|
-
const { onChange, className, value, type: type2, id, disabled: disabled2 = !1 } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (
|
|
5103
|
+
var _a14;
|
|
5104
|
+
const { onChange, className, value, type: type2, id, disabled: disabled2 = !1 } = props, univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.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
|
|
5243
|
-
const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((
|
|
5244
|
-
var
|
|
5142
|
+
var _a14;
|
|
5143
|
+
const { interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a14 = props.rule) == null ? void 0 : _a14.type) === CFRuleType.dataBar ? props.rule : void 0, [isGradient, isGradientSet] = useState(() => {
|
|
5144
|
+
var _a15;
|
|
5245
5145
|
const defaultV = "0";
|
|
5246
|
-
return rule ? (
|
|
5146
|
+
return rule ? (_a15 = rule.config) != null && _a15.isGradient ? "1" : "0" : defaultV;
|
|
5247
5147
|
}), [positiveColor, positiveColorSet] = useState(() => {
|
|
5248
|
-
var
|
|
5249
|
-
return rule ? ((
|
|
5148
|
+
var _a15;
|
|
5149
|
+
return rule ? ((_a15 = rule.config) == null ? void 0 : _a15.positiveColor) || defaultDataBarPositiveColor : defaultDataBarPositiveColor;
|
|
5250
5150
|
}), [nativeColor, nativeColorSet] = useState(() => {
|
|
5251
|
-
var
|
|
5252
|
-
return rule ? ((
|
|
5151
|
+
var _a15;
|
|
5152
|
+
return rule ? ((_a15 = rule.config) == null ? void 0 : _a15.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
|
|
5154
|
+
var _a15;
|
|
5255
5155
|
const defaultV = minOptions[0].value;
|
|
5256
|
-
return rule && ((
|
|
5156
|
+
return rule && ((_a15 = rule.config) == null ? void 0 : _a15.min.type) || defaultV;
|
|
5257
5157
|
}), [maxValueType, maxValueTypeSet] = useState(() => {
|
|
5258
|
-
var
|
|
5158
|
+
var _a15;
|
|
5259
5159
|
const defaultV = maxOptions[0].value;
|
|
5260
|
-
return rule && ((
|
|
5160
|
+
return rule && ((_a15 = rule.config) == null ? void 0 : _a15.max.type) || defaultV;
|
|
5261
5161
|
}), [minValue, minValueSet] = useState(() => {
|
|
5262
|
-
var
|
|
5162
|
+
var _a15;
|
|
5263
5163
|
if (!rule)
|
|
5264
5164
|
return 0;
|
|
5265
|
-
const value = ((
|
|
5165
|
+
const value = ((_a15 = rule.config) == null ? void 0 : _a15.min) || {};
|
|
5266
5166
|
return value.type === CFValueType.formula ? value.value || "=" : value.value || 0;
|
|
5267
5167
|
}), [maxValue, maxValueSet] = useState(() => {
|
|
5268
|
-
var
|
|
5168
|
+
var _a15;
|
|
5269
5169
|
if (!rule)
|
|
5270
5170
|
return 100;
|
|
5271
|
-
const value = ((
|
|
5171
|
+
const value = ((_a15 = rule.config) == null ? void 0 : _a15.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
|
|
5327
|
+
var _a14;
|
|
5428
5328
|
const defaultV = "#2f56ef";
|
|
5429
|
-
return (
|
|
5329
|
+
return (_a14 = style == null ? void 0 : style.cl) != null && _a14.rgb ? style.cl.rgb : defaultV;
|
|
5430
5330
|
}), [bgColor, bgColorSet] = useState(() => {
|
|
5431
|
-
var
|
|
5331
|
+
var _a14;
|
|
5432
5332
|
const defaultV = "#e8ecfc";
|
|
5433
|
-
return (
|
|
5333
|
+
return (_a14 = style == null ? void 0 : style.bg) != null && _a14.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
|
|
5451
|
-
const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((
|
|
5350
|
+
var _a14;
|
|
5351
|
+
const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), rule = ((_a14 = props.rule) == null ? void 0 : _a14.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
|
|
5723
|
-
const { interceptorManager, onChange } = props, localeService = useDependency(LocaleService), rule = ((
|
|
5622
|
+
var _a14;
|
|
5623
|
+
const { interceptorManager, onChange } = props, localeService = useDependency(LocaleService), rule = ((_a14 = props.rule) == null ? void 0 : _a14.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
|
|
5651
|
+
var _a15;
|
|
5752
5652
|
const defaultV = "";
|
|
5753
|
-
return rule ? (
|
|
5653
|
+
return rule ? (_a15 = rule.value) != null ? _a15 : createDefaultValue(rule.subType, rule.operator) : defaultV;
|
|
5754
5654
|
}), [style, styleSet] = useState({}), getResult = useMemo(() => (option) => {
|
|
5755
|
-
var
|
|
5655
|
+
var _a15, _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: (
|
|
5668
|
+
subType: (_a15 = option.subType) != null ? _a15 : 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
|
|
5844
|
-
const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), workbook = useDependency(IUniverInstanceService).getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet(), rule = ((
|
|
5743
|
+
var _a14;
|
|
5744
|
+
const { onChange, interceptorManager } = props, localeService = useDependency(LocaleService), workbook = useDependency(IUniverInstanceService).getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet(), rule = ((_a14 = props.rule) == null ? void 0 : _a14.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
|
|
6453
|
-
const univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (
|
|
6352
|
+
var _a14;
|
|
6353
|
+
const univerInstanceService = useDependency(IUniverInstanceService), unitId = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.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
|
|
6587
|
-
const { interceptorManager } = props, rule = ((
|
|
6486
|
+
var _a14;
|
|
6487
|
+
const { interceptorManager } = props, rule = ((_a14 = props.rule) == null ? void 0 : _a14.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
|
|
6679
|
-
return (
|
|
6578
|
+
var _a14;
|
|
6579
|
+
return (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.getSheetId();
|
|
6680
6580
|
}, "getSubUnitId"), RuleEdit = /* @__PURE__ */ __name((props) => {
|
|
6681
|
-
var
|
|
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 = (
|
|
6683
|
-
var
|
|
6684
|
-
let ranges = (
|
|
6581
|
+
var _a14, _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 = (_a14 = props.rule) == null ? void 0 : _a14.ranges) != null ? _b : []), rangeString = useMemo(() => {
|
|
6583
|
+
var _a15, _b2, _c2;
|
|
6584
|
+
let ranges = (_a15 = props.rule) == null ? void 0 : _a15.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
|
|
6698
|
-
const type2 = (
|
|
6597
|
+
var _a15, _b2;
|
|
6598
|
+
const type2 = (_a15 = props.rule) == null ? void 0 : _a15.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$
|
|
6811
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6710
|
+
var __defProp$a = Object.defineProperty, __getOwnPropDesc$a = Object.getOwnPropertyDescriptor, __decorateClass$a = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
6711
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$a(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$
|
|
6814
|
-
}, "__decorateClass$
|
|
6815
|
-
const
|
|
6713
|
+
return kind && result && __defProp$a(target, key, result), result;
|
|
6714
|
+
}, "__decorateClass$a"), __decorateParam$a = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$a");
|
|
6715
|
+
const CF_PANEL_KEY = "sheet.conditional.formatting.panel";
|
|
6816
6716
|
var _a3;
|
|
6817
|
-
let
|
|
6818
|
-
constructor(
|
|
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.
|
|
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
|
|
6824
|
-
sheet || (
|
|
6723
|
+
var _a14;
|
|
6724
|
+
sheet || (_a14 = this._sidebarDisposable) == null || _a14.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:
|
|
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, "
|
|
6848
|
-
|
|
6849
|
-
OnLifecycle(LifecycleStages.Ready,
|
|
6850
|
-
__decorateParam$
|
|
6851
|
-
__decorateParam$
|
|
6852
|
-
__decorateParam$
|
|
6853
|
-
__decorateParam$
|
|
6854
|
-
__decorateParam$
|
|
6855
|
-
|
|
6856
|
-
], ConditionalFormattingMenuController);
|
|
6743
|
+
}, __name(_a3, "ConditionalFormattingPanelController"), _a3);
|
|
6744
|
+
ConditionalFormattingPanelController = __decorateClass$a([
|
|
6745
|
+
OnLifecycle(LifecycleStages.Ready, ConditionalFormattingPanelController),
|
|
6746
|
+
__decorateParam$a(0, IUniverInstanceService),
|
|
6747
|
+
__decorateParam$a(1, Inject(Injector)),
|
|
6748
|
+
__decorateParam$a(2, Inject(ComponentManager)),
|
|
6749
|
+
__decorateParam$a(3, Inject(ISidebarService)),
|
|
6750
|
+
__decorateParam$a(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
|
|
6863
|
-
const conditionalFormattingMenuController = accessor.get(
|
|
6757
|
+
var _a14;
|
|
6758
|
+
const conditionalFormattingMenuController = accessor.get(ConditionalFormattingPanelController), selectionManagerService = accessor.get(SheetsSelectionsService), commandService = accessor.get(ICommandService), ranges = ((_a14 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a14.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$
|
|
6952
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6846
|
+
var __defProp$9 = Object.defineProperty, __getOwnPropDesc$9 = Object.getOwnPropertyDescriptor, __decorateClass$9 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
6847
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$9(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$
|
|
6955
|
-
}, "__decorateClass$
|
|
6849
|
+
return kind && result && __defProp$9(target, key, result), result;
|
|
6850
|
+
}, "__decorateClass$9"), __decorateParam$9 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$9"), _a4;
|
|
6956
6851
|
let SheetsCfRenderController = (_a4 = class extends Disposable {
|
|
6957
6852
|
constructor(_sheetInterceptorService, _conditionalFormattingService, _univerInstanceService, _renderManagerService, _conditionalFormattingViewModel, _conditionalFormattingRuleModel) {
|
|
6958
|
-
super()
|
|
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 _a14, _b, _c;
|
|
6865
|
+
const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId();
|
|
6866
|
+
(_a14 = this._renderManagerService.getRenderById(unitId)) == null || _a14.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
|
-
|
|
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
|
-
|
|
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$
|
|
6983
|
+
SheetsCfRenderController = __decorateClass$9([
|
|
7056
6984
|
OnLifecycle(LifecycleStages.Starting, SheetsCfRenderController),
|
|
7057
|
-
__decorateParam$
|
|
7058
|
-
__decorateParam$
|
|
7059
|
-
__decorateParam$
|
|
7060
|
-
__decorateParam$
|
|
7061
|
-
__decorateParam$
|
|
7062
|
-
__decorateParam$
|
|
6985
|
+
__decorateParam$9(0, Inject(SheetInterceptorService)),
|
|
6986
|
+
__decorateParam$9(1, Inject(ConditionalFormattingService)),
|
|
6987
|
+
__decorateParam$9(2, Inject(IUniverInstanceService)),
|
|
6988
|
+
__decorateParam$9(3, Inject(IRenderManagerService)),
|
|
6989
|
+
__decorateParam$9(4, Inject(ConditionalFormattingViewModel)),
|
|
6990
|
+
__decorateParam$9(5, Inject(ConditionalFormattingRuleModel))
|
|
7063
6991
|
], SheetsCfRenderController);
|
|
7064
|
-
var __defProp$
|
|
7065
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
6992
|
+
var __defProp$8 = Object.defineProperty, __getOwnPropDesc$8 = Object.getOwnPropertyDescriptor, __decorateClass$8 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
6993
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$8(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$
|
|
7068
|
-
}, "__decorateClass$
|
|
6995
|
+
return kind && result && __defProp$8(target, key, result), result;
|
|
6996
|
+
}, "__decorateClass$8"), __decorateParam$8 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$8"), _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$
|
|
7150
|
+
ConditionalFormattingCopyPasteController = __decorateClass$8([
|
|
7223
7151
|
OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingCopyPasteController),
|
|
7224
|
-
__decorateParam$
|
|
7225
|
-
__decorateParam$
|
|
7226
|
-
__decorateParam$
|
|
7227
|
-
__decorateParam$
|
|
7228
|
-
__decorateParam$
|
|
7152
|
+
__decorateParam$8(0, Inject(ISheetClipboardService)),
|
|
7153
|
+
__decorateParam$8(1, Inject(ConditionalFormattingRuleModel)),
|
|
7154
|
+
__decorateParam$8(2, Inject(Injector)),
|
|
7155
|
+
__decorateParam$8(3, Inject(ConditionalFormattingViewModel)),
|
|
7156
|
+
__decorateParam$8(4, Inject(IUniverInstanceService))
|
|
7229
7157
|
], ConditionalFormattingCopyPasteController);
|
|
7230
|
-
var __defProp$
|
|
7231
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7158
|
+
var __defProp$7 = Object.defineProperty, __getOwnPropDesc$7 = Object.getOwnPropertyDescriptor, __decorateClass$7 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7159
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$7(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$
|
|
7234
|
-
}, "__decorateClass$
|
|
7161
|
+
return kind && result && __defProp$7(target, key, result), result;
|
|
7162
|
+
}, "__decorateClass$7"), __decorateParam$7 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$7"), _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$
|
|
7211
|
+
SheetsCfRefRangeController = __decorateClass$7([
|
|
7284
7212
|
OnLifecycle(LifecycleStages.Rendered, SheetsCfRefRangeController),
|
|
7285
|
-
__decorateParam$
|
|
7286
|
-
__decorateParam$
|
|
7287
|
-
__decorateParam$
|
|
7288
|
-
__decorateParam$
|
|
7213
|
+
__decorateParam$7(0, Inject(ConditionalFormattingRuleModel)),
|
|
7214
|
+
__decorateParam$7(1, Inject(IUniverInstanceService)),
|
|
7215
|
+
__decorateParam$7(2, Inject(Injector)),
|
|
7216
|
+
__decorateParam$7(3, Inject(RefRangeService))
|
|
7289
7217
|
], SheetsCfRefRangeController);
|
|
7290
|
-
var __defProp$
|
|
7291
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7218
|
+
var __defProp$6 = Object.defineProperty, __getOwnPropDesc$6 = Object.getOwnPropertyDescriptor, __decorateClass$6 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7219
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$6(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$
|
|
7294
|
-
}, "__decorateClass$
|
|
7221
|
+
return kind && result && __defProp$6(target, key, result), result;
|
|
7222
|
+
}, "__decorateClass$6"), __decorateParam$6 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$6"), _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$
|
|
7239
|
+
ConditionalFormattingPermissionController = __decorateClass$6([
|
|
7312
7240
|
OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingPermissionController),
|
|
7313
|
-
__decorateParam$
|
|
7314
|
-
__decorateParam$
|
|
7315
|
-
__decorateParam$
|
|
7241
|
+
__decorateParam$6(0, Inject(LocaleService)),
|
|
7242
|
+
__decorateParam$6(1, ICommandService),
|
|
7243
|
+
__decorateParam$6(2, Inject(SheetPermissionInterceptorBaseController))
|
|
7316
7244
|
], ConditionalFormattingPermissionController);
|
|
7317
|
-
|
|
7318
|
-
|
|
7245
|
+
const PLUGIN_CONFIG_KEY = "sheets-conditional-formatting-ui.config", defaultPluginConfig = {};
|
|
7246
|
+
var __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __defNormalProp$1 = /* @__PURE__ */ __name((obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value, "__defNormalProp$1"), __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7247
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(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$
|
|
7321
|
-
}, "__decorateClass$
|
|
7249
|
+
return kind && result && __defProp$5(target, key, result), result;
|
|
7250
|
+
}, "__decorateClass$5"), __decorateParam$5 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$5"), __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 =
|
|
7324
|
-
super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this.
|
|
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$
|
|
7282
|
+
UniverSheetsConditionalFormattingMobileUIPlugin = __decorateClass$5([
|
|
7352
7283
|
DependentOn(UniverSheetsConditionalFormattingPlugin),
|
|
7353
|
-
__decorateParam$
|
|
7354
|
-
__decorateParam$
|
|
7284
|
+
__decorateParam$5(1, Inject(Injector)),
|
|
7285
|
+
__decorateParam$5(2, Inject(ICommandService)),
|
|
7286
|
+
__decorateParam$5(3, IConfigService)
|
|
7355
7287
|
], UniverSheetsConditionalFormattingMobileUIPlugin);
|
|
7356
|
-
var __defProp$
|
|
7357
|
-
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$
|
|
7288
|
+
var __defProp$4 = Object.defineProperty, __getOwnPropDesc$4 = Object.getOwnPropertyDescriptor, __decorateClass$4 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7289
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$4(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$
|
|
7360
|
-
}, "__decorateClass$
|
|
7291
|
+
return kind && result && __defProp$4(target, key, result), result;
|
|
7292
|
+
}, "__decorateClass$4"), __decorateParam$4 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$4"), _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
|
|
7369
|
-
const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (
|
|
7300
|
+
var _a14;
|
|
7301
|
+
const unitId = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getUnitId(), subUnitId = (_a14 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET).getActiveSheet()) == null ? void 0 : _a14.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
|
|
7441
|
-
const unitId = (
|
|
7372
|
+
var _a14, _b, _c;
|
|
7373
|
+
const unitId = (_a14 = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a14.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,20 +7416,149 @@ 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$
|
|
7419
|
+
ConditionalFormattingAutoFillController = __decorateClass$4([
|
|
7488
7420
|
OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingAutoFillController),
|
|
7489
|
-
__decorateParam$
|
|
7490
|
-
__decorateParam$
|
|
7491
|
-
__decorateParam$
|
|
7492
|
-
__decorateParam$
|
|
7493
|
-
__decorateParam$
|
|
7421
|
+
__decorateParam$4(0, Inject(Injector)),
|
|
7422
|
+
__decorateParam$4(1, Inject(IUniverInstanceService)),
|
|
7423
|
+
__decorateParam$4(2, Inject(IAutoFillService)),
|
|
7424
|
+
__decorateParam$4(3, Inject(ConditionalFormattingRuleModel)),
|
|
7425
|
+
__decorateParam$4(4, Inject(ConditionalFormattingViewModel))
|
|
7494
7426
|
], ConditionalFormattingAutoFillController);
|
|
7427
|
+
const commandList = [
|
|
7428
|
+
SetWorksheetActiveOperation.id,
|
|
7429
|
+
AddConditionalRuleMutation.id,
|
|
7430
|
+
SetConditionalRuleMutation.id,
|
|
7431
|
+
DeleteConditionalRuleMutation.id,
|
|
7432
|
+
MoveConditionalRuleMutation.id
|
|
7433
|
+
], commonSelections = [
|
|
7434
|
+
{
|
|
7435
|
+
label: "sheet.cf.ruleType.highlightCell",
|
|
7436
|
+
value: CF_MENU_OPERATION.highlightCell
|
|
7437
|
+
},
|
|
7438
|
+
{
|
|
7439
|
+
label: "sheet.cf.panel.rankAndAverage",
|
|
7440
|
+
value: CF_MENU_OPERATION.rank
|
|
7441
|
+
},
|
|
7442
|
+
{
|
|
7443
|
+
label: "sheet.cf.ruleType.formula",
|
|
7444
|
+
value: CF_MENU_OPERATION.formula
|
|
7445
|
+
},
|
|
7446
|
+
{
|
|
7447
|
+
label: "sheet.cf.ruleType.colorScale",
|
|
7448
|
+
value: CF_MENU_OPERATION.colorScale
|
|
7449
|
+
},
|
|
7450
|
+
{
|
|
7451
|
+
label: "sheet.cf.ruleType.dataBar",
|
|
7452
|
+
value: CF_MENU_OPERATION.dataBar
|
|
7453
|
+
},
|
|
7454
|
+
{
|
|
7455
|
+
label: "sheet.cf.ruleType.iconSet",
|
|
7456
|
+
value: CF_MENU_OPERATION.icon
|
|
7457
|
+
},
|
|
7458
|
+
{
|
|
7459
|
+
label: "sheet.cf.menu.manageConditionalFormatting",
|
|
7460
|
+
value: CF_MENU_OPERATION.viewRule
|
|
7461
|
+
},
|
|
7462
|
+
{
|
|
7463
|
+
label: "sheet.cf.menu.createConditionalFormatting",
|
|
7464
|
+
value: CF_MENU_OPERATION.createRule
|
|
7465
|
+
},
|
|
7466
|
+
{
|
|
7467
|
+
label: "sheet.cf.menu.clearRangeRules",
|
|
7468
|
+
value: CF_MENU_OPERATION.clearRangeRules,
|
|
7469
|
+
disabled: !1
|
|
7470
|
+
},
|
|
7471
|
+
{
|
|
7472
|
+
label: "sheet.cf.menu.clearWorkSheetRules",
|
|
7473
|
+
value: CF_MENU_OPERATION.clearWorkSheetRules
|
|
7474
|
+
}
|
|
7475
|
+
], FactoryManageConditionalFormattingRule = /* @__PURE__ */ __name((accessor) => {
|
|
7476
|
+
const selectionManagerService = accessor.get(SheetsSelectionsService), commandService = accessor.get(ICommandService), univerInstanceService = accessor.get(IUniverInstanceService), conditionalFormattingRuleModel = accessor.get(ConditionalFormattingRuleModel), clearRangeEnable$ = new Observable((subscriber) => merge(
|
|
7477
|
+
selectionManagerService.selectionMoveEnd$,
|
|
7478
|
+
new Observable((commandSubscribe) => {
|
|
7479
|
+
const disposable = commandService.onCommandExecuted((commandInfo) => {
|
|
7480
|
+
var _a14;
|
|
7481
|
+
const { id, params } = commandInfo, unitId = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a14.getUnitId();
|
|
7482
|
+
commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
|
|
7483
|
+
});
|
|
7484
|
+
return () => disposable.dispose();
|
|
7485
|
+
})
|
|
7486
|
+
).pipe(debounceTime$1(16)).subscribe(() => {
|
|
7487
|
+
var _a14;
|
|
7488
|
+
const ranges = ((_a14 = selectionManagerService.getCurrentSelections()) == null ? void 0 : _a14.map((selection) => selection.range)) || [], workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
7489
|
+
if (!workbook) return;
|
|
7490
|
+
const worksheet = workbook.getActiveSheet();
|
|
7491
|
+
if (!worksheet) return;
|
|
7492
|
+
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));
|
|
7493
|
+
subscriber.next(hasPermission);
|
|
7494
|
+
})), clearSheetEnable$ = new Observable(
|
|
7495
|
+
(subscriber) => new Observable((commandSubscribe) => {
|
|
7496
|
+
const disposable = commandService.onCommandExecuted((commandInfo) => {
|
|
7497
|
+
var _a14;
|
|
7498
|
+
const { id, params } = commandInfo, unitId = (_a14 = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET)) == null ? void 0 : _a14.getUnitId();
|
|
7499
|
+
commandList.includes(id) && params.unitId === unitId && commandSubscribe.next(null);
|
|
7500
|
+
});
|
|
7501
|
+
return () => disposable.dispose();
|
|
7502
|
+
}).pipe(debounceTime$1(16)).subscribe(() => {
|
|
7503
|
+
const workbook = univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET);
|
|
7504
|
+
if (!workbook) return;
|
|
7505
|
+
const worksheet = workbook.getActiveSheet();
|
|
7506
|
+
if (!worksheet) return;
|
|
7507
|
+
const allRule = conditionalFormattingRuleModel.getSubunitRules(workbook.getUnitId(), worksheet.getSheetId()) || [];
|
|
7508
|
+
if (!allRule.length)
|
|
7509
|
+
return subscriber.next(!1), !1;
|
|
7510
|
+
const hasPermission = allRule.map((rule) => rule.ranges).every((ranges) => checkRangesEditablePermission(accessor, workbook.getUnitId(), worksheet.getSheetId(), ranges));
|
|
7511
|
+
subscriber.next(hasPermission);
|
|
7512
|
+
})
|
|
7513
|
+
), selections$ = new Observable((subscriber) => {
|
|
7514
|
+
clearRangeEnable$.subscribe((v) => {
|
|
7515
|
+
const item2 = commonSelections.find((item22) => item22.value === CF_MENU_OPERATION.clearRangeRules);
|
|
7516
|
+
item2 && (item2.disabled = !v, subscriber.next(commonSelections));
|
|
7517
|
+
}), clearSheetEnable$.subscribe((v) => {
|
|
7518
|
+
const item2 = commonSelections.find((item22) => item22.value === CF_MENU_OPERATION.clearWorkSheetRules);
|
|
7519
|
+
item2 && (item2.disabled = !v, subscriber.next(commonSelections));
|
|
7520
|
+
}), subscriber.next(commonSelections);
|
|
7521
|
+
});
|
|
7522
|
+
return {
|
|
7523
|
+
id: OpenConditionalFormattingOperator.id,
|
|
7524
|
+
type: MenuItemType.SELECTOR,
|
|
7525
|
+
icon: "Conditions",
|
|
7526
|
+
tooltip: "sheet.cf.title",
|
|
7527
|
+
selections: selections$,
|
|
7528
|
+
hidden$: getMenuHiddenObservable(accessor, UniverInstanceType.UNIVER_SHEET),
|
|
7529
|
+
disabled$: getCurrentRangeDisable$(accessor, { workbookTypes: [WorkbookEditablePermission], worksheetTypes: [WorksheetSetCellStylePermission, WorksheetEditPermission], rangeTypes: [RangeProtectionPermissionEditPoint] })
|
|
7530
|
+
};
|
|
7531
|
+
}, "FactoryManageConditionalFormattingRule"), menuSchema = {
|
|
7532
|
+
[RibbonStartGroup.FORMULAS_INSERT]: {
|
|
7533
|
+
[OpenConditionalFormattingOperator.id]: {
|
|
7534
|
+
order: 0,
|
|
7535
|
+
menuItemFactory: FactoryManageConditionalFormattingRule
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7538
|
+
};
|
|
7539
|
+
var __defProp$3 = Object.defineProperty, __getOwnPropDesc$3 = Object.getOwnPropertyDescriptor, __decorateClass$3 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7540
|
+
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$3(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7541
|
+
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
7542
|
+
return kind && result && __defProp$3(target, key, result), result;
|
|
7543
|
+
}, "__decorateClass$3"), __decorateParam$3 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$3"), _a10;
|
|
7544
|
+
let ConditionalFormattingMenuController = (_a10 = class extends Disposable {
|
|
7545
|
+
constructor(_injector, _menuManagerService) {
|
|
7546
|
+
super();
|
|
7547
|
+
__publicField(this, "_sidebarDisposable", null);
|
|
7548
|
+
this._injector = _injector, this._menuManagerService = _menuManagerService, this._menuManagerService.mergeMenu(menuSchema);
|
|
7549
|
+
}
|
|
7550
|
+
}, __name(_a10, "ConditionalFormattingMenuController"), _a10);
|
|
7551
|
+
ConditionalFormattingMenuController = __decorateClass$3([
|
|
7552
|
+
OnLifecycle(LifecycleStages.Ready, ConditionalFormattingMenuController),
|
|
7553
|
+
__decorateParam$3(0, Inject(Injector)),
|
|
7554
|
+
__decorateParam$3(1, IMenuManagerService)
|
|
7555
|
+
], ConditionalFormattingMenuController);
|
|
7495
7556
|
var __defProp$2 = Object.defineProperty, __getOwnPropDesc$2 = Object.getOwnPropertyDescriptor, __decorateClass$2 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
7496
7557
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$2(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7497
7558
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
7498
7559
|
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"),
|
|
7500
|
-
let ConditionalFormattingEditorController = (
|
|
7560
|
+
}, "__decorateClass$2"), __decorateParam$2 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$2"), _a11;
|
|
7561
|
+
let ConditionalFormattingEditorController = (_a11 = class extends Disposable {
|
|
7501
7562
|
constructor(_editorBridgeService, _conditionalFormattingService) {
|
|
7502
7563
|
super(), this._editorBridgeService = _editorBridgeService, this._conditionalFormattingService = _conditionalFormattingService, this._initInterceptorEditorEnd();
|
|
7503
7564
|
}
|
|
@@ -7532,7 +7593,7 @@ let ConditionalFormattingEditorController = (_a10 = class extends Disposable {
|
|
|
7532
7593
|
)
|
|
7533
7594
|
);
|
|
7534
7595
|
}
|
|
7535
|
-
}, __name(
|
|
7596
|
+
}, __name(_a11, "ConditionalFormattingEditorController"), _a11);
|
|
7536
7597
|
ConditionalFormattingEditorController = __decorateClass$2([
|
|
7537
7598
|
OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingEditorController),
|
|
7538
7599
|
__decorateParam$2(0, Inject(IEditorBridgeService)),
|
|
@@ -7542,18 +7603,18 @@ var __defProp$1 = Object.defineProperty, __getOwnPropDesc$1 = Object.getOwnPrope
|
|
|
7542
7603
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$1(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7543
7604
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
7544
7605
|
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"),
|
|
7546
|
-
let ConditionalFormattingClearController = (
|
|
7606
|
+
}, "__decorateClass$1"), __decorateParam$1 = /* @__PURE__ */ __name((index2, decorator) => (target, key) => decorator(target, key, index2), "__decorateParam$1"), _a12;
|
|
7607
|
+
let ConditionalFormattingClearController = (_a12 = class extends Disposable {
|
|
7547
7608
|
constructor(_injector, _univerInstanceService, _sheetInterceptorService, _selectionManagerService, _conditionalFormattingRuleModel) {
|
|
7548
7609
|
super(), this._injector = _injector, this._univerInstanceService = _univerInstanceService, this._sheetInterceptorService = _sheetInterceptorService, this._selectionManagerService = _selectionManagerService, this._conditionalFormattingRuleModel = _conditionalFormattingRuleModel, this._init();
|
|
7549
7610
|
}
|
|
7550
7611
|
_init() {
|
|
7551
7612
|
this.disposeWithMe(this._sheetInterceptorService.interceptCommand({
|
|
7552
7613
|
getMutations: /* @__PURE__ */ __name((commandInfo) => {
|
|
7553
|
-
var
|
|
7614
|
+
var _a14;
|
|
7554
7615
|
const redos = [], undos = [], defaultV = { redos, undos };
|
|
7555
7616
|
if ([ClearSelectionFormatCommand.id, ClearSelectionAllCommand.id].includes(commandInfo.id)) {
|
|
7556
|
-
const ranges = (
|
|
7617
|
+
const ranges = (_a14 = this._selectionManagerService.getCurrentSelections()) == null ? void 0 : _a14.map((s) => s.range);
|
|
7557
7618
|
if (!ranges)
|
|
7558
7619
|
return defaultV;
|
|
7559
7620
|
const workbook = this._univerInstanceService.getCurrentUnitForType(UniverInstanceType.UNIVER_SHEET), worksheet = workbook.getActiveSheet();
|
|
@@ -7580,7 +7641,7 @@ let ConditionalFormattingClearController = (_a11 = class extends Disposable {
|
|
|
7580
7641
|
}, "getMutations")
|
|
7581
7642
|
}));
|
|
7582
7643
|
}
|
|
7583
|
-
}, __name(
|
|
7644
|
+
}, __name(_a12, "ConditionalFormattingClearController"), _a12);
|
|
7584
7645
|
ConditionalFormattingClearController = __decorateClass$1([
|
|
7585
7646
|
OnLifecycle(LifecycleStages.Rendered, ConditionalFormattingClearController),
|
|
7586
7647
|
__decorateParam$1(0, Inject(Injector)),
|
|
@@ -7621,15 +7682,12 @@ var __defProp2 = Object.defineProperty, __getOwnPropDesc = Object.getOwnProperty
|
|
|
7621
7682
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
7622
7683
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
7623
7684
|
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"),
|
|
7625
|
-
let UniverSheetsConditionalFormattingUIPlugin = (
|
|
7626
|
-
constructor(_config =
|
|
7627
|
-
super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this.
|
|
7628
|
-
|
|
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]);
|
|
7685
|
+
}, "__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"), _a13;
|
|
7686
|
+
let UniverSheetsConditionalFormattingUIPlugin = (_a13 = class extends Plugin {
|
|
7687
|
+
constructor(_config = defaultPluginConfig, _injector, _commandService, _configService) {
|
|
7688
|
+
super(), this._config = _config, this._injector = _injector, this._commandService = _commandService, this._configService = _configService;
|
|
7689
|
+
const { menu, ...rest } = this._config;
|
|
7690
|
+
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]);
|
|
7633
7691
|
}
|
|
7634
7692
|
_initCommand() {
|
|
7635
7693
|
[
|
|
@@ -7653,13 +7711,14 @@ let UniverSheetsConditionalFormattingUIPlugin = (_a12 = class extends Plugin {
|
|
|
7653
7711
|
this._commandService.registerCommand(m2);
|
|
7654
7712
|
});
|
|
7655
7713
|
}
|
|
7656
|
-
}, __name(
|
|
7714
|
+
}, __name(_a13, "UniverSheetsConditionalFormattingUIPlugin"), _a13);
|
|
7657
7715
|
__publicField2(UniverSheetsConditionalFormattingUIPlugin, "pluginName", `${SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);
|
|
7658
7716
|
__publicField2(UniverSheetsConditionalFormattingUIPlugin, "type", UniverInstanceType.UNIVER_SHEET);
|
|
7659
7717
|
UniverSheetsConditionalFormattingUIPlugin = __decorateClass([
|
|
7660
7718
|
DependentOn(UniverSheetsConditionalFormattingPlugin),
|
|
7661
7719
|
__decorateParam(1, Inject(Injector)),
|
|
7662
|
-
__decorateParam(2, Inject(ICommandService))
|
|
7720
|
+
__decorateParam(2, Inject(ICommandService)),
|
|
7721
|
+
__decorateParam(3, IConfigService)
|
|
7663
7722
|
], UniverSheetsConditionalFormattingUIPlugin);
|
|
7664
7723
|
export {
|
|
7665
7724
|
AddAverageCfCommand,
|