@univerjs/sheets-data-validation 0.1.6 → 0.1.8
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/README.md +33 -0
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +2607 -5009
- package/lib/index.css +1 -1
- package/lib/types/common/const.d.ts +1 -1
- package/lib/types/controllers/dv-alert.controller.d.ts +1 -3
- package/lib/types/controllers/dv-copy-paste.controller.d.ts +3 -1
- package/lib/types/controllers/{dv-resource.controller.d.ts → dv-model.controller.d.ts} +1 -2
- package/lib/types/controllers/dv-ref-range.controller.d.ts +1 -1
- package/lib/types/controllers/dv-render.controller.d.ts +3 -0
- package/lib/types/index.d.ts +0 -4
- package/lib/types/locale/zh-CN.d.ts +12 -0
- package/lib/types/models/sheet-data-validation-manager.d.ts +2 -1
- package/lib/types/plugin.d.ts +4 -2
- package/lib/types/services/dv-custom-formula.service.d.ts +4 -5
- package/lib/types/services/dv-formula.service.d.ts +3 -4
- package/lib/types/validators/list-multiple-validator.d.ts +2 -20
- package/lib/types/validators/list-validator.d.ts +12 -7
- package/lib/types/validators/text-length-validator.d.ts +1 -0
- package/lib/types/widgets/dropdown-widget.d.ts +2 -2
- package/lib/umd/index.js +2 -2
- package/package.json +49 -33
- package/lib/types/commands/mutations/formula.mutation.d.ts +0 -10
- package/lib/types/controllers/dv-sheet.controller.d.ts +0 -13
- package/lib/types/services/formula-common.d.ts +0 -19
- package/lib/types/services/register-formula.service.d.ts +0 -28
package/package.json
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/sheets-data-validation",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "",
|
|
6
|
-
"author": "univer.ai",
|
|
7
|
-
"license": "",
|
|
8
|
-
"
|
|
5
|
+
"description": "Data validation for Univer Sheets",
|
|
6
|
+
"author": "DreamNum <developer@univer.ai>",
|
|
7
|
+
"license": "Apache-2.0",
|
|
8
|
+
"funding": {
|
|
9
|
+
"type": "opencollective",
|
|
10
|
+
"url": "https://opencollective.com/univer"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://univer.ai",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/dream-num/univer"
|
|
16
|
+
},
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/dream-num/univer/issues"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"univer"
|
|
22
|
+
],
|
|
9
23
|
"exports": {
|
|
10
24
|
".": {
|
|
11
25
|
"import": "./lib/es/index.js",
|
|
@@ -32,42 +46,44 @@
|
|
|
32
46
|
"lib"
|
|
33
47
|
],
|
|
34
48
|
"peerDependencies": {
|
|
35
|
-
"@wendellhu/redi": "0.13.
|
|
36
|
-
"
|
|
49
|
+
"@wendellhu/redi": "^0.13.3",
|
|
50
|
+
"clsx": ">=2.0.0",
|
|
51
|
+
"dayjs": ">=1.11.0",
|
|
52
|
+
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
|
|
37
53
|
"rxjs": ">=7.0.0",
|
|
38
|
-
"@univerjs/
|
|
39
|
-
"@univerjs/
|
|
40
|
-
"@univerjs/engine-formula": "0.1.
|
|
41
|
-
"@univerjs/
|
|
42
|
-
"@univerjs/engine-render": "0.1.
|
|
43
|
-
"@univerjs/
|
|
44
|
-
"@univerjs/sheets
|
|
45
|
-
"@univerjs/ui": "0.1.
|
|
46
|
-
"@univerjs/
|
|
54
|
+
"@univerjs/core": "0.1.8",
|
|
55
|
+
"@univerjs/data-validation": "0.1.8",
|
|
56
|
+
"@univerjs/engine-formula": "0.1.8",
|
|
57
|
+
"@univerjs/sheets-formula": "0.1.8",
|
|
58
|
+
"@univerjs/engine-render": "0.1.8",
|
|
59
|
+
"@univerjs/design": "0.1.8",
|
|
60
|
+
"@univerjs/sheets": "0.1.8",
|
|
61
|
+
"@univerjs/sheets-ui": "0.1.8",
|
|
62
|
+
"@univerjs/ui": "0.1.8"
|
|
47
63
|
},
|
|
48
64
|
"dependencies": {
|
|
49
|
-
"@univerjs/icons": "^0.1.
|
|
50
|
-
"dayjs": "^1.11.10",
|
|
51
|
-
"react-draggable-list": "^4.2.0"
|
|
65
|
+
"@univerjs/icons": "^0.1.44"
|
|
52
66
|
},
|
|
53
67
|
"devDependencies": {
|
|
54
|
-
"@wendellhu/redi": "^0.13.
|
|
68
|
+
"@wendellhu/redi": "^0.13.3",
|
|
69
|
+
"clsx": "^2.1.1",
|
|
70
|
+
"dayjs": "^1.11.10",
|
|
55
71
|
"less": "^4.2.0",
|
|
56
72
|
"react": "^18.2.0",
|
|
57
73
|
"rxjs": "^7.8.1",
|
|
58
|
-
"typescript": "^5.4.
|
|
59
|
-
"vite": "^5.2.
|
|
60
|
-
"vitest": "^1.
|
|
61
|
-
"@univerjs/core": "0.1.
|
|
62
|
-
"@univerjs/data-validation": "0.1.
|
|
63
|
-
"@univerjs/engine-formula": "0.1.
|
|
64
|
-
"@univerjs/
|
|
65
|
-
"@univerjs/
|
|
66
|
-
"@univerjs/shared": "0.1.
|
|
67
|
-
"@univerjs/sheets": "0.1.
|
|
68
|
-
"@univerjs/sheets-
|
|
69
|
-
"@univerjs/
|
|
70
|
-
"@univerjs/
|
|
74
|
+
"typescript": "^5.4.5",
|
|
75
|
+
"vite": "^5.2.10",
|
|
76
|
+
"vitest": "^1.5.0",
|
|
77
|
+
"@univerjs/core": "0.1.8",
|
|
78
|
+
"@univerjs/data-validation": "0.1.8",
|
|
79
|
+
"@univerjs/engine-formula": "0.1.8",
|
|
80
|
+
"@univerjs/engine-render": "0.1.8",
|
|
81
|
+
"@univerjs/design": "0.1.8",
|
|
82
|
+
"@univerjs/shared": "0.1.8",
|
|
83
|
+
"@univerjs/sheets": "0.1.8",
|
|
84
|
+
"@univerjs/sheets-ui": "0.1.8",
|
|
85
|
+
"@univerjs/sheets-formula": "0.1.8",
|
|
86
|
+
"@univerjs/ui": "0.1.8"
|
|
71
87
|
},
|
|
72
88
|
"scripts": {
|
|
73
89
|
"dev": "vite",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { IMutation } from '@univerjs/core';
|
|
2
|
-
|
|
3
|
-
export interface IDataValidationFormulaMarkDirtyParams {
|
|
4
|
-
[unitId: string]: {
|
|
5
|
-
[sunUnitId: string]: {
|
|
6
|
-
[formulaId: string]: boolean;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare const DataValidationFormulaMarkDirty: IMutation<IDataValidationFormulaMarkDirtyParams>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Injector } from '@wendellhu/redi';
|
|
2
|
-
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
3
|
-
import { DataValidationModel } from '@univerjs/data-validation';
|
|
4
|
-
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
5
|
-
|
|
6
|
-
export declare class DataValidationSheetController extends Disposable {
|
|
7
|
-
private _sheetInterceptorService;
|
|
8
|
-
private _univerInstanceService;
|
|
9
|
-
private readonly _dataValidationModel;
|
|
10
|
-
private _injector;
|
|
11
|
-
constructor(_sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _dataValidationModel: DataValidationModel, _injector: Injector);
|
|
12
|
-
private _initSheetChange;
|
|
13
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ICellData, Nullable } from '@univerjs/core';
|
|
2
|
-
|
|
3
|
-
export declare enum FormulaResultStatus {
|
|
4
|
-
NOT_REGISTER = 1,
|
|
5
|
-
SUCCESS = 2,
|
|
6
|
-
WAIT = 3,
|
|
7
|
-
ERROR = 4
|
|
8
|
-
}
|
|
9
|
-
export interface IDataValidationFormulaResult {
|
|
10
|
-
result?: Nullable<ICellData>[][];
|
|
11
|
-
status: FormulaResultStatus;
|
|
12
|
-
ruleId: string;
|
|
13
|
-
formulaId: string;
|
|
14
|
-
callbacks: Set<(value: Nullable<ICellData>[][]) => void>;
|
|
15
|
-
}
|
|
16
|
-
export interface IFormulaInfo {
|
|
17
|
-
id: string;
|
|
18
|
-
text: string;
|
|
19
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { IDataValidationFormulaResult } from './formula-common';
|
|
2
|
-
import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
|
-
import { Nullable, Disposable, ICommandService } from '@univerjs/core';
|
|
4
|
-
|
|
5
|
-
export declare class RegisterOtherFormulaService extends Disposable {
|
|
6
|
-
private readonly _commandService;
|
|
7
|
-
private _activeDirtyManagerService;
|
|
8
|
-
private _formulaCacheMap;
|
|
9
|
-
private _formulaChange$;
|
|
10
|
-
formulaChange$: import('rxjs').Observable<{
|
|
11
|
-
unitId: string;
|
|
12
|
-
subUnitId: string;
|
|
13
|
-
ruleId: string;
|
|
14
|
-
formulaText: string;
|
|
15
|
-
formulaId: string;
|
|
16
|
-
}>;
|
|
17
|
-
private _formulaResult$;
|
|
18
|
-
formulaResult$: import('rxjs').Observable<Record<string, Record<string, IDataValidationFormulaResult[]>>>;
|
|
19
|
-
constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
|
|
20
|
-
private _ensureCacheMap;
|
|
21
|
-
private _createFormulaId;
|
|
22
|
-
private _initFormulaRegister;
|
|
23
|
-
private _initFormulaCalculationResultChange;
|
|
24
|
-
registerFormula(unitId: string, subUnitId: string, ruleId: string, formulaText: string): string;
|
|
25
|
-
deleteFormula(unitId: string, subUnitId: string, formulaIdList: string[]): void;
|
|
26
|
-
getFormulaValue(unitId: string, subUnitId: string, formulaId: string): Promise<Nullable<IDataValidationFormulaResult>>;
|
|
27
|
-
getFormulaValueSync(unitId: string, subUnitId: string, formulaId: string): Nullable<IDataValidationFormulaResult>;
|
|
28
|
-
}
|