@cool-office/sheets-conditional-formatting 0.0.0-stage → 1.2.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.
Files changed (151) hide show
  1. package/LICENSE +176 -0
  2. package/README.md +49 -2
  3. package/lib/cjs/facade.js +2237 -0
  4. package/lib/cjs/index.js +3211 -0
  5. package/lib/cjs/locale/ar-SA.js +10 -0
  6. package/lib/cjs/locale/ca-ES.js +10 -0
  7. package/lib/cjs/locale/de-DE.js +10 -0
  8. package/lib/cjs/locale/en-US.js +25 -0
  9. package/lib/cjs/locale/es-ES.js +10 -0
  10. package/lib/cjs/locale/fa-IR.js +10 -0
  11. package/lib/cjs/locale/fr-FR.js +10 -0
  12. package/lib/cjs/locale/id-ID.js +10 -0
  13. package/lib/cjs/locale/it-IT.js +10 -0
  14. package/lib/cjs/locale/ja-JP.js +10 -0
  15. package/lib/cjs/locale/ko-KR.js +10 -0
  16. package/lib/cjs/locale/pl-PL.js +10 -0
  17. package/lib/cjs/locale/pt-BR.js +10 -0
  18. package/lib/cjs/locale/ru-RU.js +10 -0
  19. package/lib/cjs/locale/sk-SK.js +10 -0
  20. package/lib/cjs/locale/vi-VN.js +10 -0
  21. package/lib/cjs/locale/zh-CN.js +10 -0
  22. package/lib/cjs/locale/zh-HK.js +10 -0
  23. package/lib/cjs/locale/zh-TW.js +10 -0
  24. package/lib/es/facade.js +2236 -0
  25. package/lib/es/index.js +3116 -0
  26. package/lib/es/locale/ar-SA.js +10 -0
  27. package/lib/es/locale/ca-ES.js +10 -0
  28. package/lib/es/locale/de-DE.js +10 -0
  29. package/lib/es/locale/en-US.js +25 -0
  30. package/lib/es/locale/es-ES.js +10 -0
  31. package/lib/es/locale/fa-IR.js +10 -0
  32. package/lib/es/locale/fr-FR.js +10 -0
  33. package/lib/es/locale/id-ID.js +10 -0
  34. package/lib/es/locale/it-IT.js +10 -0
  35. package/lib/es/locale/ja-JP.js +10 -0
  36. package/lib/es/locale/ko-KR.js +10 -0
  37. package/lib/es/locale/pl-PL.js +10 -0
  38. package/lib/es/locale/pt-BR.js +10 -0
  39. package/lib/es/locale/ru-RU.js +10 -0
  40. package/lib/es/locale/sk-SK.js +10 -0
  41. package/lib/es/locale/vi-VN.js +10 -0
  42. package/lib/es/locale/zh-CN.js +10 -0
  43. package/lib/es/locale/zh-HK.js +10 -0
  44. package/lib/es/locale/zh-TW.js +10 -0
  45. package/lib/facade.js +2236 -0
  46. package/lib/index.js +3116 -0
  47. package/lib/locale/ar-SA.js +10 -0
  48. package/lib/locale/ca-ES.js +10 -0
  49. package/lib/locale/de-DE.js +10 -0
  50. package/lib/locale/en-US.js +25 -0
  51. package/lib/locale/es-ES.js +10 -0
  52. package/lib/locale/fa-IR.js +10 -0
  53. package/lib/locale/fr-FR.js +10 -0
  54. package/lib/locale/id-ID.js +10 -0
  55. package/lib/locale/it-IT.js +10 -0
  56. package/lib/locale/ja-JP.js +10 -0
  57. package/lib/locale/ko-KR.js +10 -0
  58. package/lib/locale/pl-PL.js +10 -0
  59. package/lib/locale/pt-BR.js +10 -0
  60. package/lib/locale/ru-RU.js +10 -0
  61. package/lib/locale/sk-SK.js +10 -0
  62. package/lib/locale/vi-VN.js +10 -0
  63. package/lib/locale/zh-CN.js +10 -0
  64. package/lib/locale/zh-HK.js +10 -0
  65. package/lib/locale/zh-TW.js +10 -0
  66. package/lib/types/assets/icon-map.d.ts +79 -0
  67. package/lib/types/base/const.d.ts +80 -0
  68. package/lib/types/commands/commands/add-cf.command.d.ts +24 -0
  69. package/lib/types/commands/commands/clear-range-cf.command.d.ts +24 -0
  70. package/lib/types/commands/commands/clear-worksheet-cf.command.d.ts +21 -0
  71. package/lib/types/commands/commands/delete-cf.command.d.ts +22 -0
  72. package/lib/types/commands/commands/move-cf.command.d.ts +24 -0
  73. package/lib/types/commands/commands/set-cf.command.d.ts +24 -0
  74. package/lib/types/commands/mutations/add-conditional-rule.mutation.d.ts +28 -0
  75. package/lib/types/commands/mutations/delete-conditional-rule.mutation.d.ts +23 -0
  76. package/lib/types/commands/mutations/formula-mark-dirty.mutation.d.ts +24 -0
  77. package/lib/types/commands/mutations/move-conditional-rule.mutation.d.ts +28 -0
  78. package/lib/types/commands/mutations/set-conditional-rule.mutation.d.ts +28 -0
  79. package/lib/types/config/config.d.ts +20 -0
  80. package/lib/types/facade/f-conditional-formatting-builder.d.ts +1709 -0
  81. package/lib/types/facade/f-enum.d.ts +48 -0
  82. package/lib/types/facade/f-range.d.ts +99 -0
  83. package/lib/types/facade/f-worksheet.d.ts +180 -0
  84. package/lib/types/facade/index.d.ts +21 -0
  85. package/lib/types/index.d.ts +55 -0
  86. package/lib/types/locale/ar-SA.d.ts +18 -0
  87. package/lib/types/locale/ca-ES.d.ts +18 -0
  88. package/lib/types/locale/de-DE.d.ts +18 -0
  89. package/lib/types/locale/en-US.d.ts +26 -0
  90. package/lib/types/locale/es-ES.d.ts +18 -0
  91. package/lib/types/locale/fa-IR.d.ts +18 -0
  92. package/lib/types/locale/fr-FR.d.ts +18 -0
  93. package/lib/types/locale/id-ID.d.ts +18 -0
  94. package/lib/types/locale/it-IT.d.ts +18 -0
  95. package/lib/types/locale/ja-JP.d.ts +18 -0
  96. package/lib/types/locale/ko-KR.d.ts +18 -0
  97. package/lib/types/locale/pl-PL.d.ts +18 -0
  98. package/lib/types/locale/pt-BR.d.ts +18 -0
  99. package/lib/types/locale/ru-RU.d.ts +18 -0
  100. package/lib/types/locale/sk-SK.d.ts +18 -0
  101. package/lib/types/locale/types.d.ts +18 -0
  102. package/lib/types/locale/vi-VN.d.ts +18 -0
  103. package/lib/types/locale/zh-CN.d.ts +18 -0
  104. package/lib/types/locale/zh-HK.d.ts +18 -0
  105. package/lib/types/locale/zh-TW.d.ts +18 -0
  106. package/lib/types/models/calculate-unit-v2/base-calculate-unit.d.ts +68 -0
  107. package/lib/types/models/calculate-unit-v2/color-scale-calculate-unit.d.ts +27 -0
  108. package/lib/types/models/calculate-unit-v2/data-bar-calculate-unit.d.ts +33 -0
  109. package/lib/types/models/calculate-unit-v2/highlight-cell-calculate-unit.d.ts +28 -0
  110. package/lib/types/models/calculate-unit-v2/icon-set-calculate-unit.d.ts +34 -0
  111. package/lib/types/models/calculate-unit-v2/utils.d.ts +46 -0
  112. package/lib/types/models/conditional-formatting-range-index-model.d.ts +32 -0
  113. package/lib/types/models/conditional-formatting-rule-model.d.ts +45 -0
  114. package/lib/types/models/conditional-formatting-view-model.d.ts +78 -0
  115. package/lib/types/models/icon-map.d.ts +48 -0
  116. package/lib/types/models/type.d.ts +106 -0
  117. package/lib/types/plugin.d.ts +29 -0
  118. package/lib/types/render/data-bar.render.d.ts +35 -0
  119. package/lib/types/render/icon.render.d.ts +37 -0
  120. package/lib/types/render/type.d.ts +38 -0
  121. package/lib/types/services/conditional-formatting-formula.service.d.ts +73 -0
  122. package/lib/types/services/conditional-formatting-range-transform.service.d.ts +27 -0
  123. package/lib/types/services/conditional-formatting-style-composer.service.d.ts +35 -0
  124. package/lib/types/services/conditional-formatting.service.d.ts +41 -0
  125. package/lib/types/utils/anchor.d.ts +34 -0
  126. package/lib/types/utils/create-cf-id.d.ts +16 -0
  127. package/lib/types/utils/range.d.ts +18 -0
  128. package/lib/types/utils/remove-undefined-attr.d.ts +16 -0
  129. package/lib/types/utils/type.d.ts +18 -0
  130. package/lib/umd/facade.js +1 -0
  131. package/lib/umd/index.js +1 -0
  132. package/lib/umd/locale/ar-SA.js +1 -0
  133. package/lib/umd/locale/ca-ES.js +1 -0
  134. package/lib/umd/locale/de-DE.js +1 -0
  135. package/lib/umd/locale/en-US.js +1 -0
  136. package/lib/umd/locale/es-ES.js +1 -0
  137. package/lib/umd/locale/fa-IR.js +1 -0
  138. package/lib/umd/locale/fr-FR.js +1 -0
  139. package/lib/umd/locale/id-ID.js +1 -0
  140. package/lib/umd/locale/it-IT.js +1 -0
  141. package/lib/umd/locale/ja-JP.js +1 -0
  142. package/lib/umd/locale/ko-KR.js +1 -0
  143. package/lib/umd/locale/pl-PL.js +1 -0
  144. package/lib/umd/locale/pt-BR.js +1 -0
  145. package/lib/umd/locale/ru-RU.js +1 -0
  146. package/lib/umd/locale/sk-SK.js +1 -0
  147. package/lib/umd/locale/vi-VN.js +1 -0
  148. package/lib/umd/locale/zh-CN.js +1 -0
  149. package/lib/umd/locale/zh-HK.js +1 -0
  150. package/lib/umd/locale/zh-TW.js +1 -0
  151. package/package.json +90 -3
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { FEnum } from '@cool-office/core/facade';
17
+ import { CFNumberOperator, CFTimePeriodOperator, CFValueType, IIconSetType } from '@cool-office/sheets-conditional-formatting';
18
+ /**
19
+ * @ignore
20
+ */
21
+ export interface IFSheetsConditionalFormattingEnumMixin {
22
+ /**
23
+ * Conditional formatting number operator
24
+ */
25
+ ConditionFormatNumberOperatorEnum: typeof CFNumberOperator;
26
+ /**
27
+ * Conditional formatting time period operator
28
+ */
29
+ ConditionFormatTimePeriodOperatorEnum: typeof CFTimePeriodOperator;
30
+ /**
31
+ * Conditional formatting icon set type
32
+ */
33
+ ConditionFormatIconSetTypeEnum: typeof IIconSetType;
34
+ /**
35
+ * Conditional formatting value type
36
+ */
37
+ ConditionFormatValueTypeEnum: typeof CFValueType;
38
+ }
39
+ export declare class FSheetsConditionalFormattingEnumMixin extends FEnum implements IFSheetsConditionalFormattingEnumMixin {
40
+ get ConditionFormatNumberOperatorEnum(): typeof CFNumberOperator;
41
+ get ConditionFormatTimePeriodOperatorEnum(): typeof CFTimePeriodOperator;
42
+ get ConditionFormatIconSetTypeEnum(): typeof IIconSetType;
43
+ get ConditionFormatValueTypeEnum(): typeof CFValueType;
44
+ }
45
+ declare module '@cool-office/core/facade' {
46
+ interface FEnum extends IFSheetsConditionalFormattingEnumMixin {
47
+ }
48
+ }
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IConditionFormattingRule } from '@cool-office/sheets-conditional-formatting';
17
+ import { FRange } from '@cool-office/sheets/facade';
18
+ import { FConditionalFormattingBuilder } from './f-conditional-formatting-builder';
19
+ /**
20
+ * @ignore
21
+ */
22
+ export interface IFRangeSheetsConditionalFormattingMixin {
23
+ /**
24
+ * Gets all the conditional formatting for the current range.
25
+ * @returns {IConditionFormattingRule[]} conditional formatting rules for the current range.
26
+ * @example
27
+ * ```ts
28
+ * const fWorkbook = univerAPI.getActiveWorkbook();
29
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
30
+ * if (!fWorksheet) return;
31
+ *
32
+ * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
33
+ * const fRange = fWorksheet.getRange('A1:T100');
34
+ * const rule = fWorksheet.newConditionalFormattingRule()
35
+ * .whenCellNotEmpty()
36
+ * .setRanges([fRange.getRange()])
37
+ * .setItalic(true)
38
+ * .setBackground('red')
39
+ * .setFontColor('green')
40
+ * .build();
41
+ * fWorksheet.addConditionalFormattingRule(rule);
42
+ *
43
+ * // Get all the conditional formatting rules for the range F6:H8.
44
+ * const targetRange = fWorksheet.getRange('F6:H8');
45
+ * const rules = targetRange.getConditionalFormattingRules();
46
+ * console.log(rules);
47
+ * ```
48
+ */
49
+ getConditionalFormattingRules(): IConditionFormattingRule[];
50
+ /**
51
+ * Creates a constructor for conditional formatting
52
+ * @returns {FConditionalFormattingBuilder} The conditional formatting builder
53
+ * @example
54
+ * ```ts
55
+ * const fWorkbook = univerAPI.getActiveWorkbook();
56
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
57
+ * if (!fWorksheet) return;
58
+ *
59
+ * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
60
+ * const fRange = fWorksheet.getRange('A1:T100');
61
+ * const rule = fRange.createConditionalFormattingRule()
62
+ * .whenCellNotEmpty()
63
+ * .setItalic(true)
64
+ * .setBackground('red')
65
+ * .setFontColor('green')
66
+ * .build();
67
+ * fWorksheet.addConditionalFormattingRule(rule);
68
+ * console.log(fRange.getConditionalFormattingRules());
69
+ * ```
70
+ */
71
+ createConditionalFormattingRule(): FConditionalFormattingBuilder;
72
+ /**
73
+ * Clear the conditional rules for the range.
74
+ * @returns {FRange} Returns the current range instance for method chaining
75
+ * @memberof IFRangeConditionalFormattingMixin
76
+ * @example
77
+ * ```ts
78
+ * const fWorkbook = univerAPI.getActiveWorkbook();
79
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
80
+ * if (!fWorksheet) return;
81
+ * const fRange = fWorksheet.getRange('A1:T100');
82
+ *
83
+ * // Clear all conditional format rules for the range
84
+ * fRange.clearConditionalFormatRules();
85
+ * console.log(fRange.getConditionalFormattingRules()); // []
86
+ * ```
87
+ */
88
+ clearConditionalFormatRules(): FRange;
89
+ }
90
+ export declare class FRangeSheetsConditionalFormattingMixin extends FRange implements IFRangeSheetsConditionalFormattingMixin {
91
+ private _getConditionalFormattingRuleModel;
92
+ getConditionalFormattingRules(): IConditionFormattingRule[];
93
+ createConditionalFormattingRule(): FConditionalFormattingBuilder;
94
+ clearConditionalFormatRules(): FRange;
95
+ }
96
+ declare module '@cool-office/sheets/facade' {
97
+ interface FRange extends IFRangeSheetsConditionalFormattingMixin {
98
+ }
99
+ }
@@ -0,0 +1,180 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { IAnchor, IConditionFormattingRule } from '@cool-office/sheets-conditional-formatting';
17
+ import { FWorksheet } from '@cool-office/sheets/facade';
18
+ import { FConditionalFormattingBuilder } from './f-conditional-formatting-builder';
19
+ /**
20
+ * @ignore
21
+ */
22
+ export interface IFWorksheetConditionalFormattingMixin {
23
+ /**
24
+ * Gets all the conditional formatting for the current sheet
25
+ * @returns {IConditionFormattingRule[]} conditional formatting rules for the current sheet
26
+ * @memberof IFWorksheetConditionalFormattingMixin
27
+ * @example
28
+ * ```ts
29
+ * const fWorkbook = univerAPI.getActiveWorkbook();
30
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
31
+ * if (!fWorksheet) return;
32
+ * const rules = fWorksheet.getConditionalFormattingRules();
33
+ * console.log(rules);
34
+ * ```
35
+ */
36
+ getConditionalFormattingRules(): IConditionFormattingRule[];
37
+ /**
38
+ * Creates a constructor for conditional formatting
39
+ * @returns {FConditionalFormattingBuilder} The conditional formatting builder
40
+ * @memberof IFWorksheetConditionalFormattingMixin
41
+ * @example
42
+ * ```ts
43
+ * const fWorkbook = univerAPI.getActiveWorkbook();
44
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
45
+ * if (!fWorksheet) return;
46
+ *
47
+ * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
48
+ * const fRange = fWorksheet.getRange('A1:T100');
49
+ * const rule = fWorksheet.newConditionalFormattingRule()
50
+ * .whenCellNotEmpty()
51
+ * .setRanges([fRange.getRange()])
52
+ * .setItalic(true)
53
+ * .setBackground('red')
54
+ * .setFontColor('green')
55
+ * .build();
56
+ * fWorksheet.addConditionalFormattingRule(rule);
57
+ * ```
58
+ */
59
+ newConditionalFormattingRule(): FConditionalFormattingBuilder;
60
+ /**
61
+ * Add a new conditional format
62
+ * @param {IConditionFormattingRule} rule - The conditional formatting rule to add
63
+ * @returns {FWorksheet} Returns the current worksheet instance for method chaining
64
+ * @memberof IFWorksheetConditionalFormattingMixin
65
+ * @example
66
+ * ```ts
67
+ * const fWorkbook = univerAPI.getActiveWorkbook();
68
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
69
+ * if (!fWorksheet) return;
70
+ *
71
+ * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
72
+ * const fRange = fWorksheet.getRange('A1:T100');
73
+ * const rule = fWorksheet.newConditionalFormattingRule()
74
+ * .whenCellNotEmpty()
75
+ * .setRanges([fRange.getRange()])
76
+ * .setItalic(true)
77
+ * .setBackground('red')
78
+ * .setFontColor('green')
79
+ * .build();
80
+ * fWorksheet.addConditionalFormattingRule(rule);
81
+ * ```
82
+ */
83
+ addConditionalFormattingRule(rule: IConditionFormattingRule): FWorksheet;
84
+ /**
85
+ * Delete conditional format according to `cfId`
86
+ * @param {string} cfId - The conditional formatting rule id to delete
87
+ * @returns {FWorksheet} Returns the current worksheet instance for method chaining
88
+ * @memberof IFWorksheetConditionalFormattingMixin
89
+ * @example
90
+ * ```ts
91
+ * const fWorkbook = univerAPI.getActiveWorkbook();
92
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
93
+ * if (!fWorksheet) return;
94
+ * const rules = fWorksheet.getConditionalFormattingRules();
95
+ *
96
+ * // Delete the first rule
97
+ * fWorksheet.deleteConditionalFormattingRule(rules[0]?.cfId);
98
+ * ```
99
+ */
100
+ deleteConditionalFormattingRule(cfId: string): FWorksheet;
101
+ /**
102
+ * Modify the priority of the conditional format
103
+ * @param {string} cfId - The conditional formatting rule id to move
104
+ * @param {string} toCfId Target rule
105
+ * @param {IAnchor['type']} [type] After the default move to the destination rule, if type = before moves to the front, the default value is after
106
+ * @returns {FWorksheet} Returns the current worksheet instance for method chaining
107
+ * @memberof FWorksheetConditionalFormattingMixin
108
+ * @example
109
+ * ```ts
110
+ * const fWorkbook = univerAPI.getActiveWorkbook();
111
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
112
+ * if (!fWorksheet) return;
113
+ * const rules = fWorksheet.getConditionalFormattingRules();
114
+ *
115
+ * // Move the third rule before the first rule
116
+ * const rule = rules[2];
117
+ * const targetRule = rules[0];
118
+ * fWorksheet.moveConditionalFormattingRule(rule?.cfId, targetRule?.cfId, 'before');
119
+ * ```
120
+ */
121
+ moveConditionalFormattingRule(cfId: string, toCfId: string, type?: IAnchor['type']): FWorksheet;
122
+ /**
123
+ * Set the conditional format according to `cfId`
124
+ * @param {string} cfId - The conditional formatting rule id to set
125
+ * @param {IConditionFormattingRule} rule - The conditional formatting rule to set
126
+ * @returns {FWorksheet} Returns the current worksheet instance for method chaining
127
+ * @memberof IFWorksheetConditionalFormattingMixin
128
+ * @example
129
+ * ```ts
130
+ * const fWorkbook = univerAPI.getActiveWorkbook();
131
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
132
+ * if (!fWorksheet) return;
133
+ *
134
+ * // Create a conditional formatting rule that sets the cell format to italic, red background, and green font color when the cell is not empty.
135
+ * const fRange = fWorksheet.getRange('A1:T100');
136
+ * const rule = fWorksheet.newConditionalFormattingRule()
137
+ * .whenCellNotEmpty()
138
+ * .setRanges([fRange.getRange()])
139
+ * .setItalic(true)
140
+ * .setBackground('red')
141
+ * .setFontColor('green')
142
+ * .build();
143
+ * fWorksheet.addConditionalFormattingRule(rule);
144
+ *
145
+ * // Modify the first rule to apply to a new range
146
+ * const rules = fWorksheet.getConditionalFormattingRules();
147
+ * const newRuleRange = fWorksheet.getRange('A1:D10');
148
+ * fWorksheet.setConditionalFormattingRule(rules[0]?.cfId, { ...rules[0], ranges: [newRuleRange.getRange()] });
149
+ * ```
150
+ */
151
+ setConditionalFormattingRule(cfId: string, rule: IConditionFormattingRule): FWorksheet;
152
+ /**
153
+ * Removes all conditional format rules from the sheet.
154
+ * @returns {FWorksheet} Returns the current worksheet instance for method chaining
155
+ * @memberof IFWorksheetConditionalFormattingMixin
156
+ * @example
157
+ * ```ts
158
+ * const fWorkbook = univerAPI.getActiveWorkbook();
159
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
160
+ * if (!fWorksheet) return;
161
+ * fWorksheet.clearConditionalFormatRules();
162
+ * console.log(fWorksheet.getConditionalFormattingRules()); // []
163
+ * ```
164
+ */
165
+ clearConditionalFormatRules(): FWorksheet;
166
+ }
167
+ export declare class FWorksheetConditionalFormattingMixin extends FWorksheet implements IFWorksheetConditionalFormattingMixin {
168
+ private _getConditionalFormattingRuleModel;
169
+ getConditionalFormattingRules(): IConditionFormattingRule[];
170
+ newConditionalFormattingRule(): FConditionalFormattingBuilder;
171
+ addConditionalFormattingRule(rule: IConditionFormattingRule): FWorksheet;
172
+ deleteConditionalFormattingRule(cfId: string): FWorksheet;
173
+ moveConditionalFormattingRule(cfId: string, toCfId: string, type?: IAnchor['type']): FWorksheet;
174
+ setConditionalFormattingRule(cfId: string, rule: IConditionFormattingRule): FWorksheet;
175
+ clearConditionalFormatRules(): FWorksheet;
176
+ }
177
+ declare module '@cool-office/sheets/facade' {
178
+ interface FWorksheet extends IFWorksheetConditionalFormattingMixin {
179
+ }
180
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import './f-range';
17
+ import './f-worksheet';
18
+ import './f-enum';
19
+ export { FConditionalFormattingBuilder } from './f-conditional-formatting-builder';
20
+ export type { IFRangeSheetsConditionalFormattingMixin } from './f-range';
21
+ export type { IFWorksheetConditionalFormattingMixin } from './f-worksheet';
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ export * from './base/const';
17
+ export { AddCfCommand } from './commands/commands/add-cf.command';
18
+ export type { IAddCfCommandParams } from './commands/commands/add-cf.command';
19
+ export { ClearRangeCfCommand } from './commands/commands/clear-range-cf.command';
20
+ export type { IClearRangeCfParams } from './commands/commands/clear-range-cf.command';
21
+ export { ClearWorksheetCfCommand } from './commands/commands/clear-worksheet-cf.command';
22
+ export type { IClearWorksheetCfParams } from './commands/commands/clear-worksheet-cf.command';
23
+ export { DeleteCfCommand } from './commands/commands/delete-cf.command';
24
+ export type { IDeleteCfCommandParams } from './commands/commands/delete-cf.command';
25
+ export { MoveCfCommand } from './commands/commands/move-cf.command';
26
+ export type { IMoveCfCommandParams } from './commands/commands/move-cf.command';
27
+ export { SetCfCommand } from './commands/commands/set-cf.command';
28
+ export type { ISetCfCommandParams } from './commands/commands/set-cf.command';
29
+ export { AddConditionalRuleMutation, AddConditionalRuleMutationUndoFactory, } from './commands/mutations/add-conditional-rule.mutation';
30
+ export type { IAddConditionalRuleMutationParams } from './commands/mutations/add-conditional-rule.mutation';
31
+ export { DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, } from './commands/mutations/delete-conditional-rule.mutation';
32
+ export type { IDeleteConditionalRuleMutationParams } from './commands/mutations/delete-conditional-rule.mutation';
33
+ export { MoveConditionalRuleMutation, MoveConditionalRuleMutationUndoFactory, } from './commands/mutations/move-conditional-rule.mutation';
34
+ export type { IMoveConditionalRuleMutationParams } from './commands/mutations/move-conditional-rule.mutation';
35
+ export type { ISetConditionalRuleMutationParams } from './commands/mutations/set-conditional-rule.mutation';
36
+ export { SetConditionalRuleMutation, setConditionalRuleMutationUndoFactory, } from './commands/mutations/set-conditional-rule.mutation';
37
+ export type { IUniverSheetsConditionalFormattingConfig } from './config/config';
38
+ export * from './models/calculate-unit-v2/utils';
39
+ export * from './models/conditional-formatting-range-index-model';
40
+ export * from './models/conditional-formatting-rule-model';
41
+ export * from './models/conditional-formatting-view-model';
42
+ export * from './models/icon-map';
43
+ export * from './models/type';
44
+ export { UniverSheetsConditionalFormattingPlugin } from './plugin';
45
+ export * from './render/data-bar.render';
46
+ export * from './render/icon.render';
47
+ export * from './render/type';
48
+ export * from './services/conditional-formatting-formula.service';
49
+ export * from './services/conditional-formatting-range-transform.service';
50
+ export * from './services/conditional-formatting-style-composer.service';
51
+ export * from './services/conditional-formatting.service';
52
+ export * from './utils/anchor';
53
+ export * from './utils/create-cf-id';
54
+ export * from './utils/remove-undefined-attr';
55
+ export * from './utils/type';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ declare const locale: {
17
+ 'sheets-conditional-formatting': {
18
+ iconSet: {
19
+ direction: string;
20
+ shape: string;
21
+ mark: string;
22
+ rank: string;
23
+ };
24
+ };
25
+ };
26
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright 2023-present DreamNum Co., Ltd.
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type enUS from './en-US';
17
+ declare const locale: typeof enUS;
18
+ export default locale;