@univerjs/data-validation v0.5.0-beta.1 • Docs
Class: abstract
BaseDataValidator<DataType>
Extended by
Type Parameters
Type Parameter | Default type |
---|---|
DataType | CellValue |
Constructors
new BaseDataValidator()
new BaseDataValidator<DataType>(localeService, injector): BaseDataValidator<DataType>
Parameters
Parameter | Type |
---|---|
localeService | LocaleService |
injector | Injector |
Returns
BaseDataValidator
<DataType
>
Defined in
data-validation/src/validators/base-data-validator.ts:77
Properties
Property | Modifier | Type | Default value | Defined in |
---|---|---|---|---|
canvasRender | public | Nullable <IBaseDataValidationWidget > | null | data-validation/src/validators/base-data-validator.ts:71 |
dropdown | public | undefined | string | undefined | data-validation/src/validators/base-data-validator.ts:72 |
formulaInput | public | undefined | string | undefined | data-validation/src/validators/base-data-validator.ts:70 |
id | abstract | string | undefined | data-validation/src/validators/base-data-validator.ts:63 |
injector | readonly | Injector | undefined | data-validation/src/validators/base-data-validator.ts:79 |
localeService | readonly | LocaleService | undefined | data-validation/src/validators/base-data-validator.ts:78 |
operators | abstract | DataValidationOperator [] | undefined | data-validation/src/validators/base-data-validator.ts:65 |
optionsInput | public | undefined | string | undefined | data-validation/src/validators/base-data-validator.ts:73 |
scopes | abstract | string | string [] | undefined | data-validation/src/validators/base-data-validator.ts:66 |
skipDefaultFontRender | public | undefined | (rule , cellValue , pos ) => boolean | undefined | data-validation/src/validators/base-data-validator.ts:92 |
title | abstract | string | undefined | data-validation/src/validators/base-data-validator.ts:64 |
Accessors
operatorNames
Get Signature
get operatorNames(): string[]
Returns
string
[]
Defined in
data-validation/src/validators/base-data-validator.ts:84
titleStr
Get Signature
get titleStr(): string
Returns
string
Defined in
data-validation/src/validators/base-data-validator.ts:88
Methods
generateRuleErrorMessage()
generateRuleErrorMessage(rule, position): string
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRuleBase |
position | ISheetLocationBase |
Returns
string
Defined in
data-validation/src/validators/base-data-validator.ts:103
generateRuleName()
generateRuleName(rule): string
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRuleBase |
Returns
string
Defined in
data-validation/src/validators/base-data-validator.ts:94
getExtraStyle()
getExtraStyle(
rule,
value,
ctx,
row,
column): Nullable<IStyleData>
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRuleBase |
value | Nullable <CellValue > |
ctx | object |
ctx.style | IStyleData |
row | number |
column | number |
Returns
Defined in
data-validation/src/validators/base-data-validator.ts:112
getRuleFinalError()
getRuleFinalError(rule, position): string
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
position | ISheetLocationBase |
Returns
string
Defined in
data-validation/src/validators/base-data-validator.ts:114
isEmptyCellValue()
isEmptyCellValue(cellValue): cellValue is undefined | null | void
Parameters
Parameter | Type |
---|---|
cellValue | Nullable <CellValue > |
Returns
cellValue is undefined | null | void
Defined in
data-validation/src/validators/base-data-validator.ts:122
isValidType()
isValidType(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <Nullable <CellValue >> |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:141
normalizeFormula()
normalizeFormula(
rule,
unitId,
subUnitId): {
formula1: rule.formula1;
formula2: rule.formula2;
}
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
unitId | string |
subUnitId | string |
Returns
{
formula1: rule.formula1;
formula2: rule.formula2;
}
Name | Type | Default value | Defined in |
---|---|---|---|
formula1 | undefined | string | rule.formula1 | data-validation/src/validators/base-data-validator.ts:136 |
formula2 | undefined | string | rule.formula2 | data-validation/src/validators/base-data-validator.ts:137 |
Defined in
data-validation/src/validators/base-data-validator.ts:134
parseFormula()
abstract parseFormula(
rule,
unitId,
subUnitId,
row,
column): Promise<IFormulaResult<any>>
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
unitId | string |
subUnitId | string |
row | number |
column | number |
Returns
Promise
<IFormulaResult
<any
>>
Defined in
data-validation/src/validators/base-data-validator.ts:130
transform()
transform(
cellInfo,
formula,
rule): IValidatorCellInfo<DataType>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <Nullable <CellValue >> |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
IValidatorCellInfo
<DataType
>
Defined in
data-validation/src/validators/base-data-validator.ts:145
validator()
validator(cellInfo, rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <Nullable <CellValue >> |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:181
validatorFormula()
abstract validatorFormula(
rule,
unitId,
subUnitId): IFormulaValidResult
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
unitId | string |
subUnitId | string |
Returns
Defined in
data-validation/src/validators/base-data-validator.ts:132
validatorIsBetween()
validatorIsBetween(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:157
validatorIsEqual()
validatorIsEqual(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:149
validatorIsGreaterThan()
validatorIsGreaterThan(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:165
validatorIsGreaterThanOrEqual()
validatorIsGreaterThanOrEqual(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:169
validatorIsLessThan()
validatorIsLessThan(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:173
validatorIsLessThanOrEqual()
validatorIsLessThanOrEqual(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:177
validatorIsNotBetween()
validatorIsNotBetween(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:161
validatorIsNotEqual()
validatorIsNotEqual(
cellInfo,
formula,
rule): Promise<boolean>
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <DataType > |
formula | IFormulaResult <any > |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
Defined in
data-validation/src/validators/base-data-validator.ts:153