@univerjs/sheets-data-validation v0.5.4


Class: ListValidator

Defined in: sheets-data-validation/src/validators/list-validator.ts:91

Extends

Extended by

Constructors

new ListValidator()

new ListValidator(localeService, injector): ListValidator

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

Parameters

ParameterType
localeServiceLocaleService
injectorInjector

Returns

ListValidator

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

Accessors

operatorNames

Get Signature

get operatorNames(): string[]

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

Returns

string[]

Inherited from

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:176

Returns

string

Overrides

BaseDataValidator.generateRuleErrorMessage


generateRuleName()

generateRuleName(): string

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

Returns

string

Overrides

BaseDataValidator.generateRuleName


getExtraStyle()

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:125

Parameters

ParameterType
ruleIDataValidationRule
valueNullable<CellValue>
__namedParameters{ style: IStyleData; }
__namedParameters.styleIStyleData

Returns

Nullable<IStyleData>

Overrides

BaseDataValidator.getExtraStyle


getList()

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:180

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

string[]


getListAsync()

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:195

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

Promise<string[]>


getListWithColor()

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:210

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

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


getListWithColorMap()

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:217

Parameters

ParameterType
ruleIDataValidationRule
currentUnitId?string
currentSubUnitId?string

Returns

Record<string, string>


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

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

Parameters

ParameterType
cellInfoIValidatorCellInfo
formulaIFormulaResult<undefined | string[]>
ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.isValidType


normalizeFormula()

normalizeFormula(
   rule, 
   unitId, 
   subUnitId): {
  formula1: undefined | string;
  formula2: undefined | string;
}

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

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

{
  formula1: undefined | string;
  formula2: undefined | string;
}
NameTypeDefault valueDefined in
formula1undefined | stringrule.formula1data-validation/src/validators/base-data-validator.ts:138
formula2undefined | stringrule.formula2data-validation/src/validators/base-data-validator.ts:139

Inherited from

BaseDataValidator.normalizeFormula


parseCellValue()

parseCellValue(cellValue): string[]

Defined in: sheets-data-validation/src/validators/list-validator.ts:146

Parameters

ParameterType
cellValueCellValue

Returns

string[]


parseFormula()

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

Defined in: sheets-data-validation/src/validators/list-validator.ts:151

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

Promise<IFormulaResult<undefined | number>>

Overrides

BaseDataValidator.parseFormula


skipDefaultFontRender()

skipDefaultFontRender(rule): boolean

Defined in: sheets-data-validation/src/validators/list-validator.ts:103

Parameters

ParameterType
ruleISheetDataValidationRule

Returns

boolean

Overrides

BaseDataValidator.skipDefaultFontRender

transform()

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

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

Parameters

ParameterType
cellInfoIValidatorCellInfo
formulaIFormulaResult
ruleIDataValidationRule

Returns

IValidatorCellInfo<number>

Inherited from

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

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