@univerjs/sheets 1.0.0-alpha.1 → 1.0.0-alpha.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 +16 -4
- package/lib/cjs/index.js +23 -7
- package/lib/cjs/locale/ca-ES.js +10 -10
- package/lib/es/facade.js +16 -4
- package/lib/es/index.js +25 -9
- package/lib/es/locale/ca-ES.js +10 -10
- package/lib/facade.js +16 -4
- package/lib/index.js +25 -9
- package/lib/locale/ca-ES.js +10 -10
- package/lib/types/commands/commands/copy-worksheet.command.d.ts +4 -0
- package/lib/types/facade/f-range.d.ts +2 -1
- package/lib/types/facade/f-types.d.ts +16 -0
- package/lib/types/facade/f-workbook.d.ts +1 -4
- package/lib/types/facade/index.d.ts +2 -1
- package/lib/types/facade/permission/f-range-permission.d.ts +2 -0
- package/lib/types/facade/permission/f-worksheet-permission.d.ts +2 -0
- package/lib/types/facade/permission/util.d.ts +11 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/services/permission/range-permission/range-protection.service.d.ts +1 -0
- package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +1 -0
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/package.json +9 -9
package/lib/locale/ca-ES.js
CHANGED
|
@@ -11,12 +11,12 @@ const locale = { sheets: {
|
|
|
11
11
|
hideSheet: "No hi ha fulls visibles després d'ocultar aquest"
|
|
12
12
|
},
|
|
13
13
|
definedName: {
|
|
14
|
-
nameEmpty: "
|
|
15
|
-
nameDuplicate: "
|
|
16
|
-
nameInvalid: "
|
|
17
|
-
nameSheetConflict: "
|
|
18
|
-
formulaOrRefStringEmpty: "
|
|
19
|
-
nameConflict: "
|
|
14
|
+
nameEmpty: "El nom no pot estar buit",
|
|
15
|
+
nameDuplicate: "El nom ja existeix",
|
|
16
|
+
nameInvalid: "El nom no és vàlid",
|
|
17
|
+
nameSheetConflict: "El nom entra en conflicte amb el nom del full de càlcul",
|
|
18
|
+
formulaOrRefStringEmpty: "La fórmula o la cadena de referència no pot estar buida",
|
|
19
|
+
nameConflict: "El nom entra en conflicte amb el nom d'una funció",
|
|
20
20
|
defaultName: "NomDefinit"
|
|
21
21
|
},
|
|
22
22
|
permission: { dialog: {
|
|
@@ -33,10 +33,10 @@ const locale = { sheets: {
|
|
|
33
33
|
setStyleErr: "L'interval està protegit i no teniu permís per establir estils. Per establir estils, contacteu amb el creador."
|
|
34
34
|
} },
|
|
35
35
|
autoFill: {
|
|
36
|
-
copy: "
|
|
37
|
-
series: "
|
|
38
|
-
formatOnly: "
|
|
39
|
-
noFormat: "
|
|
36
|
+
copy: "Copia les cel·les",
|
|
37
|
+
series: "Omple la sèrie",
|
|
38
|
+
formatOnly: "Només el format",
|
|
39
|
+
noFormat: "Sense format"
|
|
40
40
|
},
|
|
41
41
|
merge: { confirm: {
|
|
42
42
|
title: "Continuar la fusió només conservarà el valor de la cel·la superior esquerra, descartant els altres valors. Estàs segur de continuar?",
|
|
@@ -19,5 +19,9 @@ export interface ICopySheetCommandParams {
|
|
|
19
19
|
unitId?: string;
|
|
20
20
|
subUnitId?: string;
|
|
21
21
|
}
|
|
22
|
+
export interface ICopySheetCommandInterceptorParams extends ICopySheetCommandParams {
|
|
23
|
+
targetSubUnitId: string;
|
|
24
|
+
copyContext: Map<string, unknown>;
|
|
25
|
+
}
|
|
22
26
|
export declare const CopySheetCommand: ICommand;
|
|
23
27
|
export declare function getCopyUniqueSheetName(workbook: Workbook, localeService: LocaleService, name: string): string;
|
|
@@ -321,7 +321,8 @@ export declare class FRange extends FBaseInitialable {
|
|
|
321
321
|
* console.log(fRange.getValue(true));
|
|
322
322
|
*
|
|
323
323
|
* // set the first cell value to 123
|
|
324
|
-
* const richText = univerAPI.newRichText(
|
|
324
|
+
* const richText = univerAPI.newRichText()
|
|
325
|
+
* .text('Hello World')
|
|
325
326
|
* .setStyle(0, 1, { bl: 1, cl: { rgb: '#c81e1e' } })
|
|
326
327
|
* .setStyle(6, 7, { bl: 1, cl: { rgb: '#c81e1e' } });
|
|
327
328
|
* fRange.setRichTextValueForCell(richText);
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export type FSheetEmbedUnitFacadeMapAugmentation = never;
|
|
@@ -81,6 +81,7 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
81
81
|
/**
|
|
82
82
|
* Set the name of the workbook.
|
|
83
83
|
* @param {string} name The new name of the workbook.
|
|
84
|
+
* @returns {FWorkbook} The current FWorkbook instance for chaining.
|
|
84
85
|
* @example
|
|
85
86
|
* ```ts
|
|
86
87
|
* // The code below sets the name of the workbook
|
|
@@ -546,7 +547,6 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
546
547
|
/**
|
|
547
548
|
* Insert a defined name by builder param.
|
|
548
549
|
* @param {ISetDefinedNameMutationParam} param The param to insert the defined name
|
|
549
|
-
* @returns {void}
|
|
550
550
|
* @example
|
|
551
551
|
* ```ts
|
|
552
552
|
* // The code below inserts a defined name by builder param
|
|
@@ -563,7 +563,6 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
563
563
|
/**
|
|
564
564
|
* Update the defined name with the given name.
|
|
565
565
|
* @param {ISetDefinedNameMutationParam} param The param to insert the defined name
|
|
566
|
-
* @returns {void}
|
|
567
566
|
* @example
|
|
568
567
|
* ```ts
|
|
569
568
|
* // The code below updates the defined name with the given name
|
|
@@ -622,7 +621,6 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
622
621
|
/**
|
|
623
622
|
* Register a custom range theme style.
|
|
624
623
|
* @param {RangeThemeStyle} rangeThemeStyle The range theme style to register
|
|
625
|
-
* @returns {void}
|
|
626
624
|
* @example
|
|
627
625
|
* ```ts
|
|
628
626
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -640,7 +638,6 @@ export declare class FWorkbook extends FBaseInitialable {
|
|
|
640
638
|
/**
|
|
641
639
|
* Unregister a custom range theme style.
|
|
642
640
|
* @param {string} themeName The name of the theme to unregister
|
|
643
|
-
* @returns {void}
|
|
644
641
|
* @example
|
|
645
642
|
* ```ts
|
|
646
643
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
@@ -19,7 +19,8 @@ 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
|
+
export type * from './f-univer';
|
|
22
24
|
export { FWorkbook } from './f-workbook';
|
|
23
25
|
export { FWorksheet } from './f-worksheet';
|
|
24
26
|
export { FWorkbookPermission } from './permission/f-workbook-permission';
|
|
25
|
-
export type * from './f-univer';
|
|
@@ -86,6 +86,8 @@ export declare class FRangePermission extends FBase {
|
|
|
86
86
|
unprotect(): Promise<boolean>;
|
|
87
87
|
/**
|
|
88
88
|
* List all protection rules that intersect with the current range.
|
|
89
|
+
* @param {object} [options] Options for listing protection rules.
|
|
90
|
+
* @param {boolean} [options.ignoreCollaborators] Whether to skip fetching collaborators for performance.
|
|
89
91
|
* @returns {Promise<FRangeProtectionRule[]>} Array of protection rules.
|
|
90
92
|
* @example
|
|
91
93
|
* ```ts
|
|
@@ -303,6 +303,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
303
303
|
unprotectRules(ruleIds: string[]): Promise<boolean>;
|
|
304
304
|
/**
|
|
305
305
|
* List all range protection rules for the worksheet.
|
|
306
|
+
* @param {object} [options] Options for listing range protection rules.
|
|
307
|
+
* @param {boolean} [options.ignoreCollaborators] Whether to skip fetching collaborators for performance.
|
|
306
308
|
* @returns {Promise<FRangeProtectionRule[]>} Array of protection rules.
|
|
307
309
|
* @example
|
|
308
310
|
* ```ts
|
|
@@ -28,10 +28,21 @@ export declare function determineScope(editState: EditStateEnum, viewState: View
|
|
|
28
28
|
/**
|
|
29
29
|
* Check if there are no range protection rules for the given unit and subunit when removing a range protection rule.
|
|
30
30
|
* If there are no rules left, also remove the associated worksheet protection and update the permission points accordingly.
|
|
31
|
+
* @param {Injector} injector The injector used to resolve permission services.
|
|
32
|
+
* @param {string} unitId The workbook unit id.
|
|
33
|
+
* @param {string} subUnitId The worksheet subunit id.
|
|
31
34
|
*/
|
|
32
35
|
export declare function handleWorksheetRangePermissionIsEmpty(injector: Injector, unitId: string, subUnitId: string): void;
|
|
33
36
|
/**
|
|
34
37
|
* Get the list of range protection rules for a specific worksheet or range, and convert them to FRangeProtectionRule instances.
|
|
38
|
+
* @param {Injector} injector The injector used to resolve permission services.
|
|
39
|
+
* @param {string} unitId The workbook unit id.
|
|
40
|
+
* @param {string} subUnitId The worksheet subunit id.
|
|
41
|
+
* @param {object} options Options for listing range protection rules.
|
|
42
|
+
* @param {FWorksheet} options.worksheet The worksheet facade used to convert ranges.
|
|
43
|
+
* @param {FRange} [options.specificRange] Optional range used to filter rules.
|
|
44
|
+
* @param {boolean} [options.ignoreCollaborators] Whether to skip fetching collaborators for performance.
|
|
45
|
+
* @returns {Promise<FRangeProtectionRule[]>} The range protection rules.
|
|
35
46
|
*/
|
|
36
47
|
export declare function getListRangeProtectionRules(injector: Injector, unitId: string, subUnitId: string, options: {
|
|
37
48
|
worksheet: FWorksheet;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export type { IClearSelectionContentCommandParams } from './commands/commands/cl
|
|
|
43
43
|
export { ClearSelectionFormatCommand } from './commands/commands/clear-selection-format.command';
|
|
44
44
|
export type { IClearSelectionFormatCommandParams } from './commands/commands/clear-selection-format.command';
|
|
45
45
|
export { CopySheetCommand } from './commands/commands/copy-worksheet.command';
|
|
46
|
-
export type { ICopySheetCommandParams } from './commands/commands/copy-worksheet.command';
|
|
46
|
+
export type { ICopySheetCommandInterceptorParams, ICopySheetCommandParams } from './commands/commands/copy-worksheet.command';
|
|
47
47
|
export { DeleteRangeMoveLeftCommand } from './commands/commands/delete-range-move-left.command';
|
|
48
48
|
export type { IDeleteRangeMoveLeftCommandParams } from './commands/commands/delete-range-move-left.command';
|
|
49
49
|
export { DeleteRangeMoveUpCommand } from './commands/commands/delete-range-move-up.command';
|
|
@@ -25,4 +25,5 @@ export declare class RangeProtectionService extends Disposable {
|
|
|
25
25
|
constructor(_selectionProtectionRuleModel: RangeProtectionRuleModel, _permissionService: IPermissionService, _resourceManagerService: IResourceManagerService, _selectionProtectionCache: RangeProtectionCache, _univerInstanceService: IUniverInstanceService);
|
|
26
26
|
private _initRuleChange;
|
|
27
27
|
private _initSnapshot;
|
|
28
|
+
private _addOrUpdatePermissionPoint;
|
|
28
29
|
}
|