@univerjs/sheets-data-validation 0.5.5-experimental.20250122-3362a4a → 0.5.5-experimental.20250123-34738ff
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/cjs/index.js +1 -1
- package/lib/es/facade.js +53 -63
- package/lib/es/index.js +2 -2
- package/lib/types/facade/f-data-validation-builder.d.ts +2 -2
- package/lib/types/facade/f-data-validation.d.ts +52 -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 +21 -6
- package/lib/types/facade/f-workbook.d.ts +6 -0
- package/lib/types/facade/f-worksheet.d.ts +6 -0
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
package/lib/es/facade.js
CHANGED
|
@@ -431,10 +431,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
431
431
|
* @example
|
|
432
432
|
* ```typescript
|
|
433
433
|
* const dataValidation = univerAPI
|
|
434
|
-
*
|
|
435
|
-
*
|
|
436
|
-
*
|
|
437
|
-
*
|
|
434
|
+
* .getActiveWorkbook()
|
|
435
|
+
* .getActiveWorksheet()
|
|
436
|
+
* .getActiveRange()
|
|
437
|
+
* .getDataValidation();
|
|
438
438
|
* const allowsInvalid = dataValidation.getAllowInvalid();
|
|
439
439
|
* ```
|
|
440
440
|
*/
|
|
@@ -447,10 +447,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
447
447
|
* @example
|
|
448
448
|
* ```typescript
|
|
449
449
|
* const dataValidation = univerAPI
|
|
450
|
-
*
|
|
451
|
-
*
|
|
452
|
-
*
|
|
453
|
-
*
|
|
450
|
+
* .getActiveWorkbook()
|
|
451
|
+
* .getActiveWorksheet()
|
|
452
|
+
* .getActiveRange()
|
|
453
|
+
* .getDataValidation();
|
|
454
454
|
* const type = dataValidation.getCriteriaType();
|
|
455
455
|
* ```
|
|
456
456
|
*/
|
|
@@ -463,10 +463,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
463
463
|
* @example
|
|
464
464
|
* ```typescript
|
|
465
465
|
* const dataValidation = univerAPI
|
|
466
|
-
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
466
|
+
* .getActiveWorkbook()
|
|
467
|
+
* .getActiveWorksheet()
|
|
468
|
+
* .getActiveRange()
|
|
469
|
+
* .getDataValidation();
|
|
470
470
|
* const [operator, formula1, formula2] = dataValidation.getCriteriaValues();
|
|
471
471
|
* ```
|
|
472
472
|
*/
|
|
@@ -479,10 +479,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
479
479
|
* @example
|
|
480
480
|
* ```typescript
|
|
481
481
|
* const dataValidation = univerAPI
|
|
482
|
-
*
|
|
483
|
-
*
|
|
484
|
-
*
|
|
485
|
-
*
|
|
482
|
+
* .getActiveWorkbook()
|
|
483
|
+
* .getActiveWorksheet()
|
|
484
|
+
* .getActiveRange()
|
|
485
|
+
* .getDataValidation();
|
|
486
486
|
* const helpText = dataValidation.getHelpText();
|
|
487
487
|
* ```
|
|
488
488
|
*/
|
|
@@ -495,10 +495,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
495
495
|
* @example
|
|
496
496
|
* ```typescript
|
|
497
497
|
* const dataValidation = univerAPI
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
498
|
+
* .getActiveWorkbook()
|
|
499
|
+
* .getActiveWorksheet()
|
|
500
|
+
* .getActiveRange()
|
|
501
|
+
* .getDataValidation();
|
|
502
502
|
* const builder = dataValidation.copy();
|
|
503
503
|
* const newRule = builder.setAllowInvalid(true).build();
|
|
504
504
|
* ```
|
|
@@ -512,10 +512,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
512
512
|
* @example
|
|
513
513
|
* ```typescript
|
|
514
514
|
* const dataValidation = univerAPI
|
|
515
|
-
*
|
|
516
|
-
*
|
|
517
|
-
*
|
|
518
|
-
*
|
|
515
|
+
* .getActiveWorkbook()
|
|
516
|
+
* .getActiveWorksheet()
|
|
517
|
+
* .getActiveRange()
|
|
518
|
+
* .getDataValidation();
|
|
519
519
|
* const isApplied = dataValidation.getApplied();
|
|
520
520
|
* ```
|
|
521
521
|
*/
|
|
@@ -531,10 +531,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
531
531
|
* @example
|
|
532
532
|
* ```typescript
|
|
533
533
|
* const dataValidation = univerAPI
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
*
|
|
534
|
+
* .getActiveWorkbook()
|
|
535
|
+
* .getActiveWorksheet()
|
|
536
|
+
* .getActiveRange()
|
|
537
|
+
* .getDataValidation();
|
|
538
538
|
* const ranges = dataValidation.getRanges();
|
|
539
539
|
* ```
|
|
540
540
|
*/
|
|
@@ -550,10 +550,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
550
550
|
* @example
|
|
551
551
|
* ```typescript
|
|
552
552
|
* const dataValidation = univerAPI
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
553
|
+
* .getActiveWorkbook()
|
|
554
|
+
* .getActiveWorksheet()
|
|
555
|
+
* .getActiveRange()
|
|
556
|
+
* .getDataValidation();
|
|
557
557
|
* const unitId = dataValidation.getUnitId();
|
|
558
558
|
* ```
|
|
559
559
|
*/
|
|
@@ -567,10 +567,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
567
567
|
* @example
|
|
568
568
|
* ```typescript
|
|
569
569
|
* const dataValidation = univerAPI
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
570
|
+
* .getActiveWorkbook()
|
|
571
|
+
* .getActiveWorksheet()
|
|
572
|
+
* .getActiveRange()
|
|
573
|
+
* .getDataValidation();
|
|
574
574
|
* const sheetId = dataValidation.getSheetId();
|
|
575
575
|
* ```
|
|
576
576
|
*/
|
|
@@ -587,10 +587,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
587
587
|
* @example
|
|
588
588
|
* ```typescript
|
|
589
589
|
* const dataValidation = univerAPI
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
*
|
|
590
|
+
* .getActiveWorkbook()
|
|
591
|
+
* .getActiveWorksheet()
|
|
592
|
+
* .getActiveRange()
|
|
593
|
+
* .getDataValidation();
|
|
594
594
|
* dataValidation.setCriteria(
|
|
595
595
|
* DataValidationType.DECIMAL,
|
|
596
596
|
* [DataValidationOperator.BETWEEN, '1', '10'],
|
|
@@ -621,10 +621,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
621
621
|
* @example
|
|
622
622
|
* ```typescript
|
|
623
623
|
* const dataValidation = univerAPI
|
|
624
|
-
*
|
|
625
|
-
*
|
|
626
|
-
*
|
|
627
|
-
*
|
|
624
|
+
* .getActiveWorkbook()
|
|
625
|
+
* .getActiveWorksheet()
|
|
626
|
+
* .getActiveRange()
|
|
627
|
+
* .getDataValidation();
|
|
628
628
|
* dataValidation.setOptions({
|
|
629
629
|
* allowBlank: true,
|
|
630
630
|
* showErrorMessage: true,
|
|
@@ -652,10 +652,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
652
652
|
* @example
|
|
653
653
|
* ```typescript
|
|
654
654
|
* const dataValidation = univerAPI
|
|
655
|
-
*
|
|
656
|
-
*
|
|
657
|
-
*
|
|
658
|
-
*
|
|
655
|
+
* .getActiveWorkbook()
|
|
656
|
+
* .getActiveWorksheet()
|
|
657
|
+
* .getActiveRange()
|
|
658
|
+
* .getDataValidation();
|
|
659
659
|
* const range = FRange.create('Sheet1', 'A1:B10');
|
|
660
660
|
* dataValidation.setRanges([range]);
|
|
661
661
|
* ```
|
|
@@ -676,10 +676,10 @@ const _FDataValidation = class _FDataValidation {
|
|
|
676
676
|
* @example
|
|
677
677
|
* ```typescript
|
|
678
678
|
* const dataValidation = univerAPI
|
|
679
|
-
*
|
|
680
|
-
*
|
|
681
|
-
*
|
|
682
|
-
*
|
|
679
|
+
* .getActiveWorkbook()
|
|
680
|
+
* .getActiveWorksheet()
|
|
681
|
+
* .getActiveRange()
|
|
682
|
+
* .getDataValidation();
|
|
683
683
|
* const isDeleted = dataValidation.delete();
|
|
684
684
|
* ```
|
|
685
685
|
*/
|
|
@@ -738,23 +738,13 @@ __name(_FRangeDataValidationMixin, "FRangeDataValidationMixin");
|
|
|
738
738
|
let FRangeDataValidationMixin = _FRangeDataValidationMixin;
|
|
739
739
|
FRange.extend(FRangeDataValidationMixin);
|
|
740
740
|
const _FUnvierDataValidationMixin = class _FUnvierDataValidationMixin extends FUniver {
|
|
741
|
-
// eslint-disable-next-line jsdoc/require-returns
|
|
742
|
-
/**
|
|
743
741
|
/**
|
|
744
742
|
* @deprecated use `univerAPI.newDataValidation()` as instead.
|
|
743
|
+
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
745
744
|
*/
|
|
746
745
|
static newDataValidation() {
|
|
747
746
|
return new FDataValidationBuilder();
|
|
748
747
|
}
|
|
749
|
-
/**
|
|
750
|
-
* Creates a new instance of FDataValidationBuilder
|
|
751
|
-
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
752
|
-
* @example
|
|
753
|
-
* ```ts
|
|
754
|
-
* const rule = FUnvier.newDataValidation();
|
|
755
|
-
* cell.setDataValidation(rule.requireValueInRange(range));
|
|
756
|
-
* ```
|
|
757
|
-
*/
|
|
758
748
|
newDataValidation() {
|
|
759
749
|
return new FDataValidationBuilder();
|
|
760
750
|
}
|
package/lib/es/index.js
CHANGED
|
@@ -1756,7 +1756,7 @@ DataValidationFormulaRefRangeController = __decorateClass$6([
|
|
|
1756
1756
|
__decorateParam$6(1, Inject(FormulaRefRangeService)),
|
|
1757
1757
|
__decorateParam$6(2, Inject(DataValidatorRegistryService))
|
|
1758
1758
|
], DataValidationFormulaRefRangeController);
|
|
1759
|
-
var
|
|
1759
|
+
var D = /* @__PURE__ */ ((E) => (E[E.View = 0] = "View", E[E.Edit = 1] = "Edit", E[E.ManageCollaborator = 2] = "ManageCollaborator", E[E.Print = 3] = "Print", E[E.Duplicate = 4] = "Duplicate", E[E.Comment = 5] = "Comment", E[E.Copy = 6] = "Copy", E[E.Share = 7] = "Share", E[E.Export = 8] = "Export", E[E.MoveWorksheet = 9] = "MoveWorksheet", E[E.DeleteWorksheet = 10] = "DeleteWorksheet", E[E.HideWorksheet = 11] = "HideWorksheet", E[E.RenameWorksheet = 12] = "RenameWorksheet", E[E.CreateWorksheet = 13] = "CreateWorksheet", E[E.SetWorksheetStyle = 14] = "SetWorksheetStyle", E[E.EditWorksheetCell = 15] = "EditWorksheetCell", E[E.InsertHyperlink = 16] = "InsertHyperlink", E[E.Sort = 17] = "Sort", E[E.Filter = 18] = "Filter", E[E.PivotTable = 19] = "PivotTable", E[E.FloatImg = 20] = "FloatImg", E[E.History = 21] = "History", E[E.RwHgtClWdt = 22] = "RwHgtClWdt", E[E.ViemRwHgtClWdt = 23] = "ViemRwHgtClWdt", E[E.ViewFilter = 24] = "ViewFilter", E[E.MoveSheet = 25] = "MoveSheet", E[E.DeleteSheet = 26] = "DeleteSheet", E[E.HideSheet = 27] = "HideSheet", E[E.CopySheet = 28] = "CopySheet", E[E.RenameSheet = 29] = "RenameSheet", E[E.CreateSheet = 30] = "CreateSheet", E[E.SelectProtectedCells = 31] = "SelectProtectedCells", E[E.SelectUnProtectedCells = 32] = "SelectUnProtectedCells", E[E.SetCellStyle = 33] = "SetCellStyle", E[E.SetCellValue = 34] = "SetCellValue", E[E.SetRowStyle = 35] = "SetRowStyle", E[E.SetColumnStyle = 36] = "SetColumnStyle", E[E.InsertRow = 37] = "InsertRow", E[E.InsertColumn = 38] = "InsertColumn", E[E.DeleteRow = 39] = "DeleteRow", E[E.DeleteColumn = 40] = "DeleteColumn", E[E.EditExtraObject = 41] = "EditExtraObject", E[E.Delete = 42] = "Delete", E[E.RecoverHistory = 43] = "RecoverHistory", E[E.ViewHistory = 44] = "ViewHistory", E[E.CreatePermissionObject = 45] = "CreatePermissionObject", E[E.UNRECOGNIZED = -1] = "UNRECOGNIZED", E))(D || {}), __defProp$5 = Object.defineProperty, __getOwnPropDesc$5 = Object.getOwnPropertyDescriptor, __decorateClass$5 = /* @__PURE__ */ __name((decorators, target, key, kind) => {
|
|
1760
1760
|
for (var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc$5(target, key) : target, i = decorators.length - 1, decorator; i >= 0; i--)
|
|
1761
1761
|
(decorator = decorators[i]) && (result = (kind ? decorator(target, key, result) : decorator(result)) || result);
|
|
1762
1762
|
return kind && result && __defProp$5(target, key, result), result;
|
|
@@ -1789,7 +1789,7 @@ let DataValidationFormulaController = (_a6 = class extends Disposable {
|
|
|
1789
1789
|
for (let i2 = startRow; i2 <= endRow; i2++)
|
|
1790
1790
|
for (let j = startColumn; j <= endColumn; j++) {
|
|
1791
1791
|
const permission = (_b = (_a12 = targetSheet.getCell(i2, j)) == null ? void 0 : _a12.selectionProtection) == null ? void 0 : _b[0];
|
|
1792
|
-
if ((permission == null ? void 0 : permission[
|
|
1792
|
+
if ((permission == null ? void 0 : permission[D.View]) === !1)
|
|
1793
1793
|
return !1;
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
@@ -2,12 +2,12 @@ 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
13
|
* @hideconstructor
|
|
@@ -15,10 +15,10 @@ export declare class FDataValidation {
|
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
17
|
* const dataValidation = univerAPI
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
18
|
+
* .getActiveWorkbook()
|
|
19
|
+
* .getActiveWorksheet()
|
|
20
|
+
* .getActiveRange()
|
|
21
|
+
* .getDataValidation();
|
|
22
22
|
* const allowsInvalid = dataValidation.getAllowInvalid();
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
@@ -29,10 +29,10 @@ export declare class FDataValidation {
|
|
|
29
29
|
* @example
|
|
30
30
|
* ```typescript
|
|
31
31
|
* const dataValidation = univerAPI
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* .getActiveWorkbook()
|
|
33
|
+
* .getActiveWorksheet()
|
|
34
|
+
* .getActiveRange()
|
|
35
|
+
* .getDataValidation();
|
|
36
36
|
* const type = dataValidation.getCriteriaType();
|
|
37
37
|
* ```
|
|
38
38
|
*/
|
|
@@ -43,10 +43,10 @@ export declare class FDataValidation {
|
|
|
43
43
|
* @example
|
|
44
44
|
* ```typescript
|
|
45
45
|
* const dataValidation = univerAPI
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
46
|
+
* .getActiveWorkbook()
|
|
47
|
+
* .getActiveWorksheet()
|
|
48
|
+
* .getActiveRange()
|
|
49
|
+
* .getDataValidation();
|
|
50
50
|
* const [operator, formula1, formula2] = dataValidation.getCriteriaValues();
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
@@ -57,10 +57,10 @@ export declare class FDataValidation {
|
|
|
57
57
|
* @example
|
|
58
58
|
* ```typescript
|
|
59
59
|
* const dataValidation = univerAPI
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
60
|
+
* .getActiveWorkbook()
|
|
61
|
+
* .getActiveWorksheet()
|
|
62
|
+
* .getActiveRange()
|
|
63
|
+
* .getDataValidation();
|
|
64
64
|
* const helpText = dataValidation.getHelpText();
|
|
65
65
|
* ```
|
|
66
66
|
*/
|
|
@@ -71,10 +71,10 @@ export declare class FDataValidation {
|
|
|
71
71
|
* @example
|
|
72
72
|
* ```typescript
|
|
73
73
|
* const dataValidation = univerAPI
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
74
|
+
* .getActiveWorkbook()
|
|
75
|
+
* .getActiveWorksheet()
|
|
76
|
+
* .getActiveRange()
|
|
77
|
+
* .getDataValidation();
|
|
78
78
|
* const builder = dataValidation.copy();
|
|
79
79
|
* const newRule = builder.setAllowInvalid(true).build();
|
|
80
80
|
* ```
|
|
@@ -86,10 +86,10 @@ export declare class FDataValidation {
|
|
|
86
86
|
* @example
|
|
87
87
|
* ```typescript
|
|
88
88
|
* const dataValidation = univerAPI
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
89
|
+
* .getActiveWorkbook()
|
|
90
|
+
* .getActiveWorksheet()
|
|
91
|
+
* .getActiveRange()
|
|
92
|
+
* .getDataValidation();
|
|
93
93
|
* const isApplied = dataValidation.getApplied();
|
|
94
94
|
* ```
|
|
95
95
|
*/
|
|
@@ -100,10 +100,10 @@ export declare class FDataValidation {
|
|
|
100
100
|
* @example
|
|
101
101
|
* ```typescript
|
|
102
102
|
* const dataValidation = univerAPI
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
103
|
+
* .getActiveWorkbook()
|
|
104
|
+
* .getActiveWorksheet()
|
|
105
|
+
* .getActiveRange()
|
|
106
|
+
* .getDataValidation();
|
|
107
107
|
* const ranges = dataValidation.getRanges();
|
|
108
108
|
* ```
|
|
109
109
|
*/
|
|
@@ -114,10 +114,10 @@ export declare class FDataValidation {
|
|
|
114
114
|
* @example
|
|
115
115
|
* ```typescript
|
|
116
116
|
* const dataValidation = univerAPI
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
117
|
+
* .getActiveWorkbook()
|
|
118
|
+
* .getActiveWorksheet()
|
|
119
|
+
* .getActiveRange()
|
|
120
|
+
* .getDataValidation();
|
|
121
121
|
* const unitId = dataValidation.getUnitId();
|
|
122
122
|
* ```
|
|
123
123
|
*/
|
|
@@ -128,10 +128,10 @@ export declare class FDataValidation {
|
|
|
128
128
|
* @example
|
|
129
129
|
* ```typescript
|
|
130
130
|
* const dataValidation = univerAPI
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
131
|
+
* .getActiveWorkbook()
|
|
132
|
+
* .getActiveWorksheet()
|
|
133
|
+
* .getActiveRange()
|
|
134
|
+
* .getDataValidation();
|
|
135
135
|
* const sheetId = dataValidation.getSheetId();
|
|
136
136
|
* ```
|
|
137
137
|
*/
|
|
@@ -145,10 +145,10 @@ export declare class FDataValidation {
|
|
|
145
145
|
* @example
|
|
146
146
|
* ```typescript
|
|
147
147
|
* const dataValidation = univerAPI
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
148
|
+
* .getActiveWorkbook()
|
|
149
|
+
* .getActiveWorksheet()
|
|
150
|
+
* .getActiveRange()
|
|
151
|
+
* .getDataValidation();
|
|
152
152
|
* dataValidation.setCriteria(
|
|
153
153
|
* DataValidationType.DECIMAL,
|
|
154
154
|
* [DataValidationOperator.BETWEEN, '1', '10'],
|
|
@@ -164,10 +164,10 @@ export declare class FDataValidation {
|
|
|
164
164
|
* @example
|
|
165
165
|
* ```typescript
|
|
166
166
|
* const dataValidation = univerAPI
|
|
167
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
167
|
+
* .getActiveWorkbook()
|
|
168
|
+
* .getActiveWorksheet()
|
|
169
|
+
* .getActiveRange()
|
|
170
|
+
* .getDataValidation();
|
|
171
171
|
* dataValidation.setOptions({
|
|
172
172
|
* allowBlank: true,
|
|
173
173
|
* showErrorMessage: true,
|
|
@@ -183,10 +183,10 @@ export declare class FDataValidation {
|
|
|
183
183
|
* @example
|
|
184
184
|
* ```typescript
|
|
185
185
|
* const dataValidation = univerAPI
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
186
|
+
* .getActiveWorkbook()
|
|
187
|
+
* .getActiveWorksheet()
|
|
188
|
+
* .getActiveRange()
|
|
189
|
+
* .getDataValidation();
|
|
190
190
|
* const range = FRange.create('Sheet1', 'A1:B10');
|
|
191
191
|
* dataValidation.setRanges([range]);
|
|
192
192
|
* ```
|
|
@@ -198,10 +198,10 @@ export declare class FDataValidation {
|
|
|
198
198
|
* @example
|
|
199
199
|
* ```typescript
|
|
200
200
|
* const dataValidation = univerAPI
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
201
|
+
* .getActiveWorkbook()
|
|
202
|
+
* .getActiveWorksheet()
|
|
203
|
+
* .getActiveRange()
|
|
204
|
+
* .getDataValidation();
|
|
205
205
|
* const isDeleted = dataValidation.delete();
|
|
206
206
|
* ```
|
|
207
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,13 +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;
|
|
19
25
|
/**
|
|
20
26
|
* @ignore
|
|
21
27
|
*/
|
|
22
28
|
_initialize(injector: Injector): void;
|
|
23
29
|
}
|
|
24
30
|
declare module '@univerjs/core' {
|
|
31
|
+
/**
|
|
32
|
+
* @ignore
|
|
33
|
+
*/
|
|
25
34
|
namespace FUniver {
|
|
35
|
+
/**
|
|
36
|
+
* @deprecated use `univerAPI.newDataValidation()` as instead.
|
|
37
|
+
* @returns {FDataValidationBuilder} A new instance of the FDataValidationBuilder class
|
|
38
|
+
*/
|
|
26
39
|
function newDataValidation(): FDataValidationBuilder;
|
|
27
40
|
}
|
|
41
|
+
interface FUniver extends IFUnvierDataValidationMixin {
|
|
42
|
+
}
|
|
28
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>>>;
|