@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/README.md
CHANGED
|
@@ -1,37 +1,47 @@
|
|
|
1
1
|
# @univerjs/sheets-conditional-formatting-ui
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
| --- | --- | --- | --- | --- | :---: | :---: |
|
|
7
|
-
| `@univerjs/sheets-conditional-formatting-ui` | `UniverSheetsConditionalFormattingUi` | [![][npm-version-shield]][npm-version-link] | ![][npm-license-shield] | ![][npm-downloads-shield] | ⭕️ | ⭕️ |
|
|
3
|
+
[](https://npmjs.com/package/@univerjs/sheets-conditional-formatting-ui)
|
|
4
|
+
[](https://npmjs.com/package/@univerjs/sheets-conditional-formatting-ui)
|
|
5
|
+
[](https://npmjs.com/package/@univerjs/sheets-conditional-formatting-ui)
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
`@univerjs/sheets-conditional-formatting-ui` adds the conditional formatting panels, menus, and interaction UI for Univer Sheets.
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
9
|
+
## Package Overview
|
|
14
10
|
|
|
15
|
-
|
|
11
|
+
| Package | UMD global | CSS | Locales | Facade entry |
|
|
12
|
+
| --- | --- | :---: | :---: | :---: |
|
|
13
|
+
| `@univerjs/sheets-conditional-formatting-ui` | `UniverSheetsConditionalFormattingUi` | Yes | Yes | No |
|
|
16
14
|
|
|
17
|
-
|
|
18
|
-
# Using npm
|
|
19
|
-
npm install @univerjs/sheets-conditional-formatting-ui
|
|
15
|
+
## Installation
|
|
20
16
|
|
|
21
|
-
|
|
17
|
+
```sh
|
|
22
18
|
pnpm add @univerjs/sheets-conditional-formatting-ui
|
|
19
|
+
# or
|
|
20
|
+
npm install @univerjs/sheets-conditional-formatting-ui
|
|
23
21
|
```
|
|
24
22
|
|
|
25
|
-
|
|
23
|
+
Keep all `@univerjs/*` packages on the same version.
|
|
26
24
|
|
|
27
|
-
|
|
25
|
+
## Usage
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import '@univerjs/sheets-conditional-formatting-ui/lib/index.css';
|
|
29
|
+
import EnUS from '@univerjs/sheets-conditional-formatting-ui/locale/en-US';
|
|
28
30
|
import { UniverSheetsConditionalFormattingUIPlugin } from '@univerjs/sheets-conditional-formatting-ui';
|
|
29
31
|
|
|
30
32
|
univer.registerPlugin(UniverSheetsConditionalFormattingUIPlugin);
|
|
33
|
+
|
|
34
|
+
// Merge EnUS into your Univer locale map when this package contributes UI text.
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
Exported plugin classes:
|
|
38
|
+
|
|
39
|
+
- `UniverSheetsConditionalFormattingUIPlugin`
|
|
40
|
+
- `UniverSheetsConditionalFormattingMobileUIPlugin`
|
|
41
|
+
|
|
42
|
+
## Resources
|
|
43
|
+
|
|
44
|
+
- [Documentation](https://docs.univer.ai)
|
|
45
|
+
- [NPM package](https://npmjs.com/package/@univerjs/sheets-conditional-formatting-ui)
|
|
46
|
+
- [GitHub repository](https://github.com/dream-num/univer)
|
|
47
|
+
|
package/lib/cjs/index.js
CHANGED
|
@@ -2755,7 +2755,7 @@ const RuleEdit = (props) => {
|
|
|
2755
2755
|
};
|
|
2756
2756
|
|
|
2757
2757
|
//#endregion
|
|
2758
|
-
//#region \0@oxc-project+runtime@0.
|
|
2758
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/typeof.js
|
|
2759
2759
|
function _typeof(o) {
|
|
2760
2760
|
"@babel/helpers - typeof";
|
|
2761
2761
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -2766,7 +2766,7 @@ function _typeof(o) {
|
|
|
2766
2766
|
}
|
|
2767
2767
|
|
|
2768
2768
|
//#endregion
|
|
2769
|
-
//#region \0@oxc-project+runtime@0.
|
|
2769
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPrimitive.js
|
|
2770
2770
|
function toPrimitive(t, r) {
|
|
2771
2771
|
if ("object" != _typeof(t) || !t) return t;
|
|
2772
2772
|
var e = t[Symbol.toPrimitive];
|
|
@@ -2779,14 +2779,14 @@ function toPrimitive(t, r) {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
|
|
2781
2781
|
//#endregion
|
|
2782
|
-
//#region \0@oxc-project+runtime@0.
|
|
2782
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/toPropertyKey.js
|
|
2783
2783
|
function toPropertyKey(t) {
|
|
2784
2784
|
var i = toPrimitive(t, "string");
|
|
2785
2785
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
2786
2786
|
}
|
|
2787
2787
|
|
|
2788
2788
|
//#endregion
|
|
2789
|
-
//#region \0@oxc-project+runtime@0.
|
|
2789
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/defineProperty.js
|
|
2790
2790
|
function _defineProperty(e, r, t) {
|
|
2791
2791
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2792
2792
|
value: t,
|
|
@@ -2797,7 +2797,7 @@ function _defineProperty(e, r, t) {
|
|
|
2797
2797
|
}
|
|
2798
2798
|
|
|
2799
2799
|
//#endregion
|
|
2800
|
-
//#region \0@oxc-project+runtime@0.
|
|
2800
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorateParam.js
|
|
2801
2801
|
function __decorateParam(paramIndex, decorator) {
|
|
2802
2802
|
return function(target, key) {
|
|
2803
2803
|
decorator(target, key, paramIndex);
|
|
@@ -2805,7 +2805,7 @@ function __decorateParam(paramIndex, decorator) {
|
|
|
2805
2805
|
}
|
|
2806
2806
|
|
|
2807
2807
|
//#endregion
|
|
2808
|
-
//#region \0@oxc-project+runtime@0.
|
|
2808
|
+
//#region \0@oxc-project+runtime@0.129.0/helpers/decorate.js
|
|
2809
2809
|
function __decorate(decorators, target, key, desc) {
|
|
2810
2810
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
2811
2811
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -3220,19 +3220,6 @@ ConditionalFormattingPanelController = __decorate([
|
|
|
3220
3220
|
|
|
3221
3221
|
//#endregion
|
|
3222
3222
|
//#region src/commands/operations/open-conditional-formatting-panel.ts
|
|
3223
|
-
let CF_MENU_OPERATION = /* @__PURE__ */ function(CF_MENU_OPERATION) {
|
|
3224
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["createRule"] = 1] = "createRule";
|
|
3225
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["viewRule"] = 2] = "viewRule";
|
|
3226
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["highlightCell"] = 3] = "highlightCell";
|
|
3227
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["rank"] = 4] = "rank";
|
|
3228
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["formula"] = 5] = "formula";
|
|
3229
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["colorScale"] = 6] = "colorScale";
|
|
3230
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["dataBar"] = 7] = "dataBar";
|
|
3231
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["icon"] = 8] = "icon";
|
|
3232
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["clearRangeRules"] = 9] = "clearRangeRules";
|
|
3233
|
-
CF_MENU_OPERATION[CF_MENU_OPERATION["clearWorkSheetRules"] = 10] = "clearWorkSheetRules";
|
|
3234
|
-
return CF_MENU_OPERATION;
|
|
3235
|
-
}({});
|
|
3236
3223
|
const OpenConditionalFormattingOperator = {
|
|
3237
3224
|
id: "sheet.operation.open.conditional.formatting.panel",
|
|
3238
3225
|
type: _univerjs_core.CommandType.OPERATION,
|
|
@@ -3243,13 +3230,13 @@ const OpenConditionalFormattingOperator = {
|
|
|
3243
3230
|
const commandService = accessor.get(_univerjs_core.ICommandService);
|
|
3244
3231
|
const ranges = ((_selectionManagerServ = selectionManagerService.getCurrentSelections()) === null || _selectionManagerServ === void 0 ? void 0 : _selectionManagerServ.map((s) => s.range)) || [];
|
|
3245
3232
|
switch (params.value) {
|
|
3246
|
-
case
|
|
3233
|
+
case 3:
|
|
3247
3234
|
conditionalFormattingMenuController.openPanel({
|
|
3248
3235
|
...(0, _univerjs_sheets_conditional_formatting.createDefaultRule)(),
|
|
3249
3236
|
ranges
|
|
3250
3237
|
});
|
|
3251
3238
|
break;
|
|
3252
|
-
case
|
|
3239
|
+
case 4: {
|
|
3253
3240
|
const rule = {
|
|
3254
3241
|
..._univerjs_sheets_conditional_formatting.createDefaultRule,
|
|
3255
3242
|
ranges,
|
|
@@ -3261,7 +3248,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3261
3248
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3262
3249
|
break;
|
|
3263
3250
|
}
|
|
3264
|
-
case
|
|
3251
|
+
case 5: {
|
|
3265
3252
|
const rule = {
|
|
3266
3253
|
..._univerjs_sheets_conditional_formatting.createDefaultRule,
|
|
3267
3254
|
ranges,
|
|
@@ -3274,7 +3261,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3274
3261
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3275
3262
|
break;
|
|
3276
3263
|
}
|
|
3277
|
-
case
|
|
3264
|
+
case 6: {
|
|
3278
3265
|
const rule = {
|
|
3279
3266
|
..._univerjs_sheets_conditional_formatting.createDefaultRule,
|
|
3280
3267
|
ranges,
|
|
@@ -3286,7 +3273,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3286
3273
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3287
3274
|
break;
|
|
3288
3275
|
}
|
|
3289
|
-
case
|
|
3276
|
+
case 7: {
|
|
3290
3277
|
const rule = {
|
|
3291
3278
|
..._univerjs_sheets_conditional_formatting.createDefaultRule,
|
|
3292
3279
|
ranges,
|
|
@@ -3298,7 +3285,7 @@ const OpenConditionalFormattingOperator = {
|
|
|
3298
3285
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3299
3286
|
break;
|
|
3300
3287
|
}
|
|
3301
|
-
case
|
|
3288
|
+
case 8: {
|
|
3302
3289
|
const rule = {
|
|
3303
3290
|
..._univerjs_sheets_conditional_formatting.createDefaultRule,
|
|
3304
3291
|
ranges,
|
|
@@ -3311,19 +3298,19 @@ const OpenConditionalFormattingOperator = {
|
|
|
3311
3298
|
conditionalFormattingMenuController.openPanel(rule);
|
|
3312
3299
|
break;
|
|
3313
3300
|
}
|
|
3314
|
-
case
|
|
3301
|
+
case 2:
|
|
3315
3302
|
conditionalFormattingMenuController.openPanel();
|
|
3316
3303
|
break;
|
|
3317
|
-
case
|
|
3304
|
+
case 1:
|
|
3318
3305
|
conditionalFormattingMenuController.openPanel({
|
|
3319
3306
|
...(0, _univerjs_sheets_conditional_formatting.createDefaultRule)(),
|
|
3320
3307
|
ranges
|
|
3321
3308
|
});
|
|
3322
3309
|
break;
|
|
3323
|
-
case
|
|
3310
|
+
case 9:
|
|
3324
3311
|
commandService.executeCommand(_univerjs_sheets_conditional_formatting.ClearRangeCfCommand.id, { ranges });
|
|
3325
3312
|
break;
|
|
3326
|
-
case
|
|
3313
|
+
case 10:
|
|
3327
3314
|
commandService.executeCommand(_univerjs_sheets_conditional_formatting.ClearWorksheetCfCommand.id);
|
|
3328
3315
|
break;
|
|
3329
3316
|
}
|
|
@@ -3437,7 +3424,7 @@ function generateClearCfMutations(injector, allRules, ranges, unitId, subUnitId)
|
|
|
3437
3424
|
//#endregion
|
|
3438
3425
|
//#region package.json
|
|
3439
3426
|
var name = "@univerjs/sheets-conditional-formatting-ui";
|
|
3440
|
-
var version = "0.
|
|
3427
|
+
var version = "0.22.0";
|
|
3441
3428
|
|
|
3442
3429
|
//#endregion
|
|
3443
3430
|
//#region src/config/config.ts
|
|
@@ -4572,63 +4559,63 @@ const commonSelections = [
|
|
|
4572
4559
|
name: "sheet.cf.ruleType.highlightCell",
|
|
4573
4560
|
selectable: false
|
|
4574
4561
|
},
|
|
4575
|
-
value:
|
|
4562
|
+
value: 3
|
|
4576
4563
|
},
|
|
4577
4564
|
{
|
|
4578
4565
|
label: {
|
|
4579
4566
|
name: "sheet.cf.panel.rankAndAverage",
|
|
4580
4567
|
selectable: false
|
|
4581
4568
|
},
|
|
4582
|
-
value:
|
|
4569
|
+
value: 4
|
|
4583
4570
|
},
|
|
4584
4571
|
{
|
|
4585
4572
|
label: {
|
|
4586
4573
|
name: "sheet.cf.ruleType.formula",
|
|
4587
4574
|
selectable: false
|
|
4588
4575
|
},
|
|
4589
|
-
value:
|
|
4576
|
+
value: 5
|
|
4590
4577
|
},
|
|
4591
4578
|
{
|
|
4592
4579
|
label: {
|
|
4593
4580
|
name: "sheet.cf.ruleType.colorScale",
|
|
4594
4581
|
selectable: false
|
|
4595
4582
|
},
|
|
4596
|
-
value:
|
|
4583
|
+
value: 6
|
|
4597
4584
|
},
|
|
4598
4585
|
{
|
|
4599
4586
|
label: {
|
|
4600
4587
|
name: "sheet.cf.ruleType.dataBar",
|
|
4601
4588
|
selectable: false
|
|
4602
4589
|
},
|
|
4603
|
-
value:
|
|
4590
|
+
value: 7
|
|
4604
4591
|
},
|
|
4605
4592
|
{
|
|
4606
4593
|
label: {
|
|
4607
4594
|
name: "sheet.cf.ruleType.iconSet",
|
|
4608
4595
|
selectable: false
|
|
4609
4596
|
},
|
|
4610
|
-
value:
|
|
4597
|
+
value: 8
|
|
4611
4598
|
},
|
|
4612
4599
|
{
|
|
4613
4600
|
label: {
|
|
4614
4601
|
name: "sheet.cf.menu.manageConditionalFormatting",
|
|
4615
4602
|
selectable: false
|
|
4616
4603
|
},
|
|
4617
|
-
value:
|
|
4604
|
+
value: 2
|
|
4618
4605
|
},
|
|
4619
4606
|
{
|
|
4620
4607
|
label: {
|
|
4621
4608
|
name: "sheet.cf.menu.createConditionalFormatting",
|
|
4622
4609
|
selectable: false
|
|
4623
4610
|
},
|
|
4624
|
-
value:
|
|
4611
|
+
value: 1
|
|
4625
4612
|
},
|
|
4626
4613
|
{
|
|
4627
4614
|
label: {
|
|
4628
4615
|
name: "sheet.cf.menu.clearRangeRules",
|
|
4629
4616
|
selectable: false
|
|
4630
4617
|
},
|
|
4631
|
-
value:
|
|
4618
|
+
value: 9,
|
|
4632
4619
|
disabled: false
|
|
4633
4620
|
},
|
|
4634
4621
|
{
|
|
@@ -4636,7 +4623,7 @@ const commonSelections = [
|
|
|
4636
4623
|
name: "sheet.cf.menu.clearWorkSheetRules",
|
|
4637
4624
|
selectable: false
|
|
4638
4625
|
},
|
|
4639
|
-
value:
|
|
4626
|
+
value: 10
|
|
4640
4627
|
}
|
|
4641
4628
|
];
|
|
4642
4629
|
const FactoryManageConditionalFormattingRule = (accessor) => {
|
|
@@ -4689,14 +4676,14 @@ const FactoryManageConditionalFormattingRule = (accessor) => {
|
|
|
4689
4676
|
}));
|
|
4690
4677
|
const selections$ = new rxjs.Observable((subscriber) => {
|
|
4691
4678
|
clearRangeEnable$.subscribe((v) => {
|
|
4692
|
-
const item = commonSelections.find((item) => item.value ===
|
|
4679
|
+
const item = commonSelections.find((item) => item.value === 9);
|
|
4693
4680
|
if (item) {
|
|
4694
4681
|
item.disabled = !v;
|
|
4695
4682
|
subscriber.next(commonSelections);
|
|
4696
4683
|
}
|
|
4697
4684
|
});
|
|
4698
4685
|
clearSheetEnable$.subscribe((v) => {
|
|
4699
|
-
const item = commonSelections.find((item) => item.value ===
|
|
4686
|
+
const item = commonSelections.find((item) => item.value === 10);
|
|
4700
4687
|
if (item) {
|
|
4701
4688
|
item.disabled = !v;
|
|
4702
4689
|
subscriber.next(commonSelections);
|
package/lib/es/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);
|