@univerjs/sheets-data-validation 0.5.4-nightly.202501200849 → 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,19 +1,20 @@
1
- var j = Object.defineProperty;
2
- var q = (c, e, t) => e in c ? j(c, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : c[e] = t;
3
- var f = (c, e, t) => q(c, typeof e != "symbol" ? e + "" : e, t);
4
- import { UpdateSheetDataValidationSettingCommand as U, UpdateSheetDataValidationOptionsCommand as v, UpdateSheetDataValidationRangeCommand as C, RemoveSheetDataValidationCommand as T, ClearRangeDataValidationCommand as W, AddSheetDataValidationCommand as A, SheetsDataValidationValidatorService as S, SheetDataValidationModel as V, RemoveSheetAllDataValidationCommand as O } from "@univerjs/sheets-data-validation";
5
- import { FRange as y, FWorkbook as M, FWorksheet as N } from "@univerjs/sheets/facade";
6
- import { generateRandomId as B, DataValidationType as o, DataValidationErrorStyle as w, DataValidationOperator as h, IUniverInstanceService as H, ICommandService as p, FUniver as x, CanceledError as _, toDisposable as g, FEventName as $ } from "@univerjs/core";
7
- import { DataValidationModel as b, getRuleOptions as F } from "@univerjs/data-validation";
8
- import { serializeRangeToRefString as P } from "@univerjs/engine-formula";
9
- import { filter as R } from "rxjs";
10
- class D {
11
- constructor(e) {
12
- f(this, "_rule");
13
- this._rule = e != null ? e : {
14
- uid: B(),
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 { UpdateSheetDataValidationSettingCommand, UpdateSheetDataValidationOptionsCommand, UpdateSheetDataValidationRangeCommand, RemoveSheetDataValidationCommand, ClearRangeDataValidationCommand, AddSheetDataValidationCommand, SheetsDataValidationValidatorService, SheetDataValidationModel, RemoveSheetAllDataValidationCommand } from "@univerjs/sheets-data-validation";
6
+ import { FRange, FWorkbook, FWorksheet } from "@univerjs/sheets/facade";
7
+ import { generateRandomId, DataValidationType, DataValidationErrorStyle, DataValidationOperator, IUniverInstanceService, ICommandService, FUniver, CanceledError, toDisposable, FEventName } from "@univerjs/core";
8
+ import { DataValidationModel, getRuleOptions } from "@univerjs/data-validation";
9
+ import { serializeRangeToRefString } from "@univerjs/engine-formula";
10
+ import { filter } from "rxjs";
11
+ const _FDataValidationBuilder = class _FDataValidationBuilder {
12
+ constructor(rule) {
13
+ __publicField(this, "_rule");
14
+ this._rule = rule != null ? rule : {
15
+ uid: generateRandomId(),
15
16
  ranges: void 0,
16
- type: o.CUSTOM
17
+ type: DataValidationType.CUSTOM
17
18
  };
18
19
  }
19
20
  /**
@@ -26,7 +27,7 @@ class D {
26
27
  * ```
27
28
  */
28
29
  build() {
29
- return new m(this._rule);
30
+ return new FDataValidation(this._rule);
30
31
  }
31
32
  /**
32
33
  * Creates a duplicate of the current DataValidationBuilder object
@@ -38,9 +39,9 @@ class D {
38
39
  * ```
39
40
  */
40
41
  copy() {
41
- return new D({
42
+ return new _FDataValidationBuilder({
42
43
  ...this._rule,
43
- uid: B()
44
+ uid: generateRandomId()
44
45
  });
45
46
  }
46
47
  /**
@@ -53,7 +54,7 @@ class D {
53
54
  * ```
54
55
  */
55
56
  getAllowInvalid() {
56
- return this._rule.errorStyle !== w.STOP;
57
+ return this._rule.errorStyle !== DataValidationErrorStyle.STOP;
57
58
  }
58
59
  /**
59
60
  * Gets the data validation type of the rule
@@ -102,8 +103,8 @@ class D {
102
103
  * const rule = builder.requireCheckbox('Yes', 'No').build();
103
104
  * ```
104
105
  */
105
- requireCheckbox(e, t) {
106
- return this._rule.type = o.CHECKBOX, this._rule.formula1 = e, this._rule.formula2 = t, this;
106
+ requireCheckbox(checkedValue, uncheckedValue) {
107
+ return this._rule.type = DataValidationType.CHECKBOX, this._rule.formula1 = checkedValue, this._rule.formula2 = uncheckedValue, this;
107
108
  }
108
109
  /**
109
110
  * Set the data validation type to DATE and configure the validation rules to be after a specific date
@@ -115,8 +116,8 @@ class D {
115
116
  * const rule = builder.requireDateAfter(new Date('2024-01-01')).build();
116
117
  * ```
117
118
  */
118
- requireDateAfter(e) {
119
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.operator = h.GREATER_THAN, this;
119
+ requireDateAfter(date) {
120
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = date.toLocaleDateString(), this._rule.operator = DataValidationOperator.GREATER_THAN, this;
120
121
  }
121
122
  /**
122
123
  * Set the data validation type to DATE and configure the validation rules to be before a specific date
@@ -128,8 +129,8 @@ class D {
128
129
  * const rule = builder.requireDateBefore(new Date('2024-12-31')).build();
129
130
  * ```
130
131
  */
131
- requireDateBefore(e) {
132
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = h.LESS_THAN, this;
132
+ requireDateBefore(date) {
133
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = date.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.LESS_THAN, this;
133
134
  }
134
135
  /**
135
136
  * Set the data validation type to DATE and configure the validation rules to be within a specific date range
@@ -144,8 +145,8 @@ class D {
144
145
  * .build();
145
146
  * ```
146
147
  */
147
- requireDateBetween(e, t) {
148
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.formula2 = t.toLocaleDateString(), this._rule.operator = h.BETWEEN, this;
148
+ requireDateBetween(start, end) {
149
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = start.toLocaleDateString(), this._rule.formula2 = end.toLocaleDateString(), this._rule.operator = DataValidationOperator.BETWEEN, this;
149
150
  }
150
151
  /**
151
152
  * Set the data validation type to DATE and configure the validation rules to be equal to a specific date
@@ -157,8 +158,8 @@ class D {
157
158
  * const rule = builder.requireDateEqualTo(new Date('2024-01-01')).build();
158
159
  * ```
159
160
  */
160
- requireDateEqualTo(e) {
161
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = h.EQUAL, this;
161
+ requireDateEqualTo(date) {
162
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = date.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.EQUAL, this;
162
163
  }
163
164
  /**
164
165
  * Set the data validation type to DATE and configure the validation rules to be not within a specific date range
@@ -173,8 +174,8 @@ class D {
173
174
  * .build();
174
175
  * ```
175
176
  */
176
- requireDateNotBetween(e, t) {
177
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.formula2 = t.toLocaleDateString(), this._rule.operator = h.NOT_BETWEEN, this;
177
+ requireDateNotBetween(start, end) {
178
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = start.toLocaleDateString(), this._rule.formula2 = end.toLocaleDateString(), this._rule.operator = DataValidationOperator.NOT_BETWEEN, this;
178
179
  }
179
180
  /**
180
181
  * Set the data validation type to DATE and configure the validation rules to be on or after a specific date
@@ -186,8 +187,8 @@ class D {
186
187
  * const rule = builder.requireDateOnOrAfter(new Date('2024-01-01')).build();
187
188
  * ```
188
189
  */
189
- requireDateOnOrAfter(e) {
190
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = h.GREATER_THAN_OR_EQUAL, this;
190
+ requireDateOnOrAfter(date) {
191
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = date.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.GREATER_THAN_OR_EQUAL, this;
191
192
  }
192
193
  /**
193
194
  * Set the data validation type to DATE and configure the validation rules to be on or before a specific date
@@ -199,8 +200,8 @@ class D {
199
200
  * const rule = builder.requireDateOnOrBefore(new Date('2024-12-31')).build();
200
201
  * ```
201
202
  */
202
- requireDateOnOrBefore(e) {
203
- return this._rule.type = o.DATE, this._rule.formula1 = e.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = h.LESS_THAN_OR_EQUAL, this;
203
+ requireDateOnOrBefore(date) {
204
+ return this._rule.type = DataValidationType.DATE, this._rule.formula1 = date.toLocaleDateString(), this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.LESS_THAN_OR_EQUAL, this;
204
205
  }
205
206
  /**
206
207
  * Requires that a custom formula be satisfied
@@ -212,8 +213,8 @@ class D {
212
213
  * const rule = builder.requireFormulaSatisfied('=A1>0').build();
213
214
  * ```
214
215
  */
215
- requireFormulaSatisfied(e) {
216
- return this._rule.type = o.CUSTOM, this._rule.formula1 = e, this._rule.formula2 = void 0, this;
216
+ requireFormulaSatisfied(formula) {
217
+ return this._rule.type = DataValidationType.CUSTOM, this._rule.formula1 = formula, this._rule.formula2 = void 0, this;
217
218
  }
218
219
  /**
219
220
  * Requires the user to enter a number within a specific range, which can be integer or decimal
@@ -227,8 +228,8 @@ class D {
227
228
  * const rule = builder.requireNumberBetween(1, 10).build();
228
229
  * ```
229
230
  */
230
- requireNumberBetween(e, t, r) {
231
- return this._rule.formula1 = `${e}`, this._rule.formula2 = `${t}`, this._rule.operator = h.BETWEEN, this._rule.type = r ? o.WHOLE : o.DECIMAL, this;
231
+ requireNumberBetween(start, end, isInteger) {
232
+ return this._rule.formula1 = `${start}`, this._rule.formula2 = `${end}`, this._rule.operator = DataValidationOperator.BETWEEN, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
232
233
  }
233
234
  /**
234
235
  * Requires the user to enter a number that is equal to a specific value, which can be an integer or a decimal
@@ -241,8 +242,8 @@ class D {
241
242
  * const rule = builder.requireNumberEqualTo(10).build();
242
243
  * ```
243
244
  */
244
- requireNumberEqualTo(e, t) {
245
- return this._rule.formula1 = `${e}`, this._rule.formula2 = void 0, this._rule.operator = h.EQUAL, this._rule.type = t ? o.WHOLE : o.DECIMAL, this;
245
+ requireNumberEqualTo(num, isInteger) {
246
+ return this._rule.formula1 = `${num}`, this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.EQUAL, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
246
247
  }
247
248
  /**
248
249
  * Requires the user to enter a number that is greater than a specific value, which can be an integer or a decimal
@@ -255,8 +256,8 @@ class D {
255
256
  * const rule = builder.requireNumberGreaterThan(10).build();
256
257
  * ```
257
258
  */
258
- requireNumberGreaterThan(e, t) {
259
- return this._rule.formula1 = `${e}`, this._rule.formula2 = void 0, this._rule.operator = h.GREATER_THAN, this._rule.type = t ? o.WHOLE : o.DECIMAL, this;
259
+ requireNumberGreaterThan(num, isInteger) {
260
+ return this._rule.formula1 = `${num}`, this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.GREATER_THAN, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
260
261
  }
261
262
  /**
262
263
  * Requires the user to enter a number that is greater than or equal to a specific value, which can be an integer or a decimal
@@ -269,8 +270,8 @@ class D {
269
270
  * const rule = builder.requireNumberGreaterThanOrEqualTo(10).build();
270
271
  * ```
271
272
  */
272
- requireNumberGreaterThanOrEqualTo(e, t) {
273
- return this._rule.formula1 = `${e}`, this._rule.formula2 = void 0, this._rule.operator = h.GREATER_THAN_OR_EQUAL, this._rule.type = t ? o.WHOLE : o.DECIMAL, this;
273
+ requireNumberGreaterThanOrEqualTo(num, isInteger) {
274
+ return this._rule.formula1 = `${num}`, this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.GREATER_THAN_OR_EQUAL, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
274
275
  }
275
276
  /**
276
277
  * Requires the user to enter a number that is less than a specific value, which can be an integer or a decimal
@@ -283,8 +284,8 @@ class D {
283
284
  * const rule = builder.requireNumberLessThan(10).build();
284
285
  * ```
285
286
  */
286
- requireNumberLessThan(e, t) {
287
- return this._rule.formula1 = `${e}`, this._rule.formula2 = void 0, this._rule.operator = h.LESS_THAN, this._rule.type = t ? o.WHOLE : o.DECIMAL, this;
287
+ requireNumberLessThan(num, isInteger) {
288
+ return this._rule.formula1 = `${num}`, this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.LESS_THAN, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
288
289
  }
289
290
  /**
290
291
  * Sets the data validation rule to require a number less than or equal to a specified value
@@ -298,8 +299,8 @@ class D {
298
299
  * const rule = builder.requireNumberLessThanOrEqualTo(10).build();
299
300
  * ```
300
301
  */
301
- requireNumberLessThanOrEqualTo(e, t) {
302
- return this._rule.formula1 = `${e}`, this._rule.formula2 = void 0, this._rule.operator = h.LESS_THAN_OR_EQUAL, this._rule.type = t ? o.WHOLE : o.DECIMAL, this;
302
+ requireNumberLessThanOrEqualTo(num, isInteger) {
303
+ return this._rule.formula1 = `${num}`, this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.LESS_THAN_OR_EQUAL, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
303
304
  }
304
305
  /**
305
306
  * Sets a data validation rule that requires the user to enter a number outside a specified range
@@ -314,8 +315,8 @@ class D {
314
315
  * const rule = builder.requireNumberNotBetween(1, 10).build();
315
316
  * ```
316
317
  */
317
- requireNumberNotBetween(e, t, r) {
318
- return this._rule.formula1 = `${e}`, this._rule.formula2 = `${t}`, this._rule.operator = h.NOT_BETWEEN, this._rule.type = r ? o.WHOLE : o.DECIMAL, this;
318
+ requireNumberNotBetween(start, end, isInteger) {
319
+ return this._rule.formula1 = `${start}`, this._rule.formula2 = `${end}`, this._rule.operator = DataValidationOperator.NOT_BETWEEN, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
319
320
  }
320
321
  /**
321
322
  * Creates a data validation rule that requires the user to enter a number that is not equal to a specific value
@@ -329,8 +330,8 @@ class D {
329
330
  * const rule = builder.requireNumberNotEqualTo(10).build();
330
331
  * ```
331
332
  */
332
- requireNumberNotEqualTo(e, t) {
333
- return this._rule.formula1 = `${e}`, this._rule.formula2 = void 0, this._rule.operator = h.NOT_EQUAL, this._rule.type = t ? o.WHOLE : o.DECIMAL, this;
333
+ requireNumberNotEqualTo(num, isInteger) {
334
+ return this._rule.formula1 = `${num}`, this._rule.formula2 = void 0, this._rule.operator = DataValidationOperator.NOT_EQUAL, this._rule.type = isInteger ? DataValidationType.WHOLE : DataValidationType.DECIMAL, this;
334
335
  }
335
336
  /**
336
337
  * Sets a data validation rule that requires the user to enter a value from a list of specific values
@@ -345,8 +346,8 @@ class D {
345
346
  * const rule = builder.requireValueInList(['Yes', 'No']).build();
346
347
  * ```
347
348
  */
348
- requireValueInList(e, t, r) {
349
- return this._rule.type = t ? o.LIST_MULTIPLE : o.LIST, this._rule.formula1 = e.join(","), this._rule.formula2 = void 0, this._rule.showDropDown = r != null ? r : !0, this;
349
+ requireValueInList(values, multiple, showDropdown) {
350
+ return this._rule.type = multiple ? DataValidationType.LIST_MULTIPLE : DataValidationType.LIST, this._rule.formula1 = values.join(","), this._rule.formula2 = void 0, this._rule.showDropDown = showDropdown != null ? showDropdown : !0, this;
350
351
  }
351
352
  /**
352
353
  * Sets a data validation rule that requires the user to enter a value within a specific range
@@ -362,12 +363,12 @@ class D {
362
363
  * const rule = builder.requireValueInRange(range).build();
363
364
  * ```
364
365
  */
365
- requireValueInRange(e, t, r) {
366
- return this._rule.type = t ? o.LIST_MULTIPLE : o.LIST, this._rule.formula1 = `=${P({
367
- unitId: e.getUnitId(),
368
- sheetName: e.getSheetName(),
369
- range: e.getRange()
370
- })}`, this._rule.formula2 = void 0, this._rule.showDropDown = r != null ? r : !0, this;
366
+ requireValueInRange(range, multiple, showDropdown) {
367
+ return this._rule.type = multiple ? DataValidationType.LIST_MULTIPLE : DataValidationType.LIST, this._rule.formula1 = `=${serializeRangeToRefString({
368
+ unitId: range.getUnitId(),
369
+ sheetName: range.getSheetName(),
370
+ range: range.getRange()
371
+ })}`, this._rule.formula2 = void 0, this._rule.showDropDown = showDropdown != null ? showDropdown : !0, this;
371
372
  }
372
373
  /**
373
374
  * Sets whether to allow invalid data and configures the error style
@@ -381,8 +382,8 @@ class D {
381
382
  * const rule = builder.setAllowInvalid(true).build();
382
383
  * ```
383
384
  */
384
- setAllowInvalid(e) {
385
- return this._rule.errorStyle = e ? w.WARNING : w.STOP, this;
385
+ setAllowInvalid(allowInvalidData) {
386
+ return this._rule.errorStyle = allowInvalidData ? DataValidationErrorStyle.WARNING : DataValidationErrorStyle.STOP, this;
386
387
  }
387
388
  /**
388
389
  * Sets whether to allow blank values
@@ -394,8 +395,8 @@ class D {
394
395
  * const rule = builder.setAllowBlank(true).build();
395
396
  * ```
396
397
  */
397
- setAllowBlank(e) {
398
- return this._rule.allowBlank = e, this;
398
+ setAllowBlank(allowBlank) {
399
+ return this._rule.allowBlank = allowBlank, this;
399
400
  }
400
401
  /**
401
402
  * Sets the options for the data validation rule
@@ -411,16 +412,18 @@ class D {
411
412
  * }).build();
412
413
  * ```
413
414
  */
414
- setOptions(e) {
415
- return Object.assign(this._rule, e), this;
415
+ setOptions(options) {
416
+ return Object.assign(this._rule, options), this;
416
417
  }
417
- }
418
- class m {
419
- constructor(e, t, r) {
420
- f(this, "rule");
421
- f(this, "_worksheet");
422
- f(this, "_injector");
423
- this._injector = r, this.rule = e, this._worksheet = t;
418
+ };
419
+ __name(_FDataValidationBuilder, "FDataValidationBuilder");
420
+ let FDataValidationBuilder = _FDataValidationBuilder;
421
+ const _FDataValidation = class _FDataValidation {
422
+ constructor(rule, worksheet, _injector) {
423
+ __publicField(this, "rule");
424
+ __publicField(this, "_worksheet");
425
+ __publicField(this, "_injector");
426
+ this._injector = _injector, this.rule = rule, this._worksheet = worksheet;
424
427
  }
425
428
  /**
426
429
  * Gets whether invalid data is allowed based on the error style value
@@ -436,7 +439,7 @@ class m {
436
439
  * ```
437
440
  */
438
441
  getAllowInvalid() {
439
- return this.rule.errorStyle !== w.STOP;
442
+ return this.rule.errorStyle !== DataValidationErrorStyle.STOP;
440
443
  }
441
444
  /**
442
445
  * Gets the data validation type of the rule
@@ -501,7 +504,7 @@ class m {
501
504
  * ```
502
505
  */
503
506
  copy() {
504
- return new D(this.rule);
507
+ return new FDataValidationBuilder(this.rule);
505
508
  }
506
509
  /**
507
510
  * Gets whether the data validation rule is applied to the worksheet
@@ -519,8 +522,8 @@ class m {
519
522
  getApplied() {
520
523
  if (!this._worksheet)
521
524
  return !1;
522
- const t = this._injector.get(b).getRuleById(this._worksheet.getUnitId(), this._worksheet.getSheetId(), this.rule.uid);
523
- return !!(t && t.ranges.length);
525
+ const currentRule = this._injector.get(DataValidationModel).getRuleById(this._worksheet.getUnitId(), this._worksheet.getSheetId(), this.rule.uid);
526
+ return !!(currentRule && currentRule.ranges.length);
524
527
  }
525
528
  /**
526
529
  * Gets the ranges to which the data validation rule is applied
@@ -538,8 +541,8 @@ class m {
538
541
  getRanges() {
539
542
  if (!this.getApplied())
540
543
  return [];
541
- const e = this._injector.get(H).getUnit(this._worksheet.getUnitId());
542
- return this.rule.ranges.map((t) => this._injector.createInstance(y, e, this._worksheet, t));
544
+ const workbook = this._injector.get(IUniverInstanceService).getUnit(this._worksheet.getUnitId());
545
+ return this.rule.ranges.map((range) => this._injector.createInstance(FRange, workbook, this._worksheet, range));
543
546
  }
544
547
  /**
545
548
  * Gets the unit ID of the worksheet
@@ -555,8 +558,8 @@ class m {
555
558
  * ```
556
559
  */
557
560
  getUnitId() {
558
- var e;
559
- return (e = this._worksheet) == null ? void 0 : e.getUnitId();
561
+ var _a;
562
+ return (_a = this._worksheet) == null ? void 0 : _a.getUnitId();
560
563
  }
561
564
  /**
562
565
  * Gets the sheet ID of the worksheet
@@ -572,8 +575,8 @@ class m {
572
575
  * ```
573
576
  */
574
577
  getSheetId() {
575
- var e;
576
- return (e = this._worksheet) == null ? void 0 : e.getSheetId();
578
+ var _a;
579
+ return (_a = this._worksheet) == null ? void 0 : _a.getSheetId();
577
580
  }
578
581
  /**
579
582
  * Set Criteria for the data validation rule
@@ -595,21 +598,21 @@ class m {
595
598
  * );
596
599
  * ```
597
600
  */
598
- setCriteria(e, t, r = !0) {
599
- if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(U.id, {
601
+ setCriteria(type, values, allowBlank = !0) {
602
+ if (this.getApplied() && !this._injector.get(ICommandService).syncExecuteCommand(UpdateSheetDataValidationSettingCommand.id, {
600
603
  unitId: this.getUnitId(),
601
604
  subUnitId: this.getSheetId(),
602
605
  ruleId: this.rule.uid,
603
606
  setting: {
604
- operator: t[0],
605
- formula1: t[1],
606
- formula2: t[2],
607
+ operator: values[0],
608
+ formula1: values[1],
609
+ formula2: values[2],
607
610
  type: this.rule.type,
608
- allowBlank: r
611
+ allowBlank
609
612
  }
610
613
  }))
611
614
  throw new Error("setCriteria failed");
612
- return this.rule.operator = t[0], this.rule.formula1 = t[1], this.rule.formula2 = t[2], this.rule.type = e, this.rule.allowBlank = r, this;
615
+ return this.rule.operator = values[0], this.rule.formula1 = values[1], this.rule.formula2 = values[2], this.rule.type = type, this.rule.allowBlank = allowBlank, this;
613
616
  }
614
617
  /**
615
618
  * Set the options for the data validation rule
@@ -629,18 +632,18 @@ class m {
629
632
  * });
630
633
  * ```
631
634
  */
632
- setOptions(e) {
633
- if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(v.id, {
635
+ setOptions(options) {
636
+ if (this.getApplied() && !this._injector.get(ICommandService).syncExecuteCommand(UpdateSheetDataValidationOptionsCommand.id, {
634
637
  unitId: this.getUnitId(),
635
638
  subUnitId: this.getSheetId(),
636
639
  ruleId: this.rule.uid,
637
640
  options: {
638
- ...F(this.rule),
639
- ...e
641
+ ...getRuleOptions(this.rule),
642
+ ...options
640
643
  }
641
644
  }))
642
645
  throw new Error("setOptions failed");
643
- return Object.assign(this.rule, e), this;
646
+ return Object.assign(this.rule, options), this;
644
647
  }
645
648
  /**
646
649
  * Set the ranges to the data validation rule
@@ -657,15 +660,15 @@ class m {
657
660
  * dataValidation.setRanges([range]);
658
661
  * ```
659
662
  */
660
- setRanges(e) {
661
- if (this.getApplied() && !this._injector.get(p).syncExecuteCommand(C.id, {
663
+ setRanges(ranges) {
664
+ if (this.getApplied() && !this._injector.get(ICommandService).syncExecuteCommand(UpdateSheetDataValidationRangeCommand.id, {
662
665
  unitId: this.getUnitId(),
663
666
  subUnitId: this.getSheetId(),
664
667
  ruleId: this.rule.uid,
665
- ranges: e.map((a) => a.getRange())
668
+ ranges: ranges.map((range) => range.getRange())
666
669
  }))
667
670
  throw new Error("setRanges failed");
668
- return this.rule.ranges = e.map((t) => t.getRange()), this;
671
+ return this.rule.ranges = ranges.map((range) => range.getRange()), this;
669
672
  }
670
673
  /**
671
674
  * Delete the data validation rule from the worksheet
@@ -681,63 +684,67 @@ class m {
681
684
  * ```
682
685
  */
683
686
  delete() {
684
- return this.getApplied() ? this._injector.get(p).syncExecuteCommand(T.id, {
687
+ return this.getApplied() ? this._injector.get(ICommandService).syncExecuteCommand(RemoveSheetDataValidationCommand.id, {
685
688
  unitId: this.getUnitId(),
686
689
  subUnitId: this.getSheetId(),
687
690
  ruleId: this.rule.uid
688
691
  }) : !1;
689
692
  }
690
- }
691
- class G extends y {
692
- setDataValidation(e) {
693
- if (!e)
694
- return this._commandService.syncExecuteCommand(W.id, {
693
+ };
694
+ __name(_FDataValidation, "FDataValidation");
695
+ let FDataValidation = _FDataValidation;
696
+ const _FRangeDataValidationMixin = class _FRangeDataValidationMixin extends FRange {
697
+ setDataValidation(rule) {
698
+ if (!rule)
699
+ return this._commandService.syncExecuteCommand(ClearRangeDataValidationCommand.id, {
695
700
  unitId: this._workbook.getUnitId(),
696
701
  subUnitId: this._worksheet.getSheetId(),
697
702
  ranges: [this._range]
698
703
  }), this;
699
- const t = {
704
+ const params = {
700
705
  unitId: this._workbook.getUnitId(),
701
706
  subUnitId: this._worksheet.getSheetId(),
702
707
  rule: {
703
- ...e.rule,
708
+ ...rule.rule,
704
709
  ranges: [this._range]
705
710
  }
706
711
  };
707
- return this._commandService.syncExecuteCommand(A.id, t), this;
712
+ return this._commandService.syncExecuteCommand(AddSheetDataValidationCommand.id, params), this;
708
713
  }
709
714
  getDataValidation() {
710
- const t = this._injector.get(S).getDataValidation(
715
+ const rule = this._injector.get(SheetsDataValidationValidatorService).getDataValidation(
711
716
  this._workbook.getUnitId(),
712
717
  this._worksheet.getSheetId(),
713
718
  [this._range]
714
719
  );
715
- return t && new m(t, this._worksheet, this._injector);
720
+ return rule && new FDataValidation(rule, this._worksheet, this._injector);
716
721
  }
717
722
  getDataValidations() {
718
- return this._injector.get(S).getDataValidations(
723
+ return this._injector.get(SheetsDataValidationValidatorService).getDataValidations(
719
724
  this._workbook.getUnitId(),
720
725
  this._worksheet.getSheetId(),
721
726
  [this._range]
722
- ).map((t) => new m(t, this._worksheet, this._injector));
727
+ ).map((rule) => new FDataValidation(rule, this._worksheet, this._injector));
723
728
  }
724
729
  async getValidatorStatus() {
725
- return this._injector.get(S).validatorRanges(
730
+ return this._injector.get(SheetsDataValidationValidatorService).validatorRanges(
726
731
  this._workbook.getUnitId(),
727
732
  this._worksheet.getSheetId(),
728
733
  [this._range]
729
734
  );
730
735
  }
731
- }
732
- y.extend(G);
733
- class Q extends x {
736
+ };
737
+ __name(_FRangeDataValidationMixin, "FRangeDataValidationMixin");
738
+ let FRangeDataValidationMixin = _FRangeDataValidationMixin;
739
+ FRange.extend(FRangeDataValidationMixin);
740
+ const _FUnvierDataValidationMixin = class _FUnvierDataValidationMixin extends FUniver {
734
741
  // eslint-disable-next-line jsdoc/require-returns
735
742
  /**
736
743
  /**
737
744
  * @deprecated use `univerAPI.newDataValidation()` as instead.
738
745
  */
739
746
  static newDataValidation() {
740
- return new D();
747
+ return new FDataValidationBuilder();
741
748
  }
742
749
  /**
743
750
  * Creates a new instance of FDataValidationBuilder
@@ -749,234 +756,241 @@ class Q extends x {
749
756
  * ```
750
757
  */
751
758
  newDataValidation() {
752
- return new D();
759
+ return new FDataValidationBuilder();
753
760
  }
761
+ /**
762
+ * @ignore
763
+ */
754
764
  // eslint-disable-next-line max-lines-per-function
755
- _initialize(e) {
756
- if (!e.has(V)) return;
757
- const t = e.get(V), r = e.get(p);
758
- this.disposeWithMe(t.ruleChange$.subscribe((a) => {
759
- const { unitId: i, subUnitId: n, rule: d, oldRule: u, type: s } = a, l = this.getSheetTarget(i, n);
760
- if (!l)
765
+ _initialize(injector) {
766
+ if (!injector.has(SheetDataValidationModel)) return;
767
+ const sheetDataValidationModel = injector.get(SheetDataValidationModel), commadnService = injector.get(ICommandService);
768
+ this.disposeWithMe(sheetDataValidationModel.ruleChange$.subscribe((ruleChange) => {
769
+ const { unitId, subUnitId, rule, oldRule, type } = ruleChange, target = this.getSheetTarget(unitId, subUnitId);
770
+ if (!target)
761
771
  return;
762
- const { workbook: I, worksheet: k } = l, E = new m(d, k.getSheet(), this._injector);
772
+ const { workbook, worksheet } = target, fRule = new FDataValidation(rule, worksheet.getSheet(), this._injector);
763
773
  this.fireEvent(this.Event.SheetDataValidationChanged, {
764
- origin: a,
765
- worksheet: k,
766
- workbook: I,
767
- changeType: s,
768
- oldRule: u,
769
- rule: E
774
+ origin: ruleChange,
775
+ worksheet,
776
+ workbook,
777
+ changeType: type,
778
+ oldRule,
779
+ rule: fRule
770
780
  });
771
- })), this.disposeWithMe(t.validStatusChange$.subscribe((a) => {
772
- const { unitId: i, subUnitId: n, ruleId: d, status: u, row: s, col: l } = a, I = this.getSheetTarget(i, n);
773
- if (!I)
781
+ })), this.disposeWithMe(sheetDataValidationModel.validStatusChange$.subscribe((statusChange) => {
782
+ const { unitId, subUnitId, ruleId, status, row, col } = statusChange, target = this.getSheetTarget(unitId, subUnitId);
783
+ if (!target)
774
784
  return;
775
- const { workbook: k, worksheet: E } = I, L = E.getDataValidation(d);
776
- L && this.fireEvent(this.Event.SheetDataValidatorStatusChanged, {
777
- workbook: k,
778
- worksheet: E,
779
- row: s,
780
- column: l,
781
- rule: L,
782
- status: u
785
+ const { workbook, worksheet } = target, rule = worksheet.getDataValidation(ruleId);
786
+ rule && this.fireEvent(this.Event.SheetDataValidatorStatusChanged, {
787
+ workbook,
788
+ worksheet,
789
+ row,
790
+ column: col,
791
+ rule,
792
+ status
783
793
  });
784
- })), this.disposeWithMe(r.beforeCommandExecuted((a) => {
785
- switch (a.id) {
786
- case A.id: {
787
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
788
- if (!n)
794
+ })), this.disposeWithMe(commadnService.beforeCommandExecuted((commandInfo) => {
795
+ switch (commandInfo.id) {
796
+ case AddSheetDataValidationCommand.id: {
797
+ const params = commandInfo.params, target = this.getSheetTarget(params.unitId, params.subUnitId);
798
+ if (!target)
789
799
  return;
790
- const { workbook: d, worksheet: u } = n, s = {
791
- worksheet: u,
792
- workbook: d,
793
- rule: i.rule
800
+ const { workbook, worksheet } = target, eventParams = {
801
+ worksheet,
802
+ workbook,
803
+ rule: params.rule
794
804
  };
795
- if (this.fireEvent(this.Event.BeforeSheetDataValidationAdd, s), s.cancel)
796
- throw new _();
805
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationAdd, eventParams), eventParams.cancel)
806
+ throw new CanceledError();
797
807
  break;
798
808
  }
799
- case U.id: {
800
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
801
- if (!n)
809
+ case UpdateSheetDataValidationSettingCommand.id: {
810
+ const params = commandInfo.params, target = this.getSheetTarget(params.unitId, params.subUnitId);
811
+ if (!target)
802
812
  return;
803
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
804
- if (!s)
813
+ const { workbook, worksheet } = target, rule = worksheet.getDataValidation(params.ruleId);
814
+ if (!rule)
805
815
  return;
806
- const l = {
807
- worksheet: u,
808
- workbook: d,
809
- rule: s,
810
- ruleId: i.ruleId,
811
- newCriteria: i.setting
816
+ const eventParams = {
817
+ worksheet,
818
+ workbook,
819
+ rule,
820
+ ruleId: params.ruleId,
821
+ newCriteria: params.setting
812
822
  };
813
- if (this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, l), l.cancel)
814
- throw new _();
823
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, eventParams), eventParams.cancel)
824
+ throw new CanceledError();
815
825
  break;
816
826
  }
817
- case C.id: {
818
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
819
- if (!n)
827
+ case UpdateSheetDataValidationRangeCommand.id: {
828
+ const params = commandInfo.params, target = this.getSheetTarget(params.unitId, params.subUnitId);
829
+ if (!target)
820
830
  return;
821
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
822
- if (!s)
831
+ const { workbook, worksheet } = target, rule = worksheet.getDataValidation(params.ruleId);
832
+ if (!rule)
823
833
  return;
824
- const l = {
825
- worksheet: u,
826
- workbook: d,
827
- rule: s,
828
- ruleId: i.ruleId,
829
- newRanges: i.ranges
834
+ const eventParams = {
835
+ worksheet,
836
+ workbook,
837
+ rule,
838
+ ruleId: params.ruleId,
839
+ newRanges: params.ranges
830
840
  };
831
- if (this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, l), l.cancel)
832
- throw new _();
841
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, eventParams), eventParams.cancel)
842
+ throw new CanceledError();
833
843
  break;
834
844
  }
835
- case v.id: {
836
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
837
- if (!n)
845
+ case UpdateSheetDataValidationOptionsCommand.id: {
846
+ const params = commandInfo.params, target = this.getSheetTarget(params.unitId, params.subUnitId);
847
+ if (!target)
838
848
  return;
839
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
840
- if (!s)
849
+ const { workbook, worksheet } = target, rule = worksheet.getDataValidation(params.ruleId);
850
+ if (!rule)
841
851
  return;
842
- const l = {
843
- worksheet: u,
844
- workbook: d,
845
- rule: s,
846
- ruleId: i.ruleId,
847
- newOptions: i.options
852
+ const eventParams = {
853
+ worksheet,
854
+ workbook,
855
+ rule,
856
+ ruleId: params.ruleId,
857
+ newOptions: params.options
848
858
  };
849
- if (this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, l), l.cancel)
850
- throw new _();
859
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, eventParams), eventParams.cancel)
860
+ throw new CanceledError();
851
861
  break;
852
862
  }
853
- case T.id: {
854
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
855
- if (!n)
863
+ case RemoveSheetDataValidationCommand.id: {
864
+ const params = commandInfo.params, target = this.getSheetTarget(params.unitId, params.subUnitId);
865
+ if (!target)
856
866
  return;
857
- const { workbook: d, worksheet: u } = n, s = u.getDataValidation(i.ruleId);
858
- if (!s)
867
+ const { workbook, worksheet } = target, rule = worksheet.getDataValidation(params.ruleId);
868
+ if (!rule)
859
869
  return;
860
- const l = {
861
- worksheet: u,
862
- workbook: d,
863
- rule: s,
864
- ruleId: i.ruleId
870
+ const eventParams = {
871
+ worksheet,
872
+ workbook,
873
+ rule,
874
+ ruleId: params.ruleId
865
875
  };
866
- if (this.fireEvent(this.Event.BeforeSheetDataValidationDelete, l), l.cancel)
867
- throw new _();
876
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationDelete, eventParams), eventParams.cancel)
877
+ throw new CanceledError();
868
878
  break;
869
879
  }
870
- case O.id: {
871
- const i = a.params, n = this.getSheetTarget(i.unitId, i.subUnitId);
872
- if (!n)
880
+ case RemoveSheetAllDataValidationCommand.id: {
881
+ const params = commandInfo.params, target = this.getSheetTarget(params.unitId, params.subUnitId);
882
+ if (!target)
873
883
  return;
874
- const { workbook: d, worksheet: u } = n, s = {
875
- worksheet: u,
876
- workbook: d,
877
- rules: u.getDataValidations()
884
+ const { workbook, worksheet } = target, eventParams = {
885
+ worksheet,
886
+ workbook,
887
+ rules: worksheet.getDataValidations()
878
888
  };
879
- if (this.fireEvent(this.Event.BeforeSheetDataValidationDeleteAll, s), s.cancel)
880
- throw new _();
889
+ if (this.fireEvent(this.Event.BeforeSheetDataValidationDeleteAll, eventParams), eventParams.cancel)
890
+ throw new CanceledError();
881
891
  break;
882
892
  }
883
893
  }
884
894
  }));
885
895
  }
886
- }
887
- x.extend(Q);
888
- class z extends M {
896
+ };
897
+ __name(_FUnvierDataValidationMixin, "FUnvierDataValidationMixin");
898
+ let FUnvierDataValidationMixin = _FUnvierDataValidationMixin;
899
+ FUniver.extend(FUnvierDataValidationMixin);
900
+ const _FWorkbookDataValidationMixin = class _FWorkbookDataValidationMixin extends FWorkbook {
889
901
  _initialize() {
890
902
  Object.defineProperty(this, "_dataValidationModel", {
891
903
  get() {
892
- return this._injector.get(V);
904
+ return this._injector.get(SheetDataValidationModel);
893
905
  }
894
906
  });
895
907
  }
896
908
  getValidatorStatus() {
897
- return this._injector.get(S).validatorWorkbook(this._workbook.getUnitId());
909
+ return this._injector.get(SheetsDataValidationValidatorService).validatorWorkbook(this._workbook.getUnitId());
898
910
  }
899
911
  // region DataValidationHooks
900
- onDataValidationChange(e) {
901
- return g(this._dataValidationModel.ruleChange$.pipe(R((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
912
+ onDataValidationChange(callback) {
913
+ return toDisposable(this._dataValidationModel.ruleChange$.pipe(filter((change) => change.unitId === this._workbook.getUnitId())).subscribe(callback));
902
914
  }
903
- onDataValidationStatusChange(e) {
904
- return g(this._dataValidationModel.validStatusChange$.pipe(R((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
915
+ onDataValidationStatusChange(callback) {
916
+ return toDisposable(this._dataValidationModel.validStatusChange$.pipe(filter((change) => change.unitId === this._workbook.getUnitId())).subscribe(callback));
905
917
  }
906
- onBeforeAddDataValidation(e) {
907
- return g(this._commandService.beforeCommandExecuted((t, r) => {
908
- const a = t.params;
909
- if (t.id === A.id) {
910
- if (a.unitId !== this._workbook.getUnitId())
918
+ onBeforeAddDataValidation(callback) {
919
+ return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
920
+ const params = commandInfo.params;
921
+ if (commandInfo.id === AddSheetDataValidationCommand.id) {
922
+ if (params.unitId !== this._workbook.getUnitId())
911
923
  return;
912
- if (e(a, r) === !1)
924
+ if (callback(params, options) === !1)
913
925
  throw new Error("Command is stopped by the hook onBeforeAddDataValidation");
914
926
  }
915
927
  }));
916
928
  }
917
- onBeforeUpdateDataValidationCriteria(e) {
918
- return g(this._commandService.beforeCommandExecuted((t, r) => {
919
- const a = t.params;
920
- if (t.id === U.id) {
921
- if (a.unitId !== this._workbook.getUnitId())
929
+ onBeforeUpdateDataValidationCriteria(callback) {
930
+ return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
931
+ const params = commandInfo.params;
932
+ if (commandInfo.id === UpdateSheetDataValidationSettingCommand.id) {
933
+ if (params.unitId !== this._workbook.getUnitId())
922
934
  return;
923
- if (e(a, r) === !1)
935
+ if (callback(params, options) === !1)
924
936
  throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationCriteria");
925
937
  }
926
938
  }));
927
939
  }
928
- onBeforeUpdateDataValidationRange(e) {
929
- return g(this._commandService.beforeCommandExecuted((t, r) => {
930
- const a = t.params;
931
- if (t.id === C.id) {
932
- if (a.unitId !== this._workbook.getUnitId())
940
+ onBeforeUpdateDataValidationRange(callback) {
941
+ return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
942
+ const params = commandInfo.params;
943
+ if (commandInfo.id === UpdateSheetDataValidationRangeCommand.id) {
944
+ if (params.unitId !== this._workbook.getUnitId())
933
945
  return;
934
- if (e(a, r) === !1)
946
+ if (callback(params, options) === !1)
935
947
  throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationRange");
936
948
  }
937
949
  }));
938
950
  }
939
- onBeforeUpdateDataValidationOptions(e) {
940
- return g(this._commandService.beforeCommandExecuted((t, r) => {
941
- const a = t.params;
942
- if (t.id === v.id) {
943
- if (a.unitId !== this._workbook.getUnitId())
951
+ onBeforeUpdateDataValidationOptions(callback) {
952
+ return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
953
+ const params = commandInfo.params;
954
+ if (commandInfo.id === UpdateSheetDataValidationOptionsCommand.id) {
955
+ if (params.unitId !== this._workbook.getUnitId())
944
956
  return;
945
- if (e(a, r) === !1)
957
+ if (callback(params, options) === !1)
946
958
  throw new Error("Command is stopped by the hook onBeforeUpdateDataValidationOptions");
947
959
  }
948
960
  }));
949
961
  }
950
- onBeforeDeleteDataValidation(e) {
951
- return g(this._commandService.beforeCommandExecuted((t, r) => {
952
- const a = t.params;
953
- if (t.id === T.id) {
954
- if (a.unitId !== this._workbook.getUnitId())
962
+ onBeforeDeleteDataValidation(callback) {
963
+ return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
964
+ const params = commandInfo.params;
965
+ if (commandInfo.id === RemoveSheetDataValidationCommand.id) {
966
+ if (params.unitId !== this._workbook.getUnitId())
955
967
  return;
956
- if (e(a, r) === !1)
968
+ if (callback(params, options) === !1)
957
969
  throw new Error("Command is stopped by the hook onBeforeDeleteDataValidation");
958
970
  }
959
971
  }));
960
972
  }
961
- onBeforeDeleteAllDataValidation(e) {
962
- return g(this._commandService.beforeCommandExecuted((t, r) => {
963
- const a = t.params;
964
- if (t.id === O.id) {
965
- if (a.unitId !== this._workbook.getUnitId())
973
+ onBeforeDeleteAllDataValidation(callback) {
974
+ return toDisposable(this._commandService.beforeCommandExecuted((commandInfo, options) => {
975
+ const params = commandInfo.params;
976
+ if (commandInfo.id === RemoveSheetAllDataValidationCommand.id) {
977
+ if (params.unitId !== this._workbook.getUnitId())
966
978
  return;
967
- if (e(a, r) === !1)
979
+ if (callback(params, options) === !1)
968
980
  throw new Error("Command is stopped by the hook onBeforeDeleteAllDataValidation");
969
981
  }
970
982
  }));
971
983
  }
972
- }
973
- M.extend(z);
974
- class K extends N {
984
+ };
985
+ __name(_FWorkbookDataValidationMixin, "FWorkbookDataValidationMixin");
986
+ let FWorkbookDataValidationMixin = _FWorkbookDataValidationMixin;
987
+ FWorkbook.extend(FWorkbookDataValidationMixin);
988
+ const _FWorksheetDataValidationMixin = class _FWorksheetDataValidationMixin extends FWorksheet {
975
989
  getDataValidations() {
976
- return this._injector.get(b).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((t) => new m(t, this._worksheet, this._injector));
990
+ return this._injector.get(DataValidationModel).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((rule) => new FDataValidation(rule, this._worksheet, this._injector));
977
991
  }
978
992
  getValidatorStatus() {
979
- return this._injector.get(S).validatorWorksheet(
993
+ return this._injector.get(SheetsDataValidationValidatorService).validatorWorksheet(
980
994
  this._workbook.getUnitId(),
981
995
  this._worksheet.getSheetId()
982
996
  );
@@ -984,13 +998,15 @@ class K extends N {
984
998
  getValidatorStatusAsync() {
985
999
  return this.getValidatorStatus();
986
1000
  }
987
- getDataValidation(e) {
988
- const r = this._injector.get(b).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), e);
989
- return r ? new m(r, this._worksheet, this._injector) : null;
1001
+ getDataValidation(ruleId) {
1002
+ const rule = this._injector.get(DataValidationModel).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), ruleId);
1003
+ return rule ? new FDataValidation(rule, this._worksheet, this._injector) : null;
990
1004
  }
991
- }
992
- N.extend(K);
993
- class X {
1005
+ };
1006
+ __name(_FWorksheetDataValidationMixin, "FWorksheetDataValidationMixin");
1007
+ let FWorksheetDataValidationMixin = _FWorksheetDataValidationMixin;
1008
+ FWorksheet.extend(FWorksheetDataValidationMixin);
1009
+ const _FDataValidationEvent = class _FDataValidationEvent {
994
1010
  get SheetDataValidationChanged() {
995
1011
  return "SheetDataValidationChanged";
996
1012
  }
@@ -1015,9 +1031,11 @@ class X {
1015
1031
  get BeforeSheetDataValidationOptionsUpdate() {
1016
1032
  return "BeforeSheetDataValidationOptionsUpdate";
1017
1033
  }
1018
- }
1019
- $.extend(X);
1034
+ };
1035
+ __name(_FDataValidationEvent, "FDataValidationEvent");
1036
+ let FDataValidationEvent = _FDataValidationEvent;
1037
+ FEventName.extend(FDataValidationEvent);
1020
1038
  export {
1021
- m as FDataValidation,
1022
- D as FDataValidationBuilder
1039
+ FDataValidation,
1040
+ FDataValidationBuilder
1023
1041
  };