@univerjs/sheets 0.25.1 → 1.0.0-alpha.1
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 +199 -264
- package/lib/cjs/index.js +171 -124
- package/lib/es/facade.js +200 -259
- package/lib/es/index.js +374 -321
- package/lib/facade.js +200 -259
- package/lib/index.js +374 -321
- package/lib/types/commands/commands/add-range-protection.command.d.ts +1 -1
- package/lib/types/commands/commands/delete-range-protection.command.d.ts +1 -1
- package/lib/types/commands/commands/register-range-theme.command.d.ts +1 -1
- package/lib/types/commands/commands/set-protection.command.d.ts +1 -1
- package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +1 -1
- package/lib/types/commands/mutations/add-range-theme.mutation.d.ts +1 -1
- package/lib/types/commands/mutations/register-range-theme.mutation.d.ts +1 -1
- package/lib/types/commands/mutations/set-range-protection.mutation.d.ts +1 -1
- package/lib/types/commands/mutations/set-range-theme.mutation.d.ts +1 -1
- package/lib/types/commands/mutations/set-range-values.mutation.d.ts +4 -3
- package/lib/types/controllers/permission/sheet-permission-check.controller.d.ts +1 -1
- package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +1 -1
- package/lib/types/controllers/permission/sheet-permission-view-model.controller.d.ts +1 -1
- package/lib/types/controllers/zebar-crossing.controller.d.ts +1 -1
- package/lib/types/facade/{f-sheet-hooks.d.ts → const.d.ts} +1 -9
- package/lib/types/facade/f-range.d.ts +3 -2
- package/lib/types/facade/f-univer.d.ts +33 -64
- package/lib/types/facade/f-workbook.d.ts +3 -45
- package/lib/types/facade/index.d.ts +0 -1
- package/lib/types/index.d.ts +186 -106
- package/lib/types/locale/types.d.ts +18 -0
- package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +3 -3
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +2 -2
- package/lib/types/services/permission/type.d.ts +1 -1
- package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +1 -1
- package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +1 -1
- package/lib/types/services/range-theme.service.d.ts +3 -3
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
- /package/lib/types/{model → models}/range-protection-render.model.d.ts +0 -0
- /package/lib/types/{model → models}/range-protection-rule.model.d.ts +0 -0
- /package/lib/types/{model → models}/range-protection.cache.d.ts +0 -0
- /package/lib/types/{model → models}/range-theme-model.d.ts +0 -0
- /package/lib/types/{model → models}/range-theme-util.d.ts +0 -0
- /package/lib/types/{model → models}/range-themes/build-in-theme.factory.d.ts +0 -0
- /package/lib/types/{model → models}/range-themes/default.d.ts +0 -0
- /package/lib/types/{model → models}/zebra-crossing-cache.d.ts +0 -0
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand } from '@univerjs/core';
|
|
17
|
-
import type { IRangeProtectionRule } from '../../
|
|
17
|
+
import type { IRangeProtectionRule } from '../../models/range-protection-rule.model';
|
|
18
18
|
export interface IAddRangeProtectionCommandParams {
|
|
19
19
|
permissionId: string;
|
|
20
20
|
rule: IRangeProtectionRule;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand } from '@univerjs/core';
|
|
17
|
-
import type { IRangeProtectionRule } from '../../
|
|
17
|
+
import type { IRangeProtectionRule } from '../../models/range-protection-rule.model';
|
|
18
18
|
export interface IDeleteRangeProtectionCommandParams {
|
|
19
19
|
unitId: string;
|
|
20
20
|
subUnitId: string;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand } from '@univerjs/core';
|
|
17
|
-
import type { RangeThemeStyle } from '../../
|
|
17
|
+
import type { RangeThemeStyle } from '../../models/range-theme-util';
|
|
18
18
|
export interface IRegisterWorksheetRangeThemeStyleCommandParams {
|
|
19
19
|
unitId: string;
|
|
20
20
|
rangeThemeStyle: RangeThemeStyle;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand, IRange } from '@univerjs/core';
|
|
17
|
-
import type { IRangeProtectionRule } from '../../
|
|
17
|
+
import type { IRangeProtectionRule } from '../../models/range-protection-rule.model';
|
|
18
18
|
import type { IWorksheetProtectionRule } from '../../services/permission/type';
|
|
19
19
|
type IPermissionRule = (IRangeProtectionRule | IWorksheetProtectionRule) & {
|
|
20
20
|
ranges: IRange[];
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IMutation, IMutationInfo } from '@univerjs/core';
|
|
17
|
-
import type { IRangeProtectionRule } from '../../
|
|
17
|
+
import type { IRangeProtectionRule } from '../../models/range-protection-rule.model';
|
|
18
18
|
import type { IDeleteRangeProtectionMutationParams } from './delete-range-protection.mutation';
|
|
19
19
|
export interface IAddRangeProtectionMutationParams {
|
|
20
20
|
rules: IRangeProtectionRule[];
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IMutation } from '@univerjs/core';
|
|
17
|
-
import type { IRangeThemeStyleJSON } from '../../
|
|
17
|
+
import type { IRangeThemeStyleJSON } from '../../models/range-theme-util';
|
|
18
18
|
export interface IAddRangeThemeMutationParams {
|
|
19
19
|
styleJSON: IRangeThemeStyleJSON;
|
|
20
20
|
unitId: string;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IMutation } from '@univerjs/core';
|
|
17
|
-
import type { IRangeThemeStyleJSON } from '../../
|
|
17
|
+
import type { IRangeThemeStyleJSON } from '../../models/range-theme-util';
|
|
18
18
|
export interface IRegisterWorksheetRangeThemeStyleMutationParams {
|
|
19
19
|
unitId: string;
|
|
20
20
|
themeName: string;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IAccessor, IMutation, IMutationInfo } from '@univerjs/core';
|
|
17
|
-
import type { IRangeProtectionRule } from '../../
|
|
17
|
+
import type { IRangeProtectionRule } from '../../models/range-protection-rule.model';
|
|
18
18
|
export interface ISetRangeProtectionMutationParams {
|
|
19
19
|
rule: IRangeProtectionRule;
|
|
20
20
|
unitId: string;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IMutation } from '@univerjs/core';
|
|
17
|
-
import type { IRangeThemeStyleJSON } from '../../
|
|
17
|
+
import type { IRangeThemeStyleJSON } from '../../models/range-theme-util';
|
|
18
18
|
export interface ISetRangeThemeMutationParams {
|
|
19
19
|
unitId: string;
|
|
20
20
|
subUnitId: string;
|
|
@@ -13,7 +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, ICellData,
|
|
16
|
+
import type { IAccessor, ICellData, IMutation, IMutationCommonParams, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
17
17
|
/** Params of `SetRangeValuesMutation` */
|
|
18
18
|
export interface ISetRangeValuesMutationParams extends IMutationCommonParams {
|
|
19
19
|
subUnitId: string;
|
|
@@ -23,9 +23,10 @@ export interface ISetRangeValuesMutationParams extends IMutationCommonParams {
|
|
|
23
23
|
*/
|
|
24
24
|
cellValue?: IObjectMatrixPrimitiveType<Nullable<ICellData>>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Whether to override the style of the cell, used for paste related operations.
|
|
27
|
+
* @default false
|
|
27
28
|
*/
|
|
28
|
-
|
|
29
|
+
isOverrideStyle?: boolean;
|
|
29
30
|
}
|
|
30
31
|
export interface ISetRangeValuesRangeMutationParams extends ISetRangeValuesMutationParams {
|
|
31
32
|
range: IRange[];
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
import type { IPermissionTypes, IRange } from '@univerjs/core';
|
|
17
17
|
import { Disposable, DisposableCollection, ICommandService, IPermissionService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
18
18
|
import { IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
19
|
-
import { RangeProtectionRuleModel } from '../../
|
|
19
|
+
import { RangeProtectionRuleModel } from '../../models/range-protection-rule.model';
|
|
20
20
|
import { WorksheetProtectionRuleModel } from '../../services/permission/worksheet-permission';
|
|
21
21
|
import { SheetsSelectionsService } from '../../services/selections';
|
|
22
22
|
export declare class SheetPermissionCheckController extends Disposable {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Disposable, IAuthzIoService, ICommandService, IPermissionService, IUndoRedoService, IUniverInstanceService, UserManagerService } from '@univerjs/core';
|
|
17
|
-
import { RangeProtectionRuleModel } from '../../
|
|
17
|
+
import { RangeProtectionRuleModel } from '../../models/range-protection-rule.model';
|
|
18
18
|
import { WorkbookPermissionService } from '../../services/permission/workbook-permission/workbook-permission.service';
|
|
19
19
|
import { WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from '../../services/permission/worksheet-permission';
|
|
20
20
|
export declare class SheetPermissionInitController extends Disposable {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Disposable, IPermissionService } from '@univerjs/core';
|
|
17
|
-
import { RangeProtectionCache } from '../../
|
|
17
|
+
import { RangeProtectionCache } from '../../models/range-protection.cache';
|
|
18
18
|
import { WorksheetProtectionRuleModel } from '../../services/permission/worksheet-permission';
|
|
19
19
|
import { SheetInterceptorService } from '../../services/sheet-interceptor/sheet-interceptor.service';
|
|
20
20
|
export declare class SheetPermissionViewModelController extends Disposable {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/core';
|
|
17
|
-
import { SheetRangeThemeModel } from '../
|
|
17
|
+
import { SheetRangeThemeModel } from '../models/range-theme-model';
|
|
18
18
|
export declare class ZebraCrossingCacheController extends Disposable {
|
|
19
19
|
private readonly _commandService;
|
|
20
20
|
private readonly _sheetRangeThemeModel;
|
|
@@ -13,12 +13,4 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
import { FBase } from '@univerjs/core/facade';
|
|
18
|
-
/**
|
|
19
|
-
* @hideconstructor
|
|
20
|
-
*/
|
|
21
|
-
export declare class FSheetHooks extends FBase {
|
|
22
|
-
protected readonly _injector: Injector;
|
|
23
|
-
constructor(_injector: Injector);
|
|
24
|
-
}
|
|
16
|
+
export declare const SHEETS_CUSTOM_FIELD_WARNING_MESSAGE = "[Facade]: The sheets custom field is not recommended for external use. Use it at your own risk.";
|
|
@@ -17,7 +17,7 @@ import type { AbsoluteRefType, BorderStyleTypes, BorderType, CellValue, CustomDa
|
|
|
17
17
|
import type { AUTO_FILL_APPLY_TYPE, IMergeCellsUtilOptions, SplitDelimiterEnum } from '@univerjs/sheets';
|
|
18
18
|
import type { IFacadeClearOptions } from './f-worksheet';
|
|
19
19
|
import type { FHorizontalAlignment, FVerticalAlignment } from './utils';
|
|
20
|
-
import { Dimension, ICommandService, Injector, RichTextValue, TextStyleValue, WrapStrategy } from '@univerjs/core';
|
|
20
|
+
import { Dimension, ICommandService, ILogService, Injector, RichTextValue, TextStyleValue, WrapStrategy } from '@univerjs/core';
|
|
21
21
|
import { FBaseInitialable } from '@univerjs/core/facade';
|
|
22
22
|
import { FormulaDataModel } from '@univerjs/engine-formula';
|
|
23
23
|
import { FRangePermission } from './permission/f-range-permission';
|
|
@@ -45,7 +45,8 @@ export declare class FRange extends FBaseInitialable {
|
|
|
45
45
|
protected readonly _injector: Injector;
|
|
46
46
|
protected readonly _commandService: ICommandService;
|
|
47
47
|
protected readonly _formulaDataModel: FormulaDataModel;
|
|
48
|
-
|
|
48
|
+
protected readonly _logService: ILogService;
|
|
49
|
+
constructor(_workbook: Workbook, _worksheet: Worksheet, _range: IRange, _injector: Injector, _commandService: ICommandService, _formulaDataModel: FormulaDataModel, _logService: ILogService);
|
|
49
50
|
/**
|
|
50
51
|
* Get the unit ID of the current workbook
|
|
51
52
|
* @returns {string} The unit ID of the workbook
|
|
@@ -13,7 +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 {
|
|
16
|
+
import type { ICreateUnitOptions, Injector, IWorkbookData } from '@univerjs/core';
|
|
17
17
|
import type { FWorksheet } from './f-worksheet';
|
|
18
18
|
import { FUniver } from '@univerjs/core/facade';
|
|
19
19
|
import { FWorkbook } from './f-workbook';
|
|
@@ -21,31 +21,27 @@ import { FWorkbook } from './f-workbook';
|
|
|
21
21
|
* @ignore
|
|
22
22
|
*/
|
|
23
23
|
export interface IFUniverSheetsMixin {
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated use `univerAPI.createWorkbook` instead.
|
|
26
|
-
*/
|
|
27
|
-
createUniverSheet(data: Partial<IWorkbookData>): FWorkbook;
|
|
28
24
|
/**
|
|
29
25
|
* Create a new spreadsheet and get the API handler of that spreadsheet.
|
|
30
26
|
* @param {Partial<IWorkbookData>} data The snapshot of the spreadsheet.
|
|
31
27
|
* @param {ICreateUnitOptions} options The options of creating the spreadsheet.
|
|
32
|
-
* @returns {FWorkbook}
|
|
28
|
+
* @returns {FWorkbook} The spreadsheet API instance.
|
|
33
29
|
* @example
|
|
34
30
|
* ```ts
|
|
35
|
-
* const fWorkbook = univerAPI.createWorkbook({ id: '
|
|
31
|
+
* const fWorkbook = univerAPI.createWorkbook({ id: 'workbook-01', name: 'Workbook1' });
|
|
36
32
|
* console.log(fWorkbook);
|
|
37
33
|
* ```
|
|
38
34
|
*
|
|
39
35
|
* Add you can make the workbook not as the active workbook by setting options:
|
|
40
36
|
* ```ts
|
|
41
|
-
* const fWorkbook = univerAPI.createWorkbook({ id: '
|
|
37
|
+
* const fWorkbook = univerAPI.createWorkbook({ id: 'workbook-01', name: 'Workbook1' }, { makeCurrent: false });
|
|
42
38
|
* console.log(fWorkbook);
|
|
43
39
|
* ```
|
|
44
40
|
*/
|
|
45
41
|
createWorkbook(data: Partial<IWorkbookData>, options?: ICreateUnitOptions): FWorkbook;
|
|
46
42
|
/**
|
|
47
43
|
* Get the currently focused Univer spreadsheet.
|
|
48
|
-
* @returns {FWorkbook | null} The currently focused Univer spreadsheet.
|
|
44
|
+
* @returns {FWorkbook | null} The currently focused Univer spreadsheet API instance, or null if there is no active spreadsheet.
|
|
49
45
|
* @example
|
|
50
46
|
* ```ts
|
|
51
47
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -53,49 +49,18 @@ export interface IFUniverSheetsMixin {
|
|
|
53
49
|
* ```
|
|
54
50
|
*/
|
|
55
51
|
getActiveWorkbook(): FWorkbook | null;
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated use `univerAPI.getActiveWorkbook` instead
|
|
58
|
-
*/
|
|
59
|
-
getActiveUniverSheet(): FWorkbook | null;
|
|
60
52
|
/**
|
|
61
53
|
* Get the spreadsheet API handler by the spreadsheet id.
|
|
62
54
|
* @param {string} id The spreadsheet id.
|
|
63
|
-
* @returns {FWorkbook | null} The spreadsheet API instance.
|
|
55
|
+
* @returns {FWorkbook | null} The spreadsheet API instance corresponding to the spreadsheet id, or null if not found.
|
|
64
56
|
*
|
|
65
57
|
* @example
|
|
66
58
|
* ```ts
|
|
67
|
-
* const fWorkbook = univerAPI.
|
|
68
|
-
* console.log(fWorkbook);
|
|
69
|
-
*
|
|
70
|
-
* const fWorkbook = univerAPI.getWorkbook('Sheet1');
|
|
59
|
+
* const fWorkbook = univerAPI.getWorkbook('workbook-01');
|
|
71
60
|
* console.log(fWorkbook);
|
|
72
61
|
* ```
|
|
73
62
|
*/
|
|
74
|
-
getUniverSheet(id: string): FWorkbook | null;
|
|
75
63
|
getWorkbook(id: string): FWorkbook | null;
|
|
76
|
-
/**
|
|
77
|
-
* @deprecated Use `univerAPI.addEvent(univerAPI.Event.UnitCreated, () => {})`
|
|
78
|
-
*/
|
|
79
|
-
onUniverSheetCreated(callback: (workbook: FWorkbook) => void): IDisposable;
|
|
80
|
-
/**
|
|
81
|
-
* Get the target of the sheet.
|
|
82
|
-
* @param {string} unitId - The unitId of the sheet.
|
|
83
|
-
* @param {string} subUnitId - The subUnitId of the sheet.
|
|
84
|
-
* @returns {Nullable<{ workbook: FWorkbook; worksheet: FWorksheet }>} - The target of the sheet.
|
|
85
|
-
* @example
|
|
86
|
-
* ```ts
|
|
87
|
-
* const unitId = 'workbook-01';
|
|
88
|
-
* const subUnitId = 'sheet-0001';
|
|
89
|
-
* const target = univerAPI.getSheetTarget(unitId, subUnitId);
|
|
90
|
-
* if (!target) return;
|
|
91
|
-
* const { workbook, worksheet } = target;
|
|
92
|
-
* console.log(workbook, worksheet);
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
getSheetTarget(unitId: string, subUnitId: string): Nullable<{
|
|
96
|
-
workbook: FWorkbook;
|
|
97
|
-
worksheet: FWorksheet;
|
|
98
|
-
}>;
|
|
99
64
|
/**
|
|
100
65
|
* Get the target of the sheet.
|
|
101
66
|
* @param {ICommandInfo<object>} commandInfo - The commandInfo of the command.
|
|
@@ -104,17 +69,23 @@ export interface IFUniverSheetsMixin {
|
|
|
104
69
|
* ```ts
|
|
105
70
|
* univerAPI.addEvent(univerAPI.Event.CommandExecuted, (event) => {
|
|
106
71
|
* const { options, ...commandInfo } = event;
|
|
107
|
-
* const target = univerAPI.
|
|
72
|
+
* const target = univerAPI.getSheetCommandTarget(commandInfo.params);
|
|
108
73
|
* if (!target) return;
|
|
109
74
|
* const { workbook, worksheet } = target;
|
|
110
75
|
* console.log(workbook, worksheet);
|
|
111
76
|
* });
|
|
112
77
|
* ```
|
|
113
78
|
*/
|
|
114
|
-
|
|
79
|
+
getSheetCommandTarget(params?: {
|
|
80
|
+
unitId?: string;
|
|
81
|
+
subUnitId?: string;
|
|
82
|
+
sheetId?: string;
|
|
83
|
+
}): {
|
|
115
84
|
workbook: FWorkbook;
|
|
116
85
|
worksheet: FWorksheet;
|
|
117
|
-
|
|
86
|
+
unitId: string;
|
|
87
|
+
subUnitId: string;
|
|
88
|
+
} | null;
|
|
118
89
|
/**
|
|
119
90
|
* Get the active sheet.
|
|
120
91
|
* @returns {Nullable<{ workbook: FWorkbook; worksheet: FWorksheet }>} The active sheet.
|
|
@@ -126,10 +97,10 @@ export interface IFUniverSheetsMixin {
|
|
|
126
97
|
* console.log(workbook, worksheet);
|
|
127
98
|
* ```
|
|
128
99
|
*/
|
|
129
|
-
getActiveSheet():
|
|
100
|
+
getActiveSheet(): {
|
|
130
101
|
workbook: FWorkbook;
|
|
131
102
|
worksheet: FWorksheet;
|
|
132
|
-
}
|
|
103
|
+
} | null;
|
|
133
104
|
/**
|
|
134
105
|
* Set whether to enable synchronize the frozen state to other users in real-time collaboration.
|
|
135
106
|
* @param {boolean} enabled - Whether to enable freeze sync. Default is true.
|
|
@@ -142,31 +113,29 @@ export interface IFUniverSheetsMixin {
|
|
|
142
113
|
setFreezeSync(enabled: boolean): void;
|
|
143
114
|
}
|
|
144
115
|
export declare class FUniverSheetsMixin extends FUniver implements IFUniverSheetsMixin {
|
|
145
|
-
|
|
116
|
+
createWorkbook(data: Partial<IWorkbookData>, options?: ICreateUnitOptions): FWorkbook;
|
|
117
|
+
getActiveWorkbook(): FWorkbook | null;
|
|
118
|
+
getWorkbook(id: string): FWorkbook | null;
|
|
119
|
+
getSheetCommandTarget(params?: {
|
|
120
|
+
unitId?: string;
|
|
121
|
+
subUnitId?: string;
|
|
122
|
+
sheetId?: string;
|
|
123
|
+
}): {
|
|
146
124
|
workbook: FWorkbook;
|
|
147
125
|
worksheet: FWorksheet;
|
|
148
|
-
|
|
149
|
-
|
|
126
|
+
unitId: string;
|
|
127
|
+
subUnitId: string;
|
|
128
|
+
} | null;
|
|
129
|
+
getActiveSheet(): {
|
|
150
130
|
workbook: FWorkbook;
|
|
151
131
|
worksheet: FWorksheet;
|
|
152
|
-
}
|
|
153
|
-
|
|
132
|
+
} | null;
|
|
133
|
+
setFreezeSync(enabled: boolean): void;
|
|
154
134
|
/**
|
|
155
135
|
* @ignore
|
|
156
136
|
*/
|
|
157
137
|
_initialize(injector: Injector): void;
|
|
158
|
-
|
|
159
|
-
createWorkbook(data: Partial<IWorkbookData>, options?: ICreateUnitOptions): FWorkbook;
|
|
160
|
-
getActiveWorkbook(): FWorkbook | null;
|
|
161
|
-
getActiveUniverSheet(): FWorkbook | null;
|
|
162
|
-
getUniverSheet(id: string): FWorkbook | null;
|
|
163
|
-
getWorkbook(id: string): FWorkbook | null;
|
|
164
|
-
onUniverSheetCreated(callback: (workbook: FWorkbook) => void): IDisposable;
|
|
165
|
-
getActiveSheet(): Nullable<{
|
|
166
|
-
workbook: FWorkbook;
|
|
167
|
-
worksheet: FWorksheet;
|
|
168
|
-
}>;
|
|
169
|
-
setFreezeSync(enabled: boolean): void;
|
|
138
|
+
private _initWorkbookEvent;
|
|
170
139
|
}
|
|
171
140
|
declare module '@univerjs/core/facade' {
|
|
172
141
|
interface FUniver extends IFUniverSheetsMixin {
|
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { CommandListener, CustomData, IDisposable, IRange, IStyleData, IWorkbookData, IWorksheetData,
|
|
16
|
+
import type { CommandListener, CustomData, IDisposable, IRange, IStyleData, IWorkbookData, IWorksheetData, Workbook } from '@univerjs/core';
|
|
17
17
|
import type { ISetDefinedNameMutationParam } from '@univerjs/engine-formula';
|
|
18
18
|
import type { IRangeThemeStyleJSON } from '@univerjs/sheets';
|
|
19
19
|
import type { FontLine as _FontLine } from './f-range';
|
|
20
|
-
import { ICommandService, ILogService, Injector, IPermissionService, IResourceLoaderService, IUniverInstanceService
|
|
20
|
+
import { ICommandService, ILogService, Injector, IPermissionService, IResourceLoaderService, IUniverInstanceService } from '@univerjs/core';
|
|
21
21
|
import { FBaseInitialable } from '@univerjs/core/facade';
|
|
22
22
|
import { IDefinedNamesService } from '@univerjs/engine-formula';
|
|
23
23
|
import { RangeThemeStyle, SheetsSelectionsService } from '@univerjs/sheets';
|
|
@@ -38,10 +38,9 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
38
38
|
protected readonly _commandService: ICommandService;
|
|
39
39
|
protected readonly _permissionService: IPermissionService;
|
|
40
40
|
protected readonly _logService: ILogService;
|
|
41
|
-
protected readonly _localeService: LocaleService;
|
|
42
41
|
protected readonly _definedNamesService: IDefinedNamesService;
|
|
43
42
|
readonly id: string;
|
|
44
|
-
constructor(_workbook: Workbook, _injector: Injector, _resourceLoaderService: IResourceLoaderService, _selectionManagerService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _permissionService: IPermissionService, _logService: ILogService,
|
|
43
|
+
constructor(_workbook: Workbook, _injector: Injector, _resourceLoaderService: IResourceLoaderService, _selectionManagerService: SheetsSelectionsService, _univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _permissionService: IPermissionService, _logService: ILogService, _definedNamesService: IDefinedNamesService);
|
|
45
44
|
/**
|
|
46
45
|
* Get the Workbook instance.
|
|
47
46
|
* @returns {Workbook} The Workbook instance.
|
|
@@ -102,18 +101,6 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
102
101
|
* ```
|
|
103
102
|
*/
|
|
104
103
|
save(): IWorkbookData;
|
|
105
|
-
/**
|
|
106
|
-
* @deprecated use 'save' instead.
|
|
107
|
-
* @returns {IWorkbookData} Workbook snapshot data
|
|
108
|
-
* @memberof FWorkbook
|
|
109
|
-
* @example
|
|
110
|
-
* ```ts
|
|
111
|
-
* // The code below saves the workbook snapshot data
|
|
112
|
-
* const activeSpreadsheet = univerAPI.getActiveWorkbook();
|
|
113
|
-
* const snapshot = activeSpreadsheet.getSnapshot();
|
|
114
|
-
* ```
|
|
115
|
-
*/
|
|
116
|
-
getSnapshot(): IWorkbookData;
|
|
117
104
|
/**
|
|
118
105
|
* Get the active sheet of the workbook.
|
|
119
106
|
* @returns {FWorksheet} The active sheet of the workbook
|
|
@@ -450,35 +437,6 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
450
437
|
* ```
|
|
451
438
|
*/
|
|
452
439
|
getNumSheets(): number;
|
|
453
|
-
/**
|
|
454
|
-
* Get the locale of the workbook.
|
|
455
|
-
* @returns {LocaleType} The locale of the workbook
|
|
456
|
-
* @example
|
|
457
|
-
* ```ts
|
|
458
|
-
* // The code below gets the locale of the workbook
|
|
459
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
460
|
-
* console.log(fWorkbook.getLocale());
|
|
461
|
-
* ```
|
|
462
|
-
*/
|
|
463
|
-
getLocale(): LocaleType;
|
|
464
|
-
/**
|
|
465
|
-
* @deprecated use `setSpreadsheetLocale` instead.
|
|
466
|
-
* @param {LocaleType} locale - The locale to set
|
|
467
|
-
*/
|
|
468
|
-
setLocale(locale: LocaleType): void;
|
|
469
|
-
/**
|
|
470
|
-
* Set the locale of the workbook.
|
|
471
|
-
* @param {LocaleType} locale The locale to set
|
|
472
|
-
* @returns {FWorkbook} This workbook, for chaining
|
|
473
|
-
* @example
|
|
474
|
-
* ```ts
|
|
475
|
-
* // The code below sets the locale of the workbook
|
|
476
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
477
|
-
* fWorkbook.setSpreadsheetLocale(univerAPI.Enum.LocaleType.EN_US);
|
|
478
|
-
* console.log(fWorkbook.getLocale());
|
|
479
|
-
* ```
|
|
480
|
-
*/
|
|
481
|
-
setSpreadsheetLocale(locale: LocaleType): FWorkbook;
|
|
482
440
|
/**
|
|
483
441
|
* Get the URL of the workbook.
|
|
484
442
|
* @returns {string} The URL of the workbook
|
|
@@ -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 { FSheetHooks } from './f-sheet-hooks';
|
|
23
22
|
export { FWorkbook } from './f-workbook';
|
|
24
23
|
export { FWorksheet } from './f-worksheet';
|
|
25
24
|
export { FWorkbookPermission } from './permission/f-workbook-permission';
|