@univerjs/sheets-data-validation 0.5.3-nightly.202501051605 → 0.5.3-nightly.202501060906
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
|
@@ -536,35 +536,16 @@ class x extends k {
|
|
|
536
536
|
}
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
|
-
/**
|
|
540
|
-
* get data validation validator status for current workbook
|
|
541
|
-
* @returns matrix of validator status
|
|
542
|
-
*/
|
|
543
539
|
getValidatorStatus() {
|
|
544
540
|
return this._injector.get(l).validatorWorkbook(this._workbook.getUnitId());
|
|
545
541
|
}
|
|
546
542
|
// region DataValidationHooks
|
|
547
|
-
/**
|
|
548
|
-
* The onDataValidationChange event is fired when the data validation rule of this sheet is changed.
|
|
549
|
-
* @param callback Callback function that will be called when the event is fired
|
|
550
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
551
|
-
*/
|
|
552
543
|
onDataValidationChange(e) {
|
|
553
544
|
return n(this._dataValidationModel.ruleChange$.pipe(p((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
|
|
554
545
|
}
|
|
555
|
-
/**
|
|
556
|
-
* The onDataValidationStatusChange event is fired when the data validation status of this sheet is changed.
|
|
557
|
-
* @param callback Callback function that will be called when the event is fired
|
|
558
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
559
|
-
*/
|
|
560
546
|
onDataValidationStatusChange(e) {
|
|
561
547
|
return n(this._dataValidationModel.validStatusChange$.pipe(p((t) => t.unitId === this._workbook.getUnitId())).subscribe(e));
|
|
562
548
|
}
|
|
563
|
-
/**
|
|
564
|
-
* The onBeforeAddDataValidation event is fired before the data validation rule is added.
|
|
565
|
-
* @param callback Callback function that will be called when the event is fired
|
|
566
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
567
|
-
*/
|
|
568
549
|
onBeforeAddDataValidation(e) {
|
|
569
550
|
return n(this._commandService.beforeCommandExecuted((t, r) => {
|
|
570
551
|
const a = t.params;
|
|
@@ -3,18 +3,18 @@ import { FRange } from '@univerjs/sheets/facade';
|
|
|
3
3
|
import { FDataValidation } from './f-data-validation';
|
|
4
4
|
export interface IFRangeDataValidationMixin {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Set a data validation rule to current range.
|
|
7
7
|
* @param rule data validation rule, build by `FUniver.newDataValidation`
|
|
8
8
|
* @returns current range
|
|
9
9
|
*/
|
|
10
10
|
setDataValidation(this: FRange, rule: Nullable<FDataValidation>): FRange;
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Get first data validation rule in current range.
|
|
13
13
|
* @returns data validation rule
|
|
14
14
|
*/
|
|
15
15
|
getDataValidation(this: FRange): Nullable<FDataValidation>;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Get all data validation rules in current range.
|
|
18
18
|
* @returns all data validation rules
|
|
19
19
|
*/
|
|
20
20
|
getDataValidations(this: FRange): FDataValidation[];
|
|
@@ -4,55 +4,59 @@ import { DataValidationStatus, IDisposable, IExecutionOptions, Nullable, ObjectM
|
|
|
4
4
|
import { FWorkbook } from '@univerjs/sheets/facade';
|
|
5
5
|
export interface IFWorkbookDataValidationMixin {
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
* @returns matrix of validator status
|
|
7
|
+
* Get data validation validator status for current workbook.
|
|
8
|
+
* @returns A promise that resolves to a matrix of validator status.
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* univerAPI.getActiveWorkbook().getValidatorStatus().then((status) => { console.log(status) })
|
|
12
|
+
* ```
|
|
9
13
|
*/
|
|
10
14
|
getValidatorStatus(this: FWorkbook): Promise<Record<string, ObjectMatrix<Nullable<DataValidationStatus>>>>;
|
|
11
15
|
/**
|
|
12
16
|
* The onDataValidationChange event is fired when the data validation rule of this sheet is changed.
|
|
13
|
-
* @param callback Callback function that will be called when the event is fired
|
|
14
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
17
|
+
* @param {function(IRuleChange): void} callback - Callback function that will be called when the event is fired
|
|
18
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
15
19
|
*/
|
|
16
20
|
onDataValidationChange(callback: (ruleChange: IRuleChange) => void): IDisposable;
|
|
17
21
|
/**
|
|
18
22
|
* The onDataValidationStatusChange event is fired when the data validation status of this sheet is changed.
|
|
19
|
-
* @param callback Callback function that will be called when the event is fired
|
|
20
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
23
|
+
* @param {function(IValidStatusChange): void} callback - Callback function that will be called when the event is fired
|
|
24
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
21
25
|
*/
|
|
22
26
|
onDataValidationStatusChange(callback: (statusChange: IValidStatusChange) => void): IDisposable;
|
|
23
27
|
/**
|
|
24
28
|
* The onBeforeAddDataValidation event is fired before the data validation rule is added.
|
|
25
|
-
* @param callback Callback function that will be called when the event is fired
|
|
26
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
29
|
+
* @param {function(IAddSheetDataValidationCommandParams, IExecutionOptions | undefined): void | false} callback - Callback function that will be called when the event is fired
|
|
30
|
+
* @returns {IDisposable} A disposable object that can be used to unsubscribe from the event
|
|
27
31
|
*/
|
|
28
32
|
onBeforeAddDataValidation(this: FWorkbook, callback: (params: IAddSheetDataValidationCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
29
33
|
/**
|
|
30
34
|
* The onBeforeUpdateDataValidationCriteria event is fired before the data validation rule is updated.
|
|
31
|
-
* @param callback Callback function that will be called when the event is fired
|
|
35
|
+
* @param callback - Callback function that will be called when the event is fired
|
|
32
36
|
* @returns A disposable object that can be used to unsubscribe from the event
|
|
33
37
|
*/
|
|
34
38
|
onBeforeUpdateDataValidationCriteria(this: FWorkbook, callback: (params: IUpdateSheetDataValidationSettingCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
35
39
|
/**
|
|
36
40
|
* The onBeforeUpdateDataValidationRange event is fired before the data validation rule is updated.
|
|
37
|
-
* @param callback Callback function that will be called when the event is fired
|
|
41
|
+
* @param callback - Callback function that will be called when the event is fired
|
|
38
42
|
* @returns A disposable object that can be used to unsubscribe from the event
|
|
39
43
|
*/
|
|
40
44
|
onBeforeUpdateDataValidationRange(this: FWorkbook, callback: (params: IUpdateSheetDataValidationRangeCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
41
45
|
/**
|
|
42
46
|
* The onBeforeUpdateDataValidationOptions event is fired before the data validation rule is updated.
|
|
43
|
-
* @param callback Callback function that will be called when the event is fired
|
|
47
|
+
* @param callback - Callback function that will be called when the event is fired
|
|
44
48
|
* @returns A disposable object that can be used to unsubscribe from the event
|
|
45
49
|
*/
|
|
46
50
|
onBeforeUpdateDataValidationOptions(this: FWorkbook, callback: (params: IUpdateSheetDataValidationOptionsCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
47
51
|
/**
|
|
48
52
|
* The onBeforeDeleteDataValidation event is fired before the data validation rule is deleted.
|
|
49
|
-
* @param callback Callback function that will be called when the event is fired
|
|
53
|
+
* @param callback - Callback function that will be called when the event is fired
|
|
50
54
|
* @returns A disposable object that can be used to unsubscribe from the event
|
|
51
55
|
*/
|
|
52
56
|
onBeforeDeleteDataValidation(this: FWorkbook, callback: (params: IRemoveSheetDataValidationCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
53
57
|
/**
|
|
54
58
|
* The onBeforeDeleteAllDataValidation event is fired before delete all data validation rules.
|
|
55
|
-
* @param callback Callback function that will be called when the event is fired
|
|
59
|
+
* @param callback - Callback function that will be called when the event is fired
|
|
56
60
|
* @returns A disposable object that can be used to unsubscribe from the event
|
|
57
61
|
*/
|
|
58
62
|
onBeforeDeleteAllDataValidation(this: FWorkbook, callback: (params: IRemoveSheetAllDataValidationCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
@@ -60,28 +64,9 @@ export interface IFWorkbookDataValidationMixin {
|
|
|
60
64
|
export declare class FWorkbookDataValidationMixin extends FWorkbook implements IFWorkbookDataValidationMixin {
|
|
61
65
|
_dataValidationModel: SheetDataValidationModel;
|
|
62
66
|
_initialize(): void;
|
|
63
|
-
/**
|
|
64
|
-
* get data validation validator status for current workbook
|
|
65
|
-
* @returns matrix of validator status
|
|
66
|
-
*/
|
|
67
67
|
getValidatorStatus(): Promise<Record<string, ObjectMatrix<Nullable<DataValidationStatus>>>>;
|
|
68
|
-
/**
|
|
69
|
-
* The onDataValidationChange event is fired when the data validation rule of this sheet is changed.
|
|
70
|
-
* @param callback Callback function that will be called when the event is fired
|
|
71
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
72
|
-
*/
|
|
73
68
|
onDataValidationChange(callback: (ruleChange: IRuleChange) => void): IDisposable;
|
|
74
|
-
/**
|
|
75
|
-
* The onDataValidationStatusChange event is fired when the data validation status of this sheet is changed.
|
|
76
|
-
* @param callback Callback function that will be called when the event is fired
|
|
77
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
78
|
-
*/
|
|
79
69
|
onDataValidationStatusChange(callback: (statusChange: IValidStatusChange) => void): IDisposable;
|
|
80
|
-
/**
|
|
81
|
-
* The onBeforeAddDataValidation event is fired before the data validation rule is added.
|
|
82
|
-
* @param callback Callback function that will be called when the event is fired
|
|
83
|
-
* @returns A disposable object that can be used to unsubscribe from the event
|
|
84
|
-
*/
|
|
85
70
|
onBeforeAddDataValidation(callback: (params: IAddSheetDataValidationCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
86
71
|
onBeforeUpdateDataValidationCriteria(callback: (params: IUpdateSheetDataValidationSettingCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
87
72
|
onBeforeUpdateDataValidationRange(callback: (params: IUpdateSheetDataValidationRangeCommandParams, options: IExecutionOptions | undefined) => void | false): IDisposable;
|
|
@@ -3,12 +3,12 @@ import { FWorksheet } from '@univerjs/sheets/facade';
|
|
|
3
3
|
import { FDataValidation } from './f-data-validation';
|
|
4
4
|
export interface IFWorksheetDataValidationMixin {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Get all data validation rules in current sheet.
|
|
7
7
|
* @returns all data validation rules
|
|
8
8
|
*/
|
|
9
9
|
getDataValidations(): FDataValidation[];
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* Get data validation validator status for current sheet.
|
|
12
12
|
* @returns matrix of validator status
|
|
13
13
|
*/
|
|
14
14
|
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.5.3-nightly.
|
|
3
|
+
"version": "0.5.3-nightly.202501060906",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Data validation for Univer Sheets",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@univerjs/protocol": "0.1.40",
|
|
57
|
-
"@univerjs/
|
|
58
|
-
"@univerjs/
|
|
59
|
-
"@univerjs/
|
|
60
|
-
"@univerjs/
|
|
61
|
-
"@univerjs/
|
|
57
|
+
"@univerjs/data-validation": "0.5.3-nightly.202501060906",
|
|
58
|
+
"@univerjs/sheets": "0.5.3-nightly.202501060906",
|
|
59
|
+
"@univerjs/sheets-formula": "0.5.3-nightly.202501060906",
|
|
60
|
+
"@univerjs/core": "0.5.3-nightly.202501060906",
|
|
61
|
+
"@univerjs/engine-formula": "0.5.3-nightly.202501060906"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"less": "^4.2.1",
|