@univerjs/sheets-conditional-formatting-ui 0.21.1 → 0.22.0
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/README.md +31 -21
- package/lib/cjs/index.js +29 -42
- package/lib/es/index.js +29 -42
- package/lib/index.js +29 -42
- package/lib/umd/index.js +3 -3
- package/package.json +22 -18
package/lib/index.js
CHANGED
|
@@ -2754,7 +2754,7 @@ const RuleEdit = (props) => {
|
|
|
2754
2754
|
};
|
|
2755
2755
|
|
|
2756
2756
|
//#endregion
|
|
2757
|
-
//#region \0@oxc-project+runtime@0.
|
|
2757
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
2758
2758
|
function _typeof(o) {
|
|
2759
2759
|
"@babel/helpers - typeof";
|
|
2760
2760
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -2765,7 +2765,7 @@ function _typeof(o) {
|
|
|
2765
2765
|
}
|
|
2766
2766
|
|
|
2767
2767
|
//#endregion
|
|
2768
|
-
//#region \0@oxc-project+runtime@0.
|
|
2768
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
2769
2769
|
function toPrimitive(t, r) {
|
|
2770
2770
|
if ("object" != _typeof(t) || !t) return t;
|
|
2771
2771
|
var e = t[Symbol.toPrimitive];
|
|
@@ -2778,14 +2778,14 @@ function toPrimitive(t, r) {
|
|
|
2778
2778
|
}
|
|
2779
2779
|
|
|
2780
2780
|
//#endregion
|
|
2781
|
-
//#region \0@oxc-project+runtime@0.
|
|
2781
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
2782
2782
|
function toPropertyKey(t) {
|
|
2783
2783
|
var i = toPrimitive(t, "string");
|
|
2784
2784
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
2785
2785
|
}
|
|
2786
2786
|
|
|
2787
2787
|
//#endregion
|
|
2788
|
-
//#region \0@oxc-project+runtime@0.
|
|
2788
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
2789
2789
|
function _defineProperty(e, r, t) {
|
|
2790
2790
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2791
2791
|
value: t,
|
|
@@ -2796,7 +2796,7 @@ function _defineProperty(e, r, t) {
|
|
|
2796
2796
|
}
|
|
2797
2797
|
|
|
2798
2798
|
//#endregion
|
|
2799
|
-
//#region \0@oxc-project+runtime@0.
|
|
2799
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
2800
2800
|
function __decorateParam(paramIndex, decorator) {
|
|
2801
2801
|
return function(target, key) {
|
|
2802
2802
|
decorator(target, key, paramIndex);
|
|
@@ -2804,7 +2804,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
2804
2804
|
}
|
|
2805
2805
|
|
|
2806
2806
|
//#endregion
|
|
2807
|
-
//#region \0@oxc-project+runtime@0.
|
|
2807
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
2808
2808
|
function __decorate(decorators, target, key, desc) {
|
|
2809
2809
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2810
2810
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3219,19 +3219,6 @@ ConditionalFormattingPanelController = __decorate([
|
|
|
3219
3219
|
|
|
3220
3220
|
//#endregion
|
|
3221
3221
|
//#region src/commands/operations/open-conditional-formatting-panel.ts
|
|
3222
|
-
let CF_MENU_OPERATION = /* @__PURE__ */ function(CF_MENU_OPERATION) {
|
|
3223
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["createRule"] = 1] = "createRule";
|
|
3224
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["viewRule"] = 2] = "viewRule";
|
|
3225
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["highlightCell"] = 3] = "highlightCell";
|
|
3226
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["rank"] = 4] = "rank";
|
|
3227
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["formula"] = 5] = "formula";
|
|
3228
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["colorScale"] = 6] = "colorScale";
|
|
3229
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["dataBar"] = 7] = "dataBar";
|
|
3230
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["icon"] = 8] = "icon";
|
|
3231
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["clearRangeRules"] = 9] = "clearRangeRules";
|
|
3232
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["clearWorkSheetRules"] = 10] = "clearWorkSheetRules";
|
|
3233
|
-
return CF_MENU_OPERATION;
|
|
3234
|
-
}({});
|
|
3235
3222
|
const OpenConditionalFormattingOperator = {
|
|
3236
3223
|
id: "sheet.operation.open.conditional.formatting.panel",
|
|
3237
3224
|
type: CommandType.OPERATION,
|
|
@@ -3242,13 +3229,13 @@ const OpenConditionalFormattingOperator = {
|
|
|
3242
3229
|
const commandService = accessor.get(ICommandService);
|
|
3243
3230
|
const ranges = ((_selectionManagerServ = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range)) || [];
|
|
3244
3231
|
switch (params.value) {
|
|
3245
|
-
case
|
|
3232
|
+
case 3:
|
|
3246
3233
|
conditionalFormattingMenuController.openPanel({
|
|
3247
3234
|
...createDefaultRule(),
|
|
3248
3235
|
ranges
|
|
3249
3236
|
});
|
|
3250
3237
|
break;
|
|
3251
|
-
case
|
|
3238
|
+
case 4: {
|
|
3252
3239
|
const rule = {
|
|
3253
3240
|
...createDefaultRule,
|
|
3254
3241
|
ranges,
|
|
@@ -3260,7 +3247,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3260
3247
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3261
3248
|
break;
|
|
3262
3249
|
}
|
|
3263
|
-
case
|
|
3250
|
+
case 5: {
|
|
3264
3251
|
const rule = {
|
|
3265
3252
|
...createDefaultRule,
|
|
3266
3253
|
ranges,
|
|
@@ -3273,7 +3260,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3273
3260
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3274
3261
|
break;
|
|
3275
3262
|
}
|
|
3276
|
-
case
|
|
3263
|
+
case 6: {
|
|
3277
3264
|
const rule = {
|
|
3278
3265
|
...createDefaultRule,
|
|
3279
3266
|
ranges,
|
|
@@ -3285,7 +3272,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3285
3272
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3286
3273
|
break;
|
|
3287
3274
|
}
|
|
3288
|
-
case
|
|
3275
|
+
case 7: {
|
|
3289
3276
|
const rule = {
|
|
3290
3277
|
...createDefaultRule,
|
|
3291
3278
|
ranges,
|
|
@@ -3297,7 +3284,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3297
3284
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3298
3285
|
break;
|
|
3299
3286
|
}
|
|
3300
|
-
case
|
|
3287
|
+
case 8: {
|
|
3301
3288
|
const rule = {
|
|
3302
3289
|
...createDefaultRule,
|
|
3303
3290
|
ranges,
|
|
@@ -3310,19 +3297,19 @@ const OpenConditionalFormattingOperator = {
|
|
|
3310
3297
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3311
3298
|
break;
|
|
3312
3299
|
}
|
|
3313
|
-
case
|
|
3300
|
+
case 2:
|
|
3314
3301
|
conditionalFormattingMenuController.openPanel();
|
|
3315
3302
|
break;
|
|
3316
|
-
case
|
|
3303
|
+
case 1:
|
|
3317
3304
|
conditionalFormattingMenuController.openPanel({
|
|
3318
3305
|
...createDefaultRule(),
|
|
3319
3306
|
ranges
|
|
3320
3307
|
});
|
|
3321
3308
|
break;
|
|
3322
|
-
case
|
|
3309
|
+
case 9:
|
|
3323
3310
|
commandService.executeCommand(ClearRangeCfCommand.id, { ranges });
|
|
3324
3311
|
break;
|
|
3325
|
-
case
|
|
3312
|
+
case 10:
|
|
3326
3313
|
commandService.executeCommand(ClearWorksheetCfCommand.id);
|
|
3327
3314
|
break;
|
|
3328
3315
|
}
|
|
@@ -3436,7 +3423,7 @@ function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId)
|
|
|
3436
3423
|
//#endregion
|
|
3437
3424
|
//#region package.json
|
|
3438
3425
|
var name = "@univerjs/sheets-conditional-formatting-ui";
|
|
3439
|
-
var version = "0.
|
|
3426
|
+
var version = "0.22.0";
|
|
3440
3427
|
|
|
3441
3428
|
//#endregion
|
|
3442
3429
|
//#region src/config/config.ts
|
|
@@ -4571,63 +4558,63 @@ const commonSelections = [
|
|
|
4571
4558
|
name: "sheet.cf.ruleType.highlightCell",
|
|
4572
4559
|
selectable: false
|
|
4573
4560
|
},
|
|
4574
|
-
value:
|
|
4561
|
+
value: 3
|
|
4575
4562
|
},
|
|
4576
4563
|
{
|
|
4577
4564
|
label: {
|
|
4578
4565
|
name: "sheet.cf.panel.rankAndAverage",
|
|
4579
4566
|
selectable: false
|
|
4580
4567
|
},
|
|
4581
|
-
value:
|
|
4568
|
+
value: 4
|
|
4582
4569
|
},
|
|
4583
4570
|
{
|
|
4584
4571
|
label: {
|
|
4585
4572
|
name: "sheet.cf.ruleType.formula",
|
|
4586
4573
|
selectable: false
|
|
4587
4574
|
},
|
|
4588
|
-
value:
|
|
4575
|
+
value: 5
|
|
4589
4576
|
},
|
|
4590
4577
|
{
|
|
4591
4578
|
label: {
|
|
4592
4579
|
name: "sheet.cf.ruleType.colorScale",
|
|
4593
4580
|
selectable: false
|
|
4594
4581
|
},
|
|
4595
|
-
value:
|
|
4582
|
+
value: 6
|
|
4596
4583
|
},
|
|
4597
4584
|
{
|
|
4598
4585
|
label: {
|
|
4599
4586
|
name: "sheet.cf.ruleType.dataBar",
|
|
4600
4587
|
selectable: false
|
|
4601
4588
|
},
|
|
4602
|
-
value:
|
|
4589
|
+
value: 7
|
|
4603
4590
|
},
|
|
4604
4591
|
{
|
|
4605
4592
|
label: {
|
|
4606
4593
|
name: "sheet.cf.ruleType.iconSet",
|
|
4607
4594
|
selectable: false
|
|
4608
4595
|
},
|
|
4609
|
-
value:
|
|
4596
|
+
value: 8
|
|
4610
4597
|
},
|
|
4611
4598
|
{
|
|
4612
4599
|
label: {
|
|
4613
4600
|
name: "sheet.cf.menu.manageConditionalFormatting",
|
|
4614
4601
|
selectable: false
|
|
4615
4602
|
},
|
|
4616
|
-
value:
|
|
4603
|
+
value: 2
|
|
4617
4604
|
},
|
|
4618
4605
|
{
|
|
4619
4606
|
label: {
|
|
4620
4607
|
name: "sheet.cf.menu.createConditionalFormatting",
|
|
4621
4608
|
selectable: false
|
|
4622
4609
|
},
|
|
4623
|
-
value:
|
|
4610
|
+
value: 1
|
|
4624
4611
|
},
|
|
4625
4612
|
{
|
|
4626
4613
|
label: {
|
|
4627
4614
|
name: "sheet.cf.menu.clearRangeRules",
|
|
4628
4615
|
selectable: false
|
|
4629
4616
|
},
|
|
4630
|
-
value:
|
|
4617
|
+
value: 9,
|
|
4631
4618
|
disabled: false
|
|
4632
4619
|
},
|
|
4633
4620
|
{
|
|
@@ -4635,7 +4622,7 @@ const commonSelections = [
|
|
|
4635
4622
|
name: "sheet.cf.menu.clearWorkSheetRules",
|
|
4636
4623
|
selectable: false
|
|
4637
4624
|
},
|
|
4638
|
-
value:
|
|
4625
|
+
value: 10
|
|
4639
4626
|
}
|
|
4640
4627
|
];
|
|
4641
4628
|
const FactoryManageConditionalFormattingRule = (accessor) => {
|
|
@@ -4688,14 +4675,14 @@ const FactoryManageConditionalFormattingRule = (accessor) => {
|
|
|
4688
4675
|
}));
|
|
4689
4676
|
const selections$ = new Observable((subscriber) => {
|
|
4690
4677
|
clearRangeEnable$.subscribe((v) => {
|
|
4691
|
-
const item = commonSelections.find((item) => item.value ===
|
|
4678
|
+
const item = commonSelections.find((item) => item.value === 9);
|
|
4692
4679
|
if (item) {
|
|
4693
4680
|
item.disabled = !v;
|
|
4694
4681
|
subscriber.next(commonSelections);
|
|
4695
4682
|
}
|
|
4696
4683
|
});
|
|
4697
4684
|
clearSheetEnable$.subscribe((v) => {
|
|
4698
|
-
const item = commonSelections.find((item) => item.value ===
|
|
4685
|
+
const item = commonSelections.find((item) => item.value === 10);
|
|
4699
4686
|
if (item) {
|
|
4700
4687
|
item.disabled = !v;
|
|
4701
4688
|
subscriber.next(commonSelections);
|