@univerjs/sheets-data-validation v0.5.0-beta.1 • Docs


Class: DateValidator

Extends

Constructors

new DateValidator()

new DateValidator(localeService, injector): DateValidator

Parameters

ParameterType
localeServiceLocaleService
injectorInjector

Returns

DateValidator

Inherited from

BaseDataValidator.constructor

Defined in

data-validation/src/validators/base-data-validator.ts:77

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
canvasRenderpublicNullable<IBaseDataValidationWidget>null-BaseDataValidator.canvasRenderdata-validation/src/validators/base-data-validator.ts:71
dropdownpublicundefined | stringundefined-BaseDataValidator.dropdowndata-validation/src/validators/base-data-validator.ts:72
formulaInputpublicundefined | stringundefined-BaseDataValidator.formulaInputdata-validation/src/validators/base-data-validator.ts:70
idpublicstringDataValidationType.DATEBaseDataValidator.id-sheets-data-validation/src/validators/date-validator.ts:50
injectorreadonlyInjectorundefined-BaseDataValidator.injectordata-validation/src/validators/base-data-validator.ts:79
localeServicereadonlyLocaleServiceundefined-BaseDataValidator.localeServicedata-validation/src/validators/base-data-validator.ts:78
operatorspublicDataValidationOperator[]undefinedBaseDataValidator.operators-sheets-data-validation/src/validators/date-validator.ts:52
optionsInputpublicundefined | stringundefined-BaseDataValidator.optionsInputdata-validation/src/validators/base-data-validator.ts:73
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:92
titlepublicstring'dataValidation.date.title'BaseDataValidator.title-sheets-data-validation/src/validators/date-validator.ts:51

Accessors

operatorNames

Get Signature

get operatorNames(): string[]
Returns

string[]

Overrides

BaseDataValidator.operatorNames

Defined in

sheets-data-validation/src/validators/date-validator.ts:231


titleStr

Get Signature

get titleStr(): string
Returns

string

Inherited from

BaseDataValidator.titleStr

Defined in

data-validation/src/validators/base-data-validator.ts:88

Methods

generateRuleErrorMessage()

generateRuleErrorMessage(rule, pos): string

Parameters

ParameterType
ruleIDataValidationRuleBase
posISheetLocationBase

Returns

string

Overrides

BaseDataValidator.generateRuleErrorMessage

Defined in

sheets-data-validation/src/validators/date-validator.ts:244


generateRuleName()

generateRuleName(rule): string

Parameters

ParameterType
ruleIDataValidationRuleBase

Returns

string

Overrides

BaseDataValidator.generateRuleName

Defined in

sheets-data-validation/src/validators/date-validator.ts:235


getExtraStyle()

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

Parameters

ParameterType
ruleIDataValidationRuleBase
valueNullable<CellValue>
ctxobject
ctx.styleIStyleData
rownumber
columnnumber

Returns

Nullable<IStyleData>

Inherited from

BaseDataValidator.getExtraStyle

Defined in

data-validation/src/validators/base-data-validator.ts:112


getRuleFinalError()

getRuleFinalError(rule, position): string

Parameters

ParameterType
ruleIDataValidationRule
positionISheetLocationBase

Returns

string

Inherited from

BaseDataValidator.getRuleFinalError

Defined in

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


isEmptyCellValue()

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

Parameters

ParameterType
cellValueNullable<CellValue>

Returns

cellValue is undefined | null | void

Inherited from

BaseDataValidator.isEmptyCellValue

Defined in

data-validation/src/validators/base-data-validator.ts:122


isValidType()

isValidType(info): Promise<boolean>

Parameters

ParameterType
infoIValidatorCellInfo<Nullable<CellValue>>

Returns

Promise<boolean>

Overrides

BaseDataValidator.isValidType

Defined in

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


normalizeFormula()

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

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

Defined in

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


parseFormula()

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

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring
rownumber
columnnumber

Returns

Promise<IFormulaResult<undefined | number>>

Overrides

BaseDataValidator.parseFormula

Defined in

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


transform()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
_formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

IValidatorCellInfo<number>

Overrides

BaseDataValidator.transform

Defined in

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


validator()

validator(cellInfo, rule): Promise<boolean>

Parameters

ParameterType
cellInfoIValidatorCellInfo<Nullable<CellValue>>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validator

Defined in

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


validatorFormula()

validatorFormula(
   rule, 
   unitId, 
   subUnitId): IFormulaValidResult

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

IFormulaValidResult

Overrides

BaseDataValidator.validatorFormula

Defined in

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


validatorIsBetween()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsBetween

Defined in

sheets-data-validation/src/validators/date-validator.ts:178


validatorIsEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsEqual

Defined in

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


validatorIsGreaterThan()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsGreaterThan

Defined in

sheets-data-validation/src/validators/date-validator.ts:199


validatorIsGreaterThanOrEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsGreaterThanOrEqual

Defined in

sheets-data-validation/src/validators/date-validator.ts:207


validatorIsLessThan()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsLessThan

Defined in

sheets-data-validation/src/validators/date-validator.ts:215


validatorIsLessThanOrEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsLessThanOrEqual

Defined in

sheets-data-validation/src/validators/date-validator.ts:223


validatorIsNotBetween()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsNotBetween

Defined in

sheets-data-validation/src/validators/date-validator.ts:189


validatorIsNotEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<number>
formulaIFormulaResult<any>
_ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.validatorIsNotEqual

Defined in

sheets-data-validation/src/validators/date-validator.ts:169