@univerjs/sheets-data-validation 0.2.6 → 0.2.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 +54 -4
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +441 -430
- package/lib/locale/en-US.json +12 -10
- package/lib/locale/ru-RU.json +3 -1
- package/lib/locale/vi-VN.json +3 -1
- package/lib/locale/zh-CN.json +11 -9
- package/lib/locale/zh-TW.json +3 -1
- package/lib/types/commands/commands/data-validation.command.d.ts +6 -1
- package/lib/types/commands/operations/data-validation.operation.d.ts +0 -1
- package/lib/types/common/date-text-map.d.ts +0 -1
- package/lib/types/controllers/dv-alert.controller.d.ts +0 -1
- package/lib/types/controllers/dv-auto-fill.controller.d.ts +0 -1
- package/lib/types/controllers/dv-copy-paste.controller.d.ts +0 -1
- package/lib/types/controllers/dv-formula.controller.d.ts +0 -1
- package/lib/types/controllers/dv-model.controller.d.ts +0 -1
- package/lib/types/controllers/dv-permission.controller.d.ts +0 -1
- package/lib/types/controllers/dv-ref-range.controller.d.ts +0 -1
- package/lib/types/controllers/dv-reject-input.controller.d.ts +0 -1
- package/lib/types/controllers/dv-render.controller.d.ts +0 -1
- package/lib/types/controllers/dv.controller.d.ts +1 -5
- package/lib/types/controllers/dv.menu.d.ts +0 -1
- package/lib/types/index.d.ts +4 -11
- package/lib/types/locale/en-US.d.ts +0 -1
- package/lib/types/locale/ru-RU.d.ts +0 -1
- package/lib/types/locale/vi-VN.d.ts +0 -1
- package/lib/types/locale/zh-CN.d.ts +2 -0
- package/lib/types/locale/zh-TW.d.ts +0 -1
- package/lib/types/mobile-plugin.d.ts +0 -1
- package/lib/types/models/rule-matrix.d.ts +0 -1
- package/lib/types/models/sheet-data-validation-manager.d.ts +2 -3
- package/lib/types/plugin.d.ts +0 -1
- package/lib/types/services/data-validation-panel.service.d.ts +0 -1
- package/lib/types/services/dropdown-manager.service.d.ts +1 -1
- package/lib/types/services/dv-cache.service.d.ts +0 -1
- package/lib/types/services/dv-custom-formula.service.d.ts +3 -3
- package/lib/types/services/dv-formula.service.d.ts +3 -3
- package/lib/types/services/dv-validator-service.d.ts +4 -2
- package/lib/types/types/const/operator-text-map.d.ts +0 -1
- package/lib/types/types/const/two-formula-operators.d.ts +0 -1
- package/lib/types/utils/formula.d.ts +0 -1
- package/lib/types/utils/get-cell-data-origin.d.ts +0 -1
- package/lib/types/validators/checkbox-validator.d.ts +0 -1
- package/lib/types/validators/custom-validator.d.ts +0 -1
- package/lib/types/validators/date-validator.d.ts +0 -1
- package/lib/types/validators/decimal-validator.d.ts +2 -1
- package/lib/types/validators/list-multiple-validator.d.ts +0 -1
- package/lib/types/validators/list-validator.d.ts +0 -1
- package/lib/types/validators/text-length-validator.d.ts +2 -1
- package/lib/types/validators/util.d.ts +0 -1
- package/lib/types/validators/whole-validator.d.ts +2 -1
- package/lib/types/views/date-dropdown/index.d.ts +0 -1
- package/lib/types/views/detail/index.d.ts +0 -1
- package/lib/types/views/drop-down/CellDropdown.d.ts +0 -1
- package/lib/types/views/formula-input/base-formula-input.d.ts +0 -1
- package/lib/types/views/formula-input/checkbox-formula-input.d.ts +0 -1
- package/lib/types/views/formula-input/custom-formula-input.d.ts +0 -1
- package/lib/types/views/formula-input/formula-input.d.ts +0 -1
- package/lib/types/views/formula-input/index.d.ts +0 -1
- package/lib/types/views/formula-input/list-formula-input.d.ts +0 -1
- package/lib/types/views/item/index.d.ts +0 -1
- package/lib/types/views/list/index.d.ts +0 -1
- package/lib/types/views/list-dropdown/index.d.ts +0 -1
- package/lib/types/views/options/index.d.ts +0 -1
- package/lib/types/views/panel/index.d.ts +0 -1
- package/lib/types/views/render-mode/index.d.ts +0 -1
- package/lib/types/views/show-time/index.d.ts +0 -1
- package/lib/types/widgets/checkbox-widget.d.ts +0 -1
- package/lib/types/widgets/dropdown-multiple-widget.d.ts +0 -1
- package/lib/types/widgets/dropdown-widget.d.ts +1 -3
- package/lib/types/widgets/shape/dropdown.d.ts +0 -1
- package/lib/types/widgets/shape/layout.d.ts +0 -1
- package/lib/umd/index.js +2 -2
- package/package.json +26 -26
- package/lib/types/services/dv.service.d.ts +0 -20
- package/lib/types/services/dv.tips.d.ts +0 -17
package/lib/locale/en-US.json
CHANGED
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"showWarning": "Show warning",
|
|
34
34
|
"rejectInput": "Reject input",
|
|
35
35
|
"messageInfo": "Helper message",
|
|
36
|
-
"showInfo": "Show help text for a selected cell"
|
|
36
|
+
"showInfo": "Show help text for a selected cell",
|
|
37
|
+
"rangeError": "Ranges are not legal"
|
|
37
38
|
},
|
|
38
39
|
"operators": {
|
|
39
40
|
"between": "between",
|
|
@@ -88,14 +89,14 @@
|
|
|
88
89
|
"notBetween": "is not between {FORMULA1}"
|
|
89
90
|
},
|
|
90
91
|
"errorMsg": {
|
|
91
|
-
"between": "Value must be between {FORMULA1} and {FORMULA2}",
|
|
92
|
-
"greaterThan": "Value must be after {FORMULA1}",
|
|
93
|
-
"greaterThanOrEqual": "Value must be on or after {FORMULA1}",
|
|
94
|
-
"lessThan": "Value must be before {FORMULA1}",
|
|
95
|
-
"lessThanOrEqual": "Value must be on or before {FORMULA1}",
|
|
96
|
-
"equal": "Value must be {FORMULA1}",
|
|
97
|
-
"notEqual": "Value must be not {FORMULA1}",
|
|
98
|
-
"notBetween": "Value must be not between {FORMULA1}"
|
|
92
|
+
"between": "Value must be a legal date and between {FORMULA1} and {FORMULA2}",
|
|
93
|
+
"greaterThan": "Value must be a legal date and after {FORMULA1}",
|
|
94
|
+
"greaterThanOrEqual": "Value must be a legal date and on or after {FORMULA1}",
|
|
95
|
+
"lessThan": "Value must be a legal date and before {FORMULA1}",
|
|
96
|
+
"lessThanOrEqual": "Value must be a legal date and on or before {FORMULA1}",
|
|
97
|
+
"equal": "Value must be a legal date and {FORMULA1}",
|
|
98
|
+
"notEqual": "Value must be a legal date and not {FORMULA1}",
|
|
99
|
+
"notBetween": "Value must be a legal date and not between {FORMULA1}"
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
"list": {
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"options": "Options",
|
|
109
110
|
"customOptions": "Custom",
|
|
110
111
|
"refOptions": "From a range",
|
|
111
|
-
"formulaError": "The list source must be a delimited list of data, or a reference to a single row or column."
|
|
112
|
+
"formulaError": "The list source must be a delimited list of data, or a reference to a single row or column.",
|
|
113
|
+
"edit": "Edit"
|
|
112
114
|
},
|
|
113
115
|
"listMultiple": {
|
|
114
116
|
"title": "Dropdown-Multiple",
|
package/lib/locale/ru-RU.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"removeAll": "Удалить все",
|
|
22
22
|
"add": "добавить правило",
|
|
23
23
|
"range": "Диапазоны",
|
|
24
|
+
"rangeError": "Диапазоны не являются законными",
|
|
24
25
|
"type": "Тип",
|
|
25
26
|
"options": "Дополнительные параметры",
|
|
26
27
|
"operator": "Оператор",
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"options": "Параметры",
|
|
109
110
|
"customOptions": "Пользовательские",
|
|
110
111
|
"refOptions": "Из диапазона",
|
|
111
|
-
"formulaError": "Источник списка должен быть разделенным списком данных или ссылкой на одну строку или столбец."
|
|
112
|
+
"formulaError": "Источник списка должен быть разделенным списком данных или ссылкой на одну строку или столбец.",
|
|
113
|
+
"edit": "Редактировать"
|
|
112
114
|
},
|
|
113
115
|
"listMultiple": {
|
|
114
116
|
"title": "Выпадающий список - Множественный",
|
package/lib/locale/vi-VN.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"removeAll": "Xóa tất cả",
|
|
22
22
|
"add": "Tạo quy tắc mới",
|
|
23
23
|
"range": "Phạm vi áp dụng",
|
|
24
|
+
"rangeError": "Phạm vi không hợp pháp",
|
|
24
25
|
"type": "Loại điều kiện",
|
|
25
26
|
"options": "Cài đặt nâng cao",
|
|
26
27
|
"operator": "Dữ liệu",
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"options": "Nguồn tùy chọn",
|
|
109
110
|
"customOptions": "Tùy chỉnh",
|
|
110
111
|
"refOptions": "Tham chiếu dữ liệu",
|
|
111
|
-
"formulaError": "Nguồn danh sách phải là danh sách dữ liệu đã được phân chia rõ ràng, hoặc là tham chiếu đến một hàng hoặc cột đơn."
|
|
112
|
+
"formulaError": "Nguồn danh sách phải là danh sách dữ liệu đã được phân chia rõ ràng, hoặc là tham chiếu đến một hàng hoặc cột đơn.",
|
|
113
|
+
"edit": "Biên tập"
|
|
112
114
|
},
|
|
113
115
|
"listMultiple": {
|
|
114
116
|
"title": "Danh sách thả xuống - Chọn nhiều",
|
package/lib/locale/zh-CN.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"removeAll": "全部删除",
|
|
22
22
|
"add": "新建规则",
|
|
23
23
|
"range": "应用范围",
|
|
24
|
+
"rangeError": "请输入合法的应用范围",
|
|
24
25
|
"type": "条件类型",
|
|
25
26
|
"options": "高级设置",
|
|
26
27
|
"operator": "数据",
|
|
@@ -88,14 +89,14 @@
|
|
|
88
89
|
"notBetween": "在 {FORMULA1} 和 {FORMULA2} 范围之外"
|
|
89
90
|
},
|
|
90
91
|
"errorMsg": {
|
|
91
|
-
"between": "
|
|
92
|
-
"greaterThan": "
|
|
93
|
-
"greaterThanOrEqual": "
|
|
94
|
-
"lessThan": "
|
|
95
|
-
"lessThanOrEqual": "
|
|
96
|
-
"equal": "
|
|
97
|
-
"notEqual": "
|
|
98
|
-
"notBetween": "
|
|
92
|
+
"between": "必须为有效日期且介于 {FORMULA1} 和 {FORMULA2} 之间",
|
|
93
|
+
"greaterThan": "必须为有效日期且晚于 {FORMULA1}",
|
|
94
|
+
"greaterThanOrEqual": "必须为有效日期且晚于或等于 {FORMULA1}",
|
|
95
|
+
"lessThan": "必须为有效日期且早于 {FORMULA1}",
|
|
96
|
+
"lessThanOrEqual": "必须为有效日期且早于或等于 {FORMULA1}",
|
|
97
|
+
"equal": "必须为有效日期且等于 {FORMULA1}",
|
|
98
|
+
"notEqual": "必须为有效日期且不等于 {FORMULA1}",
|
|
99
|
+
"notBetween": "必须为有效日期且在 {FORMULA1} 和 {FORMULA2} 范围之外"
|
|
99
100
|
}
|
|
100
101
|
},
|
|
101
102
|
"list": {
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"options": "选项来源",
|
|
109
110
|
"customOptions": "自定义",
|
|
110
111
|
"refOptions": "引用数据",
|
|
111
|
-
"formulaError": "列表源必须是划定分界后的数据列表,或是对单一行或一列的引用。"
|
|
112
|
+
"formulaError": "列表源必须是划定分界后的数据列表,或是对单一行或一列的引用。",
|
|
113
|
+
"edit": "编辑"
|
|
112
114
|
},
|
|
113
115
|
"listMultiple": {
|
|
114
116
|
"title": "下拉菜单-多选",
|
package/lib/locale/zh-TW.json
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
"removeAll": "全部刪除",
|
|
22
22
|
"add": "新建規則",
|
|
23
23
|
"range": "應用範圍",
|
|
24
|
+
"rangeError": "應用範圍不合法",
|
|
24
25
|
"type": "條件型別",
|
|
25
26
|
"options": "進階設定",
|
|
26
27
|
"operator": "資料",
|
|
@@ -108,7 +109,8 @@
|
|
|
108
109
|
"options": "選項來源",
|
|
109
110
|
"customOptions": "自訂",
|
|
110
111
|
"refOptions": "引用資料",
|
|
111
|
-
"formulaError": "列表來源必須是劃定分界後的資料列表,或是對單一行或一列的引用。 "
|
|
112
|
+
"formulaError": "列表來源必須是劃定分界後的資料列表,或是對單一行或一列的引用。 ",
|
|
113
|
+
"edit": "編輯"
|
|
112
114
|
},
|
|
113
115
|
"listMultiple": {
|
|
114
116
|
"title": "下拉式選單-多選",
|
|
@@ -2,7 +2,6 @@ import { IAccessor, ICommand, IDataValidationRuleBase, IDataValidationRuleOption
|
|
|
2
2
|
import { DataValidationChangeSource } from '@univerjs/data-validation';
|
|
3
3
|
import { ISheetCommandSharedParams } from '@univerjs/sheets';
|
|
4
4
|
import { RangeMutation } from '../../models/rule-matrix';
|
|
5
|
-
|
|
6
5
|
export interface IUpdateSheetDataValidationRangeCommandParams {
|
|
7
6
|
unitId: string;
|
|
8
7
|
subUnitId: string;
|
|
@@ -31,3 +30,9 @@ export interface IUpdateSheetDataValidationOptionsCommandParams extends ISheetCo
|
|
|
31
30
|
options: IDataValidationRuleOptions;
|
|
32
31
|
}
|
|
33
32
|
export declare const UpdateSheetDataValidationOptionsCommand: ICommand<IUpdateSheetDataValidationOptionsCommandParams>;
|
|
33
|
+
export interface IClearRangeDataValidationCommandParams {
|
|
34
|
+
unitId: string;
|
|
35
|
+
subUnitId: string;
|
|
36
|
+
ranges: IRange[];
|
|
37
|
+
}
|
|
38
|
+
export declare const ClearRangeDataValidationCommand: ICommand<IClearRangeDataValidationCommandParams>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DataValidationOperator } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
export declare const DateOperatorNameMap: Record<DataValidationOperator, string>;
|
|
4
3
|
export declare const DateOperatorTextMap: Record<DataValidationOperator, string>;
|
|
5
4
|
export declare const DateOperatorTitleMap: Record<DataValidationOperator, string>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { CellAlertManagerService, HoverManagerService } from '@univerjs/sheets-ui';
|
|
3
|
-
|
|
4
3
|
export declare class DataValidationAlertController extends Disposable {
|
|
5
4
|
private readonly _hoverManagerService;
|
|
6
5
|
private readonly _cellAlertManagerService;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Disposable, Injector } from '@univerjs/core';
|
|
2
2
|
import { IAutoFillService } from '@univerjs/sheets-ui';
|
|
3
3
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
4
|
-
|
|
5
4
|
export declare class DataValidationAutoFillController extends Disposable {
|
|
6
5
|
private readonly _autoFillService;
|
|
7
6
|
private readonly _dataValidationModel;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Disposable, Injector } from '@univerjs/core';
|
|
2
2
|
import { ISheetClipboardService } from '@univerjs/sheets-ui';
|
|
3
3
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
4
|
-
|
|
5
4
|
export declare class DataValidationCopyPasteController extends Disposable {
|
|
6
5
|
private _sheetClipboardService;
|
|
7
6
|
private _dataValidationModel;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Disposable, IPermissionService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
3
|
-
|
|
4
3
|
export declare class DataValidationFormulaController extends Disposable {
|
|
5
4
|
private readonly _univerInstanceService;
|
|
6
5
|
private readonly _permissionService;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Disposable, Injector, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
3
|
-
|
|
4
3
|
export declare class DataValidationModelController extends Disposable {
|
|
5
4
|
private readonly _resourceManagerService;
|
|
6
5
|
private readonly _univerInstanceService;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Disposable, ICommandService, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { SheetPermissionInterceptorBaseController } from '@univerjs/sheets-ui';
|
|
3
|
-
|
|
4
3
|
export declare class DataValidationPermissionController extends Disposable {
|
|
5
4
|
private _localeService;
|
|
6
5
|
private readonly _commandService;
|
|
@@ -4,7 +4,6 @@ import { DataValidationModel } from '@univerjs/data-validation';
|
|
|
4
4
|
import { FormulaRefRangeService } from '@univerjs/sheets-formula';
|
|
5
5
|
import { DataValidationCustomFormulaService } from '../services/dv-custom-formula.service';
|
|
6
6
|
import { DataValidationFormulaService } from '../services/dv-formula.service';
|
|
7
|
-
|
|
8
7
|
export declare class DataValidationRefRangeController extends Disposable {
|
|
9
8
|
private _dataValidationModel;
|
|
10
9
|
private _injector;
|
|
@@ -2,7 +2,6 @@ import { Disposable, LocaleService } from '@univerjs/core';
|
|
|
2
2
|
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
3
|
import { IEditorBridgeService } from '@univerjs/sheets-ui';
|
|
4
4
|
import { IDialogService } from '@univerjs/ui';
|
|
5
|
-
|
|
6
5
|
export declare class DataValidationRejectInputController extends Disposable {
|
|
7
6
|
private readonly _editorBridgeService;
|
|
8
7
|
private readonly _dataValidationModel;
|
|
@@ -5,7 +5,6 @@ import { AutoHeightController, IEditorBridgeService } from '@univerjs/sheets-ui'
|
|
|
5
5
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
6
6
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
7
7
|
import { DataValidationDropdownManagerService } from '../services/dropdown-manager.service';
|
|
8
|
-
|
|
9
8
|
export interface IUniverSheetsDataValidation {
|
|
10
9
|
menu?: MenuConfig;
|
|
11
10
|
}
|
|
@@ -2,21 +2,17 @@ import { Injector, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
|
2
2
|
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
3
|
import { ComponentManager } from '@univerjs/ui';
|
|
4
4
|
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
5
|
-
import { SheetDataValidationService } from '../services/dv.service';
|
|
6
|
-
|
|
7
5
|
export declare class DataValidationController extends RxDisposable {
|
|
8
6
|
private readonly _univerInstanceService;
|
|
9
|
-
private readonly _sheetDataValidationService;
|
|
10
7
|
private readonly _dataValidatorRegistryService;
|
|
11
8
|
private readonly _injector;
|
|
12
9
|
private readonly _componentManger;
|
|
13
10
|
private _selectionManagerService;
|
|
14
11
|
private readonly _sheetInterceptorService;
|
|
15
12
|
private readonly _dataValidationModel;
|
|
16
|
-
constructor(_univerInstanceService: IUniverInstanceService,
|
|
13
|
+
constructor(_univerInstanceService: IUniverInstanceService, _dataValidatorRegistryService: DataValidatorRegistryService, _injector: Injector, _componentManger: ComponentManager, _selectionManagerService: SheetsSelectionsService, _sheetInterceptorService: SheetInterceptorService, _dataValidationModel: DataValidationModel);
|
|
17
14
|
private _init;
|
|
18
15
|
private _registerValidators;
|
|
19
|
-
private _initInstanceChange;
|
|
20
16
|
private _initCommandInterceptor;
|
|
21
17
|
private _initComponents;
|
|
22
18
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IMenuItem } from '@univerjs/ui';
|
|
2
2
|
import { IAccessor } from '@univerjs/core';
|
|
3
|
-
|
|
4
3
|
export declare const DataValidationIcon = "data-validation-single";
|
|
5
4
|
export declare function dataValidationMenuFactory(accessor: IAccessor): IMenuItem;
|
|
6
5
|
export declare function openDataValidationMenuFactory(_accessor: IAccessor): IMenuItem;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,20 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
export { UniverSheetsDataValidationPlugin } from './plugin';
|
|
17
17
|
export { UniverSheetsDataValidationMobilePlugin } from './mobile-plugin';
|
|
18
|
-
export { ICommandService, LocaleService, Plugin } from '@univerjs/core';
|
|
19
|
-
export { SheetsDataValidationRenderController } from './controllers/dv-render.controller';
|
|
20
|
-
export { DataValidationController } from './controllers/dv.controller';
|
|
21
|
-
export { SheetDataValidationService } from './services/dv.service';
|
|
22
|
-
export { DataValidationAlertController } from './controllers/dv-alert.controller';
|
|
23
18
|
export { DataValidationCacheService } from './services/dv-cache.service';
|
|
24
19
|
export { DataValidationFormulaService } from './services/dv-formula.service';
|
|
25
20
|
export { DataValidationCustomFormulaService } from './services/dv-custom-formula.service';
|
|
26
|
-
export { DataValidationRefRangeController } from './controllers/dv-ref-range.controller';
|
|
27
21
|
export { DATA_VALIDATION_PLUGIN_NAME } from './common/const';
|
|
28
|
-
export { DataValidationAutoFillController } from './controllers/dv-auto-fill.controller';
|
|
29
|
-
export { DataValidationCopyPasteController } from './controllers/dv-copy-paste.controller';
|
|
30
|
-
export { DataValidationRejectInputController } from './controllers/dv-reject-input.controller';
|
|
31
|
-
export { DataValidationFormulaController } from './controllers/dv-formula.controller';
|
|
32
22
|
export { SheetsDataValidationValidatorService } from './services/dv-validator-service';
|
|
33
|
-
export {
|
|
23
|
+
export { DataValidationModel } from '@univerjs/data-validation';
|
|
24
|
+
export { SheetDataValidationManager } from './models/sheet-data-validation-manager';
|
|
25
|
+
export { RemoveDataValidationCommand as RemoveSheetDataValidationCommand, type IRemoveDataValidationCommandParams as IRemoveSheetDataValidationCommandParams, } from '@univerjs/data-validation';
|
|
26
|
+
export { UpdateSheetDataValidationRangeCommand, UpdateSheetDataValidationOptionsCommand, UpdateSheetDataValidationSettingCommand, AddSheetDataValidationCommand, AddSheetDataValidationAndOpenCommand, ClearRangeDataValidationCommand, type IAddSheetDataValidationCommandParams, type IUpdateSheetDataValidationRangeCommandParams, type IUpdateSheetDataValidationOptionsCommandParams, type IUpdateSheetDataValidationSettingCommandParams, type IClearRangeDataValidationCommandParams, } from './commands/commands/data-validation.command';
|
|
34
27
|
export { OpenValidationPanelOperation, CloseValidationPanelOperation, ToggleValidationPanelOperation, ShowDataValidationDropdown, HideDataValidationDropdown, } from './commands/operations/data-validation.operation';
|
|
@@ -36,6 +36,7 @@ declare const locale: {
|
|
|
36
36
|
removeAll: string;
|
|
37
37
|
add: string;
|
|
38
38
|
range: string;
|
|
39
|
+
rangeError: string;
|
|
39
40
|
type: string;
|
|
40
41
|
options: string;
|
|
41
42
|
operator: string;
|
|
@@ -124,6 +125,7 @@ declare const locale: {
|
|
|
124
125
|
customOptions: string;
|
|
125
126
|
refOptions: string;
|
|
126
127
|
formulaError: string;
|
|
128
|
+
edit: string;
|
|
127
129
|
};
|
|
128
130
|
listMultiple: {
|
|
129
131
|
title: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICommandService, LocaleService, Plugin, UniverInstanceType, Injector } from '@univerjs/core';
|
|
2
2
|
import { IUniverSheetsDataValidation } from './controllers/dv-render.controller';
|
|
3
|
-
|
|
4
3
|
export declare class UniverSheetsDataValidationMobilePlugin extends Plugin {
|
|
5
4
|
private _config;
|
|
6
5
|
protected _injector: Injector;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { CellValue, Injector, ISheetDataValidationRule, Nullable, DataValidationStatus, DataValidationType } from '@univerjs/core';
|
|
2
2
|
import { DataValidationManager, IUpdateRulePayload } from '@univerjs/data-validation';
|
|
3
|
-
import {
|
|
3
|
+
import { ISheetLocation } from '@univerjs/sheets';
|
|
4
4
|
import { RuleMatrix } from './rule-matrix';
|
|
5
|
-
|
|
6
5
|
export declare class SheetDataValidationManager extends DataValidationManager<ISheetDataValidationRule> {
|
|
7
6
|
private readonly _injector;
|
|
8
7
|
/**
|
|
@@ -22,7 +21,7 @@ export declare class SheetDataValidationManager extends DataValidationManager<IS
|
|
|
22
21
|
getValidator(type: DataValidationType): import('@univerjs/data-validation').BaseDataValidator<CellValue> | undefined;
|
|
23
22
|
getRuleIdByLocation(row: number, col: number): string | undefined;
|
|
24
23
|
getRuleByLocation(row: number, col: number): ISheetDataValidationRule | undefined;
|
|
25
|
-
validator(cellValue: Nullable<CellValue>, rule: ISheetDataValidationRule, pos:
|
|
24
|
+
validator(cellValue: Nullable<CellValue>, rule: ISheetDataValidationRule, pos: ISheetLocation, onCompete: (status: DataValidationStatus, changed: boolean) => void): DataValidationStatus;
|
|
26
25
|
getRuleErrorMsg(ruleId: string): string;
|
|
27
26
|
getRuleObjectMatrix(): RuleMatrix;
|
|
28
27
|
}
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICommandService, LocaleService, Plugin, UniverInstanceType, Injector } from '@univerjs/core';
|
|
2
2
|
import { IUniverSheetsDataValidation } from './controllers/dv-render.controller';
|
|
3
|
-
|
|
4
3
|
export declare class UniverSheetsDataValidationPlugin extends Plugin {
|
|
5
4
|
private _config;
|
|
6
5
|
protected _injector: Injector;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IDataValidationRule, IDisposable, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { ISidebarService } from '@univerjs/ui';
|
|
3
|
-
|
|
4
3
|
export declare class DataValidationPanelService extends Disposable {
|
|
5
4
|
private readonly _univerInstanceService;
|
|
6
5
|
private readonly _sidebarService;
|
|
@@ -4,11 +4,11 @@ import { SheetCanvasPopManagerService } from '@univerjs/sheets-ui';
|
|
|
4
4
|
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
5
5
|
import { IZenZoneService } from '@univerjs/ui';
|
|
6
6
|
import { IRenderManagerService } from '@univerjs/engine-render';
|
|
7
|
-
|
|
8
7
|
export interface IDropdownParam {
|
|
9
8
|
location: ISheetLocation;
|
|
10
9
|
onHide?: () => void;
|
|
11
10
|
componentKey: string;
|
|
11
|
+
trigger?: 'editor-bridge';
|
|
12
12
|
}
|
|
13
13
|
export interface IDropdownComponentProps {
|
|
14
14
|
componentKey: string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { IRange, ISheetDataValidationRule, Disposable } from '@univerjs/core';
|
|
1
|
+
import { IRange, ISheetDataValidationRule, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
3
3
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
4
4
|
import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';
|
|
5
5
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
6
|
-
|
|
7
6
|
interface IFormulaData {
|
|
8
7
|
formula: string;
|
|
9
8
|
originRow: number;
|
|
@@ -12,6 +11,7 @@ interface IFormulaData {
|
|
|
12
11
|
formulaId?: string;
|
|
13
12
|
}
|
|
14
13
|
export declare class DataValidationCustomFormulaService extends Disposable {
|
|
14
|
+
private readonly _instanceSrv;
|
|
15
15
|
private _registerOtherFormulaService;
|
|
16
16
|
private _lexerTreeBuilder;
|
|
17
17
|
private readonly _dataValidationModel;
|
|
@@ -25,7 +25,7 @@ export declare class DataValidationCustomFormulaService extends Disposable {
|
|
|
25
25
|
* reflect of formulaId to cell, only store transformable formula
|
|
26
26
|
*/
|
|
27
27
|
private _formulaCellMap;
|
|
28
|
-
constructor(_registerOtherFormulaService: RegisterOtherFormulaService, _lexerTreeBuilder: LexerTreeBuilder, _dataValidationModel: DataValidationModel, _dataValidationCacheService: DataValidationCacheService);
|
|
28
|
+
constructor(_instanceSrv: IUniverInstanceService, _registerOtherFormulaService: RegisterOtherFormulaService, _lexerTreeBuilder: LexerTreeBuilder, _dataValidationModel: DataValidationModel, _dataValidationCacheService: DataValidationCacheService);
|
|
29
29
|
private _initFormulaResultHandler;
|
|
30
30
|
private _ensureMaps;
|
|
31
31
|
private _registerFormula;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { Nullable, Disposable } from '@univerjs/core';
|
|
1
|
+
import { Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
3
3
|
import { IFormulaInfo, IOtherFormulaResult, RegisterOtherFormulaService } from '@univerjs/sheets-formula';
|
|
4
4
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
5
|
-
|
|
6
5
|
export declare class DataValidationFormulaService extends Disposable {
|
|
6
|
+
private readonly _instanceService;
|
|
7
7
|
private _registerOtherFormulaService;
|
|
8
8
|
private readonly _dataValidationCacheService;
|
|
9
9
|
private readonly _dataValidationModel;
|
|
10
10
|
private _formulaRuleMap;
|
|
11
|
-
constructor(_registerOtherFormulaService: RegisterOtherFormulaService, _dataValidationCacheService: DataValidationCacheService, _dataValidationModel: DataValidationModel);
|
|
11
|
+
constructor(_instanceService: IUniverInstanceService, _registerOtherFormulaService: RegisterOtherFormulaService, _dataValidationCacheService: DataValidationCacheService, _dataValidationModel: DataValidationModel);
|
|
12
12
|
private _initFormulaResultHandler;
|
|
13
13
|
private _ensureRuleFormulaMap;
|
|
14
14
|
addRule(unitId: string, subUnitId: string, ruleId: string, formula1: string | undefined, formula2: string | undefined): void;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { Nullable, ObjectMatrix, DataValidationStatus, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { IDataValidationRule, IRange, Nullable, ObjectMatrix, DataValidationStatus, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { DataValidationModel } from '@univerjs/data-validation';
|
|
3
3
|
import { IDataValidationResCache, DataValidationCacheService } from './dv-cache.service';
|
|
4
|
-
|
|
5
4
|
export declare class SheetsDataValidationValidatorService {
|
|
6
5
|
private readonly _univerInstanceService;
|
|
7
6
|
private readonly _dataValidationModel;
|
|
8
7
|
private readonly _dataValidationCacheService;
|
|
9
8
|
constructor(_univerInstanceService: IUniverInstanceService, _dataValidationModel: DataValidationModel, _dataValidationCacheService: DataValidationCacheService);
|
|
10
9
|
validatorCell(unitId: string, subUnitId: string, row: number, col: number): Promise<DataValidationStatus>;
|
|
10
|
+
validatorRanges(unitId: string, subUnitId: string, ranges: IRange[]): Promise<Promise<DataValidationStatus>[][]>;
|
|
11
11
|
validatorWorksheet(unitId: string, subUnitId: string): Promise<ObjectMatrix<Nullable<IDataValidationResCache>>>;
|
|
12
12
|
validatorWorkbook(unitId: string): Promise<Record<string, ObjectMatrix<Nullable<IDataValidationResCache>>>>;
|
|
13
|
+
getDataValidations(unitId: string, subUnitId: string, ranges: IRange[]): IDataValidationRule[];
|
|
14
|
+
getDataValidation(unitId: string, subUnitId: string, ranges: IRange[]): Nullable<IDataValidationRule>;
|
|
13
15
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { DataValidationOperator } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
export declare const OperatorTextMap: Record<DataValidationOperator, string>;
|
|
4
3
|
export declare const OperatorTitleMap: Record<DataValidationOperator, string>;
|
|
5
4
|
export declare const OperatorErrorTitleMap: Record<DataValidationOperator, string>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { CellValue, DataValidationOperator, IDataValidationRule, IDataValidationRuleBase, ISheetDataValidationRule, Nullable } from '@univerjs/core';
|
|
2
2
|
import { BaseDataValidator, IFormulaResult, IFormulaValidResult, IValidatorCellInfo } from '@univerjs/data-validation';
|
|
3
3
|
import { CheckboxRender } from '../widgets/checkbox-widget';
|
|
4
|
-
|
|
5
4
|
export declare const CHECKBOX_FORMULA_1 = 1;
|
|
6
5
|
export declare const CHECKBOX_FORMULA_2 = 0;
|
|
7
6
|
export declare class CheckboxValidator extends BaseDataValidator {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { CellValue, DataValidationOperator, IDataValidationRule, IDataValidationRuleBase } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
|
-
|
|
4
3
|
export declare class CustomFormulaValidator extends BaseDataValidator {
|
|
5
4
|
id: string;
|
|
6
5
|
title: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataValidationOperator, CellValue, IDataValidationRule, IDataValidationRuleBase } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
|
-
|
|
4
3
|
export declare class DateValidator extends BaseDataValidator<number> {
|
|
5
4
|
id: string;
|
|
6
5
|
title: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataValidationOperator, CellValue, IDataValidationRule } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
|
-
|
|
4
3
|
export declare function getCellValueNumber(cellValue: CellValue): number;
|
|
5
4
|
export declare class DecimalValidator extends BaseDataValidator<number> {
|
|
6
5
|
private _formulaService;
|
|
@@ -18,6 +17,8 @@ export declare class DecimalValidator extends BaseDataValidator<number> {
|
|
|
18
17
|
column: number;
|
|
19
18
|
unitId: string;
|
|
20
19
|
subUnitId: string;
|
|
20
|
+
worksheet: import('@univerjs/core').Worksheet;
|
|
21
|
+
workbook: import('@univerjs/core').Workbook;
|
|
21
22
|
};
|
|
22
23
|
private _parseNumber;
|
|
23
24
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<{
|
|
@@ -2,7 +2,6 @@ import { CellValue, DataValidationOperator, ICellData, IDataValidationRule, IShe
|
|
|
2
2
|
import { IBaseDataValidationWidget, IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
3
|
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
4
4
|
import { DataValidationFormulaService } from '../services/dv-formula.service';
|
|
5
|
-
|
|
6
5
|
export declare function getRuleFormulaResultSet(result: Nullable<Nullable<ICellData>[][]>): string[];
|
|
7
6
|
export declare function isValidListFormula(formula: string, lexer: LexerTreeBuilder): boolean | undefined;
|
|
8
7
|
export declare class ListValidator extends BaseDataValidator {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataValidationOperator, CellValue, IDataValidationRule, IDataValidationRuleBase } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
|
-
|
|
4
3
|
export declare class TextLengthValidator extends BaseDataValidator<number> {
|
|
5
4
|
id: string;
|
|
6
5
|
title: string;
|
|
@@ -19,6 +18,8 @@ export declare class TextLengthValidator extends BaseDataValidator<number> {
|
|
|
19
18
|
column: number;
|
|
20
19
|
unitId: string;
|
|
21
20
|
subUnitId: string;
|
|
21
|
+
worksheet: import('@univerjs/core').Worksheet;
|
|
22
|
+
workbook: import('@univerjs/core').Workbook;
|
|
22
23
|
};
|
|
23
24
|
isValidType(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
24
25
|
validatorIsEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ICellData, IUnitRangeName, IUniverInstanceService, Nullable } from '@univerjs/core';
|
|
2
|
-
|
|
3
2
|
export declare function getSheetRangeValueSet(grid: IUnitRangeName, univerInstanceService: IUniverInstanceService, currUnitId: string, currSubUnitId: string): string[];
|
|
4
3
|
export declare function serializeListOptions(options: string[]): string;
|
|
5
4
|
export declare function deserializeListOptions(optionsStr: string): string[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { DataValidationOperator, CellValue, IDataValidationRule, IDataValidationRuleBase } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
|
-
|
|
4
3
|
export declare class WholeValidator extends BaseDataValidator<number> {
|
|
5
4
|
private _formulaService;
|
|
6
5
|
id: string;
|
|
@@ -17,6 +16,8 @@ export declare class WholeValidator extends BaseDataValidator<number> {
|
|
|
17
16
|
column: number;
|
|
18
17
|
unitId: string;
|
|
19
18
|
subUnitId: string;
|
|
19
|
+
worksheet: import('@univerjs/core').Worksheet;
|
|
20
|
+
workbook: import('@univerjs/core').Workbook;
|
|
20
21
|
};
|
|
21
22
|
private _parseNumber;
|
|
22
23
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<{
|