@univerjs/sheets-conditional-formatting 0.1.16 → 0.2.0
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/README.md +2 -2
- package/lib/cjs/index.js +1 -1
- package/lib/es/index.js +156 -158
- package/lib/types/index.d.ts +6 -5
- package/lib/types/plugin.d.ts +2 -5
- package/lib/types/services/__test__/test.util.d.ts +6 -6
- package/lib/types/services/calculate-unit/utils.d.ts +1 -4
- package/lib/types/services/conditional-formatting.service.d.ts +3 -2
- package/lib/umd/index.js +1 -1
- package/package.json +15 -15
package/lib/types/index.d.ts
CHANGED
|
@@ -13,12 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
16
|
+
export { UniverSheetsConditionalFormattingPlugin } from './plugin';
|
|
17
17
|
export * from './base/const';
|
|
18
|
-
export * from './commands/mutations/add-conditional-rule.mutation';
|
|
19
|
-
export * from './commands/mutations/delete-conditional-rule.mutation';
|
|
20
|
-
export * from './commands/mutations/move-conditional-rule.mutation';
|
|
21
|
-
export * from './commands/mutations/set-conditional-rule.mutation';
|
|
22
18
|
export * from './models/type';
|
|
23
19
|
export * from './models/conditional-formatting-rule-model';
|
|
24
20
|
export * from './models/conditional-formatting-view-model';
|
|
@@ -36,3 +32,8 @@ export * from './models/icon-map';
|
|
|
36
32
|
export * from './services/conditional-formatting-formula.service';
|
|
37
33
|
export * from './utils/anchor';
|
|
38
34
|
export * from './utils/create-cf-id';
|
|
35
|
+
export { AddConditionalRuleMutationUndoFactory, AddConditionalRuleMutation, type IAddConditionalRuleMutationParams } from './commands/mutations/add-conditional-rule.mutation';
|
|
36
|
+
export { DeleteConditionalRuleMutation, DeleteConditionalRuleMutationUndoFactory, type IDeleteConditionalRuleMutationParams } from './commands/mutations/delete-conditional-rule.mutation';
|
|
37
|
+
export { ConditionalFormattingFormulaMarkDirty } from './commands/mutations/formula-mark-dirty.mutation';
|
|
38
|
+
export { MoveConditionalRuleMutation, MoveConditionalRuleMutationUndoFactory, type IMoveConditionalRuleMutationParams } from './commands/mutations/move-conditional-rule.mutation';
|
|
39
|
+
export { SetConditionalRuleMutation, setConditionalRuleMutationUndoFactory, type ISetConditionalRuleMutationParams } from './commands/mutations/set-conditional-rule.mutation';
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { ICommandService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Injector } from '@wendellhu/redi';
|
|
3
3
|
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class UniverSheetsConditionalFormattingPlugin extends Plugin {
|
|
5
5
|
readonly _injector: Injector;
|
|
6
6
|
private _commandService;
|
|
7
7
|
static pluginName: string;
|
|
8
8
|
static type: UniverInstanceType;
|
|
9
|
-
static readonly dependencyList: Dependency[];
|
|
10
|
-
static readonly mutationList: (import('@univerjs/core').IMutation<import('./commands/mutations/add-conditional-rule.mutation').IAddConditionalRuleMutationParams, boolean> | import('@univerjs/core').IMutation<import('./commands/mutations/delete-conditional-rule.mutation').IDeleteConditionalRuleMutationParams, boolean> | import('@univerjs/core').IMutation<import('./commands/mutations/move-conditional-rule.mutation').IMoveConditionalRuleMutationParams, boolean> | import('@univerjs/core').IMutation<import('./commands/mutations/formula-mark-dirty.mutation').IConditionalFormattingFormulaMarkDirtyParams, boolean>)[];
|
|
11
9
|
constructor(_config: unknown, _injector: Injector, _commandService: ICommandService);
|
|
12
10
|
onStarting(): void;
|
|
13
|
-
_initCommand(): void;
|
|
14
11
|
}
|
|
@@ -7,12 +7,12 @@ import { ConditionalFormattingViewModel } from '../../models/conditional-formatt
|
|
|
7
7
|
export declare const createTestBed: (dependencies?: Dependency[]) => {
|
|
8
8
|
univer: Univer;
|
|
9
9
|
get: {
|
|
10
|
-
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp
|
|
11
|
-
<
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
<
|
|
10
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
11
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp): T[];
|
|
12
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp): T | null;
|
|
13
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp): T;
|
|
14
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantity?: import('@wendellhu/redi').Quantity, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
15
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp, lookUp?: import('@wendellhu/redi').LookUp): T[] | T | null;
|
|
16
16
|
};
|
|
17
17
|
workbook: import('@univerjs/core').Workbook;
|
|
18
18
|
unitId: string;
|
|
@@ -21,10 +21,7 @@ export declare const getValueByType: (value: IValueConfig, matrix: ObjectMatrix<
|
|
|
21
21
|
export declare const getCacheStyleMatrix: <S = any>(unitId: string, subUnitId: string, rule: IConditionFormattingRule, context: IContext) => ObjectMatrix<S>;
|
|
22
22
|
export declare const compareWithNumber: (config: {
|
|
23
23
|
operator: CFNumberOperator;
|
|
24
|
-
value: number | [
|
|
25
|
-
number,
|
|
26
|
-
number
|
|
27
|
-
];
|
|
24
|
+
value: number | [number, number];
|
|
28
25
|
}, v: number) => boolean | undefined;
|
|
29
26
|
export declare const getOppositeOperator: (operator: CFNumberOperator) => CFNumberOperator;
|
|
30
27
|
export declare const getColorScaleFromValue: (colorList: {
|
|
@@ -3,6 +3,7 @@ import { SheetInterceptorService } from '@univerjs/sheets';
|
|
|
3
3
|
import { Injector } from '@wendellhu/redi';
|
|
4
4
|
import { ConditionalFormattingRuleModel } from '../models/conditional-formatting-rule-model';
|
|
5
5
|
import { ConditionalFormattingViewModel } from '../models/conditional-formatting-view-model';
|
|
6
|
+
import { IHighlightCell } from '../models/type';
|
|
6
7
|
import { IDataBarCellData, IIconSetCellData } from '../render/type';
|
|
7
8
|
|
|
8
9
|
type ComputeStatus = 'computing' | 'end' | 'error';
|
|
@@ -19,7 +20,7 @@ export declare class ConditionalFormattingService extends Disposable {
|
|
|
19
20
|
private _ruleComputeStatus$;
|
|
20
21
|
ruleComputeStatus$: import('rxjs').Observable<{
|
|
21
22
|
status: ComputeStatus;
|
|
22
|
-
result?: ObjectMatrix<any
|
|
23
|
+
result?: ObjectMatrix<any>;
|
|
23
24
|
unitId: string;
|
|
24
25
|
subUnitId: string;
|
|
25
26
|
cfId: string;
|
|
@@ -34,7 +35,7 @@ export declare class ConditionalFormattingService extends Disposable {
|
|
|
34
35
|
private _calculationUnitMap;
|
|
35
36
|
constructor(_conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _injector: Injector, _conditionalFormattingViewModel: ConditionalFormattingViewModel, _univerInstanceService: IUniverInstanceService, _resourceManagerService: IResourceManagerService, _sheetInterceptorService: SheetInterceptorService, _commandService: ICommandService);
|
|
36
37
|
composeStyle(unitId: string, subUnitId: string, row: number, col: number): ({
|
|
37
|
-
style?:
|
|
38
|
+
style?: IHighlightCell["style"];
|
|
38
39
|
} & IDataBarCellData & IIconSetCellData & {
|
|
39
40
|
isShowValue: boolean;
|
|
40
41
|
}) | null;
|