@univerjs/sheets-data-validation 0.5.0 → 0.5.1-nightly.202411301606
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/index.js +1407 -1914
- package/lib/types/controllers/config.schema.d.ts +1 -1
- package/lib/types/controllers/dv-formula-ref-range.controller.d.ts +3 -1
- package/lib/types/controllers/dv-ref-range.controller.d.ts +3 -3
- package/lib/types/facade/f-data-validation-builder.d.ts +2 -2
- package/lib/types/facade/f-data-validation.d.ts +1 -1
- package/lib/types/models/rule-matrix.d.ts +2 -0
- package/lib/types/models/sheet-data-validation-model.d.ts +1 -1
- package/lib/types/services/dv-cache.service.d.ts +4 -4
- package/lib/types/services/dv-custom-formula.service.d.ts +3 -2
- package/lib/types/services/dv-formula.service.d.ts +3 -2
- package/lib/types/utils/formula.d.ts +2 -1
- package/lib/types/validators/any-validator.d.ts +1 -0
- package/lib/types/validators/checkbox-validator.d.ts +1 -0
- package/lib/types/validators/date-validator.d.ts +1 -9
- package/lib/types/validators/decimal-validator.d.ts +1 -9
- package/lib/types/validators/list-multiple-validator.d.ts +1 -0
- package/lib/types/validators/list-validator.d.ts +2 -1
- package/lib/types/validators/text-length-validator.d.ts +4 -13
- package/lib/types/validators/whole-validator.d.ts +4 -12
- package/lib/umd/index.js +1 -1
- package/package.json +12 -13
- package/LICENSE +0 -176
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export declare const
|
|
16
|
+
export declare const SHEETS_DATA_VALIDATION_PLUGIN_CONFIG_KEY = "sheets-data-validation.config";
|
|
17
17
|
export declare const configSymbol: unique symbol;
|
|
18
18
|
export interface IUniverSheetsDataValidationConfig {
|
|
19
19
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ISheetDataValidationRule, Disposable } from '@univerjs/core';
|
|
2
|
+
import { DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
2
3
|
import { FormulaRefRangeService } from '@univerjs/sheets-formula';
|
|
3
4
|
import { SheetDataValidationModel } from '../models/sheet-data-validation-model';
|
|
4
5
|
export declare class DataValidationFormulaRefRangeController extends Disposable {
|
|
5
6
|
private _dataValidationModel;
|
|
6
7
|
private _formulaRefRangeService;
|
|
8
|
+
private _validatorRegistryService;
|
|
7
9
|
private _disposableMap;
|
|
8
|
-
constructor(_dataValidationModel: SheetDataValidationModel, _formulaRefRangeService: FormulaRefRangeService);
|
|
10
|
+
constructor(_dataValidationModel: SheetDataValidationModel, _formulaRefRangeService: FormulaRefRangeService, _validatorRegistryService: DataValidatorRegistryService);
|
|
9
11
|
private _getIdWithUnitId;
|
|
10
12
|
registerRule: (unitId: string, subUnitId: string, rule: ISheetDataValidationRule) => void;
|
|
11
13
|
register(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ISheetDataValidationRule, Disposable, Injector } from '@univerjs/core';
|
|
2
|
+
import { DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
2
3
|
import { RefRangeService } from '@univerjs/sheets';
|
|
3
4
|
import { FormulaRefRangeService } from '@univerjs/sheets-formula';
|
|
4
5
|
import { SheetDataValidationModel } from '../models/sheet-data-validation-model';
|
|
5
|
-
import { DataValidationCustomFormulaService } from '../services/dv-custom-formula.service';
|
|
6
6
|
import { DataValidationFormulaService } from '../services/dv-formula.service';
|
|
7
7
|
export declare class DataValidationRefRangeController extends Disposable {
|
|
8
8
|
private _dataValidationModel;
|
|
9
9
|
private _injector;
|
|
10
10
|
private _refRangeService;
|
|
11
|
-
private _dataValidationCustomFormulaService;
|
|
12
11
|
private _dataValidationFormulaService;
|
|
13
12
|
private _formulaRefRangeService;
|
|
13
|
+
private _validatorRegistryService;
|
|
14
14
|
private _disposableMap;
|
|
15
|
-
constructor(_dataValidationModel: SheetDataValidationModel, _injector: Injector, _refRangeService: RefRangeService,
|
|
15
|
+
constructor(_dataValidationModel: SheetDataValidationModel, _injector: Injector, _refRangeService: RefRangeService, _dataValidationFormulaService: DataValidationFormulaService, _formulaRefRangeService: FormulaRefRangeService, _validatorRegistryService: DataValidatorRegistryService);
|
|
16
16
|
private _getIdWithUnitId;
|
|
17
17
|
registerRule: (unitId: string, subUnitId: string, rule: ISheetDataValidationRule) => void;
|
|
18
18
|
registerFormula(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
@@ -34,7 +34,7 @@ export declare class FDataValidationBuilder {
|
|
|
34
34
|
*
|
|
35
35
|
* @returns {DataValidationType} The data validation type
|
|
36
36
|
*/
|
|
37
|
-
getCriteriaType(): DataValidationType;
|
|
37
|
+
getCriteriaType(): DataValidationType | string;
|
|
38
38
|
/**
|
|
39
39
|
* Gets the values used for criteria evaluation
|
|
40
40
|
*
|
|
@@ -235,7 +235,7 @@ export declare class FDataValidationBuilder {
|
|
|
235
235
|
* operator is a DataValidationOperator enum value, formula1 is the first formula, and formula2 is the second formula.
|
|
236
236
|
* @return The current instance of the FDataValidationBuilder class, allowing for method chaining.
|
|
237
237
|
*/
|
|
238
|
-
withCriteriaValues(type: DataValidationType, values: [DataValidationOperator, string, string]): this;
|
|
238
|
+
withCriteriaValues(type: DataValidationType | string, values: [DataValidationOperator, string, string]): this;
|
|
239
239
|
/**
|
|
240
240
|
* Sets the options for the data validation rule.
|
|
241
241
|
* For details of options, please refer to https://univer.ai/typedoc/@univerjs/core/interfaces/IDataValidationRuleOptions
|
|
@@ -25,8 +25,10 @@ export declare class RuleMatrix {
|
|
|
25
25
|
private _buildTree;
|
|
26
26
|
private _debonceBuildTree;
|
|
27
27
|
get _worksheet(): import('@univerjs/core').Nullable<import('@univerjs/core').Worksheet>;
|
|
28
|
+
private _addRule;
|
|
28
29
|
addRule(rule: ISheetDataValidationRule): void;
|
|
29
30
|
removeRange(_ranges: IRange[]): void;
|
|
31
|
+
private _removeRule;
|
|
30
32
|
removeRule(rule: ISheetDataValidationRule): void;
|
|
31
33
|
updateRange(ruleId: string, _newRanges: IRange[]): void;
|
|
32
34
|
addRangeRules(rules: {
|
|
@@ -34,7 +34,7 @@ export declare class SheetDataValidationModel extends Disposable {
|
|
|
34
34
|
private _addRule;
|
|
35
35
|
private _updateRule;
|
|
36
36
|
private _removeRule;
|
|
37
|
-
getValidator(type: DataValidationType): import('@univerjs/data-validation').BaseDataValidator
|
|
37
|
+
getValidator(type: DataValidationType | string): import('@univerjs/data-validation').BaseDataValidator | undefined;
|
|
38
38
|
getRuleIdByLocation(unitId: string, subUnitId: string, row: number, col: number): string | undefined;
|
|
39
39
|
getRuleByLocation(unitId: string, subUnitId: string, row: number, col: number): ISheetDataValidationRule | undefined;
|
|
40
40
|
validator(rule: ISheetDataValidationRule, pos: ISheetLocation, _onCompete?: (status: DataValidationStatus, changed: boolean) => void): DataValidationStatus;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { DataValidationStatus, IRange, ISheetDataValidationRule, Nullable, Disposable, ICommandService, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { DataValidationStatus, IRange, ISheetDataValidationRule, Nullable, Disposable, ICommandService, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
export declare class DataValidationCacheService extends Disposable {
|
|
3
3
|
private readonly _commandService;
|
|
4
|
+
private readonly _univerInstanceService;
|
|
4
5
|
private _cacheMatrix;
|
|
5
6
|
private _dirtyRanges$;
|
|
6
7
|
readonly dirtyRanges$: import('rxjs').Observable<{
|
|
@@ -8,15 +9,14 @@ export declare class DataValidationCacheService extends Disposable {
|
|
|
8
9
|
subUnitId: string;
|
|
9
10
|
ranges: IRange[];
|
|
10
11
|
}>;
|
|
11
|
-
constructor(_commandService: ICommandService);
|
|
12
|
+
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService);
|
|
12
13
|
private _initDirtyRanges;
|
|
14
|
+
private _initSheetRemove;
|
|
13
15
|
private _ensureCache;
|
|
14
16
|
ensureCache(unitId: string, subUnitId: string): ObjectMatrix<Nullable<DataValidationStatus>>;
|
|
15
17
|
addRule(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
16
18
|
removeRule(unitId: string, subUnitId: string, rule: ISheetDataValidationRule): void;
|
|
17
19
|
markRangeDirty(unitId: string, subUnitId: string, ranges: IRange[]): void;
|
|
18
|
-
markCellDirty(unitId: string, subUnitId: string, row: number, col: number): void;
|
|
19
20
|
private _deleteRange;
|
|
20
21
|
getValue(unitId: string, subUnitId: string, row: number, col: number): Nullable<Nullable<DataValidationStatus>>;
|
|
21
|
-
setValue(unitId: string, subUnitId: string, row: number, col: number, value: DataValidationStatus): void;
|
|
22
22
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ISheetDataValidationRule, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
-
import { DataValidationModel } from '@univerjs/data-validation';
|
|
2
|
+
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
3
3
|
import { RegisterOtherFormulaService } from '@univerjs/sheets-formula';
|
|
4
4
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
5
5
|
interface IFormulaData {
|
|
@@ -13,12 +13,13 @@ export declare class DataValidationCustomFormulaService extends Disposable {
|
|
|
13
13
|
private _registerOtherFormulaService;
|
|
14
14
|
private readonly _dataValidationModel;
|
|
15
15
|
private readonly _dataValidationCacheService;
|
|
16
|
+
private readonly _validatorRegistryService;
|
|
16
17
|
/**
|
|
17
18
|
* Map of origin formula of rule
|
|
18
19
|
*/
|
|
19
20
|
private _ruleFormulaMap;
|
|
20
21
|
private _ruleFormulaMap2;
|
|
21
|
-
constructor(_instanceSrv: IUniverInstanceService, _registerOtherFormulaService: RegisterOtherFormulaService, _dataValidationModel: DataValidationModel, _dataValidationCacheService: DataValidationCacheService);
|
|
22
|
+
constructor(_instanceSrv: IUniverInstanceService, _registerOtherFormulaService: RegisterOtherFormulaService, _dataValidationModel: DataValidationModel, _dataValidationCacheService: DataValidationCacheService, _validatorRegistryService: DataValidatorRegistryService);
|
|
22
23
|
private _initFormulaResultHandler;
|
|
23
24
|
private _ensureMaps;
|
|
24
25
|
private _registerFormula;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { ISheetDataValidationRule, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IFormulaInfo, IOtherFormulaResult, RegisterOtherFormulaService } from '@univerjs/sheets-formula';
|
|
3
|
-
import { DataValidationModel } from '@univerjs/data-validation';
|
|
3
|
+
import { DataValidationModel, DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
4
4
|
import { DataValidationCacheService } from './dv-cache.service';
|
|
5
5
|
export declare class DataValidationFormulaService extends Disposable {
|
|
6
6
|
private readonly _instanceService;
|
|
7
7
|
private _registerOtherFormulaService;
|
|
8
8
|
private readonly _dataValidationCacheService;
|
|
9
9
|
private readonly _dataValidationModel;
|
|
10
|
+
private readonly _validatorRegistryService;
|
|
10
11
|
private _formulaRuleMap;
|
|
11
|
-
constructor(_instanceService: IUniverInstanceService, _registerOtherFormulaService: RegisterOtherFormulaService, _dataValidationCacheService: DataValidationCacheService, _dataValidationModel: DataValidationModel);
|
|
12
|
+
constructor(_instanceService: IUniverInstanceService, _registerOtherFormulaService: RegisterOtherFormulaService, _dataValidationCacheService: DataValidationCacheService, _dataValidationModel: DataValidationModel, _validatorRegistryService: DataValidatorRegistryService);
|
|
12
13
|
private _initFormulaResultHandler;
|
|
13
14
|
private _ensureRuleFormulaMap;
|
|
14
15
|
private _registerSingleFormula;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DataValidationType, ICellData, Nullable } from '@univerjs/core';
|
|
2
|
+
import { DataValidatorRegistryService } from '@univerjs/data-validation';
|
|
2
3
|
export declare function getFormulaResult(result: Nullable<Nullable<ICellData>[][]>): Nullable<import('@univerjs/core').CellValue>;
|
|
3
4
|
export declare function getFormulaCellData(result: Nullable<Nullable<ICellData>[][]>): Nullable<ICellData>;
|
|
4
5
|
export declare function isLegalFormulaResult(res: string): boolean;
|
|
5
6
|
/**
|
|
6
7
|
* Judge if the data-validation's formula need to be offseted by ranges
|
|
7
8
|
*/
|
|
8
|
-
export declare function
|
|
9
|
+
export declare function shouldOffsetFormulaByRange(type: DataValidationType | string, validatorRegistryService: DataValidatorRegistryService): boolean;
|
|
@@ -5,6 +5,7 @@ export declare class AnyValidator extends BaseDataValidator {
|
|
|
5
5
|
title: string;
|
|
6
6
|
operators: DataValidationOperator[];
|
|
7
7
|
scopes: string | string[];
|
|
8
|
+
readonly offsetFormulaByRange = false;
|
|
8
9
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult>;
|
|
9
10
|
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
10
11
|
isValidType(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
@@ -12,6 +12,7 @@ export declare class CheckboxValidator extends BaseDataValidator {
|
|
|
12
12
|
title: string;
|
|
13
13
|
operators: DataValidationOperator[];
|
|
14
14
|
scopes: string | string[];
|
|
15
|
+
readonly offsetFormulaByRange = false;
|
|
15
16
|
private _formulaService;
|
|
16
17
|
skipDefaultFontRender: (rule: ISheetDataValidationRule, cellValue: Nullable<CellValue>, pos: {
|
|
17
18
|
unitId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CellValue, IDataValidationRule, IDataValidationRuleBase, DataValidationOperator } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
3
|
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
4
|
-
export declare class DateValidator extends BaseDataValidator
|
|
4
|
+
export declare class DateValidator extends BaseDataValidator {
|
|
5
5
|
id: string;
|
|
6
6
|
title: string;
|
|
7
7
|
operators: DataValidationOperator[];
|
|
@@ -17,14 +17,6 @@ export declare class DateValidator extends BaseDataValidator<number> {
|
|
|
17
17
|
formula2: string | undefined;
|
|
18
18
|
};
|
|
19
19
|
transform(cellInfo: IValidatorCellInfo<CellValue>, _formula: IFormulaResult, _rule: IDataValidationRule): IValidatorCellInfo<number>;
|
|
20
|
-
validatorIsEqual(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
21
|
-
validatorIsNotEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
22
|
-
validatorIsBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
23
|
-
validatorIsNotBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
24
|
-
validatorIsGreaterThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
25
|
-
validatorIsGreaterThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
26
|
-
validatorIsLessThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
27
|
-
validatorIsLessThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
28
20
|
get operatorNames(): string[];
|
|
29
21
|
generateRuleName(rule: IDataValidationRuleBase): string;
|
|
30
22
|
generateRuleErrorMessage(rule: IDataValidationRuleBase, pos: ISheetLocationBase): string;
|
|
@@ -2,7 +2,7 @@ import { CellValue, IDataValidationRule, IDataValidationRuleBase, Nullable, Data
|
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
3
|
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
4
4
|
export declare function getCellValueNumber(cellValue: CellValue): number;
|
|
5
|
-
export declare class DecimalValidator extends BaseDataValidator
|
|
5
|
+
export declare class DecimalValidator extends BaseDataValidator {
|
|
6
6
|
private readonly _customFormulaService;
|
|
7
7
|
id: string;
|
|
8
8
|
private readonly _lexerTreeBuilder;
|
|
@@ -25,13 +25,5 @@ export declare class DecimalValidator extends BaseDataValidator<number> {
|
|
|
25
25
|
private _parseNumber;
|
|
26
26
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string, row: number, column: number): Promise<IFormulaResult>;
|
|
27
27
|
validatorFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): IFormulaValidResult;
|
|
28
|
-
validatorIsEqual(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
29
|
-
validatorIsNotEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
30
|
-
validatorIsBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
31
|
-
validatorIsNotBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
32
|
-
validatorIsGreaterThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
33
|
-
validatorIsGreaterThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
34
|
-
validatorIsLessThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
35
|
-
validatorIsLessThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
36
28
|
generateRuleErrorMessage(rule: IDataValidationRuleBase, position: ISheetLocationBase): string;
|
|
37
29
|
}
|
|
@@ -8,6 +8,7 @@ export declare class ListValidator extends BaseDataValidator {
|
|
|
8
8
|
protected formulaService: DataValidationFormulaService;
|
|
9
9
|
private _lexer;
|
|
10
10
|
private _univerInstanceService;
|
|
11
|
+
readonly offsetFormulaByRange = false;
|
|
11
12
|
id: string;
|
|
12
13
|
title: string;
|
|
13
14
|
operators: DataValidationOperator[];
|
|
@@ -18,7 +19,7 @@ export declare class ListValidator extends BaseDataValidator {
|
|
|
18
19
|
style: IStyleData;
|
|
19
20
|
}): Nullable<IStyleData>;
|
|
20
21
|
parseCellValue(cellValue: CellValue): string[];
|
|
21
|
-
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult<
|
|
22
|
+
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string): Promise<IFormulaResult<number | undefined>>;
|
|
22
23
|
isValidType(cellInfo: IValidatorCellInfo<Nullable<CellValue>>, formula: IFormulaResult<string[] | undefined>, rule: IDataValidationRule): Promise<boolean>;
|
|
23
24
|
generateRuleName(): string;
|
|
24
25
|
generateRuleErrorMessage(): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CellValue, IDataValidationRule, IDataValidationRuleBase, Nullable, DataValidationOperator } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
3
|
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
4
|
-
export declare class TextLengthValidator extends BaseDataValidator
|
|
4
|
+
export declare class TextLengthValidator extends BaseDataValidator {
|
|
5
5
|
id: string;
|
|
6
6
|
title: string;
|
|
7
7
|
private readonly _lexerTreeBuilder;
|
|
@@ -9,10 +9,9 @@ export declare class TextLengthValidator extends BaseDataValidator<number> {
|
|
|
9
9
|
scopes: string | string[];
|
|
10
10
|
private readonly _customFormulaService;
|
|
11
11
|
private _isFormulaOrInt;
|
|
12
|
-
validatorFormula(rule: IDataValidationRule,
|
|
12
|
+
validatorFormula(rule: IDataValidationRule, _unitId: string, _subUnitId: string): IFormulaValidResult;
|
|
13
13
|
private _parseNumber;
|
|
14
|
-
|
|
15
|
-
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string, row: number, column: number): Promise<IFormulaResult<any>>;
|
|
14
|
+
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string, row: number, column: number): Promise<IFormulaResult<number | undefined>>;
|
|
16
15
|
transform(cellInfo: IValidatorCellInfo<CellValue>, _formula: IFormulaResult, _rule: IDataValidationRule): {
|
|
17
16
|
value: number;
|
|
18
17
|
interceptValue: Nullable<CellValue>;
|
|
@@ -24,14 +23,6 @@ export declare class TextLengthValidator extends BaseDataValidator<number> {
|
|
|
24
23
|
workbook: import('@univerjs/core').Workbook;
|
|
25
24
|
t: Nullable<import('@univerjs/protocol').CellValueType>;
|
|
26
25
|
};
|
|
27
|
-
isValidType(cellInfo: IValidatorCellInfo<number>,
|
|
28
|
-
validatorIsEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
29
|
-
validatorIsNotEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
30
|
-
validatorIsBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
31
|
-
validatorIsNotBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
32
|
-
validatorIsGreaterThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
33
|
-
validatorIsGreaterThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
34
|
-
validatorIsLessThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
35
|
-
validatorIsLessThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
26
|
+
isValidType(cellInfo: IValidatorCellInfo<number>, _formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
36
27
|
generateRuleErrorMessage(rule: IDataValidationRuleBase, pos: ISheetLocationBase): string;
|
|
37
28
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CellValue, IDataValidationRule, IDataValidationRuleBase, Nullable, DataValidationOperator } from '@univerjs/core';
|
|
2
2
|
import { IFormulaResult, IFormulaValidResult, IValidatorCellInfo, BaseDataValidator } from '@univerjs/data-validation';
|
|
3
3
|
import { ISheetLocationBase } from '@univerjs/sheets';
|
|
4
|
-
export declare class WholeValidator extends BaseDataValidator
|
|
4
|
+
export declare class WholeValidator extends BaseDataValidator {
|
|
5
5
|
private readonly _customFormulaService;
|
|
6
6
|
private readonly _lexerTreeBuilder;
|
|
7
7
|
id: string;
|
|
@@ -9,8 +9,8 @@ export declare class WholeValidator extends BaseDataValidator<number> {
|
|
|
9
9
|
operators: DataValidationOperator[];
|
|
10
10
|
scopes: string | string[];
|
|
11
11
|
private _isFormulaOrInt;
|
|
12
|
-
isValidType(cellInfo: IValidatorCellInfo<CellValue>,
|
|
13
|
-
transform(cellInfo: IValidatorCellInfo<CellValue>,
|
|
12
|
+
isValidType(cellInfo: IValidatorCellInfo<CellValue>, _formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
13
|
+
transform(cellInfo: IValidatorCellInfo<CellValue>, _formula: IFormulaResult, _rule: IDataValidationRule): {
|
|
14
14
|
value: number;
|
|
15
15
|
interceptValue: Nullable<CellValue>;
|
|
16
16
|
row: number;
|
|
@@ -23,14 +23,6 @@ export declare class WholeValidator extends BaseDataValidator<number> {
|
|
|
23
23
|
};
|
|
24
24
|
private _parseNumber;
|
|
25
25
|
parseFormula(rule: IDataValidationRule, unitId: string, subUnitId: string, row: number, column: number): Promise<IFormulaResult>;
|
|
26
|
-
validatorFormula(rule: IDataValidationRuleBase,
|
|
27
|
-
validatorIsEqual(cellInfo: IValidatorCellInfo<CellValue>, formula: IFormulaResult, rule: IDataValidationRule): Promise<boolean>;
|
|
28
|
-
validatorIsNotEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
29
|
-
validatorIsBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
30
|
-
validatorIsNotBetween(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
31
|
-
validatorIsGreaterThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
32
|
-
validatorIsGreaterThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
33
|
-
validatorIsLessThan(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
34
|
-
validatorIsLessThanOrEqual(cellInfo: IValidatorCellInfo<number>, formula: IFormulaResult, _rule: IDataValidationRule): Promise<boolean>;
|
|
26
|
+
validatorFormula(rule: IDataValidationRuleBase, _unitId: string, _subUnitId: string): IFormulaValidResult;
|
|
35
27
|
generateRuleErrorMessage(rule: IDataValidationRuleBase, position: ISheetLocationBase): string;
|
|
36
28
|
}
|