API Reference
@univerjs
@univerjs/sheets-conditional-formatting
classes
Conditionalformattingrulemodel

@univerjs/sheets-conditional-formatting v0.4.2Docs


Class: ConditionalFormattingRuleModel

Constructors

new ConditionalFormattingRuleModel()

new ConditionalFormattingRuleModel(_injector): ConditionalFormattingRuleModel

Parameters

ParameterType
_injectorInjector

Returns

ConditionalFormattingRuleModel

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:104 (opens in a new tab)

Properties

PropertyTypeDefined in
$ruleChangeObservable<{ oldRule: IConditionFormattingRule<IConditionalFormattingRuleConfig>; rule: IConditionFormattingRule<IConditionalFormattingRuleConfig>; subUnitId: string; type: RuleOperatorType; unitId: string; }>sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:32 (opens in a new tab)

Methods

addRule()

addRule(
   unitId, 
   subUnitId, 
   rule): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIConditionFormattingRule<IConditionalFormattingRuleConfig>

Returns

void

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:164 (opens in a new tab)


createCfId()

createCfId(_unitId, _subUnitId): string

Parameters

ParameterType
_unitIdstring
_subUnitIdstring

Returns

string

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:192 (opens in a new tab)


deleteRule()

deleteRule(
   unitId, 
   subUnitId, 
   cfId): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
cfIdstring

Returns

void

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:142 (opens in a new tab)


deleteUnitId()

deleteUnitId(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:196 (opens in a new tab)


getRule()

getRule(
   unitId, 
   subUnitId, 
cfId?): undefined | null | IConditionFormattingRule<IConditionalFormattingRuleConfig>

Parameters

ParameterType
unitIdstring
subUnitIdstring
cfId?string

Returns

undefined | null | IConditionFormattingRule<IConditionalFormattingRuleConfig>

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:124 (opens in a new tab)


getSubunitRules()

getSubunitRules(unitId, subUnitId): null | IConditionFormattingRule<IConditionalFormattingRuleConfig>[]

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

null | IConditionFormattingRule<IConditionalFormattingRuleConfig>[]

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:137 (opens in a new tab)


getUnitRules()

getUnitRules(unitId): null | Map<string, IConditionFormattingRule<IConditionalFormattingRuleConfig>[]>

Parameters

ParameterType
unitIdstring

Returns

null | Map<string, IConditionFormattingRule<IConditionalFormattingRuleConfig>[]>

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:132 (opens in a new tab)


moveRulePriority()

moveRulePriority(
   unitId, 
   subUnitId, 
   start, 
   end): void

example [1,2,3,4,5,6],if you move behind 5 to 2, then cfId=5,targetId=2. if targetId does not exist, it defaults to top

Parameters

ParameterType
unitIdstring
subUnitIdstring
startIAnchor
endIAnchor

Returns

void

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:178 (opens in a new tab)


setRule()

setRule(
   unitId, 
   subUnitId, 
   rule, 
   oldCfId): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIConditionFormattingRule<IConditionalFormattingRuleConfig>
oldCfIdstring

Returns

void

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:154 (opens in a new tab)


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