@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
Parameter | Type |
---|---|
localeService | LocaleService |
injector | Injector |
Returns
Properties
Property | Modifier | Type | Default value | Defined in |
---|---|---|---|---|
canvasRender | public | Nullable <IBaseDataValidationWidget > | null | data-validation/src/validators/base-data-validator.ts:73 |
dropdown | public | undefined | string | undefined | data-validation/src/validators/base-data-validator.ts:74 |
formulaInput | public | undefined | string | undefined | data-validation/src/validators/base-data-validator.ts:72 |
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:81 |
localeService | readonly | LocaleService | undefined | data-validation/src/validators/base-data-validator.ts:80 |
offsetFormulaByRange | public | boolean | true | data-validation/src/validators/base-data-validator.ts:68 |
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:75 |
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:94 |
title | abstract | string | undefined | data-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
Parameter | Type |
---|---|
rule | IDataValidationRuleBase |
position | ISheetLocationBase |
Returns
string
generateRuleName()
generateRuleName(rule): string
Defined in: data-validation/src/validators/base-data-validator.ts:96
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRuleBase |
Returns
string
getExtraStyle()
getExtraStyle(
rule,
value,
ctx,
row,
column): Nullable<IStyleData>
Defined in: data-validation/src/validators/base-data-validator.ts:114
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRuleBase |
value | Nullable <CellValue > |
ctx | { style : IStyleData ; } |
ctx.style | IStyleData |
row | number |
column | number |
Returns
getRuleFinalError()
getRuleFinalError(rule, position): string
Defined in: data-validation/src/validators/base-data-validator.ts:116
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
position | ISheetLocationBase |
Returns
string
isEmptyCellValue()
isEmptyCellValue(cellValue): cellValue is undefined | null | void
Defined in: data-validation/src/validators/base-data-validator.ts:124
Parameters
Parameter | Type |
---|---|
cellValue | Nullable <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
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo |
formula | IFormulaResult |
rule | IDataValidationRule |
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
Parameter | Type |
---|---|
rule | IDataValidationRule |
unitId | string |
subUnitId | string |
Returns
{
formula1: undefined | string;
formula2: undefined | string;
}
parseFormula()
abstract parseFormula(
rule,
unitId,
subUnitId,
row,
column): Promise<IFormulaResult<undefined | number>>
Defined in: data-validation/src/validators/base-data-validator.ts:132
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
unitId | string |
subUnitId | string |
row | number |
column | number |
Returns
Promise
<IFormulaResult
<undefined
| number
>>
transform()
transform(
cellInfo,
formula,
rule): IValidatorCellInfo<number>
Defined in: data-validation/src/validators/base-data-validator.ts:147
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo |
formula | IFormulaResult |
rule | IDataValidationRule |
Returns
IValidatorCellInfo
<number
>
validator()
validator(cellInfo, rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:224
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorFormula()
abstract validatorFormula(
rule,
unitId,
subUnitId): IFormulaValidResult
Defined in: data-validation/src/validators/base-data-validator.ts:134
Parameters
Parameter | Type |
---|---|
rule | IDataValidationRule |
unitId | string |
subUnitId | string |
Returns
validatorIsBetween()
validatorIsBetween(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:170
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsEqual()
validatorIsEqual(
cellInfo,
formula,
rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:151
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <CellValue > |
formula | IFormulaResult |
rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsGreaterThan()
validatorIsGreaterThan(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:191
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsGreaterThanOrEqual()
validatorIsGreaterThanOrEqual(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:199
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsLessThan()
validatorIsLessThan(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:207
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsLessThanOrEqual()
validatorIsLessThanOrEqual(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:215
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsNotBetween()
validatorIsNotBetween(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:181
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>
validatorIsNotEqual()
validatorIsNotEqual(
cellInfo,
formula,
_rule): Promise<boolean>
Defined in: data-validation/src/validators/base-data-validator.ts:161
Parameters
Parameter | Type |
---|---|
cellInfo | IValidatorCellInfo <number > |
formula | IFormulaResult |
_rule | IDataValidationRule |
Returns
Promise
<boolean
>