@univerjs/sheets 0.5.2 → 0.5.3
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 -1
- package/lib/cjs/index.js +3 -3
- package/lib/es/facade.js +525 -344
- package/lib/es/index.js +4605 -3763
- package/lib/types/basics/interfaces/mutation-interface.d.ts +7 -0
- package/lib/types/commands/commands/__tests__/range-template-command.sepc.d.ts +16 -0
- package/lib/types/commands/commands/add-worksheet-merge.command.d.ts +1 -1
- package/lib/types/commands/commands/add-worksheet-range-theme.command.d.ts +2 -0
- package/lib/types/commands/commands/delete-worksheet-range-theme.command.d.ts +2 -0
- package/lib/types/commands/commands/insert-row-col.command.d.ts +2 -0
- package/lib/types/commands/commands/register-range-theme.command.d.ts +7 -0
- package/lib/types/commands/commands/remove-row-col.command.d.ts +12 -0
- package/lib/types/commands/commands/unregister-range-theme.command.d.ts +6 -0
- package/lib/types/commands/mutations/add-worksheet-range-theme.mutation.d.ts +9 -0
- package/lib/types/commands/mutations/delete-worksheet-range-theme.mutation.d.ts +9 -0
- package/lib/types/commands/mutations/register-range-theme.mutation.d.ts +8 -0
- package/lib/types/commands/mutations/unregister-range-theme-style.mutation.d.ts +6 -0
- package/lib/types/facade/f-event.d.ts +30 -0
- package/lib/types/facade/f-range.d.ts +56 -15
- package/lib/types/facade/f-selection.d.ts +1 -1
- package/lib/types/facade/f-univer.d.ts +22 -6
- package/lib/types/facade/f-workbook.d.ts +52 -16
- package/lib/types/facade/f-worksheet.d.ts +59 -59
- package/lib/types/facade/index.d.ts +2 -1
- package/lib/types/index.d.ts +15 -3
- package/lib/types/model/range-theme-model.d.ts +66 -0
- package/lib/types/model/range-theme-util.d.ts +97 -0
- package/lib/types/model/range-themes/build-in-theme.factory.d.ts +5 -0
- package/lib/types/model/range-themes/default.d.ts +2 -0
- package/lib/types/services/range-theme-service.d.ts +34 -0
- package/lib/types/services/sheet-interceptor/interceptor-const.d.ts +2 -0
- package/lib/types/services/sheet-interceptor/sheet-interceptor.service.d.ts +5 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +8 -31
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomData, ICellData, IDisposable, IFreeze, IObjectArrayPrimitiveType, IStyleData, Nullable, Workbook, Worksheet,
|
|
1
|
+
import { CustomData, ICellData, IDisposable, IFreeze, IObjectArrayPrimitiveType, IStyleData, Nullable, Workbook, Worksheet, FBaseInitialable, ICommandService, ILogService, Injector, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { FDefinedName } from './f-defined-name';
|
|
3
3
|
import { FWorkbook } from './f-workbook';
|
|
4
4
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
@@ -11,7 +11,7 @@ interface IFacadeClearOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Represents a worksheet facade api instance. Which provides a set of methods to interact with the worksheet.
|
|
13
13
|
*/
|
|
14
|
-
export declare class FWorksheet extends
|
|
14
|
+
export declare class FWorksheet extends FBaseInitialable {
|
|
15
15
|
protected readonly _fWorkbook: FWorkbook;
|
|
16
16
|
protected readonly _workbook: Workbook;
|
|
17
17
|
protected readonly _worksheet: Worksheet;
|
|
@@ -67,23 +67,23 @@ export declare class FWorksheet extends FBase {
|
|
|
67
67
|
/**
|
|
68
68
|
* Set the default style of the worksheet
|
|
69
69
|
* @param {StyleDataInfo} style default style
|
|
70
|
-
* @returns {
|
|
70
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
71
71
|
*/
|
|
72
|
-
setDefaultStyle(style: string):
|
|
72
|
+
setDefaultStyle(style: string): FWorksheet;
|
|
73
73
|
/**
|
|
74
74
|
* Set the default style of the worksheet row
|
|
75
75
|
* @param {number} index The row index
|
|
76
76
|
* @param {string | Nullable<IStyleData>} style The style name or style data
|
|
77
|
-
* @returns {
|
|
77
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
78
78
|
*/
|
|
79
|
-
setColumnDefaultStyle(index: number, style: string | Nullable<IStyleData>):
|
|
79
|
+
setColumnDefaultStyle(index: number, style: string | Nullable<IStyleData>): FWorksheet;
|
|
80
80
|
/**
|
|
81
81
|
* Set the default style of the worksheet column
|
|
82
82
|
* @param {number} index The column index
|
|
83
83
|
* @param {string | Nullable<IStyleData>} style The style name or style data
|
|
84
|
-
* @returns {
|
|
84
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
85
85
|
*/
|
|
86
|
-
setRowDefaultStyle(index: number, style: string | Nullable<IStyleData>):
|
|
86
|
+
setRowDefaultStyle(index: number, style: string | Nullable<IStyleData>): FWorksheet;
|
|
87
87
|
/**
|
|
88
88
|
* Returns a Range object representing a single cell at the specified row and column.
|
|
89
89
|
* @param row The row index of the cell.
|
|
@@ -129,87 +129,87 @@ export declare class FWorksheet extends FBase {
|
|
|
129
129
|
* @param afterPosition The row after which the new row should be added, starting at 0 for the first row.
|
|
130
130
|
* @returns This sheet, for chaining.
|
|
131
131
|
*/
|
|
132
|
-
insertRowAfter(afterPosition: number):
|
|
132
|
+
insertRowAfter(afterPosition: number): FWorksheet;
|
|
133
133
|
/**
|
|
134
134
|
* Inserts a row before the given row position.
|
|
135
135
|
* @param beforePosition The row before which the new row should be added, starting at 0 for the first row.
|
|
136
136
|
* @returns This sheet, for chaining.
|
|
137
137
|
*/
|
|
138
|
-
insertRowBefore(beforePosition: number):
|
|
138
|
+
insertRowBefore(beforePosition: number): FWorksheet;
|
|
139
139
|
/**
|
|
140
140
|
* Inserts one or more consecutive blank rows in a sheet starting at the specified location.
|
|
141
141
|
* @param rowIndex The index indicating where to insert a row, starting at 0 for the first row.
|
|
142
142
|
* @param numRows The number of rows to insert.
|
|
143
143
|
* @returns This sheet, for chaining.
|
|
144
144
|
*/
|
|
145
|
-
insertRows(rowIndex: number, numRows?: number):
|
|
145
|
+
insertRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
146
146
|
/**
|
|
147
147
|
* Inserts a number of rows after the given row position.
|
|
148
148
|
* @param afterPosition The row after which the new rows should be added, starting at 0 for the first row.
|
|
149
149
|
* @param howMany The number of rows to insert.
|
|
150
150
|
* @returns This sheet, for chaining.
|
|
151
151
|
*/
|
|
152
|
-
insertRowsAfter(afterPosition: number, howMany: number):
|
|
152
|
+
insertRowsAfter(afterPosition: number, howMany: number): FWorksheet;
|
|
153
153
|
/**
|
|
154
154
|
* Inserts a number of rows before the given row position.
|
|
155
155
|
* @param beforePosition The row before which the new rows should be added, starting at 0 for the first row.
|
|
156
156
|
* @param howMany The number of rows to insert.
|
|
157
157
|
* @returns This sheet, for chaining.
|
|
158
158
|
*/
|
|
159
|
-
insertRowsBefore(beforePosition: number, howMany: number):
|
|
159
|
+
insertRowsBefore(beforePosition: number, howMany: number): FWorksheet;
|
|
160
160
|
/**
|
|
161
161
|
* Deletes the row at the given row position.
|
|
162
162
|
* @param rowPosition The position of the row, starting at 0 for the first row.
|
|
163
163
|
* @returns This sheet, for chaining.
|
|
164
164
|
*/
|
|
165
|
-
deleteRow(rowPosition: number):
|
|
165
|
+
deleteRow(rowPosition: number): FWorksheet;
|
|
166
166
|
/**
|
|
167
167
|
* Deletes a number of rows starting at the given row position.
|
|
168
168
|
* @param rowPosition The position of the first row to delete, starting at 0 for the first row.
|
|
169
169
|
* @param howMany The number of rows to delete.
|
|
170
170
|
* @returns This sheet, for chaining.
|
|
171
171
|
*/
|
|
172
|
-
deleteRows(rowPosition: number, howMany: number):
|
|
172
|
+
deleteRows(rowPosition: number, howMany: number): FWorksheet;
|
|
173
173
|
/**
|
|
174
174
|
* 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.
|
|
175
175
|
* @param rowSpec A range spanning the rows that should be moved.
|
|
176
176
|
* @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.
|
|
177
177
|
* @returns This sheet, for chaining.
|
|
178
178
|
*/
|
|
179
|
-
moveRows(rowSpec: FRange, destinationIndex: number):
|
|
179
|
+
moveRows(rowSpec: FRange, destinationIndex: number): FWorksheet;
|
|
180
180
|
/**
|
|
181
181
|
* Hides the rows in the given range.
|
|
182
182
|
* @param row The row range to hide.
|
|
183
183
|
* @returns This sheet, for chaining.
|
|
184
184
|
*/
|
|
185
|
-
hideRow(row: FRange):
|
|
185
|
+
hideRow(row: FRange): FWorksheet;
|
|
186
186
|
/**
|
|
187
187
|
* Hides one or more consecutive rows starting at the given index. Use 0-index for this method.
|
|
188
188
|
* @param rowIndex The starting index of the rows to hide.
|
|
189
189
|
* @param numRows The number of rows to hide.
|
|
190
190
|
* @returns This sheet, for chaining.
|
|
191
191
|
*/
|
|
192
|
-
hideRows(rowIndex: number, numRows?: number):
|
|
192
|
+
hideRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
193
193
|
/**
|
|
194
194
|
* Unhides the row in the given range.
|
|
195
195
|
* @param row The range to unhide, if hidden.
|
|
196
196
|
* @returns This sheet, for chaining.
|
|
197
197
|
*/
|
|
198
|
-
unhideRow(row: FRange):
|
|
198
|
+
unhideRow(row: FRange): FWorksheet;
|
|
199
199
|
/**
|
|
200
200
|
* Unhides one or more consecutive rows starting at the given index. Use 0-index for this method.
|
|
201
201
|
* @param rowIndex The starting index of the rows to unhide.
|
|
202
202
|
* @param numRows The number of rows to unhide.
|
|
203
203
|
* @returns This sheet, for chaining.
|
|
204
204
|
*/
|
|
205
|
-
showRows(rowIndex: number, numRows?: number):
|
|
205
|
+
showRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
206
206
|
/**
|
|
207
207
|
* 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).
|
|
208
208
|
* @param rowPosition The row position to change.
|
|
209
209
|
* @param height The height in pixels to set it to.
|
|
210
210
|
* @returns This sheet, for chaining.
|
|
211
211
|
*/
|
|
212
|
-
setRowHeight(rowPosition: number, height: number):
|
|
212
|
+
setRowHeight(rowPosition: number, height: number): FWorksheet;
|
|
213
213
|
/**
|
|
214
214
|
* 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).
|
|
215
215
|
* @param startRow The starting row position to change.
|
|
@@ -217,7 +217,7 @@ export declare class FWorksheet extends FBase {
|
|
|
217
217
|
* @param height The height in pixels to set it to.
|
|
218
218
|
* @returns This sheet, for chaining.
|
|
219
219
|
*/
|
|
220
|
-
setRowHeights(startRow: number, numRows: number, height: number):
|
|
220
|
+
setRowHeights(startRow: number, numRows: number, height: number): FWorksheet;
|
|
221
221
|
/**
|
|
222
222
|
* 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.
|
|
223
223
|
* @param startRow The starting row position to change.
|
|
@@ -225,99 +225,99 @@ export declare class FWorksheet extends FBase {
|
|
|
225
225
|
* @param height The height in pixels to set it to.
|
|
226
226
|
* @returns This sheet, for chaining.
|
|
227
227
|
*/
|
|
228
|
-
setRowHeightsForced(startRow: number, numRows: number, height: number):
|
|
228
|
+
setRowHeightsForced(startRow: number, numRows: number, height: number): FWorksheet;
|
|
229
229
|
/**
|
|
230
230
|
* Set custom properties for given rows.
|
|
231
231
|
* @param custom The custom properties to set.
|
|
232
232
|
* @returns This sheet, for chaining.
|
|
233
233
|
*/
|
|
234
|
-
setRowCustom(custom: IObjectArrayPrimitiveType<CustomData>):
|
|
234
|
+
setRowCustom(custom: IObjectArrayPrimitiveType<CustomData>): FWorksheet;
|
|
235
235
|
/**
|
|
236
236
|
* Inserts a column after the given column position.
|
|
237
237
|
* @param afterPosition The column after which the new column should be added, starting at 0 for the first column.
|
|
238
238
|
* @returns This sheet, for chaining.
|
|
239
239
|
*/
|
|
240
|
-
insertColumnAfter(afterPosition: number):
|
|
240
|
+
insertColumnAfter(afterPosition: number): FWorksheet;
|
|
241
241
|
/**
|
|
242
242
|
* Inserts a column before the given column position.
|
|
243
243
|
* @param beforePosition The column before which the new column should be added, starting at 0 for the first column.
|
|
244
244
|
* @returns This sheet, for chaining.
|
|
245
245
|
*/
|
|
246
|
-
insertColumnBefore(beforePosition: number):
|
|
246
|
+
insertColumnBefore(beforePosition: number): FWorksheet;
|
|
247
247
|
/**
|
|
248
248
|
* Inserts one or more consecutive blank columns in a sheet starting at the specified location.
|
|
249
249
|
* @param columnIndex The index indicating where to insert a column, starting at 0 for the first column.
|
|
250
250
|
* @param numColumns The number of columns to insert.
|
|
251
251
|
* @returns This sheet, for chaining.
|
|
252
252
|
*/
|
|
253
|
-
insertColumns(columnIndex: number, numColumns?: number):
|
|
253
|
+
insertColumns(columnIndex: number, numColumns?: number): FWorksheet;
|
|
254
254
|
/**
|
|
255
255
|
* Inserts a given number of columns after the given column position.
|
|
256
256
|
* @param afterPosition The column after which the new column should be added, starting at 0 for the first column.
|
|
257
257
|
* @param howMany The number of columns to insert.
|
|
258
258
|
* @returns This sheet, for chaining.
|
|
259
259
|
*/
|
|
260
|
-
insertColumnsAfter(afterPosition: number, howMany: number):
|
|
260
|
+
insertColumnsAfter(afterPosition: number, howMany: number): FWorksheet;
|
|
261
261
|
/**
|
|
262
262
|
* Inserts a number of columns before the given column position.
|
|
263
263
|
* @param beforePosition The column before which the new column should be added, starting at 0 for the first column.
|
|
264
264
|
* @param howMany The number of columns to insert.
|
|
265
265
|
* @returns This sheet, for chaining.
|
|
266
266
|
*/
|
|
267
|
-
insertColumnsBefore(beforePosition: number, howMany: number):
|
|
267
|
+
insertColumnsBefore(beforePosition: number, howMany: number): FWorksheet;
|
|
268
268
|
/**
|
|
269
269
|
* Deletes the column at the given column position.
|
|
270
270
|
* @param columnPosition The position of the column, starting at 0 for the first column.
|
|
271
271
|
* @returns This sheet, for chaining.
|
|
272
272
|
*/
|
|
273
|
-
deleteColumn(columnPosition: number):
|
|
273
|
+
deleteColumn(columnPosition: number): FWorksheet;
|
|
274
274
|
/**
|
|
275
275
|
* Deletes a number of columns starting at the given column position.
|
|
276
276
|
* @param columnPosition The position of the first column to delete, starting at 0 for the first column.
|
|
277
277
|
* @param howMany The number of columns to delete.
|
|
278
278
|
* @returns This sheet, for chaining.
|
|
279
279
|
*/
|
|
280
|
-
deleteColumns(columnPosition: number, howMany: number):
|
|
280
|
+
deleteColumns(columnPosition: number, howMany: number): FWorksheet;
|
|
281
281
|
/**
|
|
282
282
|
* 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.
|
|
283
283
|
* @param columnSpec A range spanning the columns that should be moved.
|
|
284
284
|
* @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.
|
|
285
285
|
* @returns This sheet, for chaining.
|
|
286
286
|
*/
|
|
287
|
-
moveColumns(columnSpec: FRange, destinationIndex: number):
|
|
287
|
+
moveColumns(columnSpec: FRange, destinationIndex: number): FWorksheet;
|
|
288
288
|
/**
|
|
289
289
|
* Hides the column or columns in the given range.
|
|
290
290
|
* @param column The column range to hide.
|
|
291
291
|
* @returns This sheet, for chaining.
|
|
292
292
|
*/
|
|
293
|
-
hideColumn(column: FRange):
|
|
293
|
+
hideColumn(column: FRange): FWorksheet;
|
|
294
294
|
/**
|
|
295
295
|
* Hides one or more consecutive columns starting at the given index. Use 0-index for this method.
|
|
296
296
|
* @param columnIndex The starting index of the columns to hide.
|
|
297
297
|
* @param numColumns The number of columns to hide.
|
|
298
298
|
* @returns This sheet, for chaining.
|
|
299
299
|
*/
|
|
300
|
-
hideColumns(columnIndex: number, numColumns?: number):
|
|
300
|
+
hideColumns(columnIndex: number, numColumns?: number): FWorksheet;
|
|
301
301
|
/**
|
|
302
302
|
* Unhides the column in the given range.
|
|
303
303
|
* @param column The range to unhide, if hidden.
|
|
304
304
|
* @returns This sheet, for chaining.
|
|
305
305
|
*/
|
|
306
|
-
unhideColumn(column: FRange):
|
|
306
|
+
unhideColumn(column: FRange): FWorksheet;
|
|
307
307
|
/**
|
|
308
308
|
* Unhides one or more consecutive columns starting at the given index. Use 0-index for this method.
|
|
309
309
|
* @param columnIndex The starting index of the columns to unhide.
|
|
310
310
|
* @param numColumns The number of columns to unhide.
|
|
311
311
|
* @returns This sheet, for chaining.
|
|
312
312
|
*/
|
|
313
|
-
showColumns(columnIndex: number, numColumns?: number):
|
|
313
|
+
showColumns(columnIndex: number, numColumns?: number): FWorksheet;
|
|
314
314
|
/**
|
|
315
315
|
* Sets the width of the given column in pixels.
|
|
316
316
|
* @param columnPosition The position of the given column to set.
|
|
317
317
|
* @param width The width in pixels to set it to.
|
|
318
318
|
* @returns This sheet, for chaining.
|
|
319
319
|
*/
|
|
320
|
-
setColumnWidth(columnPosition: number, width: number):
|
|
320
|
+
setColumnWidth(columnPosition: number, width: number): FWorksheet;
|
|
321
321
|
/**
|
|
322
322
|
* Sets the width of the given columns in pixels.
|
|
323
323
|
* @param startColumn The starting column position to change.
|
|
@@ -325,13 +325,13 @@ export declare class FWorksheet extends FBase {
|
|
|
325
325
|
* @param width The width in pixels to set it to.
|
|
326
326
|
* @returns This sheet, for chaining.
|
|
327
327
|
*/
|
|
328
|
-
setColumnWidths(startColumn: number, numColumns: number, width: number):
|
|
328
|
+
setColumnWidths(startColumn: number, numColumns: number, width: number): FWorksheet;
|
|
329
329
|
/**
|
|
330
330
|
* Set custom properties for given columns.
|
|
331
331
|
* @param custom The custom properties to set.
|
|
332
332
|
* @returns This sheet, for chaining.
|
|
333
333
|
*/
|
|
334
|
-
setColumnCustom(custom: IObjectArrayPrimitiveType<CustomData>):
|
|
334
|
+
setColumnCustom(custom: IObjectArrayPrimitiveType<CustomData>): FWorksheet;
|
|
335
335
|
/**
|
|
336
336
|
* Get all merged cells in the current sheet
|
|
337
337
|
* @returns all merged cells
|
|
@@ -367,12 +367,12 @@ export declare class FWorksheet extends FBase {
|
|
|
367
367
|
* @deprecated use `setFrozenRows` and `setFrozenColumns` instead.
|
|
368
368
|
* @returns True if the command was successful, false otherwise.
|
|
369
369
|
*/
|
|
370
|
-
setFreeze(freeze: IFreeze):
|
|
370
|
+
setFreeze(freeze: IFreeze): FWorksheet;
|
|
371
371
|
/**
|
|
372
372
|
* Cancels the frozen state of the current sheet.
|
|
373
373
|
* @returns True if the command was successful, false otherwise.
|
|
374
374
|
*/
|
|
375
|
-
cancelFreeze():
|
|
375
|
+
cancelFreeze(): FWorksheet;
|
|
376
376
|
/**
|
|
377
377
|
* Get the freeze state of the current sheet.
|
|
378
378
|
* @returns The freeze state of the current sheet.
|
|
@@ -401,7 +401,7 @@ export declare class FWorksheet extends FBase {
|
|
|
401
401
|
* @param startColumn
|
|
402
402
|
* @param endColumn
|
|
403
403
|
*/
|
|
404
|
-
setFrozenColumns(startColumn: number, endColumn: number):
|
|
404
|
+
setFrozenColumns(startColumn: number, endColumn: number): FWorksheet;
|
|
405
405
|
/**
|
|
406
406
|
* Set the number of frozen rows.
|
|
407
407
|
* @param rows The number of rows to freeze.
|
|
@@ -423,7 +423,7 @@ export declare class FWorksheet extends FBase {
|
|
|
423
423
|
* fWorkSheet.setFrozenRows(0, 2);
|
|
424
424
|
* ```
|
|
425
425
|
*/
|
|
426
|
-
setFrozenRows(startColumn: number, endColumn: number):
|
|
426
|
+
setFrozenRows(startColumn: number, endColumn: number): FWorksheet;
|
|
427
427
|
/**
|
|
428
428
|
* Get the number of frozen columns.
|
|
429
429
|
* @returns The number of frozen columns.
|
|
@@ -475,11 +475,11 @@ export declare class FWorksheet extends FBase {
|
|
|
475
475
|
* fWorkSheet.setHiddenGridlines(true);
|
|
476
476
|
* ```
|
|
477
477
|
*/
|
|
478
|
-
setHiddenGridlines(hidden: boolean):
|
|
478
|
+
setHiddenGridlines(hidden: boolean): FWorksheet;
|
|
479
479
|
/**
|
|
480
480
|
* Set the color of the gridlines in the sheet.
|
|
481
481
|
* @param {string|undefined} color The color to set for the gridlines.Undefined or null to reset to the default color.
|
|
482
|
-
* @returns {
|
|
482
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
483
483
|
* @example
|
|
484
484
|
* ```ts
|
|
485
485
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -488,7 +488,7 @@ export declare class FWorksheet extends FBase {
|
|
|
488
488
|
* fWorkSheet.setGridLinesColor('#ff0000');
|
|
489
489
|
* ```
|
|
490
490
|
*/
|
|
491
|
-
setGridLinesColor(color: string | undefined):
|
|
491
|
+
setGridLinesColor(color: string | undefined): FWorksheet;
|
|
492
492
|
/**
|
|
493
493
|
* Get the color of the gridlines in the sheet.
|
|
494
494
|
* @returns {string | undefined} The color of the gridlines in the sheet or undefined. The default color is 'rgb(214, 216, 219)'.
|
|
@@ -497,7 +497,7 @@ export declare class FWorksheet extends FBase {
|
|
|
497
497
|
/**
|
|
498
498
|
* Sets the sheet tab color.
|
|
499
499
|
* @param {string|null|undefined} color A color code in CSS notation (like '#ffffff' or 'white'), or null to reset the tab color.
|
|
500
|
-
* @returns {
|
|
500
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
501
501
|
* @example
|
|
502
502
|
* ```ts
|
|
503
503
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -506,7 +506,7 @@ export declare class FWorksheet extends FBase {
|
|
|
506
506
|
* fWorkSheet.setTabColor('#ff0000');
|
|
507
507
|
* ```
|
|
508
508
|
*/
|
|
509
|
-
setTabColor(color: string):
|
|
509
|
+
setTabColor(color: string): FWorksheet;
|
|
510
510
|
/**
|
|
511
511
|
* Get the tab color of the sheet.
|
|
512
512
|
* @returns {string} The tab color of the sheet or undefined.
|
|
@@ -564,10 +564,10 @@ export declare class FWorksheet extends FBase {
|
|
|
564
564
|
* fWorkSheet.hideSheet();
|
|
565
565
|
* ``
|
|
566
566
|
*/
|
|
567
|
-
hideSheet():
|
|
567
|
+
hideSheet(): FWorksheet;
|
|
568
568
|
/**
|
|
569
569
|
* Shows this sheet. Has no effect if the sheet is already visible.
|
|
570
|
-
* @returns {
|
|
570
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
571
571
|
* @example
|
|
572
572
|
* ```ts
|
|
573
573
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -576,7 +576,7 @@ export declare class FWorksheet extends FBase {
|
|
|
576
576
|
* fWorkSheets[fWorkSheets.length - 1].showSheet();
|
|
577
577
|
* ```
|
|
578
578
|
*/
|
|
579
|
-
showSheet():
|
|
579
|
+
showSheet(): FWorksheet;
|
|
580
580
|
/**
|
|
581
581
|
* Returns true if the sheet is currently hidden.
|
|
582
582
|
* @returns {boolean} True if the sheet is hidden; otherwise, false.
|
|
@@ -585,7 +585,7 @@ export declare class FWorksheet extends FBase {
|
|
|
585
585
|
/**
|
|
586
586
|
* Sets the sheet name.
|
|
587
587
|
* @param {string} name The new name for the sheet.
|
|
588
|
-
* @returns {
|
|
588
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
589
589
|
* @example
|
|
590
590
|
* ```ts
|
|
591
591
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -594,7 +594,7 @@ export declare class FWorksheet extends FBase {
|
|
|
594
594
|
* fWorkSheet.setName('Sheet1');
|
|
595
595
|
* ```
|
|
596
596
|
*/
|
|
597
|
-
setName(name: string):
|
|
597
|
+
setName(name: string): FWorksheet;
|
|
598
598
|
/**
|
|
599
599
|
* Activates this sheet. Does not alter the sheet itself, only the parent's notion of the active sheet.
|
|
600
600
|
* @returns Current sheet, for chaining.
|
|
@@ -618,7 +618,7 @@ export declare class FWorksheet extends FBase {
|
|
|
618
618
|
* @param {IFacadeClearOptions} [options] Options for clearing the sheet. If not provided, the contents and formatting are cleared both.
|
|
619
619
|
* @param {boolean} [options.contentsOnly] If true, the contents of the sheet are cleared. If false, the contents and formatting are cleared. Default is false.
|
|
620
620
|
* @param {boolean} [options.formatOnly] If true, the formatting of the sheet is cleared. If false, the contents and formatting are cleared. Default is false.
|
|
621
|
-
* @returns
|
|
621
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
622
622
|
* @example
|
|
623
623
|
* ```ts
|
|
624
624
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -629,10 +629,10 @@ export declare class FWorksheet extends FBase {
|
|
|
629
629
|
* fWorkSheet.clear({ contentsOnly: true });
|
|
630
630
|
* ```
|
|
631
631
|
*/
|
|
632
|
-
clear(options?: IFacadeClearOptions):
|
|
632
|
+
clear(options?: IFacadeClearOptions): FWorksheet;
|
|
633
633
|
/**
|
|
634
634
|
* Clears the sheet of contents, while preserving formatting information.
|
|
635
|
-
* @returns {
|
|
635
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
636
636
|
* @example
|
|
637
637
|
* ```ts
|
|
638
638
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -641,10 +641,10 @@ export declare class FWorksheet extends FBase {
|
|
|
641
641
|
* fWorkSheet.clearContents();
|
|
642
642
|
* ```
|
|
643
643
|
*/
|
|
644
|
-
clearContents():
|
|
644
|
+
clearContents(): FWorksheet;
|
|
645
645
|
/**
|
|
646
646
|
* Clears the sheet of formatting, while preserving contents.
|
|
647
|
-
* @returns {
|
|
647
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
648
648
|
* @example
|
|
649
649
|
* ```ts
|
|
650
650
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -653,7 +653,7 @@ export declare class FWorksheet extends FBase {
|
|
|
653
653
|
* fWorkSheet.clearFormats();
|
|
654
654
|
* ```
|
|
655
655
|
*/
|
|
656
|
-
clearFormats():
|
|
656
|
+
clearFormats(): FWorksheet;
|
|
657
657
|
/**
|
|
658
658
|
* Returns a Range corresponding to the dimensions in which data is present.
|
|
659
659
|
* This is functionally equivalent to creating a Range bounded by A1 and (Sheet.getLastColumns(), Sheet.getLastRows()).
|
|
@@ -14,11 +14,12 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import './f-univer';
|
|
17
|
+
export * from './f-event';
|
|
17
18
|
export { FPermission } from './f-permission';
|
|
18
19
|
export { FRange } from './f-range';
|
|
19
20
|
export type { FontLine, FontStyle, FontWeight } from './f-range';
|
|
20
21
|
export { FSelection } from './f-selection';
|
|
21
22
|
export { FSheetHooks } from './f-sheet-hooks';
|
|
22
23
|
export { FWorkbook } from './f-workbook';
|
|
23
|
-
export { FWorksheet } from './f-worksheet';
|
|
24
24
|
export type * from './f-univer';
|
|
25
|
+
export { FWorksheet } from './f-worksheet';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -15,12 +15,13 @@
|
|
|
15
15
|
*/
|
|
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
|
-
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';
|
|
18
|
+
export { type IAddWorksheetMergeMutationParams, type IDeleteRangeMutationParams, type IInsertColMutationParams, type IInsertRangeMutationParams, type IInsertRowMutationParams, type IInsertSheetMutationParams, type IRemoveColMutationParams, type IRemoveRowsMutationParams, type IRemoveSheetMutationParams, type IRemoveWorksheetMergeMutationParams, type IWorksheetRangeThemeStyleMutationParams, } from './basics/interfaces/mutation-interface';
|
|
19
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';
|
|
23
23
|
export { BorderStyleManagerService, type IBorderInfo } from './services/border-style-manager.service';
|
|
24
|
+
export { SheetRangeThemeService } from './services/range-theme-service';
|
|
24
25
|
export * from './services/permission/permission-point';
|
|
25
26
|
export { WorksheetPermissionService } from './services/permission/worksheet-permission/worksheet-permission.service';
|
|
26
27
|
export { WorkbookPermissionService } from './services/permission/workbook-permission/workbook-permission.service';
|
|
@@ -76,11 +77,14 @@ export { getInsertRangeMutations, getRemoveRangeMutations } from './commands/uti
|
|
|
76
77
|
export { handleInsertRangeMutation } from './commands/utils/handle-range-mutation';
|
|
77
78
|
export { type ISheetCommandSharedParams } from './commands/utils/interface';
|
|
78
79
|
export { copyRangeStyles } from './commands/commands/utils/selection-utils';
|
|
80
|
+
export { RangeThemeStyle } from './model/range-theme-util';
|
|
79
81
|
export { AddRangeProtectionCommand, type IAddRangeProtectionCommandParams } from './commands/commands/add-range-protection.command';
|
|
80
82
|
export { AddWorksheetProtectionCommand } from './commands/commands/add-worksheet-protection.command';
|
|
81
83
|
export { SetWorksheetProtectionCommand } from './commands/commands/set-worksheet-protection.command';
|
|
82
84
|
export { DeleteWorksheetProtectionCommand } from './commands/commands/delete-worksheet-protection.command';
|
|
83
85
|
export { addMergeCellsUtil, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand, } from './commands/commands/add-worksheet-merge.command';
|
|
86
|
+
export { SetWorksheetRangeThemeStyleCommand } from './commands/commands/add-worksheet-range-theme.command';
|
|
87
|
+
export { DeleteWorksheetRangeThemeStyleCommand } from './commands/commands/delete-worksheet-range-theme.command';
|
|
84
88
|
export { ClearSelectionAllCommand } from './commands/commands/clear-selection-all.command';
|
|
85
89
|
export { ClearSelectionContentCommand } from './commands/commands/clear-selection-content.command';
|
|
86
90
|
export { ClearSelectionFormatCommand } from './commands/commands/clear-selection-format.command';
|
|
@@ -98,12 +102,12 @@ export { type ISetRowDataMutationParams, SetRowDataMutation, SetRowDataMutationF
|
|
|
98
102
|
export { type ISetRowDataCommandParams, SetRowDataCommand } from './commands/commands/set-row-data.command';
|
|
99
103
|
export { type ISetColDataMutationParams, SetColDataMutation, SetColDataMutationFactory } from './commands/mutations/set-col-data.mutation';
|
|
100
104
|
export { type ISetColDataCommandParams, SetColDataCommand } from './commands/commands/set-col-data.command';
|
|
101
|
-
export { type IInsertColCommandParams, type IInsertRowCommandParams, InsertColAfterCommand, InsertColBeforeCommand, InsertColCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowCommand, } from './commands/commands/insert-row-col.command';
|
|
105
|
+
export { type IInsertColCommandParams, type IInsertRowCommandParams, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, } from './commands/commands/insert-row-col.command';
|
|
102
106
|
export { type IInsertSheetCommandParams, InsertSheetCommand } from './commands/commands/insert-sheet.command';
|
|
103
107
|
export { getMoveRangeUndoRedoMutations, type IMoveRangeCommandParams, MoveRangeCommand } from './commands/commands/move-range.command';
|
|
104
108
|
export { type IMoveColsCommandParams, type IMoveRowsCommandParams, MoveColsCommand, MoveRowsCommand, } from './commands/commands/move-rows-cols.command';
|
|
105
109
|
export { RemoveDefinedNameCommand } from './commands/commands/remove-defined-name.command';
|
|
106
|
-
export { type IRemoveRowColCommandInterceptParams, type IRemoveRowColCommandParams, RemoveColCommand, RemoveRowCommand } from './commands/commands/remove-row-col.command';
|
|
110
|
+
export { type IRemoveColByRangeCommandParams, type IRemoveRowByRangeCommandParams, type IRemoveRowColCommandInterceptParams, type IRemoveRowColCommandParams, RemoveColByRangeCommand, RemoveColCommand, RemoveRowByRangeCommand, RemoveRowCommand } from './commands/commands/remove-row-col.command';
|
|
107
111
|
export { type IRemoveSheetCommandParams, RemoveSheetCommand } from './commands/commands/remove-sheet.command';
|
|
108
112
|
export { RemoveWorksheetMergeCommand } from './commands/commands/remove-worksheet-merge.command';
|
|
109
113
|
export { type IReorderRangeCommandParams, ReorderRangeCommand } from './commands/commands/reorder-range.command';
|
|
@@ -130,6 +134,12 @@ export { DeltaRowHeightCommand, type IDeltaRowHeightCommand, type ISetWorksheetR
|
|
|
130
134
|
export { SetWorksheetShowCommand } from './commands/commands/set-worksheet-show.command';
|
|
131
135
|
export { SplitTextToColumnsCommand } from './commands/commands/split-text-to-columns.command';
|
|
132
136
|
export type { ISplitTextToColumnsCommandParams } from './commands/commands/split-text-to-columns.command';
|
|
137
|
+
export { UnregisterWorksheetRangeThemeStyleCommand } from './commands/commands/unregister-range-theme.command';
|
|
138
|
+
export type { IUnregisterWorksheetRangeThemeStyleCommandParams } from './commands/commands/unregister-range-theme.command';
|
|
139
|
+
export { RegisterWorksheetRangeThemeStyleCommand } from './commands/commands/register-range-theme.command';
|
|
140
|
+
export type { IRegisterWorksheetRangeThemeStyleCommandParams } from './commands/commands/register-range-theme.command';
|
|
141
|
+
export { type IRegisterWorksheetRangeThemeStyleMutationParams, RegisterWorksheetRangeThemeStyleMutation } from './commands/mutations/register-range-theme.mutation';
|
|
142
|
+
export { type IUnregisterWorksheetRangeThemeStyleMutationParams, UnregisterWorksheetRangeThemeStyleMutation } from './commands/mutations/unregister-range-theme-style.mutation';
|
|
133
143
|
export type { ISetWorksheetShowCommandParams } from './commands/commands/set-worksheet-show.command';
|
|
134
144
|
export { AddRangeProtectionMutation, FactoryAddRangeProtectionMutation, type IAddRangeProtectionMutationParams } from './commands/mutations/add-range-protection.mutation';
|
|
135
145
|
export { SetProtectionCommand } from './commands/commands/set-protection.command';
|
|
@@ -161,6 +171,8 @@ export { type ISetWorksheetColWidthMutationParams, SetWorksheetColWidthMutation,
|
|
|
161
171
|
export { type ISetWorksheetHideMutationParams, SetWorksheetHideMutation } from './commands/mutations/set-worksheet-hide.mutation';
|
|
162
172
|
export { type ISetWorksheetNameMutationParams, SetWorksheetNameMutation } from './commands/mutations/set-worksheet-name.mutation';
|
|
163
173
|
export { type ISetWorksheetOrderMutationParams, SetWorksheetOrderMutation } from './commands/mutations/set-worksheet-order.mutation';
|
|
174
|
+
export { SetWorksheetRangeThemeStyleMutation, SetWorksheetRangeThemeStyleMutationFactory } from './commands/mutations/add-worksheet-range-theme.mutation';
|
|
175
|
+
export { DeleteWorksheetRangeThemeStyleMutation, DeleteWorksheetRangeThemeStyleMutationFactory } from './commands/mutations/delete-worksheet-range-theme.mutation';
|
|
164
176
|
export { SetWorksheetPermissionPointsMutation } from './commands/mutations/set-worksheet-permission-points.mutation';
|
|
165
177
|
export type { ISetWorksheetPermissionPointsMutationParams } from './commands/mutations/set-worksheet-permission-points.mutation';
|
|
166
178
|
export { SetWorksheetProtectionMutation } from './commands/mutations/set-worksheet-protection.mutation';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { IRange, Nullable, Disposable, IResourceManagerService } from '@univerjs/core';
|
|
2
|
+
import { IRangeThemeStyleItem, IRangeThemeStyleJSON, RangeThemeStyle } from './range-theme-util';
|
|
3
|
+
import { SheetInterceptorService } from '../services/sheet-interceptor/sheet-interceptor.service';
|
|
4
|
+
export interface IRangeThemeRangeInfo {
|
|
5
|
+
range: IRange;
|
|
6
|
+
unitId: string;
|
|
7
|
+
subUnitId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface IRangeThemeStyleRule {
|
|
10
|
+
rangeInfo: IRangeThemeRangeInfo;
|
|
11
|
+
themeName: string;
|
|
12
|
+
}
|
|
13
|
+
interface ISheetRangeThemeModelJSON {
|
|
14
|
+
rangeThemeStyleRuleMap: Record<string, IRangeThemeStyleRule>;
|
|
15
|
+
rangeThemeStyleMapJson: Record<string, IRangeThemeStyleJSON>;
|
|
16
|
+
}
|
|
17
|
+
export declare class SheetRangeThemeModel extends Disposable {
|
|
18
|
+
private _sheetInterceptorService;
|
|
19
|
+
private _resourceManagerService;
|
|
20
|
+
private _rangeThemeStyleMap;
|
|
21
|
+
private _rangeThemeStyleRuleMap;
|
|
22
|
+
private _rTreeCollection;
|
|
23
|
+
private _defaultRangeThemeMap;
|
|
24
|
+
constructor(_sheetInterceptorService: SheetInterceptorService, _resourceManagerService: IResourceManagerService);
|
|
25
|
+
private _initDefaultTheme;
|
|
26
|
+
private _ensureRangeThemeStyleMap;
|
|
27
|
+
private _ensureRangeThemeStyleRuleMap;
|
|
28
|
+
private _ensureRTreeCollection;
|
|
29
|
+
getDefaultRangeThemeStyle(name: string): RangeThemeStyle;
|
|
30
|
+
/**
|
|
31
|
+
* Register range theme styles
|
|
32
|
+
* @param {string} themeName
|
|
33
|
+
* @param {IRangeThemeRangeInfo} rangeInfo
|
|
34
|
+
*/
|
|
35
|
+
registerRangeThemeRule(themeName: string, rangeInfo: IRangeThemeRangeInfo): void;
|
|
36
|
+
getRegisteredRangeThemeStyle(rangeInfo: IRangeThemeRangeInfo): string | undefined;
|
|
37
|
+
removeRangeThemeRule(themeName: string, rangeInfo: IRangeThemeRangeInfo): void;
|
|
38
|
+
registerDefaultRangeTheme(rangeThemeStyle: RangeThemeStyle): void;
|
|
39
|
+
getRegisteredRangeThemes(): string[];
|
|
40
|
+
/**
|
|
41
|
+
* Register custom range theme style.
|
|
42
|
+
* @param {string} unitId The unit id.
|
|
43
|
+
* @param {RangeThemeStyle} rangeThemeStyle The range theme style.
|
|
44
|
+
*/
|
|
45
|
+
registerRangeThemeStyle(unitId: string, rangeThemeStyle: RangeThemeStyle): void;
|
|
46
|
+
/**
|
|
47
|
+
* Unregister custom range theme style.
|
|
48
|
+
* @param {string} unitId The unit id.
|
|
49
|
+
* @param {string} name The name of the range theme style.
|
|
50
|
+
*/
|
|
51
|
+
unregisterRangeThemeStyle(unitId: string, name: string): void;
|
|
52
|
+
/**
|
|
53
|
+
* Gets all custom register themes
|
|
54
|
+
* @return {string[]} The array of all custom registered themes.
|
|
55
|
+
*/
|
|
56
|
+
getALLRegisteredTheme(): string[];
|
|
57
|
+
getRangeThemeStyle(unitId: string, name: string): RangeThemeStyle;
|
|
58
|
+
getCellStyle(unitId: string, subUnitId: string, row: number, col: number): Nullable<IRangeThemeStyleItem>;
|
|
59
|
+
private _registerIntercept;
|
|
60
|
+
toJson(unitId: string): string;
|
|
61
|
+
fromJSON(json: ISheetRangeThemeModelJSON): void;
|
|
62
|
+
deleteUnitId(unitId: string): void;
|
|
63
|
+
private _initSnapshot;
|
|
64
|
+
dispose(): void;
|
|
65
|
+
}
|
|
66
|
+
export {};
|