@univerjssheets-conditional-formattingclassesConditionalformattingrulemodel

@univerjs/sheets-conditional-formatting v0.5.0-beta.1Docs


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

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

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


createCfId()

createCfId(_unitId, _subUnitId): string

Parameters

ParameterType
_unitIdstring
_subUnitIdstring

Returns

string

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:192


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


deleteUnitId()

deleteUnitId(unitId): void

Parameters

ParameterType
unitIdstring

Returns

void

Defined in

sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:196


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


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


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


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


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