@univerjs/sheets-conditional-formatting 0.5.4 → 0.5.5-experimental.20250122-3362a4a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/facade.js CHANGED
@@ -1,62 +1,63 @@
1
- var N = Object.defineProperty;
2
- var q = (u, e, t) => e in u ? N(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
3
- var b = (u, e, t) => q(u, typeof e != "symbol" ? e + "" : e, t);
4
- import { ColorKit as c, Tools as _, BooleanNumber as a, Rectangle as U, ColorBuilder as B } from "@univerjs/core";
5
- import { CFRuleType as n, CFNumberOperator as l, CFValueType as C, EMPTY_ICON_TYPE as f, CFSubRuleType as o, CFTextOperator as g, createCfId as T, iconMap as M, ConditionalFormattingRuleModel as x, AddConditionalRuleMutation as S, DeleteConditionalRuleMutation as I, MoveConditionalRuleMutation as E, SetConditionalRuleMutation as k } from "@univerjs/sheets-conditional-formatting";
6
- import { FRange as v, FWorkbook as F, FWorksheet as R } from "@univerjs/sheets/facade";
7
- class d {
8
- constructor(e = {}) {
9
- b(this, "_rule", {});
10
- this._rule = e, this._ensureAttr(this._rule, ["rule"]);
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key] = value;
3
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: !0 });
4
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
5
+ import { ColorKit, Tools, BooleanNumber, Rectangle, ColorBuilder } from "@univerjs/core";
6
+ import { CFRuleType, CFNumberOperator, CFValueType, EMPTY_ICON_TYPE, CFSubRuleType, CFTextOperator, createCfId, iconMap, ConditionalFormattingRuleModel, AddConditionalRuleMutation, DeleteConditionalRuleMutation, MoveConditionalRuleMutation, SetConditionalRuleMutation } from "@univerjs/sheets-conditional-formatting";
7
+ import { FRange, FWorkbook, FWorksheet } from "@univerjs/sheets/facade";
8
+ const _ConditionalFormatRuleBaseBuilder = class _ConditionalFormatRuleBaseBuilder {
9
+ constructor(initRule = {}) {
10
+ __publicField(this, "_rule", {});
11
+ this._rule = initRule, this._ensureAttr(this._rule, ["rule"]);
11
12
  }
12
13
  get _ruleConfig() {
13
14
  return this._rule.rule || null;
14
15
  }
15
- _getDefaultConfig(e = n.highlightCell) {
16
- switch (e) {
17
- case n.colorScale:
16
+ _getDefaultConfig(type = CFRuleType.highlightCell) {
17
+ switch (type) {
18
+ case CFRuleType.colorScale:
18
19
  return {
19
- type: e,
20
+ type,
20
21
  config: [
21
- { index: 0, color: new c("").toRgbString(), value: { type: C.min } },
22
- { index: 0, color: new c("green").toRgbString(), value: { type: C.max } }
22
+ { index: 0, color: new ColorKit("").toRgbString(), value: { type: CFValueType.min } },
23
+ { index: 0, color: new ColorKit("green").toRgbString(), value: { type: CFValueType.max } }
23
24
  ]
24
25
  };
25
- case n.dataBar:
26
+ case CFRuleType.dataBar:
26
27
  return {
27
- type: e,
28
+ type,
28
29
  isShowValue: !0,
29
- config: { min: { type: C.min }, max: { type: C.max }, positiveColor: new c("green").toRgbString(), nativeColor: new c("").toRgbString(), isGradient: !1 }
30
+ config: { min: { type: CFValueType.min }, max: { type: CFValueType.max }, positiveColor: new ColorKit("green").toRgbString(), nativeColor: new ColorKit("").toRgbString(), isGradient: !1 }
30
31
  };
31
- case n.highlightCell:
32
+ case CFRuleType.highlightCell:
32
33
  return {
33
- type: e,
34
- subType: o.text,
35
- operator: g.containsText,
34
+ type,
35
+ subType: CFSubRuleType.text,
36
+ operator: CFTextOperator.containsText,
36
37
  value: "abc",
37
38
  style: {}
38
39
  };
39
- case n.iconSet:
40
+ case CFRuleType.iconSet:
40
41
  return {
41
- type: e,
42
+ type,
42
43
  isShowValue: !0,
43
44
  config: [
44
45
  {
45
- operator: l.greaterThanOrEqual,
46
- value: { type: C.min },
47
- iconType: f,
46
+ operator: CFNumberOperator.greaterThanOrEqual,
47
+ value: { type: CFValueType.min },
48
+ iconType: EMPTY_ICON_TYPE,
48
49
  iconId: ""
49
50
  },
50
51
  {
51
- operator: l.greaterThanOrEqual,
52
- value: { type: C.percentile, value: 0.5 },
53
- iconType: f,
52
+ operator: CFNumberOperator.greaterThanOrEqual,
53
+ value: { type: CFValueType.percentile, value: 0.5 },
54
+ iconType: EMPTY_ICON_TYPE,
54
55
  iconId: ""
55
56
  },
56
57
  {
57
- operator: l.lessThanOrEqual,
58
- value: { type: C.max },
59
- iconType: f,
58
+ operator: CFNumberOperator.lessThanOrEqual,
59
+ value: { type: CFValueType.max },
60
+ iconType: EMPTY_ICON_TYPE,
60
61
  iconId: ""
61
62
  }
62
63
  ]
@@ -64,14 +65,14 @@ class d {
64
65
  }
65
66
  }
66
67
  // eslint-disable-next-line ts/no-explicit-any
67
- _ensureAttr(e, t) {
68
- return t.reduce((r, s) => (r[s] || (r[s] = {}), r[s]), e), e;
68
+ _ensureAttr(obj, keys) {
69
+ return keys.reduce((pre, cur) => (pre[cur] || (pre[cur] = {}), pre[cur]), obj), obj;
69
70
  }
70
71
  build() {
71
- var r;
72
- this._rule.cfId || (this._rule.cfId = T()), this._rule.ranges || (this._rule.ranges = []), this._rule.stopIfTrue === void 0 && (this._rule.stopIfTrue = !1), (r = this._rule.rule) != null && r.type || (this._rule.rule.type = n.highlightCell, this._ensureAttr(this._rule, ["rule", "style"]));
73
- const e = this._getDefaultConfig(this._rule.rule.type);
74
- return { ...this._rule, rule: { ...e, ...this._rule.rule } };
72
+ var _a;
73
+ this._rule.cfId || (this._rule.cfId = createCfId()), this._rule.ranges || (this._rule.ranges = []), this._rule.stopIfTrue === void 0 && (this._rule.stopIfTrue = !1), (_a = this._rule.rule) != null && _a.type || (this._rule.rule.type = CFRuleType.highlightCell, this._ensureAttr(this._rule, ["rule", "style"]));
74
+ const defaultConfig = this._getDefaultConfig(this._rule.rule.type);
75
+ return { ...this._rule, rule: { ...defaultConfig, ...this._rule.rule } };
75
76
  }
76
77
  /**
77
78
  * Deep clone a current builder.
@@ -79,7 +80,7 @@ class d {
79
80
  * @memberof ConditionalFormatRuleBuilder
80
81
  */
81
82
  copy() {
82
- return new d(_.deepClone(this._rule));
83
+ return new _ConditionalFormatRuleBaseBuilder(Tools.deepClone(this._rule));
83
84
  }
84
85
  /**
85
86
  * Gets the scope of the current conditional format
@@ -93,7 +94,7 @@ class d {
93
94
  * Get the icon set mapping dictionary
94
95
  */
95
96
  getIconMap() {
96
- return M;
97
+ return iconMap;
97
98
  }
98
99
  /**
99
100
  * Create a conditional format ID.
@@ -101,7 +102,7 @@ class d {
101
102
  * @memberof ConditionalFormatRuleBuilder
102
103
  */
103
104
  createCfId() {
104
- return T();
105
+ return createCfId();
105
106
  }
106
107
  /**
107
108
  * Sets the scope for conditional formatting
@@ -109,41 +110,43 @@ class d {
109
110
  * @returns {*}
110
111
  * @memberof ConditionalFormatRuleBuilder
111
112
  */
112
- setRanges(e) {
113
- return this._rule.ranges = e, this;
113
+ setRanges(ranges) {
114
+ return this._rule.ranges = ranges, this;
114
115
  }
115
- }
116
- class i extends d {
117
- constructor(e = {}) {
118
- super(e), this._ensureAttr(this._rule, ["rule", "style"]);
116
+ };
117
+ __name(_ConditionalFormatRuleBaseBuilder, "ConditionalFormatRuleBaseBuilder");
118
+ let ConditionalFormatRuleBaseBuilder = _ConditionalFormatRuleBaseBuilder;
119
+ const _ConditionalFormatHighlightRuleBuilder = class _ConditionalFormatHighlightRuleBuilder extends ConditionalFormatRuleBaseBuilder {
120
+ constructor(initConfig = {}) {
121
+ super(initConfig), this._ensureAttr(this._rule, ["rule", "style"]);
119
122
  }
120
123
  copy() {
121
- return new i(_.deepClone(this._rule));
124
+ return new _ConditionalFormatHighlightRuleBuilder(Tools.deepClone(this._rule));
122
125
  }
123
126
  /**
124
127
  * Set average rule
125
128
  * @param {IAverageHighlightCell['operator']} operator
126
129
  * @memberof ConditionalFormatHighlightRuleBuilder
127
130
  */
128
- setAverage(e) {
129
- const t = this._ruleConfig;
130
- return t.type = n.highlightCell, t.subType = o.average, t.operator = e, this;
131
+ setAverage(operator) {
132
+ const ruleConfig = this._ruleConfig;
133
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.average, ruleConfig.operator = operator, this;
131
134
  }
132
135
  /**
133
136
  * Set uniqueValues rule
134
137
  * @memberof ConditionalFormatHighlightRuleBuilder
135
138
  */
136
139
  setUniqueValues() {
137
- const e = this._ruleConfig;
138
- return e.type = n.highlightCell, e.subType = o.uniqueValues, this;
140
+ const ruleConfig = this._ruleConfig;
141
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.uniqueValues, this;
139
142
  }
140
143
  /**
141
144
  * Set duplicateValues rule
142
145
  * @memberof ConditionalFormatHighlightRuleBuilder
143
146
  */
144
147
  setDuplicateValues() {
145
- const e = this._ruleConfig;
146
- return e.type = n.highlightCell, e.subType = o.duplicateValues, this;
148
+ const ruleConfig = this._ruleConfig;
149
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.duplicateValues, this;
147
150
  }
148
151
  /**
149
152
  * Set rank rule
@@ -153,9 +156,9 @@ class i extends d {
153
156
  * @param config.value
154
157
  * @memberof ConditionalFormatHighlightRuleBuilder
155
158
  */
156
- setRank(e) {
157
- const t = this._ruleConfig;
158
- return t.type = n.highlightCell, t.subType = o.rank, t.isBottom = e.isBottom, t.isPercent = e.isPercent, t.value = e.value, this;
159
+ setRank(config) {
160
+ const ruleConfig = this._ruleConfig;
161
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.rank, ruleConfig.isBottom = config.isBottom, ruleConfig.isPercent = config.isPercent, ruleConfig.value = config.value, this;
159
162
  }
160
163
  /**
161
164
  * Sets the background color
@@ -163,13 +166,13 @@ class i extends d {
163
166
  * @returns {*}
164
167
  * @memberof ConditionalFormatRuleBuilder
165
168
  */
166
- setBackground(e) {
167
- var t;
168
- if (((t = this._ruleConfig) == null ? void 0 : t.type) === n.highlightCell)
169
- if (e) {
169
+ setBackground(color) {
170
+ var _a;
171
+ if (((_a = this._ruleConfig) == null ? void 0 : _a.type) === CFRuleType.highlightCell)
172
+ if (color) {
170
173
  this._ensureAttr(this._ruleConfig, ["style", "bg"]);
171
- const r = new c(e);
172
- this._ruleConfig.style.bg.rgb = r.toRgbString();
174
+ const colorKit = new ColorKit(color);
175
+ this._ruleConfig.style.bg.rgb = colorKit.toRgbString();
173
176
  } else
174
177
  delete this._ruleConfig.style.bg;
175
178
  return this;
@@ -180,9 +183,9 @@ class i extends d {
180
183
  * @returns {*}
181
184
  * @memberof ConditionalFormatRuleBuilder
182
185
  */
183
- setBold(e) {
184
- var t;
185
- return ((t = this._ruleConfig) == null ? void 0 : t.type) === n.highlightCell && (this._ensureAttr(this._ruleConfig, ["style"]), this._ruleConfig.style.bl = e ? a.TRUE : a.FALSE), this;
186
+ setBold(isBold) {
187
+ var _a;
188
+ return ((_a = this._ruleConfig) == null ? void 0 : _a.type) === CFRuleType.highlightCell && (this._ensureAttr(this._ruleConfig, ["style"]), this._ruleConfig.style.bl = isBold ? BooleanNumber.TRUE : BooleanNumber.FALSE), this;
186
189
  }
187
190
  /**
188
191
  * Sets the font color
@@ -190,12 +193,12 @@ class i extends d {
190
193
  * @returns {*}
191
194
  * @memberof ConditionalFormatRuleBuilder
192
195
  */
193
- setFontColor(e) {
194
- var t;
195
- if (((t = this._ruleConfig) == null ? void 0 : t.type) === n.highlightCell)
196
- if (e) {
197
- const r = new c(e);
198
- this._ensureAttr(this._ruleConfig, ["style", "cl"]), this._ruleConfig.style.cl.rgb = r.toRgbString();
196
+ setFontColor(color) {
197
+ var _a;
198
+ if (((_a = this._ruleConfig) == null ? void 0 : _a.type) === CFRuleType.highlightCell)
199
+ if (color) {
200
+ const colorKit = new ColorKit(color);
201
+ this._ensureAttr(this._ruleConfig, ["style", "cl"]), this._ruleConfig.style.cl.rgb = colorKit.toRgbString();
199
202
  } else
200
203
  delete this._ruleConfig.style.cl;
201
204
  return this;
@@ -206,9 +209,9 @@ class i extends d {
206
209
  * @returns {*}
207
210
  * @memberof ConditionalFormatRuleBuilder
208
211
  */
209
- setItalic(e) {
210
- var t;
211
- return ((t = this._ruleConfig) == null ? void 0 : t.type) === n.highlightCell && (this._ensureAttr(this._ruleConfig, ["style"]), this._ruleConfig.style.it = e ? a.TRUE : a.FALSE), this;
212
+ setItalic(isItalic) {
213
+ var _a;
214
+ return ((_a = this._ruleConfig) == null ? void 0 : _a.type) === CFRuleType.highlightCell && (this._ensureAttr(this._ruleConfig, ["style"]), this._ruleConfig.style.it = isItalic ? BooleanNumber.TRUE : BooleanNumber.FALSE), this;
212
215
  }
213
216
  /**
214
217
  * Set the strikethrough
@@ -216,9 +219,9 @@ class i extends d {
216
219
  * @returns {*}
217
220
  * @memberof ConditionalFormatRuleBuilder
218
221
  */
219
- setStrikethrough(e) {
220
- var t;
221
- return ((t = this._ruleConfig) == null ? void 0 : t.type) === n.highlightCell && (this._ensureAttr(this._ruleConfig, ["style", "st"]), this._ruleConfig.style.st.s = e ? a.TRUE : a.FALSE), this;
222
+ setStrikethrough(isStrikethrough) {
223
+ var _a;
224
+ return ((_a = this._ruleConfig) == null ? void 0 : _a.type) === CFRuleType.highlightCell && (this._ensureAttr(this._ruleConfig, ["style", "st"]), this._ruleConfig.style.st.s = isStrikethrough ? BooleanNumber.TRUE : BooleanNumber.FALSE), this;
222
225
  }
223
226
  /**
224
227
  * Set the underscore
@@ -226,16 +229,16 @@ class i extends d {
226
229
  * @returns {*}
227
230
  * @memberof ConditionalFormatRuleBuilder
228
231
  */
229
- setUnderline(e) {
230
- var t;
231
- return ((t = this._ruleConfig) == null ? void 0 : t.type) === n.highlightCell && (this._ensureAttr(this._ruleConfig, ["style", "ul"]), this._ruleConfig.style.ul.s = e ? a.TRUE : a.FALSE), this;
232
+ setUnderline(isUnderline) {
233
+ var _a;
234
+ return ((_a = this._ruleConfig) == null ? void 0 : _a.type) === CFRuleType.highlightCell && (this._ensureAttr(this._ruleConfig, ["style", "ul"]), this._ruleConfig.style.ul.s = isUnderline ? BooleanNumber.TRUE : BooleanNumber.FALSE), this;
232
235
  }
233
236
  /**
234
237
  * Sets the conditional formatting rule to fire when the cell is empty.
235
238
  */
236
239
  whenCellEmpty() {
237
- const e = this._ruleConfig;
238
- return e.type = n.highlightCell, e.subType = o.text, e.value = "", e.operator = g.equal, this;
240
+ const ruleConfig = this._ruleConfig;
241
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = "", ruleConfig.operator = CFTextOperator.equal, this;
239
242
  }
240
243
  /**
241
244
  * Sets the conditional formatting rule to fire when the cell is not empty
@@ -243,8 +246,8 @@ class i extends d {
243
246
  * @memberof ConditionalFormatRuleBuilder
244
247
  */
245
248
  whenCellNotEmpty() {
246
- const e = this._ruleConfig;
247
- return e.type = n.highlightCell, e.subType = o.text, e.value = "", e.operator = g.notEqual, this;
249
+ const ruleConfig = this._ruleConfig;
250
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = "", ruleConfig.operator = CFTextOperator.notEqual, this;
248
251
  }
249
252
  /**
250
253
  * Highlight when the date is in a time period, custom time is not supported.
@@ -252,18 +255,18 @@ class i extends d {
252
255
  * @returns {*}
253
256
  * @memberof ConditionalFormatRuleBuilder
254
257
  */
255
- whenDate(e) {
256
- const t = this._ruleConfig;
257
- return t.type = n.highlightCell, t.subType = o.timePeriod, t.operator = e, this;
258
+ whenDate(date) {
259
+ const ruleConfig = this._ruleConfig;
260
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.timePeriod, ruleConfig.operator = date, this;
258
261
  }
259
262
  /**
260
263
  * Sets a conditional formatting rule to fire when a given formula evaluates to true.
261
264
  * @param {string} formulaString formulaString start with' = '
262
265
  * @memberof ConditionalFormatRuleBuilder
263
266
  */
264
- whenFormulaSatisfied(e) {
265
- const t = this._ruleConfig;
266
- return t.type = n.highlightCell, t.subType = o.formula, t.value = e, this;
267
+ whenFormulaSatisfied(formulaString) {
268
+ const ruleConfig = this._ruleConfig;
269
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.formula, ruleConfig.value = formulaString, this;
267
270
  }
268
271
  /**
269
272
  * Sets the conditional formatting rule to fire when a number is between two specified values or equal to one of them.
@@ -271,54 +274,54 @@ class i extends d {
271
274
  * @param {number} end
272
275
  * @memberof ConditionalFormatRuleBuilder
273
276
  */
274
- whenNumberBetween(e, t) {
275
- const r = Math.min(e, t), s = Math.max(e, t), h = this._ruleConfig;
276
- return h.type = n.highlightCell, h.subType = o.number, h.value = [r, s], h.operator = l.between, this;
277
+ whenNumberBetween(start, end) {
278
+ const min = Math.min(start, end), max = Math.max(start, end), ruleConfig = this._ruleConfig;
279
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = [min, max], ruleConfig.operator = CFNumberOperator.between, this;
277
280
  }
278
281
  /**
279
282
  * Sets the conditional formatting rule to fire when the number equals the given value
280
283
  * @param {number} value
281
284
  * @memberof ConditionalFormatRuleBuilder
282
285
  */
283
- whenNumberEqualTo(e) {
284
- const t = this._ruleConfig;
285
- return t.type = n.highlightCell, t.subType = o.number, t.value = e, t.operator = l.equal, this;
286
+ whenNumberEqualTo(value) {
287
+ const ruleConfig = this._ruleConfig;
288
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = value, ruleConfig.operator = CFNumberOperator.equal, this;
286
289
  }
287
290
  /**
288
291
  * Sets the conditional formatting rule to fire when the number is greater than the given value
289
292
  * @param {number} value
290
293
  * @memberof ConditionalFormatRuleBuilder
291
294
  */
292
- whenNumberGreaterThan(e) {
293
- const t = this._ruleConfig;
294
- return t.type = n.highlightCell, t.subType = o.number, t.value = e, t.operator = l.greaterThan, this;
295
+ whenNumberGreaterThan(value) {
296
+ const ruleConfig = this._ruleConfig;
297
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = value, ruleConfig.operator = CFNumberOperator.greaterThan, this;
295
298
  }
296
299
  /**
297
300
  * Sets a conditional formatting rule to fire when a number is greater than or equal to a given value.
298
301
  * @param {number} value
299
302
  * @memberof ConditionalFormatRuleBuilder
300
303
  */
301
- whenNumberGreaterThanOrEqualTo(e) {
302
- const t = this._ruleConfig;
303
- return t.type = n.highlightCell, t.subType = o.number, t.value = e, t.operator = l.greaterThanOrEqual, this;
304
+ whenNumberGreaterThanOrEqualTo(value) {
305
+ const ruleConfig = this._ruleConfig;
306
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = value, ruleConfig.operator = CFNumberOperator.greaterThanOrEqual, this;
304
307
  }
305
308
  /**
306
309
  * Sets a conditional formatting rule to fire when the number is less than the given value.
307
310
  * @param {number} value
308
311
  * @memberof ConditionalFormatRuleBuilder
309
312
  */
310
- whenNumberLessThan(e) {
311
- const t = this._ruleConfig;
312
- return t.type = n.highlightCell, t.subType = o.number, t.value = e, t.operator = l.lessThan, this;
313
+ whenNumberLessThan(value) {
314
+ const ruleConfig = this._ruleConfig;
315
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = value, ruleConfig.operator = CFNumberOperator.lessThan, this;
313
316
  }
314
317
  /**
315
318
  * Sets the conditional formatting rule to fire when the value is less than or equal to the given value.
316
319
  * @param {number} value
317
320
  * @memberof ConditionalFormatRuleBuilder
318
321
  */
319
- whenNumberLessThanOrEqualTo(e) {
320
- const t = this._ruleConfig;
321
- return t.type = n.highlightCell, t.subType = o.number, t.value = e, t.operator = l.lessThanOrEqual, this;
322
+ whenNumberLessThanOrEqualTo(value) {
323
+ const ruleConfig = this._ruleConfig;
324
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = value, ruleConfig.operator = CFNumberOperator.lessThanOrEqual, this;
322
325
  }
323
326
  /**
324
327
  * Sets a conditional formatting rule to fire when a number is not between two specified values and is not equal to them.
@@ -326,68 +329,70 @@ class i extends d {
326
329
  * @param {number} end
327
330
  * @memberof ConditionalFormatRuleBuilder
328
331
  */
329
- whenNumberNotBetween(e, t) {
330
- const r = Math.min(e, t), s = Math.max(e, t), h = this._ruleConfig;
331
- return h.type = n.highlightCell, h.subType = o.number, h.value = [r, s], h.operator = l.notBetween, this;
332
+ whenNumberNotBetween(start, end) {
333
+ const min = Math.min(start, end), max = Math.max(start, end), ruleConfig = this._ruleConfig;
334
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = [min, max], ruleConfig.operator = CFNumberOperator.notBetween, this;
332
335
  }
333
336
  /**
334
337
  * Sets the conditional formatting rule to fire when a number does not equal a given value.
335
338
  * @param value
336
339
  * @memberof ConditionalFormatRuleBuilder
337
340
  */
338
- whenNumberNotEqualTo(e) {
339
- const t = this._ruleConfig;
340
- return t.type = n.highlightCell, t.subType = o.number, t.value = e, t.operator = l.notEqual, this;
341
+ whenNumberNotEqualTo(value) {
342
+ const ruleConfig = this._ruleConfig;
343
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.number, ruleConfig.value = value, ruleConfig.operator = CFNumberOperator.notEqual, this;
341
344
  }
342
345
  /**
343
346
  * Sets the conditional formatting rule to fire when the input contains the given value.
344
347
  * @param {string} text
345
348
  * @memberof ConditionalFormatRuleBuilder
346
349
  */
347
- whenTextContains(e) {
348
- const t = this._ruleConfig;
349
- return t.type = n.highlightCell, t.subType = o.text, t.value = e, t.operator = g.containsText, this;
350
+ whenTextContains(text) {
351
+ const ruleConfig = this._ruleConfig;
352
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = text, ruleConfig.operator = CFTextOperator.containsText, this;
350
353
  }
351
354
  /**
352
355
  * Sets a conditional formatting rule to fire when the input does not contain the given value.
353
356
  * @param {string} text
354
357
  * @memberof ConditionalFormatRuleBuilder
355
358
  */
356
- whenTextDoesNotContain(e) {
357
- const t = this._ruleConfig;
358
- return t.type = n.highlightCell, t.subType = o.text, t.value = e, t.operator = g.notContainsText, this;
359
+ whenTextDoesNotContain(text) {
360
+ const ruleConfig = this._ruleConfig;
361
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = text, ruleConfig.operator = CFTextOperator.notContainsText, this;
359
362
  }
360
363
  /**
361
364
  * Sets a conditional formatting rule to fire when input ends with a specified value.
362
365
  * @param {string} text
363
366
  * @memberof ConditionalFormatRuleBuilder
364
367
  */
365
- whenTextEndsWith(e) {
366
- const t = this._ruleConfig;
367
- return t.type = n.highlightCell, t.subType = o.text, t.value = e, t.operator = g.endsWith, this;
368
+ whenTextEndsWith(text) {
369
+ const ruleConfig = this._ruleConfig;
370
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = text, ruleConfig.operator = CFTextOperator.endsWith, this;
368
371
  }
369
372
  /**
370
373
  * Sets the conditional formatting rule to fire when the input equals the given value.
371
374
  * @param {string} text
372
375
  * @memberof ConditionalFormatRuleBuilder
373
376
  */
374
- whenTextEqualTo(e) {
375
- const t = this._ruleConfig;
376
- return t.type = n.highlightCell, t.subType = o.text, t.value = e, t.operator = g.equal, this;
377
+ whenTextEqualTo(text) {
378
+ const ruleConfig = this._ruleConfig;
379
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = text, ruleConfig.operator = CFTextOperator.equal, this;
377
380
  }
378
381
  /**
379
382
  * Sets the conditional formatting rule to fire when the input value begins with the given value.
380
383
  * @param {string} text
381
384
  * @memberof ConditionalFormatRuleBuilder
382
385
  */
383
- whenTextStartsWith(e) {
384
- const t = this._ruleConfig;
385
- return t.type = n.highlightCell, t.subType = o.text, t.value = e, t.operator = g.beginsWith, this;
386
+ whenTextStartsWith(text) {
387
+ const ruleConfig = this._ruleConfig;
388
+ return ruleConfig.type = CFRuleType.highlightCell, ruleConfig.subType = CFSubRuleType.text, ruleConfig.value = text, ruleConfig.operator = CFTextOperator.beginsWith, this;
386
389
  }
387
- }
388
- class w extends d {
390
+ };
391
+ __name(_ConditionalFormatHighlightRuleBuilder, "ConditionalFormatHighlightRuleBuilder");
392
+ let ConditionalFormatHighlightRuleBuilder = _ConditionalFormatHighlightRuleBuilder;
393
+ const _ConditionalFormatDataBarRuleBuilder = class _ConditionalFormatDataBarRuleBuilder extends ConditionalFormatRuleBaseBuilder {
389
394
  copy() {
390
- return new w(_.deepClone(this._rule));
395
+ return new _ConditionalFormatDataBarRuleBuilder(Tools.deepClone(this._rule));
391
396
  }
392
397
  /**
393
398
  * Data bar settings
@@ -407,34 +412,38 @@ class w extends d {
407
412
  * @param config.isShowValue
408
413
  * @memberof ConditionalFormatRuleBuilder
409
414
  */
410
- setDataBar(e) {
411
- const t = this._ruleConfig;
412
- return t.type = n.dataBar, t.isShowValue = !!e.isShowValue, t.config = {
413
- min: e.min,
414
- max: e.max,
415
- positiveColor: e.positiveColor,
416
- nativeColor: e.nativeColor,
417
- isGradient: !!e.isGradient
415
+ setDataBar(config) {
416
+ const ruleConfig = this._ruleConfig;
417
+ return ruleConfig.type = CFRuleType.dataBar, ruleConfig.isShowValue = !!config.isShowValue, ruleConfig.config = {
418
+ min: config.min,
419
+ max: config.max,
420
+ positiveColor: config.positiveColor,
421
+ nativeColor: config.nativeColor,
422
+ isGradient: !!config.isGradient
418
423
  }, this;
419
424
  }
420
- }
421
- class p extends d {
425
+ };
426
+ __name(_ConditionalFormatDataBarRuleBuilder, "ConditionalFormatDataBarRuleBuilder");
427
+ let ConditionalFormatDataBarRuleBuilder = _ConditionalFormatDataBarRuleBuilder;
428
+ const _ConditionalFormatColorScaleRuleBuilder = class _ConditionalFormatColorScaleRuleBuilder extends ConditionalFormatRuleBaseBuilder {
422
429
  copy() {
423
- return new p(_.deepClone(this._rule));
430
+ return new _ConditionalFormatColorScaleRuleBuilder(Tools.deepClone(this._rule));
424
431
  }
425
432
  /**
426
433
  * Color scale set
427
434
  * @param {{ index: number; color: string; value: IValueConfig }[]} config
428
435
  * @memberof ConditionalFormatRuleBuilder
429
436
  */
430
- setColorScale(e) {
431
- const t = this._ruleConfig;
432
- return t.type = n.colorScale, t.config = e, this;
437
+ setColorScale(config) {
438
+ const ruleConfig = this._ruleConfig;
439
+ return ruleConfig.type = CFRuleType.colorScale, ruleConfig.config = config, this;
433
440
  }
434
- }
435
- class y extends d {
441
+ };
442
+ __name(_ConditionalFormatColorScaleRuleBuilder, "ConditionalFormatColorScaleRuleBuilder");
443
+ let ConditionalFormatColorScaleRuleBuilder = _ConditionalFormatColorScaleRuleBuilder;
444
+ const _ConditionalFormatIconSetRuleBuilder = class _ConditionalFormatIconSetRuleBuilder extends ConditionalFormatRuleBaseBuilder {
436
445
  copy() {
437
- return new y(_.deepClone(this._rule));
446
+ return new _ConditionalFormatIconSetRuleBuilder(Tools.deepClone(this._rule));
438
447
  }
439
448
  /**
440
449
  *
@@ -444,39 +453,41 @@ class y extends d {
444
453
  * @param config.isShowValue
445
454
  * @memberof ConditionalFormatRuleBuilder
446
455
  */
447
- setIconSet(e) {
448
- const t = this._ruleConfig;
449
- return t.type = n.iconSet, t.config = e.iconConfigs, t.isShowValue = e.isShowValue, this;
456
+ setIconSet(config) {
457
+ const ruleConfig = this._ruleConfig;
458
+ return ruleConfig.type = CFRuleType.iconSet, ruleConfig.config = config.iconConfigs, ruleConfig.isShowValue = config.isShowValue, this;
450
459
  }
451
- }
452
- class m {
453
- constructor(e = {}) {
454
- this._initConfig = e;
460
+ };
461
+ __name(_ConditionalFormatIconSetRuleBuilder, "ConditionalFormatIconSetRuleBuilder");
462
+ let ConditionalFormatIconSetRuleBuilder = _ConditionalFormatIconSetRuleBuilder;
463
+ const _FConditionalFormattingBuilder = class _FConditionalFormattingBuilder {
464
+ constructor(_initConfig = {}) {
465
+ this._initConfig = _initConfig;
455
466
  }
456
467
  build() {
457
- return new d(this._initConfig).build();
468
+ return new ConditionalFormatRuleBaseBuilder(this._initConfig).build();
458
469
  }
459
470
  /**
460
471
  * Set average rule
461
472
  * @param {IAverageHighlightCell['operator']} operator
462
473
  * @memberof ConditionalFormatHighlightRuleBuilder
463
474
  */
464
- setAverage(e) {
465
- return new i(this._initConfig).setAverage(e);
475
+ setAverage(operator) {
476
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setAverage(operator);
466
477
  }
467
478
  /**
468
479
  * Set uniqueValues rule
469
480
  * @memberof ConditionalFormatHighlightRuleBuilder
470
481
  */
471
482
  setUniqueValues() {
472
- return new i(this._initConfig).setUniqueValues();
483
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setUniqueValues();
473
484
  }
474
485
  /**
475
486
  * Set duplicateValues rule
476
487
  * @memberof ConditionalFormatHighlightRuleBuilder
477
488
  */
478
489
  setDuplicateValues() {
479
- return new i(this._initConfig).setDuplicateValues();
490
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setDuplicateValues();
480
491
  }
481
492
  /**
482
493
  * Set rank rule
@@ -486,8 +497,8 @@ class m {
486
497
  * @param config.value
487
498
  * @memberof ConditionalFormatHighlightRuleBuilder
488
499
  */
489
- setRank(e) {
490
- return new i(this._initConfig).setRank(e);
500
+ setRank(config) {
501
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setRank(config);
491
502
  }
492
503
  /**
493
504
  *
@@ -497,16 +508,16 @@ class m {
497
508
  * @param config.isShowValue
498
509
  * @memberof ConditionalFormatRuleBuilder
499
510
  */
500
- setIconSet(e) {
501
- return new y(this._initConfig).setIconSet(e);
511
+ setIconSet(config) {
512
+ return new ConditionalFormatIconSetRuleBuilder(this._initConfig).setIconSet(config);
502
513
  }
503
514
  /**
504
515
  * Set colorScale rule
505
516
  * @param {{ index: number; color: string; value: IValueConfig }[]} config
506
517
  * @memberof ConditionalFormatRuleBuilder
507
518
  */
508
- setColorScale(e) {
509
- return new p(this._initConfig).setColorScale(e);
519
+ setColorScale(config) {
520
+ return new ConditionalFormatColorScaleRuleBuilder(this._initConfig).setColorScale(config);
510
521
  }
511
522
  /**
512
523
  * Set dataBar rule
@@ -526,8 +537,8 @@ class m {
526
537
  * @param config.isShowValue
527
538
  * @memberof ConditionalFormatRuleBuilder
528
539
  */
529
- setDataBar(e) {
530
- return new w(this._initConfig).setDataBar(e);
540
+ setDataBar(config) {
541
+ return new ConditionalFormatDataBarRuleBuilder(this._initConfig).setDataBar(config);
531
542
  }
532
543
  /**
533
544
  * Sets the background color
@@ -535,8 +546,8 @@ class m {
535
546
  * @returns {*}
536
547
  * @memberof ConditionalFormatRuleBuilder
537
548
  */
538
- setBackground(e) {
539
- return new i(this._initConfig).setBackground(e);
549
+ setBackground(color) {
550
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setBackground(color);
540
551
  }
541
552
  /**
542
553
  * Set Bold
@@ -544,8 +555,8 @@ class m {
544
555
  * @returns {*}
545
556
  * @memberof ConditionalFormatRuleBuilder
546
557
  */
547
- setBold(e) {
548
- return new i(this._initConfig).setBold(e);
558
+ setBold(isBold) {
559
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setBold(isBold);
549
560
  }
550
561
  /**
551
562
  * Sets the font color
@@ -553,8 +564,8 @@ class m {
553
564
  * @returns {*}
554
565
  * @memberof ConditionalFormatRuleBuilder
555
566
  */
556
- setFontColor(e) {
557
- return new i(this._initConfig).setFontColor(e);
567
+ setFontColor(color) {
568
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setFontColor(color);
558
569
  }
559
570
  /**
560
571
  * Set the text to italic
@@ -562,8 +573,8 @@ class m {
562
573
  * @returns {*}
563
574
  * @memberof ConditionalFormatRuleBuilder
564
575
  */
565
- setItalic(e) {
566
- return new i(this._initConfig).setItalic(e);
576
+ setItalic(isItalic) {
577
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setItalic(isItalic);
567
578
  }
568
579
  /**
569
580
  * Set the strikethrough
@@ -571,8 +582,8 @@ class m {
571
582
  * @returns {*}
572
583
  * @memberof ConditionalFormatRuleBuilder
573
584
  */
574
- setStrikethrough(e) {
575
- return new i(this._initConfig).setStrikethrough(e);
585
+ setStrikethrough(isStrikethrough) {
586
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setStrikethrough(isStrikethrough);
576
587
  }
577
588
  /**
578
589
  * Set the underscore
@@ -580,14 +591,14 @@ class m {
580
591
  * @returns {*}
581
592
  * @memberof ConditionalFormatRuleBuilder
582
593
  */
583
- setUnderline(e) {
584
- return new i(this._initConfig).setUnderline(e);
594
+ setUnderline(isUnderline) {
595
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).setUnderline(isUnderline);
585
596
  }
586
597
  /**
587
598
  * Sets the conditional formatting rule to fire when the cell is empty.
588
599
  */
589
600
  whenCellEmpty() {
590
- return new i(this._initConfig).whenCellEmpty();
601
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenCellEmpty();
591
602
  }
592
603
  /**
593
604
  * Sets the conditional formatting rule to fire when the cell is not empty
@@ -595,7 +606,7 @@ class m {
595
606
  * @memberof ConditionalFormatRuleBuilder
596
607
  */
597
608
  whenCellNotEmpty() {
598
- return new i(this._initConfig).whenCellNotEmpty();
609
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenCellNotEmpty();
599
610
  }
600
611
  /**
601
612
  * Highlight when the date is in a time period, custom time is not supported.
@@ -603,16 +614,16 @@ class m {
603
614
  * @returns {*}
604
615
  * @memberof ConditionalFormatRuleBuilder
605
616
  */
606
- whenDate(e) {
607
- return new i(this._initConfig).whenDate(e);
617
+ whenDate(date) {
618
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenDate(date);
608
619
  }
609
620
  /**
610
621
  * Sets a conditional formatting rule to fire when a given formula evaluates to true.
611
622
  * @param {string} formulaString formulaString start with' = '
612
623
  * @memberof ConditionalFormatRuleBuilder
613
624
  */
614
- whenFormulaSatisfied(e) {
615
- return new i(this._initConfig).whenFormulaSatisfied(e);
625
+ whenFormulaSatisfied(formulaString) {
626
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenFormulaSatisfied(formulaString);
616
627
  }
617
628
  /**
618
629
  * Sets the conditional formatting rule to fire when a number is between two specified values or equal to one of them.
@@ -620,48 +631,48 @@ class m {
620
631
  * @param {number} end
621
632
  * @memberof ConditionalFormatRuleBuilder
622
633
  */
623
- whenNumberBetween(e, t) {
624
- return new i(this._initConfig).whenNumberBetween(e, t);
634
+ whenNumberBetween(start, end) {
635
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberBetween(start, end);
625
636
  }
626
637
  /**
627
638
  * Sets the conditional formatting rule to fire when the number equals the given value
628
639
  * @param {number} value
629
640
  * @memberof ConditionalFormatRuleBuilder
630
641
  */
631
- whenNumberEqualTo(e) {
632
- return new i(this._initConfig).whenNumberEqualTo(e);
642
+ whenNumberEqualTo(value) {
643
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberEqualTo(value);
633
644
  }
634
645
  /**
635
646
  * Sets the conditional formatting rule to fire when the number is greater than the given value
636
647
  * @param {number} value
637
648
  * @memberof ConditionalFormatRuleBuilder
638
649
  */
639
- whenNumberGreaterThan(e) {
640
- return new i(this._initConfig).whenNumberGreaterThan(e);
650
+ whenNumberGreaterThan(value) {
651
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberGreaterThan(value);
641
652
  }
642
653
  /**
643
654
  * Sets a conditional formatting rule to fire when a number is greater than or equal to a given value.
644
655
  * @param {number} value
645
656
  * @memberof ConditionalFormatRuleBuilder
646
657
  */
647
- whenNumberGreaterThanOrEqualTo(e) {
648
- return new i(this._initConfig).whenNumberGreaterThanOrEqualTo(e);
658
+ whenNumberGreaterThanOrEqualTo(value) {
659
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberGreaterThanOrEqualTo(value);
649
660
  }
650
661
  /**
651
662
  * Sets a conditional formatting rule to fire when the number is less than the given value.
652
663
  * @param {number} value
653
664
  * @memberof ConditionalFormatRuleBuilder
654
665
  */
655
- whenNumberLessThan(e) {
656
- return new i(this._initConfig).whenNumberLessThan(e);
666
+ whenNumberLessThan(value) {
667
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberLessThan(value);
657
668
  }
658
669
  /**
659
670
  * Sets the conditional formatting rule to fire when the value is less than or equal to the given value.
660
671
  * @param {number} value
661
672
  * @memberof ConditionalFormatRuleBuilder
662
673
  */
663
- whenNumberLessThanOrEqualTo(e) {
664
- return new i(this._initConfig).whenNumberLessThanOrEqualTo(e);
674
+ whenNumberLessThanOrEqualTo(value) {
675
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberLessThanOrEqualTo(value);
665
676
  }
666
677
  /**
667
678
  * Sets a conditional formatting rule to fire when a number is not between two specified values and is not equal to them.
@@ -669,159 +680,167 @@ class m {
669
680
  * @param {number} end
670
681
  * @memberof ConditionalFormatRuleBuilder
671
682
  */
672
- whenNumberNotBetween(e, t) {
673
- return new i(this._initConfig).whenNumberNotBetween(e, t);
683
+ whenNumberNotBetween(start, end) {
684
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberNotBetween(start, end);
674
685
  }
675
686
  /**
676
687
  * Sets the conditional formatting rule to fire when a number does not equal a given value.
677
688
  * @param value
678
689
  * @memberof ConditionalFormatRuleBuilder
679
690
  */
680
- whenNumberNotEqualTo(e) {
681
- return new i(this._initConfig).whenNumberNotEqualTo(e);
691
+ whenNumberNotEqualTo(value) {
692
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenNumberNotEqualTo(value);
682
693
  }
683
694
  /**
684
695
  * Sets the conditional formatting rule to fire when the input contains the given value.
685
696
  * @param {string} text
686
697
  * @memberof ConditionalFormatRuleBuilder
687
698
  */
688
- whenTextContains(e) {
689
- return new i(this._initConfig).whenTextContains(e);
699
+ whenTextContains(text) {
700
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextContains(text);
690
701
  }
691
702
  /**
692
703
  * Sets a conditional formatting rule to fire when the input does not contain the given value.
693
704
  * @param {string} text
694
705
  * @memberof ConditionalFormatRuleBuilder
695
706
  */
696
- whenTextDoesNotContain(e) {
697
- return new i(this._initConfig).whenTextDoesNotContain(e);
707
+ whenTextDoesNotContain(text) {
708
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextDoesNotContain(text);
698
709
  }
699
710
  /**
700
711
  * Sets a conditional formatting rule to fire when input ends with a specified value.
701
712
  * @param {string} text
702
713
  * @memberof ConditionalFormatRuleBuilder
703
714
  */
704
- whenTextEndsWith(e) {
705
- return new i(this._initConfig).whenTextEndsWith(e);
715
+ whenTextEndsWith(text) {
716
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextEndsWith(text);
706
717
  }
707
718
  /**
708
719
  * Sets the conditional formatting rule to fire when the input equals the given value.
709
720
  * @param {string} text
710
721
  * @memberof ConditionalFormatRuleBuilder
711
722
  */
712
- whenTextEqualTo(e) {
713
- return new i(this._initConfig).whenTextEqualTo(e);
723
+ whenTextEqualTo(text) {
724
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextEqualTo(text);
714
725
  }
715
726
  /**
716
727
  * Sets the conditional formatting rule to fire when the input value begins with the given value.
717
728
  * @param {string} text
718
729
  * @memberof ConditionalFormatRuleBuilder
719
730
  */
720
- whenTextStartsWith(e) {
721
- return new i(this._initConfig).whenTextStartsWith(e);
731
+ whenTextStartsWith(text) {
732
+ return new ConditionalFormatHighlightRuleBuilder(this._initConfig).whenTextStartsWith(text);
722
733
  }
723
- }
724
- class A extends v {
734
+ };
735
+ __name(_FConditionalFormattingBuilder, "FConditionalFormattingBuilder");
736
+ let FConditionalFormattingBuilder = _FConditionalFormattingBuilder;
737
+ const _FRangeConditionalFormattingMixin = class _FRangeConditionalFormattingMixin extends FRange {
725
738
  _getConditionalFormattingRuleModel() {
726
- return this._injector.get(x);
739
+ return this._injector.get(ConditionalFormattingRuleModel);
727
740
  }
728
741
  getConditionalFormattingRules() {
729
- return [...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(), this._worksheet.getSheetId()) || []].filter((t) => t.ranges.some((r) => U.intersects(r, this._range)));
742
+ return [...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(), this._worksheet.getSheetId()) || []].filter((rule) => rule.ranges.some((range) => Rectangle.intersects(range, this._range)));
730
743
  }
731
744
  createConditionalFormattingRule() {
732
- return new m({ ranges: [this._range] });
745
+ return new FConditionalFormattingBuilder({ ranges: [this._range] });
733
746
  }
734
- addConditionalFormattingRule(e) {
735
- const t = {
736
- rule: e,
747
+ addConditionalFormattingRule(rule) {
748
+ const params = {
749
+ rule,
737
750
  unitId: this._workbook.getUnitId(),
738
751
  subUnitId: this._worksheet.getSheetId()
739
752
  };
740
- return this._commandService.syncExecuteCommand(S.id, t), this;
753
+ return this._commandService.syncExecuteCommand(AddConditionalRuleMutation.id, params), this;
741
754
  }
742
- deleteConditionalFormattingRule(e) {
743
- const t = {
755
+ deleteConditionalFormattingRule(cfId) {
756
+ const params = {
744
757
  unitId: this._workbook.getUnitId(),
745
758
  subUnitId: this._worksheet.getSheetId(),
746
- cfId: e
759
+ cfId
747
760
  };
748
- return this._commandService.syncExecuteCommand(I.id, t), this;
761
+ return this._commandService.syncExecuteCommand(DeleteConditionalRuleMutation.id, params), this;
749
762
  }
750
- moveConditionalFormattingRule(e, t, r = "after") {
751
- const s = {
763
+ moveConditionalFormattingRule(cfId, toCfId, type = "after") {
764
+ const params = {
752
765
  unitId: this._workbook.getUnitId(),
753
766
  subUnitId: this._worksheet.getSheetId(),
754
- start: { id: e, type: "self" },
755
- end: { id: t, type: r }
767
+ start: { id: cfId, type: "self" },
768
+ end: { id: toCfId, type }
756
769
  };
757
- return this._commandService.syncExecuteCommand(E.id, s), this;
770
+ return this._commandService.syncExecuteCommand(MoveConditionalRuleMutation.id, params), this;
758
771
  }
759
- setConditionalFormattingRule(e, t) {
760
- const r = {
772
+ setConditionalFormattingRule(cfId, rule) {
773
+ const params = {
761
774
  unitId: this._workbook.getUnitId(),
762
775
  subUnitId: this._worksheet.getSheetId(),
763
- rule: t,
764
- cfId: e
776
+ rule,
777
+ cfId
765
778
  };
766
- return this._commandService.syncExecuteCommand(k.id, r), this;
779
+ return this._commandService.syncExecuteCommand(SetConditionalRuleMutation.id, params), this;
767
780
  }
768
- }
769
- v.extend(A);
770
- class D extends F {
781
+ };
782
+ __name(_FRangeConditionalFormattingMixin, "FRangeConditionalFormattingMixin");
783
+ let FRangeConditionalFormattingMixin = _FRangeConditionalFormattingMixin;
784
+ FRange.extend(FRangeConditionalFormattingMixin);
785
+ const _FWorkbookConditionalFormattingMixin = class _FWorkbookConditionalFormattingMixin extends FWorkbook {
771
786
  newColor() {
772
- return new B();
787
+ return new ColorBuilder();
773
788
  }
774
- }
775
- F.extend(D);
776
- class V extends R {
789
+ };
790
+ __name(_FWorkbookConditionalFormattingMixin, "FWorkbookConditionalFormattingMixin");
791
+ let FWorkbookConditionalFormattingMixin = _FWorkbookConditionalFormattingMixin;
792
+ FWorkbook.extend(FWorkbookConditionalFormattingMixin);
793
+ const _FWorksheetConditionalFormattingMixin = class _FWorksheetConditionalFormattingMixin extends FWorksheet {
777
794
  _getConditionalFormattingRuleModel() {
778
- return this._injector.get(x);
795
+ return this._injector.get(ConditionalFormattingRuleModel);
779
796
  }
780
797
  getConditionalFormattingRules() {
781
798
  return [...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(), this._worksheet.getSheetId()) || []];
782
799
  }
783
800
  createConditionalFormattingRule() {
784
- return new m();
801
+ return new FConditionalFormattingBuilder();
785
802
  }
786
803
  newConditionalFormattingRule() {
787
- return new m();
804
+ return new FConditionalFormattingBuilder();
788
805
  }
789
- addConditionalFormattingRule(e) {
790
- const t = {
791
- rule: e,
806
+ addConditionalFormattingRule(rule) {
807
+ const params = {
808
+ rule,
792
809
  unitId: this._workbook.getUnitId(),
793
810
  subUnitId: this._worksheet.getSheetId()
794
811
  };
795
- return this._commandService.syncExecuteCommand(S.id, t), this;
812
+ return this._commandService.syncExecuteCommand(AddConditionalRuleMutation.id, params), this;
796
813
  }
797
- deleteConditionalFormattingRule(e) {
798
- const t = {
814
+ deleteConditionalFormattingRule(cfId) {
815
+ const params = {
799
816
  unitId: this._workbook.getUnitId(),
800
817
  subUnitId: this._worksheet.getSheetId(),
801
- cfId: e
818
+ cfId
802
819
  };
803
- return this._commandService.syncExecuteCommand(I.id, t), this;
820
+ return this._commandService.syncExecuteCommand(DeleteConditionalRuleMutation.id, params), this;
804
821
  }
805
- moveConditionalFormattingRule(e, t, r = "after") {
806
- const s = {
822
+ moveConditionalFormattingRule(cfId, toCfId, type = "after") {
823
+ const params = {
807
824
  unitId: this._workbook.getUnitId(),
808
825
  subUnitId: this._worksheet.getSheetId(),
809
- start: { id: e, type: "self" },
810
- end: { id: t, type: r }
826
+ start: { id: cfId, type: "self" },
827
+ end: { id: toCfId, type }
811
828
  };
812
- return this._commandService.syncExecuteCommand(E.id, s), this;
829
+ return this._commandService.syncExecuteCommand(MoveConditionalRuleMutation.id, params), this;
813
830
  }
814
- setConditionalFormattingRule(e, t) {
815
- const r = {
831
+ setConditionalFormattingRule(cfId, rule) {
832
+ const params = {
816
833
  unitId: this._workbook.getUnitId(),
817
834
  subUnitId: this._worksheet.getSheetId(),
818
- rule: t,
819
- cfId: e
835
+ rule,
836
+ cfId
820
837
  };
821
- return this._commandService.syncExecuteCommand(k.id, r), this;
838
+ return this._commandService.syncExecuteCommand(SetConditionalRuleMutation.id, params), this;
822
839
  }
823
- }
824
- R.extend(V);
840
+ };
841
+ __name(_FWorksheetConditionalFormattingMixin, "FWorksheetConditionalFormattingMixin");
842
+ let FWorksheetConditionalFormattingMixin = _FWorksheetConditionalFormattingMixin;
843
+ FWorksheet.extend(FWorksheetConditionalFormattingMixin);
825
844
  export {
826
- m as FConditionalFormattingBuilder
845
+ FConditionalFormattingBuilder
827
846
  };