@univerjs/sheets-formula 1.0.0-alpha.3 → 1.0.0-alpha.5
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 +198 -178
- package/lib/es/index.js +194 -181
- package/lib/index.js +194 -181
- package/lib/types/config/config.d.ts +0 -4
- package/lib/types/controllers/array-formula-cell-interceptor.controller.d.ts +3 -12
- package/lib/types/controllers/trigger-calculation.controller.d.ts +2 -2
- package/lib/types/controllers/unit-qualifier-rename.controller.d.ts +35 -0
- package/lib/types/controllers/utils/ref-range-formula.d.ts +9 -6
- package/lib/types/index.d.ts +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,35 @@
|
|
|
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 { ICellData, Workbook } from '@univerjs/core';
|
|
17
|
+
import { Disposable, ICommandService, IUndoRedoService, IUniverInstanceService } from '@univerjs/core';
|
|
18
|
+
import { IDefinedNamesService } from '@univerjs/engine-formula';
|
|
19
|
+
export interface IUnitQualifierFormulaPatch {
|
|
20
|
+
unitId: string;
|
|
21
|
+
subUnitId: string;
|
|
22
|
+
cellValue: Record<number, Record<number, ICellData>>;
|
|
23
|
+
}
|
|
24
|
+
export declare function collectUnitQualifierFormulaPatches(workbook: Workbook, oldName: string, newName: string): IUnitQualifierFormulaPatch[];
|
|
25
|
+
/** Keeps persisted Sheet formulas and defined names aligned when a Base Unit is renamed. */
|
|
26
|
+
export declare class UnitQualifierRenameController extends Disposable {
|
|
27
|
+
private readonly _commandService;
|
|
28
|
+
private readonly _undoRedoService;
|
|
29
|
+
private readonly _univerInstanceService;
|
|
30
|
+
private readonly _definedNamesService;
|
|
31
|
+
private readonly _names;
|
|
32
|
+
constructor(_commandService: ICommandService, _undoRedoService: IUndoRedoService, _univerInstanceService: IUniverInstanceService, _definedNamesService: IDefinedNamesService);
|
|
33
|
+
private _watch;
|
|
34
|
+
private _refactor;
|
|
35
|
+
}
|
|
@@ -28,12 +28,13 @@ export declare enum FormulaReferenceMoveType {
|
|
|
28
28
|
InsertMoveDown = 9,// range
|
|
29
29
|
InsertMoveRight = 10,// range
|
|
30
30
|
SetName = 11,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
SetUnitName = 12,
|
|
32
|
+
RemoveSheet = 13,
|
|
33
|
+
SetDefinedName = 14,// update defined name
|
|
34
|
+
RemoveDefinedName = 15,// remove defined name
|
|
35
|
+
SetSuperTableName = 16,// update super table name
|
|
36
|
+
RemoveSuperTableName = 17,// remove super table name
|
|
37
|
+
RemoveSuperTableColumn = 18
|
|
37
38
|
}
|
|
38
39
|
export interface IFormulaReferenceMoveParam {
|
|
39
40
|
type: FormulaReferenceMoveType;
|
|
@@ -46,6 +47,8 @@ export interface IFormulaReferenceMoveParam {
|
|
|
46
47
|
from?: IRange;
|
|
47
48
|
to?: IRange;
|
|
48
49
|
sheetName?: string;
|
|
50
|
+
oldUnitName?: string;
|
|
51
|
+
unitName?: string;
|
|
49
52
|
/**
|
|
50
53
|
* defined name id
|
|
51
54
|
*/
|
package/lib/types/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ export { FormulaAutoFillController } from './controllers/formula-auto-fill.contr
|
|
|
22
22
|
export { FormulaCalculationSessionController } from './controllers/formula-calculation-session.controller';
|
|
23
23
|
export { ImageFormulaCellInterceptorController } from './controllers/image-formula-cell-interceptor.controller';
|
|
24
24
|
export { TriggerCalculationController } from './controllers/trigger-calculation.controller';
|
|
25
|
+
export { collectUnitQualifierFormulaPatches, UnitQualifierRenameController } from './controllers/unit-qualifier-rename.controller';
|
|
25
26
|
export { UpdateDefinedNameController } from './controllers/update-defined-name.controller';
|
|
26
27
|
export { UpdateFormulaController } from './controllers/update-formula.controller';
|
|
27
28
|
export { UniverRemoteSheetsFormulaPlugin, UniverSheetsFormulaPlugin } from './plugin';
|