@univerjs/sheets 0.2.2 → 0.2.4-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/README.md +11 -3
- package/lib/cjs/index.js +3 -3
- package/lib/es/index.js +2843 -2819
- package/lib/locale/vi-VN.json +14 -0
- package/lib/locale/zh-TW.json +14 -0
- package/lib/types/basics/__tests__/cell-value.spec.d.ts +16 -0
- package/lib/types/basics/cell-style.d.ts +8 -0
- package/lib/types/basics/cell-type.d.ts +19 -0
- package/lib/types/basics/cell-value.d.ts +22 -0
- package/lib/types/basics/utils.d.ts +2 -1
- package/lib/types/commands/commands/__tests__/create-command-test-bed.d.ts +1 -2
- package/lib/types/commands/commands/move-range.command.d.ts +1 -2
- package/lib/types/commands/mutations/__tests__/create-command-test-bed.d.ts +1 -2
- package/lib/types/commands/mutations/add-worksheet-merge.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/delete-range-protection.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/insert-row-col.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/insert-sheet.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/move-rows-cols.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/numfmt-mutation.d.ts +1 -2
- package/lib/types/commands/mutations/remove-row-col.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/remove-sheet.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/remove-worksheet-merge.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-col-visible.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-frozen.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-hide-gridlines.mutatiom.d.ts +1 -2
- package/lib/types/commands/mutations/set-range-protection.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +1 -48
- package/lib/types/commands/mutations/set-row-visible.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-tab-color.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-worksheet-col-width.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-worksheet-hide.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-worksheet-name.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-worksheet-order.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-worksheet-right-to-left.mutation.d.ts +1 -2
- package/lib/types/commands/mutations/set-worksheet-row-height.mutation.d.ts +1 -2
- package/lib/types/commands/operations/selection.operation.d.ts +1 -2
- package/lib/types/commands/utils/handle-merge-operation.d.ts +1 -2
- package/lib/types/commands/utils/handle-range-mutation.d.ts +1 -2
- package/lib/types/commands/utils/selection-command-util.d.ts +4 -0
- package/lib/types/controllers/__tests__/util.d.ts +7 -8
- package/lib/types/controllers/basic-worksheet.controller.d.ts +1 -2
- package/lib/types/controllers/merge-cell.controller.d.ts +3 -4
- package/lib/types/index.d.ts +4 -2
- package/lib/types/locale/vi-VN.d.ts +4 -0
- package/lib/types/locale/zh-TW.d.ts +4 -0
- package/lib/types/services/__tests__/util.d.ts +7 -8
- package/lib/types/services/border-style-manager.service.d.ts +1 -2
- package/lib/types/services/numfmt/type.d.ts +1 -1
- package/lib/types/services/permission/permission-point/index.d.ts +2 -0
- package/lib/types/services/permission/permission-point/workbook/recover-history.d.ts +12 -0
- package/lib/types/services/permission/permission-point/workbook/view-history.d.ts +12 -0
- package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +1 -2
- package/lib/types/services/ref-range/__tests__/__testing__.d.ts +7 -8
- package/lib/types/services/ref-range/__tests__/ref-range.service.spec.d.ts +6 -6
- package/lib/types/services/ref-range/ref-range.service.d.ts +3 -4
- package/lib/types/services/ref-range/util.d.ts +11 -7
- package/lib/types/services/selections/ref-selections.service.d.ts +19 -0
- package/lib/types/services/selections/selection-manager.service.d.ts +75 -0
- package/lib/types/services/sheet-interceptor/__tests__/create-core-test-bed.d.ts +7 -8
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +1 -2
- package/lib/types/sheets-plugin.d.ts +1 -2
- package/lib/umd/index.js +3 -3
- package/package.json +13 -14
- package/lib/types/services/selection-manager.service.d.ts +0 -93
- /package/lib/types/{commands/mutations/__tests__/set-range-values.mutation.spec.d.ts → basics/__tests__/cell-type.spec.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"sheets": {
|
|
3
|
+
"tabs": {
|
|
4
|
+
"sheetCopy": "(Bản sao {0})",
|
|
5
|
+
"sheet": "Bảng tính"
|
|
6
|
+
},
|
|
7
|
+
"info": {
|
|
8
|
+
"overlappingSelections": "Không thể sử dụng lệnh này trên các vùng chọn chồng chéo nhau",
|
|
9
|
+
"acrossMergedCell": "Không thể vượt qua các ô đã hợp nhất",
|
|
10
|
+
"partOfCell": "Chỉ chọn một phần của ô đã hợp nhất",
|
|
11
|
+
"hideSheet": "Không có bảng tính nào hiển thị sau khi ẩn"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
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,8 @@
|
|
|
1
|
+
import { ICellData, IStyleData, Nullable, Styles } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
export declare function handleStyle(styles: Styles, oldVal: ICellData, newVal: ICellData): void;
|
|
4
|
+
/**
|
|
5
|
+
* Convert old style data for storage
|
|
6
|
+
* @param style
|
|
7
|
+
*/
|
|
8
|
+
export declare function transformStyle(oldStyle: Nullable<IStyleData>, newStyle: Nullable<IStyleData>): Nullable<IStyleData>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CellValue, ICellData, Nullable, Styles, CellValueType } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get cell value type by style, new value and old value.
|
|
5
|
+
* If the new value contains t, then take t directly. In other cases, we need to dynamically determine based on actual data and styles
|
|
6
|
+
* @param newVal
|
|
7
|
+
* @param oldVal
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getCellType(styles: Styles, newVal: ICellData, oldVal: ICellData): void | CellValueType | null;
|
|
11
|
+
/**
|
|
12
|
+
* Get the correct type after setting values to a cell.
|
|
13
|
+
*
|
|
14
|
+
* @param v the new value
|
|
15
|
+
* @param type the old type
|
|
16
|
+
* @returns the new type
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkCellValueType(v: Nullable<CellValue>, type: Nullable<CellValueType>): Nullable<CellValueType>;
|
|
19
|
+
export declare function getCellTypeByPattern(cell: ICellData, pattern: string): Nullable<CellValueType>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ICellData, Nullable, CellValueType } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Get cell value from new value by type
|
|
5
|
+
* @param type
|
|
6
|
+
* @param cell
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
export declare function getCellValue(type: Nullable<CellValueType>, cell: ICellData): Nullable<import('@univerjs/core').CellValue>;
|
|
10
|
+
/**
|
|
11
|
+
* Check if the value can be casted to a boolean.
|
|
12
|
+
* @internal
|
|
13
|
+
* @param value
|
|
14
|
+
* @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.
|
|
15
|
+
*/
|
|
16
|
+
export declare function extractBooleanValue(value: Nullable<string | number | boolean>): Nullable<boolean>;
|
|
17
|
+
/**
|
|
18
|
+
* Supplement the data of the cell, set the other value to NULL, Used to reset properties when undoing
|
|
19
|
+
* @param value
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
export declare function setNull(value: Nullable<ICellData>): ICellData | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, Worksheet } from '@univerjs/core';
|
|
1
|
+
import { ICellData, IObjectMatrixPrimitiveType, IRange, Nullable, UniverInstanceService, Workbook, Worksheet } from '@univerjs/core';
|
|
2
2
|
import { IExpandParams } from '../commands/commands/utils/selection-utils';
|
|
3
3
|
|
|
4
4
|
export declare const groupByKey: <T = Record<string, unknown>>(arr: T[], key: string, blankKey?: string) => Record<string, T[]>;
|
|
@@ -17,3 +17,4 @@ export declare function generateNullCell(range: IRange[]): IObjectMatrixPrimitiv
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function generateNullCellValue(range: IRange[]): IObjectMatrixPrimitiveType<ICellData>;
|
|
19
19
|
export declare function generateNullCellStyle(ranges: IRange[]): IObjectMatrixPrimitiveType<ICellData>;
|
|
20
|
+
export declare function getActiveWorksheet(instanceService: UniverInstanceService): [Nullable<Workbook>, Nullable<Worksheet>];
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation } from '@univerjs/core';
|
|
3
2
|
import { IAddWorksheetMergeMutationParams, IRemoveWorksheetMergeMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
export declare const AddMergeUndoMutationFactory: (accessor: IAccessor, params: IAddWorksheetMergeMutationParams) => IRemoveWorksheetMergeMutationParams;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IAccessor } from '@
|
|
2
|
-
import { IMutation, IMutationInfo } from '@univerjs/core';
|
|
1
|
+
import { IAccessor, IMutation, IMutationInfo } from '@univerjs/core';
|
|
3
2
|
import { IAddRangeProtectionMutationParams } from './add-range-protection.mutation';
|
|
4
3
|
|
|
5
4
|
export interface IDeleteSelectionProtectionMutationParams {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation } from '@univerjs/core';
|
|
3
2
|
import { IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
export declare const InsertRowMutationUndoFactory: (accessor: IAccessor, params: IInsertRowMutationParams) => IRemoveRowsMutationParams;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation } from '@univerjs/core';
|
|
3
2
|
import { IInsertSheetMutationParams, IRemoveSheetMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { ICommand, IMutationInfo, IRange } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, ICommand, IMutationInfo, IRange } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export declare const factorySetNumfmtUndoMutation: (accessor: IAccessor, option: ISetNumfmtMutationParams) => IMutationInfo<ISetNumfmtMutationParams | IRemoveNumfmtMutationParams>[];
|
|
5
4
|
export interface ISetNumfmtMutationParams {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation, Worksheet } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation, Worksheet } from '@univerjs/core';
|
|
3
2
|
import { IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
export declare const RemoveRowsUndoMutationFactory: (params: IRemoveRowsMutationParams, worksheet: Worksheet) => IInsertRowMutationParams;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation } from '@univerjs/core';
|
|
3
2
|
import { IInsertSheetMutationParams, IRemoveSheetMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation } from '@univerjs/core';
|
|
3
2
|
import { IAddWorksheetMergeMutationParams, IRemoveWorksheetMergeMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
export declare const RemoveMergeUndoMutationFactory: (accessor: IAccessor, params: IRemoveWorksheetMergeMutationParams) => IAddWorksheetMergeMutationParams;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IAccessor } from '@
|
|
2
|
-
import { IMutation, IMutationInfo } from '@univerjs/core';
|
|
1
|
+
import { IAccessor, IMutation, IMutationInfo } from '@univerjs/core';
|
|
3
2
|
import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
|
|
4
3
|
|
|
5
4
|
export interface ISetRangeProtectionMutationParams {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, ICellData, ICopyToOptionsData, IMutation, IMutationCommonParams, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
/** Params of `SetRangeValuesMutation` */
|
|
5
4
|
export interface ISetRangeValuesMutationParams extends IMutationCommonParams {
|
|
@@ -31,49 +30,3 @@ export declare const SetRangeValuesUndoMutationFactory: (accessor: IAccessor, pa
|
|
|
31
30
|
Intercept 15-digit number reference function truncateNumber
|
|
32
31
|
*/
|
|
33
32
|
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>;
|
|
49
|
-
/**
|
|
50
|
-
* Convert old style data for storage
|
|
51
|
-
* @param style
|
|
52
|
-
*/
|
|
53
|
-
export declare function transformStyle(oldStyle: Nullable<IStyleData>, newStyle: Nullable<IStyleData>): Nullable<IStyleData>;
|
|
54
|
-
/**
|
|
55
|
-
* Convert old style normal key for storage
|
|
56
|
-
*
|
|
57
|
-
* @param style
|
|
58
|
-
*/
|
|
59
|
-
export declare function transformNormalKey(oldStyle: Nullable<IStyleData>, newStyle: Nullable<IStyleData>): Nullable<IStyleData>;
|
|
60
|
-
/**
|
|
61
|
-
* Convert old style border for storage
|
|
62
|
-
*
|
|
63
|
-
|
|
64
|
-
* @param style
|
|
65
|
-
*/
|
|
66
|
-
export declare function transformBorders(oldBorders: IBorderData, newBorders: Nullable<IBorderData>): IBorderData;
|
|
67
|
-
/**
|
|
68
|
-
* merge new style to old style
|
|
69
|
-
*
|
|
70
|
-
* @param oldStyle
|
|
71
|
-
* @param newStyle
|
|
72
|
-
*/
|
|
73
|
-
export declare function mergeStyle(oldStyle: Nullable<IStyleData>, newStyle: Nullable<IStyleData>, isRichText?: boolean): Nullable<IStyleData>;
|
|
74
|
-
/**
|
|
75
|
-
* Find the text style of all paragraphs and modify it to the new style
|
|
76
|
-
* @param p
|
|
77
|
-
* @param newStyle
|
|
78
|
-
*/
|
|
79
|
-
export declare function mergeRichTextStyle(p: IDocumentData, newStyle: Nullable<IStyleData>): void;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutation, IObjectArrayPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutation, IObjectArrayPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export interface ISetWorksheetColWidthMutationParams {
|
|
5
4
|
unitId: string;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { BooleanNumber, IMutation, IObjectArrayPrimitiveType, IRange, IRowAutoHeightInfo, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { BooleanNumber, IAccessor, IMutation, IObjectArrayPrimitiveType, IRange, IRowAutoHeightInfo, Nullable } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export interface ISetWorksheetRowHeightMutationParams {
|
|
5
4
|
unitId: string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { IOperation } from '@univerjs/core';
|
|
2
2
|
import { ISelectionWithStyle } from '../../basics/selection';
|
|
3
|
-
import { SelectionMoveType } from '../../services/selection-manager.service';
|
|
3
|
+
import { SelectionMoveType } from '../../services/selections/selection-manager.service';
|
|
4
4
|
|
|
5
5
|
export interface ISetSelectionsOperationParams {
|
|
6
6
|
unitId: string;
|
|
7
7
|
subUnitId: string;
|
|
8
|
-
pluginName: string;
|
|
9
8
|
selections: ISelectionWithStyle[];
|
|
10
9
|
type?: SelectionMoveType;
|
|
11
10
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IAccessor } from '@
|
|
2
|
-
import { IRange } from '@univerjs/core';
|
|
1
|
+
import { IAccessor, IRange } from '@univerjs/core';
|
|
3
2
|
import { IAddMergeCommandParams } from '../commands/add-worksheet-merge.command';
|
|
4
3
|
import { ISetSelectionsOperationParams } from '../operations/selection.operation';
|
|
5
4
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable, Dimension, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
import { IAccessor } from '@wendellhu/redi';
|
|
1
|
+
import { IAccessor, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable, Dimension, ObjectMatrix } from '@univerjs/core';
|
|
3
2
|
import { IDeleteRangeMutationParams, IInsertRangeMutationParams } from '../../basics/interfaces/mutation-interface';
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
2
|
-
import { Dependency } from '@wendellhu/redi';
|
|
1
|
+
import { Dependency, IWorkbookData, Univer } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
5
4
|
univer: Univer;
|
|
6
5
|
get: {
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
12
|
-
<T>(id: import('@
|
|
6
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
|
|
7
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
|
|
8
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
|
|
9
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
|
|
10
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
13
12
|
};
|
|
14
13
|
sheet: import('@univerjs/core').Workbook;
|
|
15
14
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IStyleData, Disposable, ICommandService, IConfigService } from '@univerjs/core';
|
|
2
|
-
import { IDisposable } from '@wendellhu/redi';
|
|
1
|
+
import { IDisposable, IStyleData, Disposable, ICommandService, IConfigService } from '@univerjs/core';
|
|
3
2
|
import { DataSyncPrimaryController } from '@univerjs/rpc';
|
|
4
3
|
|
|
5
4
|
export interface IStyleTypeValue<T> {
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { IRange, Dimension, Disposable, DisposableCollection, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { IRange, Dimension, Disposable, DisposableCollection, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
3
2
|
import { IRemoveWorksheetMergeMutationParams } from '../basics/interfaces/mutation-interface';
|
|
4
3
|
import { RefRangeService } from '../services/ref-range/ref-range.service';
|
|
5
4
|
import { EffectRefRangeParams } from '../services/ref-range/type';
|
|
6
|
-
import {
|
|
5
|
+
import { SheetsSelectionsService } from '../services/selections/selection-manager.service';
|
|
7
6
|
import { SheetInterceptorService } from '../services/sheet-interceptor/sheet-interceptor.service';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -21,7 +20,7 @@ export declare class MergeCellController extends Disposable {
|
|
|
21
20
|
private _sheetInterceptorService;
|
|
22
21
|
private _selectionManagerService;
|
|
23
22
|
disposableCollection: DisposableCollection;
|
|
24
|
-
constructor(_commandService: ICommandService, _refRangeService: RefRangeService, _univerInstanceService: IUniverInstanceService, _injector: Injector, _sheetInterceptorService: SheetInterceptorService, _selectionManagerService:
|
|
23
|
+
constructor(_commandService: ICommandService, _refRangeService: RefRangeService, _univerInstanceService: IUniverInstanceService, _injector: Injector, _sheetInterceptorService: SheetInterceptorService, _selectionManagerService: SheetsSelectionsService);
|
|
25
24
|
private _initCommandInterceptor;
|
|
26
25
|
refRangeHandle(config: EffectRefRangeParams, unitId: string, subUnitId: string): {
|
|
27
26
|
redos: {
|
package/lib/types/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export { convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, getNorma
|
|
|
20
20
|
export { rangeMerge, createTopMatrixFromRanges, createTopMatrixFromMatrix, findAllRectangle, RangeMergeUtil } from './basics/rangeMerge';
|
|
21
21
|
export { getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget } from './commands/commands/utils/target-util';
|
|
22
22
|
export { alignToMergedCellsBorders, getCellAtRowCol, setEndForRange, isSingleCellSelection } from './commands/commands/utils/selection-utils';
|
|
23
|
+
export { getSelectionsService } from './commands/utils/selection-command-util';
|
|
23
24
|
export { followSelectionOperation, getPrimaryForRange } from './commands/commands/utils/selection-utils';
|
|
24
25
|
export { handleDeleteRangeMutation } from './commands/utils/handle-range-mutation';
|
|
25
26
|
export { getInsertRangeMutations, getRemoveRangeMutations } from './commands/utils/handle-range-mutation';
|
|
@@ -30,7 +31,8 @@ export { BorderStyleManagerService, type IBorderInfo } from './services/border-s
|
|
|
30
31
|
export * from './services/permission/permission-point';
|
|
31
32
|
export { WorksheetPermissionService } from './services/permission/worksheet-permission/worksheet-permission.service';
|
|
32
33
|
export { WorkbookPermissionService } from './services/permission/workbook-permission/workbook-permission.service';
|
|
33
|
-
export {
|
|
34
|
+
export { SheetsSelectionsService, WorkbookSelections, SelectionMoveType, DISABLE_NORMAL_SELECTIONS, } from './services/selections/selection-manager.service';
|
|
35
|
+
export { IRefSelectionsService, RefSelectionsService } from './services/selections/ref-selections.service';
|
|
34
36
|
export { getAddMergeMutationRangeByType } from './controllers/merge-cell.controller';
|
|
35
37
|
export { NumfmtService } from './services/numfmt/numfmt.service';
|
|
36
38
|
export type { INumfmtItem, INumfmtItemWithCache } from './services/numfmt/type';
|
|
@@ -51,7 +53,7 @@ export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAll
|
|
|
51
53
|
export type { IWorksheetProtectionRule } from './services/permission/type';
|
|
52
54
|
export { WorksheetProtectionRuleModel, WorksheetProtectionPointModel } from './services/permission/worksheet-permission';
|
|
53
55
|
export { getAllWorkbookPermissionPoint, defaultWorkbookPermissionPoints } from './services/permission/workbook-permission';
|
|
54
|
-
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, } from './services/permission/permission-point';
|
|
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';
|
|
55
57
|
export { RangeProtectionRenderModel, type ICellPermission } from './model/range-protection-render.model';
|
|
56
58
|
export { RangeProtectionRuleModel, type IObjectModel, type IRangeProtectionRule, type IModel } from './model/range-protection-rule.model';
|
|
57
59
|
export type { IWorksheetProtectionRenderCellData } from './services/permission/worksheet-permission/type';
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
2
|
-
import { Dependency } from '@wendellhu/redi';
|
|
1
|
+
import { Dependency, IWorkbookData, Univer } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export declare const TEST_WORKBOOK_DATA_DEMO: IWorkbookData;
|
|
5
4
|
export declare function createTestBase(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
6
5
|
univer: Univer;
|
|
7
6
|
get: {
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
12
|
-
<T>(id: import('@
|
|
13
|
-
<T>(id: import('@
|
|
7
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
|
|
8
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
|
|
9
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
|
|
10
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
|
|
11
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
12
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
14
13
|
};
|
|
15
14
|
sheet: import('@univerjs/core').Workbook;
|
|
16
15
|
};
|
|
@@ -19,4 +19,4 @@ export interface INumfmtService {
|
|
|
19
19
|
}>): void;
|
|
20
20
|
deleteValues(unitId: string, subUnitId: string, values: IRange[]): void;
|
|
21
21
|
}
|
|
22
|
-
export declare const INumfmtService: import('@
|
|
22
|
+
export declare const INumfmtService: import('@univerjs/core').IdentifierDecorator<INumfmtService>;
|
|
@@ -48,5 +48,7 @@ export { WorkbookSharePermission } from './workbook/share';
|
|
|
48
48
|
export { WorkbookCopyPermission } from './workbook/copy';
|
|
49
49
|
export { WorkbookCopySheetPermission } from './workbook/copy-sheet';
|
|
50
50
|
export { WorkbookManageCollaboratorPermission } from './workbook/manage-collaborator';
|
|
51
|
+
export { WorkbookViewHistoryPermission } from './workbook/view-history';
|
|
52
|
+
export { WorkbookRecoverHistoryPermission } from './workbook/recover-history';
|
|
51
53
|
export { RangeProtectionPermissionEditPoint } from './range/edit';
|
|
52
54
|
export { RangeProtectionPermissionViewPoint } from './range/view';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
|
|
4
|
+
export declare class WorkbookRecoverHistoryPermission implements IPermissionPoint {
|
|
5
|
+
unitId: string;
|
|
6
|
+
id: string;
|
|
7
|
+
value: boolean;
|
|
8
|
+
type: UnitObject;
|
|
9
|
+
status: PermissionStatus;
|
|
10
|
+
subType: UnitAction;
|
|
11
|
+
constructor(unitId: string);
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
|
|
4
|
+
export declare class WorkbookViewHistoryPermission implements IPermissionPoint {
|
|
5
|
+
unitId: string;
|
|
6
|
+
id: string;
|
|
7
|
+
value: boolean;
|
|
8
|
+
type: UnitObject;
|
|
9
|
+
status: PermissionStatus;
|
|
10
|
+
subType: UnitAction;
|
|
11
|
+
constructor(unitId: string);
|
|
12
|
+
}
|
package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { IPermissionService, IResourceManagerService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
|
-
import { Injector } from '@wendellhu/redi';
|
|
1
|
+
import { Injector, IPermissionService, IResourceManagerService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
3
2
|
import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
|
|
4
3
|
import { WorksheetProtectionRuleModel } from './worksheet-permission-rule.model';
|
|
5
4
|
import { WorksheetProtectionPointModel } from './worksheet-permission-point.model';
|