@univerjs/sheets 0.4.2 → 0.5.0-beta.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/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +3 -3
- package/lib/cjs/locale/en-US.js +1 -0
- package/lib/cjs/locale/fa-IR.js +1 -0
- package/lib/cjs/locale/ru-RU.js +1 -0
- package/lib/cjs/locale/vi-VN.js +1 -0
- package/lib/cjs/locale/zh-CN.js +1 -0
- package/lib/cjs/locale/zh-TW.js +1 -0
- package/lib/es/facade.js +1806 -0
- package/lib/es/index.js +7694 -7605
- package/lib/es/locale/en-US.js +17 -0
- package/lib/es/locale/fa-IR.js +17 -0
- package/lib/es/locale/ru-RU.js +17 -0
- package/lib/es/locale/vi-VN.js +17 -0
- package/lib/es/locale/zh-CN.js +17 -0
- package/lib/es/locale/zh-TW.js +17 -0
- package/lib/types/basics/selection.d.ts +31 -20
- package/lib/types/commands/commands/add-worksheet-protection.command.d.ts +7 -0
- package/lib/types/commands/commands/delete-worksheet-protection.command.d.ts +8 -0
- package/lib/types/commands/commands/set-frozen.command.d.ts +13 -0
- package/lib/types/commands/commands/set-protection.command.d.ts +13 -0
- package/lib/types/commands/commands/set-worksheet-protection.command.d.ts +8 -0
- package/lib/types/commands/mutations/reorder-range.mutation.d.ts +1 -1
- package/lib/types/commands/operations/selection.operation.d.ts +4 -1
- package/lib/types/facade/__tests__/utils.spec.d.ts +16 -0
- package/lib/types/facade/f-permission.d.ts +106 -0
- package/lib/types/facade/f-range.d.ts +193 -0
- package/lib/types/facade/f-selection.d.ts +11 -0
- package/lib/types/facade/f-univer.d.ts +36 -0
- package/lib/types/facade/f-workbook.d.ts +105 -0
- package/lib/types/facade/f-worksheet.d.ts +408 -0
- package/lib/types/facade/index.d.ts +22 -0
- package/lib/types/facade/utils.d.ts +24 -0
- package/lib/types/index.d.ts +11 -9
- package/lib/types/model/range-protection-rule.model.d.ts +10 -1
- package/lib/types/services/permission/type.d.ts +3 -1
- package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +3 -2
- package/lib/types/services/ref-range/util.d.ts +12 -4
- package/lib/types/services/selections/index.d.ts +19 -0
- package/lib/types/services/selections/selection-data-model.d.ts +57 -0
- package/lib/types/services/selections/selection-manager.service.d.ts +15 -61
- package/lib/types/services/selections/type.d.ts +28 -0
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +38 -7
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +3 -3
- package/lib/umd/locale/en-US.js +1 -0
- package/lib/umd/locale/fa-IR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -0
- package/lib/umd/locale/vi-VN.js +1 -0
- package/lib/umd/locale/zh-CN.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -0
- package/package.json +36 -18
- package/lib/locale/en-US.json +0 -14
- package/lib/locale/fa-IR.json +0 -14
- package/lib/locale/ru-RU.json +0 -14
- package/lib/locale/vi-VN.json +0 -14
- package/lib/locale/zh-CN.json +0 -14
- package/lib/locale/zh-TW.json +0 -14
- package/lib/types/commands/commands/set-frozen-cancel.command.d.ts +0 -2
- package/lib/types/commands/commands/set-range-protection.command.d.ts +0 -8
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { CommandListener, IDisposable, IRange, IWorkbookData, Workbook, FBase, ICommandService, ILogService, Injector, IPermissionService, IResourceLoaderService, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
3
|
+
import { FRange } from './f-range';
|
|
4
|
+
import { FWorksheet } from './f-worksheet';
|
|
5
|
+
export declare class FWorkbook extends FBase {
|
|
6
|
+
protected readonly _workbook: Workbook;
|
|
7
|
+
protected readonly _injector: Injector;
|
|
8
|
+
protected readonly _resourceLoaderService: IResourceLoaderService;
|
|
9
|
+
protected readonly _selectionManagerService: SheetsSelectionsService;
|
|
10
|
+
protected readonly _univerInstanceService: IUniverInstanceService;
|
|
11
|
+
protected readonly _commandService: ICommandService;
|
|
12
|
+
protected readonly _permissionService: IPermissionService;
|
|
13
|
+
protected readonly _logService: ILogService;
|
|
14
|
+
readonly id: string;
|
|
15
|
+
constructor(_workbook: Workbook, _injector: Injector, _resourceLoaderService: IResourceLoaderService, _selectionManagerService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _permissionService: IPermissionService, _logService: ILogService);
|
|
16
|
+
getId(): string;
|
|
17
|
+
getName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* save workbook snapshot data, including conditional formatting, data validation, and other plugin data.
|
|
20
|
+
*/
|
|
21
|
+
save(): IWorkbookData;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated use 'save' instead.
|
|
24
|
+
* @return {*} {IWorkbookData}
|
|
25
|
+
* @memberof FWorkbook
|
|
26
|
+
*/
|
|
27
|
+
getSnapshot(): IWorkbookData;
|
|
28
|
+
/**
|
|
29
|
+
* Get the active sheet of the workbook.
|
|
30
|
+
* @returns The active sheet of the workbook
|
|
31
|
+
*/
|
|
32
|
+
getActiveSheet(): FWorksheet;
|
|
33
|
+
/**
|
|
34
|
+
* Gets all the worksheets in this workbook
|
|
35
|
+
* @returns An array of all the worksheets in the workbook
|
|
36
|
+
*/
|
|
37
|
+
getSheets(): FWorksheet[];
|
|
38
|
+
/**
|
|
39
|
+
* Create a new worksheet and returns a handle to it.
|
|
40
|
+
* @param name Name of the new sheet
|
|
41
|
+
* @param rows How may rows would the new sheet have
|
|
42
|
+
* @param column How many columns would the new sheet have
|
|
43
|
+
* @returns The new created sheet
|
|
44
|
+
*/
|
|
45
|
+
create(name: string, rows: number, column: number): FWorksheet;
|
|
46
|
+
/**
|
|
47
|
+
* Get a worksheet by sheet id.
|
|
48
|
+
* @param sheetId The id of the sheet to get.
|
|
49
|
+
* @return The worksheet with given sheet id
|
|
50
|
+
*/
|
|
51
|
+
getSheetBySheetId(sheetId: string): FWorksheet | null;
|
|
52
|
+
/**
|
|
53
|
+
* Get a worksheet by sheet name.
|
|
54
|
+
* @param name The name of the sheet to get.
|
|
55
|
+
* @returns The worksheet with given sheet name
|
|
56
|
+
*/
|
|
57
|
+
getSheetByName(name: string): FWorksheet | null;
|
|
58
|
+
/**
|
|
59
|
+
* Sets the given worksheet to be the active worksheet in the workbook.
|
|
60
|
+
* @param sheet The worksheet to set as the active worksheet.
|
|
61
|
+
* @returns The active worksheet
|
|
62
|
+
*/
|
|
63
|
+
setActiveSheet(sheet: FWorksheet): FWorksheet;
|
|
64
|
+
/**
|
|
65
|
+
* Inserts a new worksheet into the workbook.
|
|
66
|
+
* Using a default sheet name. The new sheet becomes the active sheet
|
|
67
|
+
* @returns The new sheet
|
|
68
|
+
*/
|
|
69
|
+
insertSheet(): FWorksheet;
|
|
70
|
+
/**
|
|
71
|
+
* Deletes the specified worksheet.
|
|
72
|
+
* @param sheet The worksheet to delete.
|
|
73
|
+
*/
|
|
74
|
+
deleteSheet(sheet: FWorksheet): void;
|
|
75
|
+
undo(): Promise<boolean>;
|
|
76
|
+
redo(): Promise<boolean>;
|
|
77
|
+
/**
|
|
78
|
+
* Register a callback that will be triggered before invoking a command targeting the Univer sheet.
|
|
79
|
+
* @param callback the callback.
|
|
80
|
+
* @returns A function to dispose the listening.
|
|
81
|
+
*/
|
|
82
|
+
onBeforeCommandExecute(callback: CommandListener): IDisposable;
|
|
83
|
+
/**
|
|
84
|
+
* Register a callback that will be triggered when a command is invoked targeting the Univer sheet.
|
|
85
|
+
* @param callback the callback.
|
|
86
|
+
* @returns A function to dispose the listening.
|
|
87
|
+
*/
|
|
88
|
+
onCommandExecuted(callback: CommandListener): IDisposable;
|
|
89
|
+
onSelectionChange(callback: (selections: IRange[]) => void): IDisposable;
|
|
90
|
+
/**
|
|
91
|
+
* Used to modify the editing permissions of the workbook. When the value is false, editing is not allowed.
|
|
92
|
+
* @param {boolean} value editable value want to set
|
|
93
|
+
*/
|
|
94
|
+
setEditable(value: boolean): void;
|
|
95
|
+
/**
|
|
96
|
+
* Sets the active selection region for this sheet.
|
|
97
|
+
* @param range The range to set as the active selection.
|
|
98
|
+
*/
|
|
99
|
+
setActiveRange(range: FRange): void;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the selected range in the active sheet, or null if there is no active range.
|
|
102
|
+
* @returns the active range
|
|
103
|
+
*/
|
|
104
|
+
getActiveRange(): FRange | null;
|
|
105
|
+
}
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { CustomData, ICellData, IDisposable, IFreeze, IObjectArrayPrimitiveType, IStyleData, Nullable, Workbook, Worksheet, FBase, ICommandService, Injector, ObjectMatrix } from '@univerjs/core';
|
|
2
|
+
import { FWorkbook } from './f-workbook';
|
|
3
|
+
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
4
|
+
import { FRange } from './f-range';
|
|
5
|
+
import { FSelection } from './f-selection';
|
|
6
|
+
export declare class FWorksheet extends FBase {
|
|
7
|
+
protected readonly _fWorkbook: FWorkbook;
|
|
8
|
+
protected readonly _workbook: Workbook;
|
|
9
|
+
protected readonly _worksheet: Worksheet;
|
|
10
|
+
protected readonly _injector: Injector;
|
|
11
|
+
protected readonly _selectionManagerService: SheetsSelectionsService;
|
|
12
|
+
protected readonly _commandService: ICommandService;
|
|
13
|
+
constructor(_fWorkbook: FWorkbook, _workbook: Workbook, _worksheet: Worksheet, _injector: Injector, _selectionManagerService: SheetsSelectionsService, _commandService: ICommandService);
|
|
14
|
+
/**
|
|
15
|
+
* Returns the injector
|
|
16
|
+
* @returns The injector
|
|
17
|
+
*/
|
|
18
|
+
getInject(): Injector;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the workbook
|
|
21
|
+
* @returns The workbook
|
|
22
|
+
*/
|
|
23
|
+
getWorkbook(): Workbook;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the worksheet id
|
|
26
|
+
* @returns The id of the worksheet
|
|
27
|
+
*/
|
|
28
|
+
getSheetId(): string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the worksheet name
|
|
31
|
+
* @returns The name of the worksheet
|
|
32
|
+
*/
|
|
33
|
+
getSheetName(): string;
|
|
34
|
+
getSelection(): FSelection | null;
|
|
35
|
+
/**
|
|
36
|
+
* Get the default style of the worksheet
|
|
37
|
+
* @returns Default style
|
|
38
|
+
*/
|
|
39
|
+
getDefaultStyle(): Nullable<IStyleData> | string;
|
|
40
|
+
/**
|
|
41
|
+
* Get the default style of the worksheet row
|
|
42
|
+
* @param {number} index The row index
|
|
43
|
+
* @param {boolean} [keepRaw] If true, return the raw style data maybe the style name or style data, otherwise return the data from row manager
|
|
44
|
+
* @returns {Nullable<IStyleData> | string} The default style of the worksheet row name or style data
|
|
45
|
+
*/
|
|
46
|
+
getRowDefaultStyle(index: number, keepRaw?: boolean): Nullable<IStyleData> | string;
|
|
47
|
+
/**
|
|
48
|
+
* Get the default style of the worksheet column
|
|
49
|
+
* @param {number} index The column index
|
|
50
|
+
* @param {boolean} [keepRaw] If true, return the raw style data maybe the style name or style data, otherwise return the data from col manager
|
|
51
|
+
* @returns {Nullable<IStyleData> | string} The default style of the worksheet column name or style data
|
|
52
|
+
*/
|
|
53
|
+
getColumnDefaultStyle(index: number, keepRaw?: boolean): Nullable<IStyleData> | string;
|
|
54
|
+
/**
|
|
55
|
+
* Set the default style of the worksheet
|
|
56
|
+
* @param style default style
|
|
57
|
+
* @returns this worksheet
|
|
58
|
+
*/
|
|
59
|
+
setDefaultStyle(style: string): Promise<FWorksheet>;
|
|
60
|
+
/**
|
|
61
|
+
* Set the default style of the worksheet row
|
|
62
|
+
* @param {number} index The row index
|
|
63
|
+
* @param {string | Nullable<IStyleData>} style The style name or style data
|
|
64
|
+
*/
|
|
65
|
+
setColumnDefaultStyle(index: number, style: string | Nullable<IStyleData>): Promise<FWorksheet>;
|
|
66
|
+
/**
|
|
67
|
+
* Set the default style of the worksheet column
|
|
68
|
+
* @param {number} index The column index
|
|
69
|
+
* @param {string | Nullable<IStyleData>} style The style name or style data
|
|
70
|
+
*/
|
|
71
|
+
setRowDefaultStyle(index: number, style: string | Nullable<IStyleData>): Promise<FWorksheet>;
|
|
72
|
+
/**
|
|
73
|
+
* Returns a Range object representing a single cell at the specified row and column.
|
|
74
|
+
* @param row The row index of the cell.
|
|
75
|
+
* @param column The column index of the cell.
|
|
76
|
+
* @returns A Range object representing the specified cell.
|
|
77
|
+
*/
|
|
78
|
+
getRange(row: number, column: number): FRange;
|
|
79
|
+
/**
|
|
80
|
+
* Returns a Range object representing a range starting at the specified row and column, with the specified number of rows.
|
|
81
|
+
* @param row The starting row index of the range.
|
|
82
|
+
* @param column The starting column index of the range.
|
|
83
|
+
* @param numRows The number of rows in the range.
|
|
84
|
+
* @returns A Range object representing the specified range.
|
|
85
|
+
*/
|
|
86
|
+
getRange(row: number, column: number, numRows: number): FRange;
|
|
87
|
+
/**
|
|
88
|
+
* Returns a Range object representing a range starting at the specified row and column, with the specified number of rows and columns.
|
|
89
|
+
* @param row The starting row index of the range.
|
|
90
|
+
* @param column The starting column index of the range.
|
|
91
|
+
* @param numRows The number of rows in the range.
|
|
92
|
+
* @param numColumns The number of columns in the range.
|
|
93
|
+
* @returns A Range object representing the specified range.
|
|
94
|
+
*/
|
|
95
|
+
getRange(row: number, column: number, numRows: number, numColumns: number): FRange;
|
|
96
|
+
/**
|
|
97
|
+
* Returns a Range object specified by A1 notation.
|
|
98
|
+
* @param a1Notation A string representing a range in A1 notation.
|
|
99
|
+
* @returns A Range object representing the specified range.
|
|
100
|
+
*/
|
|
101
|
+
getRange(a1Notation: string): FRange;
|
|
102
|
+
/**
|
|
103
|
+
* Returns the current number of columns in the sheet, regardless of content.
|
|
104
|
+
* @return The maximum columns count of the sheet
|
|
105
|
+
*/
|
|
106
|
+
getMaxColumns(): number;
|
|
107
|
+
/**
|
|
108
|
+
* Returns the current number of rows in the sheet, regardless of content.
|
|
109
|
+
* @return The maximum rows count of the sheet
|
|
110
|
+
*/
|
|
111
|
+
getMaxRows(): number;
|
|
112
|
+
/**
|
|
113
|
+
* Inserts a row after the given row position.
|
|
114
|
+
* @param afterPosition The row after which the new row should be added, starting at 0 for the first row.
|
|
115
|
+
* @returns This sheet, for chaining.
|
|
116
|
+
*/
|
|
117
|
+
insertRowAfter(afterPosition: number): Promise<FWorksheet>;
|
|
118
|
+
/**
|
|
119
|
+
* Inserts a row before the given row position.
|
|
120
|
+
* @param beforePosition The row before which the new row should be added, starting at 0 for the first row.
|
|
121
|
+
* @returns This sheet, for chaining.
|
|
122
|
+
*/
|
|
123
|
+
insertRowBefore(beforePosition: number): Promise<FWorksheet>;
|
|
124
|
+
/**
|
|
125
|
+
* Inserts one or more consecutive blank rows in a sheet starting at the specified location.
|
|
126
|
+
* @param rowIndex The index indicating where to insert a row, starting at 0 for the first row.
|
|
127
|
+
* @param numRows The number of rows to insert.
|
|
128
|
+
* @returns This sheet, for chaining.
|
|
129
|
+
*/
|
|
130
|
+
insertRows(rowIndex: number, numRows?: number): Promise<FWorksheet>;
|
|
131
|
+
/**
|
|
132
|
+
* Inserts a number of rows after the given row position.
|
|
133
|
+
* @param afterPosition The row after which the new rows should be added, starting at 0 for the first row.
|
|
134
|
+
* @param howMany The number of rows to insert.
|
|
135
|
+
* @returns This sheet, for chaining.
|
|
136
|
+
*/
|
|
137
|
+
insertRowsAfter(afterPosition: number, howMany: number): Promise<FWorksheet>;
|
|
138
|
+
/**
|
|
139
|
+
* Inserts a number of rows before the given row position.
|
|
140
|
+
* @param beforePosition The row before which the new rows should be added, starting at 0 for the first row.
|
|
141
|
+
* @param howMany The number of rows to insert.
|
|
142
|
+
* @returns This sheet, for chaining.
|
|
143
|
+
*/
|
|
144
|
+
insertRowsBefore(beforePosition: number, howMany: number): Promise<FWorksheet>;
|
|
145
|
+
/**
|
|
146
|
+
* Deletes the row at the given row position.
|
|
147
|
+
* @param rowPosition The position of the row, starting at 0 for the first row.
|
|
148
|
+
* @returns This sheet, for chaining.
|
|
149
|
+
*/
|
|
150
|
+
deleteRow(rowPosition: number): Promise<FWorksheet>;
|
|
151
|
+
/**
|
|
152
|
+
* Deletes a number of rows starting at the given row position.
|
|
153
|
+
* @param rowPosition The position of the first row to delete, starting at 0 for the first row.
|
|
154
|
+
* @param howMany The number of rows to delete.
|
|
155
|
+
* @returns This sheet, for chaining.
|
|
156
|
+
*/
|
|
157
|
+
deleteRows(rowPosition: number, howMany: number): Promise<FWorksheet>;
|
|
158
|
+
/**
|
|
159
|
+
* Moves the rows selected by the given range to the position indicated by the destinationIndex. The rowSpec itself does not have to exactly represent an entire row or group of rows to move—it selects all rows that the range spans.
|
|
160
|
+
* @param rowSpec A range spanning the rows that should be moved.
|
|
161
|
+
* @param destinationIndex The index that the rows should be moved to. Note that this index is based on the coordinates before the rows are moved. Existing data is shifted down to make room for the moved rows while the source rows are removed from the grid. Therefore, the data may end up at a different index than originally specified. Use 0-index for this method.
|
|
162
|
+
* @returns This sheet, for chaining.
|
|
163
|
+
*/
|
|
164
|
+
moveRows(rowSpec: FRange, destinationIndex: number): Promise<FWorksheet>;
|
|
165
|
+
/**
|
|
166
|
+
* Hides the rows in the given range.
|
|
167
|
+
* @param row The row range to hide.
|
|
168
|
+
* @returns This sheet, for chaining.
|
|
169
|
+
*/
|
|
170
|
+
hideRow(row: FRange): Promise<FWorksheet>;
|
|
171
|
+
/**
|
|
172
|
+
* Hides one or more consecutive rows starting at the given index. Use 0-index for this method.
|
|
173
|
+
* @param rowIndex The starting index of the rows to hide.
|
|
174
|
+
* @param numRows The number of rows to hide.
|
|
175
|
+
* @returns This sheet, for chaining.
|
|
176
|
+
*/
|
|
177
|
+
hideRows(rowIndex: number, numRows?: number): Promise<FWorksheet>;
|
|
178
|
+
/**
|
|
179
|
+
* Unhides the row in the given range.
|
|
180
|
+
* @param row The range to unhide, if hidden.
|
|
181
|
+
* @returns This sheet, for chaining.
|
|
182
|
+
*/
|
|
183
|
+
unhideRow(row: FRange): Promise<FWorksheet>;
|
|
184
|
+
/**
|
|
185
|
+
* Unhides one or more consecutive rows starting at the given index. Use 0-index for this method.
|
|
186
|
+
* @param rowIndex The starting index of the rows to unhide.
|
|
187
|
+
* @param numRows The number of rows to unhide.
|
|
188
|
+
* @returns This sheet, for chaining.
|
|
189
|
+
*/
|
|
190
|
+
showRows(rowIndex: number, numRows?: number): Promise<FWorksheet>;
|
|
191
|
+
/**
|
|
192
|
+
* Sets the row height of the given row in pixels. By default, rows grow to fit cell contents. If you want to force rows to a specified height, use setRowHeightsForced(startRow, numRows, height).
|
|
193
|
+
* @param rowPosition The row position to change.
|
|
194
|
+
* @param height The height in pixels to set it to.
|
|
195
|
+
* @returns This sheet, for chaining.
|
|
196
|
+
*/
|
|
197
|
+
setRowHeight(rowPosition: number, height: number): Promise<FWorksheet>;
|
|
198
|
+
/**
|
|
199
|
+
* Sets the height of the given rows in pixels. By default, rows grow to fit cell contents. If you want to force rows to a specified height, use setRowHeightsForced(startRow, numRows, height).
|
|
200
|
+
* @param startRow The starting row position to change.
|
|
201
|
+
* @param numRows The number of rows to change.
|
|
202
|
+
* @param height The height in pixels to set it to.
|
|
203
|
+
* @returns This sheet, for chaining.
|
|
204
|
+
*/
|
|
205
|
+
setRowHeights(startRow: number, numRows: number, height: number): Promise<FWorksheet>;
|
|
206
|
+
/**
|
|
207
|
+
* Sets the height of the given rows in pixels. By default, rows grow to fit cell contents. When you use setRowHeightsForced, rows are forced to the specified height even if the cell contents are taller than the row height.
|
|
208
|
+
* @param startRow The starting row position to change.
|
|
209
|
+
* @param numRows The number of rows to change.
|
|
210
|
+
* @param height The height in pixels to set it to.
|
|
211
|
+
* @returns This sheet, for chaining.
|
|
212
|
+
*/
|
|
213
|
+
setRowHeightsForced(startRow: number, numRows: number, height: number): Promise<FWorksheet>;
|
|
214
|
+
/**
|
|
215
|
+
* Set custom properties for given rows.
|
|
216
|
+
* @param custom The custom properties to set.
|
|
217
|
+
* @returns This sheet, for chaining.
|
|
218
|
+
*/
|
|
219
|
+
setRowCustom(custom: IObjectArrayPrimitiveType<CustomData>): Promise<FWorksheet>;
|
|
220
|
+
/**
|
|
221
|
+
* Inserts a column after the given column position.
|
|
222
|
+
* @param afterPosition The column after which the new column should be added, starting at 0 for the first column.
|
|
223
|
+
* @returns This sheet, for chaining.
|
|
224
|
+
*/
|
|
225
|
+
insertColumnAfter(afterPosition: number): Promise<FWorksheet>;
|
|
226
|
+
/**
|
|
227
|
+
* Inserts a column before the given column position.
|
|
228
|
+
* @param beforePosition The column before which the new column should be added, starting at 0 for the first column.
|
|
229
|
+
* @returns This sheet, for chaining.
|
|
230
|
+
*/
|
|
231
|
+
insertColumnBefore(beforePosition: number): Promise<FWorksheet>;
|
|
232
|
+
/**
|
|
233
|
+
* Inserts one or more consecutive blank columns in a sheet starting at the specified location.
|
|
234
|
+
* @param columnIndex The index indicating where to insert a column, starting at 0 for the first column.
|
|
235
|
+
* @param numColumns The number of columns to insert.
|
|
236
|
+
* @returns This sheet, for chaining.
|
|
237
|
+
*/
|
|
238
|
+
insertColumns(columnIndex: number, numColumns?: number): Promise<FWorksheet>;
|
|
239
|
+
/**
|
|
240
|
+
* Inserts a given number of columns after the given column position.
|
|
241
|
+
* @param afterPosition The column after which the new column should be added, starting at 0 for the first column.
|
|
242
|
+
* @param howMany The number of columns to insert.
|
|
243
|
+
* @returns This sheet, for chaining.
|
|
244
|
+
*/
|
|
245
|
+
insertColumnsAfter(afterPosition: number, howMany: number): Promise<FWorksheet>;
|
|
246
|
+
/**
|
|
247
|
+
* Inserts a number of columns before the given column position.
|
|
248
|
+
* @param beforePosition The column before which the new column should be added, starting at 0 for the first column.
|
|
249
|
+
* @param howMany The number of columns to insert.
|
|
250
|
+
* @returns This sheet, for chaining.
|
|
251
|
+
*/
|
|
252
|
+
insertColumnsBefore(beforePosition: number, howMany: number): Promise<FWorksheet>;
|
|
253
|
+
/**
|
|
254
|
+
* Deletes the column at the given column position.
|
|
255
|
+
* @param columnPosition The position of the column, starting at 0 for the first column.
|
|
256
|
+
* @returns This sheet, for chaining.
|
|
257
|
+
*/
|
|
258
|
+
deleteColumn(columnPosition: number): Promise<FWorksheet>;
|
|
259
|
+
/**
|
|
260
|
+
* Deletes a number of columns starting at the given column position.
|
|
261
|
+
* @param columnPosition The position of the first column to delete, starting at 0 for the first column.
|
|
262
|
+
* @param howMany The number of columns to delete.
|
|
263
|
+
* @returns This sheet, for chaining.
|
|
264
|
+
*/
|
|
265
|
+
deleteColumns(columnPosition: number, howMany: number): Promise<FWorksheet>;
|
|
266
|
+
/**
|
|
267
|
+
* Moves the columns selected by the given range to the position indicated by the destinationIndex. The columnSpec itself does not have to exactly represent an entire column or group of columns to move—it selects all columns that the range spans.
|
|
268
|
+
* @param columnSpec A range spanning the columns that should be moved.
|
|
269
|
+
* @param destinationIndex The index that the columns should be moved to. Note that this index is based on the coordinates before the columns are moved. Existing data is shifted right to make room for the moved columns while the source columns are removed from the grid. Therefore, the data may end up at a different index than originally specified. Use 0-index for this method.
|
|
270
|
+
* @returns This sheet, for chaining.
|
|
271
|
+
*/
|
|
272
|
+
moveColumns(columnSpec: FRange, destinationIndex: number): Promise<FWorksheet>;
|
|
273
|
+
/**
|
|
274
|
+
* Hides the column or columns in the given range.
|
|
275
|
+
* @param column The column range to hide.
|
|
276
|
+
* @returns This sheet, for chaining.
|
|
277
|
+
*/
|
|
278
|
+
hideColumn(column: FRange): Promise<FWorksheet>;
|
|
279
|
+
/**
|
|
280
|
+
* Hides one or more consecutive columns starting at the given index. Use 0-index for this method.
|
|
281
|
+
* @param columnIndex The starting index of the columns to hide.
|
|
282
|
+
* @param numColumns The number of columns to hide.
|
|
283
|
+
* @returns This sheet, for chaining.
|
|
284
|
+
*/
|
|
285
|
+
hideColumns(columnIndex: number, numColumns?: number): Promise<FWorksheet>;
|
|
286
|
+
/**
|
|
287
|
+
* Unhides the column in the given range.
|
|
288
|
+
* @param column The range to unhide, if hidden.
|
|
289
|
+
* @returns This sheet, for chaining.
|
|
290
|
+
*/
|
|
291
|
+
unhideColumn(column: FRange): Promise<FWorksheet>;
|
|
292
|
+
/**
|
|
293
|
+
* Unhides one or more consecutive columns starting at the given index. Use 0-index for this method.
|
|
294
|
+
* @param columnIndex The starting index of the columns to unhide.
|
|
295
|
+
* @param numColumns The number of columns to unhide.
|
|
296
|
+
* @returns This sheet, for chaining.
|
|
297
|
+
*/
|
|
298
|
+
showColumns(columnIndex: number, numColumns?: number): Promise<FWorksheet>;
|
|
299
|
+
/**
|
|
300
|
+
* Sets the width of the given column in pixels.
|
|
301
|
+
* @param columnPosition The position of the given column to set.
|
|
302
|
+
* @param width The width in pixels to set it to.
|
|
303
|
+
* @returns This sheet, for chaining.
|
|
304
|
+
*/
|
|
305
|
+
setColumnWidth(columnPosition: number, width: number): Promise<FWorksheet>;
|
|
306
|
+
/**
|
|
307
|
+
* Sets the width of the given columns in pixels.
|
|
308
|
+
* @param startColumn The starting column position to change.
|
|
309
|
+
* @param numColumns The number of columns to change.
|
|
310
|
+
* @param width The width in pixels to set it to.
|
|
311
|
+
* @returns This sheet, for chaining.
|
|
312
|
+
*/
|
|
313
|
+
setColumnWidths(startColumn: number, numColumns: number, width: number): Promise<FWorksheet>;
|
|
314
|
+
/**
|
|
315
|
+
* Set custom properties for given columns.
|
|
316
|
+
* @param custom The custom properties to set.
|
|
317
|
+
* @returns This sheet, for chaining.
|
|
318
|
+
*/
|
|
319
|
+
setColumnCustom(custom: IObjectArrayPrimitiveType<CustomData>): Promise<FWorksheet>;
|
|
320
|
+
/**
|
|
321
|
+
* Get all merged cells in the current sheet
|
|
322
|
+
* @returns all merged cells
|
|
323
|
+
*/
|
|
324
|
+
getMergedRanges(): FRange[];
|
|
325
|
+
/**
|
|
326
|
+
* Get the merged cell data of the specified row and column.
|
|
327
|
+
* @param {number} row The row index.
|
|
328
|
+
* @param {number} column The column index.
|
|
329
|
+
* @returns {FRange|undefined} The merged cell data, or undefined if the cell is not merged.
|
|
330
|
+
*/
|
|
331
|
+
getCellMergeData(row: number, column: number): FRange | undefined;
|
|
332
|
+
/**
|
|
333
|
+
* Returns the selected range in the active sheet, or null if there is no active range.
|
|
334
|
+
* @returns the active range
|
|
335
|
+
*/
|
|
336
|
+
getActiveRange(): FRange | null;
|
|
337
|
+
/**
|
|
338
|
+
* Sets the active selection region for this sheet.
|
|
339
|
+
* @param range The range to set as the active selection.
|
|
340
|
+
*/
|
|
341
|
+
setActiveRange(range: FRange): void;
|
|
342
|
+
/**
|
|
343
|
+
* Sets the active selection region for this sheet.
|
|
344
|
+
* @param range The range to set as the active selection.
|
|
345
|
+
*/
|
|
346
|
+
setActiveSelection: (range: FRange) => void;
|
|
347
|
+
/**
|
|
348
|
+
* Sets the frozen state of the current sheet.
|
|
349
|
+
* @param freeze - The freeze object containing the parameters for freezing the sheet.
|
|
350
|
+
* @returns True if the command was successful, false otherwise.
|
|
351
|
+
*/
|
|
352
|
+
setFreeze(freeze: IFreeze): boolean;
|
|
353
|
+
/**
|
|
354
|
+
* Cancels the frozen state of the current sheet.
|
|
355
|
+
* @returns True if the command was successful, false otherwise.
|
|
356
|
+
*/
|
|
357
|
+
cancelFreeze(): boolean;
|
|
358
|
+
/**
|
|
359
|
+
* Get the freeze state of the current sheet.
|
|
360
|
+
* @returns The freeze state of the current sheet.
|
|
361
|
+
*/
|
|
362
|
+
getFreeze(): IFreeze;
|
|
363
|
+
/**
|
|
364
|
+
* Set the number of frozen columns.
|
|
365
|
+
* @param columns The number of columns to freeze.
|
|
366
|
+
* To unfreeze all columns, set this value to 0.
|
|
367
|
+
*/
|
|
368
|
+
setFrozenColumns(columns: number): void;
|
|
369
|
+
/**
|
|
370
|
+
* Set the number of frozen rows.
|
|
371
|
+
* @param rows The number of rows to freeze.
|
|
372
|
+
* To unfreeze all rows, set this value to 0.
|
|
373
|
+
*/
|
|
374
|
+
setFrozenRows(rows: number): void;
|
|
375
|
+
/**
|
|
376
|
+
* Get the number of frozen columns.
|
|
377
|
+
* @returns The number of frozen columns.
|
|
378
|
+
* Returns 0 if no columns are frozen.
|
|
379
|
+
*/
|
|
380
|
+
getFrozenColumns(): number;
|
|
381
|
+
/**
|
|
382
|
+
* Get the number of frozen rows.
|
|
383
|
+
* @returns The number of frozen rows.
|
|
384
|
+
* Returns 0 if no rows are frozen.
|
|
385
|
+
*/
|
|
386
|
+
getFrozenRows(): number;
|
|
387
|
+
/**
|
|
388
|
+
* Returns true if the sheet's gridlines are hidden; otherwise returns false. Gridlines are visible by default.
|
|
389
|
+
*/
|
|
390
|
+
hasHiddenGridLines(): boolean;
|
|
391
|
+
/**
|
|
392
|
+
* Hides or reveals the sheet gridlines.
|
|
393
|
+
* @param {boolean} hidden If `true`, hide gridlines in this sheet; otherwise show the gridlines.
|
|
394
|
+
*/
|
|
395
|
+
setHiddenGridlines(hidden: boolean): Promise<boolean>;
|
|
396
|
+
/**
|
|
397
|
+
* Subscribe to the cell data change event.
|
|
398
|
+
* @param callback - The callback function to be executed when the cell data changes.
|
|
399
|
+
* @returns - A disposable object to unsubscribe from the event.
|
|
400
|
+
*/
|
|
401
|
+
onCellDataChange(callback: (cellValue: ObjectMatrix<Nullable<ICellData>>) => void): IDisposable;
|
|
402
|
+
/**
|
|
403
|
+
* Subscribe to the cell data change event.
|
|
404
|
+
* @param callback - The callback function to be executed before the cell data changes.
|
|
405
|
+
* @returns - A disposable object to unsubscribe from the event.
|
|
406
|
+
*/
|
|
407
|
+
onBeforeCellDataChange(callback: (cellValue: ObjectMatrix<Nullable<ICellData>>) => void): IDisposable;
|
|
408
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import './f-univer';
|
|
17
|
+
export { FPermission } from './f-permission';
|
|
18
|
+
export { FRange } from './f-range';
|
|
19
|
+
export type { FontLine, FontStyle, FontWeight } from './f-range';
|
|
20
|
+
export { FSelection } from './f-selection';
|
|
21
|
+
export { FWorkbook } from './f-workbook';
|
|
22
|
+
export { FWorksheet } from './f-worksheet';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CellValue, ICellData, IObjectMatrixPrimitiveType, IRange, IRangeWithCoord, Worksheet, HorizontalAlign, VerticalAlign } from '@univerjs/core';
|
|
2
|
+
export type FHorizontalAlignment = 'left' | 'center' | 'normal';
|
|
3
|
+
export type FVerticalAlignment = 'top' | 'middle' | 'bottom';
|
|
4
|
+
export declare function transformFacadeHorizontalAlignment(value: FHorizontalAlignment): HorizontalAlign;
|
|
5
|
+
export declare function transformCoreHorizontalAlignment(value: HorizontalAlign): FHorizontalAlignment;
|
|
6
|
+
export declare function transformFacadeVerticalAlignment(value: FVerticalAlignment): VerticalAlign;
|
|
7
|
+
export declare function transformCoreVerticalAlignment(value: VerticalAlign): FVerticalAlignment;
|
|
8
|
+
/**
|
|
9
|
+
* covert cell value to cell data
|
|
10
|
+
* @param value
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare function covertCellValue(value: CellValue | ICellData): ICellData;
|
|
14
|
+
/**
|
|
15
|
+
* covert cell value array or matrix to cell data
|
|
16
|
+
* @param value
|
|
17
|
+
* @param range
|
|
18
|
+
* @returns
|
|
19
|
+
*/
|
|
20
|
+
export declare function covertCellValues(value: CellValue[][] | IObjectMatrixPrimitiveType<CellValue> | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>, range: IRange): IObjectMatrixPrimitiveType<ICellData>;
|
|
21
|
+
export declare function isCellMerged(mergeInfo: IRangeWithCoord, range: IRange): boolean;
|
|
22
|
+
export declare function isSingleCell(mergeInfo: IRangeWithCoord, range: IRange): boolean;
|
|
23
|
+
export declare function covertToRowRange(range: IRange, worksheet: Worksheet): IRange;
|
|
24
|
+
export declare function covertToColRange(range: IRange, worksheet: Worksheet): IRange;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
export { UniverSheetsPlugin } from './sheets-plugin';
|
|
17
17
|
export { COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE } from './basics/const/command-listener-const';
|
|
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
|
-
export { convertPrimaryWithCoordToPrimary, convertSelectionDataToRange,
|
|
19
|
+
export { convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, type ISelectionStyle, type ISelectionWidgetConfig, type ISelectionWithCoord, type ISelectionWithStyle, type ISheetRangeLocation, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, } from './basics/selection';
|
|
20
20
|
export { createTopMatrixFromMatrix, createTopMatrixFromRanges, findAllRectangle, rangeMerge, RangeMergeUtil } from './basics/rangeMerge';
|
|
21
21
|
export { type IUniverSheetsConfig } from './controllers/config.schema';
|
|
22
22
|
export { MAX_CELL_PER_SHEET_KEY } from './controllers/config/config';
|
|
@@ -24,8 +24,7 @@ export { BorderStyleManagerService, type IBorderInfo } from './services/border-s
|
|
|
24
24
|
export * from './services/permission/permission-point';
|
|
25
25
|
export { WorksheetPermissionService } from './services/permission/worksheet-permission/worksheet-permission.service';
|
|
26
26
|
export { WorkbookPermissionService } from './services/permission/workbook-permission/workbook-permission.service';
|
|
27
|
-
export { DISABLE_NORMAL_SELECTIONS, SelectionMoveType, SheetsSelectionsService,
|
|
28
|
-
export { IRefSelectionsService, RefSelectionsService } from './services/selections/ref-selections.service';
|
|
27
|
+
export { DISABLE_NORMAL_SELECTIONS, IRefSelectionsService, RefSelectionsService, SelectionMoveType, SheetsSelectionsService, WorkbookSelectionModel, } from './services/selections';
|
|
29
28
|
export { getAddMergeMutationRangeByType } from './controllers/merge-cell.controller';
|
|
30
29
|
export { NumfmtService } from './services/numfmt/numfmt.service';
|
|
31
30
|
export type { INumfmtItem, INumfmtItemWithCache } from './services/numfmt/type';
|
|
@@ -34,9 +33,9 @@ export { RefRangeService } from './services/ref-range/ref-range.service';
|
|
|
34
33
|
export type { EffectRefRangeParams, IOperator } from './services/ref-range/type';
|
|
35
34
|
export { EffectRefRangId, OperatorType } from './services/ref-range/type';
|
|
36
35
|
export { DefinedNameDataController } from './controllers/defined-name-data.controller';
|
|
37
|
-
export { handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, } from './services/ref-range/util';
|
|
36
|
+
export { getSeparateEffectedRangesOnCommand, handleBaseInsertRange, handleBaseMoveRowsCols, handleBaseRemoveRange, handleCommonDefaultRangeChangeWithEffectRefCommands, handleCommonRangeChangeWithEffectRefCommandsSkipNoInterests, handleDefaultRangeChangeWithEffectRefCommands, handleDefaultRangeChangeWithEffectRefCommandsSkipNoInterests, handleDeleteRangeMoveLeft, handleDeleteRangeMoveUp, handleInsertCol, handleInsertRangeMoveDown, handleInsertRangeMoveRight, handleInsertRow, handleIRemoveCol, handleIRemoveRow, handleMoveCols, handleMoveRange, handleMoveRows, rotateRange, runRefRangeMutations, } from './services/ref-range/util';
|
|
38
37
|
export { InterceptCellContentPriority, INTERCEPTOR_POINT } from './services/sheet-interceptor/interceptor-const';
|
|
39
|
-
export { SheetInterceptorService } from './services/sheet-interceptor/sheet-interceptor.service';
|
|
38
|
+
export { AFTER_CELL_EDIT, AFTER_CELL_EDIT_ASYNC, BEFORE_CELL_EDIT, SheetInterceptorService } from './services/sheet-interceptor/sheet-interceptor.service';
|
|
40
39
|
export type { ISheetLocation, ISheetLocationBase, ISheetRowLocation } from './services/sheet-interceptor/utils/interceptor';
|
|
41
40
|
export { MERGE_CELL_INTERCEPTOR_CHECK, MergeCellController } from './controllers/merge-cell.controller';
|
|
42
41
|
export { AddMergeRedoSelectionsOperationFactory, AddMergeUndoSelectionsOperationFactory } from './commands/utils/handle-merge-operation';
|
|
@@ -51,7 +50,7 @@ export { WorkbookCommentPermission, WorkbookCopyPermission, WorkbookCreateProtec
|
|
|
51
50
|
export { UnitAction, UnitObject } from '@univerjs/protocol';
|
|
52
51
|
export { checkRangesEditablePermission } from './services/permission/util';
|
|
53
52
|
export { type ICellPermission, RangeProtectionRenderModel } from './model/range-protection-render.model';
|
|
54
|
-
export { type IModel, type IObjectModel, type IRangeProtectionRule, RangeProtectionRuleModel } from './model/range-protection-rule.model';
|
|
53
|
+
export { EditStateEnum, type IModel, type IObjectModel, type IRangeProtectionRule, RangeProtectionRuleModel, ViewStateEnum } from './model/range-protection-rule.model';
|
|
55
54
|
export { RangeProtectionCache } from './model/range-protection.cache';
|
|
56
55
|
export type { IWorksheetProtectionRenderCellData } from './services/permission/worksheet-permission/type';
|
|
57
56
|
export { RangeProtectionRefRangeService } from './services/permission/range-permission/range-protection.ref-range';
|
|
@@ -73,6 +72,9 @@ export { handleInsertRangeMutation } from './commands/utils/handle-range-mutatio
|
|
|
73
72
|
export { type ISheetCommandSharedParams } from './commands/utils/interface';
|
|
74
73
|
export { copyRangeStyles } from './commands/commands/utils/selection-utils';
|
|
75
74
|
export { AddRangeProtectionCommand, type IAddRangeProtectionCommandParams } from './commands/commands/add-range-protection.command';
|
|
75
|
+
export { AddWorksheetProtectionCommand } from './commands/commands/add-worksheet-protection.command';
|
|
76
|
+
export { SetWorksheetProtectionCommand } from './commands/commands/set-worksheet-protection.command';
|
|
77
|
+
export { DeleteWorksheetProtectionCommand } from './commands/commands/delete-worksheet-protection.command';
|
|
76
78
|
export { addMergeCellsUtil, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand, } from './commands/commands/add-worksheet-merge.command';
|
|
77
79
|
export { ClearSelectionAllCommand } from './commands/commands/clear-selection-all.command';
|
|
78
80
|
export { ClearSelectionContentCommand } from './commands/commands/clear-selection-content.command';
|
|
@@ -103,10 +105,9 @@ export { type IReorderRangeCommandParams, ReorderRangeCommand } from './commands
|
|
|
103
105
|
export { type ISetBorderBasicCommandParams, type ISetBorderColorCommandParams, type ISetBorderCommandParams, type ISetBorderPositionCommandParams, type ISetBorderStyleCommandParams, SetBorderBasicCommand, SetBorderColorCommand, SetBorderCommand, SetBorderPositionCommand, SetBorderStyleCommand, } from './commands/commands/set-border-command';
|
|
104
106
|
export { type ISetSpecificColsVisibleCommandParams, SetColHiddenCommand, SetSelectedColsVisibleCommand, SetSpecificColsVisibleCommand, } from './commands/commands/set-col-visible.command';
|
|
105
107
|
export { SetDefinedNameCommand } from './commands/commands/set-defined-name.command';
|
|
106
|
-
export {
|
|
107
|
-
export { SetFrozenCommand } from './commands/commands/set-frozen.command';
|
|
108
|
+
export { type ICancelFrozenCommandParams, type ISetFrozenCommandParams } from './commands/commands/set-frozen.command';
|
|
109
|
+
export { CancelFrozenCommand, SetFrozenCommand } from './commands/commands/set-frozen.command';
|
|
108
110
|
export { type IToggleGridlinesCommandParams, ToggleGridlinesCommand } from './commands/commands/toggle-gridlines.command';
|
|
109
|
-
export { type ISetRangeProtectionCommandParams, SetRangeProtectionCommand } from './commands/commands/set-range-protection.command';
|
|
110
111
|
export { type ISetRangeValuesCommandParams, SetRangeValuesCommand } from './commands/commands/set-range-values.command';
|
|
111
112
|
export { type ISetSpecificRowsVisibleCommandParams, SetRowHiddenCommand, SetSelectedRowsVisibleCommand, SetSpecificRowsVisibleCommand, } from './commands/commands/set-row-visible.command';
|
|
112
113
|
export { type ISetColorCommandParams, type ISetFontFamilyCommandParams, type ISetFontSizeCommandParams, type ISetHorizontalTextAlignCommandParams, type ISetStyleCommandParams, type ISetTextRotationCommandParams, type ISetTextWrapCommandParams, type ISetVerticalTextAlignCommandParams, type IStyleTypeValue, ResetBackgroundColorCommand, ResetTextColorCommand, SetBackgroundColorCommand, SetBoldCommand, SetFontFamilyCommand, SetFontSizeCommand, SetHorizontalTextAlignCommand, SetItalicCommand, SetOverlineCommand, SetStrikeThroughCommand, SetStyleCommand, SetTextColorCommand, SetTextRotationCommand, SetTextWrapCommand, SetUnderlineCommand, SetVerticalTextAlignCommand, } from './commands/commands/set-style.command';
|
|
@@ -123,6 +124,7 @@ export { DeltaRowHeightCommand, type IDeltaRowHeightCommand, type ISetWorksheetR
|
|
|
123
124
|
export { SetWorksheetShowCommand } from './commands/commands/set-worksheet-show.command';
|
|
124
125
|
export type { ISetWorksheetShowCommandParams } from './commands/commands/set-worksheet-show.command';
|
|
125
126
|
export { AddRangeProtectionMutation, FactoryAddRangeProtectionMutation, type IAddRangeProtectionMutationParams } from './commands/mutations/add-range-protection.mutation';
|
|
127
|
+
export { SetProtectionCommand } from './commands/commands/set-protection.command';
|
|
126
128
|
export { AddMergeUndoMutationFactory, AddWorksheetMergeMutation } from './commands/mutations/add-worksheet-merge.mutation';
|
|
127
129
|
export { AddWorksheetProtectionMutation, type IAddWorksheetProtectionParams } from './commands/mutations/add-worksheet-protection.mutation';
|
|
128
130
|
export { DeleteRangeProtectionMutation, FactoryDeleteRangeProtectionMutation, type IDeleteRangeProtectionMutationParams } from './commands/mutations/delete-range-protection.mutation';
|
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { IRange } from '@univerjs/core';
|
|
2
2
|
import { UnitObject } from '@univerjs/protocol';
|
|
3
|
+
export declare enum ViewStateEnum {
|
|
4
|
+
OthersCanView = "othersCanView",
|
|
5
|
+
NoOneElseCanView = "noOneElseCanView"
|
|
6
|
+
}
|
|
7
|
+
export declare enum EditStateEnum {
|
|
8
|
+
DesignedUserCanEdit = "designedUserCanEdit",
|
|
9
|
+
OnlyMe = "onlyMe"
|
|
10
|
+
}
|
|
3
11
|
export interface IRangeProtectionRule {
|
|
4
12
|
ranges: IRange[];
|
|
5
13
|
permissionId: string;
|
|
6
14
|
id: string;
|
|
7
|
-
name: string;
|
|
8
15
|
description?: string;
|
|
9
16
|
unitType: UnitObject;
|
|
10
17
|
unitId: string;
|
|
11
18
|
subUnitId: string;
|
|
19
|
+
viewState: ViewStateEnum;
|
|
20
|
+
editState: EditStateEnum;
|
|
12
21
|
}
|
|
13
22
|
export type IObjectModel = Record<string, Record<string, IRangeProtectionRule[]>>;
|
|
14
23
|
export type IModel = Map<string, Map<string, Map<string, IRangeProtectionRule>>>;
|