@univerjs/sheets 0.20.1 → 0.21.0-insiders.20260422-d7fcb4d
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 +8373 -1
- package/lib/cjs/index.js +21516 -2
- package/lib/cjs/locale/ca-ES.js +17 -1
- package/lib/cjs/locale/en-US.js +32 -1
- package/lib/cjs/locale/es-ES.js +17 -1
- package/lib/cjs/locale/fa-IR.js +17 -1
- package/lib/cjs/locale/fr-FR.js +17 -1
- package/lib/cjs/locale/ja-JP.js +17 -1
- package/lib/cjs/locale/ko-KR.js +17 -1
- package/lib/cjs/locale/ru-RU.js +17 -1
- package/lib/cjs/locale/sk-SK.js +17 -1
- package/lib/cjs/locale/vi-VN.js +17 -1
- package/lib/cjs/locale/zh-CN.js +17 -1
- package/lib/cjs/locale/zh-TW.js +17 -1
- package/lib/es/facade.js +8335 -1
- package/lib/es/index.js +20994 -2
- package/lib/es/locale/ca-ES.js +16 -1
- package/lib/es/locale/en-US.js +31 -1
- package/lib/es/locale/es-ES.js +16 -1
- package/lib/es/locale/fa-IR.js +16 -1
- package/lib/es/locale/fr-FR.js +16 -1
- package/lib/es/locale/ja-JP.js +16 -1
- package/lib/es/locale/ko-KR.js +16 -1
- package/lib/es/locale/ru-RU.js +16 -1
- package/lib/es/locale/sk-SK.js +16 -1
- package/lib/es/locale/vi-VN.js +16 -1
- package/lib/es/locale/zh-CN.js +16 -1
- package/lib/es/locale/zh-TW.js +16 -1
- package/lib/facade.js +8335 -1
- package/lib/index.js +20994 -2
- package/lib/locale/ca-ES.js +16 -1
- package/lib/locale/en-US.js +31 -1
- package/lib/locale/es-ES.js +16 -1
- package/lib/locale/fa-IR.js +16 -1
- package/lib/locale/fr-FR.js +16 -1
- package/lib/locale/ja-JP.js +16 -1
- package/lib/locale/ko-KR.js +16 -1
- package/lib/locale/ru-RU.js +16 -1
- package/lib/locale/sk-SK.js +16 -1
- package/lib/locale/vi-VN.js +16 -1
- package/lib/locale/zh-CN.js +16 -1
- package/lib/locale/zh-TW.js +16 -1
- package/lib/types/basics/defined-name-utils.d.ts +28 -0
- package/lib/types/commands/commands/remove-row-col.command.d.ts +2 -1
- package/lib/types/controllers/permission/sheet-permission-check.controller.d.ts +11 -12
- package/lib/types/facade/f-defined-name.d.ts +30 -30
- package/lib/types/facade/f-univer.d.ts +0 -24
- package/lib/types/facade/f-workbook.d.ts +38 -39
- package/lib/types/facade/index.d.ts +2 -2
- package/lib/types/facade/permission/f-range-permission.d.ts +31 -228
- package/lib/types/facade/permission/f-range-protection-rule.d.ts +157 -46
- package/lib/types/facade/permission/f-workbook-permission.d.ts +51 -129
- package/lib/types/facade/permission/f-worksheet-permission.d.ts +111 -199
- package/lib/types/facade/permission/permission-types.d.ts +20 -125
- package/lib/types/facade/permission/util.d.ts +40 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/permission/range-permission/util.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/package.json +9 -9
- package/LICENSE +0 -176
- package/lib/types/facade/f-permission.d.ts +0 -426
package/lib/locale/ca-ES.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/ca-ES.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(Còpia{0})",
|
|
5
|
+
sheet: "Full"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "No es pot utilitzar aquesta ordre en seleccions superposades",
|
|
9
|
+
acrossMergedCell: "A través d'una cel·la combinada",
|
|
10
|
+
partOfCell: "Només una part d'una cel·la combinada està seleccionada",
|
|
11
|
+
hideSheet: "No hi ha fulls visibles després d'ocultar aquest"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/en-US.js
CHANGED
|
@@ -1 +1,31 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/en-US.ts
|
|
2
|
+
/**
|
|
3
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
const locale = { sheets: {
|
|
18
|
+
tabs: {
|
|
19
|
+
sheetCopy: "(Copy{0})",
|
|
20
|
+
sheet: "Sheet"
|
|
21
|
+
},
|
|
22
|
+
info: {
|
|
23
|
+
overlappingSelections: "Cannot use that command on overlapping selections",
|
|
24
|
+
acrossMergedCell: "Across a merged cell",
|
|
25
|
+
partOfCell: "Only part of a merged cell is selected",
|
|
26
|
+
hideSheet: "No visible sheet after you hide this"
|
|
27
|
+
}
|
|
28
|
+
} };
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { locale as default };
|
package/lib/locale/es-ES.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/es-ES.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(Copia{0})",
|
|
5
|
+
sheet: "Hoja"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "No se puede usar ese comando en selecciones superpuestas",
|
|
9
|
+
acrossMergedCell: "A través de una celda combinada",
|
|
10
|
+
partOfCell: "Solo una parte de una celda combinada está seleccionada",
|
|
11
|
+
hideSheet: "No hay hojas visibles después de ocultar esta"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/fa-IR.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/fa-IR.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(کپی{0})",
|
|
5
|
+
sheet: "برگ"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "نمیتوان از این دستور روی انتخابهای همپوشانی استفاده کرد",
|
|
9
|
+
acrossMergedCell: "در سراسر سلول ادغام شده",
|
|
10
|
+
partOfCell: "فقط بخشی از سلول ادغام شده انتخاب شده است",
|
|
11
|
+
hideSheet: "پس از پنهان کردن این برگ، هیچ برگی قابل مشاهده نخواهد بود"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/fr-FR.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/fr-FR.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(Copie{0})",
|
|
5
|
+
sheet: "Feuille"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "Impossible d'utiliser cette commande sur des sélections qui se chevauchent",
|
|
9
|
+
acrossMergedCell: "À travers une cellule fusionnée",
|
|
10
|
+
partOfCell: "Seule une partie d'une cellule fusionnée est sélectionnée",
|
|
11
|
+
hideSheet: "Aucune feuille visible après avoir masqué celle-ci"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/ja-JP.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/ja-JP.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(コピー{0})",
|
|
5
|
+
sheet: "シート"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "そのコマンドは、重なり合う選択範囲に対しては使用できません。",
|
|
9
|
+
acrossMergedCell: "結合セルをまたいでいます",
|
|
10
|
+
partOfCell: "結合セルの一部が選択されています",
|
|
11
|
+
hideSheet: "表示されるシートがなくなるため、このシートを非表示にできません。"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/ko-KR.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/ko-KR.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(복사본{0})",
|
|
5
|
+
sheet: "시트"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "겹치는 영역에서는 해당 명령을 사용할 수 없습니다.",
|
|
9
|
+
acrossMergedCell: "병합된 셀을 가로지름",
|
|
10
|
+
partOfCell: "병합된 셀의 일부만 선택됨",
|
|
11
|
+
hideSheet: "이 시트를 숨기면 표시되는 시트가 없습니다."
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/ru-RU.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/ru-RU.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(Копия{0})",
|
|
5
|
+
sheet: "Лист"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "Невозможно использовать эту команду на пересекающихся выделениях",
|
|
9
|
+
acrossMergedCell: "Через объединенную ячейку",
|
|
10
|
+
partOfCell: "Выделена только часть объединенной ячейки",
|
|
11
|
+
hideSheet: "После скрытия этого листа не будет видно ни одного листа"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/sk-SK.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/sk-SK.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(Kópia{0})",
|
|
5
|
+
sheet: "Hárok"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "Na prekrývajúcich sa výberoch nie je možné použiť tento príkaz",
|
|
9
|
+
acrossMergedCell: "Cez zlúčenú bunku",
|
|
10
|
+
partOfCell: "Je vybraná iba časť zlúčenej bunky",
|
|
11
|
+
hideSheet: "Po skrytí tohto hárka nebude viditeľný žiadny hárok"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/vi-VN.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/vi-VN.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(Bản sao {0})",
|
|
5
|
+
sheet: "Bảng tính"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "Không thể sử dụng lệnh này trên các vùng chọn chồng chéo nhau",
|
|
9
|
+
acrossMergedCell: "Không thể vượt qua các ô đã hợp nhất",
|
|
10
|
+
partOfCell: "Chỉ chọn một phần của ô đã hợp nhất",
|
|
11
|
+
hideSheet: "Không có bảng tính nào hiển thị sau khi ẩn"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/zh-CN.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/zh-CN.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(副本{0})",
|
|
5
|
+
sheet: "工作表"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "无法对重叠选区使用该命令",
|
|
9
|
+
acrossMergedCell: "无法跨越合并单元格",
|
|
10
|
+
partOfCell: "仅选择了合并单元格的一部分",
|
|
11
|
+
hideSheet: "隐藏后无可见工作表"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
package/lib/locale/zh-TW.js
CHANGED
|
@@ -1 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/locale/zh-TW.ts
|
|
2
|
+
const locale = { sheets: {
|
|
3
|
+
tabs: {
|
|
4
|
+
sheetCopy: "(副本{0})",
|
|
5
|
+
sheet: "工作表"
|
|
6
|
+
},
|
|
7
|
+
info: {
|
|
8
|
+
overlappingSelections: "無法對重疊選區使用該命令",
|
|
9
|
+
acrossMergedCell: "無法跨越合併儲存格",
|
|
10
|
+
partOfCell: "僅選擇了合併儲存格的一部份",
|
|
11
|
+
hideSheet: "隱藏後無可見工作表"
|
|
12
|
+
}
|
|
13
|
+
} };
|
|
14
|
+
|
|
15
|
+
//#endregion
|
|
16
|
+
export { locale as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { IUniverInstanceService } from '@univerjs/core';
|
|
17
|
+
import type { IDefinedNamesService, IFunctionService, ISuperTableService } from '@univerjs/engine-formula';
|
|
18
|
+
interface IValidateDefinedNameOptions {
|
|
19
|
+
unitId: string;
|
|
20
|
+
formulaOrRefString: string;
|
|
21
|
+
univerInstanceService: IUniverInstanceService;
|
|
22
|
+
definedNamesService: IDefinedNamesService;
|
|
23
|
+
superTableService: ISuperTableService;
|
|
24
|
+
functionService: IFunctionService;
|
|
25
|
+
id?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function validateDefinedName(name: string, options: IValidateDefinedNameOptions): true | string;
|
|
28
|
+
export {};
|
|
@@ -14,7 +14,8 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { ICommand, IRange } from '@univerjs/core';
|
|
17
|
-
|
|
17
|
+
import type { ISheetCommandSharedParams } from '../utils/interface';
|
|
18
|
+
export interface IRemoveRowColCommandParams extends Partial<ISheetCommandSharedParams> {
|
|
18
19
|
range: IRange;
|
|
19
20
|
}
|
|
20
21
|
export interface IRemoveRowColCommandInterceptParams extends IRemoveRowColCommandParams {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import type { IPermissionTypes, IRange } from '@univerjs/core';
|
|
17
|
-
import { Disposable, DisposableCollection, ICommandService,
|
|
17
|
+
import { Disposable, DisposableCollection, ICommandService, IPermissionService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
18
18
|
import { IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
19
19
|
import { RangeProtectionRuleModel } from '../../model/range-protection-rule.model';
|
|
20
20
|
import { WorksheetProtectionRuleModel } from '../../services/permission/worksheet-permission';
|
|
@@ -28,23 +28,22 @@ export declare class SheetPermissionCheckController extends Disposable {
|
|
|
28
28
|
private _worksheetProtectionRuleModel;
|
|
29
29
|
private readonly _localeService;
|
|
30
30
|
private readonly _lexerTreeBuilder;
|
|
31
|
-
private readonly _contextService;
|
|
32
31
|
private readonly _definedNamesService;
|
|
33
32
|
disposableCollection: DisposableCollection;
|
|
34
33
|
private _triggerPermissionUIEvent$;
|
|
35
34
|
triggerPermissionUIEvent$: import("rxjs").Observable<string>;
|
|
36
|
-
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _selectionManagerService: SheetsSelectionsService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _localeService: LocaleService, _lexerTreeBuilder: LexerTreeBuilder,
|
|
37
|
-
blockExecuteWithoutPermission(errorMsg: string): void;
|
|
38
|
-
private _getPermissionCheck;
|
|
35
|
+
constructor(_commandService: ICommandService, _univerInstanceService: IUniverInstanceService, _permissionService: IPermissionService, _selectionManagerService: SheetsSelectionsService, _rangeProtectionRuleModel: RangeProtectionRuleModel, _worksheetProtectionRuleModel: WorksheetProtectionRuleModel, _localeService: LocaleService, _lexerTreeBuilder: LexerTreeBuilder, _definedNamesService: IDefinedNamesService);
|
|
39
36
|
private _initialize;
|
|
40
37
|
private _commandExecutedListener;
|
|
41
|
-
|
|
42
|
-
private
|
|
43
|
-
permissionCheckWithoutRange(permissionTypes: IPermissionTypes, unitId?: string, subUnitId?: string): boolean;
|
|
38
|
+
blockExecuteWithoutPermission(errorMsg: string): void;
|
|
39
|
+
private _getPermissionCheck;
|
|
44
40
|
permissionCheckWithRanges(permissionTypes: IPermissionTypes, selectionRanges?: IRange[], unitId?: string, subUnitId?: string): boolean;
|
|
45
|
-
|
|
46
|
-
private _permissionCheckByMoveRangeCommand;
|
|
47
|
-
private _permissionCheckBySetRangeValue;
|
|
41
|
+
permissionCheckWithoutRange(permissionTypes: IPermissionTypes, unitId?: string, subUnitId?: string): boolean;
|
|
48
42
|
private _permissionCheckWithFormula;
|
|
49
|
-
private
|
|
43
|
+
private _permissionCheckBySetRangeValue;
|
|
44
|
+
private _permissionCheckByMoveRowsColsCommand;
|
|
45
|
+
private _permissionCheckByMoveRangeCommand;
|
|
46
|
+
private _permissionCheckByInsertRowColCommand;
|
|
47
|
+
private _permissionCheckByWorksheetCommand;
|
|
48
|
+
private _permissionCheckWithInsertOrDeleteMoveRange;
|
|
50
49
|
}
|
|
@@ -23,8 +23,10 @@ import { RangeProtectionRuleModel, WorksheetProtectionPointModel, WorksheetProte
|
|
|
23
23
|
* @hideconstructor
|
|
24
24
|
*/
|
|
25
25
|
export declare class FDefinedNameBuilder {
|
|
26
|
+
protected readonly unitId: string;
|
|
27
|
+
protected readonly _injector: Injector;
|
|
26
28
|
private _definedNameParam;
|
|
27
|
-
constructor();
|
|
29
|
+
constructor(unitId: string, _injector: Injector);
|
|
28
30
|
/**
|
|
29
31
|
* Sets the name of the defined name builder.
|
|
30
32
|
* @param {string} name The name of the defined name.
|
|
@@ -32,11 +34,11 @@ export declare class FDefinedNameBuilder {
|
|
|
32
34
|
* @example
|
|
33
35
|
* ```ts
|
|
34
36
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
35
|
-
* const
|
|
37
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
36
38
|
* .setName('MyDefinedName')
|
|
37
39
|
* .setRef('Sheet1!$A$1')
|
|
38
40
|
* .build();
|
|
39
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
41
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
40
42
|
* ```
|
|
41
43
|
*/
|
|
42
44
|
setName(name: string): FDefinedNameBuilder;
|
|
@@ -47,11 +49,11 @@ export declare class FDefinedNameBuilder {
|
|
|
47
49
|
* @example
|
|
48
50
|
* ```ts
|
|
49
51
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
50
|
-
* const
|
|
52
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
51
53
|
* .setName('MyDefinedName')
|
|
52
54
|
* .setFormula('SUM(Sheet1!$A$1)')
|
|
53
55
|
* .build();
|
|
54
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
56
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
55
57
|
* ```
|
|
56
58
|
*/
|
|
57
59
|
setFormula(formula: string): FDefinedNameBuilder;
|
|
@@ -62,11 +64,11 @@ export declare class FDefinedNameBuilder {
|
|
|
62
64
|
* @example
|
|
63
65
|
* ```ts
|
|
64
66
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
65
|
-
* const
|
|
67
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
66
68
|
* .setName('MyDefinedName')
|
|
67
69
|
* .setRef('Sheet1!$A$1')
|
|
68
70
|
* .build();
|
|
69
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
71
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
70
72
|
* ```
|
|
71
73
|
*/
|
|
72
74
|
setRef(a1Notation: string): FDefinedNameBuilder;
|
|
@@ -80,11 +82,11 @@ export declare class FDefinedNameBuilder {
|
|
|
80
82
|
* @example
|
|
81
83
|
* ```ts
|
|
82
84
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
83
|
-
* const
|
|
85
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
84
86
|
* .setName('MyDefinedName')
|
|
85
87
|
* .setRefByRange(1, 3, 2, 5) // D2:H3
|
|
86
88
|
* .build();
|
|
87
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
89
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
88
90
|
* ```
|
|
89
91
|
*/
|
|
90
92
|
setRefByRange(row: number, column: number, numRows: number, numColumns: number): FDefinedNameBuilder;
|
|
@@ -95,12 +97,12 @@ export declare class FDefinedNameBuilder {
|
|
|
95
97
|
* @example
|
|
96
98
|
* ```ts
|
|
97
99
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
98
|
-
* const
|
|
100
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
99
101
|
* .setName('MyDefinedName')
|
|
100
102
|
* .setRef('Sheet1!$A$1')
|
|
101
103
|
* .setComment('A reference to A1 cell in Sheet1')
|
|
102
104
|
* .build();
|
|
103
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
105
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
104
106
|
* ```
|
|
105
107
|
*/
|
|
106
108
|
setComment(comment: string): FDefinedNameBuilder;
|
|
@@ -114,12 +116,12 @@ export declare class FDefinedNameBuilder {
|
|
|
114
116
|
* const sheets = fWorkbook.getSheets();
|
|
115
117
|
*
|
|
116
118
|
* // Create a defined name and make it available only in the second worksheet
|
|
117
|
-
* const
|
|
119
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
118
120
|
* .setName('MyDefinedName')
|
|
119
121
|
* .setRef('Sheet1!$A$1')
|
|
120
122
|
* .setScopeToWorksheet(sheets[1])
|
|
121
123
|
* .build();
|
|
122
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
124
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
123
125
|
* ```
|
|
124
126
|
*/
|
|
125
127
|
setScopeToWorksheet(worksheet: FWorksheet): FDefinedNameBuilder;
|
|
@@ -131,12 +133,12 @@ export declare class FDefinedNameBuilder {
|
|
|
131
133
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
132
134
|
*
|
|
133
135
|
* // Create a defined name and make it available in the entire workbook
|
|
134
|
-
* const
|
|
136
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
135
137
|
* .setName('MyDefinedName')
|
|
136
138
|
* .setRef('Sheet1!$A$1')
|
|
137
139
|
* .setScopeToWorkbook()
|
|
138
140
|
* .build();
|
|
139
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
141
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
140
142
|
* ```
|
|
141
143
|
*/
|
|
142
144
|
setScopeToWorkbook(): FDefinedNameBuilder;
|
|
@@ -147,12 +149,12 @@ export declare class FDefinedNameBuilder {
|
|
|
147
149
|
* @example
|
|
148
150
|
* ```ts
|
|
149
151
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
150
|
-
* const
|
|
152
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
151
153
|
* .setName('MyDefinedName')
|
|
152
154
|
* .setRef('Sheet1!$A$1')
|
|
153
155
|
* .setHidden(true)
|
|
154
156
|
* .build();
|
|
155
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
157
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
156
158
|
* ```
|
|
157
159
|
*/
|
|
158
160
|
setHidden(hidden: boolean): FDefinedNameBuilder;
|
|
@@ -162,12 +164,12 @@ export declare class FDefinedNameBuilder {
|
|
|
162
164
|
* @example
|
|
163
165
|
* ```ts
|
|
164
166
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
165
|
-
* const
|
|
167
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
166
168
|
* .setName('MyDefinedName')
|
|
167
169
|
* .setRef('Sheet1!$A$1')
|
|
168
170
|
* .setComment('A reference to A1 cell in Sheet1')
|
|
169
171
|
* .build();
|
|
170
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
172
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
171
173
|
* ```
|
|
172
174
|
*/
|
|
173
175
|
build(): ISetDefinedNameMutationParam;
|
|
@@ -178,16 +180,14 @@ export declare class FDefinedNameBuilder {
|
|
|
178
180
|
* @example
|
|
179
181
|
* ```ts
|
|
180
182
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
181
|
-
* const definedNameParam =
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* const definedNameBuilder = univerAPI.newDefinedName()
|
|
188
|
-
* .load(definedNameParam)
|
|
183
|
+
* const definedNameParam = fWorkbook.newDefinedNameBuilder()
|
|
184
|
+
* .load({
|
|
185
|
+
* id: '4TMPceoqg8',
|
|
186
|
+
* name: 'MyDefinedName',
|
|
187
|
+
* formulaOrRefString: 'Sheet1!$A$1',
|
|
188
|
+
* })
|
|
189
189
|
* .build();
|
|
190
|
-
* fWorkbook.insertDefinedNameBuilder(
|
|
190
|
+
* fWorkbook.insertDefinedNameBuilder(definedNameParam);
|
|
191
191
|
* ```
|
|
192
192
|
*/
|
|
193
193
|
load(param: ISetDefinedNameMutationParam): FDefinedNameBuilder;
|
|
@@ -374,12 +374,12 @@ export declare class FDefinedName extends FBase {
|
|
|
374
374
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
375
375
|
* const definedName = fWorkbook.getDefinedNames()[0];
|
|
376
376
|
* if (!definedName) return;
|
|
377
|
-
* const
|
|
377
|
+
* const definedNameParam = definedName
|
|
378
378
|
* .toBuilder()
|
|
379
379
|
* .setName('NewDefinedName')
|
|
380
380
|
* .setFormula('SUM(Sheet1!$A$1)')
|
|
381
381
|
* .build();
|
|
382
|
-
* fWorkbook.updateDefinedNameBuilder(
|
|
382
|
+
* fWorkbook.updateDefinedNameBuilder(definedNameParam);
|
|
383
383
|
* ```
|
|
384
384
|
*/
|
|
385
385
|
toBuilder(): FDefinedNameBuilder;
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
import type { ICommandInfo, ICreateUnitOptions, IDisposable, Injector, IWorkbookData, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { FWorksheet } from './f-worksheet';
|
|
18
18
|
import { FUniver } from '@univerjs/core/facade';
|
|
19
|
-
import { FDefinedNameBuilder } from './f-defined-name';
|
|
20
|
-
import { FPermission } from './f-permission';
|
|
21
19
|
import { FWorkbook } from './f-workbook';
|
|
22
20
|
/**
|
|
23
21
|
* @ignore
|
|
@@ -75,30 +73,10 @@ export interface IFUniverSheetsMixin {
|
|
|
75
73
|
*/
|
|
76
74
|
getUniverSheet(id: string): FWorkbook | null;
|
|
77
75
|
getWorkbook(id: string): FWorkbook | null;
|
|
78
|
-
/**
|
|
79
|
-
* Get the PermissionInstance.
|
|
80
|
-
* @deprecated This function is deprecated and will be removed in version 0.6.0. Please use the function with the same name on the `FWorkbook` instance instead.
|
|
81
|
-
*/
|
|
82
|
-
getPermission(): FPermission;
|
|
83
76
|
/**
|
|
84
77
|
* @deprecated Use `univerAPI.addEvent(univerAPI.Event.UnitCreated, () => {})`
|
|
85
78
|
*/
|
|
86
79
|
onUniverSheetCreated(callback: (workbook: FWorkbook) => void): IDisposable;
|
|
87
|
-
/**
|
|
88
|
-
* Create a new defined name builder.
|
|
89
|
-
* @returns {FDefinedNameBuilder} - The defined name builder.
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
93
|
-
* const definedNameBuilder = univerAPI.newDefinedName()
|
|
94
|
-
* .setRef('Sheet1!$A$1')
|
|
95
|
-
* .setName('MyDefinedName')
|
|
96
|
-
* .setComment('This is a comment');
|
|
97
|
-
* console.log(definedNameBuilder);
|
|
98
|
-
* fWorkbook.insertDefinedNameBuilder(definedNameBuilder.build());
|
|
99
|
-
* ```
|
|
100
|
-
*/
|
|
101
|
-
newDefinedName(): FDefinedNameBuilder;
|
|
102
80
|
/**
|
|
103
81
|
* Get the target of the sheet.
|
|
104
82
|
* @param {string} unitId - The unitId of the sheet.
|
|
@@ -183,9 +161,7 @@ export declare class FUniverSheetsMixin extends FUniver implements IFUniverSheet
|
|
|
183
161
|
getActiveUniverSheet(): FWorkbook | null;
|
|
184
162
|
getUniverSheet(id: string): FWorkbook | null;
|
|
185
163
|
getWorkbook(id: string): FWorkbook | null;
|
|
186
|
-
getPermission(): FPermission;
|
|
187
164
|
onUniverSheetCreated(callback: (workbook: FWorkbook) => void): IDisposable;
|
|
188
|
-
newDefinedName(): FDefinedNameBuilder;
|
|
189
165
|
getActiveSheet(): Nullable<{
|
|
190
166
|
workbook: FWorkbook;
|
|
191
167
|
worksheet: FWorksheet;
|