@univerjs/sheets-data-validation v0.5.4


Class: DateValidator

Defined in: sheets-data-validation/src/validators/date-validator.ts:49

Extends

Constructors

new DateValidator()

new DateValidator(localeService, injector): DateValidator

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

Parameters

ParameterType
localeServiceLocaleService
injectorInjector

Returns

DateValidator

Inherited from

BaseDataValidator.constructor

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
canvasRenderpublicNullable<IBaseDataValidationWidget>null-BaseDataValidator.canvasRenderdata-validation/src/validators/base-data-validator.ts:73
dropdownpublicundefined | stringundefined-BaseDataValidator.dropdowndata-validation/src/validators/base-data-validator.ts:74
formulaInputpublicundefined | stringundefined-BaseDataValidator.formulaInputdata-validation/src/validators/base-data-validator.ts:72
idpublicstringDataValidationType.DATEBaseDataValidator.id-sheets-data-validation/src/validators/date-validator.ts:50
injectorreadonlyInjectorundefined-BaseDataValidator.injectordata-validation/src/validators/base-data-validator.ts:81
localeServicereadonlyLocaleServiceundefined-BaseDataValidator.localeServicedata-validation/src/validators/base-data-validator.ts:80
offsetFormulaByRangepublicbooleantrue-BaseDataValidator.offsetFormulaByRangedata-validation/src/validators/base-data-validator.ts:68
operatorspublicDataValidationOperator[]undefinedBaseDataValidator.operators-sheets-data-validation/src/validators/date-validator.ts:52
optionsInputpublicundefined | stringundefined-BaseDataValidator.optionsInputdata-validation/src/validators/base-data-validator.ts:75
scopespublicstring | string[]undefinedBaseDataValidator.scopes-sheets-data-validation/src/validators/date-validator.ts:63
skipDefaultFontRenderpublicundefined | (rule, cellValue, pos) => booleanundefined-BaseDataValidator.skipDefaultFontRenderdata-validation/src/validators/base-data-validator.ts:94
titlepublicstring'dataValidation.date.title'BaseDataValidator.title-sheets-data-validation/src/validators/date-validator.ts:51

Accessors

operatorNames

Get Signature

get operatorNames(): string[]

Defined in: sheets-data-validation/src/validators/date-validator.ts:159

Returns

string[]

Overrides

BaseDataValidator.operatorNames


titleStr

Get Signature

get titleStr(): string

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

Returns

string

Inherited from

BaseDataValidator.titleStr

Methods

generateRuleErrorMessage()

generateRuleErrorMessage(rule, pos): string

Defined in: sheets-data-validation/src/validators/date-validator.ts:172

Parameters

ParameterType
ruleIDataValidationRuleBase
posISheetLocationBase

Returns

string

Overrides

BaseDataValidator.generateRuleErrorMessage


generateRuleName()

generateRuleName(rule): string

Defined in: sheets-data-validation/src/validators/date-validator.ts:163

Parameters

ParameterType
ruleIDataValidationRuleBase

Returns

string

Overrides

BaseDataValidator.generateRuleName


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>

Inherited from

BaseDataValidator.getExtraStyle


getRuleFinalError()

getRuleFinalError(rule, position): string

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

Parameters

ParameterType
ruleIDataValidationRule
positionISheetLocationBase

Returns

string

Inherited from

BaseDataValidator.getRuleFinalError


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

Inherited from

BaseDataValidator.isEmptyCellValue


isValidType()

isValidType(info): Promise<boolean>

Defined in: sheets-data-validation/src/validators/date-validator.ts:81

Parameters

ParameterType
infoIValidatorCellInfo

Returns

Promise<boolean>

Overrides

BaseDataValidator.isValidType


normalizeFormula()

normalizeFormula(
   rule, 
   _unitId, 
   _subUnitId): {
  formula1: undefined | string;
  formula2: undefined | string;
}

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

Parameters

ParameterType
ruleIDataValidationRule
_unitIdstring
_subUnitIdstring

Returns

{
  formula1: undefined | string;
  formula2: undefined | string;
}
NameTypeDefined in
formula1undefined | stringsheets-data-validation/src/validators/date-validator.ts:124
formula2undefined | stringsheets-data-validation/src/validators/date-validator.ts:124

Overrides

BaseDataValidator.normalizeFormula


parseFormula()

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

Defined in: sheets-data-validation/src/validators/date-validator.ts:67

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring
rownumber
columnnumber

Returns

Promise<IFormulaResult<undefined | number>>

Overrides

BaseDataValidator.parseFormula


transform()

transform(
   cellInfo, 
   _formula, 
_rule): IValidatorCellInfo<number>

Defined in: sheets-data-validation/src/validators/date-validator.ts:150

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
_formulaIFormulaResult
_ruleIDataValidationRule

Returns

IValidatorCellInfo<number>

Overrides

BaseDataValidator.transform


validator()

validator(cellInfo, rule): Promise<boolean>

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

Parameters

ParameterType
cellInfoIValidatorCellInfo
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validator


validatorFormula()

validatorFormula(
   rule, 
   unitId, 
   subUnitId): IFormulaValidResult

Defined in: sheets-data-validation/src/validators/date-validator.ts:98

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

IFormulaValidResult

Overrides

BaseDataValidator.validatorFormula


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>

Inherited from

BaseDataValidator.validatorIsBetween


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>

Inherited from

BaseDataValidator.validatorIsEqual


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>

Inherited from

BaseDataValidator.validatorIsGreaterThan


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>

Inherited from

BaseDataValidator.validatorIsGreaterThanOrEqual


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>

Inherited from

BaseDataValidator.validatorIsLessThan


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>

Inherited from

BaseDataValidator.validatorIsLessThanOrEqual


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>

Inherited from

BaseDataValidator.validatorIsNotBetween


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>

Inherited from

BaseDataValidator.validatorIsNotEqual