@univerjs/sheets 1.0.0-alpha.7 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +65 -66
- package/lib/cjs/index.js +285 -337
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +65 -66
- package/lib/es/index.js +286 -339
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +65 -66
- package/lib/index.js +286 -339
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/basics/cell-type.d.ts +2 -1
- package/lib/types/basics/selection.d.ts +0 -9
- package/lib/types/commands/commands/remove-row-col.command.d.ts +2 -0
- package/lib/types/commands/utils/selection-command-util.d.ts +2 -1
- package/lib/types/facade/f-worksheet.d.ts +10 -9
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/models/range-protection-render.model.d.ts +3 -2
- package/lib/types/services/ref-range/ref-range.service.d.ts +2 -0
- package/lib/types/services/selections/selection-data-model.d.ts +0 -6
- package/lib/types/services/selections/selection.service.d.ts +0 -6
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +8 -8
- package/lib/types/facade/f-types.d.ts +0 -16
package/lib/locale/zh-CN.js
CHANGED
|
@@ -17,7 +17,7 @@ const locale = { sheets: {
|
|
|
17
17
|
nameSheetConflict: "名称与工作表名称冲突",
|
|
18
18
|
formulaOrRefStringEmpty: "公式或引用字符串不能为空",
|
|
19
19
|
nameConflict: "名称与函数名称冲突",
|
|
20
|
-
defaultName: "
|
|
20
|
+
defaultName: "定义名称"
|
|
21
21
|
},
|
|
22
22
|
permission: { dialog: {
|
|
23
23
|
autoFillErr: "该范围已被保护,目前无自动填充权限。如需自动填充,请联系创建者。",
|
package/lib/locale/zh-HK.js
CHANGED
|
@@ -17,7 +17,7 @@ const locale = { sheets: {
|
|
|
17
17
|
nameSheetConflict: "名稱與工作表名稱衝突",
|
|
18
18
|
formulaOrRefStringEmpty: "公式或引用字串不能為空",
|
|
19
19
|
nameConflict: "名稱與函數名稱衝突",
|
|
20
|
-
defaultName: "
|
|
20
|
+
defaultName: "定義名稱"
|
|
21
21
|
},
|
|
22
22
|
permission: { dialog: {
|
|
23
23
|
autoFillErr: "範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -17,7 +17,7 @@ const locale = { sheets: {
|
|
|
17
17
|
nameSheetConflict: "名稱與工作表名稱衝突",
|
|
18
18
|
formulaOrRefStringEmpty: "公式或引用字串不能為空",
|
|
19
19
|
nameConflict: "名稱與函數名稱衝突",
|
|
20
|
-
defaultName: "
|
|
20
|
+
defaultName: "定義名稱"
|
|
21
21
|
},
|
|
22
22
|
permission: { dialog: {
|
|
23
23
|
autoFillErr: "範圍已被保護,目前無自動填入權限。如需自動填充,請聯絡建立者。 ",
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { CellValue, ICellData, Nullable, Styles } from '@univerjs/core';
|
|
16
|
+
import type { CellValue, ICellData, IDocumentData, Nullable, Styles } from '@univerjs/core';
|
|
17
17
|
import { CellValueType } from '@univerjs/core';
|
|
18
|
+
export declare function isCellImage(documentData: Nullable<IDocumentData>): boolean;
|
|
18
19
|
/**
|
|
19
20
|
* Get cell value type by style, new value and old value.
|
|
20
21
|
* If the new value contains t, then take t directly. In other cases, we need to dynamically determine based on actual data and styles
|
|
@@ -161,12 +161,3 @@ export declare function convertPrimaryWithCoordToPrimary(primaryWithCoord: ICell
|
|
|
161
161
|
endRow: number;
|
|
162
162
|
endColumn: number;
|
|
163
163
|
};
|
|
164
|
-
/**
|
|
165
|
-
* @deprecated Use worksheet.getCellInfoInMergeData or SpreadsheetSkeleton.getCellByIndex instead
|
|
166
|
-
* Convert the coordinates of a single cell into a selection data.
|
|
167
|
-
* @param row Specified Row Coordinate
|
|
168
|
-
* @param column Specified Column Coordinate
|
|
169
|
-
* @param mergeData Obtain the data of merged cells through the worksheet object.
|
|
170
|
-
* @returns ISelectionWithStyle
|
|
171
|
-
*/
|
|
172
|
-
export declare function transformCellDataToSelectionData(row: number, column: number, mergeData: IRange[]): Nullable<ISelectionWithStyle>;
|
|
@@ -19,6 +19,8 @@ export interface IRemoveRowColCommandParams extends Partial<ISheetCommandSharedP
|
|
|
19
19
|
range: IRange;
|
|
20
20
|
}
|
|
21
21
|
export interface IRemoveRowColCommandInterceptParams extends IRemoveRowColCommandParams {
|
|
22
|
+
unitId: string;
|
|
23
|
+
subUnitId: string;
|
|
22
24
|
ranges?: IRange[];
|
|
23
25
|
}
|
|
24
26
|
export interface IRemoveRowByRangeCommandParams {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { IAccessor } from '@univerjs/core';
|
|
16
|
+
import type { IAccessor, IRange } from '@univerjs/core';
|
|
17
17
|
import { SheetsSelectionsService } from '../../services/selections/selection.service';
|
|
18
|
+
export declare function hasOverlappingRanges(ranges: readonly IRange[]): boolean;
|
|
18
19
|
export declare function getSelectionsService(accessor: IAccessor, fromCurrentSelection?: boolean): SheetsSelectionsService;
|
|
@@ -309,7 +309,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
309
309
|
getMaxRows(): number;
|
|
310
310
|
/**
|
|
311
311
|
* Inserts a row after the given row position.
|
|
312
|
-
* @param {number} afterPosition - The row after which the new row should be added
|
|
312
|
+
* @param {number} afterPosition - The existing row after which the new row should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
313
313
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
314
314
|
* @example
|
|
315
315
|
* ```typescript
|
|
@@ -324,7 +324,7 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
324
324
|
insertRowAfter(afterPosition: number): FWorksheet;
|
|
325
325
|
/**
|
|
326
326
|
* Inserts a row before the given row position.
|
|
327
|
-
* @param {number} beforePosition - The row before which the new row should be added
|
|
327
|
+
* @param {number} beforePosition - The existing row before which the new row should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
328
328
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
329
329
|
* @example
|
|
330
330
|
* ```typescript
|
|
@@ -339,8 +339,8 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
339
339
|
insertRowBefore(beforePosition: number): FWorksheet;
|
|
340
340
|
/**
|
|
341
341
|
* Inserts one or more consecutive blank rows in a sheet starting at the specified location.
|
|
342
|
-
* @param {number} rowIndex - The
|
|
343
|
-
* @param {number} numRows - The number of rows to insert.
|
|
342
|
+
* @param {number} rowIndex - The existing row before which rows are inserted. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
343
|
+
* @param {number} numRows - The positive number of rows to insert.
|
|
344
344
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
345
345
|
* @example
|
|
346
346
|
* ```typescript
|
|
@@ -355,8 +355,8 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
355
355
|
insertRows(rowIndex: number, numRows?: number): FWorksheet;
|
|
356
356
|
/**
|
|
357
357
|
* Inserts a number of rows after the given row position.
|
|
358
|
-
* @param {number} afterPosition - The row after which the new rows should be added
|
|
359
|
-
* @param {number} howMany - The number of rows to insert.
|
|
358
|
+
* @param {number} afterPosition - The existing row after which the new rows should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
359
|
+
* @param {number} howMany - The positive number of rows to insert.
|
|
360
360
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
361
361
|
* @example
|
|
362
362
|
* ```typescript
|
|
@@ -371,8 +371,8 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
371
371
|
insertRowsAfter(afterPosition: number, howMany: number): FWorksheet;
|
|
372
372
|
/**
|
|
373
373
|
* Inserts a number of rows before the given row position.
|
|
374
|
-
* @param {number} beforePosition - The row before which the new rows should be added
|
|
375
|
-
* @param {number} howMany - The number of rows to insert.
|
|
374
|
+
* @param {number} beforePosition - The existing row before which the new rows should be added. The index is zero-based and must be between 0 and `getMaxRows() - 1`.
|
|
375
|
+
* @param {number} howMany - The positive number of rows to insert.
|
|
376
376
|
* @returns {FWorksheet} This sheet, for chaining.
|
|
377
377
|
* @example
|
|
378
378
|
* ```typescript
|
|
@@ -1525,7 +1525,8 @@ export declare class FWorksheet extends FBaseInitialable {
|
|
|
1525
1525
|
*/
|
|
1526
1526
|
getColumnCustomMetadata(index: number): CustomData | undefined;
|
|
1527
1527
|
/**
|
|
1528
|
-
* Appends a row to the bottom of the current data region in the sheet. If
|
|
1528
|
+
* Appends a row to the bottom of the current data region in the sheet. If the destination row is already within the worksheet capacity,
|
|
1529
|
+
* this method writes into that row without increasing `getMaxRows()`. If a cell's content begins with =, it's interpreted as a formula.
|
|
1529
1530
|
* @param {CellValue[]} rowContents - An array of values for the new row.
|
|
1530
1531
|
* @returns {FWorksheet} Returns the current worksheet instance for method chaining.
|
|
1531
1532
|
* @example
|
|
@@ -19,7 +19,6 @@ export * from './f-enum';
|
|
|
19
19
|
export * from './f-event';
|
|
20
20
|
export { FRange } from './f-range';
|
|
21
21
|
export { FSelection } from './f-selection';
|
|
22
|
-
export type { FSheetEmbedUnitFacadeMapAugmentation } from './f-types';
|
|
23
22
|
export type * from './f-univer';
|
|
24
23
|
export { FWorkbook } from './f-workbook';
|
|
25
24
|
export { FWorksheet } from './f-worksheet';
|
package/lib/types/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
export type { ICellOverGridPosition, ISheetOverGridPosition } from './basics/cell-position';
|
|
17
|
-
export { checkCellValueType } from './basics/cell-type';
|
|
17
|
+
export { checkCellValueType, isCellImage } from './basics/cell-type';
|
|
18
18
|
export { COMMAND_LISTENER_SKELETON_CHANGE, COMMAND_LISTENER_VALUE_CHANGE, getSkeletonChangedEffectedRange, getValueChangedEffectedRange, SheetSkeletonChangeType, SheetValueChangeType, } from './basics/const/command-listener-const';
|
|
19
19
|
export type { CommandListenerSkeletonChange, CommandListenerValueChange } from './basics/const/command-listener-const';
|
|
20
20
|
export { validateDefinedName } from './basics/defined-name-utils';
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
*/
|
|
16
16
|
import type { IRange } from '@univerjs/core';
|
|
17
17
|
import type { UnitAction } from '@univerjs/protocol';
|
|
18
|
-
import { IPermissionService } from '@univerjs/core';
|
|
18
|
+
import { Disposable, IPermissionService } from '@univerjs/core';
|
|
19
19
|
import { RangeProtectionRuleModel } from './range-protection-rule.model';
|
|
20
20
|
export type ICellPermission = Record<UnitAction, boolean> & {
|
|
21
21
|
ruleId?: string;
|
|
22
22
|
ranges?: IRange[];
|
|
23
23
|
};
|
|
24
|
-
export declare class RangeProtectionRenderModel {
|
|
24
|
+
export declare class RangeProtectionRenderModel extends Disposable {
|
|
25
25
|
private _selectionProtectionRuleModel;
|
|
26
26
|
private _permissionService;
|
|
27
27
|
private _cache;
|
|
@@ -30,4 +30,5 @@ export declare class RangeProtectionRenderModel {
|
|
|
30
30
|
private _createKey;
|
|
31
31
|
getCellInfo(unitId: string, subUnitId: string, row: number, col: number): ICellPermission[];
|
|
32
32
|
clear(): void;
|
|
33
|
+
dispose(): void;
|
|
33
34
|
}
|
|
@@ -38,6 +38,8 @@ export declare class RefRangeService extends Disposable {
|
|
|
38
38
|
MERGE_UNDO: import("@univerjs/core").IInterceptor<IMutationInfo<object>[], null>;
|
|
39
39
|
}>;
|
|
40
40
|
private _watchRanges;
|
|
41
|
+
private _watchRangesListener;
|
|
42
|
+
private _watchRangeRevision;
|
|
41
43
|
constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _univerInstanceService: IUniverInstanceService, _selectionManagerService: SheetsSelectionsService);
|
|
42
44
|
watchRange(unitId: string, subUnitId: string, range: IRange, callback: WatchRangeCallback, skipIntersects?: boolean): IDisposable;
|
|
43
45
|
private _refRangeManagerMap;
|
|
@@ -52,12 +52,6 @@ export declare class WorkbookSelectionModel extends Disposable {
|
|
|
52
52
|
*/
|
|
53
53
|
setSelections(sheetId: string, selectionDatas: ISelectionWithStyle[] | undefined, type: SelectionMoveType): void;
|
|
54
54
|
getCurrentSelections(): Readonly<ISelectionWithStyle[]>;
|
|
55
|
-
/**
|
|
56
|
-
* @deprecated use `getSelectionsOfWorksheet` instead.
|
|
57
|
-
* @param sheetId
|
|
58
|
-
* @returns
|
|
59
|
-
*/
|
|
60
|
-
getSelectionOfWorksheet(sheetId: string): ISelectionWithStyle[];
|
|
61
55
|
getSelectionsOfWorksheet(sheetId: string): ISelectionWithStyle[];
|
|
62
56
|
getLastSelectionPrimaryCellOfWorksheet(sheetId: string): Nullable<ISelectionCell>;
|
|
63
57
|
setSelectionsOfWorksheet(sheetId: string, selections: ISelectionWithStyle[]): void;
|
|
@@ -78,12 +78,6 @@ export declare class SheetsSelectionsService extends RxDisposable {
|
|
|
78
78
|
setSelections(selectionDatas: ISelectionWithStyle[], type?: SelectionMoveType): void;
|
|
79
79
|
setSelections(unitId: string, worksheetId: string, selectionDatas: ISelectionWithStyle[], type?: SelectionMoveType): void;
|
|
80
80
|
clearCurrentSelections(): void;
|
|
81
|
-
/**
|
|
82
|
-
* Determine whether multiple current selections overlap
|
|
83
|
-
*
|
|
84
|
-
* @deprecated this should be extracted to an pure function
|
|
85
|
-
*/
|
|
86
|
-
isOverlapping(): boolean;
|
|
87
81
|
protected _getCurrentSelections(): ISelectionWithStyle[];
|
|
88
82
|
getWorkbookSelections(unitId: string): WorkbookSelectionModel;
|
|
89
83
|
protected _workbookSelections: Map<string, WorkbookSelectionModel>;
|