@univerjs/sheets 0.2.8 → 0.2.10
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 +3 -3
- package/lib/es/index.js +454 -277
- package/lib/types/basics/__tests__/expand.data.d.ts +2 -0
- package/lib/types/basics/__tests__/expand.spec.d.ts +16 -0
- package/lib/types/basics/expand-range.d.ts +15 -0
- package/lib/types/commands/commands/move-rows-cols.command.d.ts +6 -0
- package/lib/types/commands/commands/remove-row-col.command.d.ts +3 -0
- package/lib/types/commands/commands/set-col-visible.command.d.ts +5 -0
- package/lib/types/commands/commands/set-row-visible.command.d.ts +6 -1
- package/lib/types/commands/commands/set-worksheet-col-width.command.d.ts +4 -1
- package/lib/types/commands/commands/set-worksheet-row-height.command.d.ts +7 -2
- package/lib/types/commands/commands/utils/selection-utils.d.ts +13 -1
- package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +1 -1
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +0 -1
- package/lib/types/index.d.ts +6 -4
- package/lib/types/model/range-protection-rule.model.d.ts +1 -0
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +6 -1
- package/lib/types/services/permission/type.d.ts +1 -1
- package/lib/types/services/permission/worksheet-permission/worksheet-permission-point.model.d.ts +1 -0
- package/lib/types/services/permission/worksheet-permission/worksheet-permission-rule.model.d.ts +2 -1
- package/lib/types/services/ref-range/util.d.ts +5 -0
- package/lib/types/services/selections/selection-manager.service.d.ts +11 -6
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +1 -1
- package/lib/types/services/sheet-interceptor/interceptor-const.d.ts +4 -0
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +3 -4
- package/lib/types/sheets-plugin.d.ts +2 -7
- package/lib/umd/index.js +3 -3
- package/package.json +13 -13
|
@@ -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,15 @@
|
|
|
1
|
+
import { IRange, Worksheet } from '@univerjs/core';
|
|
2
|
+
export interface IExpandParams {
|
|
3
|
+
left?: boolean;
|
|
4
|
+
right?: boolean;
|
|
5
|
+
up?: boolean;
|
|
6
|
+
down?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Expand the range to a continuous range, it uses when Ctrl + A , or only one cell selected to add a pivot table adn so on.
|
|
10
|
+
* @param {IRange} startRange The start range.
|
|
11
|
+
* @param {IExpandParams} directions The directions to expand.
|
|
12
|
+
* @param {Worksheet} worksheet The worksheet working on.
|
|
13
|
+
* @returns {IRange} The expanded range.
|
|
14
|
+
*/
|
|
15
|
+
export declare function expandToContinuousRange(startRange: IRange, directions: IExpandParams, worksheet: Worksheet): IRange;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { ICommand, IRange } from '@univerjs/core';
|
|
2
2
|
export interface IMoveRowsCommandParams {
|
|
3
|
+
unitId?: string;
|
|
4
|
+
subUnitId?: string;
|
|
5
|
+
range?: IRange;
|
|
3
6
|
fromRange: IRange;
|
|
4
7
|
toRange: IRange;
|
|
5
8
|
}
|
|
@@ -9,6 +12,9 @@ export declare const MoveRowsCommandId: "sheet.command.move-rows";
|
|
|
9
12
|
*/
|
|
10
13
|
export declare const MoveRowsCommand: ICommand<IMoveRowsCommandParams>;
|
|
11
14
|
export interface IMoveColsCommandParams {
|
|
15
|
+
unitId?: string;
|
|
16
|
+
subUnitId?: string;
|
|
17
|
+
range?: IRange;
|
|
12
18
|
fromRange: IRange;
|
|
13
19
|
toRange: IRange;
|
|
14
20
|
}
|
|
@@ -2,6 +2,9 @@ import { ICommand, IRange } from '@univerjs/core';
|
|
|
2
2
|
export interface IRemoveRowColCommandParams {
|
|
3
3
|
range: IRange;
|
|
4
4
|
}
|
|
5
|
+
export interface IRemoveRowColCommandInterceptParams extends IRemoveRowColCommandParams {
|
|
6
|
+
ranges?: IRange[];
|
|
7
|
+
}
|
|
5
8
|
export declare const RemoveRowCommandId = "sheet.command.remove-row";
|
|
6
9
|
/**
|
|
7
10
|
* This command would remove the selected rows. These selected rows can be non-continuous.
|
|
@@ -6,5 +6,10 @@ export interface ISetSpecificColsVisibleCommandParams {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const SetSpecificColsVisibleCommand: ICommand<ISetSpecificColsVisibleCommandParams>;
|
|
8
8
|
export declare const SetSelectedColsVisibleCommand: ICommand;
|
|
9
|
+
export interface ISetColHiddenCommandParams {
|
|
10
|
+
unitId?: string;
|
|
11
|
+
subUnitId?: string;
|
|
12
|
+
ranges?: IRange[];
|
|
13
|
+
}
|
|
9
14
|
export declare const SetColHiddenCommand: ICommand;
|
|
10
15
|
export declare function divideRangesByHiddenCols(worksheet: Worksheet, ranges: IRange[]): IRange[];
|
|
@@ -6,5 +6,10 @@ export interface ISetSpecificRowsVisibleCommandParams {
|
|
|
6
6
|
}
|
|
7
7
|
export declare const SetSpecificRowsVisibleCommand: ICommand<ISetSpecificRowsVisibleCommandParams>;
|
|
8
8
|
export declare const SetSelectedRowsVisibleCommand: ICommand;
|
|
9
|
-
export
|
|
9
|
+
export interface ISetRowHiddenCommandParams {
|
|
10
|
+
unitId?: string;
|
|
11
|
+
subUnitId?: string;
|
|
12
|
+
ranges?: IRange[];
|
|
13
|
+
}
|
|
14
|
+
export declare const SetRowHiddenCommand: ICommand<ISetRowHiddenCommandParams>;
|
|
10
15
|
export declare function divideRangesByHiddenRows(worksheet: Worksheet, ranges: IRange[]): IRange[];
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ICommand } from '@univerjs/core';
|
|
1
|
+
import { ICommand, IRange } from '@univerjs/core';
|
|
2
2
|
export interface IDeltaColumnWidthCommandParams {
|
|
3
3
|
anchorCol: number;
|
|
4
4
|
deltaX: number;
|
|
5
5
|
}
|
|
6
6
|
export declare const DeltaColumnWidthCommand: ICommand<IDeltaColumnWidthCommandParams>;
|
|
7
7
|
export interface ISetColWidthCommandParams {
|
|
8
|
+
unitId?: string;
|
|
9
|
+
subUnitId?: string;
|
|
10
|
+
ranges?: IRange[];
|
|
8
11
|
value: number;
|
|
9
12
|
}
|
|
10
13
|
export declare const SetColWidthCommand: ICommand;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { ICommand } from '@univerjs/core';
|
|
1
|
+
import { ICommand, IRange } from '@univerjs/core';
|
|
2
2
|
export interface IDeltaRowHeightCommand {
|
|
3
3
|
anchorRow: number;
|
|
4
4
|
deltaY: number;
|
|
5
5
|
}
|
|
6
6
|
export declare const DeltaRowHeightCommand: ICommand;
|
|
7
7
|
export interface ISetRowHeightCommandParams {
|
|
8
|
+
unitId?: string;
|
|
9
|
+
subUnitId?: string;
|
|
10
|
+
ranges?: IRange[];
|
|
8
11
|
value: number;
|
|
9
12
|
}
|
|
10
13
|
export declare const SetRowHeightCommand: ICommand;
|
|
11
14
|
export interface ISetWorksheetRowIsAutoHeightCommandParams {
|
|
12
|
-
|
|
15
|
+
unitId?: string;
|
|
16
|
+
subUnitId?: string;
|
|
17
|
+
ranges?: IRange[];
|
|
13
18
|
}
|
|
14
19
|
export declare const SetWorksheetRowIsAutoHeightCommand: ICommand;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IRange, ISelectionCell, Nullable, Workbook, Worksheet } from '@univerjs/core';
|
|
1
|
+
import { ICellData, IObjectMatrixPrimitiveType, IRange, ISelectionCell, Nullable, Workbook, Worksheet } from '@univerjs/core';
|
|
2
2
|
import { ISetSelectionsOperationParams } from '../../operations/selection.operation';
|
|
3
3
|
import { ISelectionWithStyle } from '../../../basics/selection';
|
|
4
4
|
export interface IExpandParams {
|
|
@@ -49,3 +49,15 @@ export declare function isSingleCellSelection(selection: Nullable<ISelectionWith
|
|
|
49
49
|
export declare function createRangeIteratorWithSkipFilteredRows(sheet: Worksheet): {
|
|
50
50
|
forOperableEach: (ranges: IRange, operator: (row: number, col: number, range: IRange) => void) => void;
|
|
51
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* Copy the styles of a range of cells to another range. Used for insert row and insert column.
|
|
54
|
+
* @param worksheet
|
|
55
|
+
* @param startRow
|
|
56
|
+
* @param endRow
|
|
57
|
+
* @param startColumn
|
|
58
|
+
* @param endColumn
|
|
59
|
+
* @param isRow
|
|
60
|
+
* @param styleRowOrColumn
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
export declare function copyRangeStyles(worksheet: Worksheet, startRow: number, endRow: number, startColumn: number, endColumn: number, isRow: boolean, styleRowOrColumn: number): IObjectMatrixPrimitiveType<ICellData>;
|
|
@@ -5,7 +5,7 @@ export interface IAddRangeProtectionMutationParams {
|
|
|
5
5
|
rules: IRangeProtectionRule[];
|
|
6
6
|
unitId: string;
|
|
7
7
|
subUnitId: string;
|
|
8
|
-
name
|
|
8
|
+
name?: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
}
|
|
11
11
|
export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<IDeleteSelectionProtectionMutationParams>;
|
|
@@ -25,7 +25,6 @@ export interface ISetRangeValuesRangeMutationParams extends ISetRangeValuesMutat
|
|
|
25
25
|
export declare const SetRangeValuesUndoMutationFactory: (accessor: IAccessor, params: ISetRangeValuesMutationParams) => ISetRangeValuesMutationParams;
|
|
26
26
|
/**
|
|
27
27
|
* TODO@Dushusir: Excel can display numbers with up to about 15 digits of precision. When the user inputs more than 15 digits, interception is required, but there are unknown performance risks.
|
|
28
|
-
|
|
29
28
|
Intercept 15-digit number reference function truncateNumber
|
|
30
29
|
*/
|
|
31
30
|
export declare const SetRangeValuesMutation: IMutation<ISetRangeValuesMutationParams, boolean>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -41,19 +41,20 @@ export { RefRangeService } from './services/ref-range/ref-range.service';
|
|
|
41
41
|
export type { EffectRefRangeParams, IOperator } from './services/ref-range/type';
|
|
42
42
|
export { EffectRefRangId, OperatorType } from './services/ref-range/type';
|
|
43
43
|
export { DefinedNameDataController } from './controllers/defined-name-data.controller';
|
|
44
|
-
export { handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, handleCommonDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, } from './services/ref-range/util';
|
|
45
|
-
export { INTERCEPTOR_POINT } from './services/sheet-interceptor/interceptor-const';
|
|
44
|
+
export { handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, handleCommonDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, } from './services/ref-range/util';
|
|
45
|
+
export { INTERCEPTOR_POINT, InterceptCellContentPriority } from './services/sheet-interceptor/interceptor-const';
|
|
46
46
|
export { SheetInterceptorService } from './services/sheet-interceptor/sheet-interceptor.service';
|
|
47
47
|
export type { ISheetLocation, ISheetLocationBase, ISheetRowLocation } from './services/sheet-interceptor/utils/interceptor';
|
|
48
48
|
export { MergeCellController, MERGE_CELL_INTERCEPTOR_CHECK } from './controllers/merge-cell.controller';
|
|
49
49
|
export { AddMergeRedoSelectionsOperationFactory, AddMergeUndoSelectionsOperationFactory } from './commands/utils/handle-merge-operation';
|
|
50
50
|
export type { FormatType } from './services/numfmt/type';
|
|
51
|
-
export { expandToContinuousRange } from './basics/
|
|
51
|
+
export { expandToContinuousRange } from './basics/expand-range';
|
|
52
52
|
export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel } from './services/permission';
|
|
53
53
|
export type { IWorksheetProtectionRule } from './services/permission/type';
|
|
54
54
|
export { WorksheetProtectionRuleModel, WorksheetProtectionPointModel } from './services/permission/worksheet-permission';
|
|
55
55
|
export { getAllWorkbookPermissionPoint, defaultWorkbookPermissionPoints } from './services/permission/workbook-permission';
|
|
56
56
|
export { WorksheetCopyPermission, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetViewPermission, WorksheetSetRowStylePermission, WorksheetSetColumnStylePermission, WorksheetInsertRowPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetDeleteRowPermission, WorksheetDeleteColumnPermission, WorksheetSortPermission, WorksheetFilterPermission, WorksheetPivotTablePermission, WorksheetEditExtraObjectPermission, WorksheetManageCollaboratorPermission, WorksheetEditPermission, WorkbookCommentPermission, WorkbookEditablePermission, WorkbookDuplicatePermission, WorkbookPrintPermission, WorkbookExportPermission, WorkbookMoveSheetPermission, WorkbookDeleteSheetPermission, WorkbookHideSheetPermission, WorkbookRenameSheetPermission, WorkbookCreateSheetPermission, WorkbookHistoryPermission, WorkbookViewPermission, WorkbookSharePermission, WorkbookCopyPermission, WorkbookManageCollaboratorPermission, WorkbookViewHistoryPermission, WorkbookRecoverHistoryPermission, } from './services/permission/permission-point';
|
|
57
|
+
export { UnitObject } from '@univerjs/protocol';
|
|
57
58
|
export { checkRangesEditablePermission } from './services/permission/util';
|
|
58
59
|
export { RangeProtectionRenderModel, type ICellPermission } from './model/range-protection-render.model';
|
|
59
60
|
export { RangeProtectionRuleModel, type IObjectModel, type IRangeProtectionRule, type IModel } from './model/range-protection-rule.model';
|
|
@@ -64,6 +65,7 @@ export { type IRangePermissionPoint, getAllRangePermissionPoint, getDefaultRange
|
|
|
64
65
|
export { RangeProtectionPermissionEditPoint } from './services/permission/permission-point/range/edit';
|
|
65
66
|
export { RangeProtectionPermissionViewPoint } from './services/permission/permission-point/range/view';
|
|
66
67
|
export { generateNullCellValue, generateNullCell } from './basics/utils';
|
|
68
|
+
export { copyRangeStyles } from './commands/commands/utils/selection-utils';
|
|
67
69
|
export { AddRangeProtectionCommand, type IAddRangeProtectionCommandParams } from './commands/commands/add-range-protection.command';
|
|
68
70
|
export { AddWorksheetMergeCommand, AddWorksheetMergeAllCommand, AddWorksheetMergeVerticalCommand, AddWorksheetMergeHorizontalCommand, } from './commands/commands/add-worksheet-merge.command';
|
|
69
71
|
export { ClearSelectionAllCommand } from './commands/commands/clear-selection-all.command';
|
|
@@ -81,7 +83,7 @@ export { InsertSheetCommand, type IInsertSheetCommandParams } from './commands/c
|
|
|
81
83
|
export { MoveRangeCommand, getMoveRangeUndoRedoMutations, type IMoveRangeCommandParams } from './commands/commands/move-range.command';
|
|
82
84
|
export { MoveRowsCommand, MoveColsCommand, type IMoveRowsCommandParams, type IMoveColsCommandParams, } from './commands/commands/move-rows-cols.command';
|
|
83
85
|
export { RemoveDefinedNameCommand } from './commands/commands/remove-defined-name.command';
|
|
84
|
-
export { RemoveRowCommand, RemoveColCommand, type IRemoveRowColCommandParams } from './commands/commands/remove-row-col.command';
|
|
86
|
+
export { RemoveRowCommand, RemoveColCommand, type IRemoveRowColCommandParams, type IRemoveRowColCommandInterceptParams } from './commands/commands/remove-row-col.command';
|
|
85
87
|
export { RemoveSheetCommand, type IRemoveSheetCommandParams } from './commands/commands/remove-sheet.command';
|
|
86
88
|
export { RemoveWorksheetMergeCommand } from './commands/commands/remove-worksheet-merge.command';
|
|
87
89
|
export { ReorderRangeCommand, type IReorderRangeCommandParams } from './commands/commands/reorder-range.command';
|
|
@@ -43,5 +43,6 @@ export declare class RangeProtectionRuleModel {
|
|
|
43
43
|
fromObject(obj: IObjectModel): void;
|
|
44
44
|
deleteUnitModel(unitId: string): void;
|
|
45
45
|
createRuleId(unitId: string, subUnitId: string): string;
|
|
46
|
+
getTargetByPermissionId(unitId: string, permissionId: string): string[] | null;
|
|
46
47
|
}
|
|
47
48
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { Disposable, DisposableCollection, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, DisposableCollection, ICommandService, IUniverInstanceService, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
|
|
3
3
|
import { RangeProtectionRenderModel } from '../../../model/range-protection-render.model';
|
|
4
4
|
import { ISetRangeProtectionMutationParams } from '../../../commands/mutations/set-range-protection.mutation';
|
|
5
5
|
import { EffectRefRangeParams } from '../../../services/ref-range/type';
|
|
6
6
|
import { RefRangeService } from '../../../services/ref-range/ref-range.service';
|
|
7
|
+
import { IDeleteSelectionProtectionMutationParams } from '../../../commands/mutations/delete-range-protection.mutation';
|
|
8
|
+
import { IAddRangeProtectionMutationParams } from '../../../commands/mutations/add-range-protection.mutation';
|
|
7
9
|
export declare class RangeProtectionRefRangeService extends Disposable {
|
|
8
10
|
private _selectionProtectionRuleModel;
|
|
9
11
|
private _univerInstanceService;
|
|
@@ -22,6 +24,9 @@ export declare class RangeProtectionRefRangeService extends Disposable {
|
|
|
22
24
|
id: string;
|
|
23
25
|
params: ISetRangeProtectionMutationParams;
|
|
24
26
|
}[];
|
|
27
|
+
} | {
|
|
28
|
+
redos: IMutationInfo<IDeleteSelectionProtectionMutationParams | IAddRangeProtectionMutationParams | ISetRangeProtectionMutationParams>[];
|
|
29
|
+
undos: IMutationInfo<IDeleteSelectionProtectionMutationParams | IAddRangeProtectionMutationParams | ISetRangeProtectionMutationParams>[];
|
|
25
30
|
};
|
|
26
31
|
private _getRefRangeMutationsByDeleteCols;
|
|
27
32
|
private _getRefRangeMutationsByDeleteRows;
|
package/lib/types/services/permission/worksheet-permission/worksheet-permission-point.model.d.ts
CHANGED
|
@@ -14,4 +14,5 @@ export declare class WorksheetProtectionPointModel {
|
|
|
14
14
|
fromObject(obj: IObjectPointModel): void;
|
|
15
15
|
deleteUnitModel(unitId: string): void;
|
|
16
16
|
private _ensureSubUnitMap;
|
|
17
|
+
getTargetByPermissionId(unitId: string, permissionId: string): string[] | null | undefined;
|
|
17
18
|
}
|
package/lib/types/services/permission/worksheet-permission/worksheet-permission-rule.model.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ type IRuleChangeType = 'add' | 'set' | 'delete';
|
|
|
3
3
|
export declare class WorksheetProtectionRuleModel {
|
|
4
4
|
/**
|
|
5
5
|
*
|
|
6
|
-
* Map<unitId, Map<subUnitId, Map<
|
|
6
|
+
* Map<unitId, Map<subUnitId, Map<subUnitId, IWorksheetProtectionRule>>>
|
|
7
7
|
*/
|
|
8
8
|
private _model;
|
|
9
9
|
private _ruleChange;
|
|
@@ -31,5 +31,6 @@ export declare class WorksheetProtectionRuleModel {
|
|
|
31
31
|
private _ensureSubUnitMap;
|
|
32
32
|
ruleRefresh(permissionId: string): void;
|
|
33
33
|
resetOrder(): void;
|
|
34
|
+
getTargetByPermissionId(unitId: string, permissionId: string): string[] | null | undefined;
|
|
34
35
|
}
|
|
35
36
|
export {};
|
|
@@ -4,6 +4,7 @@ import { IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationP
|
|
|
4
4
|
import { IMoveRangeMutationParams } from '../../commands/mutations/move-range.mutation';
|
|
5
5
|
import { ISheetCommandSharedParams } from '../../commands/utils/interface';
|
|
6
6
|
import { SheetsSelectionsService } from '../selections/selection-manager.service';
|
|
7
|
+
import { IRemoveRowColCommandInterceptParams } from '../../commands/commands/remove-row-col.command';
|
|
7
8
|
import { EffectRefRangeParams, IDeleteRangeMoveLeftCommand, IDeleteRangeMoveUpCommand, IInsertColCommand, IInsertRangeMoveDownCommand, IInsertRangeMoveRightCommand, IInsertRowCommand, IMoveColsCommand, IMoveRangeCommand, IMoveRowsCommand, IOperator, IRemoveRowColCommand, IReorderRangeCommand } from './type';
|
|
8
9
|
export declare const handleRangeTypeInput: (range: IRange) => {
|
|
9
10
|
rangeType?: RANGE_TYPE;
|
|
@@ -67,6 +68,7 @@ export declare const handleDeleteRangeMoveLeft: (param: IDeleteRangeMoveLeftComm
|
|
|
67
68
|
export declare const handleDeleteRangeMoveLeftCommon: (param: IDeleteRangeMoveLeftCommand, targetRange: IRange) => IRange[];
|
|
68
69
|
export declare const handleDeleteRangeMoveUp: (param: IDeleteRangeMoveUpCommand, targetRange: IRange) => IOperator[];
|
|
69
70
|
export declare const handleDeleteRangeMoveUpCommon: (param: IDeleteRangeMoveUpCommand, targetRange: IRange) => IRange[];
|
|
71
|
+
export declare const handleRemoveRowCommon: (param: IRemoveRowColCommandInterceptParams, targetRange: IRange) => IRange[];
|
|
70
72
|
export declare const runRefRangeMutations: (operators: IOperator[], range: IRange) => IRange | null;
|
|
71
73
|
export declare const handleDefaultRangeChangeWithEffectRefCommands: (range: IRange, commandInfo: ICommandInfo) => IRange | null;
|
|
72
74
|
export declare const handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests: (range: IRange, commandInfo: ICommandInfo, deps: {
|
|
@@ -74,6 +76,9 @@ export declare const handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterest
|
|
|
74
76
|
}) => IRange | null;
|
|
75
77
|
type MutationsAffectRange = ISheetCommandSharedParams | IRemoveSheetMutationParams | IMoveRowsMutationParams | IMoveColumnsMutationParams | IRemoveRowsMutationParams | IRemoveColMutationParams | IInsertColMutationParams | IInsertRowMutationParams | IMoveRangeMutationParams;
|
|
76
78
|
export declare const handleCommonDefaultRangeChangeWithEffectRefCommands: (range: IRange, commandInfo: ICommandInfo) => IRange | IRange[] | null;
|
|
79
|
+
export declare const handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests: (range: IRange, commandInfo: ICommandInfo, deps: {
|
|
80
|
+
selectionManagerService: SheetsSelectionsService;
|
|
81
|
+
}) => IRange | IRange[] | null;
|
|
77
82
|
/**
|
|
78
83
|
* This function should work as a pure function.
|
|
79
84
|
*
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISelectionCell, Nullable, Workbook, Disposable, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
1
|
+
import { DeepReadonly, ISelectionCell, Nullable, Workbook, Disposable, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { ISelectionWithStyle } from '../../basics/selection';
|
|
4
4
|
export interface ISelectionManagerSearchParam {
|
|
@@ -13,15 +13,19 @@ export declare enum SelectionMoveType {
|
|
|
13
13
|
export declare class SheetsSelectionsService extends RxDisposable {
|
|
14
14
|
protected readonly _instanceSrv: IUniverInstanceService;
|
|
15
15
|
private get _currentSelectionPos();
|
|
16
|
+
get currentSelectionParam(): Nullable<ISelectionManagerSearchParam>;
|
|
16
17
|
selectionMoveStart$: Observable<Nullable<ISelectionWithStyle[]>>;
|
|
17
18
|
selectionMoving$: Observable<Nullable<ISelectionWithStyle[]>>;
|
|
18
19
|
selectionMoveEnd$: Observable<ISelectionWithStyle[]>;
|
|
19
20
|
constructor(_instanceSrv: IUniverInstanceService);
|
|
20
21
|
protected _init(): void;
|
|
21
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Clear all selections in all workbooks.
|
|
24
|
+
* invoked by prompt.controller
|
|
25
|
+
*/
|
|
22
26
|
clear(): void;
|
|
23
27
|
getCurrentSelections(): Readonly<ISelectionWithStyle[]>;
|
|
24
|
-
getCurrentLastSelection():
|
|
28
|
+
getCurrentLastSelection(): DeepReadonly<Nullable<ISelectionWithStyle & {
|
|
25
29
|
primary: ISelectionCell;
|
|
26
30
|
}>>;
|
|
27
31
|
addSelections(selectionsData: ISelectionWithStyle[]): void;
|
|
@@ -60,12 +64,13 @@ export declare class WorkbookSelections extends Disposable {
|
|
|
60
64
|
clear(): void;
|
|
61
65
|
addSelections(sheetId: string, selectionDatas: ISelectionWithStyle[]): void;
|
|
62
66
|
/**
|
|
63
|
-
*
|
|
67
|
+
* Set selectionDatas to _worksheetSelections, and emit selectionDatas by type.
|
|
68
|
+
* If type is not specfied, this method would clear all existing selections.
|
|
64
69
|
* @param sheetId
|
|
65
70
|
* @param selectionDatas
|
|
66
71
|
* @param type
|
|
67
72
|
*/
|
|
68
|
-
setSelections(sheetId: string, selectionDatas: ISelectionWithStyle[], type
|
|
73
|
+
setSelections(sheetId: string, selectionDatas: ISelectionWithStyle[], type: SelectionMoveType): void;
|
|
69
74
|
getCurrentSelections(): Readonly<ISelectionWithStyle[]>;
|
|
70
75
|
getSelectionOfWorksheet(sheetId: string): ISelectionWithStyle[];
|
|
71
76
|
private _getCurrentSelections;
|
|
@@ -74,7 +79,7 @@ export declare class WorkbookSelections extends Disposable {
|
|
|
74
79
|
}>>;
|
|
75
80
|
private _worksheetSelections;
|
|
76
81
|
/**
|
|
77
|
-
*
|
|
82
|
+
* Same as _getCurrentSelections(which return this._worksheetSelections), but this method would set [] if no selection.
|
|
78
83
|
* @param sheetId
|
|
79
84
|
* @returns this._worksheetSelections
|
|
80
85
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Dependency, IWorkbookData, Univer } from '@univerjs/core';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function createSheetTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
3
3
|
univer: Univer;
|
|
4
4
|
get: {
|
|
5
5
|
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
|
|
@@ -4,3 +4,7 @@ export declare const INTERCEPTOR_POINT: {
|
|
|
4
4
|
CELL_CONTENT: import('@univerjs/core').IInterceptor<ICellDataForSheetInterceptor, ISheetLocation>;
|
|
5
5
|
ROW_FILTERED: import('@univerjs/core').IInterceptor<boolean, ISheetRowLocation>;
|
|
6
6
|
};
|
|
7
|
+
export declare enum InterceptCellContentPriority {
|
|
8
|
+
DATA_VALIDATION = 9,
|
|
9
|
+
NUMFMT = 10
|
|
10
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICommandInfo, IDisposable, IInterceptor, IRange, IUndoRedoCommandInfosByInterceptor, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
1
|
+
import { ICommandInfo, IDisposable, IInterceptor, IRange, IUndoRedoCommandInfosByInterceptor, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
export interface IBeforeCommandInterceptor {
|
|
3
3
|
priority?: number;
|
|
4
4
|
performCheck(info: ICommandInfo): Promise<boolean>;
|
|
@@ -18,8 +18,6 @@ export interface IRangeInterceptors {
|
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* This class expose methods for sheet features to inject code to sheet underlying logic.
|
|
21
|
-
*
|
|
22
|
-
* It would inject Workbook & Worksheet.
|
|
23
21
|
*/
|
|
24
22
|
export declare class SheetInterceptorService extends Disposable {
|
|
25
23
|
private readonly _univerInstanceService;
|
|
@@ -29,6 +27,7 @@ export declare class SheetInterceptorService extends Disposable {
|
|
|
29
27
|
private _beforeCommandInterceptor;
|
|
30
28
|
private readonly _workbookDisposables;
|
|
31
29
|
private readonly _worksheetDisposables;
|
|
30
|
+
/** @ignore */
|
|
32
31
|
constructor(_univerInstanceService: IUniverInstanceService);
|
|
33
32
|
dispose(): void;
|
|
34
33
|
interceptCommand(interceptor: ICommandInterceptor): IDisposable;
|
|
@@ -53,7 +52,7 @@ export declare class SheetInterceptorService extends Disposable {
|
|
|
53
52
|
onCommandExecute(info: ICommandInfo): IUndoRedoCommandInfosByInterceptor;
|
|
54
53
|
generateMutationsByRanges(info: IRangesInfo): IUndoRedoCommandInfosByInterceptor;
|
|
55
54
|
intercept<T extends IInterceptor<any, any>>(name: T, interceptor: T): IDisposable;
|
|
56
|
-
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue:
|
|
55
|
+
fetchThroughInterceptors<T, C>(name: IInterceptor<T, C>): (initValue: Nullable<T>, initContext: C) => Nullable<T>;
|
|
57
56
|
private _interceptWorkbook;
|
|
58
57
|
private _disposeWorkbookInterceptor;
|
|
59
58
|
private _disposeSheetInterceptor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DependencyOverride,
|
|
1
|
+
import { DependencyOverride, IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
2
2
|
export interface IUniverSheetsConfig {
|
|
3
3
|
notExecuteFormula?: boolean;
|
|
4
4
|
override?: DependencyOverride;
|
|
@@ -8,18 +8,13 @@ export interface IUniverSheetsConfig {
|
|
|
8
8
|
*/
|
|
9
9
|
onlyRegisterFormulaRelatedMutations?: true;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
* The main sheet base, construct the sheet container and layout, mount the rendering engine
|
|
13
|
-
*/
|
|
14
11
|
export declare class UniverSheetsPlugin extends Plugin {
|
|
15
12
|
private _config;
|
|
16
|
-
private readonly _commandService;
|
|
17
13
|
private readonly _configService;
|
|
18
|
-
private readonly _localeService;
|
|
19
14
|
readonly _injector: Injector;
|
|
20
15
|
static pluginName: string;
|
|
21
16
|
static type: UniverInstanceType;
|
|
22
|
-
constructor(_config: IUniverSheetsConfig | undefined,
|
|
17
|
+
constructor(_config: IUniverSheetsConfig | undefined, _configService: IConfigService, _injector: Injector);
|
|
23
18
|
onRendered(): void;
|
|
24
19
|
private _initConfig;
|
|
25
20
|
private _initDependencies;
|