@univerjs/sheets-data-validation 0.1.14 → 0.1.15
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 +2 -2
- package/lib/es/index.js +1925 -1924
- package/lib/locale/en-US.json +3 -2
- package/lib/locale/ru-RU.json +3 -2
- package/lib/locale/zh-CN.json +2 -1
- package/lib/types/locale/zh-CN.d.ts +1 -0
- package/lib/types/models/rule-matrix.d.ts +4 -3
- package/lib/types/validators/checkbox-validator.d.ts +1 -1
- package/lib/types/validators/custom-validator.d.ts +1 -1
- package/lib/types/validators/date-validator.d.ts +2 -2
- package/lib/types/validators/decimal-validator.d.ts +2 -2
- package/lib/types/validators/list-validator.d.ts +3 -2
- package/lib/types/validators/text-length-validator.d.ts +1 -1
- package/lib/types/validators/whole-validator.d.ts +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +26 -25
package/lib/locale/en-US.json
CHANGED
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"list": "Please input options",
|
|
11
11
|
"listInvalid": "The list source must be a delimited list or a reference to a single row or column",
|
|
12
12
|
"checkboxEqual": "Enter different values for ticked and unticked cell contents.",
|
|
13
|
-
"formulaError": "The reference range contains invisible data, please readjust the range"
|
|
13
|
+
"formulaError": "The reference range contains invisible data, please readjust the range",
|
|
14
|
+
"listIntersects": "The selected range cannot intersect with the scope of the rules"
|
|
14
15
|
},
|
|
15
16
|
"panel": {
|
|
16
17
|
"title": "Data validation management",
|
|
17
18
|
"addTitle": "Create new data validation",
|
|
18
19
|
"removeAll": "Remove All",
|
|
19
|
-
"add": "
|
|
20
|
+
"add": "Add Rule",
|
|
20
21
|
"range": "Ranges",
|
|
21
22
|
"type": "Type",
|
|
22
23
|
"options": "Advance options",
|
package/lib/locale/ru-RU.json
CHANGED
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
"list": "Пожалуйста, введите параметры",
|
|
11
11
|
"listInvalid": "Источник списка должен быть разделенным списком или ссылкой на одну строку или столбец",
|
|
12
12
|
"checkboxEqual": "Для выбранных и не выбранных ячеек введите разные значения",
|
|
13
|
-
"formulaError": "Диапазон ссылок содержит невидимые данные, пожалуйста, пересмотрите диапазон"
|
|
13
|
+
"formulaError": "Диапазон ссылок содержит невидимые данные, пожалуйста, пересмотрите диапазон",
|
|
14
|
+
"listIntersects": "Выбранный диапазон не может пересекаться с диапазоном правила."
|
|
14
15
|
},
|
|
15
16
|
"panel": {
|
|
16
17
|
"title": "Управление проверкой данных",
|
|
17
18
|
"addTitle": "Создать новую проверку данных",
|
|
18
19
|
"removeAll": "Удалить все",
|
|
19
|
-
"add": "
|
|
20
|
+
"add": "добавить правило",
|
|
20
21
|
"range": "Диапазоны",
|
|
21
22
|
"type": "Тип",
|
|
22
23
|
"options": "Дополнительные параметры",
|
package/lib/locale/zh-CN.json
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
"list": "请输入至少一个合法选项",
|
|
11
11
|
"listInvalid": "列表源必须是分隔列表或对单行或列的引用。",
|
|
12
12
|
"checkboxEqual": "为勾选和未勾选的单元格内容输入不同的值。",
|
|
13
|
-
"formulaError": "引用范围内包含不可见的数据,请重新调整范围"
|
|
13
|
+
"formulaError": "引用范围内包含不可见的数据,请重新调整范围",
|
|
14
|
+
"listIntersects": "所选范围不能和规则范围相交"
|
|
14
15
|
},
|
|
15
16
|
"panel": {
|
|
16
17
|
"title": "管理数据验证",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRange, ISheetDataValidationRule, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { IRange, ISheetDataValidationRule, Worksheet, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
|
|
3
3
|
export type RangeMutation = {
|
|
4
4
|
type: 'update';
|
|
@@ -14,12 +14,13 @@ export type RangeMutation = {
|
|
|
14
14
|
rule: ISheetDataValidationRule;
|
|
15
15
|
};
|
|
16
16
|
export declare class RuleMatrix {
|
|
17
|
+
private _worksheet;
|
|
17
18
|
readonly value: ObjectMatrix<string>;
|
|
18
|
-
constructor(value: ObjectMatrix<string
|
|
19
|
+
constructor(value: ObjectMatrix<string>, _worksheet: Worksheet);
|
|
19
20
|
addRule(rule: ISheetDataValidationRule): void;
|
|
20
21
|
removeRange(ranges: IRange[]): void;
|
|
21
22
|
removeRule(rule: ISheetDataValidationRule): void;
|
|
22
|
-
updateRange(ruleId: string,
|
|
23
|
+
updateRange(ruleId: string, _oldRanges: IRange[], _newRanges: IRange[]): void;
|
|
23
24
|
diff(rules: ISheetDataValidationRule[]): RangeMutation[];
|
|
24
25
|
diffWithAddition(rules: ISheetDataValidationRule[], additionRules: IterableIterator<ISheetDataValidationRule>): RangeMutation[];
|
|
25
26
|
clone(): RuleMatrix;
|
|
@@ -14,7 +14,7 @@ export declare class CheckboxValidator extends BaseDataValidator {
|
|
|
14
14
|
canvasRender: CheckboxRender;
|
|
15
15
|
private _formulaService;
|
|
16
16
|
skipDefaultFontRender(rule: ISheetDataValidationRule, cellValue: Nullable<CellValue>, pos: ISheetLocation): boolean;
|
|
17
|
-
validatorFormula(rule:
|
|
17
|
+
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
18
18
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult>;
|
|
19
19
|
parseFormulaSync(rule: IDataValidationRule, unitId: string, subUnitId: string): {
|
|
20
20
|
formula1: Nullable<CellValue>;
|
|
@@ -8,7 +8,7 @@ export declare class CustomFormulaValidator extends BaseDataValidator {
|
|
|
8
8
|
scopes: string | string[];
|
|
9
9
|
formulaInput: string;
|
|
10
10
|
private _customFormulaService;
|
|
11
|
-
validatorFormula(rule:
|
|
11
|
+
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
12
12
|
parseFormula(_rule: IDataValidationRule, _unitId: string, _subUnitId: string): Promise<IFormulaResult>;
|
|
13
13
|
isValidType(cellInfo: IValidatorCellInfo<CellValue>, _formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
14
14
|
generateRuleErrorMessage(rule: IDataValidationRuleBase): string;
|
|
@@ -14,7 +14,7 @@ export declare class DateValidator extends BaseDataValidator<Dayjs> {
|
|
|
14
14
|
transformDate: (value: Nullable<CellValue>) => Dayjs | undefined;
|
|
15
15
|
isValidType(info: IValidatorCellInfo): Promise<boolean>;
|
|
16
16
|
private _validatorSingleFormula;
|
|
17
|
-
validatorFormula(rule:
|
|
17
|
+
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
18
18
|
transform(cellInfo: IValidatorCellInfo<CellValue>, _formula: IFormulaResult, _rule: IDataValidationRule): IValidatorCellInfo<Dayjs>;
|
|
19
19
|
validatorIsEqual(info: IValidatorCellInfo<Dayjs>, formula: IFormulaResult<Dayjs | undefined>, _rule: IDataValidationRule): Promise<boolean>;
|
|
20
20
|
validatorIsNotEqual(info: IValidatorCellInfo<Dayjs>, formula: IFormulaResult<Dayjs | undefined>): Promise<boolean>;
|
|
@@ -24,7 +24,7 @@ export declare class DateValidator extends BaseDataValidator<Dayjs> {
|
|
|
24
24
|
validatorIsGreaterThanOrEqual(info: IValidatorCellInfo<Dayjs>, formula: IFormulaResult<Dayjs | undefined>): Promise<boolean>;
|
|
25
25
|
validatorIsLessThan(info: IValidatorCellInfo<Dayjs>, formula: IFormulaResult<Dayjs | undefined>): Promise<boolean>;
|
|
26
26
|
validatorIsLessThanOrEqual(info: IValidatorCellInfo<Dayjs>, formula: IFormulaResult<Dayjs | undefined>): Promise<boolean>;
|
|
27
|
-
validatorFormulaValue(rule:
|
|
27
|
+
validatorFormulaValue(rule: IDataValidationRule): string | undefined;
|
|
28
28
|
get operatorNames(): string[];
|
|
29
29
|
generateRuleName(rule: IDataValidationRuleBase): string;
|
|
30
30
|
generateRuleErrorMessage(rule: IDataValidationRuleBase): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataValidationOperator, CellValue, IDataValidationRule
|
|
1
|
+
import { DataValidationOperator, CellValue, IDataValidationRule } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
3
|
|
|
4
4
|
export declare function getCellValueNumber(cellValue: CellValue): number;
|
|
@@ -24,7 +24,7 @@ export declare class DecimalValidator extends BaseDataValidator<number> {
|
|
|
24
24
|
formula1: number;
|
|
25
25
|
formula2: number;
|
|
26
26
|
}>;
|
|
27
|
-
validatorFormula(rule:
|
|
27
|
+
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
28
28
|
validatorIsEqual(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
29
29
|
validatorIsNotEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
30
30
|
validatorIsBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CellValue, DataValidationOperator, ICellData, IDataValidationRule,
|
|
1
|
+
import { CellValue, DataValidationOperator, ICellData, IDataValidationRule, ISheetDataValidationRule, Nullable } from '@univerjs/core';
|
|
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';
|
|
@@ -8,6 +8,7 @@ export declare function isValidListFormula(formula: string, lexer: LexerTreeBuil
|
|
|
8
8
|
export declare class ListValidator extends BaseDataValidator {
|
|
9
9
|
protected formulaService: DataValidationFormulaService;
|
|
10
10
|
private _lexer;
|
|
11
|
+
private _univerInstanceService;
|
|
11
12
|
id: string;
|
|
12
13
|
title: string;
|
|
13
14
|
operators: DataValidationOperator[];
|
|
@@ -17,7 +18,7 @@ export declare class ListValidator extends BaseDataValidator {
|
|
|
17
18
|
dropdown: string | undefined;
|
|
18
19
|
optionsInput: string | undefined;
|
|
19
20
|
skipDefaultFontRender(rule: ISheetDataValidationRule): boolean;
|
|
20
|
-
validatorFormula(rule:
|
|
21
|
+
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
21
22
|
parseCellValue(cellValue: CellValue): string[];
|
|
22
23
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult<string[] | undefined>>;
|
|
23
24
|
isValidType(cellInfo: IValidatorCellInfo<Nullable<CellValue>>, formula: IFormulaResult<string[] | undefined>, rule: IDataValidationRule): Promise<boolean>;
|
|
@@ -9,7 +9,7 @@ export declare class TextLengthValidator extends BaseDataValidator<number> {
|
|
|
9
9
|
formulaInput: string;
|
|
10
10
|
private _formulaService;
|
|
11
11
|
private _isFormulaOrInt;
|
|
12
|
-
validatorFormula(rule:
|
|
12
|
+
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
13
13
|
private _parseNumber;
|
|
14
14
|
private _isValidFormula;
|
|
15
15
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult<any>>;
|
|
@@ -23,7 +23,7 @@ export declare class WholeValidator extends BaseDataValidator<number> {
|
|
|
23
23
|
formula1: number;
|
|
24
24
|
formula2: number;
|
|
25
25
|
}>;
|
|
26
|
-
validatorFormula(rule: IDataValidationRuleBase): IFormulaValidResult;
|
|
26
|
+
validatorFormula(rule: IDataValidationRuleBase, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
27
27
|
validatorIsEqual(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
28
28
|
validatorIsNotEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
29
29
|
validatorIsBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|