@univerjs/sheets-data-validation 0.5.5 → 0.6.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/es/facade.js +56 -63
- package/lib/types/facade/f-data-validation-builder.d.ts +3 -2
- package/lib/types/facade/f-data-validation.d.ts +55 -52
- package/lib/types/facade/f-event.d.ts +12 -0
- package/lib/types/facade/f-range.d.ts +6 -0
- package/lib/types/facade/f-univer.d.ts +24 -6
- package/lib/types/facade/f-workbook.d.ts +6 -0
- package/lib/types/facade/f-worksheet.d.ts +6 -0
- package/package.json +9 -9
package/lib/es/facade.js
CHANGED
|
@@ -428,10 +428,10 @@ class m {
|
|
|
428
428
|
* @example
|
|
429
429
|
* ```typescript
|
|
430
430
|
* const dataValidation = univerAPI
|
|
431
|
-
*
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
*
|
|
431
|
+
* .getActiveWorkbook()
|
|
432
|
+
* .getActiveWorksheet()
|
|
433
|
+
* .getActiveRange()
|
|
434
|
+
* .getDataValidation();
|
|
435
435
|
* const allowsInvalid = dataValidation.getAllowInvalid();
|
|
436
436
|
* ```
|
|
437
437
|
*/
|
|
@@ -444,10 +444,10 @@ class m {
|
|
|
444
444
|
* @example
|
|
445
445
|
* ```typescript
|
|
446
446
|
* const dataValidation = univerAPI
|
|
447
|
-
*
|
|
448
|
-
*
|
|
449
|
-
*
|
|
450
|
-
*
|
|
447
|
+
* .getActiveWorkbook()
|
|
448
|
+
* .getActiveWorksheet()
|
|
449
|
+
* .getActiveRange()
|
|
450
|
+
* .getDataValidation();
|
|
451
451
|
* const type = dataValidation.getCriteriaType();
|
|
452
452
|
* ```
|
|
453
453
|
*/
|
|
@@ -460,10 +460,10 @@ class m {
|
|
|
460
460
|
* @example
|
|
461
461
|
* ```typescript
|
|
462
462
|
* const dataValidation = univerAPI
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
*
|
|
466
|
-
*
|
|
463
|
+
* .getActiveWorkbook()
|
|
464
|
+
* .getActiveWorksheet()
|
|
465
|
+
* .getActiveRange()
|
|
466
|
+
* .getDataValidation();
|
|
467
467
|
* const [operator, formula1, formula2] = dataValidation.getCriteriaValues();
|
|
468
468
|
* ```
|
|
469
469
|
*/
|
|
@@ -476,10 +476,10 @@ class m {
|
|
|
476
476
|
* @example
|
|
477
477
|
* ```typescript
|
|
478
478
|
* const dataValidation = univerAPI
|
|
479
|
-
*
|
|
480
|
-
*
|
|
481
|
-
*
|
|
482
|
-
*
|
|
479
|
+
* .getActiveWorkbook()
|
|
480
|
+
* .getActiveWorksheet()
|
|
481
|
+
* .getActiveRange()
|
|
482
|
+
* .getDataValidation();
|
|
483
483
|
* const helpText = dataValidation.getHelpText();
|
|
484
484
|
* ```
|
|
485
485
|
*/
|
|
@@ -492,10 +492,10 @@ class m {
|
|
|
492
492
|
* @example
|
|
493
493
|
* ```typescript
|
|
494
494
|
* const dataValidation = univerAPI
|
|
495
|
-
*
|
|
496
|
-
*
|
|
497
|
-
*
|
|
498
|
-
*
|
|
495
|
+
* .getActiveWorkbook()
|
|
496
|
+
* .getActiveWorksheet()
|
|
497
|
+
* .getActiveRange()
|
|
498
|
+
* .getDataValidation();
|
|
499
499
|
* const builder = dataValidation.copy();
|
|
500
500
|
* const newRule = builder.setAllowInvalid(true).build();
|
|
501
501
|
* ```
|
|
@@ -509,10 +509,10 @@ class m {
|
|
|
509
509
|
* @example
|
|
510
510
|
* ```typescript
|
|
511
511
|
* const dataValidation = univerAPI
|
|
512
|
-
*
|
|
513
|
-
*
|
|
514
|
-
*
|
|
515
|
-
*
|
|
512
|
+
* .getActiveWorkbook()
|
|
513
|
+
* .getActiveWorksheet()
|
|
514
|
+
* .getActiveRange()
|
|
515
|
+
* .getDataValidation();
|
|
516
516
|
* const isApplied = dataValidation.getApplied();
|
|
517
517
|
* ```
|
|
518
518
|
*/
|
|
@@ -528,10 +528,10 @@ class m {
|
|
|
528
528
|
* @example
|
|
529
529
|
* ```typescript
|
|
530
530
|
* const dataValidation = univerAPI
|
|
531
|
-
*
|
|
532
|
-
*
|
|
533
|
-
*
|
|
534
|
-
*
|
|
531
|
+
* .getActiveWorkbook()
|
|
532
|
+
* .getActiveWorksheet()
|
|
533
|
+
* .getActiveRange()
|
|
534
|
+
* .getDataValidation();
|
|
535
535
|
* const ranges = dataValidation.getRanges();
|
|
536
536
|
* ```
|
|
537
537
|
*/
|
|
@@ -547,10 +547,10 @@ class m {
|
|
|
547
547
|
* @example
|
|
548
548
|
* ```typescript
|
|
549
549
|
* const dataValidation = univerAPI
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
550
|
+
* .getActiveWorkbook()
|
|
551
|
+
* .getActiveWorksheet()
|
|
552
|
+
* .getActiveRange()
|
|
553
|
+
* .getDataValidation();
|
|
554
554
|
* const unitId = dataValidation.getUnitId();
|
|
555
555
|
* ```
|
|
556
556
|
*/
|
|
@@ -564,10 +564,10 @@ class m {
|
|
|
564
564
|
* @example
|
|
565
565
|
* ```typescript
|
|
566
566
|
* const dataValidation = univerAPI
|
|
567
|
-
*
|
|
568
|
-
*
|
|
569
|
-
*
|
|
570
|
-
*
|
|
567
|
+
* .getActiveWorkbook()
|
|
568
|
+
* .getActiveWorksheet()
|
|
569
|
+
* .getActiveRange()
|
|
570
|
+
* .getDataValidation();
|
|
571
571
|
* const sheetId = dataValidation.getSheetId();
|
|
572
572
|
* ```
|
|
573
573
|
*/
|
|
@@ -584,10 +584,10 @@ class m {
|
|
|
584
584
|
* @example
|
|
585
585
|
* ```typescript
|
|
586
586
|
* const dataValidation = univerAPI
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
*
|
|
587
|
+
* .getActiveWorkbook()
|
|
588
|
+
* .getActiveWorksheet()
|
|
589
|
+
* .getActiveRange()
|
|
590
|
+
* .getDataValidation();
|
|
591
591
|
* dataValidation.setCriteria(
|
|
592
592
|
* DataValidationType.DECIMAL,
|
|
593
593
|
* [DataValidationOperator.BETWEEN, '1', '10'],
|
|
@@ -618,10 +618,10 @@ class m {
|
|
|
618
618
|
* @example
|
|
619
619
|
* ```typescript
|
|
620
620
|
* const dataValidation = univerAPI
|
|
621
|
-
*
|
|
622
|
-
*
|
|
623
|
-
*
|
|
624
|
-
*
|
|
621
|
+
* .getActiveWorkbook()
|
|
622
|
+
* .getActiveWorksheet()
|
|
623
|
+
* .getActiveRange()
|
|
624
|
+
* .getDataValidation();
|
|
625
625
|
* dataValidation.setOptions({
|
|
626
626
|
* allowBlank: true,
|
|
627
627
|
* showErrorMessage: true,
|
|
@@ -649,10 +649,10 @@ class m {
|
|
|
649
649
|
* @example
|
|
650
650
|
* ```typescript
|
|
651
651
|
* const dataValidation = univerAPI
|
|
652
|
-
*
|
|
653
|
-
*
|
|
654
|
-
*
|
|
655
|
-
*
|
|
652
|
+
* .getActiveWorkbook()
|
|
653
|
+
* .getActiveWorksheet()
|
|
654
|
+
* .getActiveRange()
|
|
655
|
+
* .getDataValidation();
|
|
656
656
|
* const range = FRange.create('Sheet1', 'A1:B10');
|
|
657
657
|
* dataValidation.setRanges([range]);
|
|
658
658
|
* ```
|
|
@@ -673,10 +673,10 @@ class m {
|
|
|
673
673
|
* @example
|
|
674
674
|
* ```typescript
|
|
675
675
|
* const dataValidation = univerAPI
|
|
676
|
-
*
|
|
677
|
-
*
|
|
678
|
-
*
|
|
679
|
-
*
|
|
676
|
+
* .getActiveWorkbook()
|
|
677
|
+
* .getActiveWorksheet()
|
|
678
|
+
* .getActiveRange()
|
|
679
|
+
* .getDataValidation();
|
|
680
680
|
* const isDeleted = dataValidation.delete();
|
|
681
681
|
* ```
|
|
682
682
|
*/
|
|
@@ -731,26 +731,19 @@ class G extends y {
|
|
|
731
731
|
}
|
|
732
732
|
y.extend(G);
|
|
733
733
|
class Q extends x {
|
|
734
|
-
// eslint-disable-next-line jsdoc/require-returns
|
|
735
|
-
/**
|
|
736
734
|
/**
|
|
737
735
|
* @deprecated use `univerAPI.newDataValidation()` as instead.
|
|
736
|
+
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
738
737
|
*/
|
|
739
738
|
static newDataValidation() {
|
|
740
739
|
return new D();
|
|
741
740
|
}
|
|
742
|
-
/**
|
|
743
|
-
* Creates a new instance of FDataValidationBuilder
|
|
744
|
-
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
745
|
-
* @example
|
|
746
|
-
* ```ts
|
|
747
|
-
* const rule = FUnvier.newDataValidation();
|
|
748
|
-
* cell.setDataValidation(rule.requireValueInRange(range));
|
|
749
|
-
* ```
|
|
750
|
-
*/
|
|
751
741
|
newDataValidation() {
|
|
752
742
|
return new D();
|
|
753
743
|
}
|
|
744
|
+
/**
|
|
745
|
+
* @ignore
|
|
746
|
+
*/
|
|
754
747
|
// eslint-disable-next-line max-lines-per-function
|
|
755
748
|
_initialize(e) {
|
|
756
749
|
if (!e.has(V)) return;
|
|
@@ -2,14 +2,15 @@ import { IDataValidationRule, IDataValidationRuleOptions, DataValidationType } f
|
|
|
2
2
|
import { FRange } from '@univerjs/sheets/facade';
|
|
3
3
|
import { FDataValidation } from './f-data-validation';
|
|
4
4
|
/**
|
|
5
|
-
* Builder for data validation rules.
|
|
5
|
+
* Builder for data validation rules. use {@link FUniver} `univerAPI.newDataValidation()` to create a new builder.
|
|
6
6
|
* @example
|
|
7
7
|
* ```typescript
|
|
8
8
|
* // Set the data validation for cell A1 to require a value from B1:B10
|
|
9
9
|
* const range = FRange.create('Sheet1', 'B1:B10');
|
|
10
|
-
* const rule =
|
|
10
|
+
* const rule = univerAPI.newDataValidation().requireValueInRange(range).build();
|
|
11
11
|
* cell.setDataValidation(rule);
|
|
12
12
|
* ```
|
|
13
|
+
* @hideconstructor
|
|
13
14
|
*/
|
|
14
15
|
export declare class FDataValidationBuilder {
|
|
15
16
|
private _rule;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DataValidationOperator, DataValidationType, IDataValidationRule, IDataValidationRuleOptions, Injector, Worksheet } from '@univerjs/core';
|
|
2
2
|
import { FRange } from '@univerjs/sheets/facade';
|
|
3
3
|
import { FDataValidationBuilder } from './f-data-validation-builder';
|
|
4
|
+
/**
|
|
5
|
+
* @hideconstructor
|
|
6
|
+
*/
|
|
4
7
|
export declare class FDataValidation {
|
|
5
8
|
rule: IDataValidationRule;
|
|
6
9
|
private _worksheet;
|
|
@@ -12,10 +15,10 @@ export declare class FDataValidation {
|
|
|
12
15
|
* @example
|
|
13
16
|
* ```typescript
|
|
14
17
|
* const dataValidation = univerAPI
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
18
|
+
* .getActiveWorkbook()
|
|
19
|
+
* .getActiveWorksheet()
|
|
20
|
+
* .getActiveRange()
|
|
21
|
+
* .getDataValidation();
|
|
19
22
|
* const allowsInvalid = dataValidation.getAllowInvalid();
|
|
20
23
|
* ```
|
|
21
24
|
*/
|
|
@@ -26,10 +29,10 @@ export declare class FDataValidation {
|
|
|
26
29
|
* @example
|
|
27
30
|
* ```typescript
|
|
28
31
|
* const dataValidation = univerAPI
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
32
|
+
* .getActiveWorkbook()
|
|
33
|
+
* .getActiveWorksheet()
|
|
34
|
+
* .getActiveRange()
|
|
35
|
+
* .getDataValidation();
|
|
33
36
|
* const type = dataValidation.getCriteriaType();
|
|
34
37
|
* ```
|
|
35
38
|
*/
|
|
@@ -40,10 +43,10 @@ export declare class FDataValidation {
|
|
|
40
43
|
* @example
|
|
41
44
|
* ```typescript
|
|
42
45
|
* const dataValidation = univerAPI
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
46
|
+
* .getActiveWorkbook()
|
|
47
|
+
* .getActiveWorksheet()
|
|
48
|
+
* .getActiveRange()
|
|
49
|
+
* .getDataValidation();
|
|
47
50
|
* const [operator, formula1, formula2] = dataValidation.getCriteriaValues();
|
|
48
51
|
* ```
|
|
49
52
|
*/
|
|
@@ -54,10 +57,10 @@ export declare class FDataValidation {
|
|
|
54
57
|
* @example
|
|
55
58
|
* ```typescript
|
|
56
59
|
* const dataValidation = univerAPI
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
60
|
+
* .getActiveWorkbook()
|
|
61
|
+
* .getActiveWorksheet()
|
|
62
|
+
* .getActiveRange()
|
|
63
|
+
* .getDataValidation();
|
|
61
64
|
* const helpText = dataValidation.getHelpText();
|
|
62
65
|
* ```
|
|
63
66
|
*/
|
|
@@ -68,10 +71,10 @@ export declare class FDataValidation {
|
|
|
68
71
|
* @example
|
|
69
72
|
* ```typescript
|
|
70
73
|
* const dataValidation = univerAPI
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
74
|
+
* .getActiveWorkbook()
|
|
75
|
+
* .getActiveWorksheet()
|
|
76
|
+
* .getActiveRange()
|
|
77
|
+
* .getDataValidation();
|
|
75
78
|
* const builder = dataValidation.copy();
|
|
76
79
|
* const newRule = builder.setAllowInvalid(true).build();
|
|
77
80
|
* ```
|
|
@@ -83,10 +86,10 @@ export declare class FDataValidation {
|
|
|
83
86
|
* @example
|
|
84
87
|
* ```typescript
|
|
85
88
|
* const dataValidation = univerAPI
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
89
|
+
* .getActiveWorkbook()
|
|
90
|
+
* .getActiveWorksheet()
|
|
91
|
+
* .getActiveRange()
|
|
92
|
+
* .getDataValidation();
|
|
90
93
|
* const isApplied = dataValidation.getApplied();
|
|
91
94
|
* ```
|
|
92
95
|
*/
|
|
@@ -97,10 +100,10 @@ export declare class FDataValidation {
|
|
|
97
100
|
* @example
|
|
98
101
|
* ```typescript
|
|
99
102
|
* const dataValidation = univerAPI
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
103
|
+
* .getActiveWorkbook()
|
|
104
|
+
* .getActiveWorksheet()
|
|
105
|
+
* .getActiveRange()
|
|
106
|
+
* .getDataValidation();
|
|
104
107
|
* const ranges = dataValidation.getRanges();
|
|
105
108
|
* ```
|
|
106
109
|
*/
|
|
@@ -111,10 +114,10 @@ export declare class FDataValidation {
|
|
|
111
114
|
* @example
|
|
112
115
|
* ```typescript
|
|
113
116
|
* const dataValidation = univerAPI
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
117
|
+
* .getActiveWorkbook()
|
|
118
|
+
* .getActiveWorksheet()
|
|
119
|
+
* .getActiveRange()
|
|
120
|
+
* .getDataValidation();
|
|
118
121
|
* const unitId = dataValidation.getUnitId();
|
|
119
122
|
* ```
|
|
120
123
|
*/
|
|
@@ -125,10 +128,10 @@ export declare class FDataValidation {
|
|
|
125
128
|
* @example
|
|
126
129
|
* ```typescript
|
|
127
130
|
* const dataValidation = univerAPI
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
131
|
+
* .getActiveWorkbook()
|
|
132
|
+
* .getActiveWorksheet()
|
|
133
|
+
* .getActiveRange()
|
|
134
|
+
* .getDataValidation();
|
|
132
135
|
* const sheetId = dataValidation.getSheetId();
|
|
133
136
|
* ```
|
|
134
137
|
*/
|
|
@@ -142,10 +145,10 @@ export declare class FDataValidation {
|
|
|
142
145
|
* @example
|
|
143
146
|
* ```typescript
|
|
144
147
|
* const dataValidation = univerAPI
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
148
|
+
* .getActiveWorkbook()
|
|
149
|
+
* .getActiveWorksheet()
|
|
150
|
+
* .getActiveRange()
|
|
151
|
+
* .getDataValidation();
|
|
149
152
|
* dataValidation.setCriteria(
|
|
150
153
|
* DataValidationType.DECIMAL,
|
|
151
154
|
* [DataValidationOperator.BETWEEN, '1', '10'],
|
|
@@ -161,10 +164,10 @@ export declare class FDataValidation {
|
|
|
161
164
|
* @example
|
|
162
165
|
* ```typescript
|
|
163
166
|
* const dataValidation = univerAPI
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
167
|
+
* .getActiveWorkbook()
|
|
168
|
+
* .getActiveWorksheet()
|
|
169
|
+
* .getActiveRange()
|
|
170
|
+
* .getDataValidation();
|
|
168
171
|
* dataValidation.setOptions({
|
|
169
172
|
* allowBlank: true,
|
|
170
173
|
* showErrorMessage: true,
|
|
@@ -180,10 +183,10 @@ export declare class FDataValidation {
|
|
|
180
183
|
* @example
|
|
181
184
|
* ```typescript
|
|
182
185
|
* const dataValidation = univerAPI
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
186
|
+
* .getActiveWorkbook()
|
|
187
|
+
* .getActiveWorksheet()
|
|
188
|
+
* .getActiveRange()
|
|
189
|
+
* .getDataValidation();
|
|
187
190
|
* const range = FRange.create('Sheet1', 'A1:B10');
|
|
188
191
|
* dataValidation.setRanges([range]);
|
|
189
192
|
* ```
|
|
@@ -195,10 +198,10 @@ export declare class FDataValidation {
|
|
|
195
198
|
* @example
|
|
196
199
|
* ```typescript
|
|
197
200
|
* const dataValidation = univerAPI
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
201
|
+
* .getActiveWorkbook()
|
|
202
|
+
* .getActiveWorksheet()
|
|
203
|
+
* .getActiveRange()
|
|
204
|
+
* .getDataValidation();
|
|
202
205
|
* const isDeleted = dataValidation.delete();
|
|
203
206
|
* ```
|
|
204
207
|
*/
|
|
@@ -132,6 +132,9 @@ export interface IBeforeSheetDataValidationDeleteAllEvent extends IEventBase {
|
|
|
132
132
|
/** Array of all validation rules to be deleted */
|
|
133
133
|
rules: FDataValidation[];
|
|
134
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* @ignore
|
|
137
|
+
*/
|
|
135
138
|
export interface IDataValidationEventParamConfig {
|
|
136
139
|
SheetDataValidationChanged: ISheetDataValidationChangedEvent;
|
|
137
140
|
SheetDataValidatorStatusChanged: ISheetDataValidatorStatusChangedEvent;
|
|
@@ -142,6 +145,9 @@ export interface IDataValidationEventParamConfig {
|
|
|
142
145
|
BeforeSheetDataValidationRangeUpdate: IBeforeSheetDataValidationRangeUpdateEvent;
|
|
143
146
|
BeforeSheetDataValidationOptionsUpdate: IBeforeSheetDataValidationOptionsUpdateEvent;
|
|
144
147
|
}
|
|
148
|
+
/**
|
|
149
|
+
* @ignore
|
|
150
|
+
*/
|
|
145
151
|
interface IDataValidationEvent {
|
|
146
152
|
/**
|
|
147
153
|
* Event fired when a rule is added, deleted, or modified
|
|
@@ -240,6 +246,9 @@ interface IDataValidationEvent {
|
|
|
240
246
|
*/
|
|
241
247
|
readonly BeforeSheetDataValidationOptionsUpdate: 'BeforeSheetDataValidationOptionsUpdate';
|
|
242
248
|
}
|
|
249
|
+
/**
|
|
250
|
+
* @ignore
|
|
251
|
+
*/
|
|
243
252
|
export declare class FDataValidationEvent implements IDataValidationEvent {
|
|
244
253
|
get SheetDataValidationChanged(): 'SheetDataValidationChanged';
|
|
245
254
|
get SheetDataValidatorStatusChanged(): 'SheetDataValidatorStatusChanged';
|
|
@@ -250,6 +259,9 @@ export declare class FDataValidationEvent implements IDataValidationEvent {
|
|
|
250
259
|
get BeforeSheetDataValidationRangeUpdate(): 'BeforeSheetDataValidationRangeUpdate';
|
|
251
260
|
get BeforeSheetDataValidationOptionsUpdate(): 'BeforeSheetDataValidationOptionsUpdate';
|
|
252
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* @ignore
|
|
264
|
+
*/
|
|
253
265
|
export interface IDataValidationEventConfig {
|
|
254
266
|
SheetDataValidationChanged: ISheetDataValidationChangedEvent;
|
|
255
267
|
SheetDataValidatorStatusChanged: ISheetDataValidatorStatusChangedEvent;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DataValidationStatus, Nullable } from '@univerjs/core';
|
|
2
2
|
import { FRange } from '@univerjs/sheets/facade';
|
|
3
3
|
import { FDataValidation } from './f-data-validation';
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
4
7
|
export interface IFRangeDataValidationMixin {
|
|
5
8
|
/**
|
|
6
9
|
* Set a data validation rule to current range. if rule is null, clear data validation rule.
|
|
@@ -47,6 +50,9 @@ export interface IFRangeDataValidationMixin {
|
|
|
47
50
|
*/
|
|
48
51
|
getValidatorStatus(): Promise<DataValidationStatus[][]>;
|
|
49
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* @ignore
|
|
55
|
+
*/
|
|
50
56
|
export declare class FRangeDataValidationMixin extends FRange implements IFRangeDataValidationMixin {
|
|
51
57
|
setDataValidation(rule: Nullable<FDataValidation>): FRange;
|
|
52
58
|
getDataValidation(): Nullable<FDataValidation>;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Injector, FUniver } from '@univerjs/core';
|
|
2
2
|
import { FDataValidationBuilder } from './f-data-validation-builder';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*/
|
|
8
|
-
static newDataValidation(): FDataValidationBuilder;
|
|
3
|
+
/**
|
|
4
|
+
* @ignore
|
|
5
|
+
*/
|
|
6
|
+
export interface IFUnvierDataValidationMixin {
|
|
9
7
|
/**
|
|
10
8
|
* Creates a new instance of FDataValidationBuilder
|
|
11
9
|
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
@@ -16,10 +14,30 @@ export declare class FUnvierDataValidationMixin extends FUniver {
|
|
|
16
14
|
* ```
|
|
17
15
|
*/
|
|
18
16
|
newDataValidation(): FDataValidationBuilder;
|
|
17
|
+
}
|
|
18
|
+
export declare class FUnvierDataValidationMixin extends FUniver implements IFUnvierDataValidationMixin {
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated use `univerAPI.newDataValidation()` as instead.
|
|
21
|
+
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
22
|
+
*/
|
|
23
|
+
static newDataValidation(): FDataValidationBuilder;
|
|
24
|
+
newDataValidation(): FDataValidationBuilder;
|
|
25
|
+
/**
|
|
26
|
+
* @ignore
|
|
27
|
+
*/
|
|
19
28
|
_initialize(injector: Injector): void;
|
|
20
29
|
}
|
|
21
30
|
declare module '@univerjs/core' {
|
|
31
|
+
/**
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
22
34
|
namespace FUniver {
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use `univerAPI.newDataValidation()` as instead.
|
|
37
|
+
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
38
|
+
*/
|
|
23
39
|
function newDataValidation(): FDataValidationBuilder;
|
|
24
40
|
}
|
|
41
|
+
interface FUniver extends IFUnvierDataValidationMixin {
|
|
42
|
+
}
|
|
25
43
|
}
|
|
@@ -2,6 +2,9 @@ import { IRuleChange } from '@univerjs/data-validation';
|
|
|
2
2
|
import { IAddSheetDataValidationCommandParams, IRemoveSheetAllDataValidationCommandParams, IRemoveSheetDataValidationCommandParams, IUpdateSheetDataValidationOptionsCommandParams, IUpdateSheetDataValidationRangeCommandParams, IUpdateSheetDataValidationSettingCommandParams, IValidStatusChange, SheetDataValidationModel } from '@univerjs/sheets-data-validation';
|
|
3
3
|
import { DataValidationStatus, IDisposable, IExecutionOptions, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
4
4
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
5
|
+
/**
|
|
6
|
+
* @ignore
|
|
7
|
+
*/
|
|
5
8
|
export interface IFWorkbookDataValidationMixin {
|
|
6
9
|
/**
|
|
7
10
|
* Get data validation validator status for current workbook.
|
|
@@ -45,6 +48,9 @@ export interface IFWorkbookDataValidationMixin {
|
|
|
45
48
|
*/
|
|
46
49
|
onBeforeDeleteAllDataValidation(this: FWorkbook, callback: (params: IRemoveSheetAllDataValidationCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
47
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* @ignore
|
|
53
|
+
*/
|
|
48
54
|
export declare class FWorkbookDataValidationMixin extends FWorkbook implements IFWorkbookDataValidationMixin {
|
|
49
55
|
_dataValidationModel: SheetDataValidationModel;
|
|
50
56
|
_initialize(): void;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DataValidationStatus, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { FWorksheet } from '@univerjs/sheets/facade';
|
|
3
3
|
import { FDataValidation } from './f-data-validation';
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
4
7
|
export interface IFWorksheetDataValidationMixin {
|
|
5
8
|
/**
|
|
6
9
|
* Get all data validation rules in current sheet.
|
|
@@ -38,6 +41,9 @@ export interface IFWorksheetDataValidationMixin {
|
|
|
38
41
|
*/
|
|
39
42
|
getDataValidation(ruleId: string): Nullable<FDataValidation>;
|
|
40
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* @ignore
|
|
46
|
+
*/
|
|
41
47
|
export declare class FWorksheetDataValidationMixin extends FWorksheet implements IFWorksheetDataValidationMixin {
|
|
42
48
|
getDataValidations(): FDataValidation[];
|
|
43
49
|
getValidatorStatus(): Promise<ObjectMatrix<Nullable<DataValidationStatus>>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-data-validation",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0-alpha.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Data validation for Univer Sheets",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"rxjs": ">=7.0.0"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"@univerjs/protocol": "0.1.
|
|
57
|
-
"@univerjs/core": "0.
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/
|
|
61
|
-
"@univerjs/sheets-formula": "0.
|
|
56
|
+
"@univerjs/protocol": "0.1.43",
|
|
57
|
+
"@univerjs/core": "0.6.0-alpha.0",
|
|
58
|
+
"@univerjs/data-validation": "0.6.0-alpha.0",
|
|
59
|
+
"@univerjs/sheets": "0.6.0-alpha.0",
|
|
60
|
+
"@univerjs/engine-formula": "0.6.0-alpha.0",
|
|
61
|
+
"@univerjs/sheets-formula": "0.6.0-alpha.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"less": "^4.2.1",
|
|
65
65
|
"rxjs": "^7.8.1",
|
|
66
|
-
"typescript": "^5.7.
|
|
66
|
+
"typescript": "^5.7.3",
|
|
67
67
|
"vite": "^6.0.7",
|
|
68
68
|
"vitest": "^2.1.8",
|
|
69
|
-
"@univerjs-infra/shared": "0.
|
|
69
|
+
"@univerjs-infra/shared": "0.6.0-alpha.0"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"dev": "vite",
|