@univerjs/sheets-conditional-formatting 0.25.0 → 1.0.0-alpha.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/lib/cjs/facade.js +4 -4
- package/lib/cjs/index.js +263 -166
- package/lib/cjs/locale/ar-SA.js +11 -0
- package/lib/cjs/locale/ca-ES.js +11 -0
- package/lib/cjs/locale/de-DE.js +11 -0
- package/lib/cjs/locale/en-US.js +26 -0
- package/lib/cjs/locale/es-ES.js +11 -0
- package/lib/cjs/locale/fa-IR.js +11 -0
- package/lib/cjs/locale/fr-FR.js +11 -0
- package/lib/cjs/locale/id-ID.js +11 -0
- package/lib/cjs/locale/it-IT.js +11 -0
- package/lib/cjs/locale/ja-JP.js +11 -0
- package/lib/cjs/locale/ko-KR.js +11 -0
- package/lib/cjs/locale/pl-PL.js +11 -0
- package/lib/cjs/locale/pt-BR.js +11 -0
- package/lib/cjs/locale/ru-RU.js +11 -0
- package/lib/cjs/locale/sk-SK.js +11 -0
- package/lib/cjs/locale/vi-VN.js +11 -0
- package/lib/cjs/locale/zh-CN.js +11 -0
- package/lib/cjs/locale/zh-HK.js +11 -0
- package/lib/cjs/locale/zh-TW.js +11 -0
- package/lib/es/facade.js +4 -4
- package/lib/es/index.js +252 -168
- package/lib/es/locale/ar-SA.js +10 -0
- package/lib/es/locale/ca-ES.js +10 -0
- package/lib/es/locale/de-DE.js +10 -0
- package/lib/es/locale/en-US.js +25 -0
- package/lib/es/locale/es-ES.js +10 -0
- package/lib/es/locale/fa-IR.js +10 -0
- package/lib/es/locale/fr-FR.js +10 -0
- package/lib/es/locale/id-ID.js +10 -0
- package/lib/es/locale/it-IT.js +10 -0
- package/lib/es/locale/ja-JP.js +10 -0
- package/lib/es/locale/ko-KR.js +10 -0
- package/lib/es/locale/pl-PL.js +10 -0
- package/lib/es/locale/pt-BR.js +10 -0
- package/lib/es/locale/ru-RU.js +10 -0
- package/lib/es/locale/sk-SK.js +10 -0
- package/lib/es/locale/vi-VN.js +10 -0
- package/lib/es/locale/zh-CN.js +10 -0
- package/lib/es/locale/zh-HK.js +10 -0
- package/lib/es/locale/zh-TW.js +10 -0
- package/lib/facade.js +4 -4
- package/lib/index.js +252 -168
- package/lib/locale/ar-SA.js +10 -0
- package/lib/locale/ca-ES.js +10 -0
- package/lib/locale/de-DE.js +10 -0
- package/lib/locale/en-US.js +25 -0
- package/lib/locale/es-ES.js +10 -0
- package/lib/locale/fa-IR.js +10 -0
- package/lib/locale/fr-FR.js +10 -0
- package/lib/locale/id-ID.js +10 -0
- package/lib/locale/it-IT.js +10 -0
- package/lib/locale/ja-JP.js +10 -0
- package/lib/locale/ko-KR.js +10 -0
- package/lib/locale/pl-PL.js +10 -0
- package/lib/locale/pt-BR.js +10 -0
- package/lib/locale/ru-RU.js +10 -0
- package/lib/locale/sk-SK.js +10 -0
- package/lib/locale/vi-VN.js +10 -0
- package/lib/locale/zh-CN.js +10 -0
- package/lib/locale/zh-HK.js +10 -0
- package/lib/locale/zh-TW.js +10 -0
- package/lib/types/index.d.ts +23 -11
- package/lib/types/{utils/is-ranges-equal.d.ts → locale/ar-SA.d.ts} +3 -1
- package/lib/types/locale/ca-ES.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +26 -0
- package/lib/types/locale/es-ES.d.ts +18 -0
- package/lib/types/locale/fa-IR.d.ts +18 -0
- package/lib/types/locale/fr-FR.d.ts +18 -0
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/ja-JP.d.ts +18 -0
- package/lib/types/locale/ko-KR.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/ru-RU.d.ts +18 -0
- package/lib/types/locale/sk-SK.d.ts +18 -0
- package/lib/types/locale/types.d.ts +18 -0
- package/lib/types/locale/vi-VN.d.ts +18 -0
- package/lib/types/locale/zh-CN.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/types/locale/zh-TW.d.ts +18 -0
- package/lib/types/models/conditional-formatting-range-index-model.d.ts +32 -0
- package/lib/types/models/conditional-formatting-view-model.d.ts +3 -2
- package/lib/types/services/conditional-formatting-range-transform.service.d.ts +27 -0
- package/lib/types/services/conditional-formatting-style-composer.service.d.ts +31 -0
- package/lib/types/services/conditional-formatting.service.d.ts +7 -7
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -0
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/es-ES.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/fr-FR.js +1 -0
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -0
- package/lib/umd/locale/ko-KR.js +1 -0
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/sk-SK.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +14 -9
- package/lib/types/models/calculate-unit-v2/__test__/test.util.d.ts +0 -38
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IRange } from '@univerjs/core';
|
|
17
|
+
import { Disposable } from '@univerjs/core';
|
|
18
|
+
import { ConditionalFormattingRuleModel } from './conditional-formatting-rule-model';
|
|
19
|
+
export declare class ConditionalFormattingRangeIndexModel extends Disposable {
|
|
20
|
+
private _conditionalFormattingRuleModel;
|
|
21
|
+
private _rTreeManager;
|
|
22
|
+
constructor(_conditionalFormattingRuleModel: ConditionalFormattingRuleModel);
|
|
23
|
+
getRuleIdsByCell(unitId: string, subUnitId: string, row: number, col: number): Set<string>;
|
|
24
|
+
getRuleIdsByRanges(unitId: string, subUnitId: string, ranges: IRange[]): Set<string>;
|
|
25
|
+
getRulesByRanges(unitId: string, subUnitId: string, ranges: IRange[]): import("./type").IConditionFormattingRule<import("./type").IConditionalFormattingRuleConfig>[];
|
|
26
|
+
dispose(): void;
|
|
27
|
+
clear(): void;
|
|
28
|
+
rebuild(): void;
|
|
29
|
+
private _initRuleListener;
|
|
30
|
+
private _insert;
|
|
31
|
+
private _remove;
|
|
32
|
+
}
|
|
@@ -15,15 +15,16 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import { Disposable, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
17
17
|
import { ConditionalFormattingFormulaService } from '../services/conditional-formatting-formula.service';
|
|
18
|
+
import { ConditionalFormattingRangeIndexModel } from './conditional-formatting-range-index-model';
|
|
18
19
|
import { ConditionalFormattingRuleModel } from './conditional-formatting-rule-model';
|
|
19
20
|
export declare const CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH: number;
|
|
20
21
|
export declare class ConditionalFormattingViewModel extends Disposable {
|
|
21
22
|
private _injector;
|
|
22
23
|
private _conditionalFormattingRuleModel;
|
|
24
|
+
private _conditionalFormattingRangeIndexModel;
|
|
23
25
|
private _conditionalFormattingFormulaService;
|
|
24
26
|
private _univerInstanceService;
|
|
25
27
|
private _calculateUnitManagers;
|
|
26
|
-
private _rTreeManager;
|
|
27
28
|
/**
|
|
28
29
|
* 1nd-level cache
|
|
29
30
|
*/
|
|
@@ -39,7 +40,7 @@ export declare class ConditionalFormattingViewModel extends Disposable {
|
|
|
39
40
|
subUnitId: string;
|
|
40
41
|
isImmediately?: boolean;
|
|
41
42
|
}>;
|
|
42
|
-
constructor(_injector: Injector, _conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _conditionalFormattingFormulaService: ConditionalFormattingFormulaService, _univerInstanceService: IUniverInstanceService);
|
|
43
|
+
constructor(_injector: Injector, _conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _conditionalFormattingRangeIndexModel: ConditionalFormattingRangeIndexModel, _conditionalFormattingFormulaService: ConditionalFormattingFormulaService, _univerInstanceService: IUniverInstanceService);
|
|
43
44
|
private _initCFFormulaListener;
|
|
44
45
|
getCellCfs(unitId: string, subUnitId: string, row: number, col: number): {
|
|
45
46
|
cfId: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IRange } from '@univerjs/core';
|
|
17
|
+
export interface IRangeAnchor {
|
|
18
|
+
row: number;
|
|
19
|
+
col: number;
|
|
20
|
+
}
|
|
21
|
+
export declare class ConditionalFormattingRangeTransformService {
|
|
22
|
+
subtractRanges(sourceRanges: IRange[], rangesToSubtract: IRange[]): IRange[];
|
|
23
|
+
addRanges(sourceRanges: IRange[], rangesToAdd: IRange[]): IRange[];
|
|
24
|
+
applyRangeDelta(sourceRanges: IRange[], rangesToSubtract: IRange[], rangesToAdd: IRange[]): IRange[];
|
|
25
|
+
copyIntersectingRanges(sourceRanges: IRange[], sourceRange: IRange, targetAnchor: IRangeAnchor): IRange[];
|
|
26
|
+
translateRange(range: IRange, offset: IRangeAnchor): IRange;
|
|
27
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IHighlightCell } from '../models/type';
|
|
17
|
+
import type { IDataBarCellData, IIconSetCellData } from '../render/type';
|
|
18
|
+
import { ConditionalFormattingRuleModel } from '../models/conditional-formatting-rule-model';
|
|
19
|
+
import { ConditionalFormattingViewModel } from '../models/conditional-formatting-view-model';
|
|
20
|
+
export declare class ConditionalFormattingStyleComposer {
|
|
21
|
+
private _conditionalFormattingRuleModel;
|
|
22
|
+
private _conditionalFormattingViewModel;
|
|
23
|
+
constructor(_conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _conditionalFormattingViewModel: ConditionalFormattingViewModel);
|
|
24
|
+
composeStyle(unitId: string, subUnitId: string, row: number, col: number): ({
|
|
25
|
+
style?: IHighlightCell["style"];
|
|
26
|
+
} & IDataBarCellData & IIconSetCellData & {
|
|
27
|
+
isShowValue: boolean;
|
|
28
|
+
}) | null;
|
|
29
|
+
private _mergeComposeResult;
|
|
30
|
+
private _isRuleMatched;
|
|
31
|
+
}
|
|
@@ -13,28 +13,28 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IHighlightCell } from '../models/type';
|
|
17
|
-
import type { IDataBarCellData, IIconSetCellData } from '../render/type';
|
|
18
16
|
import { Disposable, ICommandService, Injector, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
19
17
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
18
|
+
import { ConditionalFormattingRangeIndexModel } from '../models/conditional-formatting-range-index-model';
|
|
20
19
|
import { ConditionalFormattingRuleModel } from '../models/conditional-formatting-rule-model';
|
|
21
20
|
import { ConditionalFormattingViewModel } from '../models/conditional-formatting-view-model';
|
|
21
|
+
import { ConditionalFormattingStyleComposer } from './conditional-formatting-style-composer.service';
|
|
22
22
|
export declare class ConditionalFormattingService extends Disposable {
|
|
23
23
|
private _conditionalFormattingRuleModel;
|
|
24
|
+
private _conditionalFormattingRangeIndexModel;
|
|
25
|
+
private _conditionalFormattingStyleComposer;
|
|
24
26
|
private _injector;
|
|
25
27
|
private _univerInstanceService;
|
|
26
28
|
private _resourceManagerService;
|
|
27
29
|
private _sheetInterceptorService;
|
|
28
30
|
private _commandService;
|
|
29
31
|
get _conditionalFormattingViewModelV2(): ConditionalFormattingViewModel;
|
|
30
|
-
|
|
31
|
-
constructor(_conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _injector: Injector, _univerInstanceService: IUniverInstanceService, _resourceManagerService: IResourceManagerService, _sheetInterceptorService: SheetInterceptorService, _commandService: ICommandService);
|
|
32
|
+
constructor(_conditionalFormattingRuleModel: ConditionalFormattingRuleModel, _conditionalFormattingRangeIndexModel: ConditionalFormattingRangeIndexModel, _conditionalFormattingStyleComposer: ConditionalFormattingStyleComposer, _injector: Injector, _univerInstanceService: IUniverInstanceService, _resourceManagerService: IResourceManagerService, _sheetInterceptorService: SheetInterceptorService, _commandService: ICommandService);
|
|
32
33
|
composeStyle(unitId: string, subUnitId: string, row: number, col: number): ({
|
|
33
|
-
style?: IHighlightCell["style"];
|
|
34
|
-
} & IDataBarCellData & IIconSetCellData & {
|
|
34
|
+
style?: import("..").IHighlightCell["style"];
|
|
35
|
+
} & import("..").IDataBarCellData & import("..").IIconSetCellData & {
|
|
35
36
|
isShowValue: boolean;
|
|
36
37
|
}) | null;
|
|
37
|
-
private _isRuleMatched;
|
|
38
38
|
private _initSnapshot;
|
|
39
39
|
private _initSheetChange;
|
|
40
40
|
private _initCellChange;
|