@univerjs/sheets-data-validation 0.6.0-nightly.202502181606 → 0.6.0-nightly.202502201606

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,16 +1,16 @@
1
1
  var H = Object.defineProperty;
2
2
  var j = (g, e, t) => e in g ? H(g, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[e] = t;
3
- var _ = (g, e, t) => j(g, typeof e != "symbol" ? e + "" : e, t);
4
- import { UpdateSheetDataValidationSettingCommand as b, UpdateSheetDataValidationOptionsCommand as U, UpdateSheetDataValidationRangeCommand as C, RemoveSheetDataValidationCommand as A, ClearRangeDataValidationCommand as q, AddSheetDataValidationCommand as T, SheetsDataValidationValidatorService as S, SheetDataValidationModel as w, RemoveSheetAllDataValidationCommand as O } from "@univerjs/sheets-data-validation";
3
+ var f = (g, e, t) => j(g, typeof e != "symbol" ? e + "" : e, t);
4
+ import { UpdateSheetDataValidationSettingCommand as b, UpdateSheetDataValidationOptionsCommand as U, UpdateSheetDataValidationRangeCommand as C, RemoveSheetDataValidationCommand as A, ClearRangeDataValidationCommand as q, AddSheetDataValidationCommand as T, SheetsDataValidationValidatorService as S, SheetDataValidationModel as k, RemoveSheetAllDataValidationCommand as O } from "@univerjs/sheets-data-validation";
5
5
  import { FRange as y, FWorkbook as x, FWorksheet as N } from "@univerjs/sheets/facade";
6
- import { generateRandomId as L, DataValidationType as o, DataValidationErrorStyle as k, DataValidationOperator as h, IUniverInstanceService as W, ICommandService as p, CanceledError as f, toDisposable as c } from "@univerjs/core";
7
- import { DataValidationModel as v, getRuleOptions as $ } from "@univerjs/data-validation";
6
+ import { DataValidationType as o, generateRandomId as L, DataValidationErrorStyle as V, DataValidationOperator as h, IUniverInstanceService as W, ICommandService as p, CanceledError as m, toDisposable as c } from "@univerjs/core";
7
+ import { DataValidationModel as w, getRuleOptions as $ } from "@univerjs/data-validation";
8
8
  import { serializeRangeToRefString as F } from "@univerjs/engine-formula";
9
9
  import { FUniver as M, FEventName as P } from "@univerjs/core/facade";
10
10
  import { filter as R } from "rxjs";
11
11
  class E {
12
12
  constructor(e) {
13
- _(this, "_rule");
13
+ f(this, "_rule");
14
14
  this._rule = e != null ? e : {
15
15
  uid: L(),
16
16
  ranges: void 0,
@@ -22,20 +22,31 @@ class E {
22
22
  * @returns {FDataValidation} A new instance of the FDataValidation class
23
23
  * @example
24
24
  * ```typescript
25
- * const builder = univerAPI.newDataValidation();
26
- * const validation = builder.requireNumberBetween(1, 10).build();
25
+ * const fWorkbook = univerAPI.getActiveWorkbook();
26
+ * const fWorksheet = fWorkbook.getActiveSheet();
27
+ * const fRange = fWorksheet.getRange('A1:B10');
28
+ * const rule = univerAPI.newDataValidation()
29
+ * .requireNumberBetween(1, 10)
30
+ * .setOptions({
31
+ * allowBlank: true,
32
+ * showErrorMessage: true,
33
+ * error: 'Please enter a number between 1 and 10'
34
+ * })
35
+ * .build();
36
+ * fRange.setDataValidation(rule);
27
37
  * ```
28
38
  */
29
39
  build() {
30
- return new m(this._rule);
40
+ return new _(this._rule);
31
41
  }
32
42
  /**
33
43
  * Creates a duplicate of the current DataValidationBuilder object
34
44
  * @returns {FDataValidationBuilder} A new instance of the DataValidationBuilder class
35
45
  * @example
36
46
  * ```typescript
37
- * const builder = univerAPI.newDataValidation();
38
- * const copy = builder.requireNumberBetween(1, 10).copy();
47
+ * const builder = univerAPI.newDataValidation().requireNumberBetween(1, 10);
48
+ * const copyBuilder = builder.copy();
49
+ * console.log(copyBuilder);
39
50
  * ```
40
51
  */
41
52
  copy() {
@@ -49,12 +60,12 @@ class E {
49
60
  * @returns {boolean} True if invalid data is allowed, False otherwise
50
61
  * @example
51
62
  * ```typescript
52
- * const builder = univerAPI.newDataValidation();
53
- * const allowsInvalid = builder.getAllowInvalid();
63
+ * const builder = univerAPI.newDataValidation().requireNumberBetween(1, 10);
64
+ * console.log(builder.getAllowInvalid());
54
65
  * ```
55
66
  */
56
67
  getAllowInvalid() {
57
- return this._rule.errorStyle !== k.STOP;
68
+ return this._rule.errorStyle !== V.STOP;
58
69
  }
59
70
  /**
60
71
  * Gets the data validation type of the rule
@@ -62,7 +73,13 @@ class E {
62
73
  * @example
63
74
  * ```typescript
64
75
  * const builder = univerAPI.newDataValidation();
65
- * const type = builder.getCriteriaType();
76
+ * console.log(builder.getCriteriaType());
77
+ *
78
+ * builder.requireNumberBetween(1, 10);
79
+ * console.log(builder.getCriteriaType());
80
+ *
81
+ * builder.requireValueInList(['Yes', 'No']);
82
+ * console.log(builder.getCriteriaType());
66
83
  * ```
67
84
  */
68
85
  getCriteriaType() {
@@ -73,8 +90,12 @@ class E {
73
90
  * @returns {[string | undefined, string | undefined, string | undefined]} An array containing the operator, formula1, and formula2 values
74
91
  * @example
75
92
  * ```typescript
76
- * const builder = univerAPI.newDataValidation();
93
+ * const builder = univerAPI.newDataValidation().requireNumberBetween(1, 10);
77
94
  * const [operator, formula1, formula2] = builder.getCriteriaValues();
95
+ * console.log(operator, formula1, formula2);
96
+ *
97
+ * builder.requireValueInList(['Yes', 'No']);
98
+ * console.log(builder.getCriteriaValues());
78
99
  * ```
79
100
  */
80
101
  getCriteriaValues() {
@@ -85,8 +106,11 @@ class E {
85
106
  * @returns {string | undefined} Returns the help text information. If there is no error message, it returns an undefined value
86
107
  * @example
87
108
  * ```typescript
88
- * const builder = univerAPI.newDataValidation();
89
- * const helpText = builder.getHelpText();
109
+ * const builder = univerAPI.newDataValidation().setOptions({
110
+ * showErrorMessage: true,
111
+ * error: 'Please enter a valid value'
112
+ * });
113
+ * console.log(builder.getHelpText()); // 'Please enter a valid value'
90
114
  * ```
91
115
  */
92
116
  getHelpText() {
@@ -99,8 +123,22 @@ class E {
99
123
  * @returns {FDataValidationBuilder} The current instance for method chaining
100
124
  * @example
101
125
  * ```typescript
102
- * const builder = univerAPI.newDataValidation();
103
- * const rule = builder.requireCheckbox('Yes', 'No').build();
126
+ * const fWorkbook = univerAPI.getActiveWorkbook();
127
+ * const fWorksheet = fWorkbook.getActiveSheet();
128
+ *
129
+ * // Set the data validation for cell A1:A10 to require a checkbox with default 1 and 0 values
130
+ * const fRange = fWorksheet.getRange('A1:A10');
131
+ * const rule = univerAPI.newDataValidation()
132
+ * .requireCheckbox()
133
+ * .build();
134
+ * fRange.setDataValidation(rule);
135
+ *
136
+ * // Set the data validation for cell B1:B10 to require a checkbox with 'Yes' and 'No' values
137
+ * const fRange2 = fWorksheet.getRange('B1:B10');
138
+ * const rule2 = univerAPI.newDataValidation()
139
+ * .requireCheckbox('Yes', 'No')
140
+ * .build();
141
+ * fRange2.setDataValidation(rule2);
104
142
  * ```
105
143
  */
106
144
  requireCheckbox(e, t) {
@@ -112,8 +150,20 @@ class E {
112
150
  * @returns {FDataValidationBuilder} The current instance for method chaining
113
151
  * @example
114
152
  * ```typescript
115
- * const builder = univerAPI.newDataValidation();
116
- * const rule = builder.requireDateAfter(new Date('2024-01-01')).build();
153
+ * const fWorkbook = univerAPI.getActiveWorkbook();
154
+ * const fWorksheet = fWorkbook.getActiveSheet();
155
+ * const fRange = fWorksheet.getRange('A1:B2');
156
+ * fRange.setValues([
157
+ * ['2024-01-01', '2024-12-31'],
158
+ * ['2025-01-01', '2025-12-31']
159
+ * ]);
160
+ * const rule = univerAPI.newDataValidation()
161
+ * .requireDateAfter(new Date('2025-01-01'))
162
+ * .build();
163
+ * fRange.setDataValidation(rule);
164
+ *
165
+ * const status = await fRange.getValidatorStatus();
166
+ * console.log(status); // [['invalid', 'invalid', 'invalid', 'valid']]
117
167
  * ```
118
168
  */
119
169
  requireDateAfter(e) {
@@ -125,8 +175,20 @@ class E {
125
175
  * @returns {FDataValidationBuilder} The current instance for method chaining
126
176
  * @example
127
177
  * ```typescript
128
- * const builder = univerAPI.newDataValidation();
129
- * const rule = builder.requireDateBefore(new Date('2024-12-31')).build();
178
+ * const fWorkbook = univerAPI.getActiveWorkbook();
179
+ * const fWorksheet = fWorkbook.getActiveSheet();
180
+ * const fRange = fWorksheet.getRange('A1:B2');
181
+ * fRange.setValues([
182
+ * ['2024-01-01', '2024-12-31'],
183
+ * ['2025-01-01', '2025-12-31']
184
+ * ]);
185
+ * const rule = univerAPI.newDataValidation()
186
+ * .requireDateBefore(new Date('2025-01-01'))
187
+ * .build();
188
+ * fRange.setDataValidation(rule);
189
+ *
190
+ * const status = await fRange.getValidatorStatus();
191
+ * console.log(status); // [['valid', 'valid', 'invalid', 'invalid']]
130
192
  * ```
131
193
  */
132
194
  requireDateBefore(e) {
@@ -139,10 +201,20 @@ class E {
139
201
  * @returns {FDataValidationBuilder} The current instance for method chaining
140
202
  * @example
141
203
  * ```typescript
142
- * const builder = univerAPI.newDataValidation();
143
- * const rule = builder
144
- * .requireDateBetween(new Date('2024-01-01'), new Date('2024-12-31'))
204
+ * const fWorkbook = univerAPI.getActiveWorkbook();
205
+ * const fWorksheet = fWorkbook.getActiveSheet();
206
+ * const fRange = fWorksheet.getRange('A1:B2');
207
+ * fRange.setValues([
208
+ * ['2024-01-01', '2024-12-31'],
209
+ * ['2025-01-01', '2025-12-31']
210
+ * ]);
211
+ * const rule = univerAPI.newDataValidation()
212
+ * .requireDateBetween(new Date('2024-06-01'), new Date('2025-06-01'))
145
213
  * .build();
214
+ * fRange.setDataValidation(rule);
215
+ *
216
+ * const status = await fRange.getValidatorStatus();
217
+ * console.log(status); // [['invalid', 'valid', 'valid', 'invalid']]
146
218
  * ```
147
219
  */
148
220
  requireDateBetween(e, t) {
@@ -154,8 +226,23 @@ class E {
154
226
  * @returns {FDataValidationBuilder} The current instance for method chaining
155
227
  * @example
156
228
  * ```typescript
157
- * const builder = univerAPI.newDataValidation();
158
- * const rule = builder.requireDateEqualTo(new Date('2024-01-01')).build();
229
+ * const fWorkbook = univerAPI.getActiveWorkbook();
230
+ * const fWorksheet = fWorkbook.getActiveSheet();
231
+ * const fRange = fWorksheet.getRange('A1:B2');
232
+ * fRange.setValues([
233
+ * ['2024-01-01', '2024-12-31'],
234
+ * ['2025-01-01', '2025-12-31']
235
+ * ]);
236
+ * const rule = univerAPI.newDataValidation()
237
+ * .requireDateEqualTo(new Date('2025-01-01'))
238
+ * .build();
239
+ * fRange.setDataValidation(rule);
240
+ *
241
+ * const status = await fWorksheet.getRange('A2').getValidatorStatus();
242
+ * console.log(status?.[0]?.[0]); // 'valid'
243
+ *
244
+ * const status2 = await fWorksheet.getRange('B2').getValidatorStatus();
245
+ * console.log(status2?.[0]?.[0]); // 'invalid'
159
246
  * ```
160
247
  */
161
248
  requireDateEqualTo(e) {
@@ -168,10 +255,20 @@ class E {
168
255
  * @returns {FDataValidationBuilder} The current instance for method chaining
169
256
  * @example
170
257
  * ```typescript
171
- * const builder = univerAPI.newDataValidation();
172
- * const rule = builder
173
- * .requireDateNotBetween(new Date('2024-01-01'), new Date('2024-12-31'))
258
+ * const fWorkbook = univerAPI.getActiveWorkbook();
259
+ * const fWorksheet = fWorkbook.getActiveSheet();
260
+ * const fRange = fWorksheet.getRange('A1:B2');
261
+ * fRange.setValues([
262
+ * ['2024-01-01', '2024-12-31'],
263
+ * ['2025-01-01', '2025-12-31']
264
+ * ]);
265
+ * const rule = univerAPI.newDataValidation()
266
+ * .requireDateNotBetween(new Date('2024-06-01'), new Date('2025-06-01'))
174
267
  * .build();
268
+ * fRange.setDataValidation(rule);
269
+ *
270
+ * const status = await fRange.getValidatorStatus();
271
+ * console.log(status); // [['valid', 'invalid', 'invalid', 'valid']]
175
272
  * ```
176
273
  */
177
274
  requireDateNotBetween(e, t) {
@@ -183,8 +280,20 @@ class E {
183
280
  * @returns {FDataValidationBuilder} The current instance for method chaining
184
281
  * @example
185
282
  * ```typescript
186
- * const builder = univerAPI.newDataValidation();
187
- * const rule = builder.requireDateOnOrAfter(new Date('2024-01-01')).build();
283
+ * const fWorkbook = univerAPI.getActiveWorkbook();
284
+ * const fWorksheet = fWorkbook.getActiveSheet();
285
+ * const fRange = fWorksheet.getRange('A1:B2');
286
+ * fRange.setValues([
287
+ * ['2024-01-01', '2024-12-31'],
288
+ * ['2025-01-01', '2025-12-31']
289
+ * ]);
290
+ * const rule = univerAPI.newDataValidation()
291
+ * .requireDateOnOrAfter(new Date('2025-01-01'))
292
+ * .build();
293
+ * fRange.setDataValidation(rule);
294
+ *
295
+ * const status = await fRange.getValidatorStatus();
296
+ * console.log(status); // [['invalid', 'invalid', 'valid', 'valid']]
188
297
  * ```
189
298
  */
190
299
  requireDateOnOrAfter(e) {
@@ -196,8 +305,20 @@ class E {
196
305
  * @returns {FDataValidationBuilder} The current instance for method chaining
197
306
  * @example
198
307
  * ```typescript
199
- * const builder = univerAPI.newDataValidation();
200
- * const rule = builder.requireDateOnOrBefore(new Date('2024-12-31')).build();
308
+ * const fWorkbook = univerAPI.getActiveWorkbook();
309
+ * const fWorksheet = fWorkbook.getActiveSheet();
310
+ * const fRange = fWorksheet.getRange('A1:B2');
311
+ * fRange.setValues([
312
+ * ['2024-01-01', '2024-12-31'],
313
+ * ['2025-01-01', '2025-12-31']
314
+ * ]);
315
+ * const rule = univerAPI.newDataValidation()
316
+ * .requireDateOnOrBefore(new Date('2025-01-01'))
317
+ * .build();
318
+ * fRange.setDataValidation(rule);
319
+ *
320
+ * const status = await fRange.getValidatorStatus();
321
+ * console.log(status); // [['valid', 'valid', 'valid', 'invalid']]
201
322
  * ```
202
323
  */
203
324
  requireDateOnOrBefore(e) {
@@ -205,12 +326,33 @@ class E {
205
326
  }
206
327
  /**
207
328
  * Requires that a custom formula be satisfied
208
- * @param {string} formula - The formula string that needs to be satisfied
329
+ * @param {string} formula - The formula string that needs to be satisfied, formula result should be TRUE or FALSE, and references range will relative offset
209
330
  * @returns {FDataValidationBuilder} The current instance for method chaining
210
331
  * @example
211
332
  * ```typescript
212
- * const builder = univerAPI.newDataValidation();
213
- * const rule = builder.requireFormulaSatisfied('=A1>0').build();
333
+ * const fWorkbook = univerAPI.getActiveWorkbook();
334
+ * const fWorksheet = fWorkbook.getActiveSheet();
335
+ * const cell = fWorksheet.getRange('A1:B2');
336
+ * cell.setValues([
337
+ * [4, 3],
338
+ * [2, 1]
339
+ * ]);
340
+ * const fRange = fWorksheet.getRange('C1:D2');
341
+ * fRange.setValues([
342
+ * [1, 2],
343
+ * [3, 4]
344
+ * ]);
345
+ * const rule = univerAPI.newDataValidation()
346
+ * .requireFormulaSatisfied('=A1>2')
347
+ * .setOptions({
348
+ * showErrorMessage: true,
349
+ * error: 'Please enter a value equal to A1'
350
+ * })
351
+ * .build();
352
+ * fRange.setDataValidation(rule);
353
+ *
354
+ * const status = await fRange.getValidatorStatus();
355
+ * console.log(status); // [['valid', 'valid', 'invalid', 'invalid']]
214
356
  * ```
215
357
  */
216
358
  requireFormulaSatisfied(e) {
@@ -224,8 +366,18 @@ class E {
224
366
  * @returns {FDataValidationBuilder} The current instance for method chaining
225
367
  * @example
226
368
  * ```typescript
227
- * const builder = univerAPI.newDataValidation();
228
- * const rule = builder.requireNumberBetween(1, 10).build();
369
+ * const fWorkbook = univerAPI.getActiveWorkbook();
370
+ * const fWorksheet = fWorkbook.getActiveSheet();
371
+ * const fRange = fWorksheet.getRange('A1:B10');
372
+ * const rule = univerAPI.newDataValidation()
373
+ * .requireNumberBetween(1, 10)
374
+ * .setOptions({
375
+ * allowBlank: false,
376
+ * showErrorMessage: true,
377
+ * error: 'Please enter a number between 1 and 10'
378
+ * })
379
+ * .build();
380
+ * fRange.setDataValidation(rule);
229
381
  * ```
230
382
  */
231
383
  requireNumberBetween(e, t, i) {
@@ -238,8 +390,18 @@ class E {
238
390
  * @returns {FDataValidationBuilder} The current instance for method chaining
239
391
  * @example
240
392
  * ```typescript
241
- * const builder = univerAPI.newDataValidation();
242
- * const rule = builder.requireNumberEqualTo(10).build();
393
+ * const fWorkbook = univerAPI.getActiveWorkbook();
394
+ * const fWorksheet = fWorkbook.getActiveSheet();
395
+ * const fRange = fWorksheet.getRange('A1:B10');
396
+ * const rule = univerAPI.newDataValidation()
397
+ * .requireNumberEqualTo(10)
398
+ * .setOptions({
399
+ * allowBlank: false,
400
+ * showErrorMessage: true,
401
+ * error: 'Please enter a number equal to 10'
402
+ * })
403
+ * .build();
404
+ * fRange.setDataValidation(rule);
243
405
  * ```
244
406
  */
245
407
  requireNumberEqualTo(e, t) {
@@ -252,8 +414,18 @@ class E {
252
414
  * @returns {FDataValidationBuilder} The current instance for method chaining
253
415
  * @example
254
416
  * ```typescript
255
- * const builder = univerAPI.newDataValidation();
256
- * const rule = builder.requireNumberGreaterThan(10).build();
417
+ * const fWorkbook = univerAPI.getActiveWorkbook();
418
+ * const fWorksheet = fWorkbook.getActiveSheet();
419
+ * const fRange = fWorksheet.getRange('A1:B10');
420
+ * const rule = univerAPI.newDataValidation()
421
+ * .requireNumberGreaterThan(10)
422
+ * .setOptions({
423
+ * allowBlank: false,
424
+ * showErrorMessage: true,
425
+ * error: 'Please enter a number greater than 10'
426
+ * })
427
+ * .build();
428
+ * fRange.setDataValidation(rule);
257
429
  * ```
258
430
  */
259
431
  requireNumberGreaterThan(e, t) {
@@ -266,8 +438,18 @@ class E {
266
438
  * @returns {FDataValidationBuilder} The current instance for method chaining
267
439
  * @example
268
440
  * ```typescript
269
- * const builder = univerAPI.newDataValidation();
270
- * const rule = builder.requireNumberGreaterThanOrEqualTo(10).build();
441
+ * const fWorkbook = univerAPI.getActiveWorkbook();
442
+ * const fWorksheet = fWorkbook.getActiveSheet();
443
+ * const fRange = fWorksheet.getRange('A1:B10');
444
+ * const rule = univerAPI.newDataValidation()
445
+ * .requireNumberGreaterThanOrEqualTo(10)
446
+ * .setOptions({
447
+ * allowBlank: false,
448
+ * showErrorMessage: true,
449
+ * error: 'Please enter a number greater than 10 or equal to 10'
450
+ * })
451
+ * .build();
452
+ * fRange.setDataValidation(rule);
271
453
  * ```
272
454
  */
273
455
  requireNumberGreaterThanOrEqualTo(e, t) {
@@ -280,8 +462,18 @@ class E {
280
462
  * @returns {FDataValidationBuilder} The current instance for method chaining
281
463
  * @example
282
464
  * ```typescript
283
- * const builder = univerAPI.newDataValidation();
284
- * const rule = builder.requireNumberLessThan(10).build();
465
+ * const fWorkbook = univerAPI.getActiveWorkbook();
466
+ * const fWorksheet = fWorkbook.getActiveSheet();
467
+ * const fRange = fWorksheet.getRange('A1:B10');
468
+ * const rule = univerAPI.newDataValidation()
469
+ * .requireNumberLessThan(10)
470
+ * .setOptions({
471
+ * allowBlank: false,
472
+ * showErrorMessage: true,
473
+ * error: 'Please enter a number less than 10'
474
+ * })
475
+ * .build();
476
+ * fRange.setDataValidation(rule);
285
477
  * ```
286
478
  */
287
479
  requireNumberLessThan(e, t) {
@@ -295,8 +487,18 @@ class E {
295
487
  * @returns {FDataValidationBuilder} The current instance for method chaining
296
488
  * @example
297
489
  * ```typescript
298
- * const builder = univerAPI.newDataValidation();
299
- * const rule = builder.requireNumberLessThanOrEqualTo(10).build();
490
+ * const fWorkbook = univerAPI.getActiveWorkbook();
491
+ * const fWorksheet = fWorkbook.getActiveSheet();
492
+ * const fRange = fWorksheet.getRange('A1:B10');
493
+ * const rule = univerAPI.newDataValidation()
494
+ * .requireNumberLessThanOrEqualTo(10)
495
+ * .setOptions({
496
+ * allowBlank: false,
497
+ * showErrorMessage: true,
498
+ * error: 'Please enter a number less than 10 or equal to 10'
499
+ * })
500
+ * .build();
501
+ * fRange.setDataValidation(rule);
300
502
  * ```
301
503
  */
302
504
  requireNumberLessThanOrEqualTo(e, t) {
@@ -311,8 +513,18 @@ class E {
311
513
  * @returns {FDataValidationBuilder} The current instance for method chaining
312
514
  * @example
313
515
  * ```typescript
314
- * const builder = univerAPI.newDataValidation();
315
- * const rule = builder.requireNumberNotBetween(1, 10).build();
516
+ * const fWorkbook = univerAPI.getActiveWorkbook();
517
+ * const fWorksheet = fWorkbook.getActiveSheet();
518
+ * const fRange = fWorksheet.getRange('A1:B10');
519
+ * const rule = univerAPI.newDataValidation()
520
+ * .requireNumberNotBetween(1, 10)
521
+ * .setOptions({
522
+ * allowBlank: false,
523
+ * showErrorMessage: true,
524
+ * error: 'Please enter a number not between 1 and 10'
525
+ * })
526
+ * .build();
527
+ * fRange.setDataValidation(rule);
316
528
  * ```
317
529
  */
318
530
  requireNumberNotBetween(e, t, i) {
@@ -326,8 +538,18 @@ class E {
326
538
  * @returns {FDataValidationBuilder} The current instance for method chaining
327
539
  * @example
328
540
  * ```typescript
329
- * const builder = univerAPI.newDataValidation();
330
- * const rule = builder.requireNumberNotEqualTo(10).build();
541
+ * const fWorkbook = univerAPI.getActiveWorkbook();
542
+ * const fWorksheet = fWorkbook.getActiveSheet();
543
+ * const fRange = fWorksheet.getRange('A1:B10');
544
+ * const rule = univerAPI.newDataValidation()
545
+ * .requireNumberNotEqualTo(10)
546
+ * .setOptions({
547
+ * allowBlank: false,
548
+ * showErrorMessage: true,
549
+ * error: 'Please enter a number not equal to 10'
550
+ * })
551
+ * .build();
552
+ * fRange.setDataValidation(rule);
331
553
  * ```
332
554
  */
333
555
  requireNumberNotEqualTo(e, t) {
@@ -342,8 +564,18 @@ class E {
342
564
  * @returns {FDataValidationBuilder} The current instance for method chaining
343
565
  * @example
344
566
  * ```typescript
345
- * const builder = univerAPI.newDataValidation();
346
- * const rule = builder.requireValueInList(['Yes', 'No']).build();
567
+ * const fWorkbook = univerAPI.getActiveWorkbook();
568
+ * const fWorksheet = fWorkbook.getActiveSheet();
569
+ * const fRange = fWorksheet.getRange('A1:B10');
570
+ * const rule = univerAPI.newDataValidation()
571
+ * .requireValueInList(['Yes', 'No'])
572
+ * .setOptions({
573
+ * allowBlank: true,
574
+ * showErrorMessage: true,
575
+ * error: 'Please enter a value from the list'
576
+ * })
577
+ * .build();
578
+ * fRange.setDataValidation(rule);
347
579
  * ```
348
580
  */
349
581
  requireValueInList(e, t, i) {
@@ -358,9 +590,24 @@ class E {
358
590
  * @returns {FDataValidationBuilder} The current instance for method chaining
359
591
  * @example
360
592
  * ```typescript
361
- * const builder = univerAPI.newDataValidation();
362
- * const range = FRange.create('Sheet1', 'B1:B10');
363
- * const rule = builder.requireValueInRange(range).build();
593
+ * const fWorkbook = univerAPI.getActiveWorkbook();
594
+ * const fWorksheet = fWorkbook.getActiveSheet();
595
+ * const fRange = fWorksheet.getRange('B1:B2');
596
+ * fRange.setValues([
597
+ * ['Yes'],
598
+ * ['No']
599
+ * ]);
600
+ *
601
+ * const rule = univerAPI.newDataValidation()
602
+ * .requireValueInRange(fRange)
603
+ * .setOptions({
604
+ * allowBlank: false,
605
+ * showErrorMessage: true,
606
+ * error: 'Please enter a value from the list'
607
+ * })
608
+ * .build();
609
+ * const cell = fWorksheet.getRange('A1');
610
+ * cell.setDataValidation(rule);
364
611
  * ```
365
612
  */
366
613
  requireValueInRange(e, t, i) {
@@ -378,12 +625,28 @@ class E {
378
625
  * @returns {FDataValidationBuilder} The current instance for method chaining
379
626
  * @example
380
627
  * ```typescript
381
- * const builder = univerAPI.newDataValidation();
382
- * const rule = builder.setAllowInvalid(true).build();
628
+ * const fWorkbook = univerAPI.getActiveWorkbook();
629
+ * const fWorksheet = fWorkbook.getActiveSheet();
630
+ *
631
+ * // Set the data validation for cell A1:B2 to allow invalid data, so A1:B2 will display a warning when invalid data is entered
632
+ * const fRange = fWorksheet.getRange('A1:B2');
633
+ * const rule = univerAPI.newDataValidation()
634
+ * .requireValueInList(['Yes', 'No'])
635
+ * .setAllowInvalid(true)
636
+ * .build();
637
+ * fRange.setDataValidation(rule);
638
+ *
639
+ * // Set the data validation for cell C1:D2 to not allow invalid data, so C1:D2 will stop data entry when invalid data is entered
640
+ * const fRange2 = fWorksheet.getRange('C1:D2');
641
+ * const rule2 = univerAPI.newDataValidation()
642
+ * .requireValueInList(['Yes', 'No'])
643
+ * .setAllowInvalid(false)
644
+ * .build();
645
+ * fRange2.setDataValidation(rule2);
383
646
  * ```
384
647
  */
385
648
  setAllowInvalid(e) {
386
- return this._rule.errorStyle = e ? k.WARNING : k.STOP, this;
649
+ return this._rule.errorStyle = e ? V.WARNING : V.STOP, this;
387
650
  }
388
651
  /**
389
652
  * Sets whether to allow blank values
@@ -391,8 +654,25 @@ class E {
391
654
  * @returns {FDataValidationBuilder} The current instance for method chaining
392
655
  * @example
393
656
  * ```typescript
394
- * const builder = univerAPI.newDataValidation();
395
- * const rule = builder.setAllowBlank(true).build();
657
+ * // Assume current sheet is empty data
658
+ * const fWorkbook = univerAPI.getActiveWorkbook();
659
+ * const fWorksheet = fWorkbook.getActiveSheet();
660
+ *
661
+ * // Set the data validation for cell A1:B2 to allow blank values
662
+ * const fRange = fWorksheet.getRange('A1:B2');
663
+ * const rule = univerAPI.newDataValidation()
664
+ * .requireValueInList(['Yes', 'No'])
665
+ * .setAllowBlank(true)
666
+ * .build();
667
+ * fRange.setDataValidation(rule);
668
+ *
669
+ * // Set the data validation for cell C1:D2 to not allow blank values
670
+ * const fRange2 = fWorksheet.getRange('C1:D2');
671
+ * const rule2 = univerAPI.newDataValidation()
672
+ * .requireValueInList(['Yes', 'No'])
673
+ * .setAllowBlank(false)
674
+ * .build();
675
+ * fRange2.setDataValidation(rule2);
396
676
  * ```
397
677
  */
398
678
  setAllowBlank(e) {
@@ -404,23 +684,29 @@ class E {
404
684
  * @returns {FDataValidationBuilder} The current instance for method chaining
405
685
  * @example
406
686
  * ```typescript
407
- * const builder = univerAPI.newDataValidation();
408
- * const rule = builder.setOptions({
409
- * allowBlank: true,
410
- * showErrorMessage: true,
411
- * error: 'Please enter a valid value'
412
- * }).build();
687
+ * const fWorkbook = univerAPI.getActiveWorkbook();
688
+ * const fWorksheet = fWorkbook.getActiveSheet();
689
+ * const fRange = fWorksheet.getRange('A1:B10');
690
+ * const rule = univerAPI.newDataValidation()
691
+ * .requireValueInList(['Yes', 'No'])
692
+ * .setOptions({
693
+ * allowBlank: true,
694
+ * showErrorMessage: true,
695
+ * error: 'Please enter a value from the list'
696
+ * })
697
+ * .build();
698
+ * fRange.setDataValidation(rule);
413
699
  * ```
414
700
  */
415
701
  setOptions(e) {
416
702
  return Object.assign(this._rule, e), this;
417
703
  }
418
704
  }
419
- class m {
705
+ class _ {
420
706
  constructor(e, t, i) {
421
- _(this, "rule");
422
- _(this, "_worksheet");
423
- _(this, "_injector");
707
+ f(this, "rule");
708
+ f(this, "_worksheet");
709
+ f(this, "_injector");
424
710
  this._injector = i, this.rule = e, this._worksheet = t;
425
711
  }
426
712
  /**
@@ -428,28 +714,28 @@ class m {
428
714
  * @returns {boolean} true if invalid data is allowed, false otherwise
429
715
  * @example
430
716
  * ```typescript
431
- * const dataValidation = univerAPI
432
- * .getActiveWorkbook()
433
- * .getActiveWorksheet()
434
- * .getActiveRange()
435
- * .getDataValidation();
436
- * const allowsInvalid = dataValidation.getAllowInvalid();
717
+ * const fWorkbook = univerAPI.getActiveWorkbook();
718
+ * const fWorksheet = fWorkbook.getActiveSheet();
719
+ * const rules = fWorksheet.getDataValidations();
720
+ * rules.forEach((rule) => {
721
+ * console.log(rule, rule.getAllowInvalid());
722
+ * });
437
723
  * ```
438
724
  */
439
725
  getAllowInvalid() {
440
- return this.rule.errorStyle !== k.STOP;
726
+ return this.rule.errorStyle !== V.STOP;
441
727
  }
442
728
  /**
443
729
  * Gets the data validation type of the rule
444
730
  * @returns {DataValidationType | string} The data validation type
445
731
  * @example
446
732
  * ```typescript
447
- * const dataValidation = univerAPI
448
- * .getActiveWorkbook()
449
- * .getActiveWorksheet()
450
- * .getActiveRange()
451
- * .getDataValidation();
452
- * const type = dataValidation.getCriteriaType();
733
+ * const fWorkbook = univerAPI.getActiveWorkbook();
734
+ * const fWorksheet = fWorkbook.getActiveSheet();
735
+ * const rules = fWorksheet.getDataValidations();
736
+ * rules.forEach((rule) => {
737
+ * console.log(rule, rule.getCriteriaType());
738
+ * });
453
739
  * ```
454
740
  */
455
741
  getCriteriaType() {
@@ -460,12 +746,15 @@ class m {
460
746
  * @returns {[string | undefined, string | undefined, string | undefined]} An array containing the operator, formula1, and formula2 values
461
747
  * @example
462
748
  * ```typescript
463
- * const dataValidation = univerAPI
464
- * .getActiveWorkbook()
465
- * .getActiveWorksheet()
466
- * .getActiveRange()
467
- * .getDataValidation();
468
- * const [operator, formula1, formula2] = dataValidation.getCriteriaValues();
749
+ * const fWorkbook = univerAPI.getActiveWorkbook();
750
+ * const fWorksheet = fWorkbook.getActiveSheet();
751
+ * const rules = fWorksheet.getDataValidations();
752
+ * rules.forEach((rule) => {
753
+ * console.log(rule);
754
+ * const criteriaValues = rule.getCriteriaValues();
755
+ * const [operator, formula1, formula2] = criteriaValues;
756
+ * console.log(operator, formula1, formula2);
757
+ * });
469
758
  * ```
470
759
  */
471
760
  getCriteriaValues() {
@@ -476,12 +765,19 @@ class m {
476
765
  * @returns {string | undefined} Returns the help text information. If there is no error message, it returns an undefined value
477
766
  * @example
478
767
  * ```typescript
479
- * const dataValidation = univerAPI
480
- * .getActiveWorkbook()
481
- * .getActiveWorksheet()
482
- * .getActiveRange()
483
- * .getDataValidation();
484
- * const helpText = dataValidation.getHelpText();
768
+ * const fWorkbook = univerAPI.getActiveWorkbook();
769
+ * const fWorksheet = fWorkbook.getActiveSheet();
770
+ * const fRange = fWorksheet.getRange('A1:B10');
771
+ * const rule = univerAPI.newDataValidation()
772
+ * .requireNumberBetween(1, 10)
773
+ * .setOptions({
774
+ * allowBlank: true,
775
+ * showErrorMessage: true,
776
+ * error: 'Please enter a number between 1 and 10'
777
+ * })
778
+ * .build();
779
+ * fRange.setDataValidation(rule);
780
+ * console.log(fRange.getDataValidation().getHelpText()); // 'Please enter a number between 1 and 10'
485
781
  * ```
486
782
  */
487
783
  getHelpText() {
@@ -492,13 +788,27 @@ class m {
492
788
  * @returns {FDataValidationBuilder} A new FDataValidationBuilder instance with the same rule configuration
493
789
  * @example
494
790
  * ```typescript
495
- * const dataValidation = univerAPI
496
- * .getActiveWorkbook()
497
- * .getActiveWorksheet()
498
- * .getActiveRange()
499
- * .getDataValidation();
500
- * const builder = dataValidation.copy();
501
- * const newRule = builder.setAllowInvalid(true).build();
791
+ * const fWorkbook = univerAPI.getActiveWorkbook();
792
+ * const fWorksheet = fWorkbook.getActiveSheet();
793
+ * const fRange = fWorksheet.getRange('A1:B10');
794
+ * const rule = univerAPI.newDataValidation()
795
+ * .requireNumberBetween(1, 10)
796
+ * .setOptions({
797
+ * allowBlank: true,
798
+ * showErrorMessage: true,
799
+ * error: 'Please enter a number between 1 and 10'
800
+ * })
801
+ * .build();
802
+ * fRange.setDataValidation(rule);
803
+ *
804
+ * const builder = fRange.getDataValidation().copy();
805
+ * const newRule = builder
806
+ * .requireNumberBetween(1, 5)
807
+ * .setOptions({
808
+ * error: 'Please enter a number between 1 and 5'
809
+ * })
810
+ * .build();
811
+ * fRange.setDataValidation(newRule);
502
812
  * ```
503
813
  */
504
814
  copy() {
@@ -509,18 +819,21 @@ class m {
509
819
  * @returns {boolean} true if the rule is applied, false otherwise
510
820
  * @example
511
821
  * ```typescript
512
- * const dataValidation = univerAPI
513
- * .getActiveWorkbook()
514
- * .getActiveWorksheet()
515
- * .getActiveRange()
516
- * .getDataValidation();
517
- * const isApplied = dataValidation.getApplied();
822
+ * const fWorkbook = univerAPI.getActiveWorkbook();
823
+ * const fWorksheet = fWorkbook.getActiveSheet();
824
+ * const rules = fWorksheet.getDataValidations();
825
+ * rules.forEach((rule) => {
826
+ * console.log(rule, rule.getApplied());
827
+ * });
828
+ *
829
+ * const fRange = fWorksheet.getRange('A1:B10');
830
+ * console.log(fRange.getDataValidation()?.getApplied());
518
831
  * ```
519
832
  */
520
833
  getApplied() {
521
834
  if (!this._worksheet)
522
835
  return !1;
523
- const t = this._injector.get(v).getRuleById(this._worksheet.getUnitId(), this._worksheet.getSheetId(), this.rule.uid);
836
+ const t = this._injector.get(w).getRuleById(this._worksheet.getUnitId(), this._worksheet.getSheetId(), this.rule.uid);
524
837
  return !!(t && t.ranges.length);
525
838
  }
526
839
  /**
@@ -528,12 +841,16 @@ class m {
528
841
  * @returns {FRange[]} An array of FRange objects representing the ranges to which the data validation rule is applied
529
842
  * @example
530
843
  * ```typescript
531
- * const dataValidation = univerAPI
532
- * .getActiveWorkbook()
533
- * .getActiveWorksheet()
534
- * .getActiveRange()
535
- * .getDataValidation();
536
- * const ranges = dataValidation.getRanges();
844
+ * const fWorkbook = univerAPI.getActiveWorkbook();
845
+ * const fWorksheet = fWorkbook.getActiveSheet();
846
+ * const rules = fWorksheet.getDataValidations();
847
+ * rules.forEach((rule) => {
848
+ * console.log(rule);
849
+ * const ranges = rule.getRanges();
850
+ * ranges.forEach((range) => {
851
+ * console.log(range.getA1Notation());
852
+ * });
853
+ * });
537
854
  * ```
538
855
  */
539
856
  getRanges() {
@@ -547,12 +864,10 @@ class m {
547
864
  * @returns {string | undefined} The unit ID of the worksheet
548
865
  * @example
549
866
  * ```typescript
550
- * const dataValidation = univerAPI
551
- * .getActiveWorkbook()
552
- * .getActiveWorksheet()
553
- * .getActiveRange()
554
- * .getDataValidation();
555
- * const unitId = dataValidation.getUnitId();
867
+ * const fWorkbook = univerAPI.getActiveWorkbook();
868
+ * const fWorksheet = fWorkbook.getActiveSheet();
869
+ * const fRange = fWorksheet.getRange('A1:B10');
870
+ * console.log(fRange.getDataValidation().getUnitId());
556
871
  * ```
557
872
  */
558
873
  getUnitId() {
@@ -564,12 +879,10 @@ class m {
564
879
  * @returns {string | undefined} The sheet ID of the worksheet
565
880
  * @example
566
881
  * ```typescript
567
- * const dataValidation = univerAPI
568
- * .getActiveWorkbook()
569
- * .getActiveWorksheet()
570
- * .getActiveRange()
571
- * .getDataValidation();
572
- * const sheetId = dataValidation.getSheetId();
882
+ * const fWorkbook = univerAPI.getActiveWorkbook();
883
+ * const fWorksheet = fWorkbook.getActiveSheet();
884
+ * const fRange = fWorksheet.getRange('A1:B10');
885
+ * console.log(fRange.getDataValidation().getSheetId());
573
886
  * ```
574
887
  */
575
888
  getSheetId() {
@@ -584,15 +897,17 @@ class m {
584
897
  * @returns {FDataValidation} The current instance for method chaining
585
898
  * @example
586
899
  * ```typescript
587
- * const dataValidation = univerAPI
588
- * .getActiveWorkbook()
589
- * .getActiveWorksheet()
590
- * .getActiveRange()
591
- * .getDataValidation();
592
- * dataValidation.setCriteria(
593
- * DataValidationType.DECIMAL,
594
- * [DataValidationOperator.BETWEEN, '1', '10'],
595
- * true
900
+ * const fWorkbook = univerAPI.getActiveWorkbook();
901
+ * const fWorksheet = fWorkbook.getActiveSheet();
902
+ * const fRange = fWorksheet.getRange('A1:B10');
903
+ * const rule = univerAPI.newDataValidation()
904
+ * .requireNumberEqualTo(20)
905
+ * .build();
906
+ * fRange.setDataValidation(rule);
907
+ *
908
+ * fRange.getDataValidation().setCriteria(
909
+ * univerAPI.Enum.DataValidationType.DECIMAL,
910
+ * [univerAPI.Enum.DataValidationOperator.BETWEEN, '1', '10']
596
911
  * );
597
912
  * ```
598
913
  */
@@ -618,12 +933,15 @@ class m {
618
933
  * @returns {FDataValidation} The current instance for method chaining
619
934
  * @example
620
935
  * ```typescript
621
- * const dataValidation = univerAPI
622
- * .getActiveWorkbook()
623
- * .getActiveWorksheet()
624
- * .getActiveRange()
625
- * .getDataValidation();
626
- * dataValidation.setOptions({
936
+ * const fWorkbook = univerAPI.getActiveWorkbook();
937
+ * const fWorksheet = fWorkbook.getActiveSheet();
938
+ * const fRange = fWorksheet.getRange('A1:B10');
939
+ * const rule = univerAPI.newDataValidation()
940
+ * .requireNumberEqualTo(20)
941
+ * .build();
942
+ * fRange.setDataValidation(rule);
943
+ *
944
+ * fRange.getDataValidation().setOptions({
627
945
  * allowBlank: true,
628
946
  * showErrorMessage: true,
629
947
  * error: 'Please enter a valid value'
@@ -649,13 +967,16 @@ class m {
649
967
  * @returns {FDataValidation} The current instance for method chaining
650
968
  * @example
651
969
  * ```typescript
652
- * const dataValidation = univerAPI
653
- * .getActiveWorkbook()
654
- * .getActiveWorksheet()
655
- * .getActiveRange()
656
- * .getDataValidation();
657
- * const range = FRange.create('Sheet1', 'A1:B10');
658
- * dataValidation.setRanges([range]);
970
+ * const fWorkbook = univerAPI.getActiveWorkbook();
971
+ * const fWorksheet = fWorkbook.getActiveSheet();
972
+ * const fRange = fWorksheet.getRange('A1:B10');
973
+ * const rule = univerAPI.newDataValidation()
974
+ * .requireNumberEqualTo(20)
975
+ * .build();
976
+ * fRange.setDataValidation(rule);
977
+ *
978
+ * const newRuleRange = fWorksheet.getRange('C1:D10');
979
+ * fRange.getDataValidation().setRanges([newRuleRange]);
659
980
  * ```
660
981
  */
661
982
  setRanges(e) {
@@ -673,12 +994,15 @@ class m {
673
994
  * @returns {boolean} true if the rule is deleted successfully, false otherwise
674
995
  * @example
675
996
  * ```typescript
676
- * const dataValidation = univerAPI
677
- * .getActiveWorkbook()
678
- * .getActiveWorksheet()
679
- * .getActiveRange()
680
- * .getDataValidation();
681
- * const isDeleted = dataValidation.delete();
997
+ * const fWorkbook = univerAPI.getActiveWorkbook();
998
+ * const fWorksheet = fWorkbook.getActiveSheet();
999
+ * const fRange = fWorksheet.getRange('A1:B10');
1000
+ * const rule = univerAPI.newDataValidation()
1001
+ * .requireNumberEqualTo(20)
1002
+ * .build();
1003
+ * fRange.setDataValidation(rule);
1004
+ *
1005
+ * fRange.getDataValidation().delete();
682
1006
  * ```
683
1007
  */
684
1008
  delete() {
@@ -713,14 +1037,14 @@ class G extends y {
713
1037
  this._worksheet.getSheetId(),
714
1038
  [this._range]
715
1039
  );
716
- return t && new m(t, this._worksheet, this._injector);
1040
+ return t && new _(t, this._worksheet, this._injector);
717
1041
  }
718
1042
  getDataValidations() {
719
1043
  return this._injector.get(S).getDataValidations(
720
1044
  this._workbook.getUnitId(),
721
1045
  this._worksheet.getSheetId(),
722
1046
  [this._range]
723
- ).map((t) => new m(t, this._worksheet, this._injector));
1047
+ ).map((t) => new _(t, this._worksheet, this._injector));
724
1048
  }
725
1049
  async getValidatorStatus() {
726
1050
  return this._injector.get(S).validatorRanges(
@@ -747,22 +1071,22 @@ class Q extends M {
747
1071
  */
748
1072
  // eslint-disable-next-line max-lines-per-function
749
1073
  _initialize(e) {
750
- if (!e.has(w)) return;
751
- const t = e.get(w), i = e.get(p);
1074
+ if (!e.has(k)) return;
1075
+ const t = e.get(k), i = e.get(p);
752
1076
  this.registerEventHandler(
753
1077
  this.Event.SheetDataValidationChanged,
754
1078
  () => t.ruleChange$.subscribe((r) => {
755
1079
  const { unitId: a, subUnitId: n, rule: u, oldRule: l, type: s } = r, d = this.getSheetTarget(a, n);
756
1080
  if (!d)
757
1081
  return;
758
- const { workbook: D, worksheet: I } = d, V = new m(u, I.getSheet(), this._injector);
1082
+ const { workbook: D, worksheet: I } = d, v = new _(u, I.getSheet(), this._injector);
759
1083
  this.fireEvent(this.Event.SheetDataValidationChanged, {
760
1084
  origin: r,
761
1085
  worksheet: I,
762
1086
  workbook: D,
763
1087
  changeType: s,
764
1088
  oldRule: l,
765
- rule: V
1089
+ rule: v
766
1090
  });
767
1091
  })
768
1092
  ), this.registerEventHandler(
@@ -771,10 +1095,10 @@ class Q extends M {
771
1095
  const { unitId: a, subUnitId: n, ruleId: u, status: l, row: s, col: d } = r, D = this.getSheetTarget(a, n);
772
1096
  if (!D)
773
1097
  return;
774
- const { workbook: I, worksheet: V } = D, B = V.getDataValidation(u);
1098
+ const { workbook: I, worksheet: v } = D, B = v.getDataValidation(u);
775
1099
  B && this.fireEvent(this.Event.SheetDataValidatorStatusChanged, {
776
1100
  workbook: I,
777
- worksheet: V,
1101
+ worksheet: v,
778
1102
  row: s,
779
1103
  column: d,
780
1104
  rule: B,
@@ -794,7 +1118,7 @@ class Q extends M {
794
1118
  rule: a.rule
795
1119
  };
796
1120
  if (this.fireEvent(this.Event.BeforeSheetDataValidationAdd, s), s.cancel)
797
- throw new f();
1121
+ throw new m();
798
1122
  }
799
1123
  })
800
1124
  ), this.registerEventHandler(
@@ -815,7 +1139,7 @@ class Q extends M {
815
1139
  newCriteria: a.setting
816
1140
  };
817
1141
  if (this.fireEvent(this.Event.BeforeSheetDataValidationCriteriaUpdate, d), d.cancel)
818
- throw new f();
1142
+ throw new m();
819
1143
  }
820
1144
  })
821
1145
  ), this.registerEventHandler(
@@ -836,7 +1160,7 @@ class Q extends M {
836
1160
  newRanges: a.ranges
837
1161
  };
838
1162
  if (this.fireEvent(this.Event.BeforeSheetDataValidationRangeUpdate, d), d.cancel)
839
- throw new f();
1163
+ throw new m();
840
1164
  }
841
1165
  })
842
1166
  ), this.registerEventHandler(
@@ -857,7 +1181,7 @@ class Q extends M {
857
1181
  newOptions: a.options
858
1182
  };
859
1183
  if (this.fireEvent(this.Event.BeforeSheetDataValidationOptionsUpdate, d), d.cancel)
860
- throw new f();
1184
+ throw new m();
861
1185
  }
862
1186
  })
863
1187
  ), this.registerEventHandler(
@@ -877,7 +1201,7 @@ class Q extends M {
877
1201
  ruleId: a.ruleId
878
1202
  };
879
1203
  if (this.fireEvent(this.Event.BeforeSheetDataValidationDelete, d), d.cancel)
880
- throw new f();
1204
+ throw new m();
881
1205
  }
882
1206
  })
883
1207
  ), this.registerEventHandler(
@@ -893,7 +1217,7 @@ class Q extends M {
893
1217
  rules: l.getDataValidations()
894
1218
  };
895
1219
  if (this.fireEvent(this.Event.BeforeSheetDataValidationDeleteAll, s), s.cancel)
896
- throw new f();
1220
+ throw new m();
897
1221
  }
898
1222
  })
899
1223
  );
@@ -904,7 +1228,7 @@ class z extends x {
904
1228
  _initialize() {
905
1229
  Object.defineProperty(this, "_dataValidationModel", {
906
1230
  get() {
907
- return this._injector.get(w);
1231
+ return this._injector.get(k);
908
1232
  }
909
1233
  });
910
1234
  }
@@ -988,7 +1312,7 @@ class z extends x {
988
1312
  x.extend(z);
989
1313
  class K extends N {
990
1314
  getDataValidations() {
991
- return this._injector.get(v).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((t) => new m(t, this._worksheet, this._injector));
1315
+ return this._injector.get(w).getRules(this._workbook.getUnitId(), this._worksheet.getSheetId()).map((t) => new _(t, this._worksheet, this._injector));
992
1316
  }
993
1317
  getValidatorStatus() {
994
1318
  return this._injector.get(S).validatorWorksheet(
@@ -1000,8 +1324,8 @@ class K extends N {
1000
1324
  return this.getValidatorStatus();
1001
1325
  }
1002
1326
  getDataValidation(e) {
1003
- const i = this._injector.get(v).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), e);
1004
- return i ? new m(i, this._worksheet, this._injector) : null;
1327
+ const i = this._injector.get(w).getRuleById(this._workbook.getUnitId(), this._worksheet.getSheetId(), e);
1328
+ return i ? new _(i, this._worksheet, this._injector) : null;
1005
1329
  }
1006
1330
  }
1007
1331
  N.extend(K);
@@ -1033,6 +1357,6 @@ class X {
1033
1357
  }
1034
1358
  P.extend(X);
1035
1359
  export {
1036
- m as FDataValidation,
1360
+ _ as FDataValidation,
1037
1361
  E as FDataValidationBuilder
1038
1362
  };