@univerjsdata-validationclassesBasedatavalidator

@univerjs/data-validation v0.5.4


Class: abstract BaseDataValidator

Defined in: data-validation/src/validators/base-data-validator.ts:62

Extended by

Constructors

new BaseDataValidator()

new BaseDataValidator(localeService, injector): BaseDataValidator

Defined in: data-validation/src/validators/base-data-validator.ts:79

Parameters

ParameterType
localeServiceLocaleService
injectorInjector

Returns

BaseDataValidator

Properties

PropertyModifierTypeDefault valueDefined in
canvasRenderpublicNullable<IBaseDataValidationWidget>nulldata-validation/src/validators/base-data-validator.ts:73
dropdownpublicundefined | stringundefineddata-validation/src/validators/base-data-validator.ts:74
formulaInputpublicundefined | stringundefineddata-validation/src/validators/base-data-validator.ts:72
idabstractstringundefineddata-validation/src/validators/base-data-validator.ts:63
injectorreadonlyInjectorundefineddata-validation/src/validators/base-data-validator.ts:81
localeServicereadonlyLocaleServiceundefineddata-validation/src/validators/base-data-validator.ts:80
offsetFormulaByRangepublicbooleantruedata-validation/src/validators/base-data-validator.ts:68
operatorsabstractDataValidationOperator[]undefineddata-validation/src/validators/base-data-validator.ts:65
optionsInputpublicundefined | stringundefineddata-validation/src/validators/base-data-validator.ts:75
scopesabstractstring | string[]undefineddata-validation/src/validators/base-data-validator.ts:66
skipDefaultFontRenderpublicundefined | (rule, cellValue, pos) => booleanundefineddata-validation/src/validators/base-data-validator.ts:94
titleabstractstringundefineddata-validation/src/validators/base-data-validator.ts:64

Accessors

operatorNames

Get Signature

get operatorNames(): string[]

Defined in: data-validation/src/validators/base-data-validator.ts:86

Returns

string[]


titleStr

Get Signature

get titleStr(): string

Defined in: data-validation/src/validators/base-data-validator.ts:90

Returns

string

Methods

generateRuleErrorMessage()

generateRuleErrorMessage(rule, position): string

Defined in: data-validation/src/validators/base-data-validator.ts:105

Parameters

ParameterType
ruleIDataValidationRuleBase
positionISheetLocationBase

Returns

string


generateRuleName()

generateRuleName(rule): string

Defined in: data-validation/src/validators/base-data-validator.ts:96

Parameters

ParameterType
ruleIDataValidationRuleBase

Returns

string


getExtraStyle()

getExtraStyle(
   rule, 
   value, 
   ctx, 
   row, 
column): Nullable<IStyleData>

Defined in: data-validation/src/validators/base-data-validator.ts:114

Parameters

ParameterType
ruleIDataValidationRuleBase
valueNullable<CellValue>
ctx{ style: IStyleData; }
ctx.styleIStyleData
rownumber
columnnumber

Returns

Nullable<IStyleData>


getRuleFinalError()

getRuleFinalError(rule, position): string

Defined in: data-validation/src/validators/base-data-validator.ts:116

Parameters

ParameterType
ruleIDataValidationRule
positionISheetLocationBase

Returns

string


isEmptyCellValue()

isEmptyCellValue(cellValue): cellValue is undefined | null | void

Defined in: data-validation/src/validators/base-data-validator.ts:124

Parameters

ParameterType
cellValueNullable<CellValue>

Returns

cellValue is undefined | null | void


isValidType()

isValidType(
   cellInfo, 
   formula, 
rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:143

Parameters

ParameterType
cellInfoIValidatorCellInfo
formulaIFormulaResult
ruleIDataValidationRule

Returns

Promise<boolean>


normalizeFormula()

normalizeFormula(
   rule, 
   unitId, 
   subUnitId): {
  formula1: undefined | string;
  formula2: undefined | string;
}

Defined in: data-validation/src/validators/base-data-validator.ts:136

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

{
  formula1: undefined | string;
  formula2: undefined | string;
}
NameTypeDefault valueDefined in
formula1undefined | stringrule.formula1data-validation/src/validators/base-data-validator.ts:138
formula2undefined | stringrule.formula2data-validation/src/validators/base-data-validator.ts:139

parseFormula()

abstract parseFormula(
   rule, 
   unitId, 
   subUnitId, 
   row, 
column): Promise<IFormulaResult<undefined | number>>

Defined in: data-validation/src/validators/base-data-validator.ts:132

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring
rownumber
columnnumber

Returns

Promise<IFormulaResult<undefined | number>>


transform()

transform(
   cellInfo, 
   formula, 
rule): IValidatorCellInfo<number>

Defined in: data-validation/src/validators/base-data-validator.ts:147

Parameters

ParameterType
cellInfoIValidatorCellInfo
formulaIFormulaResult
ruleIDataValidationRule

Returns

IValidatorCellInfo<number>


validator()

validator(cellInfo, rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:224

Parameters

ParameterType
cellInfoIValidatorCellInfo
ruleIDataValidationRule

Returns

Promise<boolean>


validatorFormula()

abstract validatorFormula(
   rule, 
   unitId, 
   subUnitId): IFormulaValidResult

Defined in: data-validation/src/validators/base-data-validator.ts:134

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

IFormulaValidResult


validatorIsBetween()

validatorIsBetween(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:170

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsEqual()

validatorIsEqual(
   cellInfo, 
   formula, 
rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:151

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult
ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsGreaterThan()

validatorIsGreaterThan(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:191

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsGreaterThanOrEqual()

validatorIsGreaterThanOrEqual(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:199

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsLessThan()

validatorIsLessThan(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:207

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsLessThanOrEqual()

validatorIsLessThanOrEqual(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:215

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsNotBetween()

validatorIsNotBetween(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:181

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>


validatorIsNotEqual()

validatorIsNotEqual(
   cellInfo, 
   formula, 
_rule): Promise<boolean>

Defined in: data-validation/src/validators/base-data-validator.ts:161

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult
_ruleIDataValidationRule

Returns

Promise<boolean>