@univerjs/sheets 0.6.1 → 0.6.2-nightly.202503031606
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 +1504 -706
- package/lib/es/index.js +3410 -3178
- package/lib/types/basics/interfaces/selection-config.d.ts +4 -0
- package/lib/types/basics/utils.d.ts +4 -1
- package/lib/types/commands/commands/append-row.command.d.ts +17 -0
- package/lib/types/commands/commands/insert-row-col.command.d.ts +10 -0
- package/lib/types/commands/commands/set-style.command.d.ts +1 -1
- package/lib/types/commands/commands/utils/selection-utils.d.ts +2 -2
- package/lib/types/commands/operations/selection.operation.d.ts +10 -1
- package/lib/types/facade/f-range.d.ts +547 -15
- package/lib/types/facade/f-workbook.d.ts +10 -0
- package/lib/types/facade/f-worksheet.d.ts +84 -7
- package/lib/types/facade/utils.d.ts +36 -27
- package/lib/types/index.d.ts +4 -3
- package/lib/types/services/ref-range/util.d.ts +11 -2
- package/lib/types/services/selections/selection.service.d.ts +4 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +9 -9
- package/LICENSE +0 -176
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { CustomData, ICellData, IColumnRange, IDisposable, IFreeze, IObjectArrayPrimitiveType, IRange, IRowRange, IStyleData, Nullable, Workbook, Worksheet, BooleanNumber, ICommandService, ILogService, Injector, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { CellValue, CustomData, ICellData, IColumnRange, IDisposable, IFreeze, IObjectArrayPrimitiveType, IRange, IRowRange, IStyleData, Nullable, Workbook, Worksheet, BooleanNumber, 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 { FBaseInitialable } from '@univerjs/core/facade';
|
|
5
5
|
import { SheetsSelectionsService } from '@univerjs/sheets';
|
|
6
6
|
import { FRange } from './f-range';
|
|
7
7
|
import { FSelection } from './f-selection';
|
|
8
|
-
interface IFacadeClearOptions {
|
|
8
|
+
export interface IFacadeClearOptions {
|
|
9
9
|
contentsOnly?: boolean;
|
|
10
10
|
formatOnly?: boolean;
|
|
11
11
|
}
|
|
@@ -441,7 +441,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
441
441
|
/**
|
|
442
442
|
* Scrolling sheet to make specific rows visible.
|
|
443
443
|
* @param {number} rowIndex - The starting index of the rows
|
|
444
|
-
* @param {number}
|
|
444
|
+
* @param {number} numRows - The number of rows
|
|
445
445
|
* @returns {FWorksheet} This worksheet instance for chaining
|
|
446
446
|
* @example
|
|
447
447
|
* ```typescript
|
|
@@ -452,7 +452,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
452
452
|
* fWorksheet.showRows(0);
|
|
453
453
|
* ```
|
|
454
454
|
*/
|
|
455
|
-
showRows(rowIndex: number,
|
|
455
|
+
showRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
456
456
|
/**
|
|
457
457
|
* 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).
|
|
458
458
|
* @param {number} rowPosition - The row position to change.
|
|
@@ -494,6 +494,24 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
494
494
|
* ```
|
|
495
495
|
*/
|
|
496
496
|
setRowHeights(startRow: number, numRows: number, height: number): FWorksheet;
|
|
497
|
+
/**
|
|
498
|
+
* Gets the height in pixels of the given row.
|
|
499
|
+
* @param {number} rowPosition - The position of the row to examine. index starts at 0.
|
|
500
|
+
* @returns {number} The height in pixels of the given row.
|
|
501
|
+
* @example
|
|
502
|
+
* ```typescript
|
|
503
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
504
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
505
|
+
*
|
|
506
|
+
* // Set the value of the cell A1 to 'Hello, Univer!', set the font size to 30 and font weight to bold
|
|
507
|
+
* const fRange = fWorksheet.getRange('A1');
|
|
508
|
+
* fRange.setValue('Hello, Univer!').setFontSize(30).setFontWeight('bold');
|
|
509
|
+
*
|
|
510
|
+
* // Get the height of the first row
|
|
511
|
+
* console.log(fWorksheet.getRowHeight(0));
|
|
512
|
+
* ```
|
|
513
|
+
*/
|
|
514
|
+
getRowHeight(rowPosition: number): number;
|
|
497
515
|
/**
|
|
498
516
|
* Sets the height of the given rows to auto.
|
|
499
517
|
* @param {number} startRow - The starting row position to change
|
|
@@ -506,6 +524,21 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
506
524
|
* ```
|
|
507
525
|
*/
|
|
508
526
|
setRowAutoHeight(startRow: number, numRows: number): FWorksheet;
|
|
527
|
+
/**
|
|
528
|
+
* Sets the height of the given ranges to auto.
|
|
529
|
+
* @param {IRange[]} ranges - The ranges to change
|
|
530
|
+
* @returns {FWorksheet} This worksheet instance for chaining
|
|
531
|
+
* @example
|
|
532
|
+
* ```typescript
|
|
533
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
534
|
+
* const ranges = [
|
|
535
|
+
* { startRow: 1, endRow: 10, startColumn: 0, endColumn: 10 },
|
|
536
|
+
* { startRow: 11, endRow: 20, startColumn: 0, endColumn: 10 },
|
|
537
|
+
* ]
|
|
538
|
+
* fWorksheet.setRangesAutoHeight(ranges);
|
|
539
|
+
* ```
|
|
540
|
+
*/
|
|
541
|
+
setRangesAutoHeight(ranges: IRange[]): FWorksheet;
|
|
509
542
|
/**
|
|
510
543
|
* 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.
|
|
511
544
|
* @param {number} startRow - The starting row position to change
|
|
@@ -699,7 +732,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
699
732
|
/**
|
|
700
733
|
* Show one or more consecutive columns starting at the given index. Use 0-index for this method
|
|
701
734
|
* @param {number} columnIndex - The starting index of the columns to unhide
|
|
702
|
-
* @param {number}
|
|
735
|
+
* @param {number} numColumns - The number of columns to unhide
|
|
703
736
|
* @returns {FWorksheet} This sheet, for chaining
|
|
704
737
|
* @example
|
|
705
738
|
* ```typescript
|
|
@@ -710,7 +743,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
710
743
|
* fWorksheet.showColumns(0, 1);
|
|
711
744
|
* ```
|
|
712
745
|
*/
|
|
713
|
-
showColumns(columnIndex: number,
|
|
746
|
+
showColumns(columnIndex: number, numColumns?: number): FWorksheet;
|
|
714
747
|
/**
|
|
715
748
|
* Sets the width of the given column in pixels.
|
|
716
749
|
* @param {number} columnPosition - The position of the given column to set
|
|
@@ -738,6 +771,27 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
738
771
|
* ```
|
|
739
772
|
*/
|
|
740
773
|
setColumnWidths(startColumn: number, numColumn: number, width: number): FWorksheet;
|
|
774
|
+
/**
|
|
775
|
+
* Gets the width in pixels of the given column.
|
|
776
|
+
* @param {number} columnPosition - The position of the column to examine. index starts at 0.
|
|
777
|
+
* @returns {number} The width of the column in pixels
|
|
778
|
+
* @example
|
|
779
|
+
* ```typescript
|
|
780
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
781
|
+
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
782
|
+
*
|
|
783
|
+
* // Set the long text value in cell A1
|
|
784
|
+
* const fRange = fWorksheet.getRange('A1');
|
|
785
|
+
* fRange.setValue('Whenever it is a damp, drizzly November in my soul...');
|
|
786
|
+
*
|
|
787
|
+
* // Set the column A to a width which fits the text
|
|
788
|
+
* fWorksheet.autoResizeColumn(0);
|
|
789
|
+
*
|
|
790
|
+
* // Get the width of the column A
|
|
791
|
+
* console.log(fWorksheet.getColumnWidth(0));
|
|
792
|
+
* ```
|
|
793
|
+
*/
|
|
794
|
+
getColumnWidth(columnPosition: number): number;
|
|
741
795
|
/**
|
|
742
796
|
* Set custom properties for given columns.
|
|
743
797
|
* @param {IObjectArrayPrimitiveType<CustomData>} custom - The custom properties to set
|
|
@@ -819,6 +873,16 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
819
873
|
* ```
|
|
820
874
|
*/
|
|
821
875
|
setActiveRange(range: FRange): FWorksheet;
|
|
876
|
+
/**
|
|
877
|
+
* Returns the active cell in this sheet.
|
|
878
|
+
* @returns {FRange | null} The active cell
|
|
879
|
+
* @example
|
|
880
|
+
* ```typescript
|
|
881
|
+
* const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
882
|
+
* console.log(fWorkSheet.getActiveCell().getA1Notation());
|
|
883
|
+
* ```
|
|
884
|
+
*/
|
|
885
|
+
getActiveCell(): FRange | null;
|
|
822
886
|
/**
|
|
823
887
|
* Sets the active selection region for this sheet.
|
|
824
888
|
* @param range - The range to set as the active selection
|
|
@@ -1330,5 +1394,18 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
1330
1394
|
* ```
|
|
1331
1395
|
*/
|
|
1332
1396
|
getColumnCustomMetadata(index: number): CustomData | undefined;
|
|
1397
|
+
/**
|
|
1398
|
+
* Appends a row to the bottom of the current data region in the sheet. If a cell's content begins with =, it's interpreted as a formula.
|
|
1399
|
+
* @param {CellValue[]} rowContents - An array of values for the new row.
|
|
1400
|
+
* @returns {FWorksheet} Returns the current worksheet instance for method chaining.
|
|
1401
|
+
* @example
|
|
1402
|
+
* ```ts
|
|
1403
|
+
* // Appends a new row with 4 columns to the bottom of the current
|
|
1404
|
+
* // data region in the sheet containing the values in the array.
|
|
1405
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
1406
|
+
* const fWorkSheet = fWorkbook.getActiveSheet();
|
|
1407
|
+
* fWorkSheet.appendRow([1, 'Hello Univer', true, '=A1']);
|
|
1408
|
+
* ```
|
|
1409
|
+
*/
|
|
1410
|
+
appendRow(rowContents: CellValue[]): FWorksheet;
|
|
1333
1411
|
}
|
|
1334
|
-
export {};
|
|
@@ -1,60 +1,69 @@
|
|
|
1
1
|
import { CellValue, ICellData, IObjectMatrixPrimitiveType, IRange, IRangeWithCoord, Worksheet, HorizontalAlign, VerticalAlign } from '@univerjs/core';
|
|
2
|
+
export type FDefaultAlignment = 'general';
|
|
2
3
|
export type FHorizontalAlignment = 'left' | 'center' | 'normal';
|
|
3
4
|
export type FVerticalAlignment = 'top' | 'middle' | 'bottom';
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
* @param value
|
|
6
|
+
* Transform the Facade API horizontal alignment to the Univer Core horizontal alignment.
|
|
7
|
+
* @param {FHorizontalAlignment} value - The Facade API horizontal alignment.
|
|
8
|
+
* @returns {HorizontalAlign} The Univer Core horizontal alignment.
|
|
7
9
|
*/
|
|
8
10
|
export declare function transformFacadeHorizontalAlignment(value: FHorizontalAlignment): HorizontalAlign;
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param value
|
|
12
|
+
* Transform the Univer Core horizontal alignment to the Facade API horizontal alignment.
|
|
13
|
+
* @param {HorizontalAlign} value - The Univer Core horizontal alignment.
|
|
14
|
+
* @returns {FHorizontalAlignment} The Facade API horizontal alignment.
|
|
12
15
|
*/
|
|
13
|
-
export declare function transformCoreHorizontalAlignment(value: HorizontalAlign): FHorizontalAlignment;
|
|
16
|
+
export declare function transformCoreHorizontalAlignment(value: HorizontalAlign): FHorizontalAlignment | FDefaultAlignment;
|
|
14
17
|
/**
|
|
15
|
-
*
|
|
16
|
-
* @param value
|
|
18
|
+
* Transform the Facade API vertical alignment to the Univer Core vertical alignment.
|
|
19
|
+
* @param {FVerticalAlignment} value - The Facade API vertical alignment.
|
|
20
|
+
* @returns {VerticalAlign} The Univer Core vertical alignment.
|
|
17
21
|
*/
|
|
18
22
|
export declare function transformFacadeVerticalAlignment(value: FVerticalAlignment): VerticalAlign;
|
|
19
23
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @param value
|
|
24
|
+
* Transform the Univer Core vertical alignment to the Facade API vertical alignment.
|
|
25
|
+
* @param {VerticalAlign} value - The Univer Core vertical alignment.
|
|
26
|
+
* @returns {FVerticalAlignment} The Facade API vertical alignment.
|
|
22
27
|
*/
|
|
23
|
-
export declare function transformCoreVerticalAlignment(value: VerticalAlign): FVerticalAlignment;
|
|
28
|
+
export declare function transformCoreVerticalAlignment(value: VerticalAlign): FVerticalAlignment | FDefaultAlignment;
|
|
24
29
|
/**
|
|
25
30
|
* Covert cell value to cell data.
|
|
26
|
-
* @param value
|
|
27
|
-
* @returns
|
|
31
|
+
* @param {CellValue | ICellData} value - The cell value.
|
|
32
|
+
* @returns {ICellData} The cell data.
|
|
28
33
|
*/
|
|
29
34
|
export declare function covertCellValue(value: CellValue | ICellData): ICellData;
|
|
30
35
|
/**
|
|
31
36
|
* Covert cell value array or matrix to cell data.
|
|
32
|
-
* @param value
|
|
33
|
-
* @param range
|
|
34
|
-
* @returns
|
|
37
|
+
* @param {CellValue[][] | IObjectMatrixPrimitiveType<CellValue> | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>} value - The cell value array or matrix.
|
|
38
|
+
* @param {IRange} range - The range.
|
|
39
|
+
* @returns {IObjectMatrixPrimitiveType<ICellData>} The cell data matrix.
|
|
35
40
|
*/
|
|
36
41
|
export declare function covertCellValues(value: CellValue[][] | IObjectMatrixPrimitiveType<CellValue> | ICellData[][] | IObjectMatrixPrimitiveType<ICellData>, range: IRange): IObjectMatrixPrimitiveType<ICellData>;
|
|
37
42
|
/**
|
|
38
|
-
*
|
|
39
|
-
* @param mergeInfo
|
|
40
|
-
* @param range
|
|
43
|
+
* Judge whether the range is merged.
|
|
44
|
+
* @param {IRangeWithCoord} mergeInfo - The merge info.
|
|
45
|
+
* @param {IRange} range - The range.
|
|
46
|
+
* @returns {boolean} Whether the range is merged.
|
|
41
47
|
*/
|
|
42
48
|
export declare function isCellMerged(mergeInfo: IRangeWithCoord, range: IRange): boolean;
|
|
43
49
|
/**
|
|
44
|
-
*
|
|
45
|
-
* @param mergeInfo
|
|
46
|
-
* @param range
|
|
50
|
+
* Judge whether the range is single cell.
|
|
51
|
+
* @param {IRangeWithCoord} mergeInfo - The merge info.
|
|
52
|
+
* @param {IRange} range - The range.
|
|
53
|
+
* @returns {boolean} Whether the range is single cell.
|
|
47
54
|
*/
|
|
48
55
|
export declare function isSingleCell(mergeInfo: IRangeWithCoord, range: IRange): boolean;
|
|
49
56
|
/**
|
|
50
|
-
*
|
|
51
|
-
* @param range
|
|
52
|
-
* @param worksheet
|
|
57
|
+
* Covert the range to row range.
|
|
58
|
+
* @param {IRange} range - The range.
|
|
59
|
+
* @param {Worksheet} worksheet - The worksheet.
|
|
60
|
+
* @returns {IRange} The row range.
|
|
53
61
|
*/
|
|
54
62
|
export declare function covertToRowRange(range: IRange, worksheet: Worksheet): IRange;
|
|
55
63
|
/**
|
|
56
|
-
*
|
|
57
|
-
* @param range
|
|
58
|
-
* @param worksheet
|
|
64
|
+
* Covert the range to column range.
|
|
65
|
+
* @param {IRange} range - The range.
|
|
66
|
+
* @param {Worksheet} worksheet - The worksheet.
|
|
67
|
+
* @returns {IRange} The column range.
|
|
59
68
|
*/
|
|
60
69
|
export declare function covertToColRange(range: IRange, worksheet: Worksheet): IRange;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -70,7 +70,7 @@ export { RangeProtectionPermissionViewPoint } from './services/permission/permis
|
|
|
70
70
|
export { RangeProtectionPermissionManageCollaPoint } from './services/permission/permission-point/range/manage-collaborator';
|
|
71
71
|
export { RangeProtectionPermissionDeleteProtectionPoint } from './services/permission/permission-point/range/delete-protection';
|
|
72
72
|
export { baseProtectionActions } from './services/permission/range-permission/util';
|
|
73
|
-
export { generateNullCell, generateNullCellValue } from './basics/utils';
|
|
73
|
+
export { generateNullCell, generateNullCellValue, getVisibleRanges, rangeToDiscreteRange } from './basics/utils';
|
|
74
74
|
export { getSheetCommandTarget, getSheetCommandTargetWorkbook, getSheetMutationTarget } from './commands/commands/utils/target-util';
|
|
75
75
|
export { alignToMergedCellsBorders, getCellAtRowCol, isSingleCellSelection, setEndForRange } from './commands/commands/utils/selection-utils';
|
|
76
76
|
export { getSelectionsService } from './commands/utils/selection-command-util';
|
|
@@ -88,6 +88,7 @@ export { DeleteWorksheetProtectionCommand } from './commands/commands/delete-wor
|
|
|
88
88
|
export { addMergeCellsUtil, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand, } from './commands/commands/add-worksheet-merge.command';
|
|
89
89
|
export { SetWorksheetRangeThemeStyleCommand } from './commands/commands/add-worksheet-range-theme.command';
|
|
90
90
|
export { DeleteWorksheetRangeThemeStyleCommand } from './commands/commands/delete-worksheet-range-theme.command';
|
|
91
|
+
export { AppendRowCommand, type IAppendRowCommandParams } from './commands/commands/append-row.command';
|
|
91
92
|
export { ClearSelectionAllCommand } from './commands/commands/clear-selection-all.command';
|
|
92
93
|
export { ClearSelectionContentCommand } from './commands/commands/clear-selection-content.command';
|
|
93
94
|
export { ClearSelectionFormatCommand } from './commands/commands/clear-selection-format.command';
|
|
@@ -105,7 +106,7 @@ export { type ISetRowDataMutationParams, SetRowDataMutation, SetRowDataMutationF
|
|
|
105
106
|
export { type ISetRowDataCommandParams, SetRowDataCommand } from './commands/commands/set-row-data.command';
|
|
106
107
|
export { type ISetColDataMutationParams, SetColDataMutation, SetColDataMutationFactory } from './commands/mutations/set-col-data.mutation';
|
|
107
108
|
export { type ISetColDataCommandParams, SetColDataCommand } from './commands/commands/set-col-data.command';
|
|
108
|
-
export { type IInsertColCommandParams, type IInsertRowCommandParams, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, } from './commands/commands/insert-row-col.command';
|
|
109
|
+
export { type IInsertColCommandParams, type IInsertRowCommandParams, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, } from './commands/commands/insert-row-col.command';
|
|
109
110
|
export { type IInsertSheetCommandParams, InsertSheetCommand } from './commands/commands/insert-sheet.command';
|
|
110
111
|
export { getMoveRangeUndoRedoMutations, type IMoveRangeCommandParams, MoveRangeCommand } from './commands/commands/move-range.command';
|
|
111
112
|
export { type IMoveColsCommandParams, type IMoveRowsCommandParams, MoveColsCommand, MoveRowsCommand, } from './commands/commands/move-rows-cols.command';
|
|
@@ -183,7 +184,7 @@ export type { ISetWorksheetProtectionParams } from './commands/mutations/set-wor
|
|
|
183
184
|
export { SetWorksheetRightToLeftMutation } from './commands/mutations/set-worksheet-right-to-left.mutation';
|
|
184
185
|
export { type ISetWorksheetRowAutoHeightMutationParams, type ISetWorksheetRowHeightMutationParams, type ISetWorksheetRowIsAutoHeightMutationParams, SetWorksheetRowAutoHeightMutation, SetWorksheetRowAutoHeightMutationFactory, SetWorksheetRowHeightMutation, SetWorksheetRowIsAutoHeightMutation, } from './commands/mutations/set-worksheet-row-height.mutation';
|
|
185
186
|
export { type IScrollToCellOperationParams, ScrollToCellOperation } from './commands/operations/scroll-to-cell.operation';
|
|
186
|
-
export { type ISetSelectionsOperationParams, SetSelectionsOperation } from './commands/operations/selection.operation';
|
|
187
|
+
export { type ISelectRangeCommandParams, type ISetSelectionsOperationParams, SelectRangeCommand, SetSelectionsOperation } from './commands/operations/selection.operation';
|
|
187
188
|
export { type ISetWorksheetActiveOperationParams, SetWorksheetActiveOperation } from './commands/operations/set-worksheet-active.operation';
|
|
188
189
|
export { type IToggleCellCheckboxCommandParams, ToggleCellCheckboxCommand } from './commands/commands/toggle-checkbox.command';
|
|
189
190
|
export { SCOPE_WORKBOOK_VALUE_DEFINED_NAME } from './controllers/defined-name-data.controller';
|
|
@@ -2,10 +2,10 @@ import { IAccessor, ICommandInfo, IMutationInfo, IRange, Nullable, RANGE_TYPE }
|
|
|
2
2
|
import { IInsertColMutationParams, IInsertRowMutationParams, IRemoveColMutationParams, IRemoveRowsMutationParams, IRemoveSheetMutationParams } from '../../basics';
|
|
3
3
|
import { IInsertColCommandParams, IInsertRowCommandParams } from '../../commands/commands/insert-row-col.command';
|
|
4
4
|
import { IRemoveRowColCommandInterceptParams } from '../../commands/commands/remove-row-col.command';
|
|
5
|
-
import { ISheetCommandSharedParams } from '../../commands/utils/interface';
|
|
6
|
-
import { EffectRefRangeParams, IDeleteRangeMoveLeftCommand, IDeleteRangeMoveUpCommand, IInsertColCommand, IInsertRangeMoveDownCommand, IInsertRangeMoveRightCommand, IInsertRowCommand, IMoveColsCommand, IMoveRangeCommand, IMoveRowsCommand, IOperator, IRemoveRowColCommand, IReorderRangeCommand } from './type';
|
|
7
5
|
import { IMoveRangeMutationParams } from '../../commands/mutations/move-range.mutation';
|
|
8
6
|
import { IMoveColumnsMutationParams, IMoveRowsMutationParams } from '../../commands/mutations/move-rows-cols.mutation';
|
|
7
|
+
import { ISheetCommandSharedParams } from '../../commands/utils/interface';
|
|
8
|
+
import { EffectRefRangeParams, IDeleteRangeMoveLeftCommand, IDeleteRangeMoveUpCommand, IInsertColCommand, IInsertRangeMoveDownCommand, IInsertRangeMoveRightCommand, IInsertRowCommand, IMoveColsCommand, IMoveRangeCommand, IMoveRowsCommand, IOperator, IRemoveRowColCommand, IReorderRangeCommand } from './type';
|
|
9
9
|
import { SheetsSelectionsService } from '../selections/selection.service';
|
|
10
10
|
export declare const handleRangeTypeInput: (range: IRange) => {
|
|
11
11
|
rangeType?: RANGE_TYPE;
|
|
@@ -55,6 +55,15 @@ export declare const handleBaseRemoveRange: (_removeRange: IRange, _targetRange:
|
|
|
55
55
|
export declare const handleIRemoveCol: (param: IRemoveRowColCommand, targetRange: IRange) => IOperator[];
|
|
56
56
|
export declare const handleIRemoveRow: (param: IRemoveRowColCommand, targetRange: IRange) => IOperator[];
|
|
57
57
|
export declare const handleReorderRange: (param: IReorderRangeCommand, targetRange: IRange) => IOperator[];
|
|
58
|
+
/**
|
|
59
|
+
* see docs/tldr/ref-range/insert-rows-cols.tldr
|
|
60
|
+
* calculate insert steps(move step) or expand size(length) to ref range.
|
|
61
|
+
*
|
|
62
|
+
* @param _insertRange inserted range
|
|
63
|
+
* @param _targetRange ref range
|
|
64
|
+
* @returns {step: number, length: number} step means inserted count of row/col before ref range, that would cause range move few cells(steps) afterward.
|
|
65
|
+
* length means expand size of row/col in ref range, that would make ref range larger than before.
|
|
66
|
+
*/
|
|
58
67
|
export declare const handleBaseInsertRange: (_insertRange: IRange, _targetRange: IRange) => {
|
|
59
68
|
step: number;
|
|
60
69
|
length: number;
|
|
@@ -3,6 +3,10 @@ import { Observable } from 'rxjs';
|
|
|
3
3
|
import { ISelectionWithStyle } from '../../basics/selection';
|
|
4
4
|
import { ISelectionManagerSearchParam, SelectionMoveType } from './type';
|
|
5
5
|
import { WorkbookSelectionModel } from './selection-data-model';
|
|
6
|
+
/**
|
|
7
|
+
* For normal selection.
|
|
8
|
+
* Ref selection is in RefSelectionService which extends this class.
|
|
9
|
+
*/
|
|
6
10
|
export declare class SheetsSelectionsService extends RxDisposable {
|
|
7
11
|
protected readonly _instanceSrv: IUniverInstanceService;
|
|
8
12
|
private get _currentSelectionPos();
|