@univerjs/sheets 0.24.0 → 0.25.0-insiders.20260608-e4336f7

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.
Files changed (133) hide show
  1. package/lib/cjs/facade.js +641 -466
  2. package/lib/cjs/index.js +146 -128
  3. package/lib/cjs/locale/ar-SA.js +52 -0
  4. package/lib/cjs/locale/ca-ES.js +36 -1
  5. package/lib/cjs/locale/de-DE.js +52 -0
  6. package/lib/cjs/locale/en-US.js +36 -1
  7. package/lib/cjs/locale/es-ES.js +36 -1
  8. package/lib/cjs/locale/fa-IR.js +36 -1
  9. package/lib/cjs/locale/fr-FR.js +36 -1
  10. package/lib/cjs/locale/id-ID.js +52 -0
  11. package/lib/cjs/locale/it-IT.js +52 -0
  12. package/lib/cjs/locale/ja-JP.js +36 -1
  13. package/lib/cjs/locale/ko-KR.js +36 -1
  14. package/lib/cjs/locale/pl-PL.js +52 -0
  15. package/lib/cjs/locale/pt-BR.js +52 -0
  16. package/lib/cjs/locale/ru-RU.js +36 -1
  17. package/lib/cjs/locale/sk-SK.js +36 -1
  18. package/lib/cjs/locale/vi-VN.js +36 -1
  19. package/lib/cjs/locale/zh-CN.js +36 -1
  20. package/lib/cjs/locale/zh-HK.js +52 -0
  21. package/lib/cjs/locale/zh-TW.js +36 -1
  22. package/lib/es/facade.js +642 -461
  23. package/lib/es/index.js +139 -129
  24. package/lib/es/locale/ar-SA.js +51 -0
  25. package/lib/es/locale/ca-ES.js +36 -1
  26. package/lib/es/locale/de-DE.js +51 -0
  27. package/lib/es/locale/en-US.js +36 -1
  28. package/lib/es/locale/es-ES.js +36 -1
  29. package/lib/es/locale/fa-IR.js +36 -1
  30. package/lib/es/locale/fr-FR.js +36 -1
  31. package/lib/es/locale/id-ID.js +51 -0
  32. package/lib/es/locale/it-IT.js +51 -0
  33. package/lib/es/locale/ja-JP.js +36 -1
  34. package/lib/es/locale/ko-KR.js +36 -1
  35. package/lib/es/locale/pl-PL.js +51 -0
  36. package/lib/es/locale/pt-BR.js +51 -0
  37. package/lib/es/locale/ru-RU.js +36 -1
  38. package/lib/es/locale/sk-SK.js +36 -1
  39. package/lib/es/locale/vi-VN.js +36 -1
  40. package/lib/es/locale/zh-CN.js +36 -1
  41. package/lib/es/locale/zh-HK.js +51 -0
  42. package/lib/es/locale/zh-TW.js +36 -1
  43. package/lib/facade.js +642 -461
  44. package/lib/index.js +139 -129
  45. package/lib/locale/ar-SA.js +51 -0
  46. package/lib/locale/ca-ES.js +36 -1
  47. package/lib/locale/de-DE.js +51 -0
  48. package/lib/locale/en-US.js +36 -1
  49. package/lib/locale/es-ES.js +36 -1
  50. package/lib/locale/fa-IR.js +36 -1
  51. package/lib/locale/fr-FR.js +36 -1
  52. package/lib/locale/id-ID.js +51 -0
  53. package/lib/locale/it-IT.js +51 -0
  54. package/lib/locale/ja-JP.js +36 -1
  55. package/lib/locale/ko-KR.js +36 -1
  56. package/lib/locale/pl-PL.js +51 -0
  57. package/lib/locale/pt-BR.js +51 -0
  58. package/lib/locale/ru-RU.js +36 -1
  59. package/lib/locale/sk-SK.js +36 -1
  60. package/lib/locale/vi-VN.js +36 -1
  61. package/lib/locale/zh-CN.js +36 -1
  62. package/lib/locale/zh-HK.js +51 -0
  63. package/lib/locale/zh-TW.js +36 -1
  64. package/lib/types/basics/utils.d.ts +2 -0
  65. package/lib/types/commands/commands/add-range-protection.command.d.ts +1 -1
  66. package/lib/types/commands/commands/delete-range-protection.command.d.ts +1 -1
  67. package/lib/types/commands/commands/register-range-theme.command.d.ts +1 -1
  68. package/lib/types/commands/commands/set-protection.command.d.ts +1 -1
  69. package/lib/types/commands/mutations/add-range-protection.mutation.d.ts +1 -1
  70. package/lib/types/commands/mutations/add-range-theme.mutation.d.ts +1 -1
  71. package/lib/types/commands/mutations/register-range-theme.mutation.d.ts +1 -1
  72. package/lib/types/commands/mutations/set-range-protection.mutation.d.ts +1 -1
  73. package/lib/types/commands/mutations/set-range-theme.mutation.d.ts +1 -1
  74. package/lib/types/controllers/permission/sheet-permission-check.controller.d.ts +1 -1
  75. package/lib/types/controllers/permission/sheet-permission-init.controller.d.ts +1 -1
  76. package/lib/types/controllers/permission/sheet-permission-view-model.controller.d.ts +1 -1
  77. package/lib/types/controllers/zebar-crossing.controller.d.ts +1 -1
  78. package/lib/types/facade/{f-sheet-hooks.d.ts → const.d.ts} +1 -9
  79. package/lib/types/facade/f-range.d.ts +187 -94
  80. package/lib/types/facade/f-selection.d.ts +15 -8
  81. package/lib/types/facade/f-univer.d.ts +33 -64
  82. package/lib/types/facade/f-workbook.d.ts +15 -50
  83. package/lib/types/facade/f-worksheet.d.ts +202 -101
  84. package/lib/types/facade/index.d.ts +0 -1
  85. package/lib/types/facade/permission/f-range-permission.d.ts +8 -4
  86. package/lib/types/facade/permission/f-range-protection-rule.d.ts +18 -9
  87. package/lib/types/facade/permission/f-worksheet-permission.d.ts +36 -18
  88. package/lib/types/index.d.ts +9 -8
  89. package/lib/types/locale/ar-SA.d.ts +18 -0
  90. package/lib/types/locale/de-DE.d.ts +18 -0
  91. package/lib/types/locale/en-US.d.ts +39 -0
  92. package/lib/types/locale/id-ID.d.ts +18 -0
  93. package/lib/types/locale/it-IT.d.ts +18 -0
  94. package/lib/types/locale/pl-PL.d.ts +18 -0
  95. package/lib/types/locale/pt-BR.d.ts +18 -0
  96. package/lib/types/locale/zh-HK.d.ts +18 -0
  97. package/lib/types/services/permission/range-permission/range-protection.ref-range.d.ts +3 -3
  98. package/lib/types/services/permission/range-permission/range-protection.service.d.ts +2 -2
  99. package/lib/types/services/permission/type.d.ts +1 -1
  100. package/lib/types/services/permission/workbook-permission/workbook-permission.service.d.ts +1 -1
  101. package/lib/types/services/permission/worksheet-permission/worksheet-permission.service.d.ts +1 -1
  102. package/lib/types/services/range-theme.service.d.ts +3 -3
  103. package/lib/umd/facade.js +1 -1
  104. package/lib/umd/index.js +2 -2
  105. package/lib/umd/locale/ar-SA.js +1 -0
  106. package/lib/umd/locale/ca-ES.js +1 -1
  107. package/lib/umd/locale/de-DE.js +1 -0
  108. package/lib/umd/locale/en-US.js +1 -1
  109. package/lib/umd/locale/es-ES.js +1 -1
  110. package/lib/umd/locale/fa-IR.js +1 -1
  111. package/lib/umd/locale/fr-FR.js +1 -1
  112. package/lib/umd/locale/id-ID.js +1 -0
  113. package/lib/umd/locale/it-IT.js +1 -0
  114. package/lib/umd/locale/ja-JP.js +1 -1
  115. package/lib/umd/locale/ko-KR.js +1 -1
  116. package/lib/umd/locale/pl-PL.js +1 -0
  117. package/lib/umd/locale/pt-BR.js +1 -0
  118. package/lib/umd/locale/ru-RU.js +1 -1
  119. package/lib/umd/locale/sk-SK.js +1 -1
  120. package/lib/umd/locale/vi-VN.js +1 -1
  121. package/lib/umd/locale/zh-CN.js +1 -1
  122. package/lib/umd/locale/zh-HK.js +1 -0
  123. package/lib/umd/locale/zh-TW.js +1 -1
  124. package/package.json +9 -9
  125. package/LICENSE +0 -176
  126. /package/lib/types/{model → models}/range-protection-render.model.d.ts +0 -0
  127. /package/lib/types/{model → models}/range-protection-rule.model.d.ts +0 -0
  128. /package/lib/types/{model → models}/range-protection.cache.d.ts +0 -0
  129. /package/lib/types/{model → models}/range-theme-model.d.ts +0 -0
  130. /package/lib/types/{model → models}/range-theme-util.d.ts +0 -0
  131. /package/lib/types/{model → models}/range-themes/build-in-theme.factory.d.ts +0 -0
  132. /package/lib/types/{model → models}/range-themes/default.d.ts +0 -0
  133. /package/lib/types/{model → models}/zebra-crossing-cache.d.ts +0 -0
@@ -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';
@@ -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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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()?.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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.getActiveSheet();
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());
@@ -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';
@@ -163,6 +163,7 @@ export { type ISheetCommandSharedParams } from './commands/utils/interface';
163
163
  export { getSelectionsService } from './commands/utils/selection-command-util';
164
164
  export { defaultLargeSheetOperationConfig, type ILargeSheetOperationConfig, type IUniverSheetsConfig, SHEETS_PLUGIN_CONFIG_KEY } from './config/config';
165
165
  export { AutoFillController } from './controllers/auto-fill.controller';
166
+ export { CalculateResultApplyController } from './controllers/calculate-result-apply.controller';
166
167
  export { MAX_CELL_PER_SHEET_KEY } from './controllers/config/config';
167
168
  export { DefinedNameDataController } from './controllers/defined-name-data.controller';
168
169
  export { SCOPE_WORKBOOK_VALUE_DEFINED_NAME } from './controllers/defined-name-data.controller';
@@ -172,13 +173,13 @@ export { MERGE_CELL_INTERCEPTOR_CHECK, MergeCellController } from './controllers
172
173
  export { SheetPermissionCheckController } from './controllers/permission/sheet-permission-check.controller';
173
174
  export { SheetPermissionInitController } from './controllers/permission/sheet-permission-init.controller';
174
175
  export { ZebraCrossingCacheController } from './controllers/zebar-crossing.controller';
175
- export { type ICellPermission, RangeProtectionRenderModel } from './model/range-protection-render.model';
176
- export { EditStateEnum, type IModel, type IObjectModel, type IRangeProtectionRule, RangeProtectionRuleModel, ViewStateEnum } from './model/range-protection-rule.model';
177
- export { RangeProtectionCache } from './model/range-protection.cache';
178
- export { SheetRangeThemeModel } from './model/range-theme-model';
179
- export type { IRangeThemeStyleJSON } from './model/range-theme-util';
180
- export { RangeThemeStyle } from './model/range-theme-util';
181
- export type { IRangeThemeStyleItem } from './model/range-theme-util';
176
+ export { type ICellPermission, RangeProtectionRenderModel } from './models/range-protection-render.model';
177
+ export { EditStateEnum, type IModel, type IObjectModel, type IRangeProtectionRule, RangeProtectionRuleModel, ViewStateEnum } from './models/range-protection-rule.model';
178
+ export { RangeProtectionCache } from './models/range-protection.cache';
179
+ export { SheetRangeThemeModel } from './models/range-theme-model';
180
+ export type { IRangeThemeStyleJSON } from './models/range-theme-util';
181
+ export { RangeThemeStyle } from './models/range-theme-util';
182
+ export type { IRangeThemeStyleItem } from './models/range-theme-util';
182
183
  export { UniverSheetsPlugin } from './plugin';
183
184
  export { AutoFillService, IAutoFillService } from './services/auto-fill/auto-fill.service';
184
185
  export { default as AutoFillRules } from './services/auto-fill/rules';
@@ -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;
@@ -19,9 +19,9 @@ import type { IDeleteRangeProtectionMutationParams } from '../../../commands/mut
19
19
  import type { ISetRangeProtectionMutationParams } from '../../../commands/mutations/set-range-protection.mutation';
20
20
  import type { EffectRefRangeParams } from '../../ref-range/type';
21
21
  import { Disposable, DisposableCollection, ICommandService, IUniverInstanceService } from '@univerjs/core';
22
- import { RangeProtectionRenderModel } from '../../../model/range-protection-render.model';
23
- import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
24
- import { RangeProtectionCache } from '../../../model/range-protection.cache';
22
+ import { RangeProtectionRenderModel } from '../../../models/range-protection-render.model';
23
+ import { RangeProtectionRuleModel } from '../../../models/range-protection-rule.model';
24
+ import { RangeProtectionCache } from '../../../models/range-protection.cache';
25
25
  import { RefRangeService } from '../../ref-range/ref-range.service';
26
26
  import { SheetInterceptorService } from '../../sheet-interceptor/sheet-interceptor.service';
27
27
  export declare class RangeProtectionRefRangeService extends Disposable {
@@ -14,8 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Disposable, IPermissionService, IResourceManagerService, IUniverInstanceService } from '@univerjs/core';
17
- import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
18
- import { RangeProtectionCache } from '../../../model/range-protection.cache';
17
+ import { RangeProtectionRuleModel } from '../../../models/range-protection-rule.model';
18
+ import { RangeProtectionCache } from '../../../models/range-protection.cache';
19
19
  export declare class RangeProtectionService extends Disposable {
20
20
  private _selectionProtectionRuleModel;
21
21
  private _permissionService;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import type { UnitObject } from '@univerjs/protocol';
17
- import type { EditStateEnum, ViewStateEnum } from '../../model/range-protection-rule.model';
17
+ import type { EditStateEnum, ViewStateEnum } from '../../models/range-protection-rule.model';
18
18
  export interface IWorksheetProtectionRule {
19
19
  permissionId: string;
20
20
  description?: string;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Disposable, IPermissionService, IUniverInstanceService } from '@univerjs/core';
17
- import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
17
+ import { RangeProtectionRuleModel } from '../../../models/range-protection-rule.model';
18
18
  import { WorksheetProtectionPointModel, WorksheetProtectionRuleModel } from '../worksheet-permission';
19
19
  export declare class WorkbookPermissionService extends Disposable {
20
20
  private _permissionService;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { ILogService, Injector, IPermissionService, IResourceManagerService, IUniverInstanceService, RxDisposable } from '@univerjs/core';
17
- import { RangeProtectionRuleModel } from '../../../model/range-protection-rule.model';
17
+ import { RangeProtectionRuleModel } from '../../../models/range-protection-rule.model';
18
18
  import { WorksheetProtectionPointModel } from './worksheet-permission-point.model';
19
19
  import { WorksheetProtectionRuleModel } from './worksheet-permission-rule.model';
20
20
  export declare const RULE_MODEL_PLUGIN_NAME = "SHEET_WORKSHEET_PROTECTION_PLUGIN";
@@ -13,10 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import type { IRangeThemeRangeInfo } from '../model/range-theme-model';
17
- import type { RangeThemeStyle } from '../model/range-theme-util';
16
+ import type { IRangeThemeRangeInfo } from '../models/range-theme-model';
17
+ import type { RangeThemeStyle } from '../models/range-theme-util';
18
18
  import { Disposable } from '@univerjs/core';
19
- import { SheetRangeThemeModel } from '../model/range-theme-model';
19
+ import { SheetRangeThemeModel } from '../models/range-theme-model';
20
20
  export declare class SheetRangeThemeService extends Disposable {
21
21
  private _sheetRangeThemeModel;
22
22
  constructor(_sheetRangeThemeModel: SheetRangeThemeModel);