@univerjs/sheets 0.1.5 → 0.1.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.
- package/lib/cjs/index.js +2 -2
- package/lib/es/index.js +3032 -2516
- package/lib/types/commands/commands/insert-defined-name.command.d.ts +6 -0
- package/lib/types/commands/commands/remove-defined-name.command.d.ts +6 -0
- package/lib/types/commands/commands/remove-row-col.command.d.ts +1 -1
- package/lib/types/commands/commands/set-defined-name.command.d.ts +12 -0
- package/lib/types/commands/commands/set-style.command.d.ts +2 -2
- package/lib/types/commands/mutations/__tests__/set-range-values.mutation.spec.d.ts +16 -0
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +16 -1
- package/lib/types/commands/operations/scroll-to-cell.operation.d.ts +3 -0
- package/lib/types/commands/utils/handle-merge-operation.d.ts +1 -1
- package/lib/types/controllers/defined-name-data.controller.d.ts +12 -0
- package/lib/types/controllers/merge-cell.controller.d.ts +16 -1
- package/lib/types/index.d.ts +6 -2
- package/lib/types/services/ref-range/__tests__/ref-range.service.spec.d.ts +14 -0
- package/lib/types/services/ref-range/__tests__/utils.spec.d.ts +16 -0
- package/lib/types/services/ref-range/__tests__/watch-range.spec.d.ts +16 -0
- package/lib/types/services/ref-range/ref-range.service.d.ts +8 -2
- package/lib/types/services/ref-range/util.d.ts +23 -1
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +3 -3
- package/lib/umd/index.js +2 -2
- package/package.json +10 -11
- /package/lib/types/{services/ref-range/__tests__/util.spec.d.ts → commands/commands/__tests__/remove-rows-cols.command.spec.d.ts} +0 -0
- /package/lib/types/services/ref-range/__tests__/{util.d.ts → __testing__.d.ts} +0 -0
|
@@ -7,7 +7,7 @@ export declare const RemoveRowCommandId = "sheet.command.remove-row";
|
|
|
7
7
|
/**
|
|
8
8
|
* This command would remove the selected rows. These selected rows can be non-continuous.
|
|
9
9
|
*/
|
|
10
|
-
export declare const RemoveRowCommand: ICommand
|
|
10
|
+
export declare const RemoveRowCommand: ICommand<IRemoveRowColCommandParams>;
|
|
11
11
|
export declare const RemoveColCommandId = "sheet.command.remove-col";
|
|
12
12
|
/**
|
|
13
13
|
* This command would remove the selected columns. These selected rows can be non-continuous.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ISetDefinedNameMutationParam } from '@univerjs/engine-formula';
|
|
2
|
+
import { ICommand } from '@univerjs/core';
|
|
3
|
+
|
|
4
|
+
export interface ISetDefinedNameCommandParams {
|
|
5
|
+
unitId: string;
|
|
6
|
+
oldDefinedName: ISetDefinedNameMutationParam;
|
|
7
|
+
newDefinedName: ISetDefinedNameMutationParam;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The command to update defined name
|
|
11
|
+
*/
|
|
12
|
+
export declare const SetDefinedNameCommand: ICommand;
|
|
@@ -54,11 +54,11 @@ export declare const SetTextColorCommand: ICommand<ISetColorCommandParams>;
|
|
|
54
54
|
export declare const ResetTextColorCommand: ICommand;
|
|
55
55
|
export declare const SetBackgroundColorCommand: ICommand<ISetColorCommandParams>;
|
|
56
56
|
export declare const ResetBackgroundColorCommand: ICommand;
|
|
57
|
-
export interface ISetVerticalTextAlignCommandParams {
|
|
57
|
+
export interface ISetVerticalTextAlignCommandParams extends ISetStyleCommonParams {
|
|
58
58
|
value: VerticalAlign;
|
|
59
59
|
}
|
|
60
60
|
export declare const SetVerticalTextAlignCommand: ICommand<ISetVerticalTextAlignCommandParams>;
|
|
61
|
-
export interface ISetHorizontalTextAlignCommandParams {
|
|
61
|
+
export interface ISetHorizontalTextAlignCommandParams extends ISetStyleCommonParams {
|
|
62
62
|
value: HorizontalAlign;
|
|
63
63
|
}
|
|
64
64
|
export declare const SetHorizontalTextAlignCommand: ICommand<ISetHorizontalTextAlignCommandParams>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IAccessor } from '@wendellhu/redi';
|
|
2
|
-
import { IBorderData, ICellData, ICopyToOptionsData, IDocumentData, IMutation, IMutationCommonParams, IObjectMatrixPrimitiveType, IRange, IStyleData, Nullable } from '@univerjs/core';
|
|
2
|
+
import { CellValue, IBorderData, ICellData, ICopyToOptionsData, IDocumentData, IMutation, IMutationCommonParams, IObjectMatrixPrimitiveType, IRange, IStyleData, Nullable, CellValueType } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
/** Params of `SetRangeValuesMutation` */
|
|
5
5
|
export interface ISetRangeValuesMutationParams extends IMutationCommonParams {
|
|
@@ -31,6 +31,21 @@ export declare const SetRangeValuesUndoMutationFactory: (accessor: IAccessor, pa
|
|
|
31
31
|
Intercept 15-digit number reference function truncateNumber
|
|
32
32
|
*/
|
|
33
33
|
export declare const SetRangeValuesMutation: IMutation<ISetRangeValuesMutationParams, boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Get the correct type after setting values to a cell.
|
|
36
|
+
*
|
|
37
|
+
* @param v the new value
|
|
38
|
+
* @param oldType the old type
|
|
39
|
+
* @returns the new type
|
|
40
|
+
*/
|
|
41
|
+
export declare function checkCellValueType(v: Nullable<CellValue>, oldType: Nullable<CellValueType>): Nullable<CellValueType>;
|
|
42
|
+
/**
|
|
43
|
+
* Check if the value can be casted to a boolean.
|
|
44
|
+
* @internal
|
|
45
|
+
* @param value
|
|
46
|
+
* @returns It would return null if the value cannot be casted to a boolean, and would return the boolean value if it can be casted.
|
|
47
|
+
*/
|
|
48
|
+
export declare function extractBooleanValue(value: Nullable<string | number | boolean>): Nullable<boolean>;
|
|
34
49
|
/**
|
|
35
50
|
* Convert old style data for storage
|
|
36
51
|
* @param style
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISetSelectionsOperationParams } from '
|
|
1
|
+
import { ISetSelectionsOperationParams } from '../operations/selection.operation';
|
|
2
2
|
import { IAddMergeCommandParams } from '../commands/add-worksheet-merge.command';
|
|
3
3
|
import { IRange } from '@univerjs/core';
|
|
4
4
|
import { IAccessor } from '@wendellhu/redi';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IDefinedNamesService } from '@univerjs/engine-formula';
|
|
2
|
+
import { Disposable, ICommandService, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
3
|
+
|
|
4
|
+
export declare class DefinedNameDataController extends Disposable {
|
|
5
|
+
private readonly _commandService;
|
|
6
|
+
private readonly _univerInstanceService;
|
|
7
|
+
private readonly _definedNamesService;
|
|
8
|
+
private _resourceManagerService;
|
|
9
|
+
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _definedNamesService: IDefinedNamesService, _resourceManagerService: IResourceManagerService);
|
|
10
|
+
private _initialize;
|
|
11
|
+
private _initSnapshot;
|
|
12
|
+
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { SheetInterceptorService } from '../services/sheet-interceptor/sheet-interceptor.service';
|
|
2
2
|
import { SelectionManagerService } from '../services/selection-manager.service';
|
|
3
|
+
import { EffectRefRangeParams } from '../services/ref-range/type';
|
|
3
4
|
import { RefRangeService } from '../services/ref-range/ref-range.service';
|
|
5
|
+
import { IRemoveWorksheetMergeMutationParams } from '../basics/interfaces/mutation-interface';
|
|
4
6
|
import { Injector } from '@wendellhu/redi';
|
|
5
|
-
import { IRange, Dimension, Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
7
|
+
import { IRange, Dimension, Disposable, DisposableCollection, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* calculates the selection based on the merged cell type
|
|
@@ -18,8 +20,19 @@ export declare class MergeCellController extends Disposable {
|
|
|
18
20
|
private _injector;
|
|
19
21
|
private _sheetInterceptorService;
|
|
20
22
|
private _selectionManagerService;
|
|
23
|
+
disposableCollection: DisposableCollection;
|
|
21
24
|
constructor(_commandService: ICommandService, _refRangeService: RefRangeService, _univerInstanceService: IUniverInstanceService, _injector: Injector, _sheetInterceptorService: SheetInterceptorService, _selectionManagerService: SelectionManagerService);
|
|
22
25
|
private _initCommandInterceptor;
|
|
26
|
+
refRangeHandle(config: EffectRefRangeParams, unitId: string, subUnitId: string): {
|
|
27
|
+
redos: {
|
|
28
|
+
id: string;
|
|
29
|
+
params: IRemoveWorksheetMergeMutationParams;
|
|
30
|
+
}[];
|
|
31
|
+
undos: {
|
|
32
|
+
id: string;
|
|
33
|
+
params: IRemoveWorksheetMergeMutationParams;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
23
36
|
private _onRefRangeChange;
|
|
24
37
|
private _handleMoveRowsCommand;
|
|
25
38
|
private _handleMoveColsCommand;
|
|
@@ -32,5 +45,7 @@ export declare class MergeCellController extends Disposable {
|
|
|
32
45
|
private _handleInsertRangeMoveDownCommand;
|
|
33
46
|
private _handleDeleteRangeMoveUpCommand;
|
|
34
47
|
private _handleDeleteRangeMoveLeftCommand;
|
|
48
|
+
private _checkIsMergeCell;
|
|
35
49
|
private _handleNull;
|
|
50
|
+
private _commandExecutedListener;
|
|
36
51
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -83,7 +83,7 @@ export type { ISetRangeValuesMutationParams } from './commands/mutations/set-ran
|
|
|
83
83
|
export { SetRangeValuesMutation } from './commands/mutations/set-range-values.mutation';
|
|
84
84
|
export { SetRangeValuesUndoMutationFactory } from './commands/mutations/set-range-values.mutation';
|
|
85
85
|
export { type ISetRangeValuesRangeMutationParams } from './commands/mutations/set-range-values.mutation';
|
|
86
|
-
export { type ISetRowHiddenMutationParams, type ISetRowVisibleMutationParams, SetRowHiddenMutation, SetRowVisibleMutation } from './commands/mutations/set-row-visible.mutation';
|
|
86
|
+
export { type ISetRowHiddenMutationParams, type ISetRowVisibleMutationParams, SetRowHiddenMutation, SetRowVisibleMutation, } from './commands/mutations/set-row-visible.mutation';
|
|
87
87
|
export { SetTabColorMutation } from './commands/mutations/set-tab-color.mutation';
|
|
88
88
|
export { type ISetTabColorMutationParams } from './commands/mutations/set-tab-color.mutation';
|
|
89
89
|
export { type ISetWorksheetColWidthMutationParams, SetWorksheetColWidthMutation, SetWorksheetColWidthMutationFactory, } from './commands/mutations/set-worksheet-col-width.mutation';
|
|
@@ -108,9 +108,13 @@ export { INumfmtService } from './services/numfmt/type';
|
|
|
108
108
|
export { RefRangeService } from './services/ref-range/ref-range.service';
|
|
109
109
|
export type { EffectRefRangeParams, IOperator } from './services/ref-range/type';
|
|
110
110
|
export { EffectRefRangId, OperatorType } from './services/ref-range/type';
|
|
111
|
-
export { handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, handleDefaultRangeChangeWithEffectRefCommands, } from './services/ref-range/util';
|
|
111
|
+
export { handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, handleCommonDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommands, } from './services/ref-range/util';
|
|
112
112
|
export { INTERCEPTOR_POINT } from './services/sheet-interceptor/interceptor-const';
|
|
113
113
|
export { SheetInterceptorService } from './services/sheet-interceptor/sheet-interceptor.service';
|
|
114
114
|
export type { ISheetLocation } from './services/sheet-interceptor/utils/interceptor';
|
|
115
115
|
export { MergeCellController } from './controllers/merge-cell.controller';
|
|
116
116
|
export { AddMergeRedoSelectionsOperationFactory, AddMergeUndoSelectionsOperationFactory } from './commands/utils/handle-merge-operation';
|
|
117
|
+
export { InsertDefinedNameCommand } from './commands/commands/insert-defined-name.command';
|
|
118
|
+
export { RemoveDefinedNameCommand } from './commands/commands/remove-defined-name.command';
|
|
119
|
+
export { SetDefinedNameCommand, type ISetDefinedNameCommandParams } from './commands/commands/set-defined-name.command';
|
|
120
|
+
export { ScrollToCellOperation } from './commands/operations/scroll-to-cell.operation';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Univer } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
export declare function createRefRangeTestBed(): {
|
|
4
|
+
univer: Univer;
|
|
5
|
+
get: {
|
|
6
|
+
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
7
|
+
<T_1>(id: import('@wendellhu/redi').DependencyIdentifier<T_1>, quantity: import("@wendellhu/redi").Quantity.MANY, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_1[];
|
|
8
|
+
<T_2>(id: import('@wendellhu/redi').DependencyIdentifier<T_2>, quantity: import("@wendellhu/redi").Quantity.OPTIONAL, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_2 | null;
|
|
9
|
+
<T_3>(id: import('@wendellhu/redi').DependencyIdentifier<T_3>, quantity: import("@wendellhu/redi").Quantity.REQUIRED, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_3;
|
|
10
|
+
<T_4>(id: import('@wendellhu/redi').DependencyIdentifier<T_4>, quantity?: import('@wendellhu/redi').Quantity | undefined, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_4 | T_4[] | null;
|
|
11
|
+
<T_5>(id: import('@wendellhu/redi').DependencyIdentifier<T_5>, quantityOrLookup?: import('@wendellhu/redi').Quantity | import('@wendellhu/redi').LookUp | undefined, lookUp?: import('@wendellhu/redi').LookUp | undefined): T_5 | T_5[] | null;
|
|
12
|
+
};
|
|
13
|
+
sheet: import('@univerjs/core').Workbook;
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
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
|
+
export {};
|
|
@@ -2,16 +2,20 @@ import { EffectRefRangeParams } from './type';
|
|
|
2
2
|
import { SheetInterceptorService } from '../sheet-interceptor/sheet-interceptor.service';
|
|
3
3
|
import { SelectionManagerService } from '../selection-manager.service';
|
|
4
4
|
import { IDisposable } from '@wendellhu/redi';
|
|
5
|
-
import { IMutationInfo, IRange, Disposable, InterceptorManager, IUniverInstanceService } from '@univerjs/core';
|
|
5
|
+
import { IMutationInfo, IRange, Nullable, Disposable, ICommandService, InterceptorManager, IUniverInstanceService } from '@univerjs/core';
|
|
6
6
|
|
|
7
7
|
type RefRangCallback = (params: EffectRefRangeParams) => {
|
|
8
8
|
redos: IMutationInfo[];
|
|
9
9
|
undos: IMutationInfo[];
|
|
10
|
+
preRedos?: IMutationInfo[];
|
|
11
|
+
preUndos?: IMutationInfo[];
|
|
10
12
|
};
|
|
13
|
+
export type WatchRangeCallback = (before: IRange, after: Nullable<IRange>) => void;
|
|
11
14
|
/**
|
|
12
15
|
* Collect side effects caused by ref range change
|
|
13
16
|
*/
|
|
14
17
|
export declare class RefRangeService extends Disposable {
|
|
18
|
+
private readonly _commandService;
|
|
15
19
|
private _sheetInterceptorService;
|
|
16
20
|
private _univerInstanceService;
|
|
17
21
|
private _selectionManagerService;
|
|
@@ -19,7 +23,9 @@ export declare class RefRangeService extends Disposable {
|
|
|
19
23
|
MERGE_REDO: import('@univerjs/core').IInterceptor<IMutationInfo<object>[], null>;
|
|
20
24
|
MERGE_UNDO: import('@univerjs/core').IInterceptor<IMutationInfo<object>[], null>;
|
|
21
25
|
}>;
|
|
22
|
-
|
|
26
|
+
private _watchRanges;
|
|
27
|
+
constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SelectionManagerService);
|
|
28
|
+
watchRange(unitId: string, subUnitId: string, range: IRange, callback: WatchRangeCallback): IDisposable;
|
|
23
29
|
private _refRangeManagerMap;
|
|
24
30
|
private _serializer;
|
|
25
31
|
private _onRefRangeChange;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { IDeleteRangeMoveLeftCommand, IDeleteRangeMoveUpCommand, IInsertColCommand, IInsertRangeMoveDownCommand, IInsertRangeMoveRightCommand, IInsertRowCommand, IMoveColsCommand, IMoveRangeCommand, IMoveRowsCommand, IOperator, IRemoveRowColCommand } from './type';
|
|
2
|
-
import {
|
|
2
|
+
import { ISheetCommandSharedParams } from '../../commands/utils/interface';
|
|
3
|
+
import { IMoveRangeMutationParams } from '../../commands/mutations/move-range.mutation';
|
|
4
|
+
import { IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams, IRemoveSheetMutationParams } from '../../basics';
|
|
5
|
+
import { IMoveColumnsMutationParams, IMoveRowsMutationParams } from '../../commands/mutations/move-rows-cols.mutation';
|
|
6
|
+
import { ICommandInfo, IMutationInfo, IRange, Nullable, RANGE_TYPE } from '@univerjs/core';
|
|
3
7
|
|
|
4
8
|
export declare const handleRangeTypeInput: (range: IRange) => {
|
|
5
9
|
startColumn: number;
|
|
@@ -32,8 +36,11 @@ export declare const handleBaseMoveRowsCols: (fromRange: ILine, toRange: ILine,
|
|
|
32
36
|
step: number;
|
|
33
37
|
};
|
|
34
38
|
export declare const handleMoveRows: (params: IMoveRowsCommand, targetRange: IRange) => IOperator[];
|
|
39
|
+
export declare const handleMoveRowsCommon: (params: IMoveRowsCommand, targetRange: IRange) => IRange[];
|
|
35
40
|
export declare const handleMoveCols: (params: IMoveColsCommand, targetRange: IRange) => IOperator[];
|
|
41
|
+
export declare const handleMoveColsCommon: (params: IMoveColsCommand, targetRange: IRange) => IRange[];
|
|
36
42
|
export declare const handleMoveRange: (param: IMoveRangeCommand, targetRange: IRange) => IOperator[];
|
|
43
|
+
export declare const handleMoveRangeCommon: (param: IMoveRangeCommand, targetRange: IRange) => IRange[];
|
|
37
44
|
export declare const handleBaseRemoveRange: (_removeRange: IRange, _targetRange: IRange) => {
|
|
38
45
|
step: number;
|
|
39
46
|
length: number;
|
|
@@ -47,9 +54,24 @@ export declare const handleBaseInsertRange: (_insertRange: IRange, _targetRange:
|
|
|
47
54
|
export declare const handleInsertRow: (param: IInsertRowCommand, targetRange: IRange) => IOperator[];
|
|
48
55
|
export declare const handleInsertCol: (param: IInsertColCommand, targetRange: IRange) => IOperator[];
|
|
49
56
|
export declare const handleInsertRangeMoveDown: (param: IInsertRangeMoveDownCommand, targetRange: IRange) => IOperator[];
|
|
57
|
+
export declare const handleInsertRangeMoveDownCommon: (param: IInsertRangeMoveDownCommand, targetRange: IRange) => IRange[];
|
|
50
58
|
export declare const handleInsertRangeMoveRight: (param: IInsertRangeMoveRightCommand, targetRange: IRange) => IOperator[];
|
|
59
|
+
export declare const handleInsertRangeMoveRightCommon: (param: IInsertRangeMoveRightCommand, targetRange: IRange) => IRange[];
|
|
51
60
|
export declare const handleDeleteRangeMoveLeft: (param: IDeleteRangeMoveLeftCommand, targetRange: IRange) => IOperator[];
|
|
61
|
+
export declare const handleDeleteRangeMoveLeftCommon: (param: IDeleteRangeMoveLeftCommand, targetRange: IRange) => IRange[];
|
|
52
62
|
export declare const handleDeleteRangeMoveUp: (param: IDeleteRangeMoveUpCommand, targetRange: IRange) => IOperator[];
|
|
63
|
+
export declare const handleDeleteRangeMoveUpCommon: (param: IDeleteRangeMoveUpCommand, targetRange: IRange) => IRange[];
|
|
53
64
|
export declare const runRefRangeMutations: (operators: IOperator[], range: IRange) => IRange | null;
|
|
54
65
|
export declare const handleDefaultRangeChangeWithEffectRefCommands: (range: IRange, commandInfo: ICommandInfo) => IRange | null;
|
|
66
|
+
type MutationsAffectRange = ISheetCommandSharedParams | IRemoveSheetMutationParams | IMoveRowsMutationParams | IMoveColumnsMutationParams | IRemoveRowsMutationParams | IRemoveColMutationParams | IInsertColMutationParams | IInsertRowMutationParams | IMoveRangeMutationParams;
|
|
67
|
+
export declare const handleCommonDefaultRangeChangeWithEffectRefCommands: (range: IRange, commandInfo: ICommandInfo) => IRange | IRange[] | null;
|
|
68
|
+
/**
|
|
69
|
+
* This function should work as a pure function.
|
|
70
|
+
*
|
|
71
|
+
* @pure
|
|
72
|
+
* @param range
|
|
73
|
+
* @param mutation
|
|
74
|
+
* @returns the adjusted range
|
|
75
|
+
*/
|
|
76
|
+
export declare function adjustRangeOnMutation(range: Readonly<IRange>, mutation: IMutationInfo<MutationsAffectRange>): Nullable<IRange>;
|
|
55
77
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IDisposable } from '@wendellhu/redi';
|
|
2
|
-
import { ICommandInfo, IInterceptor,
|
|
2
|
+
import { ICommandInfo, IInterceptor, IUndoRedoCommandInfosByInterceptor, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
3
3
|
|
|
4
4
|
export interface ICommandInterceptor {
|
|
5
5
|
priority?: number;
|
|
6
|
-
getMutations(command: ICommandInfo):
|
|
6
|
+
getMutations(command: ICommandInfo): IUndoRedoCommandInfosByInterceptor;
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* This class expose methods for sheet features to inject code to sheet underlying logic.
|
|
@@ -24,7 +24,7 @@ export declare class SheetInterceptorService extends Disposable {
|
|
|
24
24
|
* @param command
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
onCommandExecute(command: ICommandInfo):
|
|
27
|
+
onCommandExecute(command: ICommandInfo): IUndoRedoCommandInfosByInterceptor;
|
|
28
28
|
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): IDisposable;
|
|
29
29
|
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue: import('@univerjs/core/common/type-utils.js').Nullable<T>, initContext: C) => import('@univerjs/core/common/type-utils.js').Nullable<T>;
|
|
30
30
|
private _interceptWorkbook;
|