@univerjs/sheets 0.15.2 → 0.15.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 +290 -258
- package/lib/es/index.js +2862 -2772
- package/lib/facade.js +290 -258
- package/lib/index.js +2862 -2772
- package/lib/types/commands/commands/insert-range-move-down.command.d.ts +1 -1
- package/lib/types/commands/commands/insert-range-move-right.command.d.ts +1 -1
- package/lib/types/commands/commands/text-to-number.command.d.ts +9 -0
- package/lib/types/facade/f-worksheet.d.ts +24 -0
- package/lib/types/index.d.ts +3 -2
- package/lib/types/services/ref-range/type.d.ts +4 -4
- package/lib/types/services/ref-range/util.d.ts +11 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +3 -3
- package/package.json +7 -7
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICommand, IRange } from '@univerjs/core';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IInsertRangeMoveDownCommandParams {
|
|
3
3
|
range: IRange;
|
|
4
4
|
}
|
|
5
5
|
export declare const InsertRangeMoveDownCommandId = "sheet.command.insert-range-move-down";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICommand, IRange } from '@univerjs/core';
|
|
2
|
-
export interface
|
|
2
|
+
export interface IInsertRangeMoveRightCommandParams {
|
|
3
3
|
range: IRange;
|
|
4
4
|
}
|
|
5
5
|
export declare const InsertRangeMoveRightCommandId = "sheet.command.insert-range-move-right";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICommand, IRange } from '@univerjs/core';
|
|
2
|
+
import { ISheetCommandSharedParams } from '../utils/interface';
|
|
3
|
+
export interface ITextToNumberCommandParams extends Partial<ISheetCommandSharedParams> {
|
|
4
|
+
ranges?: IRange[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The command to convert text to number in selected cells.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TextToNumberCommand: ICommand;
|
|
@@ -376,6 +376,18 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
376
376
|
* ```
|
|
377
377
|
*/
|
|
378
378
|
deleteRows(rowPosition: number, howMany: number): FWorksheet;
|
|
379
|
+
/**
|
|
380
|
+
* Deletes the rows specified by the given row points. Each point can be a single row index or a tuple representing a range of rows.
|
|
381
|
+
* @param {Array<number | [number, number]>} rowPoints - An array of row points to delete. Each point can be a single row index or a tuple representing a range of rows.
|
|
382
|
+
* @returns {FWorksheet} This sheet, for chaining.
|
|
383
|
+
* @example
|
|
384
|
+
* ```typescript
|
|
385
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
386
|
+
* // Delete rows at index 2, and range from index 4 to 6 (rows 3, 5-7)
|
|
387
|
+
* fWorksheet.deleteRowsByPoints([2, [4, 6]]);
|
|
388
|
+
* ```
|
|
389
|
+
*/
|
|
390
|
+
deleteRowsByPoints(rowPoints: Array<number | [number, number]>): FWorksheet;
|
|
379
391
|
/**
|
|
380
392
|
* 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.
|
|
381
393
|
* @param {FRange} rowSpec - A range spanning the rows that should be moved.
|
|
@@ -667,6 +679,18 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
667
679
|
* ```
|
|
668
680
|
*/
|
|
669
681
|
deleteColumns(columnPosition: number, howMany: number): FWorksheet;
|
|
682
|
+
/**
|
|
683
|
+
* Deletes the columns specified by the given column points. Each point can be a single column index or a tuple representing a range of columns.
|
|
684
|
+
* @param {Array<number | [number, number]>} columnPoints - An array of column points to delete. Each point can be a single column index or a tuple representing a range of columns.
|
|
685
|
+
* @returns {FWorksheet} This sheet, for chaining
|
|
686
|
+
* @example
|
|
687
|
+
* ```typescript
|
|
688
|
+
* const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
689
|
+
* // Delete columns at index 2, and range from index 4 to 6 (columns C, E-G)
|
|
690
|
+
* fWorksheet.deleteColumnsByPoints([2, [4, 6]]);
|
|
691
|
+
* ```
|
|
692
|
+
*/
|
|
693
|
+
deleteColumnsByPoints(columnPoints: Array<number | [number, number]>): FWorksheet;
|
|
670
694
|
/**
|
|
671
695
|
* 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.
|
|
672
696
|
* @param {FRange} columnSpec - A range spanning the columns that should be moved
|
package/lib/types/index.d.ts
CHANGED
|
@@ -39,8 +39,8 @@ export { DeleteRangeProtectionCommand, type IDeleteRangeProtectionCommandParams
|
|
|
39
39
|
export { DeleteWorksheetProtectionCommand } from './commands/commands/delete-worksheet-protection.command';
|
|
40
40
|
export { DeleteWorksheetRangeThemeStyleCommand } from './commands/commands/delete-worksheet-range-theme.command';
|
|
41
41
|
export { InsertDefinedNameCommand } from './commands/commands/insert-defined-name.command';
|
|
42
|
-
export {
|
|
43
|
-
export {
|
|
42
|
+
export { type IInsertRangeMoveDownCommandParams, InsertRangeMoveDownCommand } from './commands/commands/insert-range-move-down.command';
|
|
43
|
+
export { type IInsertRangeMoveRightCommandParams, InsertRangeMoveRightCommand } from './commands/commands/insert-range-move-right.command';
|
|
44
44
|
export { type IInsertColCommandParams, type IInsertRowCommandParams, InsertColAfterCommand, InsertColBeforeCommand, InsertColByRangeCommand, InsertColCommand, InsertMultiColsLeftCommand, InsertMultiColsRightCommand, InsertMultiRowsAboveCommand, InsertMultiRowsAfterCommand, InsertRowAfterCommand, InsertRowBeforeCommand, InsertRowByRangeCommand, InsertRowCommand, } from './commands/commands/insert-row-col.command';
|
|
45
45
|
export { type IInsertSheetCommandParams, InsertSheetCommand } from './commands/commands/insert-sheet.command';
|
|
46
46
|
export { getMoveRangeUndoRedoMutations, type IMoveRangeCommandParams, MoveRangeCommand } from './commands/commands/move-range.command';
|
|
@@ -86,6 +86,7 @@ export { SetWorksheetShowCommand } from './commands/commands/set-worksheet-show.
|
|
|
86
86
|
export type { ISetWorksheetShowCommandParams } from './commands/commands/set-worksheet-show.command';
|
|
87
87
|
export { SplitTextToColumnsCommand } from './commands/commands/split-text-to-columns.command';
|
|
88
88
|
export type { ISplitTextToColumnsCommandParams } from './commands/commands/split-text-to-columns.command';
|
|
89
|
+
export { type ITextToNumberCommandParams, TextToNumberCommand } from './commands/commands/text-to-number.command';
|
|
89
90
|
export { type IToggleCellCheckboxCommandParams, ToggleCellCheckboxCommand } from './commands/commands/toggle-checkbox.command';
|
|
90
91
|
export { type IToggleGridlinesCommandParams, ToggleGridlinesCommand } from './commands/commands/toggle-gridlines.command';
|
|
91
92
|
export { UnregisterWorksheetRangeThemeStyleCommand } from './commands/commands/unregister-range-theme.command';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ICommandInfo, IRange } from '@univerjs/core';
|
|
2
2
|
import { IDeleteRangeMoveLeftCommandParams, DeleteRangeMoveLeftCommandId } from '../../commands/commands/delete-range-move-left.command';
|
|
3
3
|
import { IDeleteRangeMoveUpCommandParams, DeleteRangeMoveUpCommandId } from '../../commands/commands/delete-range-move-up.command';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { IInsertRangeMoveDownCommandParams, InsertRangeMoveDownCommandId } from '../../commands/commands/insert-range-move-down.command';
|
|
5
|
+
import { IInsertRangeMoveRightCommandParams, InsertRangeMoveRightCommandId } from '../../commands/commands/insert-range-move-right.command';
|
|
6
6
|
import { IInsertColCommandParams, IInsertRowCommandParams, InsertColCommandId, InsertRowCommandId } from '../../commands/commands/insert-row-col.command';
|
|
7
7
|
import { IMoveRangeCommandParams, MoveRangeCommandId } from '../../commands/commands/move-range.command';
|
|
8
8
|
import { IMoveColsCommandParams, IMoveRowsCommandParams, MoveColsCommandId, MoveRowsCommandId } from '../../commands/commands/move-rows-cols.command';
|
|
@@ -32,10 +32,10 @@ export type IDeleteRangeMoveLeftCommand = ICommandInfo<IDeleteRangeMoveLeftComma
|
|
|
32
32
|
export type IDeleteRangeMoveUpCommand = ICommandInfo<IDeleteRangeMoveUpCommandParams> & {
|
|
33
33
|
id: typeof DeleteRangeMoveUpCommandId;
|
|
34
34
|
};
|
|
35
|
-
export type IInsertRangeMoveDownCommand = ICommandInfo<
|
|
35
|
+
export type IInsertRangeMoveDownCommand = ICommandInfo<IInsertRangeMoveDownCommandParams> & {
|
|
36
36
|
id: typeof InsertRangeMoveDownCommandId;
|
|
37
37
|
};
|
|
38
|
-
export type IInsertRangeMoveRightCommand = ICommandInfo<
|
|
38
|
+
export type IInsertRangeMoveRightCommand = ICommandInfo<IInsertRangeMoveRightCommandParams> & {
|
|
39
39
|
id: typeof InsertRangeMoveRightCommandId;
|
|
40
40
|
};
|
|
41
41
|
export type IReorderRangeCommand = ICommandInfo<IReorderRangeCommandParams> & {
|
|
@@ -78,7 +78,17 @@ export declare const handleDeleteRangeMoveLeft: (param: IDeleteRangeMoveLeftComm
|
|
|
78
78
|
export declare const handleDeleteRangeMoveLeftCommon: (param: IDeleteRangeMoveLeftCommand, targetRange: IRange) => IRange[];
|
|
79
79
|
export declare const handleDeleteRangeMoveUp: (param: IDeleteRangeMoveUpCommand, targetRange: IRange) => IOperator[];
|
|
80
80
|
export declare const handleDeleteRangeMoveUpCommon: (param: IDeleteRangeMoveUpCommand, targetRange: IRange) => IRange[];
|
|
81
|
-
export declare const handleRemoveRowCommon: (param: IRemoveRowColCommandInterceptParams, targetRange: IRange) =>
|
|
81
|
+
export declare const handleRemoveRowCommon: (param: IRemoveRowColCommandInterceptParams, targetRange: IRange) => {
|
|
82
|
+
startRow: number;
|
|
83
|
+
endRow: number;
|
|
84
|
+
rangeType?: RANGE_TYPE;
|
|
85
|
+
startAbsoluteRefType?: import('@univerjs/core').AbsoluteRefType;
|
|
86
|
+
endAbsoluteRefType?: import('@univerjs/core').AbsoluteRefType;
|
|
87
|
+
unitId?: string;
|
|
88
|
+
sheetId?: string;
|
|
89
|
+
startColumn: number;
|
|
90
|
+
endColumn: number;
|
|
91
|
+
}[];
|
|
82
92
|
export declare const handleInsertRowCommon: (info: ICommandInfo<IInsertRowCommandParams>, targetRange: IRange) => IRange[];
|
|
83
93
|
export declare const handleInsertColCommon: (info: ICommandInfo<IInsertColCommandParams>, targetRange: IRange) => IRange[];
|
|
84
94
|
export declare const runRefRangeMutations: (operators: IOperator[], range: IRange) => IRange | null;
|