@univerjs/sheets-conditional-formatting 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -62,5 +62,5 @@ export declare enum CFValueType {
62
62
  export declare const DEFAULT_BG_COLOR = "#fff";
63
63
  export declare const DEFAULT_FONT_COLOR = "#000000";
64
64
  export declare const createDefaultRule: () => IConditionFormattingRule<import('../models/type').IConditionalFormattingRuleConfig>;
65
- export declare const createDefaultValue: (subType: CFSubRuleType, operator: CFTextOperator | CFNumberOperator | CFTimePeriodOperator) => "" | 10 | [number, number];
65
+ export declare const createDefaultValue: (subType: CFSubRuleType, operator: CFTextOperator | CFNumberOperator | CFTimePeriodOperator) => 10 | "" | [number, number];
66
66
  export declare const createDefaultValueByValueType: (type: CFValueType, defaultValue?: number) => number | "" | "=";
@@ -1,21 +1,21 @@
1
1
  import { Injector } from '@univerjs/core';
2
+ import { Observable } from 'rxjs';
2
3
  import { IAnchor } from '../utils/anchor';
3
4
  import { IConditionFormattingRule } from './type';
4
- import { ConditionalFormattingViewModel } from './conditional-formatting-view-model';
5
5
 
6
6
  type RuleOperatorType = 'delete' | 'set' | 'add' | 'sort';
7
7
  export declare class ConditionalFormattingRuleModel {
8
- private _conditionalFormattingViewModel;
9
8
  private _injector;
10
9
  private _model;
11
10
  private _ruleChange$;
12
- $ruleChange: import('rxjs').Observable<{
11
+ $ruleChange: Observable<{
13
12
  rule: IConditionFormattingRule;
13
+ oldRule?: IConditionFormattingRule;
14
14
  unitId: string;
15
15
  subUnitId: string;
16
16
  type: RuleOperatorType;
17
17
  }>;
18
- constructor(_conditionalFormattingViewModel: ConditionalFormattingViewModel, _injector: Injector);
18
+ constructor(_injector: Injector);
19
19
  private _ensureList;
20
20
  getRule(unitId: string, subUnitId: string, cfId?: string): IConditionFormattingRule<import('./type').IConditionalFormattingRuleConfig> | null | undefined;
21
21
  getUnitRules(unitId: string): Map<string, IConditionFormattingRule<import('./type').IConditionalFormattingRuleConfig>[]> | null;
@@ -2,12 +2,13 @@ import { ObjectMatrix } from '@univerjs/core';
2
2
  import { IDataBarRenderParams } from '../render/type';
3
3
  import { IConditionFormattingRule, IHighlightCell } from './type';
4
4
 
5
+ interface ICacheItem {
6
+ cfId: string;
7
+ ruleCache?: IHighlightCell['style'] | IDataBarRenderParams;
8
+ isDirty: boolean;
9
+ }
5
10
  interface ICellItem {
6
- cfList: {
7
- cfId: string;
8
- ruleCache?: IHighlightCell['style'] | IDataBarRenderParams;
9
- isDirty: boolean;
10
- }[];
11
+ cfList: ICacheItem[];
11
12
  }
12
13
  export declare class ConditionalFormattingViewModel {
13
14
  private _model;
@@ -2,6 +2,8 @@ import { IRange, IScale } from '@univerjs/core';
2
2
  import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
3
3
 
4
4
  export declare const dataBarUKey = "sheet-conditional-rule-data-bar";
5
+ export declare const defaultDataBarPositiveColor = "#ffbe38";
6
+ export declare const defaultDataBarNativeColor = "#abd91a";
5
7
  export declare class DataBar extends SheetExtension {
6
8
  private _paddingRightAndLeft;
7
9
  private _paddingTopAndBottom;