@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,2236 @@
1
+ import { BooleanNumber, ColorKit, Rectangle, Tools } from "@cool-office/core";
2
+ import { AddCfCommand, CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType, ClearRangeCfCommand, ClearWorksheetCfCommand, ConditionalFormattingRuleModel, DeleteCfCommand, IIconSetType, MoveCfCommand, SetCfCommand, createCfId, iconMap } from "@cool-office/sheets-conditional-formatting";
3
+ import { FRange, FWorksheet } from "@cool-office/sheets/facade";
4
+ import { FEnum } from "@cool-office/core/facade";
5
+
6
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/typeof.js
7
+ function _typeof(o) {
8
+ "@babel/helpers - typeof";
9
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
10
+ return typeof o;
11
+ } : function(o) {
12
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
13
+ }, _typeof(o);
14
+ }
15
+
16
+ //#endregion
17
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPrimitive.js
18
+ function toPrimitive(t, r) {
19
+ if ("object" != _typeof(t) || !t) return t;
20
+ var e = t[Symbol.toPrimitive];
21
+ if (void 0 !== e) {
22
+ var i = e.call(t, r || "default");
23
+ if ("object" != _typeof(i)) return i;
24
+ throw new TypeError("@@toPrimitive must return a primitive value.");
25
+ }
26
+ return ("string" === r ? String : Number)(t);
27
+ }
28
+
29
+ //#endregion
30
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/toPropertyKey.js
31
+ function toPropertyKey(t) {
32
+ var i = toPrimitive(t, "string");
33
+ return "symbol" == _typeof(i) ? i : i + "";
34
+ }
35
+
36
+ //#endregion
37
+ //#region \0@oxc-project+runtime@0.153.0/helpers/esm/defineProperty.js
38
+ function _defineProperty(e, r, t) {
39
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
40
+ value: t,
41
+ enumerable: !0,
42
+ configurable: !0,
43
+ writable: !0
44
+ }) : e[r] = t, e;
45
+ }
46
+
47
+ //#endregion
48
+ //#region src/facade/f-conditional-formatting-builder.ts
49
+ /**
50
+ * @ignore
51
+ * @hideconstructor
52
+ */
53
+ var ConditionalFormatRuleBaseBuilder = class ConditionalFormatRuleBaseBuilder {
54
+ get _ruleConfig() {
55
+ return this._rule.rule || null;
56
+ }
57
+ _getDefaultConfig(type = CFRuleType.highlightCell) {
58
+ switch (type) {
59
+ case CFRuleType.colorScale: return {
60
+ type,
61
+ config: [{
62
+ index: 0,
63
+ color: new ColorKit("").toRgbString(),
64
+ value: { type: CFValueType.min }
65
+ }, {
66
+ index: 0,
67
+ color: new ColorKit("green").toRgbString(),
68
+ value: { type: CFValueType.max }
69
+ }]
70
+ };
71
+ case CFRuleType.dataBar: return {
72
+ type,
73
+ isShowValue: true,
74
+ config: {
75
+ min: { type: CFValueType.min },
76
+ max: { type: CFValueType.max },
77
+ positiveColor: new ColorKit("green").toRgbString(),
78
+ nativeColor: new ColorKit("").toRgbString(),
79
+ isGradient: false
80
+ }
81
+ };
82
+ case CFRuleType.highlightCell: return {
83
+ type,
84
+ subType: CFSubRuleType.text,
85
+ operator: CFTextOperator.containsText,
86
+ value: "abc",
87
+ style: {}
88
+ };
89
+ case CFRuleType.iconSet: return {
90
+ type,
91
+ isShowValue: true,
92
+ config: [
93
+ {
94
+ operator: CFNumberOperator.greaterThanOrEqual,
95
+ value: { type: CFValueType.min },
96
+ iconType: IIconSetType.empty,
97
+ iconId: ""
98
+ },
99
+ {
100
+ operator: CFNumberOperator.greaterThanOrEqual,
101
+ value: {
102
+ type: CFValueType.percentile,
103
+ value: .5
104
+ },
105
+ iconType: IIconSetType.empty,
106
+ iconId: ""
107
+ },
108
+ {
109
+ operator: CFNumberOperator.lessThanOrEqual,
110
+ value: { type: CFValueType.max },
111
+ iconType: IIconSetType.empty,
112
+ iconId: ""
113
+ }
114
+ ]
115
+ };
116
+ }
117
+ }
118
+ constructor(initRule = {}) {
119
+ _defineProperty(this, "_rule", {});
120
+ this._rule = initRule;
121
+ this._ensureAttr(this._rule, ["rule"]);
122
+ }
123
+ _ensureAttr(obj, keys) {
124
+ keys.reduce((pre, cur) => {
125
+ if (!pre[cur]) pre[cur] = {};
126
+ return pre[cur];
127
+ }, obj);
128
+ return obj;
129
+ }
130
+ /**
131
+ * Constructs a conditional format rule from the settings applied to the builder.
132
+ * @returns {IConditionFormattingRule} The conditional format rule.
133
+ * @example
134
+ * ```typescript
135
+ * const fWorkbook = univerAPI.getActiveWorkbook();
136
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
137
+ * if (!fWorksheet) return;
138
+ *
139
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
140
+ * const fRange = fWorksheet.getRange('A1:D10');
141
+ * const rule = fWorksheet.newConditionalFormattingRule()
142
+ * .whenCellEmpty()
143
+ * .setBackground('#FF0000')
144
+ * .setRanges([fRange.getRange()])
145
+ * .build();
146
+ * fWorksheet.addConditionalFormattingRule(rule);
147
+ * ```
148
+ */
149
+ build() {
150
+ var _this$_rule$rule;
151
+ if (!this._rule.cfId) this._rule.cfId = createCfId();
152
+ if (!this._rule.ranges) this._rule.ranges = [];
153
+ if (this._rule.stopIfTrue === void 0) this._rule.stopIfTrue = false;
154
+ if (!((_this$_rule$rule = this._rule.rule) === null || _this$_rule$rule === void 0 ? void 0 : _this$_rule$rule.type)) {
155
+ this._rule.rule.type = CFRuleType.highlightCell;
156
+ this._ensureAttr(this._rule, ["rule", "style"]);
157
+ }
158
+ const defaultConfig = this._getDefaultConfig(this._rule.rule.type);
159
+ return {
160
+ ...this._rule,
161
+ rule: {
162
+ ...defaultConfig,
163
+ ...this._rule.rule
164
+ }
165
+ };
166
+ }
167
+ /**
168
+ * Deep clone a current builder.
169
+ * @returns {ConditionalFormatRuleBaseBuilder} A new builder with the same settings as the original.
170
+ * @example
171
+ * ```typescript
172
+ * const fWorkbook = univerAPI.getActiveWorkbook();
173
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
174
+ * if (!fWorksheet) return;
175
+ *
176
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
177
+ * const fRange = fWorksheet.getRange('A1:D10');
178
+ * const builder = fWorksheet.newConditionalFormattingRule()
179
+ * .whenCellEmpty()
180
+ * .setBackground('#FF0000')
181
+ * .setRanges([fRange.getRange()]);
182
+ * fWorksheet.addConditionalFormattingRule(builder.build());
183
+ *
184
+ * // Copy the rule and change the background color to green for the range A1:B2.
185
+ * const newRange = fWorksheet.getRange('A1:B2');
186
+ * const newBuilder = builder.copy()
187
+ * .setBackground('#00FF00')
188
+ * .setRanges([newRange.getRange()]);
189
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
190
+ * ```
191
+ */
192
+ copy() {
193
+ const newRule = Tools.deepClone(this._rule);
194
+ if (newRule.cfId) newRule.cfId = createCfId();
195
+ return new ConditionalFormatRuleBaseBuilder(newRule);
196
+ }
197
+ /**
198
+ * Gets the scope of the current conditional format.
199
+ * @returns {IRange[]} The ranges to which the conditional format applies.
200
+ */
201
+ getRanges() {
202
+ return this._rule.ranges || [];
203
+ }
204
+ /**
205
+ * Get the icon set mapping dictionary.
206
+ * @returns {Record<string, string[]>} The icon set mapping dictionary.
207
+ */
208
+ getIconMap() {
209
+ return iconMap;
210
+ }
211
+ /**
212
+ * Create a conditional format ID.
213
+ * @returns {string} The conditional format ID.
214
+ */
215
+ createCfId() {
216
+ return createCfId();
217
+ }
218
+ /**
219
+ * Sets the scope for conditional formatting.
220
+ * @param {IRange[]} ranges - The ranges to which the conditional format applies.
221
+ * @returns {ConditionalFormatRuleBaseBuilder} This builder for chaining.
222
+ * @example
223
+ * ```typescript
224
+ * const fWorkbook = univerAPI.getActiveWorkbook();
225
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
226
+ * if (!fWorksheet) return;
227
+ *
228
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
229
+ * const fRange = fWorksheet.getRange('A1:D10');
230
+ * const rule = fWorksheet.newConditionalFormattingRule()
231
+ * .whenCellEmpty()
232
+ * .setBackground('#FF0000')
233
+ * .setRanges([fRange.getRange()])
234
+ * .build();
235
+ * fWorksheet.addConditionalFormattingRule(rule);
236
+ * ```
237
+ */
238
+ setRanges(ranges) {
239
+ this._rule.ranges = ranges;
240
+ return this;
241
+ }
242
+ };
243
+ /**
244
+ * @hideconstructor
245
+ */
246
+ var ConditionalFormatHighlightRuleBuilder = class ConditionalFormatHighlightRuleBuilder extends ConditionalFormatRuleBaseBuilder {
247
+ constructor(initConfig = {}) {
248
+ super(initConfig);
249
+ this._ensureAttr(this._rule, ["rule", "style"]);
250
+ }
251
+ /**
252
+ * Deep clone a current builder.
253
+ * @returns {ConditionalFormatHighlightRuleBuilder} A new builder with the same settings as the original.
254
+ * @example
255
+ * ```typescript
256
+ * const fWorkbook = univerAPI.getActiveWorkbook();
257
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
258
+ * if (!fWorksheet) return;
259
+ *
260
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
261
+ * const fRange = fWorksheet.getRange('A1:D10');
262
+ * const builder = fWorksheet.newConditionalFormattingRule()
263
+ * .whenCellEmpty()
264
+ * .setBackground('#FF0000')
265
+ * .setRanges([fRange.getRange()]);
266
+ * fWorksheet.addConditionalFormattingRule(builder.build());
267
+ *
268
+ * // Copy the rule and change the background color to green for the range A1:B2.
269
+ * const newRange = fWorksheet.getRange('A1:B2');
270
+ * const newBuilder = builder.copy()
271
+ * .setBackground('#00FF00')
272
+ * .setRanges([newRange.getRange()]);
273
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
274
+ * ```
275
+ */
276
+ copy() {
277
+ const newRule = Tools.deepClone(this._rule);
278
+ if (newRule.cfId) newRule.cfId = createCfId();
279
+ return new ConditionalFormatHighlightRuleBuilder(newRule);
280
+ }
281
+ /**
282
+ * Set average rule.
283
+ * @param {IAverageHighlightCell['operator']} operator - The operator to use for the average rule.
284
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
285
+ * @example
286
+ * ```typescript
287
+ * const fWorkbook = univerAPI.getActiveWorkbook();
288
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
289
+ * if (!fWorksheet) return;
290
+ *
291
+ * // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
292
+ * const fRange = fWorksheet.getRange('A1:D10');
293
+ * const rule = fWorksheet.newConditionalFormattingRule()
294
+ * .setAverage(univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan)
295
+ * .setBackground('#FF0000')
296
+ * .setRanges([fRange.getRange()])
297
+ * .build();
298
+ * fWorksheet.addConditionalFormattingRule(rule);
299
+ * ```
300
+ */
301
+ setAverage(operator) {
302
+ const ruleConfig = this._ruleConfig;
303
+ ruleConfig.type = CFRuleType.highlightCell;
304
+ ruleConfig.subType = CFSubRuleType.average;
305
+ ruleConfig.operator = operator;
306
+ return this;
307
+ }
308
+ /**
309
+ * Set unique values rule.
310
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
311
+ * @example
312
+ * ```typescript
313
+ * const fWorkbook = univerAPI.getActiveWorkbook();
314
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
315
+ * if (!fWorksheet) return;
316
+ *
317
+ * // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
318
+ * const fRange = fWorksheet.getRange('A1:D10');
319
+ * const rule = fWorksheet.newConditionalFormattingRule()
320
+ * .setUniqueValues()
321
+ * .setBackground('#FF0000')
322
+ * .setRanges([fRange.getRange()])
323
+ * .build();
324
+ * fWorksheet.addConditionalFormattingRule(rule);
325
+ * ```
326
+ */
327
+ setUniqueValues() {
328
+ const ruleConfig = this._ruleConfig;
329
+ ruleConfig.type = CFRuleType.highlightCell;
330
+ ruleConfig.subType = CFSubRuleType.uniqueValues;
331
+ return this;
332
+ }
333
+ /**
334
+ * Set duplicate values rule.
335
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
336
+ * @example
337
+ * ```typescript
338
+ * const fWorkbook = univerAPI.getActiveWorkbook();
339
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
340
+ * if (!fWorksheet) return;
341
+ *
342
+ * // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
343
+ * const fRange = fWorksheet.getRange('A1:D10');
344
+ * const rule = fWorksheet.newConditionalFormattingRule()
345
+ * .setDuplicateValues()
346
+ * .setBackground('#FF0000')
347
+ * .setRanges([fRange.getRange()])
348
+ * .build();
349
+ * fWorksheet.addConditionalFormattingRule(rule);
350
+ * ```
351
+ */
352
+ setDuplicateValues() {
353
+ const ruleConfig = this._ruleConfig;
354
+ ruleConfig.type = CFRuleType.highlightCell;
355
+ ruleConfig.subType = CFSubRuleType.duplicateValues;
356
+ return this;
357
+ }
358
+ /**
359
+ * Set rank rule.
360
+ * @param {{ isBottom: boolean, isPercent: boolean, value: number }} config - The rank rule settings.
361
+ * @param {boolean} config.isBottom - Whether to highlight the bottom rank.
362
+ * @param {boolean} config.isPercent - Whether to use a percentage rank.
363
+ * @param {number} config.value - The rank value.
364
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
365
+ * @example
366
+ * ```typescript
367
+ * const fWorkbook = univerAPI.getActiveWorkbook();
368
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
369
+ * if (!fWorksheet) return;
370
+ *
371
+ * // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
372
+ * const fRange = fWorksheet.getRange('A1:D10');
373
+ * const rule = fWorksheet.newConditionalFormattingRule()
374
+ * .setRank({ isBottom: true, isPercent: true, value: 10 })
375
+ * .setBackground('#FF0000')
376
+ * .setRanges([fRange.getRange()])
377
+ * .build();
378
+ * fWorksheet.addConditionalFormattingRule(rule);
379
+ * ```
380
+ */
381
+ setRank(config) {
382
+ const ruleConfig = this._ruleConfig;
383
+ ruleConfig.type = CFRuleType.highlightCell;
384
+ ruleConfig.subType = CFSubRuleType.rank;
385
+ ruleConfig.isBottom = config.isBottom;
386
+ ruleConfig.isPercent = config.isPercent;
387
+ ruleConfig.value = config.value;
388
+ return this;
389
+ }
390
+ /**
391
+ * Sets the background color for the conditional format rule's format.
392
+ * @param {string} [color] - The background color to set. If not provided, the background color is removed.
393
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
394
+ * @example
395
+ * ```typescript
396
+ * const fWorkbook = univerAPI.getActiveWorkbook();
397
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
398
+ * if (!fWorksheet) return;
399
+ *
400
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
401
+ * const fRange = fWorksheet.getRange('A1:D10');
402
+ * const rule = fWorksheet.newConditionalFormattingRule()
403
+ * .whenCellEmpty()
404
+ * .setBackground('#FF0000')
405
+ * .setRanges([fRange.getRange()])
406
+ * .build();
407
+ * fWorksheet.addConditionalFormattingRule(rule);
408
+ * ```
409
+ */
410
+ setBackground(color) {
411
+ var _this$_ruleConfig;
412
+ if (((_this$_ruleConfig = this._ruleConfig) === null || _this$_ruleConfig === void 0 ? void 0 : _this$_ruleConfig.type) === CFRuleType.highlightCell) {
413
+ if (color) {
414
+ this._ensureAttr(this._ruleConfig, ["style", "bg"]);
415
+ const colorKit = new ColorKit(color);
416
+ this._ruleConfig.style.bg.rgb = colorKit.toRgbString();
417
+ } else delete this._ruleConfig.style.bg;
418
+ }
419
+ return this;
420
+ }
421
+ /**
422
+ * Sets text bolding for the conditional format rule's format.
423
+ * @param {boolean} isBold - Whether to bold the text.
424
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
425
+ * @example
426
+ * ```typescript
427
+ * const fWorkbook = univerAPI.getActiveWorkbook();
428
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
429
+ * if (!fWorksheet) return;
430
+ *
431
+ * // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
432
+ * const fRange = fWorksheet.getRange('A1:D10');
433
+ * const rule = fWorksheet.newConditionalFormattingRule()
434
+ * .whenCellNotEmpty()
435
+ * .setBold(true)
436
+ * .setRanges([fRange.getRange()])
437
+ * .build();
438
+ * fWorksheet.addConditionalFormattingRule(rule);
439
+ * ```
440
+ */
441
+ setBold(isBold) {
442
+ var _this$_ruleConfig2;
443
+ if (((_this$_ruleConfig2 = this._ruleConfig) === null || _this$_ruleConfig2 === void 0 ? void 0 : _this$_ruleConfig2.type) === CFRuleType.highlightCell) {
444
+ this._ensureAttr(this._ruleConfig, ["style"]);
445
+ this._ruleConfig.style.bl = isBold ? BooleanNumber.TRUE : BooleanNumber.FALSE;
446
+ }
447
+ return this;
448
+ }
449
+ /**
450
+ * Sets the font color for the conditional format rule's format.
451
+ * @param {string} [color] - The font color to set. If not provided, the font color is removed.
452
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
453
+ * @example
454
+ * ```typescript
455
+ * const fWorkbook = univerAPI.getActiveWorkbook();
456
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
457
+ * if (!fWorksheet) return;
458
+ *
459
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
460
+ * const fRange = fWorksheet.getRange('A1:D10');
461
+ * const rule = fWorksheet.newConditionalFormattingRule()
462
+ * .whenCellNotEmpty()
463
+ * .setFontColor('#FF0000')
464
+ * .setRanges([fRange.getRange()])
465
+ * .build();
466
+ * fWorksheet.addConditionalFormattingRule(rule);
467
+ * ```
468
+ */
469
+ setFontColor(color) {
470
+ var _this$_ruleConfig3;
471
+ if (((_this$_ruleConfig3 = this._ruleConfig) === null || _this$_ruleConfig3 === void 0 ? void 0 : _this$_ruleConfig3.type) === CFRuleType.highlightCell) {
472
+ if (color) {
473
+ const colorKit = new ColorKit(color);
474
+ this._ensureAttr(this._ruleConfig, ["style", "cl"]);
475
+ this._ruleConfig.style.cl.rgb = colorKit.toRgbString();
476
+ } else delete this._ruleConfig.style.cl;
477
+ }
478
+ return this;
479
+ }
480
+ /**
481
+ * Sets text italics for the conditional format rule's format.
482
+ * @param {boolean} isItalic - Whether to italicize the text.
483
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
484
+ * @example
485
+ * ```typescript
486
+ * const fWorkbook = univerAPI.getActiveWorkbook();
487
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
488
+ * if (!fWorksheet) return;
489
+ *
490
+ * // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
491
+ * const fRange = fWorksheet.getRange('A1:D10');
492
+ * const rule = fWorksheet.newConditionalFormattingRule()
493
+ * .whenCellNotEmpty()
494
+ * .setItalic(true)
495
+ * .setRanges([fRange.getRange()])
496
+ * .build();
497
+ * fWorksheet.addConditionalFormattingRule(rule);
498
+ * ```
499
+ */
500
+ setItalic(isItalic) {
501
+ var _this$_ruleConfig4;
502
+ if (((_this$_ruleConfig4 = this._ruleConfig) === null || _this$_ruleConfig4 === void 0 ? void 0 : _this$_ruleConfig4.type) === CFRuleType.highlightCell) {
503
+ this._ensureAttr(this._ruleConfig, ["style"]);
504
+ this._ruleConfig.style.it = isItalic ? BooleanNumber.TRUE : BooleanNumber.FALSE;
505
+ }
506
+ return this;
507
+ }
508
+ /**
509
+ * Sets text strikethrough for the conditional format rule's format.
510
+ * @param {boolean} isStrikethrough - Whether is strikethrough the text.
511
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
512
+ * @example
513
+ * ```typescript
514
+ * const fWorkbook = univerAPI.getActiveWorkbook();
515
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
516
+ * if (!fWorksheet) return;
517
+ *
518
+ * // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
519
+ * const fRange = fWorksheet.getRange('A1:D10');
520
+ * const rule = fWorksheet.newConditionalFormattingRule()
521
+ * .whenCellNotEmpty()
522
+ * .setStrikethrough(true)
523
+ * .setRanges([fRange.getRange()])
524
+ * .build();
525
+ * fWorksheet.addConditionalFormattingRule(rule);
526
+ * ```
527
+ */
528
+ setStrikethrough(isStrikethrough) {
529
+ var _this$_ruleConfig5;
530
+ if (((_this$_ruleConfig5 = this._ruleConfig) === null || _this$_ruleConfig5 === void 0 ? void 0 : _this$_ruleConfig5.type) === CFRuleType.highlightCell) {
531
+ this._ensureAttr(this._ruleConfig, ["style", "st"]);
532
+ this._ruleConfig.style.st.s = isStrikethrough ? BooleanNumber.TRUE : BooleanNumber.FALSE;
533
+ }
534
+ return this;
535
+ }
536
+ /**
537
+ * Sets text underlining for the conditional format rule's format.
538
+ * @param {boolean} isUnderline - Whether to underline the text.
539
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
540
+ * @example
541
+ * ```typescript
542
+ * const fWorkbook = univerAPI.getActiveWorkbook();
543
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
544
+ * if (!fWorksheet) return;
545
+ *
546
+ * // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
547
+ * const fRange = fWorksheet.getRange('A1:D10');
548
+ * const rule = fWorksheet.newConditionalFormattingRule()
549
+ * .whenCellNotEmpty()
550
+ * .setUnderline(true)
551
+ * .setRanges([fRange.getRange()])
552
+ * .build();
553
+ * fWorksheet.addConditionalFormattingRule(rule);
554
+ * ```
555
+ */
556
+ setUnderline(isUnderline) {
557
+ var _this$_ruleConfig6;
558
+ if (((_this$_ruleConfig6 = this._ruleConfig) === null || _this$_ruleConfig6 === void 0 ? void 0 : _this$_ruleConfig6.type) === CFRuleType.highlightCell) {
559
+ this._ensureAttr(this._ruleConfig, ["style", "ul"]);
560
+ this._ruleConfig.style.ul.s = isUnderline ? BooleanNumber.TRUE : BooleanNumber.FALSE;
561
+ }
562
+ return this;
563
+ }
564
+ /**
565
+ * Sets the conditional format rule to trigger when the cell is empty.
566
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
567
+ * @example
568
+ * ```typescript
569
+ * const fWorkbook = univerAPI.getActiveWorkbook();
570
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
571
+ * if (!fWorksheet) return;
572
+ *
573
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
574
+ * const fRange = fWorksheet.getRange('A1:D10');
575
+ * const rule = fWorksheet.newConditionalFormattingRule()
576
+ * .whenCellEmpty()
577
+ * .setBackground('#FF0000')
578
+ * .setRanges([fRange.getRange()])
579
+ * .build();
580
+ * fWorksheet.addConditionalFormattingRule(rule);
581
+ * ```
582
+ */
583
+ whenCellEmpty() {
584
+ const ruleConfig = this._ruleConfig;
585
+ ruleConfig.type = CFRuleType.highlightCell;
586
+ ruleConfig.subType = CFSubRuleType.text;
587
+ ruleConfig.value = "";
588
+ ruleConfig.operator = CFTextOperator.equal;
589
+ return this;
590
+ }
591
+ /**
592
+ * Sets the conditional format rule to trigger when the cell is not empty.
593
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
594
+ * @example
595
+ * ```typescript
596
+ * const fWorkbook = univerAPI.getActiveWorkbook();
597
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
598
+ * if (!fWorksheet) return;
599
+ *
600
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
601
+ * const fRange = fWorksheet.getRange('A1:D10');
602
+ * const rule = fWorksheet.newConditionalFormattingRule()
603
+ * .whenCellNotEmpty()
604
+ * .setFontColor('#FF0000')
605
+ * .setRanges([fRange.getRange()])
606
+ * .build();
607
+ * fWorksheet.addConditionalFormattingRule(rule);
608
+ * ```
609
+ */
610
+ whenCellNotEmpty() {
611
+ const ruleConfig = this._ruleConfig;
612
+ ruleConfig.type = CFRuleType.highlightCell;
613
+ ruleConfig.subType = CFSubRuleType.text;
614
+ ruleConfig.value = "";
615
+ ruleConfig.operator = CFTextOperator.notEqual;
616
+ return this;
617
+ }
618
+ /**
619
+ * Sets the conditional format rule to trigger when a time period is met.
620
+ * @param {CFTimePeriodOperator} date - The time period to check for.
621
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
622
+ * @example
623
+ * ```typescript
624
+ * const fWorkbook = univerAPI.getActiveWorkbook();
625
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
626
+ * if (!fWorksheet) return;
627
+ *
628
+ * // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
629
+ * const fRange = fWorksheet.getRange('A1:D10');
630
+ * const rule = fWorksheet.newConditionalFormattingRule()
631
+ * .whenDate(univerAPI.Enum.ConditionFormatTimePeriodOperatorEnum.last7Days)
632
+ * .setBackground('#FF0000')
633
+ * .setRanges([fRange.getRange()])
634
+ * .build();
635
+ * fWorksheet.addConditionalFormattingRule(rule);
636
+ * ```
637
+ */
638
+ whenDate(date) {
639
+ const ruleConfig = this._ruleConfig;
640
+ ruleConfig.type = CFRuleType.highlightCell;
641
+ ruleConfig.subType = CFSubRuleType.timePeriod;
642
+ ruleConfig.operator = date;
643
+ return this;
644
+ }
645
+ /**
646
+ * Sets the conditional format rule to trigger when that the given formula evaluates to `true`.
647
+ * @param {string} formulaString - A custom formula that evaluates to true if the input is valid. formulaString start with '='.
648
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
649
+ * @example
650
+ * ```typescript
651
+ * const fWorkbook = univerAPI.getActiveWorkbook();
652
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
653
+ * if (!fWorksheet) return;
654
+ *
655
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
656
+ * const fRange = fWorksheet.getRange('A1:D10');
657
+ * const rule = fWorksheet.newConditionalFormattingRule()
658
+ * .whenFormulaSatisfied('=A1>10')
659
+ * .setBackground('#FF0000')
660
+ * .setRanges([fRange.getRange()])
661
+ * .build();
662
+ * fWorksheet.addConditionalFormattingRule(rule);
663
+ * ```
664
+ */
665
+ whenFormulaSatisfied(formulaString) {
666
+ const ruleConfig = this._ruleConfig;
667
+ ruleConfig.type = CFRuleType.highlightCell;
668
+ ruleConfig.subType = CFSubRuleType.formula;
669
+ ruleConfig.value = formulaString;
670
+ return this;
671
+ }
672
+ /**
673
+ * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
674
+ * @param {number} start - The lowest acceptable value.
675
+ * @param {number} end - The highest acceptable value.
676
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
677
+ * @example
678
+ * ```typescript
679
+ * const fWorkbook = univerAPI.getActiveWorkbook();
680
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
681
+ * if (!fWorksheet) return;
682
+ *
683
+ * // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
684
+ * const fRange = fWorksheet.getRange('A1:D10');
685
+ * const rule = fWorksheet.newConditionalFormattingRule()
686
+ * .whenNumberBetween(10, 20)
687
+ * .setBackground('#FF0000')
688
+ * .setRanges([fRange.getRange()])
689
+ * .build();
690
+ * fWorksheet.addConditionalFormattingRule(rule);
691
+ * ```
692
+ */
693
+ whenNumberBetween(start, end) {
694
+ const min = Math.min(start, end);
695
+ const max = Math.max(start, end);
696
+ const ruleConfig = this._ruleConfig;
697
+ ruleConfig.type = CFRuleType.highlightCell;
698
+ ruleConfig.subType = CFSubRuleType.number;
699
+ ruleConfig.value = [min, max];
700
+ ruleConfig.operator = CFNumberOperator.between;
701
+ return this;
702
+ }
703
+ /**
704
+ * Sets the conditional format rule to trigger when a number is equal to the given value.
705
+ * @param {number} value - The sole acceptable value.
706
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
707
+ * @example
708
+ * ```typescript
709
+ * const fWorkbook = univerAPI.getActiveWorkbook();
710
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
711
+ * if (!fWorksheet) return;
712
+ *
713
+ * // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
714
+ * const fRange = fWorksheet.getRange('A1:D10');
715
+ * const rule = fWorksheet.newConditionalFormattingRule()
716
+ * .whenNumberEqualTo(10)
717
+ * .setBackground('#FF0000')
718
+ * .setRanges([fRange.getRange()])
719
+ * .build();
720
+ * fWorksheet.addConditionalFormattingRule(rule);
721
+ * ```
722
+ */
723
+ whenNumberEqualTo(value) {
724
+ const ruleConfig = this._ruleConfig;
725
+ ruleConfig.type = CFRuleType.highlightCell;
726
+ ruleConfig.subType = CFSubRuleType.number;
727
+ ruleConfig.value = value;
728
+ ruleConfig.operator = CFNumberOperator.equal;
729
+ return this;
730
+ }
731
+ /**
732
+ * Sets the conditional format rule to trigger when a number is greater than the given value.
733
+ * @param {number} value - The highest unacceptable value.
734
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
735
+ * @example
736
+ * ```typescript
737
+ * const fWorkbook = univerAPI.getActiveWorkbook();
738
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
739
+ * if (!fWorksheet) return;
740
+ *
741
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
742
+ * const fRange = fWorksheet.getRange('A1:D10');
743
+ * const rule = fWorksheet.newConditionalFormattingRule()
744
+ * .whenNumberGreaterThan(10)
745
+ * .setBackground('#FF0000')
746
+ * .setRanges([fRange.getRange()])
747
+ * .build();
748
+ * fWorksheet.addConditionalFormattingRule(rule);
749
+ * ```
750
+ */
751
+ whenNumberGreaterThan(value) {
752
+ const ruleConfig = this._ruleConfig;
753
+ ruleConfig.type = CFRuleType.highlightCell;
754
+ ruleConfig.subType = CFSubRuleType.number;
755
+ ruleConfig.value = value;
756
+ ruleConfig.operator = CFNumberOperator.greaterThan;
757
+ return this;
758
+ }
759
+ /**
760
+ * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.
761
+ * @param {number} value - The lowest acceptable value.
762
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
763
+ * @example
764
+ * ```typescript
765
+ * const fWorkbook = univerAPI.getActiveWorkbook();
766
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
767
+ * if (!fWorksheet) return;
768
+ *
769
+ * // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
770
+ * const fRange = fWorksheet.getRange('A1:D10');
771
+ * const rule = fWorksheet.newConditionalFormattingRule()
772
+ * .whenNumberGreaterThanOrEqualTo(10)
773
+ * .setBackground('#FF0000')
774
+ * .setRanges([fRange.getRange()])
775
+ * .build();
776
+ * fWorksheet.addConditionalFormattingRule(rule);
777
+ * ```
778
+ */
779
+ whenNumberGreaterThanOrEqualTo(value) {
780
+ const ruleConfig = this._ruleConfig;
781
+ ruleConfig.type = CFRuleType.highlightCell;
782
+ ruleConfig.subType = CFSubRuleType.number;
783
+ ruleConfig.value = value;
784
+ ruleConfig.operator = CFNumberOperator.greaterThanOrEqual;
785
+ return this;
786
+ }
787
+ /**
788
+ * Sets the conditional conditional format rule to trigger when a number less than the given value.
789
+ * @param {number} value - The lowest unacceptable value.
790
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
791
+ * @example
792
+ * ```typescript
793
+ * const fWorkbook = univerAPI.getActiveWorkbook();
794
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
795
+ * if (!fWorksheet) return;
796
+ *
797
+ * // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
798
+ * const fRange = fWorksheet.getRange('A1:D10');
799
+ * const rule = fWorksheet.newConditionalFormattingRule()
800
+ * .whenNumberLessThan(10)
801
+ * .setBackground('#FF0000')
802
+ * .setRanges([fRange.getRange()])
803
+ * .build();
804
+ * fWorksheet.addConditionalFormattingRule(rule);
805
+ * ```
806
+ */
807
+ whenNumberLessThan(value) {
808
+ const ruleConfig = this._ruleConfig;
809
+ ruleConfig.type = CFRuleType.highlightCell;
810
+ ruleConfig.subType = CFSubRuleType.number;
811
+ ruleConfig.value = value;
812
+ ruleConfig.operator = CFNumberOperator.lessThan;
813
+ return this;
814
+ }
815
+ /**
816
+ * Sets the conditional format rule to trigger when a number less than or equal to the given value.
817
+ * @param {number} value - The highest acceptable value.
818
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
819
+ * @example
820
+ * ```typescript
821
+ * const fWorkbook = univerAPI.getActiveWorkbook();
822
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
823
+ * if (!fWorksheet) return;
824
+ *
825
+ * // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
826
+ * const fRange = fWorksheet.getRange('A1:D10');
827
+ * const rule = fWorksheet.newConditionalFormattingRule()
828
+ * .whenNumberLessThanOrEqualTo(10)
829
+ * .setBackground('#FF0000')
830
+ * .setRanges([fRange.getRange()])
831
+ * .build();
832
+ * fWorksheet.addConditionalFormattingRule(rule);
833
+ * ```
834
+ */
835
+ whenNumberLessThanOrEqualTo(value) {
836
+ const ruleConfig = this._ruleConfig;
837
+ ruleConfig.type = CFRuleType.highlightCell;
838
+ ruleConfig.subType = CFSubRuleType.number;
839
+ ruleConfig.value = value;
840
+ ruleConfig.operator = CFNumberOperator.lessThanOrEqual;
841
+ return this;
842
+ }
843
+ /**
844
+ * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
845
+ * @param {number} start - The lowest unacceptable value.
846
+ * @param {number} end - The highest unacceptable value.
847
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
848
+ * @example
849
+ * ```typescript
850
+ * const fWorkbook = univerAPI.getActiveWorkbook();
851
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
852
+ * if (!fWorksheet) return;
853
+ *
854
+ * // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
855
+ * const fRange = fWorksheet.getRange('A1:D10');
856
+ * const rule = fWorksheet.newConditionalFormattingRule()
857
+ * .whenNumberNotBetween(10, 20)
858
+ * .setBackground('#FF0000')
859
+ * .setRanges([fRange.getRange()])
860
+ * .build();
861
+ * fWorksheet.addConditionalFormattingRule(rule);
862
+ * ```
863
+ */
864
+ whenNumberNotBetween(start, end) {
865
+ const min = Math.min(start, end);
866
+ const max = Math.max(start, end);
867
+ const ruleConfig = this._ruleConfig;
868
+ ruleConfig.type = CFRuleType.highlightCell;
869
+ ruleConfig.subType = CFSubRuleType.number;
870
+ ruleConfig.value = [min, max];
871
+ ruleConfig.operator = CFNumberOperator.notBetween;
872
+ return this;
873
+ }
874
+ /**
875
+ * Sets the conditional format rule to trigger when a number is not equal to the given value.
876
+ * @param {number} value - The sole unacceptable value.
877
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
878
+ * @example
879
+ * ```typescript
880
+ * const fWorkbook = univerAPI.getActiveWorkbook();
881
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
882
+ * if (!fWorksheet) return;
883
+ *
884
+ * // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
885
+ * const fRange = fWorksheet.getRange('A1:D10');
886
+ * const rule = fWorksheet.newConditionalFormattingRule()
887
+ * .whenNumberNotEqualTo(10)
888
+ * .setBackground('#FF0000')
889
+ * .setRanges([fRange.getRange()])
890
+ * .build();
891
+ * fWorksheet.addConditionalFormattingRule(rule);
892
+ * ```
893
+ */
894
+ whenNumberNotEqualTo(value) {
895
+ const ruleConfig = this._ruleConfig;
896
+ ruleConfig.type = CFRuleType.highlightCell;
897
+ ruleConfig.subType = CFSubRuleType.number;
898
+ ruleConfig.value = value;
899
+ ruleConfig.operator = CFNumberOperator.notEqual;
900
+ return this;
901
+ }
902
+ /**
903
+ * Sets the conditional format rule to trigger when that the input contains the given value.
904
+ * @param {string} text - The value that the input must contain.
905
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
906
+ * @example
907
+ * ```typescript
908
+ * const fWorkbook = univerAPI.getActiveWorkbook();
909
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
910
+ * if (!fWorksheet) return;
911
+ *
912
+ * // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
913
+ * const fRange = fWorksheet.getRange('A1:D10');
914
+ * const rule = fWorksheet.newConditionalFormattingRule()
915
+ * .whenTextContains('apple')
916
+ * .setBackground('#FF0000')
917
+ * .setRanges([fRange.getRange()])
918
+ * .build();
919
+ * fWorksheet.addConditionalFormattingRule(rule);
920
+ * ```
921
+ */
922
+ whenTextContains(text) {
923
+ const ruleConfig = this._ruleConfig;
924
+ ruleConfig.type = CFRuleType.highlightCell;
925
+ ruleConfig.subType = CFSubRuleType.text;
926
+ ruleConfig.value = text;
927
+ ruleConfig.operator = CFTextOperator.containsText;
928
+ return this;
929
+ }
930
+ /**
931
+ * Sets the conditional format rule to trigger when that the input does not contain the given value.
932
+ * @param {string} text - The value that the input must not contain.
933
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
934
+ * @example
935
+ * ```typescript
936
+ * const fWorkbook = univerAPI.getActiveWorkbook();
937
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
938
+ * if (!fWorksheet) return;
939
+ *
940
+ * // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
941
+ * const fRange = fWorksheet.getRange('A1:D10');
942
+ * const rule = fWorksheet.newConditionalFormattingRule()
943
+ * .whenTextDoesNotContain('apple')
944
+ * .setBackground('#FF0000')
945
+ * .setRanges([fRange.getRange()])
946
+ * .build();
947
+ * fWorksheet.addConditionalFormattingRule(rule);
948
+ * ```
949
+ */
950
+ whenTextDoesNotContain(text) {
951
+ const ruleConfig = this._ruleConfig;
952
+ ruleConfig.type = CFRuleType.highlightCell;
953
+ ruleConfig.subType = CFSubRuleType.text;
954
+ ruleConfig.value = text;
955
+ ruleConfig.operator = CFTextOperator.notContainsText;
956
+ return this;
957
+ }
958
+ /**
959
+ * Sets the conditional format rule to trigger when that the input ends with the given value.
960
+ * @param {string} text - Text to compare against the end of the string.
961
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
962
+ * @example
963
+ * ```typescript
964
+ * const fWorkbook = univerAPI.getActiveWorkbook();
965
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
966
+ * if (!fWorksheet) return;
967
+ *
968
+ * // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
969
+ * const fRange = fWorksheet.getRange('A1:D10');
970
+ * const rule = fWorksheet.newConditionalFormattingRule()
971
+ * .whenTextEndsWith('.ai')
972
+ * .setBackground('#FF0000')
973
+ * .setRanges([fRange.getRange()])
974
+ * .build();
975
+ * fWorksheet.addConditionalFormattingRule(rule);
976
+ * ```
977
+ */
978
+ whenTextEndsWith(text) {
979
+ const ruleConfig = this._ruleConfig;
980
+ ruleConfig.type = CFRuleType.highlightCell;
981
+ ruleConfig.subType = CFSubRuleType.text;
982
+ ruleConfig.value = text;
983
+ ruleConfig.operator = CFTextOperator.endsWith;
984
+ return this;
985
+ }
986
+ /**
987
+ * Sets the conditional format rule to trigger when that the input is equal to the given value.
988
+ * @param {string} text - The sole acceptable value.
989
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
990
+ * @example
991
+ * ```typescript
992
+ * const fWorkbook = univerAPI.getActiveWorkbook();
993
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
994
+ * if (!fWorksheet) return;
995
+ *
996
+ * // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
997
+ * const fRange = fWorksheet.getRange('A1:D10');
998
+ * const rule = fWorksheet.newConditionalFormattingRule()
999
+ * .whenTextEqualTo('apple')
1000
+ * .setBackground('#FF0000')
1001
+ * .setRanges([fRange.getRange()])
1002
+ * .build();
1003
+ * fWorksheet.addConditionalFormattingRule(rule);
1004
+ * ```
1005
+ */
1006
+ whenTextEqualTo(text) {
1007
+ const ruleConfig = this._ruleConfig;
1008
+ ruleConfig.type = CFRuleType.highlightCell;
1009
+ ruleConfig.subType = CFSubRuleType.text;
1010
+ ruleConfig.value = text;
1011
+ ruleConfig.operator = CFTextOperator.equal;
1012
+ return this;
1013
+ }
1014
+ /**
1015
+ * Sets the conditional format rule to trigger when that the input starts with the given value.
1016
+ * @param {string} text - Text to compare against the beginning of the string.
1017
+ * @returns {ConditionalFormatHighlightRuleBuilder} This builder for chaining.
1018
+ * @example
1019
+ * ```typescript
1020
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1021
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1022
+ * if (!fWorksheet) return;
1023
+ *
1024
+ * // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
1025
+ * const fRange = fWorksheet.getRange('A1:D10');
1026
+ * const rule = fWorksheet.newConditionalFormattingRule()
1027
+ * .whenTextStartsWith('https://')
1028
+ * .setBackground('#FF0000')
1029
+ * .setRanges([fRange.getRange()])
1030
+ * .build();
1031
+ * fWorksheet.addConditionalFormattingRule(rule);
1032
+ * ```
1033
+ */
1034
+ whenTextStartsWith(text) {
1035
+ const ruleConfig = this._ruleConfig;
1036
+ ruleConfig.type = CFRuleType.highlightCell;
1037
+ ruleConfig.subType = CFSubRuleType.text;
1038
+ ruleConfig.value = text;
1039
+ ruleConfig.operator = CFTextOperator.beginsWith;
1040
+ return this;
1041
+ }
1042
+ };
1043
+ var ConditionalFormatDataBarRuleBuilder = class ConditionalFormatDataBarRuleBuilder extends ConditionalFormatRuleBaseBuilder {
1044
+ /**
1045
+ * Deep clone a current builder.
1046
+ * @returns {ConditionalFormatDataBarRuleBuilder} A new instance of the builder with the same settings as the original.
1047
+ * @example
1048
+ * ```typescript
1049
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1050
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1051
+ * if (!fWorksheet) return;
1052
+ *
1053
+ * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
1054
+ * // positive values are green and negative values are red.
1055
+ * const fRange = fWorksheet.getRange('A1:D10');
1056
+ * const builder = fWorksheet.newConditionalFormattingRule()
1057
+ * .setDataBar({
1058
+ * min: { type: 'num', value: -100 },
1059
+ * max: { type: 'num', value: 100 },
1060
+ * positiveColor: '#00FF00',
1061
+ * nativeColor: '#FF0000',
1062
+ * isShowValue: true
1063
+ * })
1064
+ * .setRanges([fRange.getRange()]);
1065
+ * fWorksheet.addConditionalFormattingRule(builder.build());
1066
+ *
1067
+ * // Copy the rule and apply it to a new range.
1068
+ * const newRange = fWorksheet.getRange('F1:F10');
1069
+ * const newBuilder = builder.copy()
1070
+ * .setRanges([newRange.getRange()]);
1071
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
1072
+ * ```
1073
+ */
1074
+ copy() {
1075
+ const newRule = Tools.deepClone(this._rule);
1076
+ if (newRule.cfId) newRule.cfId = createCfId();
1077
+ return new ConditionalFormatDataBarRuleBuilder(newRule);
1078
+ }
1079
+ /**
1080
+ * Set data bar rule.
1081
+ * @param {object} config - The data bar rule settings.
1082
+ * @param {IValueConfig} config.min - The minimum value for the data bar.
1083
+ * @param {IValueConfig} config.max - The maximum value for the data bar.
1084
+ * @param {boolean} [config.isGradient] - Whether the data bar is gradient.
1085
+ * @param {string} config.positiveColor - The color for positive values.
1086
+ * @param {string} config.nativeColor - The color for negative values.
1087
+ * @param {boolean} [config.isShowValue] - Whether to show the value in the cell.
1088
+ * @returns {ConditionalFormatDataBarRuleBuilder} This builder for chaining.
1089
+ * @example
1090
+ * ```typescript
1091
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1092
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1093
+ * if (!fWorksheet) return;
1094
+ *
1095
+ * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
1096
+ * // positive values are green and negative values are red.
1097
+ * const fRange = fWorksheet.getRange('A1:D10');
1098
+ * const rule = fWorksheet.newConditionalFormattingRule()
1099
+ * .setDataBar({
1100
+ * min: { type: 'num', value: -100 },
1101
+ * max: { type: 'num', value: 100 },
1102
+ * positiveColor: '#00FF00',
1103
+ * nativeColor: '#FF0000',
1104
+ * isShowValue: true
1105
+ * })
1106
+ * .setRanges([fRange.getRange()])
1107
+ * .build();
1108
+ * fWorksheet.addConditionalFormattingRule(rule);
1109
+ * ```
1110
+ */
1111
+ setDataBar(config) {
1112
+ const ruleConfig = this._ruleConfig;
1113
+ ruleConfig.type = CFRuleType.dataBar;
1114
+ ruleConfig.isShowValue = !!config.isShowValue;
1115
+ ruleConfig.config = {
1116
+ min: config.min,
1117
+ max: config.max,
1118
+ positiveColor: config.positiveColor,
1119
+ nativeColor: config.nativeColor,
1120
+ isGradient: !!config.isGradient
1121
+ };
1122
+ return this;
1123
+ }
1124
+ };
1125
+ var ConditionalFormatColorScaleRuleBuilder = class ConditionalFormatColorScaleRuleBuilder extends ConditionalFormatRuleBaseBuilder {
1126
+ /**
1127
+ * Deep clone a current builder.
1128
+ * @returns {ConditionalFormatColorScaleRuleBuilder} A new instance of the builder with the same settings as the original.
1129
+ * @example
1130
+ * ```typescript
1131
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1132
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1133
+ * if (!fWorksheet) return;
1134
+ *
1135
+ * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
1136
+ * // The color scale is green for 0, yellow for 50, and red for 100.
1137
+ * const fRange = fWorksheet.getRange('A1:D10');
1138
+ * const builder = fWorksheet.newConditionalFormattingRule()
1139
+ * .setColorScale([
1140
+ * { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
1141
+ * { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
1142
+ * { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
1143
+ * ])
1144
+ * .setRanges([fRange.getRange()]);
1145
+ * fWorksheet.addConditionalFormattingRule(builder.build());
1146
+ *
1147
+ * // Copy the rule and apply it to a new range.
1148
+ * const newRange = fWorksheet.getRange('F1:F10');
1149
+ * const newBuilder = builder.copy()
1150
+ * .setRanges([newRange.getRange()]);
1151
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
1152
+ * ```
1153
+ */
1154
+ copy() {
1155
+ const newRule = Tools.deepClone(this._rule);
1156
+ if (newRule.cfId) newRule.cfId = createCfId();
1157
+ return new ConditionalFormatColorScaleRuleBuilder(newRule);
1158
+ }
1159
+ /**
1160
+ * Set color scale rule.
1161
+ * @param {{ index: number; color: string; value: IValueConfig }[]} config - The color scale rule settings.
1162
+ * @param {number} config.index - The index of the color scale configuration.
1163
+ * @param {string} config.color - The color corresponding to the index of the color scale configuration.
1164
+ * @param {IValueConfig} config.value - The condition value corresponding to the index of the color scale configuration.
1165
+ * @returns {ConditionalFormatColorScaleRuleBuilder} This builder for chaining.
1166
+ * @example
1167
+ * ```typescript
1168
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1169
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1170
+ * if (!fWorksheet) return;
1171
+ *
1172
+ * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
1173
+ * // The color scale is green for 0, yellow for 50, and red for 100.
1174
+ * const fRange = fWorksheet.getRange('A1:D10');
1175
+ * const rule = fWorksheet.newConditionalFormattingRule()
1176
+ * .setColorScale([
1177
+ * { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
1178
+ * { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
1179
+ * { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
1180
+ * ])
1181
+ * .setRanges([fRange.getRange()])
1182
+ * .build();
1183
+ * fWorksheet.addConditionalFormattingRule(rule);
1184
+ * ```
1185
+ */
1186
+ setColorScale(config) {
1187
+ const ruleConfig = this._ruleConfig;
1188
+ ruleConfig.type = CFRuleType.colorScale;
1189
+ ruleConfig.config = config;
1190
+ return this;
1191
+ }
1192
+ };
1193
+ var ConditionalFormatIconSetRuleBuilder = class ConditionalFormatIconSetRuleBuilder extends ConditionalFormatRuleBaseBuilder {
1194
+ /**
1195
+ * Deep clone a current builder.
1196
+ * @returns {ConditionalFormatIconSetRuleBuilder} A new instance of the builder with the same settings as the original.
1197
+ * @example
1198
+ * ```typescript
1199
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1200
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1201
+ * if (!fWorksheet) return;
1202
+ *
1203
+ * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
1204
+ * // The first arrow is green for values greater than 20.
1205
+ * // The second arrow is yellow for values greater than 10.
1206
+ * // The third arrow is red for values less than or equal to 10.
1207
+ * const fRange = fWorksheet.getRange('A1:D10');
1208
+ * const builder = fWorksheet.newConditionalFormattingRule()
1209
+ * .setIconSet({
1210
+ * iconConfigs: [
1211
+ * {
1212
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1213
+ * iconId: '0',
1214
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1215
+ * value: {
1216
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1217
+ * value: 20
1218
+ * }
1219
+ * },
1220
+ * {
1221
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1222
+ * iconId: '1',
1223
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1224
+ * value: {
1225
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1226
+ * value: 10
1227
+ * }
1228
+ * },
1229
+ * {
1230
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1231
+ * iconId: '2',
1232
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1233
+ * value: {
1234
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1235
+ * value: 10
1236
+ * }
1237
+ * }
1238
+ * ],
1239
+ * isShowValue: true,
1240
+ * })
1241
+ * .setRanges([fRange.getRange()]);
1242
+ * fWorksheet.addConditionalFormattingRule(builder.build());
1243
+ *
1244
+ * // Copy the rule and apply it to a new range.
1245
+ * const newRange = fWorksheet.getRange('F1:F10');
1246
+ * const newBuilder = builder.copy()
1247
+ * .setRanges([newRange.getRange()]);
1248
+ * fWorksheet.addConditionalFormattingRule(newBuilder.build());
1249
+ * ```
1250
+ */
1251
+ copy() {
1252
+ const newRule = Tools.deepClone(this._rule);
1253
+ if (newRule.cfId) newRule.cfId = createCfId();
1254
+ return new ConditionalFormatIconSetRuleBuilder(newRule);
1255
+ }
1256
+ /**
1257
+ * Set up icon set conditional formatting rule.
1258
+ * @param {{ iconConfigs: IIconSet['config'], isShowValue: boolean }} config - The icon set conditional formatting rule settings.
1259
+ * @param {IIconSet['config']} config.iconConfigs - The icon configurations. iconId property is a string indexing of a group icons.
1260
+ * @param {boolean} config.isShowValue - Whether to show the value in the cell.
1261
+ * @returns {ConditionalFormatIconSetRuleBuilder} This builder for chaining.
1262
+ * @example
1263
+ * ```typescript
1264
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1265
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1266
+ * if (!fWorksheet) return;
1267
+ *
1268
+ * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
1269
+ * // The first arrow is green for values greater than 20.
1270
+ * // The second arrow is yellow for values greater than 10.
1271
+ * // The third arrow is red for values less than or equal to 10.
1272
+ * const fRange = fWorksheet.getRange('A1:D10');
1273
+ * const builder = fWorksheet.newConditionalFormattingRule();
1274
+ * console.log(builder.getIconMap()); // icons key-value map
1275
+ * const rule = builder.setIconSet({
1276
+ * iconConfigs: [
1277
+ * {
1278
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1279
+ * iconId: '0',
1280
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1281
+ * value: {
1282
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1283
+ * value: 20
1284
+ * }
1285
+ * },
1286
+ * {
1287
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1288
+ * iconId: '1',
1289
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1290
+ * value: {
1291
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1292
+ * value: 10
1293
+ * }
1294
+ * },
1295
+ * {
1296
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1297
+ * iconId: '2',
1298
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1299
+ * value: {
1300
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1301
+ * value: 10
1302
+ * }
1303
+ * }
1304
+ * ],
1305
+ * isShowValue: true,
1306
+ * })
1307
+ * .setRanges([fRange.getRange()])
1308
+ * .build();
1309
+ * fWorksheet.addConditionalFormattingRule(rule);
1310
+ * ```
1311
+ */
1312
+ setIconSet(config) {
1313
+ const ruleConfig = this._ruleConfig;
1314
+ ruleConfig.type = CFRuleType.iconSet;
1315
+ ruleConfig.config = config.iconConfigs;
1316
+ ruleConfig.isShowValue = config.isShowValue;
1317
+ return this;
1318
+ }
1319
+ };
1320
+ /**
1321
+ * @hideconstructor
1322
+ */
1323
+ var FConditionalFormattingBuilder = class {
1324
+ constructor(_initConfig = {}) {
1325
+ this._initConfig = _initConfig;
1326
+ }
1327
+ /**
1328
+ * Constructs a conditional format rule from the settings applied to the builder.
1329
+ * @returns {IConditionFormattingRule} The conditional format rule.
1330
+ * @example
1331
+ * ```typescript
1332
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1333
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1334
+ * if (!fWorksheet) return;
1335
+ *
1336
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
1337
+ * const fRange = fWorksheet.getRange('A1:D10');
1338
+ * const rule = fWorksheet.newConditionalFormattingRule()
1339
+ * .whenNumberGreaterThan(10)
1340
+ * .setBackground('#FF0000')
1341
+ * .setRanges([fRange.getRange()])
1342
+ * .build();
1343
+ * fWorksheet.addConditionalFormattingRule(rule);
1344
+ * ```
1345
+ */
1346
+ build() {
1347
+ return new ConditionalFormatRuleBaseBuilder(this._initConfig).build();
1348
+ }
1349
+ /**
1350
+ * Set average rule.
1351
+ * @param {IAverageHighlightCell['operator']} operator - The operator to use for the average rule.
1352
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1353
+ * @example
1354
+ * ```typescript
1355
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1356
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1357
+ * if (!fWorksheet) return;
1358
+ *
1359
+ * // Create a conditional formatting rule that highlights cells with greater than average values in red for the range A1:D10.
1360
+ * const fRange = fWorksheet.getRange('A1:D10');
1361
+ * const rule = fWorksheet.newConditionalFormattingRule()
1362
+ * .setAverage(univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan)
1363
+ * .setBackground('#FF0000')
1364
+ * .setRanges([fRange.getRange()])
1365
+ * .build();
1366
+ * fWorksheet.addConditionalFormattingRule(rule);
1367
+ * ```
1368
+ */
1369
+ setAverage(operator) {
1370
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setAverage(operator);
1371
+ }
1372
+ /**
1373
+ * Set unique values rule.
1374
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1375
+ * @example
1376
+ * ```typescript
1377
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1378
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1379
+ * if (!fWorksheet) return;
1380
+ *
1381
+ * // Create a conditional formatting rule that highlights cells with unique values in red for the range A1:D10.
1382
+ * const fRange = fWorksheet.getRange('A1:D10');
1383
+ * const rule = fWorksheet.newConditionalFormattingRule()
1384
+ * .setUniqueValues()
1385
+ * .setBackground('#FF0000')
1386
+ * .setRanges([fRange.getRange()])
1387
+ * .build();
1388
+ * fWorksheet.addConditionalFormattingRule(rule);
1389
+ * ```
1390
+ */
1391
+ setUniqueValues() {
1392
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setUniqueValues();
1393
+ }
1394
+ /**
1395
+ * Set duplicate values rule.
1396
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1397
+ * @example
1398
+ * ```typescript
1399
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1400
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1401
+ * if (!fWorksheet) return;
1402
+ *
1403
+ * // Create a conditional formatting rule that highlights cells with duplicate values in red for the range A1:D10.
1404
+ * const fRange = fWorksheet.getRange('A1:D10');
1405
+ * const rule = fWorksheet.newConditionalFormattingRule()
1406
+ * .setDuplicateValues()
1407
+ * .setBackground('#FF0000')
1408
+ * .setRanges([fRange.getRange()])
1409
+ * .build();
1410
+ * fWorksheet.addConditionalFormattingRule(rule);
1411
+ * ```
1412
+ */
1413
+ setDuplicateValues() {
1414
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setDuplicateValues();
1415
+ }
1416
+ /**
1417
+ * Set rank rule.
1418
+ * @param {{ isBottom: boolean, isPercent: boolean, value: number }} config - The rank rule settings.
1419
+ * @param {boolean} config.isBottom - Whether to highlight the bottom rank.
1420
+ * @param {boolean} config.isPercent - Whether to use a percentage rank.
1421
+ * @param {number} config.value - The rank value.
1422
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1423
+ * @example
1424
+ * ```typescript
1425
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1426
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1427
+ * if (!fWorksheet) return;
1428
+ *
1429
+ * // Create a conditional formatting rule that highlights the bottom 10% of values in red for the range A1:D10.
1430
+ * const fRange = fWorksheet.getRange('A1:D10');
1431
+ * const rule = fWorksheet.newConditionalFormattingRule()
1432
+ * .setRank({ isBottom: true, isPercent: true, value: 10 })
1433
+ * .setBackground('#FF0000')
1434
+ * .setRanges([fRange.getRange()])
1435
+ * .build();
1436
+ * fWorksheet.addConditionalFormattingRule(rule);
1437
+ * ```
1438
+ */
1439
+ setRank(config) {
1440
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setRank(config);
1441
+ }
1442
+ /**
1443
+ * Get the icon set mapping dictionary.
1444
+ * @returns {Record<string, string[]>} The icon set mapping dictionary.
1445
+ * @example
1446
+ * ```typescript
1447
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1448
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1449
+ * if (!fWorksheet) return;
1450
+ * console.log(fWorksheet.newConditionalFormattingRule().getIconMap()); // icons key-value map
1451
+ * ```
1452
+ */
1453
+ getIconMap() {
1454
+ return iconMap;
1455
+ }
1456
+ /**
1457
+ * Set up icon set conditional formatting rule.
1458
+ * @param {{ iconConfigs: IIconSet['config'], isShowValue: boolean }} config - The icon set conditional formatting rule settings.
1459
+ * @param {IIconSet['config']} config.iconConfigs - The icon configurations. iconId property is a string indexing of a group icons.
1460
+ * @param {boolean} config.isShowValue - Whether to show the value in the cell.
1461
+ * @returns {ConditionalFormatIconSetRuleBuilder} The conditional format icon set rule builder.
1462
+ * @example
1463
+ * ```typescript
1464
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1465
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1466
+ * if (!fWorksheet) return;
1467
+ *
1468
+ * // Create a 3-arrow icon set conditional formatting rule in the range A1:D10.
1469
+ * // The first arrow is green for values greater than 20.
1470
+ * // The second arrow is yellow for values greater than 10.
1471
+ * // The third arrow is red for values less than or equal to 10.
1472
+ * const fRange = fWorksheet.getRange('A1:D10');
1473
+ * const builder = fWorksheet.newConditionalFormattingRule();
1474
+ * console.log(builder.getIconMap()); // icons key-value map
1475
+ * const rule = builder.setIconSet({
1476
+ * iconConfigs: [
1477
+ * {
1478
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1479
+ * iconId: '0',
1480
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1481
+ * value: {
1482
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1483
+ * value: 20
1484
+ * }
1485
+ * },
1486
+ * {
1487
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1488
+ * iconId: '1',
1489
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.greaterThan,
1490
+ * value: {
1491
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1492
+ * value: 10
1493
+ * }
1494
+ * },
1495
+ * {
1496
+ * iconType: univerAPI.Enum.ConditionFormatIconSetTypeEnum.threeArrows,
1497
+ * iconId: '2',
1498
+ * operator: univerAPI.Enum.ConditionFormatNumberOperatorEnum.lessThanOrEqual,
1499
+ * value: {
1500
+ * type: univerAPI.Enum.ConditionFormatValueTypeEnum.num,
1501
+ * value: 10
1502
+ * }
1503
+ * }
1504
+ * ],
1505
+ * isShowValue: true,
1506
+ * })
1507
+ * .setRanges([fRange.getRange()])
1508
+ * .build();
1509
+ * fWorksheet.addConditionalFormattingRule(rule);
1510
+ * ```
1511
+ */
1512
+ setIconSet(config) {
1513
+ return new ConditionalFormatIconSetRuleBuilder(this._initConfig).setIconSet(config);
1514
+ }
1515
+ /**
1516
+ * Set color scale rule.
1517
+ * @param {{ index: number; color: string; value: IValueConfig }[]} config - The color scale rule settings.
1518
+ * @param {number} config.index - The index of the color scale.
1519
+ * @param {string} config.color - The color for the color scale.
1520
+ * @param {IValueConfig} config.value - The value for the color scale.
1521
+ * @returns {ConditionalFormatColorScaleRuleBuilder} The conditional format color scale rule builder.
1522
+ * @example
1523
+ * ```typescript
1524
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1525
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1526
+ * if (!fWorksheet) return;
1527
+ *
1528
+ * // Create a conditional formatting rule that adds a color scale to cells with values between 0 and 100 in the range A1:D10.
1529
+ * // The color scale is green for 0, yellow for 50, and red for 100.
1530
+ * const fRange = fWorksheet.getRange('A1:D10');
1531
+ * const rule = fWorksheet.newConditionalFormattingRule()
1532
+ * .setColorScale([
1533
+ * { index: 0, color: '#00FF00', value: { type: 'num', value: 0 } },
1534
+ * { index: 1, color: '#FFFF00', value: { type: 'num', value: 50 } },
1535
+ * { index: 2, color: '#FF0000', value: { type: 'num', value: 100 } }
1536
+ * ])
1537
+ * .setRanges([fRange.getRange()])
1538
+ * .build();
1539
+ * fWorksheet.addConditionalFormattingRule(rule);
1540
+ * ```
1541
+ */
1542
+ setColorScale(config) {
1543
+ return new ConditionalFormatColorScaleRuleBuilder(this._initConfig).setColorScale(config);
1544
+ }
1545
+ /**
1546
+ * Set data bar rule.
1547
+ * @param {object} config - The data bar rule settings.
1548
+ * @param {IValueConfig} config.min - The minimum value for the data bar.
1549
+ * @param {IValueConfig} config.max - The maximum value for the data bar.
1550
+ * @param {boolean} [config.isGradient] - Whether the data bar is gradient.
1551
+ * @param {string} config.positiveColor - The color for positive values.
1552
+ * @param {string} config.nativeColor - The color for negative values.
1553
+ * @param {boolean} [config.isShowValue] - Whether to show the value in the cell.
1554
+ * @returns {ConditionalFormatDataBarRuleBuilder} The conditional format data bar rule builder.
1555
+ * @example
1556
+ * ```typescript
1557
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1558
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1559
+ * if (!fWorksheet) return;
1560
+ *
1561
+ * // Create a conditional formatting rule that adds a data bar to cells with values between -100 and 100 in the range A1:D10.
1562
+ * // positive values are green and negative values are red.
1563
+ * const fRange = fWorksheet.getRange('A1:D10');
1564
+ * const rule = fWorksheet.newConditionalFormattingRule()
1565
+ * .setDataBar({
1566
+ * min: { type: 'num', value: -100 },
1567
+ * max: { type: 'num', value: 100 },
1568
+ * positiveColor: '#00FF00',
1569
+ * nativeColor: '#FF0000',
1570
+ * isShowValue: true
1571
+ * })
1572
+ * .setRanges([fRange.getRange()])
1573
+ * .build();
1574
+ * fWorksheet.addConditionalFormattingRule(rule);
1575
+ * ```
1576
+ */
1577
+ setDataBar(config) {
1578
+ return new ConditionalFormatDataBarRuleBuilder(this._initConfig).setDataBar(config);
1579
+ }
1580
+ /**
1581
+ * Sets the background color for the conditional format rule's format.
1582
+ * @param {string} [color] - The background color to set. If not provided, the background color is removed.
1583
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1584
+ * @example
1585
+ * ```typescript
1586
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1587
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1588
+ * if (!fWorksheet) return;
1589
+ *
1590
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
1591
+ * const fRange = fWorksheet.getRange('A1:D10');
1592
+ * const rule = fWorksheet.newConditionalFormattingRule()
1593
+ * .whenCellEmpty()
1594
+ * .setBackground('#FF0000')
1595
+ * .setRanges([fRange.getRange()])
1596
+ * .build();
1597
+ * fWorksheet.addConditionalFormattingRule(rule);
1598
+ * ```
1599
+ */
1600
+ setBackground(color) {
1601
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setBackground(color);
1602
+ }
1603
+ /**
1604
+ * Sets text bolding for the conditional format rule's format.
1605
+ * @param {boolean} isBold - Whether to bold the text.
1606
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1607
+ * @example
1608
+ * ```typescript
1609
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1610
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1611
+ * if (!fWorksheet) return;
1612
+ *
1613
+ * // Create a conditional formatting rule that bolds the text for cells with not empty content in the range A1:D10.
1614
+ * const fRange = fWorksheet.getRange('A1:D10');
1615
+ * const rule = fWorksheet.newConditionalFormattingRule()
1616
+ * .whenCellNotEmpty()
1617
+ * .setBold(true)
1618
+ * .setRanges([fRange.getRange()])
1619
+ * .build();
1620
+ * fWorksheet.addConditionalFormattingRule(rule);
1621
+ * ```
1622
+ */
1623
+ setBold(isBold) {
1624
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setBold(isBold);
1625
+ }
1626
+ /**
1627
+ * Sets the font color for the conditional format rule's format.
1628
+ * @param {string} [color] - The font color to set. If not provided, the font color is removed.
1629
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1630
+ * @example
1631
+ * ```typescript
1632
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1633
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1634
+ * if (!fWorksheet) return;
1635
+ *
1636
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
1637
+ * const fRange = fWorksheet.getRange('A1:D10');
1638
+ * const rule = fWorksheet.newConditionalFormattingRule()
1639
+ * .whenCellNotEmpty()
1640
+ * .setFontColor('#FF0000')
1641
+ * .setRanges([fRange.getRange()])
1642
+ * .build();
1643
+ * fWorksheet.addConditionalFormattingRule(rule);
1644
+ * ```
1645
+ */
1646
+ setFontColor(color) {
1647
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setFontColor(color);
1648
+ }
1649
+ /**
1650
+ * Sets text italics for the conditional format rule's format.
1651
+ * @param {boolean} isItalic - Whether to italicize the text.
1652
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1653
+ * @example
1654
+ * ```typescript
1655
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1656
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1657
+ * if (!fWorksheet) return;
1658
+ *
1659
+ * // Create a conditional formatting rule that italicizes the text for cells with not empty content in the range A1:D10.
1660
+ * const fRange = fWorksheet.getRange('A1:D10');
1661
+ * const rule = fWorksheet.newConditionalFormattingRule()
1662
+ * .whenCellNotEmpty()
1663
+ * .setItalic(true)
1664
+ * .setRanges([fRange.getRange()])
1665
+ * .build();
1666
+ * fWorksheet.addConditionalFormattingRule(rule);
1667
+ * ```
1668
+ */
1669
+ setItalic(isItalic) {
1670
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setItalic(isItalic);
1671
+ }
1672
+ /**
1673
+ * Sets text strikethrough for the conditional format rule's format.
1674
+ * @param {boolean} isStrikethrough - Whether is strikethrough the text.
1675
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1676
+ * @example
1677
+ * ```typescript
1678
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1679
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1680
+ * if (!fWorksheet) return;
1681
+ *
1682
+ * // Create a conditional formatting rule that set text strikethrough for cells with not empty content in the range A1:D10.
1683
+ * const fRange = fWorksheet.getRange('A1:D10');
1684
+ * const rule = fWorksheet.newConditionalFormattingRule()
1685
+ * .whenCellNotEmpty()
1686
+ * .setStrikethrough(true)
1687
+ * .setRanges([fRange.getRange()])
1688
+ * .build();
1689
+ * fWorksheet.addConditionalFormattingRule(rule);
1690
+ * ```
1691
+ */
1692
+ setStrikethrough(isStrikethrough) {
1693
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setStrikethrough(isStrikethrough);
1694
+ }
1695
+ /**
1696
+ * Sets text underlining for the conditional format rule's format.
1697
+ * @param {boolean} isUnderline - Whether to underline the text.
1698
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1699
+ * @example
1700
+ * ```typescript
1701
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1702
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1703
+ * if (!fWorksheet) return;
1704
+ *
1705
+ * // Create a conditional formatting rule that underlines the text for cells with not empty content in the range A1:D10.
1706
+ * const fRange = fWorksheet.getRange('A1:D10');
1707
+ * const rule = fWorksheet.newConditionalFormattingRule()
1708
+ * .whenCellNotEmpty()
1709
+ * .setUnderline(true)
1710
+ * .setRanges([fRange.getRange()])
1711
+ * .build();
1712
+ * fWorksheet.addConditionalFormattingRule(rule);
1713
+ * ```
1714
+ */
1715
+ setUnderline(isUnderline) {
1716
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setUnderline(isUnderline);
1717
+ }
1718
+ /**
1719
+ * Sets the conditional format rule to trigger when the cell is empty.
1720
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1721
+ * @example
1722
+ * ```typescript
1723
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1724
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1725
+ * if (!fWorksheet) return;
1726
+ *
1727
+ * // Create a conditional formatting rule that highlights cells with no content in red for the range A1:D10.
1728
+ * const fRange = fWorksheet.getRange('A1:D10');
1729
+ * const rule = fWorksheet.newConditionalFormattingRule()
1730
+ * .whenCellEmpty()
1731
+ * .setBackground('#FF0000')
1732
+ * .setRanges([fRange.getRange()])
1733
+ * .build();
1734
+ * fWorksheet.addConditionalFormattingRule(rule);
1735
+ * ```
1736
+ */
1737
+ whenCellEmpty() {
1738
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenCellEmpty();
1739
+ }
1740
+ /**
1741
+ * Sets the conditional format rule to trigger when the cell is not empty.
1742
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1743
+ * @example
1744
+ * ```typescript
1745
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1746
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1747
+ * if (!fWorksheet) return;
1748
+ *
1749
+ * // Create a conditional formatting rule that changes the font color to red for cells with not empty content in the range A1:D10.
1750
+ * const fRange = fWorksheet.getRange('A1:D10');
1751
+ * const rule = fWorksheet.newConditionalFormattingRule()
1752
+ * .whenCellNotEmpty()
1753
+ * .setFontColor('#FF0000')
1754
+ * .setRanges([fRange.getRange()])
1755
+ * .build();
1756
+ * fWorksheet.addConditionalFormattingRule(rule);
1757
+ * ```
1758
+ */
1759
+ whenCellNotEmpty() {
1760
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenCellNotEmpty();
1761
+ }
1762
+ /**
1763
+ * Sets the conditional format rule to trigger when a time period is met.
1764
+ * @param {CFTimePeriodOperator} date - The time period to check for.
1765
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1766
+ * @example
1767
+ * ```typescript
1768
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1769
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1770
+ * if (!fWorksheet) return;
1771
+ *
1772
+ * // Create a conditional formatting rule that highlights cells with dates in the last 7 days in red for the range A1:D10.
1773
+ * const fRange = fWorksheet.getRange('A1:D10');
1774
+ * const rule = fWorksheet.newConditionalFormattingRule()
1775
+ * .whenDate(univerAPI.Enum.ConditionFormatTimePeriodOperatorEnum.last7Days)
1776
+ * .setBackground('#FF0000')
1777
+ * .setRanges([fRange.getRange()])
1778
+ * .build();
1779
+ * fWorksheet.addConditionalFormattingRule(rule);
1780
+ * ```
1781
+ */
1782
+ whenDate(date) {
1783
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenDate(date);
1784
+ }
1785
+ /**
1786
+ * Sets the conditional format rule to trigger when that the given formula evaluates to `true`.
1787
+ * @param {string} formulaString - A custom formula that evaluates to true if the input is valid. formulaString start with '='.
1788
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1789
+ * @example
1790
+ * ```typescript
1791
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1792
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1793
+ * if (!fWorksheet) return;
1794
+ *
1795
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
1796
+ * const fRange = fWorksheet.getRange('A1:D10');
1797
+ * const rule = fWorksheet.newConditionalFormattingRule()
1798
+ * .whenFormulaSatisfied('=A1>10')
1799
+ * .setBackground('#FF0000')
1800
+ * .setRanges([fRange.getRange()])
1801
+ * .build();
1802
+ * fWorksheet.addConditionalFormattingRule(rule);
1803
+ * ```
1804
+ */
1805
+ whenFormulaSatisfied(formulaString) {
1806
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenFormulaSatisfied(formulaString);
1807
+ }
1808
+ /**
1809
+ * Sets the conditional format rule to trigger when a number falls between, or is either of, two specified values.
1810
+ * @param {number} start - The lowest acceptable value.
1811
+ * @param {number} end - The highest acceptable value.
1812
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1813
+ * @example
1814
+ * ```typescript
1815
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1816
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1817
+ * if (!fWorksheet) return;
1818
+ *
1819
+ * // Create a conditional formatting rule that highlights cells with values between 10 and 20 in red for the range A1:D10.
1820
+ * const fRange = fWorksheet.getRange('A1:D10');
1821
+ * const rule = fWorksheet.newConditionalFormattingRule()
1822
+ * .whenNumberBetween(10, 20)
1823
+ * .setBackground('#FF0000')
1824
+ * .setRanges([fRange.getRange()])
1825
+ * .build();
1826
+ * fWorksheet.addConditionalFormattingRule(rule);
1827
+ * ```
1828
+ */
1829
+ whenNumberBetween(start, end) {
1830
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberBetween(start, end);
1831
+ }
1832
+ /**
1833
+ * Sets the conditional format rule to trigger when a number is equal to the given value.
1834
+ * @param {number} value - The sole acceptable value.
1835
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1836
+ * @example
1837
+ * ```typescript
1838
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1839
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1840
+ * if (!fWorksheet) return;
1841
+ *
1842
+ * // Create a conditional formatting rule that highlights cells with values equal to 10 in red for the range A1:D10.
1843
+ * const fRange = fWorksheet.getRange('A1:D10');
1844
+ * const rule = fWorksheet.newConditionalFormattingRule()
1845
+ * .whenNumberEqualTo(10)
1846
+ * .setBackground('#FF0000')
1847
+ * .setRanges([fRange.getRange()])
1848
+ * .build();
1849
+ * fWorksheet.addConditionalFormattingRule(rule);
1850
+ * ```
1851
+ */
1852
+ whenNumberEqualTo(value) {
1853
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberEqualTo(value);
1854
+ }
1855
+ /**
1856
+ * Sets the conditional format rule to trigger when a number is greater than the given value.
1857
+ * @param {number} value - The highest unacceptable value.
1858
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1859
+ * @example
1860
+ * ```typescript
1861
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1862
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1863
+ * if (!fWorksheet) return;
1864
+ *
1865
+ * // Create a conditional formatting rule that highlights cells with values greater than 10 in red for the range A1:D10.
1866
+ * const fRange = fWorksheet.getRange('A1:D10');
1867
+ * const rule = fWorksheet.newConditionalFormattingRule()
1868
+ * .whenNumberGreaterThan(10)
1869
+ * .setBackground('#FF0000')
1870
+ * .setRanges([fRange.getRange()])
1871
+ * .build();
1872
+ * fWorksheet.addConditionalFormattingRule(rule);
1873
+ * ```
1874
+ */
1875
+ whenNumberGreaterThan(value) {
1876
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberGreaterThan(value);
1877
+ }
1878
+ /**
1879
+ * Sets the conditional format rule to trigger when a number is greater than or equal to the given value.
1880
+ * @param {number} value - The lowest acceptable value.
1881
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1882
+ * @example
1883
+ * ```typescript
1884
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1885
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1886
+ * if (!fWorksheet) return;
1887
+ *
1888
+ * // Create a conditional formatting rule that highlights cells with values greater than or equal to 10 in red for the range A1:D10.
1889
+ * const fRange = fWorksheet.getRange('A1:D10');
1890
+ * const rule = fWorksheet.newConditionalFormattingRule()
1891
+ * .whenNumberGreaterThanOrEqualTo(10)
1892
+ * .setBackground('#FF0000')
1893
+ * .setRanges([fRange.getRange()])
1894
+ * .build();
1895
+ * fWorksheet.addConditionalFormattingRule(rule);
1896
+ * ```
1897
+ */
1898
+ whenNumberGreaterThanOrEqualTo(value) {
1899
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberGreaterThanOrEqualTo(value);
1900
+ }
1901
+ /**
1902
+ * Sets the conditional conditional format rule to trigger when a number less than the given value.
1903
+ * @param {number} value - The lowest unacceptable value.
1904
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1905
+ * @example
1906
+ * ```typescript
1907
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1908
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1909
+ * if (!fWorksheet) return;
1910
+ *
1911
+ * // Create a conditional formatting rule that highlights cells with values less than 10 in red for the range A1:D10.
1912
+ * const fRange = fWorksheet.getRange('A1:D10');
1913
+ * const rule = fWorksheet.newConditionalFormattingRule()
1914
+ * .whenNumberLessThan(10)
1915
+ * .setBackground('#FF0000')
1916
+ * .setRanges([fRange.getRange()])
1917
+ * .build();
1918
+ * fWorksheet.addConditionalFormattingRule(rule);
1919
+ * ```
1920
+ */
1921
+ whenNumberLessThan(value) {
1922
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberLessThan(value);
1923
+ }
1924
+ /**
1925
+ * Sets the conditional format rule to trigger when a number less than or equal to the given value.
1926
+ * @param {number} value - The highest acceptable value.
1927
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1928
+ * @example
1929
+ * ```typescript
1930
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1931
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1932
+ * if (!fWorksheet) return;
1933
+ *
1934
+ * // Create a conditional formatting rule that highlights cells with values less than or equal to 10 in red for the range A1:D10.
1935
+ * const fRange = fWorksheet.getRange('A1:D10');
1936
+ * const rule = fWorksheet.newConditionalFormattingRule()
1937
+ * .whenNumberLessThanOrEqualTo(10)
1938
+ * .setBackground('#FF0000')
1939
+ * .setRanges([fRange.getRange()])
1940
+ * .build();
1941
+ * fWorksheet.addConditionalFormattingRule(rule);
1942
+ * ```
1943
+ */
1944
+ whenNumberLessThanOrEqualTo(value) {
1945
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberLessThanOrEqualTo(value);
1946
+ }
1947
+ /**
1948
+ * Sets the conditional format rule to trigger when a number does not fall between, and is neither of, two specified values.
1949
+ * @param {number} start - The lowest unacceptable value.
1950
+ * @param {number} end - The highest unacceptable value.
1951
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1952
+ * @example
1953
+ * ```typescript
1954
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1955
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1956
+ * if (!fWorksheet) return;
1957
+ *
1958
+ * // Create a conditional formatting rule that highlights cells with values not between 10 and 20 in red for the range A1:D10.
1959
+ * const fRange = fWorksheet.getRange('A1:D10');
1960
+ * const rule = fWorksheet.newConditionalFormattingRule()
1961
+ * .whenNumberNotBetween(10, 20)
1962
+ * .setBackground('#FF0000')
1963
+ * .setRanges([fRange.getRange()])
1964
+ * .build();
1965
+ * fWorksheet.addConditionalFormattingRule(rule);
1966
+ * ```
1967
+ */
1968
+ whenNumberNotBetween(start, end) {
1969
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberNotBetween(start, end);
1970
+ }
1971
+ /**
1972
+ * Sets the conditional format rule to trigger when a number is not equal to the given value.
1973
+ * @param {number} value - The sole unacceptable value.
1974
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1975
+ * @example
1976
+ * ```typescript
1977
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1978
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
1979
+ * if (!fWorksheet) return;
1980
+ *
1981
+ * // Create a conditional formatting rule that highlights cells with values not equal to 10 in red for the range A1:D10.
1982
+ * const fRange = fWorksheet.getRange('A1:D10');
1983
+ * const rule = fWorksheet.newConditionalFormattingRule()
1984
+ * .whenNumberNotEqualTo(10)
1985
+ * .setBackground('#FF0000')
1986
+ * .setRanges([fRange.getRange()])
1987
+ * .build();
1988
+ * fWorksheet.addConditionalFormattingRule(rule);
1989
+ * ```
1990
+ */
1991
+ whenNumberNotEqualTo(value) {
1992
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberNotEqualTo(value);
1993
+ }
1994
+ /**
1995
+ * Sets the conditional format rule to trigger when that the input contains the given value.
1996
+ * @param {string} text - The value that the input must contain.
1997
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
1998
+ * @example
1999
+ * ```typescript
2000
+ * const fWorkbook = univerAPI.getActiveWorkbook();
2001
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
2002
+ * if (!fWorksheet) return;
2003
+ *
2004
+ * // Create a conditional formatting rule that highlights cells with text containing 'apple' in red for the range A1:D10.
2005
+ * const fRange = fWorksheet.getRange('A1:D10');
2006
+ * const rule = fWorksheet.newConditionalFormattingRule()
2007
+ * .whenTextContains('apple')
2008
+ * .setBackground('#FF0000')
2009
+ * .setRanges([fRange.getRange()])
2010
+ * .build();
2011
+ * fWorksheet.addConditionalFormattingRule(rule);
2012
+ * ```
2013
+ */
2014
+ whenTextContains(text) {
2015
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextContains(text);
2016
+ }
2017
+ /**
2018
+ * Sets the conditional format rule to trigger when that the input does not contain the given value.
2019
+ * @param {string} text - The value that the input must not contain.
2020
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
2021
+ * @example
2022
+ * ```typescript
2023
+ * const fWorkbook = univerAPI.getActiveWorkbook();
2024
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
2025
+ * if (!fWorksheet) return;
2026
+ *
2027
+ * // Create a conditional formatting rule that highlights cells with text not containing 'apple' in red for the range A1:D10.
2028
+ * const fRange = fWorksheet.getRange('A1:D10');
2029
+ * const rule = fWorksheet.newConditionalFormattingRule()
2030
+ * .whenTextDoesNotContain('apple')
2031
+ * .setBackground('#FF0000')
2032
+ * .setRanges([fRange.getRange()])
2033
+ * .build();
2034
+ * fWorksheet.addConditionalFormattingRule(rule);
2035
+ * ```
2036
+ */
2037
+ whenTextDoesNotContain(text) {
2038
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextDoesNotContain(text);
2039
+ }
2040
+ /**
2041
+ * Sets the conditional format rule to trigger when that the input ends with the given value.
2042
+ * @param {string} text - Text to compare against the end of the string.
2043
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
2044
+ * @example
2045
+ * ```typescript
2046
+ * const fWorkbook = univerAPI.getActiveWorkbook();
2047
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
2048
+ * if (!fWorksheet) return;
2049
+ *
2050
+ * // Create a conditional formatting rule that highlights cells with text ending with '.ai' in red for the range A1:D10.
2051
+ * const fRange = fWorksheet.getRange('A1:D10');
2052
+ * const rule = fWorksheet.newConditionalFormattingRule()
2053
+ * .whenTextEndsWith('.ai')
2054
+ * .setBackground('#FF0000')
2055
+ * .setRanges([fRange.getRange()])
2056
+ * .build();
2057
+ * fWorksheet.addConditionalFormattingRule(rule);
2058
+ * ```
2059
+ */
2060
+ whenTextEndsWith(text) {
2061
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextEndsWith(text);
2062
+ }
2063
+ /**
2064
+ * Sets the conditional format rule to trigger when that the input is equal to the given value.
2065
+ * @param {string} text - The sole acceptable value.
2066
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
2067
+ * @example
2068
+ * ```typescript
2069
+ * const fWorkbook = univerAPI.getActiveWorkbook();
2070
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
2071
+ * if (!fWorksheet) return;
2072
+ *
2073
+ * // Create a conditional formatting rule that highlights cells with text equal to 'apple' in red for the range A1:D10.
2074
+ * const fRange = fWorksheet.getRange('A1:D10');
2075
+ * const rule = fWorksheet.newConditionalFormattingRule()
2076
+ * .whenTextEqualTo('apple')
2077
+ * .setBackground('#FF0000')
2078
+ * .setRanges([fRange.getRange()])
2079
+ * .build();
2080
+ * fWorksheet.addConditionalFormattingRule(rule);
2081
+ * ```
2082
+ */
2083
+ whenTextEqualTo(text) {
2084
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextEqualTo(text);
2085
+ }
2086
+ /**
2087
+ * Sets the conditional format rule to trigger when that the input starts with the given value.
2088
+ * @param {string} text - Text to compare against the beginning of the string.
2089
+ * @returns {ConditionalFormatHighlightRuleBuilder} The conditional format highlight rule builder.
2090
+ * @example
2091
+ * ```typescript
2092
+ * const fWorkbook = univerAPI.getActiveWorkbook();
2093
+ * const fWorksheet = fWorkbook.getSheetByName('Sheet1');
2094
+ * if (!fWorksheet) return;
2095
+ *
2096
+ * // Create a conditional formatting rule that highlights cells with text starting with 'https://' in red for the range A1:D10.
2097
+ * const fRange = fWorksheet.getRange('A1:D10');
2098
+ * const rule = fWorksheet.newConditionalFormattingRule()
2099
+ * .whenTextStartsWith('https://')
2100
+ * .setBackground('#FF0000')
2101
+ * .setRanges([fRange.getRange()])
2102
+ * .build();
2103
+ * fWorksheet.addConditionalFormattingRule(rule);
2104
+ * ```
2105
+ */
2106
+ whenTextStartsWith(text) {
2107
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextStartsWith(text);
2108
+ }
2109
+ };
2110
+
2111
+ //#endregion
2112
+ //#region src/facade/f-range.ts
2113
+ var FRangeSheetsConditionalFormattingMixin = class extends FRange {
2114
+ _getConditionalFormattingRuleModel() {
2115
+ return this._injector.get(ConditionalFormattingRuleModel);
2116
+ }
2117
+ getConditionalFormattingRules() {
2118
+ return [...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(), this._worksheet.getSheetId()) || []].filter((rule) => rule.ranges.some((range) => Rectangle.intersects(range, this._range)));
2119
+ }
2120
+ createConditionalFormattingRule() {
2121
+ return new FConditionalFormattingBuilder({ ranges: [this._range] });
2122
+ }
2123
+ clearConditionalFormatRules() {
2124
+ const params = {
2125
+ unitId: this._workbook.getUnitId(),
2126
+ subUnitId: this._worksheet.getSheetId(),
2127
+ ranges: [this._range]
2128
+ };
2129
+ this._commandService.syncExecuteCommand(ClearRangeCfCommand.id, params);
2130
+ return this;
2131
+ }
2132
+ };
2133
+ FRange.extend(FRangeSheetsConditionalFormattingMixin);
2134
+
2135
+ //#endregion
2136
+ //#region src/facade/f-worksheet.ts
2137
+ var FWorksheetConditionalFormattingMixin = class extends FWorksheet {
2138
+ _getConditionalFormattingRuleModel() {
2139
+ return this._injector.get(ConditionalFormattingRuleModel);
2140
+ }
2141
+ getConditionalFormattingRules() {
2142
+ return [...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(), this._worksheet.getSheetId()) || []];
2143
+ }
2144
+ newConditionalFormattingRule() {
2145
+ return new FConditionalFormattingBuilder();
2146
+ }
2147
+ addConditionalFormattingRule(rule) {
2148
+ const params = {
2149
+ unitId: this._workbook.getUnitId(),
2150
+ subUnitId: this._worksheet.getSheetId(),
2151
+ rule
2152
+ };
2153
+ this._commandService.syncExecuteCommand(AddCfCommand.id, params);
2154
+ return this;
2155
+ }
2156
+ deleteConditionalFormattingRule(cfId) {
2157
+ const params = {
2158
+ unitId: this._workbook.getUnitId(),
2159
+ subUnitId: this._worksheet.getSheetId(),
2160
+ cfId
2161
+ };
2162
+ this._commandService.syncExecuteCommand(DeleteCfCommand.id, params);
2163
+ return this;
2164
+ }
2165
+ moveConditionalFormattingRule(cfId, toCfId, type = "after") {
2166
+ const params = {
2167
+ unitId: this._workbook.getUnitId(),
2168
+ subUnitId: this._worksheet.getSheetId(),
2169
+ start: {
2170
+ id: cfId,
2171
+ type: "self"
2172
+ },
2173
+ end: {
2174
+ id: toCfId,
2175
+ type
2176
+ }
2177
+ };
2178
+ this._commandService.syncExecuteCommand(MoveCfCommand.id, params);
2179
+ return this;
2180
+ }
2181
+ setConditionalFormattingRule(cfId, rule) {
2182
+ const params = {
2183
+ unitId: this._workbook.getUnitId(),
2184
+ subUnitId: this._worksheet.getSheetId(),
2185
+ cfId,
2186
+ rule
2187
+ };
2188
+ this._commandService.syncExecuteCommand(SetCfCommand.id, params);
2189
+ return this;
2190
+ }
2191
+ clearConditionalFormatRules() {
2192
+ const params = {
2193
+ unitId: this._workbook.getUnitId(),
2194
+ subUnitId: this._worksheet.getSheetId()
2195
+ };
2196
+ this._commandService.syncExecuteCommand(ClearWorksheetCfCommand.id, params);
2197
+ return this;
2198
+ }
2199
+ };
2200
+ FWorksheet.extend(FWorksheetConditionalFormattingMixin);
2201
+
2202
+ //#endregion
2203
+ //#region src/facade/f-enum.ts
2204
+ /**
2205
+ * Copyright 2023-present DreamNum Co., Ltd.
2206
+ *
2207
+ * Licensed under the Apache License, Version 2.0 (the "License");
2208
+ * you may not use this file except in compliance with the License.
2209
+ * You may obtain a copy of the License at
2210
+ *
2211
+ * http://www.apache.org/licenses/LICENSE-2.0
2212
+ *
2213
+ * Unless required by applicable law or agreed to in writing, software
2214
+ * distributed under the License is distributed on an "AS IS" BASIS,
2215
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2216
+ * See the License for the specific language governing permissions and
2217
+ * limitations under the License.
2218
+ */
2219
+ var FSheetsConditionalFormattingEnumMixin = class extends FEnum {
2220
+ get ConditionFormatNumberOperatorEnum() {
2221
+ return CFNumberOperator;
2222
+ }
2223
+ get ConditionFormatTimePeriodOperatorEnum() {
2224
+ return CFTimePeriodOperator;
2225
+ }
2226
+ get ConditionFormatIconSetTypeEnum() {
2227
+ return IIconSetType;
2228
+ }
2229
+ get ConditionFormatValueTypeEnum() {
2230
+ return CFValueType;
2231
+ }
2232
+ };
2233
+ FEnum.extend(FSheetsConditionalFormattingEnumMixin);
2234
+
2235
+ //#endregion
2236
+ export { FConditionalFormattingBuilder };