@univerjs/sheets 0.4.1 → 0.4.2
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 +1 -1
- package/lib/es/index.js +487 -227
- package/lib/types/basics/row-column-value.d.ts +14 -0
- package/lib/types/commands/commands/__tests__/set-col-data.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/set-row-data.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/__tests__/set-worksheet-default-style.command.spec.d.ts +16 -0
- package/lib/types/commands/commands/set-col-data.command.d.ts +7 -0
- package/lib/types/commands/commands/set-row-data.command.d.ts +7 -0
- package/lib/types/commands/commands/set-style.command.d.ts +1 -1
- package/lib/types/commands/commands/set-worksheet-col-width.command.d.ts +6 -0
- package/lib/types/commands/commands/set-worksheet-default-style.command.d.ts +2 -0
- package/lib/types/commands/commands/toggle-gridlines.command.d.ts +7 -0
- package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +2 -2
- package/lib/types/commands/mutations/delete-range-protection.mutation.d.ts +3 -3
- package/lib/types/commands/mutations/set-col-data.mutation.d.ts +8 -0
- package/lib/types/commands/mutations/set-frozen.mutation.d.ts +8 -0
- package/lib/types/commands/mutations/set-row-data.mutation.d.ts +8 -0
- package/lib/types/commands/mutations/set-worksheet-col-width.mutation.d.ts +3 -0
- package/lib/types/commands/mutations/set-worksheet-default-style.mutation.d.ts +12 -0
- package/lib/types/commands/mutations/toggle-gridlines.mutation.d.ts +7 -0
- package/lib/types/controllers/config.schema.d.ts +4 -0
- package/lib/types/index.d.ts +16 -4
- package/lib/types/model/range-protection.cache.d.ts +5 -2
- package/lib/types/services/border-style-manager.service.d.ts +2 -2
- package/lib/types/services/permission/permission-point/index.d.ts +2 -0
- package/lib/types/services/permission/permission-point/range/delete-protection.d.ts +13 -0
- package/lib/types/services/permission/permission-point/range/manage-collaborator.d.ts +13 -0
- package/lib/types/services/permission/permission-point/workbook/create-permission.d.ts +11 -0
- package/lib/types/services/permission/permission-point/worksheet/delete-protection.d.ts +12 -0
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +3 -3
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +3 -2
- package/lib/types/services/permission/range-permission/util.d.ts +1 -0
- package/lib/types/services/permission/type.d.ts +1 -1
- package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +4 -1
- package/lib/types/services/permission/worksheet-permission/utils.d.ts +2 -2
- package/lib/types/services/selections/selection-manager.service.d.ts +2 -2
- package/lib/umd/index.js +1 -1
- package/package.json +7 -7
- package/lib/types/basics/cell-custom.d.ts +0 -12
- package/lib/types/commands/commands/set-hide-gridlines.command.d.ts +0 -7
- package/lib/types/commands/mutations/set-hide-gridlines.mutatiom.d.ts +0 -8
- /package/lib/types/basics/__tests__/{cell-custom.spec.d.ts → row-column-value.spec.d.ts} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IColumnData, IRowData, Nullable } from '@univerjs/core';
|
|
2
|
+
/**
|
|
3
|
+
* Reset the row data to undefined when undoing the operation
|
|
4
|
+
* @param currentRow
|
|
5
|
+
* @returns
|
|
6
|
+
*/
|
|
7
|
+
export declare function getOldRowData(currentRow: Nullable<Partial<IRowData>>, newRow: Nullable<Partial<IRowData>>): Nullable<Partial<IRowData>>;
|
|
8
|
+
/**
|
|
9
|
+
* Reset the column data to undefined when undoing the operation
|
|
10
|
+
* @param currenColumn
|
|
11
|
+
* @param newColumn
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function getOldColumnData(currenColumn: Nullable<Partial<IColumnData>>, newColumn: Nullable<Partial<IColumnData>>): Nullable<Partial<IColumnData>>;
|
|
@@ -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 {};
|
|
@@ -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,7 @@
|
|
|
1
|
+
import { IColumnData, ICommand, IObjectArrayPrimitiveType, Nullable } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '../utils/interface';
|
|
3
|
+
export type IColumnProperties = Omit<IColumnData, 'w' | 'hd'>;
|
|
4
|
+
export interface ISetColDataCommandParams extends Partial<ISheetCommandSharedParams> {
|
|
5
|
+
columnData: IObjectArrayPrimitiveType<Nullable<IColumnProperties>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SetColDataCommand: ICommand;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ICommand, IObjectArrayPrimitiveType, IRowData, Nullable } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '../utils/interface';
|
|
3
|
+
export type IRowProperties = Omit<IRowData, 'h' | 'ia' | 'ah' | 'hd'>;
|
|
4
|
+
export interface ISetRowDataCommandParams extends Partial<ISheetCommandSharedParams> {
|
|
5
|
+
rowData: IObjectArrayPrimitiveType<Nullable<IRowProperties>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SetRowDataCommand: ICommand;
|
|
@@ -46,7 +46,7 @@ export interface ISetFontSizeCommandParams {
|
|
|
46
46
|
}
|
|
47
47
|
export declare const SetFontSizeCommand: ICommand<ISetFontSizeCommandParams>;
|
|
48
48
|
export interface ISetColorCommandParams {
|
|
49
|
-
value: string;
|
|
49
|
+
value: string | null;
|
|
50
50
|
}
|
|
51
51
|
export declare const SetTextColorCommand: ICommand<ISetColorCommandParams>;
|
|
52
52
|
export declare const ResetTextColorCommand: ICommand;
|
|
@@ -11,3 +11,9 @@ export interface ISetColWidthCommandParams {
|
|
|
11
11
|
value: number;
|
|
12
12
|
}
|
|
13
13
|
export declare const SetColWidthCommand: ICommand;
|
|
14
|
+
export interface ISetWorksheetColIsAutoWidthCommandParams {
|
|
15
|
+
unitId?: string;
|
|
16
|
+
subUnitId?: string;
|
|
17
|
+
ranges?: IRange[];
|
|
18
|
+
}
|
|
19
|
+
export declare const SetWorksheetColIsAutoWidthCommand: ICommand;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMutation, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { IRangeProtectionRule } from '../../model/range-protection-rule.model';
|
|
3
|
-
import {
|
|
3
|
+
import { IDeleteRangeProtectionMutationParams } from './delete-range-protection.mutation';
|
|
4
4
|
export interface IAddRangeProtectionMutationParams {
|
|
5
5
|
rules: IRangeProtectionRule[];
|
|
6
6
|
unitId: string;
|
|
@@ -8,5 +8,5 @@ export interface IAddRangeProtectionMutationParams {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
description?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<
|
|
11
|
+
export declare const FactoryAddRangeProtectionMutation: (param: IAddRangeProtectionMutationParams) => IMutationInfo<IDeleteRangeProtectionMutationParams>;
|
|
12
12
|
export declare const AddRangeProtectionMutation: IMutation<IAddRangeProtectionMutationParams>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IAccessor, IMutation, IMutationInfo } from '@univerjs/core';
|
|
2
2
|
import { IAddRangeProtectionMutationParams } from './add-range-protection.mutation';
|
|
3
|
-
export interface
|
|
3
|
+
export interface IDeleteRangeProtectionMutationParams {
|
|
4
4
|
ruleIds: string[];
|
|
5
5
|
unitId: string;
|
|
6
6
|
subUnitId: string;
|
|
7
7
|
}
|
|
8
|
-
export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param:
|
|
9
|
-
export declare const DeleteRangeProtectionMutation: IMutation<
|
|
8
|
+
export declare const FactoryDeleteRangeProtectionMutation: (accessor: IAccessor, param: IDeleteRangeProtectionMutationParams) => IMutationInfo<Omit<IAddRangeProtectionMutationParams, "name">>;
|
|
9
|
+
export declare const DeleteRangeProtectionMutation: IMutation<IDeleteRangeProtectionMutationParams>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IColumnData, IMutation, IObjectArrayPrimitiveType, Nullable, Worksheet } from '@univerjs/core';
|
|
2
|
+
export interface ISetColDataMutationParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
columnData: IObjectArrayPrimitiveType<Nullable<IColumnData>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SetColDataMutationFactory: (params: ISetColDataMutationParams, worksheet: Worksheet) => ISetColDataMutationParams;
|
|
8
|
+
export declare const SetColDataMutation: IMutation<ISetColDataMutationParams>;
|
|
@@ -4,7 +4,15 @@ export interface ISetFrozenMutationParams {
|
|
|
4
4
|
subUnitId: string;
|
|
5
5
|
startRow: number;
|
|
6
6
|
startColumn: number;
|
|
7
|
+
/**
|
|
8
|
+
* Number of frozen rows.
|
|
9
|
+
* if row freeze start at 7, end at 10, then ySplit is 3
|
|
10
|
+
*/
|
|
7
11
|
ySplit: number;
|
|
12
|
+
/**
|
|
13
|
+
* Number of frozen columns.
|
|
14
|
+
* if column freeze start at 7, end at 10, then xSplit is 3
|
|
15
|
+
*/
|
|
8
16
|
xSplit: number;
|
|
9
17
|
resetScroll?: boolean;
|
|
10
18
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IMutation, IObjectArrayPrimitiveType, IRowData, Nullable, Worksheet } from '@univerjs/core';
|
|
2
|
+
export interface ISetRowDataMutationParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
rowData: IObjectArrayPrimitiveType<Nullable<IRowData>>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SetRowDataMutationFactory: (params: ISetRowDataMutationParams, worksheet: Worksheet) => ISetRowDataMutationParams;
|
|
8
|
+
export declare const SetRowDataMutation: IMutation<ISetRowDataMutationParams>;
|
|
@@ -12,4 +12,7 @@ export interface ISetWorksheetColWidthMutationParams {
|
|
|
12
12
|
* for each column in the range.
|
|
13
13
|
*/
|
|
14
14
|
export declare const SetWorksheetColWidthMutationFactory: (params: ISetWorksheetColWidthMutationParams, worksheet: Worksheet) => ISetWorksheetColWidthMutationParams;
|
|
15
|
+
/**
|
|
16
|
+
* Set width of column manually
|
|
17
|
+
*/
|
|
15
18
|
export declare const SetWorksheetColWidthMutation: IMutation<ISetWorksheetColWidthMutationParams>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IAccessor, IMutation, IStyleData, Nullable } from '@univerjs/core';
|
|
2
|
+
export interface ISetWorksheetDefaultStyleMutationParams {
|
|
3
|
+
unitId: string;
|
|
4
|
+
subUnitId: string;
|
|
5
|
+
defaultStyle: string | Nullable<IStyleData>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SetWorksheetDefaultStyleMutation: IMutation<ISetWorksheetDefaultStyleMutationParams>;
|
|
8
|
+
export declare const SetWorksheetDefaultStyleMutationFactory: (accessor: IAccessor, params: ISetWorksheetDefaultStyleMutationParams) => {
|
|
9
|
+
unitId: string;
|
|
10
|
+
subUnitId: string;
|
|
11
|
+
defaultStyle: string | Nullable<IStyleData>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BooleanNumber, IMutation } from '@univerjs/core';
|
|
2
|
+
export interface IToggleGridlinesMutationParams {
|
|
3
|
+
showGridlines: BooleanNumber;
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const ToggleGridlinesMutation: IMutation<IToggleGridlinesMutationParams>;
|
|
@@ -9,5 +9,9 @@ export interface IUniverSheetsConfig {
|
|
|
9
9
|
* web worker environment or server-side-calculation.
|
|
10
10
|
*/
|
|
11
11
|
onlyRegisterFormulaRelatedMutations?: true;
|
|
12
|
+
/**
|
|
13
|
+
* If the row style and column style be set both, and the row style should precede the column style or not.
|
|
14
|
+
*/
|
|
15
|
+
isRowStylePrecedeColumnStyle?: boolean;
|
|
12
16
|
}
|
|
13
17
|
export declare const defaultPluginConfig: IUniverSheetsConfig;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export { COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE } from
|
|
|
18
18
|
export { type IAddWorksheetMergeMutationParams, type IDeleteRangeMutationParams, type IInsertColMutationParams, type IInsertRangeMutationParams, type IInsertRowMutationParams, type IInsertSheetMutationParams, type IRemoveColMutationParams, type IRemoveRowsMutationParams, type IRemoveSheetMutationParams, type IRemoveWorksheetMergeMutationParams, } from './basics/interfaces/mutation-interface';
|
|
19
19
|
export { convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, getNormalSelectionStyle, type ISelectionStyle, type ISelectionWidgetConfig, type ISelectionWithCoordAndStyle, type ISelectionWithStyle, type ISheetRangeLocation, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, transformCellDataToSelectionData, } from './basics/selection';
|
|
20
20
|
export { createTopMatrixFromMatrix, createTopMatrixFromRanges, findAllRectangle, rangeMerge, RangeMergeUtil } from './basics/rangeMerge';
|
|
21
|
+
export { type IUniverSheetsConfig } from './controllers/config.schema';
|
|
21
22
|
export { MAX_CELL_PER_SHEET_KEY } from './controllers/config/config';
|
|
22
23
|
export { BorderStyleManagerService, type IBorderInfo } from './services/border-style-manager.service';
|
|
23
24
|
export * from './services/permission/permission-point';
|
|
@@ -46,7 +47,7 @@ export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAll
|
|
|
46
47
|
export type { IWorksheetProtectionRule } from './services/permission/type';
|
|
47
48
|
export { WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from './services/permission/worksheet-permission';
|
|
48
49
|
export { defaultWorkbookPermissionPoints, getAllWorkbookPermissionPoint } from './services/permission/workbook-permission';
|
|
49
|
-
export { WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCreateSheetPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookHistoryPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPivotTablePermission, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, } from './services/permission/permission-point';
|
|
50
|
+
export { WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCreateProtectPermission, WorkbookCreateSheetPermission, WorkbookDeleteSheetPermission, WorkbookDuplicatePermission, WorkbookEditablePermission, WorkbookExportPermission, WorkbookHideSheetPermission, WorkbookHistoryPermission, WorkbookManageCollaboratorPermission, WorkbookMoveSheetPermission, WorkbookPrintPermission, WorkbookRecoverHistoryPermission, WorkbookRenameSheetPermission, WorkbookSharePermission, WorkbookViewHistoryPermission, WorkbookViewPermission, WorksheetCopyPermission, WorksheetDeleteColumnPermission, WorksheetDeleteProtectionPermission, WorksheetDeleteRowPermission, WorksheetEditExtraObjectPermission, WorksheetEditPermission, WorksheetFilterPermission, WorksheetInsertColumnPermission, WorksheetInsertHyperlinkPermission, WorksheetInsertRowPermission, WorksheetManageCollaboratorPermission, WorksheetPivotTablePermission, WorksheetSelectProtectedCellsPermission, WorksheetSelectUnProtectedCellsPermission, WorksheetSetCellStylePermission, WorksheetSetCellValuePermission, WorksheetSetColumnStylePermission, WorksheetSetRowStylePermission, WorksheetSortPermission, WorksheetViewPermission, } from './services/permission/permission-point';
|
|
50
51
|
export { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
51
52
|
export { checkRangesEditablePermission } from './services/permission/util';
|
|
52
53
|
export { type ICellPermission, RangeProtectionRenderModel } from './model/range-protection-render.model';
|
|
@@ -58,6 +59,9 @@ export { RangeProtectionService } from './services/permission/range-permission/r
|
|
|
58
59
|
export { getAllRangePermissionPoint, getDefaultRangePermission, type IRangePermissionPoint, } from './services/permission/range-permission/util';
|
|
59
60
|
export { RangeProtectionPermissionEditPoint } from './services/permission/permission-point/range/edit';
|
|
60
61
|
export { RangeProtectionPermissionViewPoint } from './services/permission/permission-point/range/view';
|
|
62
|
+
export { RangeProtectionPermissionManageCollaPoint } from './services/permission/permission-point/range/manage-collaborator';
|
|
63
|
+
export { RangeProtectionPermissionDeleteProtectionPoint } from './services/permission/permission-point/range/delete-protection';
|
|
64
|
+
export { baseProtectionActions } from './services/permission/range-permission/util';
|
|
61
65
|
export { generateNullCell, generateNullCellValue } from './basics/utils';
|
|
62
66
|
export { getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget } from './commands/commands/utils/target-util';
|
|
63
67
|
export { alignToMergedCellsBorders, getCellAtRowCol, isSingleCellSelection, setEndForRange } from './commands/commands/utils/selection-utils';
|
|
@@ -81,6 +85,12 @@ export { DeleteRangeProtectionCommand, type IDeleteRangeProtectionCommandParams
|
|
|
81
85
|
export { InsertDefinedNameCommand } from './commands/commands/insert-defined-name.command';
|
|
82
86
|
export { InsertRangeMoveDownCommand, type InsertRangeMoveDownCommandParams } from './commands/commands/insert-range-move-down.command';
|
|
83
87
|
export { InsertRangeMoveRightCommand, type InsertRangeMoveRightCommandParams } from './commands/commands/insert-range-move-right.command';
|
|
88
|
+
export { type ISetWorksheetDefaultStyleMutationParams, SetWorksheetDefaultStyleMutation, SetWorksheetDefaultStyleMutationFactory } from './commands/mutations/set-worksheet-default-style.mutation';
|
|
89
|
+
export { SetWorksheetDefaultStyleCommand } from './commands/commands/set-worksheet-default-style.command';
|
|
90
|
+
export { type ISetRowDataMutationParams, SetRowDataMutation, SetRowDataMutationFactory } from './commands/mutations/set-row-data.mutation';
|
|
91
|
+
export { type ISetRowDataCommandParams, SetRowDataCommand } from './commands/commands/set-row-data.command';
|
|
92
|
+
export { type ISetColDataMutationParams, SetColDataMutation, SetColDataMutationFactory } from './commands/mutations/set-col-data.mutation';
|
|
93
|
+
export { type ISetColDataCommandParams, SetColDataCommand } from './commands/commands/set-col-data.command';
|
|
84
94
|
export { type IInsertColCommandParams, type IInsertRowCommandParams, InsertColAfterCommand, InsertColBeforeCommand, InsertColCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowCommand, } from './commands/commands/insert-row-col.command';
|
|
85
95
|
export { type IInsertSheetCommandParams, InsertSheetCommand } from './commands/commands/insert-sheet.command';
|
|
86
96
|
export { getMoveRangeUndoRedoMutations, type IMoveRangeCommandParams, MoveRangeCommand } from './commands/commands/move-range.command';
|
|
@@ -95,7 +105,7 @@ export { type ISetSpecificColsVisibleCommandParams, SetColHiddenCommand, SetSele
|
|
|
95
105
|
export { SetDefinedNameCommand } from './commands/commands/set-defined-name.command';
|
|
96
106
|
export { SetFrozenCancelCommand } from './commands/commands/set-frozen-cancel.command';
|
|
97
107
|
export { SetFrozenCommand } from './commands/commands/set-frozen.command';
|
|
98
|
-
export {
|
|
108
|
+
export { type IToggleGridlinesCommandParams, ToggleGridlinesCommand } from './commands/commands/toggle-gridlines.command';
|
|
99
109
|
export { type ISetRangeProtectionCommandParams, SetRangeProtectionCommand } from './commands/commands/set-range-protection.command';
|
|
100
110
|
export { type ISetRangeValuesCommandParams, SetRangeValuesCommand } from './commands/commands/set-range-values.command';
|
|
101
111
|
export { type ISetSpecificRowsVisibleCommandParams, SetRowHiddenCommand, SetSelectedRowsVisibleCommand, SetSpecificRowsVisibleCommand, } from './commands/commands/set-row-visible.command';
|
|
@@ -115,8 +125,9 @@ export type { ISetWorksheetShowCommandParams } from './commands/commands/set-wor
|
|
|
115
125
|
export { AddRangeProtectionMutation, FactoryAddRangeProtectionMutation, type IAddRangeProtectionMutationParams } from './commands/mutations/add-range-protection.mutation';
|
|
116
126
|
export { AddMergeUndoMutationFactory, AddWorksheetMergeMutation } from './commands/mutations/add-worksheet-merge.mutation';
|
|
117
127
|
export { AddWorksheetProtectionMutation, type IAddWorksheetProtectionParams } from './commands/mutations/add-worksheet-protection.mutation';
|
|
118
|
-
export { DeleteRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, type
|
|
128
|
+
export { DeleteRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, type IDeleteRangeProtectionMutationParams } from './commands/mutations/delete-range-protection.mutation';
|
|
119
129
|
export { DeleteWorksheetProtectionMutation } from './commands/mutations/delete-worksheet-protection.mutation';
|
|
130
|
+
export type { IDeleteWorksheetProtectionParams } from './commands/mutations/delete-worksheet-protection.mutation';
|
|
120
131
|
export { EmptyMutation } from './commands/mutations/empty.mutation';
|
|
121
132
|
export { InsertColMutation, InsertColMutationUndoFactory, InsertRowMutation, InsertRowMutationUndoFactory, } from './commands/mutations/insert-row-col.mutation';
|
|
122
133
|
export { InsertSheetMutation, InsertSheetUndoMutationFactory } from './commands/mutations/insert-sheet.mutation';
|
|
@@ -129,7 +140,7 @@ export { RemoveMergeUndoMutationFactory, RemoveWorksheetMergeMutation } from './
|
|
|
129
140
|
export { type IReorderRangeMutationParams, ReorderRangeMutation, ReorderRangeUndoMutationFactory } from './commands/mutations/reorder-range.mutation';
|
|
130
141
|
export { type ISetColHiddenMutationParams, type ISetColVisibleMutationParams, SetColHiddenMutation, SetColVisibleMutation, } from './commands/mutations/set-col-visible.mutation';
|
|
131
142
|
export { type ISetFrozenMutationParams, SetFrozenMutation, SetFrozenMutationFactory, } from './commands/mutations/set-frozen.mutation';
|
|
132
|
-
export {
|
|
143
|
+
export { type IToggleGridlinesMutationParams, ToggleGridlinesMutation } from './commands/mutations/toggle-gridlines.mutation';
|
|
133
144
|
export { FactorySetRangeProtectionMutation, type ISetRangeProtectionMutationParams, SetRangeProtectionMutation } from './commands/mutations/set-range-protection.mutation';
|
|
134
145
|
export { type ISetRangeValuesMutationParams, type ISetRangeValuesRangeMutationParams, SetRangeValuesMutation, SetRangeValuesUndoMutationFactory, } from './commands/mutations/set-range-values.mutation';
|
|
135
146
|
export { type ISetRowHiddenMutationParams, type ISetRowVisibleMutationParams, SetRowHiddenMutation, SetRowVisibleMutation, } from './commands/mutations/set-row-visible.mutation';
|
|
@@ -142,6 +153,7 @@ export { type ISetWorksheetOrderMutationParams, SetWorksheetOrderMutation } from
|
|
|
142
153
|
export { SetWorksheetPermissionPointsMutation } from './commands/mutations/set-worksheet-permission-points.mutation';
|
|
143
154
|
export type { ISetWorksheetPermissionPointsMutationParams } from './commands/mutations/set-worksheet-permission-points.mutation';
|
|
144
155
|
export { SetWorksheetProtectionMutation } from './commands/mutations/set-worksheet-protection.mutation';
|
|
156
|
+
export type { ISetWorksheetProtectionParams } from './commands/mutations/set-worksheet-protection.mutation';
|
|
145
157
|
export { SetWorksheetRightToLeftMutation } from './commands/mutations/set-worksheet-right-to-left.mutation';
|
|
146
158
|
export { type ISetWorksheetRowAutoHeightMutationParams, type ISetWorksheetRowHeightMutationParams, type ISetWorksheetRowIsAutoHeightMutationParams, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowIsAutoHeightMutation, } from './commands/mutations/set-worksheet-row-height.mutation';
|
|
147
159
|
export { ScrollToCellOperation } from './commands/operations/scroll-to-cell.operation';
|
|
@@ -19,6 +19,7 @@ export declare class RangeProtectionCache extends Disposable {
|
|
|
19
19
|
private _ensureRowColInfoMap;
|
|
20
20
|
private _addCellRuleCache;
|
|
21
21
|
private _deleteCellRuleCache;
|
|
22
|
+
private _getSelectionActions;
|
|
22
23
|
reBuildCache(unitId: string, subUnitId: string): void;
|
|
23
24
|
getRowPermissionInfo(unitId: string, subUnitId: string, row: number, types: UnitAction[]): boolean;
|
|
24
25
|
getColPermissionInfo(unitId: string, subUnitId: string, col: number, types: UnitAction[]): boolean;
|
|
@@ -27,10 +28,12 @@ export declare class RangeProtectionCache extends Disposable {
|
|
|
27
28
|
ruleId?: string;
|
|
28
29
|
ranges?: IRange[];
|
|
29
30
|
}) | {
|
|
30
|
-
1: boolean;
|
|
31
|
-
0: boolean;
|
|
32
31
|
ruleId: string;
|
|
33
32
|
ranges: IRange[];
|
|
33
|
+
1: boolean;
|
|
34
|
+
0: boolean;
|
|
35
|
+
2: boolean;
|
|
36
|
+
42: boolean;
|
|
34
37
|
} | undefined;
|
|
35
38
|
deleteUnit(unitId: string): void;
|
|
36
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BorderStyleTypes, BorderType
|
|
1
|
+
import { IDisposable, BorderStyleTypes, BorderType } from '@univerjs/core';
|
|
2
2
|
export interface IBorderInfo {
|
|
3
3
|
type: BorderType;
|
|
4
4
|
color: string | undefined;
|
|
@@ -18,5 +18,5 @@ export declare class BorderStyleManagerService implements IDisposable {
|
|
|
18
18
|
setStyle(style: BorderStyleTypes): void;
|
|
19
19
|
setActiveBorderType(status: boolean): void;
|
|
20
20
|
getBorderInfo(): Readonly<IBorderInfo>;
|
|
21
|
-
private
|
|
21
|
+
private _refresh;
|
|
22
22
|
}
|
|
@@ -18,6 +18,7 @@ export { RangeProtectionPermissionViewPoint } from './range/view';
|
|
|
18
18
|
export { WorkbookCommentPermission } from './workbook/comment';
|
|
19
19
|
export { WorkbookCopyPermission } from './workbook/copy';
|
|
20
20
|
export { WorkbookCopySheetPermission } from './workbook/copy-sheet';
|
|
21
|
+
export { WorkbookCreateProtectPermission } from './workbook/create-permission';
|
|
21
22
|
export { WorkbookCreateSheetPermission } from './workbook/create-sheet';
|
|
22
23
|
export { WorkbookDeleteSheetPermission } from './workbook/delete-sheet';
|
|
23
24
|
export { WorkbookDuplicatePermission } from './workbook/duplicate';
|
|
@@ -35,6 +36,7 @@ export { WorkbookViewPermission } from './workbook/view';
|
|
|
35
36
|
export { WorkbookViewHistoryPermission } from './workbook/view-history';
|
|
36
37
|
export { WorksheetCopyPermission } from './worksheet/copy';
|
|
37
38
|
export { WorksheetDeleteColumnPermission } from './worksheet/delete-column';
|
|
39
|
+
export { WorksheetDeleteProtectionPermission } from './worksheet/delete-protection';
|
|
38
40
|
export { WorksheetDeleteRowPermission } from './worksheet/delete-row';
|
|
39
41
|
export { WorksheetEditPermission } from './worksheet/edit';
|
|
40
42
|
export { WorksheetEditExtraObjectPermission } from './worksheet/edit-extra-object';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class RangeProtectionPermissionDeleteProtectionPoint implements IPermissionPoint {
|
|
4
|
+
type: UnitObject;
|
|
5
|
+
subType: UnitAction;
|
|
6
|
+
status: PermissionStatus;
|
|
7
|
+
value: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
unitId: string;
|
|
10
|
+
subUnitId: string;
|
|
11
|
+
permissionId: string;
|
|
12
|
+
constructor(unitId: string, subUnitId: string, permissionId: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class RangeProtectionPermissionManageCollaPoint implements IPermissionPoint {
|
|
4
|
+
type: UnitObject;
|
|
5
|
+
subType: UnitAction;
|
|
6
|
+
status: PermissionStatus;
|
|
7
|
+
value: boolean;
|
|
8
|
+
id: string;
|
|
9
|
+
unitId: string;
|
|
10
|
+
subUnitId: string;
|
|
11
|
+
permissionId: string;
|
|
12
|
+
constructor(unitId: string, subUnitId: string, permissionId: string);
|
|
13
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class WorkbookCreateProtectPermission implements IPermissionPoint {
|
|
4
|
+
unitId: string;
|
|
5
|
+
id: string;
|
|
6
|
+
value: boolean;
|
|
7
|
+
type: UnitObject;
|
|
8
|
+
status: PermissionStatus;
|
|
9
|
+
subType: UnitAction;
|
|
10
|
+
constructor(unitId: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IPermissionPoint, PermissionStatus } from '@univerjs/core';
|
|
2
|
+
import { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare class WorksheetDeleteProtectionPermission implements IPermissionPoint {
|
|
4
|
+
unitId: string;
|
|
5
|
+
subUnitId: string;
|
|
6
|
+
value: boolean;
|
|
7
|
+
type: UnitObject;
|
|
8
|
+
status: PermissionStatus;
|
|
9
|
+
id: string;
|
|
10
|
+
subType: UnitAction;
|
|
11
|
+
constructor(unitId: string, subUnitId: string);
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IMutationInfo, Disposable, DisposableCollection, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IAddRangeProtectionMutationParams } from '../../../commands/mutations/add-range-protection.mutation';
|
|
3
|
-
import {
|
|
3
|
+
import { IDeleteRangeProtectionMutationParams } from '../../../commands/mutations/delete-range-protection.mutation';
|
|
4
4
|
import { ISetRangeProtectionMutationParams } from '../../../commands/mutations/set-range-protection.mutation';
|
|
5
5
|
import { EffectRefRangeParams } from '../../../services/ref-range/type';
|
|
6
6
|
import { RangeProtectionCache } from '../../../model/range-protection.cache';
|
|
@@ -30,8 +30,8 @@ export declare class RangeProtectionRefRangeService extends Disposable {
|
|
|
30
30
|
params: ISetRangeProtectionMutationParams;
|
|
31
31
|
}[];
|
|
32
32
|
} | {
|
|
33
|
-
redos: IMutationInfo<
|
|
34
|
-
undos: IMutationInfo<
|
|
33
|
+
redos: IMutationInfo<IDeleteRangeProtectionMutationParams | IAddRangeProtectionMutationParams | ISetRangeProtectionMutationParams>[];
|
|
34
|
+
undos: IMutationInfo<IDeleteRangeProtectionMutationParams | IAddRangeProtectionMutationParams | ISetRangeProtectionMutationParams>[];
|
|
35
35
|
};
|
|
36
36
|
private _getRefRangeMutationsByDeleteCols;
|
|
37
37
|
private _getRefRangeMutationsByDeleteRows;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Disposable, IPermissionService, IResourceManagerService } from '@univerjs/core';
|
|
1
|
+
import { Disposable, IPermissionService, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { RangeProtectionCache } from '../../../model/range-protection.cache';
|
|
3
3
|
import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
|
|
4
4
|
export declare class RangeProtectionService extends Disposable {
|
|
@@ -6,7 +6,8 @@ export declare class RangeProtectionService extends Disposable {
|
|
|
6
6
|
private _permissionService;
|
|
7
7
|
private _resourceManagerService;
|
|
8
8
|
private _selectionProtectionCache;
|
|
9
|
-
|
|
9
|
+
private _univerInstanceService;
|
|
10
|
+
constructor(_selectionProtectionRuleModel: RangeProtectionRuleModel, _permissionService: IPermissionService, _resourceManagerService: IResourceManagerService, _selectionProtectionCache: RangeProtectionCache, _univerInstanceService: IUniverInstanceService);
|
|
10
11
|
private _initRuleChange;
|
|
11
12
|
private _initSnapshot;
|
|
12
13
|
}
|
|
@@ -3,4 +3,5 @@ import { RangeProtectionPermissionEditPoint } from '../permission-point/range/ed
|
|
|
3
3
|
import { RangeProtectionPermissionViewPoint } from '../permission-point/range/view';
|
|
4
4
|
export type IRangePermissionPoint = RangeProtectionPermissionEditPoint | RangeProtectionPermissionViewPoint;
|
|
5
5
|
export declare const getAllRangePermissionPoint: () => (typeof RangeProtectionPermissionEditPoint)[];
|
|
6
|
+
export declare const baseProtectionActions: UnitAction[];
|
|
6
7
|
export declare const getDefaultRangePermission: (unitId?: string, subUnitId?: string, permissionId?: string) => Record<UnitAction, boolean>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { UnitObject } from '@univerjs/protocol';
|
|
2
2
|
export interface IWorksheetProtectionRule {
|
|
3
3
|
permissionId: string;
|
|
4
|
-
name?: string;
|
|
5
4
|
description?: string;
|
|
6
5
|
unitType: UnitObject;
|
|
7
6
|
unitId: string;
|
|
8
7
|
subUnitId: string;
|
|
8
|
+
name: string;
|
|
9
9
|
}
|
|
10
10
|
export interface IWorksheetProtectionPointRule {
|
|
11
11
|
unitId: string;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Disposable, IPermissionService, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
|
|
3
|
+
import { WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from '../worksheet-permission';
|
|
3
4
|
export declare class WorkbookPermissionService extends Disposable {
|
|
4
5
|
private _permissionService;
|
|
5
6
|
private _univerInstanceService;
|
|
6
7
|
private _rangeProtectionRuleModel;
|
|
7
|
-
|
|
8
|
+
private _worksheetProtectionRuleModel;
|
|
9
|
+
private _worksheetProtectionPointModel;
|
|
10
|
+
constructor(_permissionService: IPermissionService, _univerInstanceService: IUniverInstanceService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _worksheetProtectionPointModel: WorksheetProtectionPointModel);
|
|
8
11
|
private _init;
|
|
9
12
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UnitAction } from '@univerjs/protocol';
|
|
2
|
-
import { WorksheetCopyPermission,
|
|
3
|
-
export declare const getAllWorksheetPermissionPoint: () => (typeof
|
|
2
|
+
import { WorksheetCopyPermission, WorksheetDeleteProtectionPermission } from '../permission-point';
|
|
3
|
+
export declare const getAllWorksheetPermissionPoint: () => (typeof WorksheetDeleteProtectionPermission)[];
|
|
4
4
|
export declare const getAllWorksheetPermissionPointByPointPanel: () => (typeof WorksheetCopyPermission)[];
|
|
5
5
|
export declare const defaultWorksheetPermissionPoint: UnitAction[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepReadonly, ISelectionCell, Nullable, Workbook, Disposable, IUniverInstanceService, RxDisposable } from '@univerjs/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
2
|
+
import { Observable, BehaviorSubject } from 'rxjs';
|
|
3
3
|
import { ISelectionWithStyle } from '../../basics/selection';
|
|
4
4
|
export interface ISelectionManagerSearchParam {
|
|
5
5
|
unitId: string;
|
|
@@ -58,7 +58,7 @@ export declare class WorkbookSelections extends Disposable {
|
|
|
58
58
|
readonly selectionMoveStart$: Observable<Nullable<ISelectionWithStyle[]>>;
|
|
59
59
|
private readonly _selectionMoving$;
|
|
60
60
|
readonly selectionMoving$: Observable<Nullable<ISelectionWithStyle[]>>;
|
|
61
|
-
|
|
61
|
+
readonly _selectionMoveEnd$: BehaviorSubject<ISelectionWithStyle[]>;
|
|
62
62
|
readonly selectionMoveEnd$: Observable<ISelectionWithStyle[]>;
|
|
63
63
|
private readonly _selectionSet$;
|
|
64
64
|
readonly selectionSet$: Observable<ISelectionWithStyle[]>;
|