@univerjs/sheets 0.5.3 → 0.5.4-experimental.20250114-7c09c35
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 +1526 -777
- package/lib/es/index.js +3904 -3276
- package/lib/types/basics/cell-style.d.ts +8 -0
- package/lib/types/commands/operations/selection.operation.d.ts +1 -0
- package/lib/types/commands/utils/selection-command-util.d.ts +1 -1
- package/lib/types/controllers/permission/sheet-permission-check.controller.d.ts +33 -0
- package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +29 -0
- package/lib/types/controllers/permission/sheet-permission-view-model.controller.d.ts +13 -0
- package/lib/types/facade/f-defined-name.d.ts +61 -61
- package/lib/types/facade/f-event.d.ts +85 -1
- package/lib/types/facade/f-permission.d.ts +3 -20
- package/lib/types/facade/f-range.d.ts +486 -57
- package/lib/types/facade/f-univer.d.ts +56 -11
- package/lib/types/facade/f-workbook.d.ts +87 -17
- package/lib/types/facade/f-worksheet.d.ts +158 -59
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/facade/utils.d.ts +38 -2
- package/lib/types/index.d.ts +2 -0
- package/lib/types/model/range-theme-util.d.ts +3 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +7 -7
- package/LICENSE +0 -176
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomData, ICellData, IDisposable, IFreeze, IObjectArrayPrimitiveType, IStyleData, Nullable, Workbook, Worksheet, FBaseInitialable, ICommandService, ILogService, Injector, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { CustomData, ICellData, IColumnRange, IDisposable, IEventParamConfig, IFreeze, IObjectArrayPrimitiveType, IRowRange, 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';
|
|
@@ -20,6 +20,33 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
20
20
|
protected readonly _logService: ILogService;
|
|
21
21
|
protected readonly _commandService: ICommandService;
|
|
22
22
|
constructor(_fWorkbook: FWorkbook, _workbook: Workbook, _worksheet: Worksheet, _injector: Injector, _selectionManagerService: SheetsSelectionsService, _logService: ILogService, _commandService: ICommandService);
|
|
23
|
+
getSheet(): Worksheet;
|
|
24
|
+
private _eventRegistry;
|
|
25
|
+
private _ensureEventRegistry;
|
|
26
|
+
/**
|
|
27
|
+
* Add an event listener
|
|
28
|
+
* @param event key of event
|
|
29
|
+
* @param callback callback when event triggered
|
|
30
|
+
* @returns {Disposable} The Disposable instance, for remove the listener
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* univerAPI.addEvent(univerAPI.event.UnitCreated, (params) => {
|
|
34
|
+
* console.log('unit created', params);
|
|
35
|
+
* });
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
addEvent(event: keyof IEventParamConfig, callback: (params: IEventParamConfig[typeof event]) => void): IDisposable;
|
|
39
|
+
/**
|
|
40
|
+
* Fire an event, used in internal only.
|
|
41
|
+
* @param event {string} key of event
|
|
42
|
+
* @param params {any} params of event
|
|
43
|
+
* @returns {boolean} should cancel
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* this.fireEvent(univerAPI.event.UnitCreated, params);
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
protected fireEvent<T extends keyof IEventParamConfig>(event: T, params: IEventParamConfig[T]): boolean | undefined;
|
|
23
50
|
/**
|
|
24
51
|
* Returns the injector
|
|
25
52
|
* @returns The injector
|
|
@@ -60,7 +87,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
60
87
|
/**
|
|
61
88
|
* Get the default style of the worksheet column
|
|
62
89
|
* @param {number} index The column index
|
|
63
|
-
* @param
|
|
90
|
+
* @param {boolean} [keepRaw] If true, return the raw style data maybe the style name or style data, otherwise return the data from col manager
|
|
64
91
|
* @returns {Nullable<IStyleData> | string} The default style of the worksheet column name or style data
|
|
65
92
|
*/
|
|
66
93
|
getColumnDefaultStyle(index: number, keepRaw?: boolean): Nullable<IStyleData> | string;
|
|
@@ -116,24 +143,24 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
116
143
|
getRange(a1Notation: string): FRange;
|
|
117
144
|
/**
|
|
118
145
|
* Returns the current number of columns in the sheet, regardless of content.
|
|
119
|
-
* @
|
|
146
|
+
* @returns {number} The maximum columns count of the sheet
|
|
120
147
|
*/
|
|
121
148
|
getMaxColumns(): number;
|
|
122
149
|
/**
|
|
123
150
|
* Returns the current number of rows in the sheet, regardless of content.
|
|
124
|
-
* @
|
|
151
|
+
* @returns {number}The maximum rows count of the sheet
|
|
125
152
|
*/
|
|
126
153
|
getMaxRows(): number;
|
|
127
154
|
/**
|
|
128
155
|
* Inserts a row after the given row position.
|
|
129
|
-
* @param afterPosition The row after which the new row should be added, starting at 0 for the first row.
|
|
130
|
-
* @returns This sheet, for chaining.
|
|
156
|
+
* @param {number} afterPosition The row after which the new row should be added, starting at 0 for the first row.
|
|
157
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
131
158
|
*/
|
|
132
159
|
insertRowAfter(afterPosition: number): FWorksheet;
|
|
133
160
|
/**
|
|
134
161
|
* Inserts a row before the given row position.
|
|
135
|
-
* @param beforePosition The row before which the new row should be added, starting at 0 for the first row.
|
|
136
|
-
* @returns This sheet, for chaining.
|
|
162
|
+
* @param {number} beforePosition The row before which the new row should be added, starting at 0 for the first row.
|
|
163
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
137
164
|
*/
|
|
138
165
|
insertRowBefore(beforePosition: number): FWorksheet;
|
|
139
166
|
/**
|
|
@@ -185,45 +212,46 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
185
212
|
hideRow(row: FRange): FWorksheet;
|
|
186
213
|
/**
|
|
187
214
|
* Hides one or more consecutive rows starting at the given index. Use 0-index for this method.
|
|
188
|
-
* @param rowIndex The starting index of the rows to hide.
|
|
189
|
-
* @param numRows The number of rows to hide.
|
|
190
|
-
* @returns This sheet, for chaining.
|
|
215
|
+
* @param {number} rowIndex The starting index of the rows to hide.
|
|
216
|
+
* @param {number} numRows The number of rows to hide.
|
|
217
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
191
218
|
*/
|
|
192
219
|
hideRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
193
220
|
/**
|
|
194
|
-
*
|
|
195
|
-
* @param row The range to unhide, if hidden.
|
|
196
|
-
* @returns This sheet, for chaining.
|
|
221
|
+
* Make the row in the given range visible.
|
|
222
|
+
* @param {FRange} row The range to unhide, if hidden.
|
|
223
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
197
224
|
*/
|
|
198
225
|
unhideRow(row: FRange): FWorksheet;
|
|
199
226
|
/**
|
|
200
|
-
*
|
|
201
|
-
* @param rowIndex The starting index of the rows
|
|
202
|
-
* @param numRows The number of rows
|
|
203
|
-
* @returns This sheet, for chaining.
|
|
227
|
+
* Scrolling sheet to make specific rows visible.
|
|
228
|
+
* @param {number} rowIndex The starting index of the rows
|
|
229
|
+
* @param {number} numRows The number of rows
|
|
230
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
204
231
|
*/
|
|
205
232
|
showRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
206
233
|
/**
|
|
207
234
|
* 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
|
-
* @param rowPosition The row position to change.
|
|
209
|
-
* @param height The height in pixels to set it to.
|
|
210
|
-
* @returns This sheet, for chaining.
|
|
235
|
+
* @param {number} rowPosition The row position to change.
|
|
236
|
+
* @param {number} height The height in pixels to set it to.
|
|
237
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
211
238
|
*/
|
|
212
239
|
setRowHeight(rowPosition: number, height: number): FWorksheet;
|
|
213
240
|
/**
|
|
214
|
-
* Sets the height of the given rows in pixels.
|
|
215
|
-
*
|
|
216
|
-
* @param
|
|
217
|
-
* @param
|
|
218
|
-
* @
|
|
241
|
+
* Sets the height of the given rows in pixels.
|
|
242
|
+
* By default, rows grow to fit cell contents. If you want to force rows to a specified height, use setRowHeightsForced(startRow, numRows, height).
|
|
243
|
+
* @param {number} startRow The starting row position to change.
|
|
244
|
+
* @param {number} numRows The number of rows to change.
|
|
245
|
+
* @param {number} height The height in pixels to set it to.
|
|
246
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
219
247
|
*/
|
|
220
248
|
setRowHeights(startRow: number, numRows: number, height: number): FWorksheet;
|
|
221
249
|
/**
|
|
222
250
|
* 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
|
-
* @param startRow The starting row position to change.
|
|
224
|
-
* @param numRows The number of rows to change.
|
|
225
|
-
* @param height The height in pixels to set it to.
|
|
226
|
-
* @returns This sheet, for chaining.
|
|
251
|
+
* @param {number} startRow The starting row position to change.
|
|
252
|
+
* @param {number} numRows The number of rows to change.
|
|
253
|
+
* @param {number} height The height in pixels to set it to.
|
|
254
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
227
255
|
*/
|
|
228
256
|
setRowHeightsForced(startRow: number, numRows: number, height: number): FWorksheet;
|
|
229
257
|
/**
|
|
@@ -299,13 +327,13 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
299
327
|
*/
|
|
300
328
|
hideColumns(columnIndex: number, numColumns?: number): FWorksheet;
|
|
301
329
|
/**
|
|
302
|
-
*
|
|
330
|
+
* Show the column in the given range.
|
|
303
331
|
* @param column The range to unhide, if hidden.
|
|
304
332
|
* @returns This sheet, for chaining.
|
|
305
333
|
*/
|
|
306
334
|
unhideColumn(column: FRange): FWorksheet;
|
|
307
335
|
/**
|
|
308
|
-
*
|
|
336
|
+
* Show one or more consecutive columns starting at the given index. Use 0-index for this method.
|
|
309
337
|
* @param columnIndex The starting index of the columns to unhide.
|
|
310
338
|
* @param numColumns The number of columns to unhide.
|
|
311
339
|
* @returns This sheet, for chaining.
|
|
@@ -351,19 +379,19 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
351
379
|
getActiveRange(): FRange | null;
|
|
352
380
|
/**
|
|
353
381
|
* Sets the active selection region for this sheet.
|
|
354
|
-
* @param range The range to set as the active selection.
|
|
382
|
+
* @param {FRange} range The range to set as the active selection.
|
|
383
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
355
384
|
*/
|
|
356
|
-
setActiveRange(range: FRange):
|
|
385
|
+
setActiveRange(range: FRange): FWorksheet;
|
|
357
386
|
/**
|
|
358
387
|
* Sets the active selection region for this sheet.
|
|
359
388
|
* @param range The range to set as the active selection.
|
|
360
389
|
*/
|
|
361
|
-
setActiveSelection: (range: FRange) =>
|
|
390
|
+
setActiveSelection: (range: FRange) => FWorksheet;
|
|
362
391
|
/**
|
|
363
392
|
* Sets the frozen state of the current sheet.
|
|
364
393
|
* @param freeze - the scrolling viewport start range and count of freezed rows and columns.
|
|
365
394
|
* that means if you want to freeze the first 3 rows and 2 columns, you should set freeze as { startRow: 3, startColumn: 2, xSplit: 2, ySplit: 3 }
|
|
366
|
-
*
|
|
367
395
|
* @deprecated use `setFrozenRows` and `setFrozenColumns` instead.
|
|
368
396
|
* @returns True if the command was successful, false otherwise.
|
|
369
397
|
*/
|
|
@@ -376,7 +404,6 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
376
404
|
/**
|
|
377
405
|
* Get the freeze state of the current sheet.
|
|
378
406
|
* @returns The freeze state of the current sheet.
|
|
379
|
-
*
|
|
380
407
|
* @deprecated use `getRowFreezeStatus` and `getColumnFreezeStatus` instead.
|
|
381
408
|
*/
|
|
382
409
|
getFreeze(): IFreeze;
|
|
@@ -385,21 +412,21 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
385
412
|
* @param columns The number of columns to freeze.
|
|
386
413
|
* To unfreeze all columns, set this value to 0.
|
|
387
414
|
*/
|
|
388
|
-
setFrozenColumns(columns: number):
|
|
415
|
+
setFrozenColumns(columns: number): FWorksheet;
|
|
389
416
|
/**
|
|
390
417
|
* Set freeze column, then the range from startColumn to endColumn will be fixed.
|
|
391
418
|
* e.g. setFrozenColumns(0, 2) will fix the column range from 0 to 2.
|
|
392
419
|
* e.g. setFrozenColumns(2, 3) will fix the column range from 2 to 3, And column from 0 to 1 will be invisible.
|
|
393
|
-
*
|
|
394
420
|
* @example
|
|
395
|
-
* ```
|
|
421
|
+
* ```typescript
|
|
396
422
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
397
423
|
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
398
424
|
* // freeze the first too columns.
|
|
399
425
|
* fWorkSheet.setFrozenColumns(0, 2);
|
|
400
426
|
* ```
|
|
401
|
-
* @param startColumn
|
|
402
|
-
* @param endColumn
|
|
427
|
+
* @param startColumn - The start column of the range to freeze.
|
|
428
|
+
* @param endColumn - The end column of the range to freeze.
|
|
429
|
+
* @returns {FWorksheet} This FWorksheet instance.
|
|
403
430
|
*/
|
|
404
431
|
setFrozenColumns(startColumn: number, endColumn: number): FWorksheet;
|
|
405
432
|
/**
|
|
@@ -407,14 +434,13 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
407
434
|
* @param rows The number of rows to freeze.
|
|
408
435
|
* To unfreeze all rows, set this value to 0.
|
|
409
436
|
*/
|
|
410
|
-
setFrozenRows(rows: number):
|
|
437
|
+
setFrozenRows(rows: number): FWorksheet;
|
|
411
438
|
/**
|
|
412
439
|
* Set freeze row, then the range from startRow to endRow will be fixed.
|
|
413
440
|
* e.g. setFrozenRows(0, 2) will fix the row range from 0 to 2.
|
|
414
441
|
* e.g. setFrozenRows(2, 3) will fix the row range from 2 to 3, And row from 0 to 1 will be invisible.
|
|
415
|
-
* @param startRow
|
|
416
|
-
* @param endRow
|
|
417
|
-
*
|
|
442
|
+
* @param startRow - The start row of the range to freeze.
|
|
443
|
+
* @param endRow - The end row of the range to freeze.
|
|
418
444
|
* @example
|
|
419
445
|
* ``` ts
|
|
420
446
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -426,30 +452,24 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
426
452
|
setFrozenRows(startColumn: number, endColumn: number): FWorksheet;
|
|
427
453
|
/**
|
|
428
454
|
* Get the number of frozen columns.
|
|
429
|
-
* @returns The number of frozen columns.
|
|
430
|
-
* Returns 0 if no columns are frozen.
|
|
455
|
+
* @returns The number of frozen columns, returns 0 if no columns are frozen.
|
|
431
456
|
*/
|
|
432
457
|
getFrozenColumns(): number;
|
|
433
458
|
/**
|
|
434
459
|
* Get the number of frozen rows.
|
|
435
|
-
* @returns The number of frozen rows.
|
|
436
|
-
* Returns 0 if no rows are frozen.
|
|
460
|
+
* @returns The number of frozen rows. returns 0 if no rows are frozen.
|
|
437
461
|
*/
|
|
438
462
|
getFrozenRows(): number;
|
|
439
463
|
/**
|
|
440
464
|
* Get freezed rows.
|
|
465
|
+
* @returns {IRowRange} The range of the frozen rows.
|
|
441
466
|
*/
|
|
442
|
-
getFrozenRowRange():
|
|
443
|
-
startRow: number;
|
|
444
|
-
endRow: number;
|
|
445
|
-
};
|
|
467
|
+
getFrozenRowRange(): IRowRange;
|
|
446
468
|
/**
|
|
447
469
|
* Get freezed columns
|
|
470
|
+
* @returns {IColumnRange} The range of the frozen columns.
|
|
448
471
|
*/
|
|
449
|
-
getFrozenColumnRange():
|
|
450
|
-
startColumn: number;
|
|
451
|
-
endColumn: number;
|
|
452
|
-
};
|
|
472
|
+
getFrozenColumnRange(): IColumnRange;
|
|
453
473
|
/**
|
|
454
474
|
* Returns true if the sheet's gridlines are hidden; otherwise returns false. Gridlines are visible by default.
|
|
455
475
|
* @returns {boolean} True if the sheet's gridlines are hidden; otherwise false.
|
|
@@ -467,6 +487,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
467
487
|
/**
|
|
468
488
|
* Hides or reveals the sheet gridlines.
|
|
469
489
|
* @param {boolean} hidden If `true`, hide gridlines in this sheet; otherwise show the gridlines.
|
|
490
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
470
491
|
* @example
|
|
471
492
|
* ``` ts
|
|
472
493
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -556,13 +577,14 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
556
577
|
onBeforeCellDataChange(callback: (cellValue: ObjectMatrix<Nullable<ICellData>>) => void): IDisposable;
|
|
557
578
|
/**
|
|
558
579
|
* Hides this sheet. Has no effect if the sheet is already hidden. If this method is called on the only visible sheet, it throws an exception.
|
|
580
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining
|
|
559
581
|
* @example
|
|
560
582
|
* ```ts
|
|
561
583
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
562
584
|
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
563
585
|
* // hide the active sheet
|
|
564
586
|
* fWorkSheet.hideSheet();
|
|
565
|
-
*
|
|
587
|
+
* ```
|
|
566
588
|
*/
|
|
567
589
|
hideSheet(): FWorksheet;
|
|
568
590
|
/**
|
|
@@ -682,6 +704,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
682
704
|
*/
|
|
683
705
|
getLastColumns(): number;
|
|
684
706
|
/**
|
|
707
|
+
* @deprecated use getLastColumn instead.
|
|
685
708
|
* Returns the position of the last column that has content. Same as getLastColumns.
|
|
686
709
|
* @returns {number} the last column of the sheet that contains content.
|
|
687
710
|
* @example
|
|
@@ -694,6 +717,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
694
717
|
*/
|
|
695
718
|
getLastColumn(): number;
|
|
696
719
|
/**
|
|
720
|
+
* @deprecated use getLastRow instead.
|
|
697
721
|
* Returns the position of the last row that has content.
|
|
698
722
|
* @returns {number} the last row of the sheet that contains content.
|
|
699
723
|
* @example
|
|
@@ -743,5 +767,80 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
743
767
|
* ```
|
|
744
768
|
*/
|
|
745
769
|
getDefinedNames(): FDefinedName[];
|
|
770
|
+
/**
|
|
771
|
+
* Set custom metadata of worksheet
|
|
772
|
+
* @param {CustomData | undefined} custom custom metadata
|
|
773
|
+
* @example
|
|
774
|
+
* ```ts
|
|
775
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
776
|
+
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
777
|
+
* fWorkSheet.setCustomMetadata({ key: 'value' });
|
|
778
|
+
* ```
|
|
779
|
+
*/
|
|
780
|
+
setCustomMetadata(custom: CustomData | undefined): FWorksheet;
|
|
781
|
+
/**
|
|
782
|
+
* Set custom metadata of row
|
|
783
|
+
* @param {number} index row index
|
|
784
|
+
* @param {CustomData | undefined} custom custom metadata
|
|
785
|
+
* @example
|
|
786
|
+
* ```ts
|
|
787
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
788
|
+
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
789
|
+
* fWorkSheet.setRowCustomMetadata(0, { key: 'value' });
|
|
790
|
+
* ```
|
|
791
|
+
*/
|
|
792
|
+
setRowCustomMetadata(index: number, custom: CustomData | undefined): FWorksheet;
|
|
793
|
+
/**
|
|
794
|
+
* Set custom metadata of column
|
|
795
|
+
* @param {number} index column index
|
|
796
|
+
* @param {CustomData | undefined} custom custom metadata
|
|
797
|
+
* @example
|
|
798
|
+
* ```ts
|
|
799
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
800
|
+
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
801
|
+
* fWorkSheet.setColumnCustomMetadata(0, { key: 'value' });
|
|
802
|
+
* ```
|
|
803
|
+
*/
|
|
804
|
+
setColumnCustomMetadata(index: number, custom: CustomData | undefined): FWorksheet;
|
|
805
|
+
/**
|
|
806
|
+
* Get custom metadata of row
|
|
807
|
+
* @param {number} index row index
|
|
808
|
+
* @returns {CustomData | undefined} custom metadata
|
|
809
|
+
* @example
|
|
810
|
+
* ```ts
|
|
811
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
812
|
+
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
813
|
+
* const custom = fWorkSheet.getRowCustomMetadata(0);
|
|
814
|
+
* ```
|
|
815
|
+
*/
|
|
816
|
+
getRowCustomMetadata(index: number): CustomData | undefined;
|
|
817
|
+
/**
|
|
818
|
+
* Get custom metadata of column
|
|
819
|
+
* @param {number} index column index
|
|
820
|
+
* @returns {CustomData | undefined} custom metadata
|
|
821
|
+
* @example
|
|
822
|
+
* ```ts
|
|
823
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
824
|
+
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
825
|
+
* const custom = fWorkSheet.getColumnCustomMetadata(0);
|
|
826
|
+
* ```
|
|
827
|
+
*/
|
|
828
|
+
getColumnCustomMetadata(index: number): CustomData | undefined;
|
|
829
|
+
/**
|
|
830
|
+
* Get all merged cells in the current worksheet
|
|
831
|
+
* @returns {FRange[]} All the merged cells in the worksheet
|
|
832
|
+
* @example
|
|
833
|
+
* ```ts
|
|
834
|
+
* const workbook = univerAPI.getActiveWorkbook();
|
|
835
|
+
* const worksheet = workbook.getActiveSheet();
|
|
836
|
+
* const rangeFirst = worksheet.getRange(0, 0, 2, 2);
|
|
837
|
+
* const mergeFirst = rangeFirst.merge();
|
|
838
|
+
* const rangeSecond = worksheet.getRange(5, 0, 2, 2);
|
|
839
|
+
* const mergeSecond = rangeSecond.merge();
|
|
840
|
+
* const mergeData = worksheet.getMergeData();
|
|
841
|
+
* console.log('debugger', mergeData);
|
|
842
|
+
* ```
|
|
843
|
+
*/
|
|
844
|
+
getMergeData(): FRange[];
|
|
746
845
|
}
|
|
747
846
|
export {};
|
|
@@ -17,7 +17,6 @@ import './f-univer';
|
|
|
17
17
|
export * from './f-event';
|
|
18
18
|
export { FPermission } from './f-permission';
|
|
19
19
|
export { FRange } from './f-range';
|
|
20
|
-
export type { FontLine, FontStyle, FontWeight } from './f-range';
|
|
21
20
|
export { FSelection } from './f-selection';
|
|
22
21
|
export { FSheetHooks } from './f-sheet-hooks';
|
|
23
22
|
export { FWorkbook } from './f-workbook';
|
|
@@ -1,24 +1,60 @@
|
|
|
1
1
|
import { CellValue, ICellData, IObjectMatrixPrimitiveType, IRange, IRangeWithCoord, Worksheet, HorizontalAlign, VerticalAlign } from '@univerjs/core';
|
|
2
2
|
export type FHorizontalAlignment = 'left' | 'center' | 'normal';
|
|
3
3
|
export type FVerticalAlignment = 'top' | 'middle' | 'bottom';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param value
|
|
7
|
+
*/
|
|
4
8
|
export declare function transformFacadeHorizontalAlignment(value: FHorizontalAlignment): HorizontalAlign;
|
|
9
|
+
/**
|
|
10
|
+
*
|
|
11
|
+
* @param value
|
|
12
|
+
*/
|
|
5
13
|
export declare function transformCoreHorizontalAlignment(value: HorizontalAlign): FHorizontalAlignment;
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param value
|
|
17
|
+
*/
|
|
6
18
|
export declare function transformFacadeVerticalAlignment(value: FVerticalAlignment): VerticalAlign;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param value
|
|
22
|
+
*/
|
|
7
23
|
export declare function transformCoreVerticalAlignment(value: VerticalAlign): FVerticalAlignment;
|
|
8
24
|
/**
|
|
9
|
-
*
|
|
25
|
+
* Covert cell value to cell data.
|
|
10
26
|
* @param value
|
|
11
27
|
* @returns
|
|
12
28
|
*/
|
|
13
29
|
export declare function covertCellValue(value: CellValue | ICellData): ICellData;
|
|
14
30
|
/**
|
|
15
|
-
*
|
|
31
|
+
* Covert cell value array or matrix to cell data.
|
|
16
32
|
* @param value
|
|
17
33
|
* @param range
|
|
18
34
|
* @returns
|
|
19
35
|
*/
|
|
20
36
|
export declare function covertCellValues(value: CellValue[][] | IObjectMatrixPrimitiveType<CellValue> | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>, range: IRange): IObjectMatrixPrimitiveType<ICellData>;
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param mergeInfo
|
|
40
|
+
* @param range
|
|
41
|
+
*/
|
|
21
42
|
export declare function isCellMerged(mergeInfo: IRangeWithCoord, range: IRange): boolean;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @param mergeInfo
|
|
46
|
+
* @param range
|
|
47
|
+
*/
|
|
22
48
|
export declare function isSingleCell(mergeInfo: IRangeWithCoord, range: IRange): boolean;
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param range
|
|
52
|
+
* @param worksheet
|
|
53
|
+
*/
|
|
23
54
|
export declare function covertToRowRange(range: IRange, worksheet: Worksheet): IRange;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @param range
|
|
58
|
+
* @param worksheet
|
|
59
|
+
*/
|
|
24
60
|
export declare function covertToColRange(range: IRange, worksheet: Worksheet): IRange;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -49,6 +49,8 @@ export { getNextPrimaryCell } from './services/selections/move-active-cell-util'
|
|
|
49
49
|
export { ExclusiveRangeService, IExclusiveRangeService } from './services/exclusive-range/exclusive-range-service';
|
|
50
50
|
export { defaultWorksheetPermissionPoint, getAllWorksheetPermissionPoint, getAllWorksheetPermissionPointByPointPanel } from './services/permission';
|
|
51
51
|
export type { IWorksheetProtectionRule } from './services/permission/type';
|
|
52
|
+
export { SheetPermissionCheckController } from './controllers/permission/sheet-permission-check.controller';
|
|
53
|
+
export { SheetPermissionInitController } from './controllers/permission/sheet-permission-init.controller';
|
|
52
54
|
export { WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from './services/permission/worksheet-permission';
|
|
53
55
|
export { defaultWorkbookPermissionPoints, getAllWorkbookPermissionPoint } from './services/permission/workbook-permission';
|
|
54
56
|
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';
|
|
@@ -44,15 +44,15 @@ export declare class RangeThemeStyle {
|
|
|
44
44
|
*/
|
|
45
45
|
lastRowStyle: Nullable<IRangeThemeStyleItem>;
|
|
46
46
|
/**
|
|
47
|
-
* @property {Nullable<IRangeThemeStyleItem>} effect for the first column.
|
|
47
|
+
* @property {Nullable<IRangeThemeStyleItem>} firstColumnStyle effect for the first column.
|
|
48
48
|
*/
|
|
49
49
|
firstColumnStyle: Nullable<IRangeThemeStyleItem>;
|
|
50
50
|
/**
|
|
51
|
-
* @property {Nullable<IRangeThemeStyleItem>} effect for the second column.
|
|
51
|
+
* @property {Nullable<IRangeThemeStyleItem>} secondColumnStyle effect for the second column.
|
|
52
52
|
*/
|
|
53
53
|
secondColumnStyle: Nullable<IRangeThemeStyleItem>;
|
|
54
54
|
/**
|
|
55
|
-
* @property {Nullable<IRangeThemeStyleItem>} effect for the last column.
|
|
55
|
+
* @property {Nullable<IRangeThemeStyleItem>} lastColumnStyle effect for the last column.
|
|
56
56
|
*/
|
|
57
57
|
lastColumnStyle: Nullable<IRangeThemeStyleItem>;
|
|
58
58
|
/**
|