API Reference
@univerjs
@univerjs/sheets-data-validation
classes
Datevalidator

@univerjs/sheets-data-validation v0.4.2Docs


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:76 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueOverridesInherited fromDefined in
canvasRenderpublicNullable<IBaseDataValidationWidget>null-BaseDataValidator.canvasRenderdata-validation/src/validators/base-data-validator.ts:70 (opens in a new tab)
dropdownpublicundefined | stringundefined-BaseDataValidator.dropdowndata-validation/src/validators/base-data-validator.ts:71 (opens in a new tab)
formulaInputpublicundefined | stringundefined-BaseDataValidator.formulaInputdata-validation/src/validators/base-data-validator.ts:69 (opens in a new tab)
idpublicstringDataValidationType.DATEBaseDataValidator.id-sheets-data-validation/src/validators/date-validator.ts:50 (opens in a new tab)
injectorreadonlyInjectorundefined-BaseDataValidator.injectordata-validation/src/validators/base-data-validator.ts:78 (opens in a new tab)
localeServicereadonlyLocaleServiceundefined-BaseDataValidator.localeServicedata-validation/src/validators/base-data-validator.ts:77 (opens in a new tab)
operatorspublicDataValidationOperator[]undefinedBaseDataValidator.operators-sheets-data-validation/src/validators/date-validator.ts:52 (opens in a new tab)
optionsInputpublicundefined | stringundefined-BaseDataValidator.optionsInputdata-validation/src/validators/base-data-validator.ts:72 (opens in a new tab)
scopespublicstring | string[]undefinedBaseDataValidator.scopes-sheets-data-validation/src/validators/date-validator.ts:63 (opens in a new tab)
skipDefaultFontRenderpublicundefined | (rule, cellValue, pos) => booleanundefined-BaseDataValidator.skipDefaultFontRenderdata-validation/src/validators/base-data-validator.ts:91 (opens in a new tab)
titlepublicstring'dataValidation.date.title'BaseDataValidator.title-sheets-data-validation/src/validators/date-validator.ts:51 (opens in a new tab)

Accessors

operatorNames

get operatorNames(): string[]

Returns

string[]

Overrides

BaseDataValidator.operatorNames

Defined in

sheets-data-validation/src/validators/date-validator.ts:240 (opens in a new tab)


titleStr

get titleStr(): string

Returns

string

Inherited from

BaseDataValidator.titleStr

Defined in

data-validation/src/validators/base-data-validator.ts:87 (opens in a new tab)

Methods

generateRuleErrorMessage()

generateRuleErrorMessage(rule): string

Parameters

ParameterType
ruleIDataValidationRuleBase

Returns

string

Overrides

BaseDataValidator.generateRuleErrorMessage

Defined in

sheets-data-validation/src/validators/date-validator.ts:253 (opens in a new tab)


generateRuleName()

generateRuleName(rule): string

Parameters

ParameterType
ruleIDataValidationRuleBase

Returns

string

Overrides

BaseDataValidator.generateRuleName

Defined in

sheets-data-validation/src/validators/date-validator.ts:244 (opens in a new tab)


getExtraStyle()

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

Parameters

ParameterType
ruleIDataValidationRuleBase
valueNullable<CellValue>
ctxobject
ctx.styleIStyleData

Returns

Nullable<IStyleData>

Inherited from

BaseDataValidator.getExtraStyle

Defined in

data-validation/src/validators/base-data-validator.ts:111 (opens in a new tab)


getRuleFinalError()

getRuleFinalError(rule): string

Parameters

ParameterType
ruleIDataValidationRule

Returns

string

Inherited from

BaseDataValidator.getRuleFinalError

Defined in

data-validation/src/validators/base-data-validator.ts:113 (opens in a new tab)


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:121 (opens in a new tab)


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:90 (opens in a new tab)


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:133 (opens in a new tab)
formula2undefined | stringsheets-data-validation/src/validators/date-validator.ts:133 (opens in a new tab)

Overrides

BaseDataValidator.normalizeFormula

Defined in

sheets-data-validation/src/validators/date-validator.ts:133 (opens in a new tab)


parseFormula()

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

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

Promise<IFormulaResult<undefined | number>>

Overrides

BaseDataValidator.parseFormula

Defined in

sheets-data-validation/src/validators/date-validator.ts:66 (opens in a new tab)


parseFormulaSync()

parseFormulaSync(
   rule, 
   unitId, 
   subUnitId): {
  formula1: undefined | number;
  formula2: undefined | number;
}

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

{
  formula1: undefined | number;
  formula2: undefined | number;
}
NameTypeDefined in
formula1undefined | numbersheets-data-validation/src/validators/date-validator.ts:85 (opens in a new tab)
formula2undefined | numbersheets-data-validation/src/validators/date-validator.ts:86 (opens in a new tab)

Defined in

sheets-data-validation/src/validators/date-validator.ts:80 (opens in a new tab)


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:159 (opens in a new tab)


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:180 (opens in a new tab)


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:107 (opens in a new tab)


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:187 (opens in a new tab)


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:168 (opens in a new tab)


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:208 (opens in a new tab)


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:216 (opens in a new tab)


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:224 (opens in a new tab)


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:232 (opens in a new tab)


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:198 (opens in a new tab)


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:178 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.