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

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


Class: CheckboxValidator

Extends

Constructors

new CheckboxValidator()

new CheckboxValidator(localeService, injector): CheckboxValidator

Parameters

ParameterType
localeServiceLocaleService
injectorInjector

Returns

CheckboxValidator

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.CHECKBOXBaseDataValidator.id-sheets-data-validation/src/validators/checkbox-validator.ts:52 (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[][]BaseDataValidator.operators-sheets-data-validation/src/validators/checkbox-validator.ts:54 (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/checkbox-validator.ts:55 (opens in a new tab)
titlepublicstring'dataValidation.checkbox.title'BaseDataValidator.title-sheets-data-validation/src/validators/checkbox-validator.ts:53 (opens in a new tab)

Accessors

operatorNames

get operatorNames(): string[]

Returns

string[]

Inherited from

BaseDataValidator.operatorNames

Defined in

data-validation/src/validators/base-data-validator.ts:83 (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/checkbox-validator.ts:148 (opens in a new tab)


generateRuleName()

generateRuleName(rule): string

Parameters

ParameterType
ruleIDataValidationRuleBase

Returns

string

Inherited from

BaseDataValidator.generateRuleName

Defined in

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


getExtraStyle()

getExtraStyle(rule, value): {
  tb: WrapStrategy.CLIP;
}

Parameters

ParameterType
ruleIDataValidationRule
valueNullable<CellValue>

Returns

{
  tb: WrapStrategy.CLIP;
}
NameTypeDefault valueDefined in
tbWrapStrategyWrapStrategy.CLIPsheets-data-validation/src/validators/checkbox-validator.ts:115 (opens in a new tab)

Overrides

BaseDataValidator.getExtraStyle

Defined in

sheets-data-validation/src/validators/checkbox-validator.ts:113 (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(
   cellInfo, 
   formula, 
rule): Promise<boolean>

Parameters

ParameterType
cellInfoIValidatorCellInfo<CellValue>
formulaIFormulaResult<any>
ruleIDataValidationRule

Returns

Promise<boolean>

Overrides

BaseDataValidator.isValidType

Defined in

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


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:135 (opens in a new tab)
formula2undefined | stringrule.formula2data-validation/src/validators/base-data-validator.ts:136 (opens in a new tab)

Inherited from

BaseDataValidator.normalizeFormula

Defined in

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


parseFormula()

parseFormula(
   rule, 
   unitId, 
subUnitId): Promise<ICheckboxFormulaResult>

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

Promise<ICheckboxFormulaResult>

Overrides

BaseDataValidator.parseFormula

Defined in

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


parseFormulaSync()

parseFormulaSync(
   rule, 
   unitId, 
   subUnitId): {
  formula1: Nullable<CellValue>;
  formula2: Nullable<CellValue>;
  originFormula1: Nullable<CellValue>;
  originFormula2: Nullable<CellValue>;
}

Parameters

ParameterType
ruleIDataValidationRule
unitIdstring
subUnitIdstring

Returns

{
  formula1: Nullable<CellValue>;
  formula2: Nullable<CellValue>;
  originFormula1: Nullable<CellValue>;
  originFormula2: Nullable<CellValue>;
}
NameTypeDefined in
formula1Nullable<CellValue>sheets-data-validation/src/validators/checkbox-validator.ts:126 (opens in a new tab)
formula2Nullable<CellValue>sheets-data-validation/src/validators/checkbox-validator.ts:127 (opens in a new tab)
originFormula1Nullable<CellValue>sheets-data-validation/src/validators/checkbox-validator.ts:128 (opens in a new tab)
originFormula2Nullable<CellValue>sheets-data-validation/src/validators/checkbox-validator.ts:129 (opens in a new tab)

Defined in

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


skipDefaultFontRender()

skipDefaultFontRender(
   rule, 
   cellValue, 
   pos): boolean

Parameters

ParameterType
ruleISheetDataValidationRule
cellValueNullable<CellValue>
posobject
pos.subUnitIdstring
pos.unitIdstring

Returns

boolean

Overrides

BaseDataValidator.skipDefaultFontRender

Defined in

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


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:144 (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/checkbox-validator.ts:68 (opens in a new tab)


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


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


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


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


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


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


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


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


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