@univerjs/sheets 0.24.0 → 0.25.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 +462 -235
- package/lib/cjs/index.js +68 -56
- package/lib/cjs/locale/ar-SA.js +52 -0
- package/lib/cjs/locale/ca-ES.js +36 -1
- package/lib/cjs/locale/de-DE.js +52 -0
- package/lib/cjs/locale/en-US.js +36 -1
- package/lib/cjs/locale/es-ES.js +36 -1
- package/lib/cjs/locale/fa-IR.js +36 -1
- package/lib/cjs/locale/fr-FR.js +36 -1
- package/lib/cjs/locale/id-ID.js +52 -0
- package/lib/cjs/locale/it-IT.js +52 -0
- package/lib/cjs/locale/ja-JP.js +36 -1
- package/lib/cjs/locale/ko-KR.js +36 -1
- package/lib/cjs/locale/pl-PL.js +52 -0
- package/lib/cjs/locale/pt-BR.js +52 -0
- package/lib/cjs/locale/ru-RU.js +36 -1
- package/lib/cjs/locale/sk-SK.js +36 -1
- package/lib/cjs/locale/vi-VN.js +36 -1
- package/lib/cjs/locale/zh-CN.js +36 -1
- package/lib/cjs/locale/zh-HK.js +52 -0
- package/lib/cjs/locale/zh-TW.js +36 -1
- package/lib/es/facade.js +462 -235
- package/lib/es/index.js +67 -57
- package/lib/es/locale/ar-SA.js +51 -0
- package/lib/es/locale/ca-ES.js +36 -1
- package/lib/es/locale/de-DE.js +51 -0
- package/lib/es/locale/en-US.js +36 -1
- package/lib/es/locale/es-ES.js +36 -1
- package/lib/es/locale/fa-IR.js +36 -1
- package/lib/es/locale/fr-FR.js +36 -1
- package/lib/es/locale/id-ID.js +51 -0
- package/lib/es/locale/it-IT.js +51 -0
- package/lib/es/locale/ja-JP.js +36 -1
- package/lib/es/locale/ko-KR.js +36 -1
- package/lib/es/locale/pl-PL.js +51 -0
- package/lib/es/locale/pt-BR.js +51 -0
- package/lib/es/locale/ru-RU.js +36 -1
- package/lib/es/locale/sk-SK.js +36 -1
- package/lib/es/locale/vi-VN.js +36 -1
- package/lib/es/locale/zh-CN.js +36 -1
- package/lib/es/locale/zh-HK.js +51 -0
- package/lib/es/locale/zh-TW.js +36 -1
- package/lib/facade.js +462 -235
- package/lib/index.js +67 -57
- package/lib/locale/ar-SA.js +51 -0
- package/lib/locale/ca-ES.js +36 -1
- package/lib/locale/de-DE.js +51 -0
- package/lib/locale/en-US.js +36 -1
- package/lib/locale/es-ES.js +36 -1
- package/lib/locale/fa-IR.js +36 -1
- package/lib/locale/fr-FR.js +36 -1
- package/lib/locale/id-ID.js +51 -0
- package/lib/locale/it-IT.js +51 -0
- package/lib/locale/ja-JP.js +36 -1
- package/lib/locale/ko-KR.js +36 -1
- package/lib/locale/pl-PL.js +51 -0
- package/lib/locale/pt-BR.js +51 -0
- package/lib/locale/ru-RU.js +36 -1
- package/lib/locale/sk-SK.js +36 -1
- package/lib/locale/vi-VN.js +36 -1
- package/lib/locale/zh-CN.js +36 -1
- package/lib/locale/zh-HK.js +51 -0
- package/lib/locale/zh-TW.js +36 -1
- package/lib/types/basics/utils.d.ts +2 -0
- package/lib/types/facade/f-range.d.ts +184 -92
- package/lib/types/facade/f-selection.d.ts +15 -8
- package/lib/types/facade/f-workbook.d.ts +12 -5
- package/lib/types/facade/f-worksheet.d.ts +202 -101
- package/lib/types/facade/permission/f-range-permission.d.ts +8 -4
- package/lib/types/facade/permission/f-range-protection-rule.d.ts +18 -9
- package/lib/types/facade/permission/f-worksheet-permission.d.ts +36 -18
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/ar-SA.d.ts +18 -0
- package/lib/types/locale/de-DE.d.ts +18 -0
- package/lib/types/locale/en-US.d.ts +39 -0
- package/lib/types/locale/id-ID.d.ts +18 -0
- package/lib/types/locale/it-IT.d.ts +18 -0
- package/lib/types/locale/pl-PL.d.ts +18 -0
- package/lib/types/locale/pt-BR.d.ts +18 -0
- package/lib/types/locale/zh-HK.d.ts +18 -0
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +2 -2
- package/lib/umd/locale/ar-SA.js +1 -0
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -0
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -0
- package/lib/umd/locale/it-IT.js +1 -0
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -0
- package/lib/umd/locale/pt-BR.js +1 -0
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -0
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +9 -9
|
@@ -42,7 +42,8 @@ export declare class FRangePermission extends FBase {
|
|
|
42
42
|
* @example
|
|
43
43
|
* ```ts
|
|
44
44
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
45
|
-
* const fWorksheet = fWorkbook.
|
|
45
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
46
|
+
* if (!fWorksheet) return;
|
|
46
47
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
47
48
|
* // Check if the A1:B2 range is protected
|
|
48
49
|
* const isProtected = fRange.getRangePermission().isProtected();
|
|
@@ -57,7 +58,8 @@ export declare class FRangePermission extends FBase {
|
|
|
57
58
|
* @example
|
|
58
59
|
* ```ts
|
|
59
60
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
60
|
-
* const fWorksheet = fWorkbook.
|
|
61
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
62
|
+
* if (!fWorksheet) return;
|
|
61
63
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
62
64
|
* const rule = await fRange.getRangePermission().protect({
|
|
63
65
|
* name: 'My protected range',
|
|
@@ -74,7 +76,8 @@ export declare class FRangePermission extends FBase {
|
|
|
74
76
|
* @example
|
|
75
77
|
* ```ts
|
|
76
78
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
77
|
-
* const fWorksheet = fWorkbook.
|
|
79
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
80
|
+
* if (!fWorksheet) return;
|
|
78
81
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
79
82
|
* const result = await fRange.getRangePermission().unprotect();
|
|
80
83
|
* console.log(result);
|
|
@@ -87,7 +90,8 @@ export declare class FRangePermission extends FBase {
|
|
|
87
90
|
* @example
|
|
88
91
|
* ```ts
|
|
89
92
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
90
|
-
* const fWorksheet = fWorkbook.
|
|
93
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
94
|
+
* if (!fWorksheet) return;
|
|
91
95
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
92
96
|
* const rules = await fRange.getRangePermission().listRules();
|
|
93
97
|
* console.log(rules);
|
|
@@ -60,7 +60,8 @@ export declare class FRangeProtectionRule {
|
|
|
60
60
|
* @example
|
|
61
61
|
* ```ts
|
|
62
62
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
63
|
-
* const fWorksheet = fWorkbook.
|
|
63
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
64
|
+
* if (!fWorksheet) return;
|
|
64
65
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
65
66
|
* // Update the ranges to A1:C3 for the first rule
|
|
66
67
|
* if (rules.length > 0) {
|
|
@@ -77,7 +78,8 @@ export declare class FRangeProtectionRule {
|
|
|
77
78
|
* @example
|
|
78
79
|
* ```ts
|
|
79
80
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
80
|
-
* const fWorksheet = fWorkbook.
|
|
81
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
82
|
+
* if (!fWorksheet) return;
|
|
81
83
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
82
84
|
* // Remove the first protection rule
|
|
83
85
|
* if (rules.length > 0) {
|
|
@@ -108,7 +110,8 @@ export declare class FRangeProtectionRule {
|
|
|
108
110
|
* @example
|
|
109
111
|
* ```ts
|
|
110
112
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
111
|
-
* const fWorksheet = fWorkbook.
|
|
113
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
114
|
+
* if (!fWorksheet) return;
|
|
112
115
|
* const fRange = fWorksheet.getRange('A1:B2');
|
|
113
116
|
* // First, create a protection rule
|
|
114
117
|
* const rule = await fRange.getRangePermission().protect({ name: 'My Range', allowEdit: true });
|
|
@@ -125,7 +128,8 @@ export declare class FRangeProtectionRule {
|
|
|
125
128
|
* @example
|
|
126
129
|
* ```ts
|
|
127
130
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
128
|
-
* const fWorksheet = fWorkbook.
|
|
131
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
132
|
+
* if (!fWorksheet) return;
|
|
129
133
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
130
134
|
* // Check if the first rule allows editing
|
|
131
135
|
* if (rules.length > 0) {
|
|
@@ -142,7 +146,8 @@ export declare class FRangeProtectionRule {
|
|
|
142
146
|
* @example
|
|
143
147
|
* ```ts
|
|
144
148
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
145
|
-
* const fWorksheet = fWorkbook.
|
|
149
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
150
|
+
* if (!fWorksheet) return;
|
|
146
151
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
147
152
|
* // Check if the first rule allows editing
|
|
148
153
|
* const rule = rules[0];
|
|
@@ -158,7 +163,8 @@ export declare class FRangeProtectionRule {
|
|
|
158
163
|
* @example
|
|
159
164
|
* ```ts
|
|
160
165
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
161
|
-
* const fWorksheet = fWorkbook.
|
|
166
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
167
|
+
* if (!fWorksheet) return;
|
|
162
168
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
163
169
|
* // Check if the first rule allows viewing
|
|
164
170
|
* const rule = rules[0];
|
|
@@ -174,7 +180,8 @@ export declare class FRangeProtectionRule {
|
|
|
174
180
|
* @example
|
|
175
181
|
* ```ts
|
|
176
182
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
177
|
-
* const fWorksheet = fWorkbook.
|
|
183
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
184
|
+
* if (!fWorksheet) return;
|
|
178
185
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
179
186
|
* // Check if the first rule allows managing collaborators
|
|
180
187
|
* const rule = rules[0];
|
|
@@ -190,7 +197,8 @@ export declare class FRangeProtectionRule {
|
|
|
190
197
|
* @example
|
|
191
198
|
* ```ts
|
|
192
199
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
193
|
-
* const fWorksheet = fWorkbook.
|
|
200
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
201
|
+
* if (!fWorksheet) return;
|
|
194
202
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
195
203
|
* // Check if the first rule allows deleting the rule
|
|
196
204
|
* const rule = rules[0];
|
|
@@ -206,7 +214,8 @@ export declare class FRangeProtectionRule {
|
|
|
206
214
|
* @example
|
|
207
215
|
* ```ts
|
|
208
216
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
209
|
-
* const fWorksheet = fWorkbook.
|
|
217
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
218
|
+
* if (!fWorksheet) return;
|
|
210
219
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
211
220
|
* // Get the permission snapshot of the first rule
|
|
212
221
|
* if (rules.length > 0) {
|
|
@@ -45,7 +45,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
45
45
|
* @example
|
|
46
46
|
* ```ts
|
|
47
47
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
48
|
-
* const fWorksheet = fWorkbook.
|
|
48
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
49
|
+
* if (!fWorksheet) return;
|
|
49
50
|
* if (fWorksheet.getWorksheetPermission().isProtected()) {
|
|
50
51
|
* console.log('Worksheet is protected');
|
|
51
52
|
* }
|
|
@@ -60,7 +61,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
60
61
|
* @example
|
|
61
62
|
* ```ts
|
|
62
63
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
63
|
-
* const fWorksheet = fWorkbook.
|
|
64
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
65
|
+
* if (!fWorksheet) return;
|
|
64
66
|
* const permission = fWorksheet.getWorksheetPermission();
|
|
65
67
|
*
|
|
66
68
|
* // Create worksheet protection with collaborators
|
|
@@ -81,7 +83,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
81
83
|
* @example
|
|
82
84
|
* ```ts
|
|
83
85
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
84
|
-
* const fWorksheet = fWorkbook.
|
|
86
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
87
|
+
* if (!fWorksheet) return;
|
|
85
88
|
* await fWorksheet.getWorksheetPermission().unprotect();
|
|
86
89
|
* ```
|
|
87
90
|
*/
|
|
@@ -94,7 +97,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
94
97
|
* @example
|
|
95
98
|
* ```ts
|
|
96
99
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
97
|
-
* const fWorksheet = fWorkbook.
|
|
100
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
101
|
+
* if (!fWorksheet) return;
|
|
98
102
|
* await fWorksheet.getWorksheetPermission().setMode('readOnly');
|
|
99
103
|
* ```
|
|
100
104
|
*/
|
|
@@ -110,7 +114,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
110
114
|
* @example
|
|
111
115
|
* ```ts
|
|
112
116
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
113
|
-
* const fWorksheet = fWorkbook.
|
|
117
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
118
|
+
* if (!fWorksheet) return;
|
|
114
119
|
* await fWorksheet.getWorksheetPermission().setReadOnly();
|
|
115
120
|
* ```
|
|
116
121
|
*/
|
|
@@ -121,7 +126,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
121
126
|
* @example
|
|
122
127
|
* ```ts
|
|
123
128
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
124
|
-
* const fWorksheet = fWorkbook.
|
|
129
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
130
|
+
* if (!fWorksheet) return;
|
|
125
131
|
* await fWorksheet.getWorksheetPermission().setEditable();
|
|
126
132
|
* ```
|
|
127
133
|
*/
|
|
@@ -135,7 +141,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
135
141
|
* @example
|
|
136
142
|
* ```ts
|
|
137
143
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
138
|
-
* const fWorksheet = fWorkbook.
|
|
144
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
145
|
+
* if (!fWorksheet) return;
|
|
139
146
|
* const permission = fWorksheet.getWorksheetPermission();
|
|
140
147
|
* await permission.setPoint(univerAPI.Enum.WorksheetPermissionPoint.InsertRow, false);
|
|
141
148
|
* ```
|
|
@@ -147,7 +154,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
147
154
|
* @example
|
|
148
155
|
* ```ts
|
|
149
156
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
150
|
-
* const fWorksheet = fWorkbook.
|
|
157
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
158
|
+
* if (!fWorksheet) return;
|
|
151
159
|
* if (fWorksheet.getWorksheetPermission().canEdit()) {
|
|
152
160
|
* console.log('Worksheet is editable');
|
|
153
161
|
* }
|
|
@@ -162,7 +170,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
162
170
|
* @example
|
|
163
171
|
* ```ts
|
|
164
172
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
165
|
-
* const fWorksheet = fWorkbook.
|
|
173
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
174
|
+
* if (!fWorksheet) return;
|
|
166
175
|
* // Check if cell C3 can be edited
|
|
167
176
|
* const fRange = fWorksheet.getRange('C3');
|
|
168
177
|
* const canEdit = fWorksheet.getWorksheetPermission().canEditCell(fRange.getRow(), fRange.getColumn());
|
|
@@ -176,7 +185,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
176
185
|
* @example
|
|
177
186
|
* ```ts
|
|
178
187
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
179
|
-
* const fWorksheet = fWorkbook.
|
|
188
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
189
|
+
* if (!fWorksheet) return;
|
|
180
190
|
* if (fWorksheet.getWorksheetPermission().canView()) {
|
|
181
191
|
* console.log('Worksheet is viewable');
|
|
182
192
|
* }
|
|
@@ -190,7 +200,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
190
200
|
* @example
|
|
191
201
|
* ```ts
|
|
192
202
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
193
|
-
* const fWorksheet = fWorkbook.
|
|
203
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
204
|
+
* if (!fWorksheet) return;
|
|
194
205
|
* // Check if cell C3 can be viewed
|
|
195
206
|
* const fRange = fWorksheet.getRange('C3');
|
|
196
207
|
* const canView = fWorksheet.getWorksheetPermission().canViewCell(fRange.getRow(), fRange.getColumn());
|
|
@@ -205,7 +216,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
205
216
|
* @example
|
|
206
217
|
* ```ts
|
|
207
218
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
208
|
-
* const fWorksheet = fWorkbook.
|
|
219
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
220
|
+
* if (!fWorksheet) return;
|
|
209
221
|
* const permission = fWorksheet.getWorksheetPermission();
|
|
210
222
|
* const canInsertRow = permission.getPoint(univerAPI.Enum.WorksheetPermissionPoint.InsertRow);
|
|
211
223
|
* console.log(canInsertRow);
|
|
@@ -218,7 +230,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
218
230
|
* @example
|
|
219
231
|
* ```ts
|
|
220
232
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
221
|
-
* const fWorksheet = fWorkbook.
|
|
233
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
234
|
+
* if (!fWorksheet) return;
|
|
222
235
|
* const snapshot = fWorksheet.getWorksheetPermission().getSnapshot();
|
|
223
236
|
* console.log(snapshot);
|
|
224
237
|
* ```
|
|
@@ -230,7 +243,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
230
243
|
* @returns {Promise<void>} A promise that resolves when the configuration is applied.
|
|
231
244
|
* @example
|
|
232
245
|
* ```ts
|
|
233
|
-
* const worksheet = univerAPI.getActiveWorkbook()?.
|
|
246
|
+
* const worksheet = univerAPI.getActiveWorkbook()?.getSheetByName('Sheet1');
|
|
247
|
+
* if (!worksheet) return;
|
|
234
248
|
* const permission = worksheet?.getWorksheetPermission();
|
|
235
249
|
* await permission?.applyConfig({
|
|
236
250
|
* mode: 'readOnly',
|
|
@@ -249,7 +263,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
249
263
|
* @example
|
|
250
264
|
* ```ts
|
|
251
265
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
252
|
-
* const fWorksheet = fWorkbook.
|
|
266
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
267
|
+
* if (!fWorksheet) return;
|
|
253
268
|
* const rules = await fWorksheet.getWorksheetPermission().protectRanges([
|
|
254
269
|
* {
|
|
255
270
|
* ranges: [fWorksheet.getRange('A1:B2')],
|
|
@@ -274,7 +289,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
274
289
|
* @example
|
|
275
290
|
* ```ts
|
|
276
291
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
277
|
-
* const fWorksheet = fWorkbook.
|
|
292
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
293
|
+
* if (!fWorksheet) return;
|
|
278
294
|
* const worksheetPermission = fWorksheet.getWorksheetPermission();
|
|
279
295
|
* const rules = await worksheetPermission.listRangeProtectionRules();
|
|
280
296
|
* // Unprotect the first rule as an example
|
|
@@ -291,7 +307,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
291
307
|
* @example
|
|
292
308
|
* ```ts
|
|
293
309
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
294
|
-
* const fWorksheet = fWorkbook.
|
|
310
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
311
|
+
* if (!fWorksheet) return;
|
|
295
312
|
* const rules = await fWorksheet.getWorksheetPermission().listRangeProtectionRules();
|
|
296
313
|
* console.log(rules);
|
|
297
314
|
* ```
|
|
@@ -307,7 +324,8 @@ export declare class FWorksheetPermission extends FBase {
|
|
|
307
324
|
* @example
|
|
308
325
|
* ```ts
|
|
309
326
|
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
310
|
-
* const fWorksheet = fWorkbook.
|
|
327
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
328
|
+
* if (!fWorksheet) return;
|
|
311
329
|
* // Get debug info for cell C3
|
|
312
330
|
* const fRange = fWorksheet.getRange('C3');
|
|
313
331
|
* const debugInfo = await fWorksheet.getWorksheetPermission().debugCellPermission(fRange.getRow(), fRange.getColumn());
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export { createTopMatrixFromMatrix, createTopMatrixFromRanges, findAllRectangle,
|
|
|
23
23
|
export { convertPrimaryWithCoordToPrimary, convertSelectionDataToRange, type ISelectionStyle, type ISelectionWidgetConfig, type ISelectionWithCoord, type ISelectionWithStyle, type ISheetRangeLocation, SELECTION_CONTROL_BORDER_BUFFER_COLOR, SELECTION_CONTROL_BORDER_BUFFER_WIDTH, } from './basics/selection';
|
|
24
24
|
export { SplitDelimiterEnum, splitRangeText } from './basics/split-range-text';
|
|
25
25
|
export { findFirstNonEmptyCell } from './basics/utils';
|
|
26
|
-
export { discreteRangeToRange, generateNullCell, generateNullCellValue, getVisibleRanges, rangeToDiscreteRange } from './basics/utils';
|
|
26
|
+
export { deserializeListOptions, discreteRangeToRange, generateNullCell, generateNullCellValue, getVisibleRanges, rangeToDiscreteRange, serializeListOptions } from './basics/utils';
|
|
27
27
|
export { AddRangeProtectionCommand, type IAddRangeProtectionCommandParams } from './commands/commands/add-range-protection.command';
|
|
28
28
|
export { addMergeCellsUtil, AddWorksheetMergeAllCommand, AddWorksheetMergeCommand, AddWorksheetMergeHorizontalCommand, AddWorksheetMergeVerticalCommand, getClearContentMutationParamForRange, getClearContentMutationParamsForRanges, type IAddMergeCommandParams, type IMergeCellsUtilOptions, } from './commands/commands/add-worksheet-merge.command';
|
|
29
29
|
export { AddWorksheetProtectionCommand } from './commands/commands/add-worksheet-protection.command';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -25,6 +25,45 @@ declare const locale: {
|
|
|
25
25
|
partOfCell: string;
|
|
26
26
|
hideSheet: string;
|
|
27
27
|
};
|
|
28
|
+
definedName: {
|
|
29
|
+
nameEmpty: string;
|
|
30
|
+
nameDuplicate: string;
|
|
31
|
+
nameInvalid: string;
|
|
32
|
+
nameSheetConflict: string;
|
|
33
|
+
formulaOrRefStringEmpty: string;
|
|
34
|
+
nameConflict: string;
|
|
35
|
+
defaultName: string;
|
|
36
|
+
};
|
|
37
|
+
permission: {
|
|
38
|
+
dialog: {
|
|
39
|
+
autoFillErr: string;
|
|
40
|
+
editErr: string;
|
|
41
|
+
formulaErr: string;
|
|
42
|
+
insertOrDeleteMoveRangeErr: string;
|
|
43
|
+
insertRowColErr: string;
|
|
44
|
+
moveRangeErr: string;
|
|
45
|
+
moveRowColErr: string;
|
|
46
|
+
operatorSheetErr: string;
|
|
47
|
+
removeRowColErr: string;
|
|
48
|
+
setRowColStyleErr: string;
|
|
49
|
+
setStyleErr: string;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
autoFill: {
|
|
53
|
+
copy: string;
|
|
54
|
+
series: string;
|
|
55
|
+
formatOnly: string;
|
|
56
|
+
noFormat: string;
|
|
57
|
+
};
|
|
58
|
+
merge: {
|
|
59
|
+
confirm: {
|
|
60
|
+
title: string;
|
|
61
|
+
cancel: string;
|
|
62
|
+
confirm: string;
|
|
63
|
+
warning: string;
|
|
64
|
+
dismantleMergeCellWarning: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
28
67
|
};
|
|
29
68
|
};
|
|
30
69
|
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|
|
@@ -0,0 +1,18 @@
|
|
|
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 enUS from './en-US';
|
|
17
|
+
declare const locale: typeof enUS;
|
|
18
|
+
export default locale;
|