@univerjs/sheets-conditional-formatting 0.2.6 → 0.2.8
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.
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +180 -187
- package/lib/types/base/const.d.ts +0 -1
- package/lib/types/commands/mutations/add-conditional-rule.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/delete-conditional-rule.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/formula-mark-dirty.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/move-conditional-rule.mutation.d.ts +0 -1
- package/lib/types/commands/mutations/set-conditional-rule.mutation.d.ts +0 -1
- package/lib/types/models/conditional-formatting-rule-model.d.ts +4 -5
- package/lib/types/models/conditional-formatting-view-model.d.ts +6 -6
- package/lib/types/models/type.d.ts +0 -1
- package/lib/types/plugin.d.ts +0 -1
- package/lib/types/render/data-bar.render.d.ts +2 -1
- package/lib/types/render/icon.render.d.ts +0 -1
- package/lib/types/render/type.d.ts +0 -1
- package/lib/types/services/__test__/test.util.d.ts +0 -1
- package/lib/types/services/calculate-unit/color-scale.d.ts +0 -1
- package/lib/types/services/calculate-unit/data-bar.d.ts +0 -1
- package/lib/types/services/calculate-unit/highlight-cell.d.ts +0 -1
- package/lib/types/services/calculate-unit/icon-set.d.ts +0 -1
- package/lib/types/services/calculate-unit/type.d.ts +0 -1
- package/lib/types/services/calculate-unit/utils.d.ts +0 -1
- package/lib/types/services/conditional-formatting-formula.service.d.ts +0 -1
- package/lib/types/services/conditional-formatting.service.d.ts +0 -1
- package/lib/types/utils/get-string-from-data-stream.d.ts +0 -1
- package/lib/types/utils/is-ranges-equal.d.ts +0 -1
- package/lib/umd/index.js +1 -1
- package/package.json +14 -14
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IAccessor, IMutation } from '@univerjs/core';
|
|
2
2
|
import { IConditionFormattingRule } from '../../models/type';
|
|
3
3
|
import { IDeleteConditionalRuleMutationParams } from './delete-conditional-rule.mutation';
|
|
4
|
-
|
|
5
4
|
export interface IAddConditionalRuleMutationParams {
|
|
6
5
|
unitId: string;
|
|
7
6
|
subUnitId: string;
|
|
@@ -1,21 +1,20 @@
|
|
|
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
|
-
|
|
6
5
|
type RuleOperatorType = 'delete' | 'set' | 'add' | 'sort';
|
|
7
6
|
export declare class ConditionalFormattingRuleModel {
|
|
8
|
-
private _conditionalFormattingViewModel;
|
|
9
7
|
private _injector;
|
|
10
8
|
private _model;
|
|
11
9
|
private _ruleChange$;
|
|
12
|
-
$ruleChange:
|
|
10
|
+
$ruleChange: Observable<{
|
|
13
11
|
rule: IConditionFormattingRule;
|
|
12
|
+
oldRule?: IConditionFormattingRule;
|
|
14
13
|
unitId: string;
|
|
15
14
|
subUnitId: string;
|
|
16
15
|
type: RuleOperatorType;
|
|
17
16
|
}>;
|
|
18
|
-
constructor(
|
|
17
|
+
constructor(_injector: Injector);
|
|
19
18
|
private _ensureList;
|
|
20
19
|
getRule(unitId: string, subUnitId: string, cfId?: string): IConditionFormattingRule<import('./type').IConditionalFormattingRuleConfig> | null | undefined;
|
|
21
20
|
getUnitRules(unitId: string): Map<string, IConditionFormattingRule<import('./type').IConditionalFormattingRuleConfig>[]> | null;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { IDataBarRenderParams } from '../render/type';
|
|
3
3
|
import { IConditionFormattingRule, IHighlightCell } from './type';
|
|
4
|
-
|
|
4
|
+
interface ICacheItem {
|
|
5
|
+
cfId: string;
|
|
6
|
+
ruleCache?: IHighlightCell['style'] | IDataBarRenderParams;
|
|
7
|
+
isDirty: boolean;
|
|
8
|
+
}
|
|
5
9
|
interface ICellItem {
|
|
6
|
-
cfList:
|
|
7
|
-
cfId: string;
|
|
8
|
-
ruleCache?: IHighlightCell['style'] | IDataBarRenderParams;
|
|
9
|
-
isDirty: boolean;
|
|
10
|
-
}[];
|
|
10
|
+
cfList: ICacheItem[];
|
|
11
11
|
}
|
|
12
12
|
export declare class ConditionalFormattingViewModel {
|
|
13
13
|
private _model;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { IRange, IStyleBase } from '@univerjs/core';
|
|
2
2
|
import { CFNumberOperator, CFRuleType, CFSubRuleType, CFTextOperator, CFTimePeriodOperator, CFValueType } from '../base/const';
|
|
3
3
|
import { IIconType } from './icon-map';
|
|
4
|
-
|
|
5
4
|
export interface IBaseCfRule {
|
|
6
5
|
type: string;
|
|
7
6
|
}
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
2
|
import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
|
|
3
|
-
|
|
4
3
|
export declare const dataBarUKey = "sheet-conditional-rule-data-bar";
|
|
4
|
+
export declare const defaultDataBarPositiveColor = "#ffbe38";
|
|
5
|
+
export declare const defaultDataBarNativeColor = "#abd91a";
|
|
5
6
|
export declare class DataBar extends SheetExtension {
|
|
6
7
|
private _paddingRightAndLeft;
|
|
7
8
|
private _paddingTopAndBottom;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IRange, IScale } from '@univerjs/core';
|
|
2
2
|
import { SpreadsheetSkeleton, UniverRenderingContext, SheetExtension } from '@univerjs/engine-render';
|
|
3
|
-
|
|
4
3
|
export declare const IconUKey = "sheet-conditional-rule-icon";
|
|
5
4
|
export declare const DEFAULT_WIDTH = 15;
|
|
6
5
|
export declare const DEFAULT_PADDING = 2;
|
|
@@ -2,7 +2,6 @@ import { Dependency, ICommandService, Univer } from '@univerjs/core';
|
|
|
2
2
|
import { ConditionalFormattingService } from '../conditional-formatting.service';
|
|
3
3
|
import { ConditionalFormattingRuleModel } from '../../models/conditional-formatting-rule-model';
|
|
4
4
|
import { ConditionalFormattingViewModel } from '../../models/conditional-formatting-view-model';
|
|
5
|
-
|
|
6
5
|
export declare const createTestBed: (dependencies?: Dependency[]) => {
|
|
7
6
|
univer: Univer;
|
|
8
7
|
get: {
|
|
@@ -3,7 +3,6 @@ import { IConditionFormattingRule, IValueConfig } from '../../models/type';
|
|
|
3
3
|
import { CFNumberOperator } from '../../base/const';
|
|
4
4
|
import { FormulaResultStatus } from '../conditional-formatting-formula.service';
|
|
5
5
|
import { IContext } from './type';
|
|
6
|
-
|
|
7
6
|
export declare function isFloatsEqual(a: number, b: number): boolean;
|
|
8
7
|
export declare const isNullable: (v: any) => boolean;
|
|
9
8
|
export declare const getCellValue: (cell?: ICellData) => import('@univerjs/core').Nullable<import('@univerjs/core').CellValue>;
|
|
@@ -2,7 +2,6 @@ import { ObjectMatrix, Disposable, ICommandService, Injector, RefAlias } from '@
|
|
|
2
2
|
import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
3
|
import { ConditionalFormattingViewModel } from '../models/conditional-formatting-view-model';
|
|
4
4
|
import { ConditionalFormattingRuleModel } from '../models/conditional-formatting-rule-model';
|
|
5
|
-
|
|
6
5
|
type IFormulaItem = {
|
|
7
6
|
formulaText: string;
|
|
8
7
|
cfId: string;
|
|
@@ -4,7 +4,6 @@ import { ConditionalFormattingRuleModel } from '../models/conditional-formatting
|
|
|
4
4
|
import { ConditionalFormattingViewModel } from '../models/conditional-formatting-view-model';
|
|
5
5
|
import { IHighlightCell } from '../models/type';
|
|
6
6
|
import { IDataBarCellData, IIconSetCellData } from '../render/type';
|
|
7
|
-
|
|
8
7
|
type ComputeStatus = 'computing' | 'end' | 'error';
|
|
9
8
|
export declare class ConditionalFormattingService extends Disposable {
|
|
10
9
|
private _conditionalFormattingRuleModel;
|