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


Class: ListValidator

Extends

Extended by

Constructors

new ListValidator()

new ListValidator(localeService, injector): ListValidator

Parameters

ParameterType
localeServiceLocaleService
injectorInjector

Returns

ListValidator

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
formulaServiceprotectedDataValidationFormulaServiceundefined--sheets-data-validation/src/validators/list-validator.ts:92
idpublicstringDataValidationType.LISTBaseDataValidator.id-sheets-data-validation/src/validators/list-validator.ts:96
injectorreadonlyInjectorundefined-BaseDataValidator.injectordata-validation/src/validators/base-data-validator.ts:79
localeServicereadonlyLocaleServiceundefined-BaseDataValidator.localeServicedata-validation/src/validators/base-data-validator.ts:78
operatorspublicDataValidationOperator[][]BaseDataValidator.operators-sheets-data-validation/src/validators/list-validator.ts:98
optionsInputpublicundefined | stringundefined-BaseDataValidator.optionsInputdata-validation/src/validators/base-data-validator.ts:73
scopespublicstring | string[]undefinedBaseDataValidator.scopes-sheets-data-validation/src/validators/list-validator.ts:99
titlepublicstring'dataValidation.list.title'BaseDataValidator.title-sheets-data-validation/src/validators/list-validator.ts:97

Accessors

operatorNames

Get Signature

get operatorNames(): string[]
Returns

string[]

Inherited from

BaseDataValidator.operatorNames

Defined in

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


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(): string

Returns

string

Overrides

BaseDataValidator.generateRuleErrorMessage

Defined in

sheets-data-validation/src/validators/list-validator.ts:173


generateRuleName()

generateRuleName(): string

Returns

string

Overrides

BaseDataValidator.generateRuleName

Defined in

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


getExtraStyle()

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

Parameters

ParameterType
ruleIDataValidationRule
valueNullable<CellValue>
__namedParametersobject
__namedParameters.styleIStyleData

Returns

Nullable<IStyleData>

Overrides

BaseDataValidator.getExtraStyle

Defined in

sheets-data-validation/src/validators/list-validator.ts:123


getList()

getList(
   rule, 
   currentUnitId?, 
   currentSubUnitId?): string[]

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

string[]

Defined in

sheets-data-validation/src/validators/list-validator.ts:177


getListAsync()

getListAsync(
   rule, 
   currentUnitId?, 
currentSubUnitId?): Promise<string[]>

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

Promise<string[]>

Defined in

sheets-data-validation/src/validators/list-validator.ts:192


getListWithColor()

getListWithColor(
   rule, 
   currentUnitId?, 
   currentSubUnitId?): {
  color: string;
  label: string;
 }[]

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

{ color: string; label: string; }[]

Defined in

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


getListWithColorMap()

getListWithColorMap(
   rule, 
   currentUnitId?, 
currentSubUnitId?): Record<string, string>

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

Record<string, string>

Defined in

sheets-data-validation/src/validators/list-validator.ts:214


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(
   cellInfo, 
   formula, 
rule): Promise<boolean>

Parameters

ParameterType
cellInfoIValidatorCellInfo<Nullable<CellValue>>
formulaIFormulaResult<undefined | string[]>
ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.isValidType

Defined in

sheets-data-validation/src/validators/list-validator.ts:162


normalizeFormula()

normalizeFormula(
   rule, 
   unitId, 
   subUnitId): {
  formula1: rule.formula1;
  formula2: rule.formula2;
}

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

{
  formula1: rule.formula1;
  formula2: rule.formula2;
}
NameTypeDefault valueDefined in
formula1undefined | stringrule.formula1data-validation/src/validators/base-data-validator.ts:136
formula2undefined | stringrule.formula2data-validation/src/validators/base-data-validator.ts:137

Inherited from

BaseDataValidator.normalizeFormula

Defined in

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


parseCellValue()

parseCellValue(cellValue): string[]

Parameters

ParameterType
cellValueCellValue

Returns

string[]

Defined in

sheets-data-validation/src/validators/list-validator.ts:144


parseFormula()

parseFormula(
   rule, 
   unitId, 
subUnitId): Promise<IFormulaResult<undefined | string[]>>

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

Promise<IFormulaResult<undefined | string[]>>

Overrides

BaseDataValidator.parseFormula

Defined in

sheets-data-validation/src/validators/list-validator.ts:149


skipDefaultFontRender()

skipDefaultFontRender(rule): boolean

Parameters

ParameterType
ruleISheetDataValidationRule

Returns

boolean

Overrides

BaseDataValidator.skipDefaultFontRender

Defined in

sheets-data-validation/src/validators/list-validator.ts:101


transform()

transform(
   cellInfo, 
   formula, 
rule): IValidatorCellInfo<CellValue>

Parameters

ParameterType
cellInfoIValidatorCellInfo<Nullable<CellValue>>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

IValidatorCellInfo<CellValue>

Inherited from

BaseDataValidator.transform

Defined in

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


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/list-validator.ts:105


validatorIsBetween()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsBetween

Defined in

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


validatorIsEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsEqual

Defined in

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


validatorIsGreaterThan()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsGreaterThan

Defined in

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


validatorIsGreaterThanOrEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsGreaterThanOrEqual

Defined in

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


validatorIsLessThan()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsLessThan

Defined in

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


validatorIsLessThanOrEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsLessThanOrEqual

Defined in

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


validatorIsNotBetween()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsNotBetween

Defined in

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


validatorIsNotEqual()

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

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Inherited from

BaseDataValidator.validatorIsNotEqual

Defined in

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