@univerjs/sheets-conditional-formatting v0.5.4


Class: ConditionalFormattingRuleModel

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:27

Constructors

new ConditionalFormattingRuleModel()

new ConditionalFormattingRuleModel(): ConditionalFormattingRuleModel

Returns

ConditionalFormattingRuleModel

Properties

PropertyModifierTypeDefined in
$ruleChangepublicObservable<{ oldRule: IConditionFormattingRule; rule: IConditionFormattingRule; subUnitId: string; type: RuleOperatorType; unitId: string; }>sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:31

Methods

addRule()

addRule(
   unitId, 
   subUnitId, 
   rule): void

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:87

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIConditionFormattingRule

Returns

void


createCfId()

createCfId(_unitId, _subUnitId): string

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:115

Parameters

ParameterType
_unitIdstring
_subUnitIdstring

Returns

string


deleteRule()

deleteRule(
   unitId, 
   subUnitId, 
   cfId): void

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:65

Parameters

ParameterType
unitIdstring
subUnitIdstring
cfIdstring

Returns

void


deleteUnitId()

deleteUnitId(unitId): void

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:119

Parameters

ParameterType
unitIdstring

Returns

void


getRule()

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

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:47

Parameters

ParameterType
unitIdstring
subUnitIdstring
cfId?string

Returns

| undefined | null | IConditionFormattingRule


getSubunitRules()

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

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:60

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

| null | IConditionFormattingRule[]


getUnitRules()

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

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:55

Parameters

ParameterType
unitIdstring

Returns

| null | Map<string, IConditionFormattingRule[]>


moveRulePriority()

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

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:101

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


setRule()

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

Defined in: sheets-conditional-formatting/src/models/conditional-formatting-rule-model.ts:77

Parameters

ParameterType
unitIdstring
subUnitIdstring
ruleIConditionFormattingRule
oldCfIdstring

Returns

void