@univerjssheets-conditional-formattingfacadeclassesFconditionalformattingbuilder

@univerjs/sheets-conditional-formatting v0.5.4


Class: FConditionalFormattingBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:642

Constructors

new FConditionalFormattingBuilder()

new FConditionalFormattingBuilder(_initConfig): FConditionalFormattingBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:643

Parameters

ParameterType
_initConfig{ ranges: IRange[]; }
_initConfig.ranges?IRange[]

Returns

FConditionalFormattingBuilder

Methods

build()

build(): IConditionFormattingRule

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:647

Returns

IConditionFormattingRule


setAverage()

setAverage(operator): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:656

Set average rule

Parameters

ParameterType
operator| greaterThan | greaterThanOrEqual | lessThan | lessThanOrEqual | equal | notEqual

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatHighlightRuleBuilder


setBackground()

setBackground(color?): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:744

Sets the background color

Parameters

ParameterType
color?string

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setBold()

setBold(isBold): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:754

Set Bold

Parameters

ParameterType
isBoldboolean

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setColorScale()

setColorScale(config): ConditionalFormatColorScaleRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:705

Set colorScale rule

Parameters

ParameterType
config{ color: string; index: number; value: IValueConfig; }[]

Returns

ConditionalFormatColorScaleRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setDataBar()

setDataBar(config): ConditionalFormatDataBarRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:727

Set dataBar rule

Parameters

ParameterType
config{ isGradient: boolean; isShowValue: boolean; max: IValueConfig; min: IValueConfig; nativeColor: string; positiveColor: string; }
config.isGradient?boolean
config.isShowValue?boolean
config.maxIValueConfig
config.minIValueConfig
config.nativeColorstring
config.positiveColorstring

Returns

ConditionalFormatDataBarRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setDuplicateValues()

setDuplicateValues(): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:672

Set duplicateValues rule

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatHighlightRuleBuilder


setFontColor()

setFontColor(color?): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:764

Sets the font color

Parameters

ParameterType
color?string

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setIconSet()

setIconSet(config): ConditionalFormatIconSetRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:696

Set iconSet rule

Parameters

ParameterType
config{ iconConfigs: { iconId: string; iconType: string; operator: CFNumberOperator; value: IValueConfig; }[]; isShowValue: boolean; }
config.iconConfigs{ iconId: string; iconType: string; operator: CFNumberOperator; value: IValueConfig; }[]
config.isShowValueboolean

Returns

ConditionalFormatIconSetRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setItalic()

setItalic(isItalic): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:774

Set the text to italic

Parameters

ParameterType
isItalicboolean

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setRank()

setRank(config): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:684

Set rank rule

Parameters

ParameterType
config{ isBottom: boolean; isPercent: boolean; value: number; }
config.isBottomboolean
config.isPercentboolean
config.valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatHighlightRuleBuilder


setStrikethrough()

setStrikethrough(isStrikethrough): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:784

Set the strikethrough

Parameters

ParameterType
isStrikethroughboolean

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setUnderline()

setUnderline(isUnderline): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:794

Set the underscore

Parameters

ParameterType
isUnderlineboolean

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


setUniqueValues()

setUniqueValues(): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:664

Set uniqueValues rule

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatHighlightRuleBuilder


whenCellEmpty()

whenCellEmpty(): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:801

Sets the conditional formatting rule to fire when the cell is empty.

Returns

ConditionalFormatHighlightRuleBuilder


whenCellNotEmpty()

whenCellNotEmpty(): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:810

Sets the conditional formatting rule to fire when the cell is not empty

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenDate()

whenDate(date): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:820

Highlight when the date is in a time period, custom time is not supported.

Parameters

ParameterType
dateCFTimePeriodOperator

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenFormulaSatisfied()

whenFormulaSatisfied(formulaString): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:829

Sets a conditional formatting rule to fire when a given formula evaluates to true.

Parameters

ParameterTypeDescription
formulaStringstringformulaString start with’ = ‘

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberBetween()

whenNumberBetween(start, end): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:839

Sets the conditional formatting rule to fire when a number is between two specified values or equal to one of them.

Parameters

ParameterType
startnumber
endnumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberEqualTo()

whenNumberEqualTo(value): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:848

Sets the conditional formatting rule to fire when the number equals the given value

Parameters

ParameterType
valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberGreaterThan()

whenNumberGreaterThan(value): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:857

Sets the conditional formatting rule to fire when the number is greater than the given value

Parameters

ParameterType
valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberGreaterThanOrEqualTo()

whenNumberGreaterThanOrEqualTo(value): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:866

Sets a conditional formatting rule to fire when a number is greater than or equal to a given value.

Parameters

ParameterType
valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberLessThan()

whenNumberLessThan(value): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:875

Sets a conditional formatting rule to fire when the number is less than the given value.

Parameters

ParameterType
valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberLessThanOrEqualTo()

whenNumberLessThanOrEqualTo(value): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:884

Sets the conditional formatting rule to fire when the value is less than or equal to the given value.

Parameters

ParameterType
valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberNotBetween()

whenNumberNotBetween(start, end): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:894

Sets a conditional formatting rule to fire when a number is not between two specified values and is not equal to them.

Parameters

ParameterType
startnumber
endnumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenNumberNotEqualTo()

whenNumberNotEqualTo(value): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:903

Sets the conditional formatting rule to fire when a number does not equal a given value.

Parameters

ParameterType
valuenumber

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenTextContains()

whenTextContains(text): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:912

Sets the conditional formatting rule to fire when the input contains the given value.

Parameters

ParameterType
textstring

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenTextDoesNotContain()

whenTextDoesNotContain(text): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:921

Sets a conditional formatting rule to fire when the input does not contain the given value.

Parameters

ParameterType
textstring

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenTextEndsWith()

whenTextEndsWith(text): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:930

Sets a conditional formatting rule to fire when input ends with a specified value.

Parameters

ParameterType
textstring

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenTextEqualTo()

whenTextEqualTo(text): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:939

Sets the conditional formatting rule to fire when the input equals the given value.

Parameters

ParameterType
textstring

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder


whenTextStartsWith()

whenTextStartsWith(text): ConditionalFormatHighlightRuleBuilder

Defined in: sheets-conditional-formatting/src/facade/conditional-formatting-builder.ts:948

Sets the conditional formatting rule to fire when the input value begins with the given value.

Parameters

ParameterType
textstring

Returns

ConditionalFormatHighlightRuleBuilder

Memberof

ConditionalFormatRuleBuilder