@univerjs/sheets 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/facade.js CHANGED
@@ -1,16 +1,16 @@
1
- var Le = Object.defineProperty;
2
- var ze = (s, e, t) => e in s ? Le(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
- var v = (s, e, t) => ze(s, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as u, Injector as b, ICommandService as m, IPermissionService as he, IAuthzIoService as Pe, LocaleService as xe, generateRandomId as Ne, Rectangle as T, RANGE_TYPE as _, HorizontalAlign as E, VerticalAlign as y, isFormulaString as Ge, isCellV as $e, isICellData as qe, ObjectMatrix as W, Tools as Ke, TextStyleValue as ge, RichTextValue as p, BooleanNumber as g, WrapStrategy as Y, Dimension as me, ILogService as Te, Direction as M, IResourceLoaderService as Ye, IUniverInstanceService as J, mergeWorksheetSnapshotWithDefault as Je, UndoCommand as Qe, RedoCommand as Xe, toDisposable as De, UniverInstanceType as R, CanceledError as Ze } from "@univerjs/core";
5
- import { FBase as de, FBaseInitialable as ce, FUniver as Me, FEnum as et, FEventName as tt } from "@univerjs/core/facade";
6
- import { WorksheetProtectionRuleModel as Ae, RangeProtectionRuleModel as Be, WorksheetProtectionPointModel as We, SetDefinedNameCommand as Q, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as X, RemoveDefinedNameCommand as nt, PermissionPointsDefinitions as rt, WorkbookEditablePermission as Fe, UnitObject as U, AddWorksheetProtectionMutation as st, DeleteWorksheetProtectionMutation as ot, getAllWorksheetPermissionPoint as it, getAllWorksheetPermissionPointByPointPanel as le, SetWorksheetPermissionPointsMutation as at, AddRangeProtectionMutation as ht, DeleteRangeProtectionMutation as dt, SetRangeProtectionMutation as ct, WorksheetEditPermission as ut, WorksheetViewPermission as gt, SetBorderBasicCommand as mt, SetStyleCommand as f, SetRangeValuesCommand as P, SetTextWrapCommand as Z, SetVerticalTextAlignCommand as lt, SetHorizontalTextAlignCommand as _t, addMergeCellsUtil as z, getAddMergeMutationRangeByType as _e, RemoveWorksheetMergeCommand as kt, SplitTextToColumnsCommand as St, SetWorksheetRangeThemeStyleCommand as wt, DeleteWorksheetRangeThemeStyleCommand as Ct, SheetRangeThemeService as He, getPrimaryForRange as ee, SetSelectionsOperation as Ve, getNextPrimaryCell as ft, SheetsSelectionsService as je, SetWorksheetDefaultStyleMutation as vt, SetColDataCommand as ke, SetRowDataCommand as Se, copyRangeStyles as A, InsertRowByRangeCommand as we, RemoveRowByRangeCommand as It, MoveRowsCommand as Rt, SetRowHiddenCommand as Ce, SetSpecificRowsVisibleCommand as fe, SetWorksheetRowIsAutoHeightMutation as bt, SetRowHeightCommand as ve, SetWorksheetRowIsAutoHeightCommand as Ie, InsertColByRangeCommand as Re, RemoveColByRangeCommand as pt, MoveColsCommand as Et, SetColHiddenCommand as be, SetSpecificColsVisibleCommand as pe, SetColWidthCommand as yt, SetFrozenCommand as G, CancelFrozenCommand as Ut, ToggleGridlinesCommand as te, SetGridlinesColorCommand as ne, SetTabColorCommand as re, SetRangeValuesMutation as Ee, SetWorksheetHideCommand as se, SetWorksheetShowCommand as Pt, SetWorksheetNameCommand as oe, ClearSelectionAllCommand as xt, ClearSelectionContentCommand as Nt, ClearSelectionFormatCommand as Tt, InsertSheetCommand as x, SetWorksheetActiveOperation as N, RemoveSheetCommand as ie, CopySheetCommand as Dt, SetWorksheetOrderCommand as ae, RegisterWorksheetRangeThemeStyleCommand as Mt, UnregisterWorksheetRangeThemeStyleCommand as At, RangeThemeStyle as Bt, COMMAND_LISTENER_VALUE_CHANGE as Wt, getValueChangedEffectedRange as Ft, SheetValueChangeType as Ht, SheetSkeletonChangeType as Vt } from "@univerjs/sheets";
7
- import { IDefinedNamesService as Oe, serializeRange as ue, FormulaDataModel as jt, serializeRangeWithSheet as Ot, deserializeRangeWithSheet as Lt } from "@univerjs/engine-formula";
8
- var zt = Object.getOwnPropertyDescriptor, Gt = (s, e, t, n) => {
9
- for (var r = n > 1 ? void 0 : n ? zt(e, t) : e, o = s.length - 1, i; o >= 0; o--)
1
+ var ze = Object.defineProperty;
2
+ var Ge = (s, e, t) => e in s ? ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
3
+ var I = (s, e, t) => Ge(s, typeof e != "symbol" ? e + "" : e, t);
4
+ import { Inject as u, Injector as p, ICommandService as m, IPermissionService as ie, IAuthzIoService as xe, LocaleService as Ne, generateRandomId as Te, Rectangle as D, RANGE_TYPE as _, HorizontalAlign as y, VerticalAlign as U, isFormulaString as $e, isCellV as qe, isICellData as Ke, ObjectMatrix as F, Tools as Ye, TextStyleValue as ce, RichTextValue as E, BooleanNumber as g, WrapStrategy as J, Dimension as ue, ILogService as De, Direction as A, IResourceLoaderService as Je, IUniverInstanceService as Q, mergeWorksheetSnapshotWithDefault as Qe, UndoCommand as Xe, RedoCommand as Ze, toDisposable as Me, UniverInstanceType as b, CanceledError as w } from "@univerjs/core";
5
+ import { FBase as ae, FBaseInitialable as he, FUniver as Ae, FEnum as et, FEventName as tt } from "@univerjs/core/facade";
6
+ import { WorksheetProtectionRuleModel as We, RangeProtectionRuleModel as Be, WorksheetProtectionPointModel as Fe, SetDefinedNameCommand as X, SCOPE_WORKBOOK_VALUE_DEFINED_NAME as Z, RemoveDefinedNameCommand as nt, PermissionPointsDefinitions as rt, WorkbookEditablePermission as He, UnitObject as P, AddWorksheetProtectionMutation as st, DeleteWorksheetProtectionMutation as ot, getAllWorksheetPermissionPoint as it, getAllWorksheetPermissionPointByPointPanel as ge, SetWorksheetPermissionPointsMutation as at, AddRangeProtectionMutation as ht, DeleteRangeProtectionMutation as dt, SetRangeProtectionMutation as ct, WorksheetEditPermission as ut, WorksheetViewPermission as gt, SetBorderBasicCommand as mt, SetStyleCommand as f, SetRangeValuesCommand as x, SetTextWrapCommand as ee, SetVerticalTextAlignCommand as lt, SetHorizontalTextAlignCommand as _t, addMergeCellsUtil as G, getAddMergeMutationRangeByType as me, RemoveWorksheetMergeCommand as kt, SplitTextToColumnsCommand as wt, SetWorksheetRangeThemeStyleCommand as St, DeleteWorksheetRangeThemeStyleCommand as Ct, SheetRangeThemeService as Oe, getPrimaryForRange as te, SetSelectionsOperation as Ve, getNextPrimaryCell as vt, SheetsSelectionsService as je, SetWorksheetDefaultStyleMutation as ft, SetColDataCommand as le, SetRowDataCommand as _e, copyRangeStyles as W, InsertRowByRangeCommand as ke, RemoveRowByRangeCommand as It, MoveRowsCommand as Rt, SetRowHiddenCommand as we, SetSpecificRowsVisibleCommand as Se, SetWorksheetRowIsAutoHeightMutation as bt, SetRowHeightCommand as Ce, SetWorksheetRowIsAutoHeightCommand as ve, InsertColByRangeCommand as fe, RemoveColByRangeCommand as pt, MoveColsCommand as Et, SetColHiddenCommand as Ie, SetSpecificColsVisibleCommand as Re, SetColWidthCommand as yt, SetFrozenCommand as $, CancelFrozenCommand as Ut, ToggleGridlinesCommand as ne, SetGridlinesColorCommand as re, SetTabColorCommand as Pt, SetRangeValuesMutation as be, SetWorksheetHideCommand as xt, SetWorksheetShowCommand as Nt, SetWorksheetNameCommand as se, ClearSelectionAllCommand as Tt, ClearSelectionContentCommand as Dt, ClearSelectionFormatCommand as Mt, InsertSheetCommand as N, SetWorksheetActiveOperation as T, RemoveSheetCommand as oe, CopySheetCommand as At, SetWorksheetOrderCommand as Wt, RegisterWorksheetRangeThemeStyleCommand as Bt, UnregisterWorksheetRangeThemeStyleCommand as Ft, RangeThemeStyle as Ht, SetWorksheetOrderMutation as pe, SetTabColorMutation as Ee, SetWorksheetHideMutation as ye, COMMAND_LISTENER_VALUE_CHANGE as Ot, getValueChangedEffectedRange as Vt, SheetValueChangeType as jt, SheetSkeletonChangeType as Lt, SplitDelimiterEnum as zt } from "@univerjs/sheets";
7
+ import { IDefinedNamesService as Le, serializeRange as de, FormulaDataModel as Gt, serializeRangeWithSheet as $t, deserializeRangeWithSheet as qt } from "@univerjs/engine-formula";
8
+ var Kt = Object.getOwnPropertyDescriptor, Yt = (s, e, t, n) => {
9
+ for (var r = n > 1 ? void 0 : n ? Kt(e, t) : e, o = s.length - 1, i; o >= 0; o--)
10
10
  (i = s[o]) && (r = i(r) || r);
11
11
  return r;
12
12
  }, S = (s, e) => (t, n) => e(t, n, s);
13
- function $t(s, e, t) {
13
+ function Jt(s, e, t) {
14
14
  const n = t.getDefinedNameMap(s);
15
15
  if (n == null)
16
16
  return e.t("definedName.defaultName") + 1;
@@ -25,11 +25,11 @@ function $t(s, e, t) {
25
25
  a++;
26
26
  }
27
27
  }
28
- class O {
28
+ class L {
29
29
  constructor() {
30
- v(this, "_definedNameParam");
30
+ I(this, "_definedNameParam");
31
31
  this._definedNameParam = {
32
- id: Ne(10),
32
+ id: Te(10),
33
33
  unitId: "",
34
34
  name: "",
35
35
  formulaOrRefString: ""
@@ -38,7 +38,7 @@ class O {
38
38
  /**
39
39
  * Sets the name of the defined name builder.
40
40
  * @param {string} name The name of the defined name.
41
- * @returns {FDefinedNameBuilder} The defined name builder.
41
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
42
42
  * @example
43
43
  * ```ts
44
44
  * const workbook = univerAPI.getActiveWorkbook();
@@ -54,7 +54,7 @@ class O {
54
54
  /**
55
55
  * Sets the formula of the defined name builder.
56
56
  * @param {string }formula The formula of the defined name.
57
- * @returns {FDefinedNameBuilder} The defined name builder.
57
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
58
58
  * @example
59
59
  * ```ts
60
60
  * const workbook = univerAPI.getActiveWorkbook();
@@ -71,7 +71,7 @@ class O {
71
71
  /**
72
72
  * Sets the reference of the defined name builder.
73
73
  * @param {string} a1Notation The reference of the defined name.
74
- * @returns {FDefinedNameBuilder} The defined name builder.
74
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
75
75
  * @example
76
76
  * ```ts
77
77
  * const workbook = univerAPI.getActiveWorkbook();
@@ -90,7 +90,7 @@ class O {
90
90
  * @param {number} column The start column of the range.
91
91
  * @param {number} numRows The number of rows in the range.
92
92
  * @param {number} numColumns The number of columns in the range.
93
- * @returns {FDefinedNameBuilder} The defined name builder.
93
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
94
94
  * @example
95
95
  * ```ts
96
96
  * const workbook = univerAPI.getActiveWorkbook();
@@ -101,7 +101,7 @@ class O {
101
101
  * ```
102
102
  */
103
103
  setRefByRange(e, t, n, r) {
104
- return this._definedNameParam.formulaOrRefString = ue({
104
+ return this._definedNameParam.formulaOrRefString = de({
105
105
  startRow: e,
106
106
  endRow: e + (n != null ? n : 1) - 1,
107
107
  startColumn: t,
@@ -111,7 +111,7 @@ class O {
111
111
  /**
112
112
  * Sets the comment of the defined name builder.
113
113
  * @param {string} comment The comment of the defined name.
114
- * @returns {FDefinedNameBuilder} The defined name builder.
114
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
115
115
  * @example
116
116
  * ```ts
117
117
  * const workbook = univerAPI.getActiveWorkbook();
@@ -127,7 +127,7 @@ class O {
127
127
  /**
128
128
  * Sets the hidden status of the defined name builder.
129
129
  * @param {boolean} hidden The hidden status of the defined name.
130
- * @returns {FDefinedNameBuilder} The defined name builder.
130
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
131
131
  * @example
132
132
  * ```ts
133
133
  * const workbook = univerAPI.getActiveWorkbook();
@@ -141,14 +141,15 @@ class O {
141
141
  return this._definedNameParam.hidden = e, this;
142
142
  }
143
143
  /**
144
- * Builds the defined name.
145
- * @returns {FDefinedNameBuilder} The defined name mutation parameter.
144
+ * Builds the defined name parameter.
145
+ * @returns {ISetDefinedNameMutationParam} The defined name mutation parameter.
146
146
  * @example
147
147
  * ```ts
148
148
  * const workbook = univerAPI.getActiveWorkbook();
149
149
  * const definedNameBuilder = univerAPI.newDefinedName()
150
150
  * .setRef('Sheet1!$A$1')
151
151
  * .setName('MyDefinedName')
152
+ * .setComment('This is a comment')
152
153
  * .build();
153
154
  * workbook.insertDefinedNameBuilder(definedNameBuilder);
154
155
  * ```
@@ -156,16 +157,35 @@ class O {
156
157
  build() {
157
158
  return this._definedNameParam;
158
159
  }
160
+ /**
161
+ * Loads the defined name mutation parameter.
162
+ * @param {ISetDefinedNameMutationParam} param - defined name mutation parameter
163
+ * @returns {FDefinedNameBuilder} The instance of `FDefinedNameBuilder` for method chaining.
164
+ * @example
165
+ * ```ts
166
+ * const workbook = univerAPI.getActiveWorkbook();
167
+ * const definedNameParam = {
168
+ * id: '4TMPceoqg8',
169
+ * unitId: workbook.getId(),
170
+ * name: 'MyDefinedName',
171
+ * formulaOrRefString: 'Sheet1!$A$1',
172
+ * }
173
+ * const definedNameBuilder = univerAPI.newDefinedName()
174
+ * .load(definedNameParam)
175
+ * .build();
176
+ * workbook.insertDefinedNameBuilder(definedNameBuilder);
177
+ * ```
178
+ */
159
179
  load(e) {
160
180
  return this._definedNameParam = e, this;
161
181
  }
162
182
  }
163
- let F = class extends de {
183
+ let H = class extends ae {
164
184
  constructor(s, e, t, n, r, o, i, a, h, d) {
165
185
  super(), this._definedNameParam = s, this._injector = e, this._commandService = t, this._permissionService = n, this._worksheetProtectionRuleModel = r, this._rangeProtectionRuleModel = o, this._worksheetProtectionPointRuleModel = i, this._authzIoService = a, this._localeService = h, this._definedNamesService = d;
166
186
  }
167
187
  _apply() {
168
- this._definedNameParam.name === "" && (this._definedNameParam.name = $t(this._definedNameParam.unitId, this._localeService, this._definedNamesService)), this._commandService.syncExecuteCommand(Q.id, this._definedNameParam);
188
+ this._definedNameParam.name === "" && (this._definedNameParam.name = Jt(this._definedNameParam.unitId, this._localeService, this._definedNamesService)), this._commandService.syncExecuteCommand(X.id, this._definedNameParam);
169
189
  }
170
190
  /**
171
191
  * Gets the name of the defined name.
@@ -173,8 +193,8 @@ let F = class extends de {
173
193
  * @example
174
194
  * ```ts
175
195
  * const workbook = univerAPI.getActiveWorkbook();
176
- * const definedName = workbook.getDefinedNames[0];
177
- * console.log(definedName.getName());
196
+ * const definedName = workbook.getDefinedNames()[0];
197
+ * console.log(definedName?.getName());
178
198
  * ```
179
199
  */
180
200
  getName() {
@@ -186,8 +206,8 @@ let F = class extends de {
186
206
  * @example
187
207
  * ```ts
188
208
  * const workbook = univerAPI.getActiveWorkbook();
189
- * const definedName = workbook.getDefinedName('MyDefinedName');
190
- * definedName.setName('NewDefinedName');
209
+ * const definedName = workbook.getDefinedNames()[0];
210
+ * definedName?.setName('NewDefinedName');
191
211
  * ```
192
212
  */
193
213
  setName(s) {
@@ -199,8 +219,8 @@ let F = class extends de {
199
219
  * @example
200
220
  * ```ts
201
221
  * const workbook = univerAPI.getActiveWorkbook();
202
- * const definedName = workbook.getDefinedName('MyDefinedName');
203
- * definedName.setFormula('SUM(Sheet1!$A$1)');
222
+ * const definedName = workbook.getDefinedNames()[0];
223
+ * definedName?.setFormula('SUM(Sheet1!$A$1)');
204
224
  * ```
205
225
  */
206
226
  setFormula(s) {
@@ -212,21 +232,21 @@ let F = class extends de {
212
232
  * @example
213
233
  * ```ts
214
234
  * const workbook = univerAPI.getActiveWorkbook();
215
- * const definedName = workbook.getDefinedNames[0];
216
- * definedName.setRef('Sheet1!$A$1');
235
+ * const definedName = workbook.getDefinedNames()[0];
236
+ * definedName?.setRef('Sheet1!$A$1');
217
237
  * ```
218
238
  */
219
239
  setRef(s) {
220
240
  this._definedNameParam.formulaOrRefString = s, this._apply();
221
241
  }
222
242
  /**
223
- * Gets the reference of the defined name.
224
- * @returns {string} The reference of the defined name.
243
+ * Gets the formula or reference string of the defined name.
244
+ * @returns {string} The formula or reference string of the defined name.
225
245
  * @example
226
246
  * ```ts
227
247
  * const workbook = univerAPI.getActiveWorkbook();
228
- * const definedName = workbook.getDefinedNames[0];
229
- * console.log(definedName.getFormulaOrRefString());
248
+ * const definedName = workbook.getDefinedNames()[0];
249
+ * console.log(definedName?.getFormulaOrRefString());
230
250
  * ```
231
251
  */
232
252
  getFormulaOrRefString() {
@@ -241,12 +261,12 @@ let F = class extends de {
241
261
  * @example
242
262
  * ```ts
243
263
  * const workbook = univerAPI.getActiveWorkbook();
244
- * const definedName = workbook.getDefinedNames[0];
245
- * definedName.setRefByRange(1, 3, 2, 5);
264
+ * const definedName = workbook.getDefinedNames()[0];
265
+ * definedName?.setRefByRange(1, 3, 2, 5);
246
266
  * ```
247
267
  */
248
268
  setRefByRange(s, e, t, n) {
249
- this._definedNameParam.formulaOrRefString = ue({
269
+ this._definedNameParam.formulaOrRefString = de({
250
270
  startRow: s,
251
271
  endRow: s + (t != null ? t : 1) - 1,
252
272
  startColumn: e,
@@ -259,8 +279,8 @@ let F = class extends de {
259
279
  * @example
260
280
  * ```ts
261
281
  * const workbook = univerAPI.getActiveWorkbook();
262
- * const definedName = workbook.getDefinedNames[0];
263
- * console.log(definedName.getComment());
282
+ * const definedName = workbook.getDefinedNames()[0];
283
+ * console.log(definedName?.getComment());
264
284
  * ```
265
285
  */
266
286
  getComment() {
@@ -272,8 +292,8 @@ let F = class extends de {
272
292
  * @example
273
293
  * ```ts
274
294
  * const workbook = univerAPI.getActiveWorkbook();
275
- * const definedName = workbook.getDefinedNames[0];
276
- * definedName.setComment('This is a comment');
295
+ * const definedName = workbook.getDefinedNames()[0];
296
+ * definedName?.setComment('This is a comment');
277
297
  * ```
278
298
  */
279
299
  setComment(s) {
@@ -285,9 +305,9 @@ let F = class extends de {
285
305
  * @example
286
306
  * ```ts
287
307
  * const workbook = univerAPI.getActiveWorkbook();
288
- * const worksheet = workbook.getWorksheets[0];
289
- * const definedName = workbook.getDefinedNames[0];
290
- * definedName.setScopeToWorksheet(worksheet);
308
+ * const worksheet = workbook.getSheets()[0];
309
+ * const definedName = workbook.getDefinedNames()[0];
310
+ * definedName?.setScopeToWorksheet(worksheet);
291
311
  * ```
292
312
  */
293
313
  setScopeToWorksheet(s) {
@@ -298,12 +318,12 @@ let F = class extends de {
298
318
  * @example
299
319
  * ```ts
300
320
  * const workbook = univerAPI.getActiveWorkbook();
301
- * const definedName = workbook.getDefinedNames[0];
302
- * definedName.setScopeToWorkbook();
321
+ * const definedName = workbook.getDefinedNames()[0];
322
+ * definedName?.setScopeToWorkbook();
303
323
  * ```
304
324
  */
305
325
  setScopeToWorkbook() {
306
- this._definedNameParam.localSheetId = X, this._apply();
326
+ this._definedNameParam.localSheetId = Z, this._apply();
307
327
  }
308
328
  /**
309
329
  * Sets the hidden status of the defined name.
@@ -311,8 +331,8 @@ let F = class extends de {
311
331
  * @example
312
332
  * ```ts
313
333
  * const workbook = univerAPI.getActiveWorkbook();
314
- * const definedName = workbook.getDefinedNames[0];
315
- * definedName.setHidden(true);
334
+ * const definedName = workbook.getDefinedNames()[0];
335
+ * definedName?.setHidden(true);
316
336
  * ```
317
337
  */
318
338
  setHidden(s) {
@@ -323,8 +343,8 @@ let F = class extends de {
323
343
  * @example
324
344
  * ```ts
325
345
  * const workbook = univerAPI.getActiveWorkbook();
326
- * const definedName = workbook.getDefinedNames[0];
327
- * definedName.delete();
346
+ * const definedName = workbook.getDefinedNames()[0];
347
+ * definedName?.delete();
328
348
  * ```
329
349
  */
330
350
  delete() {
@@ -336,8 +356,8 @@ let F = class extends de {
336
356
  * @example
337
357
  * ```ts
338
358
  * const workbook = univerAPI.getActiveWorkbook();
339
- * const definedName = workbook.getDefinedNames[0];
340
- * console.log(definedName.getLocalSheetId());
359
+ * const definedName = workbook.getDefinedNames()[0];
360
+ * console.log(definedName?.getLocalSheetId());
341
361
  * ```
342
362
  */
343
363
  getLocalSheetId() {
@@ -349,12 +369,12 @@ let F = class extends de {
349
369
  * @example
350
370
  * ```ts
351
371
  * const workbook = univerAPI.getActiveWorkbook();
352
- * const definedName = workbook.getDefinedNames[0];
353
- * console.log(definedName.isWorkbookScope());
372
+ * const definedName = workbook.getDefinedNames()[0];
373
+ * console.log(definedName?.isWorkbookScope());
354
374
  * ```
355
375
  */
356
376
  isWorkbookScope() {
357
- return this._definedNameParam.localSheetId === X;
377
+ return this._definedNameParam.localSheetId === Z;
358
378
  }
359
379
  /**
360
380
  * Converts the defined name to a defined name builder.
@@ -362,48 +382,52 @@ let F = class extends de {
362
382
  * @example
363
383
  * ```ts
364
384
  * const workbook = univerAPI.getActiveWorkbook();
365
- * const definedName = workbook.getDefinedNames[0];
366
- * const definedNameBuilder = definedName.toBuilder();
367
- * const param definedNameBuilder.setName('NewDefinedName').setFormula('SUM(Sheet1!$A$1)').build();
368
- * workbook.updateDefinedNameBuilder(param);
385
+ * const definedName = workbook.getDefinedNames()[0];
386
+ * if (!definedName) return;
387
+ * const definedNameBuilder = definedName
388
+ * .toBuilder()
389
+ * .setName('NewDefinedName')
390
+ * .setFormula('SUM(Sheet1!$A$1)')
391
+ * .build();
392
+ * workbook.updateDefinedNameBuilder(definedNameBuilder);
369
393
  * ```
370
394
  */
371
395
  toBuilder() {
372
- const s = this._injector.createInstance(O);
396
+ const s = this._injector.createInstance(L);
373
397
  return s.load(this._definedNameParam), s;
374
398
  }
375
399
  };
376
- F = Gt([
377
- S(1, u(b)),
400
+ H = Yt([
401
+ S(1, u(p)),
378
402
  S(2, m),
379
- S(3, he),
380
- S(4, u(Ae)),
403
+ S(3, ie),
404
+ S(4, u(We)),
381
405
  S(5, u(Be)),
382
- S(6, u(We)),
383
- S(7, u(Pe)),
384
- S(8, u(xe)),
385
- S(9, Oe)
386
- ], F);
387
- var qt = Object.getOwnPropertyDescriptor, Kt = (s, e, t, n) => {
388
- for (var r = n > 1 ? void 0 : n ? qt(e, t) : e, o = s.length - 1, i; o >= 0; o--)
406
+ S(6, u(Fe)),
407
+ S(7, u(xe)),
408
+ S(8, u(Ne)),
409
+ S(9, Le)
410
+ ], H);
411
+ var Qt = Object.getOwnPropertyDescriptor, Xt = (s, e, t, n) => {
412
+ for (var r = n > 1 ? void 0 : n ? Qt(e, t) : e, o = s.length - 1, i; o >= 0; o--)
389
413
  (i = s[o]) && (r = i(r) || r);
390
414
  return r;
391
- }, I = (s, e) => (t, n) => e(t, n, s);
392
- let H = class extends de {
415
+ }, R = (s, e) => (t, n) => e(t, n, s);
416
+ let O = class extends ae {
393
417
  constructor(e, t, n, r, o, i, a) {
394
418
  super();
395
419
  /**
396
420
  * Permission point definition, can read the point constructor want to modify from here
397
421
  */
398
- v(this, "permissionPointsDefinition", rt);
422
+ I(this, "permissionPointsDefinition", rt);
399
423
  /**
400
424
  * An observable object used to monitor permission change events within a range, thereby triggering corresponding subsequent processing.
401
425
  */
402
- v(this, "rangeRuleChangedAfterAuth$");
426
+ I(this, "rangeRuleChangedAfterAuth$");
403
427
  /**
404
428
  * An observable object used to monitor permission change events within a worksheet, thereby triggering corresponding subsequent processing.
405
429
  */
406
- v(this, "sheetRuleChangedAfterAuth$");
430
+ I(this, "sheetRuleChangedAfterAuth$");
407
431
  this._injector = e, this._commandService = t, this._permissionService = n, this._worksheetProtectionRuleModel = r, this._rangeProtectionRuleModel = o, this._worksheetProtectionPointRuleModel = i, this._authzIoService = a, this.rangeRuleChangedAfterAuth$ = this._rangeProtectionRuleModel.ruleRefresh$, this.sheetRuleChangedAfterAuth$ = this._worksheetProtectionRuleModel.ruleRefresh$;
408
432
  }
409
433
  /**
@@ -440,7 +464,7 @@ let H = class extends de {
440
464
  * ```
441
465
  */
442
466
  setWorkbookEditPermission(e, t) {
443
- this.setWorkbookPermissionPoint(e, Fe, t);
467
+ this.setWorkbookPermissionPoint(e, He, t);
444
468
  }
445
469
  /**
446
470
  * This function is used to add a base permission for a worksheet.
@@ -468,7 +492,7 @@ let H = class extends de {
468
492
  if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length > 0)
469
493
  throw new Error("sheet protection cannot intersect with range protection");
470
494
  const r = await this._authzIoService.create({
471
- objectType: U.Worksheet,
495
+ objectType: P.Worksheet,
472
496
  worksheetObject: {
473
497
  collaborators: [],
474
498
  unitID: e,
@@ -482,7 +506,7 @@ let H = class extends de {
482
506
  subUnitId: t,
483
507
  rule: {
484
508
  permissionId: r,
485
- unitType: U.Worksheet,
509
+ unitType: P.Worksheet,
486
510
  unitId: e,
487
511
  subUnitId: t
488
512
  }
@@ -508,7 +532,7 @@ let H = class extends de {
508
532
  this._commandService.syncExecuteCommand(ot.id, {
509
533
  unitId: e,
510
534
  subUnitId: t
511
- }), [...it(), ...le()].forEach((n) => {
535
+ }), [...it(), ...ge()].forEach((n) => {
512
536
  const r = new n(e, t);
513
537
  this._permissionService.updatePermissionPoint(r.id, !0);
514
538
  }), this._worksheetProtectionPointRuleModel.deleteRule(e, t);
@@ -533,6 +557,7 @@ let H = class extends de {
533
557
  * const permissionId = await permission.addWorksheetBasePermission(unitId, subUnitId)
534
558
  * // After this line of code , the worksheet will no longer be editable
535
559
  * permission.setWorksheetPermissionPoint(unitId, subUnitId, permission.permissionPointsDefinition.WorksheetEditPermission, false);
560
+ * ```
536
561
  */
537
562
  async setWorksheetPermissionPoint(e, t, n, r) {
538
563
  const o = this._worksheetProtectionRuleModel.getRule(e, t);
@@ -548,7 +573,7 @@ let H = class extends de {
548
573
  else {
549
574
  const c = this._worksheetProtectionPointRuleModel.getRule(e, t);
550
575
  c ? i = c.permissionId : (i = await this._authzIoService.create({
551
- objectType: U.Worksheet,
576
+ objectType: P.Worksheet,
552
577
  worksheetObject: {
553
578
  collaborators: [],
554
579
  unitID: e,
@@ -572,12 +597,12 @@ let H = class extends de {
572
597
  *
573
598
  * @example
574
599
  * ```typescript
575
- *const workbook = univerAPI.getActiveWorkbook();
600
+ * const workbook = univerAPI.getActiveWorkbook();
576
601
  * const permission = workbook.getPermission();
577
602
  * const unitId = workbook.getId();
578
603
  * const worksheet = workbook.getActiveSheet();
579
604
  * const subUnitId = worksheet.getSheetId();
580
- * const range = worksheet.getRange(0,0,2,2);
605
+ * const range = worksheet.getRange('A1:B2');
581
606
  * const ranges = [];
582
607
  * ranges.push(range);
583
608
  * // Note that there will be no permission changes after this step is completed. It only returns an ID for subsequent permission changes.
@@ -589,24 +614,24 @@ let H = class extends de {
589
614
  */
590
615
  async addRangeBaseProtection(e, t, n) {
591
616
  const r = await this._authzIoService.create({
592
- objectType: U.SelectRange,
617
+ objectType: P.SelectRange,
593
618
  selectRangeObject: {
594
619
  collaborators: [],
595
620
  unitID: e,
596
621
  name: "",
597
622
  scope: void 0
598
623
  }
599
- }), o = `ruleId_${Ne(6)}`;
624
+ }), o = `ruleId_${Te(6)}`;
600
625
  if (this._worksheetProtectionRuleModel.getRule(e, t))
601
626
  throw new Error("sheet protection cannot intersect with range protection");
602
- if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((c) => c.ranges.some((L) => n.some((D) => T.intersects(D.getRange(), L)))))
627
+ if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).some((c) => c.ranges.some((z) => n.some((M) => D.intersects(M.getRange(), z)))))
603
628
  throw new Error("range protection cannot intersect");
604
629
  if (this._commandService.syncExecuteCommand(ht.id, {
605
630
  unitId: e,
606
631
  subUnitId: t,
607
632
  rules: [{
608
633
  permissionId: r,
609
- unitType: U.SelectRange,
634
+ unitType: P.SelectRange,
610
635
  unitId: e,
611
636
  subUnitId: t,
612
637
  ranges: n.map((c) => c.getRange()),
@@ -631,7 +656,7 @@ let H = class extends de {
631
656
  * const unitId = workbook.getId();
632
657
  * const worksheet = workbook.getActiveSheet();
633
658
  * const subUnitId = worksheet.getSheetId();
634
- * const range = worksheet.getRange(0,0,2,2);
659
+ * const range = worksheet.getRange('A1:B2');
635
660
  * const ranges = [];
636
661
  * ranges.push(range);
637
662
  * const res = await permission.addRangeBaseProtection(unitId, subUnitId, ranges);
@@ -644,7 +669,7 @@ let H = class extends de {
644
669
  unitId: e,
645
670
  subUnitId: t,
646
671
  ruleIds: n
647
- }) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...le()].forEach((i) => {
672
+ }) && this._rangeProtectionRuleModel.getSubunitRuleList(e, t).length === 0 && (this._worksheetProtectionPointRuleModel.deleteRule(e, t), [...ge()].forEach((i) => {
648
673
  const a = new i(e, t);
649
674
  this._permissionService.updatePermissionPoint(a.id, a.value);
650
675
  }));
@@ -665,7 +690,7 @@ let H = class extends de {
665
690
  * const unitId = workbook.getId();
666
691
  * const worksheet = workbook.getActiveSheet();
667
692
  * const subUnitId = worksheet.getSheetId();
668
- * const range = worksheet.getRange(0, 0, 2, 2);
693
+ * const range = worksheet.getRange('A1:B2');
669
694
  * const ranges = [];
670
695
  * ranges.push(range);
671
696
  * // Note that there will be no permission changes after this step is completed. It only returns an ID for subsequent permission changes.
@@ -689,7 +714,7 @@ let H = class extends de {
689
714
  * @param {string} unitId - The unique identifier of the workbook.
690
715
  * @param {string} subUnitId - The unique identifier of the worksheet within the workbook.
691
716
  * @param {string} ruleId - The ruleId of the range protection rule that is being updated.
692
- * @param {IRange[]} ranges - The array of new ranges to be set for the range protection rule.
717
+ * @param {FRange[]} ranges - The array of new ranges to be set for the range protection rule.
693
718
  *
694
719
  * @example
695
720
  * ```typescript
@@ -698,19 +723,19 @@ let H = class extends de {
698
723
  * const unitId = workbook.getId();
699
724
  * const worksheet = workbook.getActiveSheet();
700
725
  * const subUnitId = worksheet.getSheetId();
701
- * const range = worksheet.getRange(0, 0, 2, 2);
726
+ * const range = worksheet.getRange('A1:B2');
702
727
  * const ranges = [];
703
728
  * ranges.push(range);
704
729
  * const res = await permission.addRangeBaseProtection(unitId, subUnitId, ranges);
705
730
  * const {permissionId, ruleId} = res;
706
- * const newRange = worksheet.getRange(3, 3, 2, 2);
731
+ * const newRange = worksheet.getRange('C1:D2');
707
732
  * permission.setRangeProtectionRanges(unitId, subUnitId, ruleId, [newRange]);
708
733
  * ```
709
734
  */
710
735
  setRangeProtectionRanges(e, t, n, r) {
711
736
  const o = this._rangeProtectionRuleModel.getRule(e, t, n);
712
737
  if (o) {
713
- if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== n).some((h) => h.ranges.some((d) => r.some((c) => T.intersects(c.getRange(), d)))))
738
+ if (this._rangeProtectionRuleModel.getSubunitRuleList(e, t).filter((h) => h.id !== n).some((h) => h.ranges.some((d) => r.some((c) => D.intersects(c.getRange(), d)))))
714
739
  throw new Error("range protection cannot intersect");
715
740
  this._commandService.syncExecuteCommand(ct.id, {
716
741
  unitId: e,
@@ -724,87 +749,87 @@ let H = class extends de {
724
749
  }
725
750
  }
726
751
  };
727
- H = Kt([
728
- I(0, u(b)),
729
- I(1, m),
730
- I(2, he),
731
- I(3, u(Ae)),
732
- I(4, u(Be)),
733
- I(5, u(We)),
734
- I(6, u(Pe))
735
- ], H);
736
- function Yt(s) {
752
+ O = Xt([
753
+ R(0, u(p)),
754
+ R(1, m),
755
+ R(2, ie),
756
+ R(3, u(We)),
757
+ R(4, u(Be)),
758
+ R(5, u(Fe)),
759
+ R(6, u(xe))
760
+ ], O);
761
+ function Zt(s) {
737
762
  switch (s) {
738
763
  case "left":
739
- return E.LEFT;
764
+ return y.LEFT;
740
765
  case "center":
741
- return E.CENTER;
766
+ return y.CENTER;
742
767
  case "normal":
743
- return E.RIGHT;
768
+ return y.RIGHT;
744
769
  default:
745
770
  throw new Error(`Invalid horizontal alignment: ${s}`);
746
771
  }
747
772
  }
748
- function Jt(s) {
773
+ function en(s) {
749
774
  switch (s) {
750
- case E.LEFT:
775
+ case y.LEFT:
751
776
  return "left";
752
- case E.CENTER:
777
+ case y.CENTER:
753
778
  return "center";
754
- case E.RIGHT:
779
+ case y.RIGHT:
755
780
  return "normal";
756
781
  default:
757
782
  throw new Error(`Invalid horizontal alignment: ${s}`);
758
783
  }
759
784
  }
760
- function Qt(s) {
785
+ function tn(s) {
761
786
  switch (s) {
762
787
  case "top":
763
- return y.TOP;
788
+ return U.TOP;
764
789
  case "middle":
765
- return y.MIDDLE;
790
+ return U.MIDDLE;
766
791
  case "bottom":
767
- return y.BOTTOM;
792
+ return U.BOTTOM;
768
793
  default:
769
794
  throw new Error(`Invalid vertical alignment: ${s}`);
770
795
  }
771
796
  }
772
- function Xt(s) {
797
+ function nn(s) {
773
798
  switch (s) {
774
- case y.TOP:
799
+ case U.TOP:
775
800
  return "top";
776
- case y.MIDDLE:
801
+ case U.MIDDLE:
777
802
  return "middle";
778
- case y.BOTTOM:
803
+ case U.BOTTOM:
779
804
  return "bottom";
780
805
  default:
781
806
  throw new Error(`Invalid vertical alignment: ${s}`);
782
807
  }
783
808
  }
784
809
  function V(s) {
785
- return Ge(s) ? {
810
+ return $e(s) ? {
786
811
  f: s,
787
812
  v: null,
788
813
  p: null
789
- } : $e(s) ? {
814
+ } : qe(s) ? {
790
815
  v: s,
791
816
  p: null,
792
817
  f: null
793
- } : (qe(s), s);
818
+ } : (Ke(s), s);
794
819
  }
795
- function ye(s, e) {
796
- const t = new W(), { startRow: n, startColumn: r, endRow: o, endColumn: i } = e;
797
- if (Ke.isArray(s))
820
+ function Ue(s, e) {
821
+ const t = new F(), { startRow: n, startColumn: r, endRow: o, endColumn: i } = e;
822
+ if (Ye.isArray(s))
798
823
  for (let a = 0; a <= o - n; a++)
799
824
  for (let h = 0; h <= i - r; h++)
800
825
  t.setValue(a + n, h + r, V(s[a][h]));
801
826
  else
802
- new W(s).forValue((h, d, c) => {
827
+ new F(s).forValue((h, d, c) => {
803
828
  t.setValue(h, d, V(c));
804
829
  });
805
830
  return t.getMatrix();
806
831
  }
807
- function $(s, e) {
832
+ function q(s, e) {
808
833
  return {
809
834
  startRow: s.startRow,
810
835
  endRow: s.endRow,
@@ -813,7 +838,7 @@ function $(s, e) {
813
838
  rangeType: _.ROW
814
839
  };
815
840
  }
816
- function q(s, e) {
841
+ function K(s, e) {
817
842
  return {
818
843
  startRow: 0,
819
844
  endRow: e.getRowCount() - 1,
@@ -822,12 +847,12 @@ function q(s, e) {
822
847
  rangeType: _.COLUMN
823
848
  };
824
849
  }
825
- var Zt = Object.getOwnPropertyDescriptor, en = (s, e, t, n) => {
826
- for (var r = n > 1 ? void 0 : n ? Zt(e, t) : e, o = s.length - 1, i; o >= 0; o--)
850
+ var rn = Object.getOwnPropertyDescriptor, sn = (s, e, t, n) => {
851
+ for (var r = n > 1 ? void 0 : n ? rn(e, t) : e, o = s.length - 1, i; o >= 0; o--)
827
852
  (i = s[o]) && (r = i(r) || r);
828
853
  return r;
829
- }, K = (s, e) => (t, n) => e(t, n, s);
830
- let k = class extends ce {
854
+ }, Y = (s, e) => (t, n) => e(t, n, s);
855
+ let k = class extends he {
831
856
  constructor(s, e, t, n, r, o) {
832
857
  super(n), this._workbook = s, this._worksheet = e, this._range = t, this._injector = n, this._commandService = r, this._formulaDataModel = o;
833
858
  }
@@ -836,10 +861,10 @@ let k = class extends ce {
836
861
  * @returns {string} The unit ID of the workbook
837
862
  * @example
838
863
  * ```ts
839
- * univerAPI.getActiveWorkbook()
840
- * .getActiveSheet()
841
- * .getActiveRange()
842
- * .getUnitId()
864
+ * const fWorkbook = univerAPI.getActiveWorkbook();
865
+ * const fWorksheet = fWorkbook.getActiveSheet();
866
+ * const fRange = fWorksheet.getRange('A1:B2');
867
+ * console.log(fRange.getUnitId());
843
868
  * ```
844
869
  */
845
870
  getUnitId() {
@@ -850,10 +875,10 @@ let k = class extends ce {
850
875
  * @returns {string} The name of the worksheet
851
876
  * @example
852
877
  * ```ts
853
- * univerAPI.getActiveWorkbook()
854
- * .getActiveSheet()
855
- * .getActiveRange()
856
- * .getSheetName()
878
+ * const fWorkbook = univerAPI.getActiveWorkbook();
879
+ * const fWorksheet = fWorkbook.getActiveSheet();
880
+ * const fRange = fWorksheet.getRange('A1:B2');
881
+ * console.log(fRange.getSheetName());
857
882
  * ```
858
883
  */
859
884
  getSheetName() {
@@ -864,10 +889,10 @@ let k = class extends ce {
864
889
  * @returns {string} The ID of the worksheet
865
890
  * @example
866
891
  * ```ts
867
- * univerAPI.getActiveWorkbook()
868
- * .getActiveSheet()
869
- * .getActiveRange()
870
- * .getSheetId()
892
+ * const fWorkbook = univerAPI.getActiveWorkbook();
893
+ * const fWorksheet = fWorkbook.getActiveSheet();
894
+ * const fRange = fWorksheet.getRange('A1:B2');
895
+ * console.log(fRange.getSheetId());
871
896
  * ```
872
897
  */
873
898
  getSheetId() {
@@ -878,10 +903,12 @@ let k = class extends ce {
878
903
  * @returns {IRange} The area where the statement is applied
879
904
  * @example
880
905
  * ```ts
881
- * univerAPI.getActiveWorkbook()
882
- * .getActiveSheet()
883
- * .getActiveRange()
884
- * .getRange()
906
+ * const fWorkbook = univerAPI.getActiveWorkbook();
907
+ * const fWorksheet = fWorkbook.getActiveSheet();
908
+ * const fRange = fWorksheet.getRange('A1:B2');
909
+ * const range = fRange.getRange();
910
+ * const { startRow, startColumn, endRow, endColumn } = range;
911
+ * console.log(range);
885
912
  * ```
886
913
  */
887
914
  getRange() {
@@ -892,10 +919,10 @@ let k = class extends ce {
892
919
  * @returns {number} The starting row number of the area
893
920
  * @example
894
921
  * ```ts
895
- * univerAPI.getActiveWorkbook()
896
- * .getActiveSheet()
897
- * .getActiveRange()
898
- * .getRow()
922
+ * const fWorkbook = univerAPI.getActiveWorkbook();
923
+ * const fWorksheet = fWorkbook.getActiveSheet();
924
+ * const fRange = fWorksheet.getRange('A1:B2');
925
+ * console.log(fRange.getRow());
899
926
  * ```
900
927
  */
901
928
  getRow() {
@@ -906,10 +933,10 @@ let k = class extends ce {
906
933
  * @returns {number} The starting column number of the area
907
934
  * @example
908
935
  * ```ts
909
- * univerAPI.getActiveWorkbook()
910
- * .getActiveSheet()
911
- * .getActiveRange()
912
- * .getColumn()
936
+ * const fWorkbook = univerAPI.getActiveWorkbook();
937
+ * const fWorksheet = fWorkbook.getActiveSheet();
938
+ * const fRange = fWorksheet.getRange('A1:B2');
939
+ * console.log(fRange.getColumn());
913
940
  * ```
914
941
  */
915
942
  getColumn() {
@@ -920,10 +947,10 @@ let k = class extends ce {
920
947
  * @returns {number} The width of the area
921
948
  * @example
922
949
  * ```ts
923
- * univerAPI.getActiveWorkbook()
924
- * .getActiveSheet()
925
- * .getActiveRange()
926
- * .getWidth()
950
+ * const fWorkbook = univerAPI.getActiveWorkbook();
951
+ * const fWorksheet = fWorkbook.getActiveSheet();
952
+ * const fRange = fWorksheet.getRange('A1:B2');
953
+ * console.log(fRange.getWidth());
927
954
  * ```
928
955
  */
929
956
  getWidth() {
@@ -934,10 +961,10 @@ let k = class extends ce {
934
961
  * @returns {number} The height of the area
935
962
  * @example
936
963
  * ```ts
937
- * univerAPI.getActiveWorkbook()
938
- * .getActiveSheet()
939
- * .getActiveRange()
940
- * .getHeight()
964
+ * const fWorkbook = univerAPI.getActiveWorkbook();
965
+ * const fWorksheet = fWorkbook.getActiveSheet();
966
+ * const fRange = fWorksheet.getRange('A1:B2');
967
+ * console.log(fRange.getHeight());
941
968
  * ```
942
969
  */
943
970
  getHeight() {
@@ -948,25 +975,28 @@ let k = class extends ce {
948
975
  * @returns {boolean} if true is merged
949
976
  * @example
950
977
  * ```ts
951
- * univerAPI.getActiveWorkbook()
952
- * .getActiveSheet()
953
- * .getActiveRange()
954
- * .isMerged()
978
+ * const fWorkbook = univerAPI.getActiveWorkbook();
979
+ * const fWorksheet = fWorkbook.getActiveSheet();
980
+ * const fRange = fWorksheet.getRange('A1:B2');
981
+ * console.log(fRange.isMerged());
982
+ * // merge cells A1:B2
983
+ * fRange.merge();
984
+ * console.log(fRange.isMerged());
955
985
  * ```
956
986
  */
957
987
  isMerged() {
958
988
  const { startColumn: s, startRow: e, endColumn: t, endRow: n } = this._range;
959
- return this._worksheet.getMergedCellRange(e, s, n, t).some((o) => T.equals(o, this._range));
989
+ return this._worksheet.getMergedCellRange(e, s, n, t).some((o) => D.equals(o, this._range));
960
990
  }
961
991
  /**
962
992
  * Return first cell style data in this range
963
993
  * @returns {IStyleData | null} The cell style data
964
994
  * @example
965
995
  * ```ts
966
- * univerAPI.getActiveWorkbook()
967
- * .getActiveSheet()
968
- * .getActiveRange()
969
- * .getCellStyleData()
996
+ * const fWorkbook = univerAPI.getActiveWorkbook();
997
+ * const fWorksheet = fWorkbook.getActiveSheet();
998
+ * const fRange = fWorksheet.getRange('A1:B2');
999
+ * console.log(fRange.getCellStyleData());
970
1000
  * ```
971
1001
  */
972
1002
  getCellStyleData() {
@@ -979,25 +1009,25 @@ let k = class extends ce {
979
1009
  * @returns {TextStyleValue | null} The cell style
980
1010
  * @example
981
1011
  * ```ts
982
- * univerAPI.getActiveWorkbook()
983
- * .getActiveSheet()
984
- * .getActiveRange()
985
- * .getCellStyle()
1012
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1013
+ * const fWorksheet = fWorkbook.getActiveSheet();
1014
+ * const fRange = fWorksheet.getRange('A1:B2');
1015
+ * console.log(fRange.getCellStyle());
986
1016
  * ```
987
1017
  */
988
1018
  getCellStyle() {
989
1019
  const s = this.getCellStyleData();
990
- return s ? ge.create(s) : null;
1020
+ return s ? ce.create(s) : null;
991
1021
  }
992
1022
  /**
993
1023
  * Returns the cell styles for the cells in the range.
994
1024
  * @returns {Array<Array<TextStyleValue | null>>} A two-dimensional array of cell styles.
995
1025
  * @example
996
1026
  * ```ts
997
- * univerAPI.getActiveWorkbook()
998
- * .getActiveSheet()
999
- * .getActiveRange()
1000
- * .getCellStyles()
1027
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1028
+ * const fWorksheet = fWorkbook.getActiveSheet();
1029
+ * const fRange = fWorksheet.getRange('A1:B2');
1030
+ * console.log(fRange.getCellStyles());
1001
1031
  * ```
1002
1032
  */
1003
1033
  getCellStyles() {
@@ -1005,7 +1035,7 @@ let k = class extends ce {
1005
1035
  return s.map((t) => t.map((n) => {
1006
1036
  if (!n) return null;
1007
1037
  const r = e.getStyleByCell(n);
1008
- return r ? ge.create(r) : null;
1038
+ return r ? ce.create(r) : null;
1009
1039
  }));
1010
1040
  }
1011
1041
  getValue(s) {
@@ -1014,7 +1044,8 @@ let k = class extends ce {
1014
1044
  }
1015
1045
  getValues(s) {
1016
1046
  var i, a;
1017
- s && this.getValueAndRichTextValues();
1047
+ if (s)
1048
+ return this.getValueAndRichTextValues();
1018
1049
  const { startRow: e, endRow: t, startColumn: n, endColumn: r } = this._range, o = [];
1019
1050
  for (let h = e; h <= t; h++) {
1020
1051
  const d = [];
@@ -1029,10 +1060,10 @@ let k = class extends ce {
1029
1060
  * @returns {ICellData | null} The cell model data
1030
1061
  * @example
1031
1062
  * ```ts
1032
- * univerAPI.getActiveWorkbook()
1033
- * .getActiveSheet()
1034
- * .getActiveRange()
1035
- * .getCellData()
1063
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1064
+ * const fWorksheet = fWorkbook.getActiveSheet();
1065
+ * const fRange = fWorksheet.getRange('A1:B2');
1066
+ * console.log(fRange.getCellData());
1036
1067
  * ```
1037
1068
  */
1038
1069
  getCellData() {
@@ -1044,10 +1075,10 @@ let k = class extends ce {
1044
1075
  * @returns {Nullable<ICellData>[][]} A two-dimensional array of cell data.
1045
1076
  * @example
1046
1077
  * ```ts
1047
- * univerAPI.getActiveWorkbook()
1048
- * .getActiveSheet()
1049
- * .getActiveRange()
1050
- * .getCellDatas()
1078
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1079
+ * const fWorksheet = fWorkbook.getActiveSheet();
1080
+ * const fRange = fWorksheet.getRange('A1:B2');
1081
+ * console.log(fRange.getCellDatas());
1051
1082
  * ```
1052
1083
  */
1053
1084
  getCellDatas() {
@@ -1058,10 +1089,10 @@ let k = class extends ce {
1058
1089
  * @returns {Nullable<ICellData>[][]} A two-dimensional array of cell data.
1059
1090
  * @example
1060
1091
  * ```ts
1061
- * univerAPI.getActiveWorkbook()
1062
- * .getActiveSheet()
1063
- * .getActiveRange()
1064
- * .getCellDataGrid()
1092
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1093
+ * const fWorksheet = fWorkbook.getActiveSheet();
1094
+ * const fRange = fWorksheet.getRange('A1:B2');
1095
+ * console.log(fRange.getCellDataGrid());
1065
1096
  * ```
1066
1097
  */
1067
1098
  getCellDataGrid() {
@@ -1081,15 +1112,15 @@ let k = class extends ce {
1081
1112
  * @beta
1082
1113
  * @example
1083
1114
  * ```ts
1084
- * univerAPI.getActiveWorkbook()
1085
- * .getActiveSheet()
1086
- * .getActiveRange()
1087
- * .getRichTextValue()
1115
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1116
+ * const fWorksheet = fWorkbook.getActiveSheet();
1117
+ * const fRange = fWorksheet.getRange('A1:B2');
1118
+ * console.log(fRange.getRichTextValue());
1088
1119
  * ```
1089
1120
  */
1090
1121
  getRichTextValue() {
1091
1122
  const s = this.getCellData();
1092
- return s != null && s.p ? new p(s.p) : null;
1123
+ return s != null && s.p ? new E(s.p) : null;
1093
1124
  }
1094
1125
  /**
1095
1126
  * Returns the rich text value for the cells in the range.
@@ -1098,14 +1129,14 @@ let k = class extends ce {
1098
1129
  * @beta
1099
1130
  * @example
1100
1131
  * ```ts
1101
- * univerAPI.getActiveWorkbook()
1102
- * .getActiveSheet()
1103
- * .getActiveRange()
1104
- * .getRichTextValues()
1132
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1133
+ * const fWorksheet = fWorkbook.getActiveSheet();
1134
+ * const fRange = fWorksheet.getRange('A1:B2');
1135
+ * console.log(fRange.getRichTextValues());
1105
1136
  * ```
1106
1137
  */
1107
1138
  getRichTextValues() {
1108
- return this.getCellDataGrid().map((e) => e.map((t) => t != null && t.p ? new p(t.p) : null));
1139
+ return this.getCellDataGrid().map((e) => e.map((t) => t != null && t.p ? new E(t.p) : null));
1109
1140
  }
1110
1141
  /**
1111
1142
  * Returns the value and rich text value for the cell at the start of this range.
@@ -1114,39 +1145,39 @@ let k = class extends ce {
1114
1145
  * @beta
1115
1146
  * @example
1116
1147
  * ```ts
1117
- * univerAPI.getActiveWorkbook()
1118
- * .getActiveSheet()
1119
- * .getActiveRange()
1120
- * .getValueAndRichTextValue()
1148
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1149
+ * const fWorksheet = fWorkbook.getActiveSheet();
1150
+ * const fRange = fWorksheet.getRange('A1:B2');
1151
+ * console.log(fRange.getValueAndRichTextValue());
1121
1152
  * ```
1122
1153
  */
1123
1154
  getValueAndRichTextValue() {
1124
1155
  const s = this.getCellData();
1125
- return s != null && s.p ? new p(s.p) : s == null ? void 0 : s.v;
1156
+ return s != null && s.p ? new E(s.p) : s == null ? void 0 : s.v;
1126
1157
  }
1127
1158
  /**
1128
1159
  * Returns the value and rich text value for the cells in the range.
1129
1160
  * @returns {Nullable<CellValue | RichTextValue>[][]} A two-dimensional array of value and rich text value
1130
1161
  * @example
1131
1162
  * ```ts
1132
- * univerAPI.getActiveWorkbook()
1133
- * .getActiveSheet()
1134
- * .getActiveRange()
1135
- * .getValueAndRichTextValues()
1163
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1164
+ * const fWorksheet = fWorkbook.getActiveSheet();
1165
+ * const fRange = fWorksheet.getRange('A1:B2');
1166
+ * console.log(fRange.getValueAndRichTextValues());
1136
1167
  * ```
1137
1168
  */
1138
1169
  getValueAndRichTextValues() {
1139
- return this.getCellDatas().map((e) => e.map((t) => t != null && t.p ? new p(t.p) : t == null ? void 0 : t.v));
1170
+ return this.getCellDatas().map((e) => e.map((t) => t != null && t.p ? new E(t.p) : t == null ? void 0 : t.v));
1140
1171
  }
1141
1172
  /**
1142
1173
  * Returns the formulas (A1 notation) for the cells in the range. Entries in the 2D array are empty strings for cells with no formula.
1143
1174
  * @returns {string[][]} A two-dimensional array of formulas in string format.
1144
1175
  * @example
1145
1176
  * ```ts
1146
- * univerAPI.getActiveWorkbook()
1147
- * .getActiveSheet()
1148
- * .getActiveRange()
1149
- * .getFormulas()
1177
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1178
+ * const fWorksheet = fWorkbook.getActiveSheet();
1179
+ * const fRange = fWorksheet.getRange('A1:B2');
1180
+ * console.log(fRange.getFormulas());
1150
1181
  * ```
1151
1182
  */
1152
1183
  getFormulas() {
@@ -1162,14 +1193,14 @@ let k = class extends ce {
1162
1193
  return s;
1163
1194
  }
1164
1195
  /**
1165
- * Returns true if the cell wrap is enabled
1196
+ * Returns true if the cell wrap is enabled for the top left cell of the range.
1166
1197
  * @returns {boolean} True if the cell wrap is enabled
1167
1198
  * @example
1168
1199
  * ```ts
1169
- * univerAPI.getActiveWorkbook()
1170
- * .getActiveSheet()
1171
- * .getActiveRange()
1172
- * .getWrap()
1200
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1201
+ * const fWorksheet = fWorkbook.getActiveSheet();
1202
+ * const fRange = fWorksheet.getRange('A1:B2');
1203
+ * console.log(fRange.getWrap());
1173
1204
  * ```
1174
1205
  */
1175
1206
  getWrap() {
@@ -1180,10 +1211,10 @@ let k = class extends ce {
1180
1211
  * @returns {WrapStrategy} The text wrapping strategy
1181
1212
  * @example
1182
1213
  * ```ts
1183
- * univerAPI.getActiveWorkbook()
1184
- * .getActiveSheet()
1185
- * .getActiveRange()
1186
- * .getWrapStrategy()
1214
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1215
+ * const fWorksheet = fWorkbook.getActiveSheet();
1216
+ * const fRange = fWorksheet.getRange('A1:B2');
1217
+ * console.log(fRange.getWrapStrategy());
1187
1218
  * ```
1188
1219
  */
1189
1220
  getWrapStrategy() {
@@ -1194,38 +1225,39 @@ let k = class extends ce {
1194
1225
  * @returns {string} The horizontal alignment
1195
1226
  * @example
1196
1227
  * ```ts
1197
- * univerAPI.getActiveWorkbook()
1198
- * .getActiveSheet()
1199
- * .getActiveRange()
1200
- * .getHorizontalAlignment()
1228
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1229
+ * const fWorksheet = fWorkbook.getActiveSheet();
1230
+ * const fRange = fWorksheet.getRange('A1:B2');
1231
+ * console.log(fRange.getHorizontalAlignment());
1201
1232
  * ```
1202
1233
  */
1203
1234
  getHorizontalAlignment() {
1204
- return Jt(this._worksheet.getRange(this._range).getHorizontalAlignment());
1235
+ return en(this._worksheet.getRange(this._range).getHorizontalAlignment());
1205
1236
  }
1206
1237
  /**
1207
1238
  * Returns the vertical alignment for the top left cell of the range.
1208
1239
  * @returns {string} The vertical alignment
1209
1240
  * @example
1210
1241
  * ```ts
1211
- * univerAPI.getActiveWorkbook()
1212
- * .getActiveSheet()
1213
- * .getActiveRange()
1214
- * .getVerticalAlignment()
1242
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1243
+ * const fWorksheet = fWorkbook.getActiveSheet();
1244
+ * const fRange = fWorksheet.getRange('A1:B2');
1245
+ * console.log(fRange.getVerticalAlignment());
1215
1246
  * ```
1216
1247
  */
1217
1248
  getVerticalAlignment() {
1218
- return Xt(this._worksheet.getRange(this._range).getVerticalAlignment());
1249
+ return nn(this._worksheet.getRange(this._range).getVerticalAlignment());
1219
1250
  }
1220
1251
  /**
1221
1252
  * Set custom meta data for first cell in current range.
1222
1253
  * @param {CustomData} data The custom meta data
1223
1254
  * @returns {FRange} This range, for chaining
1224
1255
  * ```ts
1225
- * univerAPI.getActiveWorkbook()
1226
- * .getActiveSheet()
1227
- * .getActiveRange()
1228
- * .setCustomMetaData({ key: 'value' });
1256
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1257
+ * const fWorksheet = fWorkbook.getActiveSheet();
1258
+ * const fRange = fWorksheet.getRange('A1:B2');
1259
+ * fRange.setCustomMetaData({ key: 'value' });
1260
+ * console.log(fRange.getCustomMetaData());
1229
1261
  * ```
1230
1262
  */
1231
1263
  setCustomMetaData(s) {
@@ -1238,10 +1270,14 @@ let k = class extends ce {
1238
1270
  * @param {CustomData[][]} datas The custom meta data
1239
1271
  * @returns {FRange} This range, for chaining
1240
1272
  * ```ts
1241
- * univerAPI.getActiveWorkbook()
1242
- * .getActiveSheet()
1243
- * .getActiveRange()
1244
- * .setCustomMetaDatas([[{ key: 'value' }]]);
1273
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1274
+ * const fWorksheet = fWorkbook.getActiveSheet();
1275
+ * const fRange = fWorksheet.getRange('A1:B2');
1276
+ * fRange.setCustomMetaDatas([
1277
+ * [{ key: 'value' }, { key: 'value2' }],
1278
+ * [{ key: 'value3' }, { key: 'value4' }],
1279
+ * ]);
1280
+ * console.log(fRange.getCustomMetaDatas());
1245
1281
  * ```
1246
1282
  */
1247
1283
  setCustomMetaDatas(s) {
@@ -1252,10 +1288,10 @@ let k = class extends ce {
1252
1288
  * @returns {CustomData | null} The custom meta data
1253
1289
  * @example
1254
1290
  * ```
1255
- * univerAPI.getActiveWorkbook()
1256
- * .getActiveSheet()
1257
- * .getActiveRange()
1258
- * .getCustomMetaData()
1291
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1292
+ * const fWorksheet = fWorkbook.getActiveSheet();
1293
+ * const fRange = fWorksheet.getRange('A1:B2');
1294
+ * console.log(fRange.getCustomMetaData());
1259
1295
  * ```
1260
1296
  */
1261
1297
  getCustomMetaData() {
@@ -1268,10 +1304,10 @@ let k = class extends ce {
1268
1304
  * @returns {CustomData[][]} A two-dimensional array of custom meta data
1269
1305
  * @example
1270
1306
  * ```
1271
- * univerAPI.getActiveWorkbook()
1272
- * .getActiveSheet()
1273
- * .getActiveRange()
1274
- * .getCustomMetaDatas()
1307
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1308
+ * const fWorksheet = fWorkbook.getActiveSheet();
1309
+ * const fRange = fWorksheet.getRange('A1:B2');
1310
+ * console.log(fRange.getCustomMetaDatas());
1275
1311
  * ```
1276
1312
  */
1277
1313
  getCustomMetaDatas() {
@@ -1288,16 +1324,17 @@ let k = class extends ce {
1288
1324
  * @returns {FRange} This range, for chaining
1289
1325
  * @example
1290
1326
  * ```ts
1291
- * univerAPI.getActiveWorkbook()
1292
- * .getActiveSheet()
1293
- * .getActiveRange()
1294
- * .setBorder(BorderType.ALL, BorderStyleType.THIN, '#ff0000');
1327
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1328
+ * const fWorksheet = fWorkbook.getActiveSheet();
1329
+ * const fRange = fWorksheet.getRange('A1:B2');
1330
+ * fRange.setBorder(univerAPI.Enum.BorderType.ALL, univerAPI.Enum.BorderStyleTypes.THIN, '#ff0000');
1295
1331
  * ```
1296
1332
  */
1297
1333
  setBorder(s, e, t) {
1298
1334
  return this._commandService.syncExecuteCommand(mt.id, {
1299
1335
  unitId: this._workbook.getUnitId(),
1300
1336
  subUnitId: this._worksheet.getSheetId(),
1337
+ ranges: [this._range],
1301
1338
  value: {
1302
1339
  type: s,
1303
1340
  style: e,
@@ -1312,10 +1349,10 @@ let k = class extends ce {
1312
1349
  * @returns {FRange} This range, for chaining
1313
1350
  * @example
1314
1351
  * ```ts
1315
- * univerAPI.getActiveWorkbook()
1316
- * .getActiveSheet()
1317
- * .getActiveRange()
1318
- * .setBackgroundColor('red')
1352
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1353
+ * const fWorksheet = fWorkbook.getActiveSheet();
1354
+ * const fRange = fWorksheet.getRange('A1:B2');
1355
+ * fRange.setBackgroundColor('red');
1319
1356
  * ```
1320
1357
  */
1321
1358
  setBackgroundColor(s) {
@@ -1337,28 +1374,34 @@ let k = class extends ce {
1337
1374
  * @returns {FRange} This range, for chaining
1338
1375
  * @example
1339
1376
  * ```typescript
1340
- * univerAPI.getActiveWorkbook().getActiveSheet().getActiveRange().setBackground('red')
1377
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1378
+ * const fWorksheet = fWorkbook.getActiveSheet();
1379
+ * const fRange = fWorksheet.getRange('A1:B2');
1380
+ * fRange.setBackground('red');
1341
1381
  * ```
1342
1382
  */
1343
1383
  setBackground(s) {
1344
1384
  return this.setBackgroundColor(s), this;
1345
1385
  }
1346
1386
  /**
1347
- * Set new value for current cell, first cell in this range.
1387
+ * Sets the value of the range.
1348
1388
  * @param {CellValue | ICellData} value The value can be a number, string, boolean, or standard cell format. If it begins with `=`, it is interpreted as a formula. The value is tiled to all cells in the range.
1349
1389
  * @returns {FRange} This range, for chaining
1350
1390
  * ```ts
1351
- * univerAPI.getActiveWorkbook()
1352
- * .getActiveSheet()
1353
- * .getActiveRange()
1354
- * .setValue(1);
1391
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1392
+ * const fWorksheet = fWorkbook.getActiveSheet();
1393
+ * const fRange = fWorksheet.getRange('B2');
1394
+ * fRange.setValue(123);
1395
+ *
1396
+ * // or
1397
+ * fRange.setValue({ v: 234, s: { bg: { rgb: '#ff0000' } } });
1355
1398
  * ```
1356
1399
  */
1357
1400
  setValue(s) {
1358
1401
  const e = V(s);
1359
1402
  if (!e)
1360
1403
  throw new Error("Invalid value");
1361
- return this._commandService.syncExecuteCommand(P.id, {
1404
+ return this._commandService.syncExecuteCommand(x.id, {
1362
1405
  unitId: this._workbook.getUnitId(),
1363
1406
  subUnitId: this._worksheet.getSheetId(),
1364
1407
  range: this._range,
@@ -1370,24 +1413,27 @@ let k = class extends ce {
1370
1413
  * @param {CellValue | ICellData} value The value can be a number, string, boolean, or standard cell format. If it begins with `=`, it is interpreted as a formula. The value is tiled to all cells in the range.
1371
1414
  * @returns {FRange} This range, for chaining
1372
1415
  * ```ts
1373
- * univerAPI.getActiveWorkbook()
1374
- * .getActiveSheet()
1375
- * .getActiveRange()
1376
- * .setValueForCell(1);
1416
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1417
+ * const fWorksheet = fWorkbook.getActiveSheet();
1418
+ * const fRange = fWorksheet.getRange('A1:B2');
1419
+ * fRange.setValueForCell(123);
1420
+ *
1421
+ * // or
1422
+ * fRange.setValueForCell({ v: 234, s: { bg: { rgb: '#ff0000' } } });
1377
1423
  * ```
1378
1424
  */
1379
1425
  setValueForCell(s) {
1380
1426
  const e = V(s);
1381
1427
  if (!e)
1382
1428
  throw new Error("Invalid value");
1383
- return this._commandService.syncExecuteCommand(P.id, {
1429
+ return this._commandService.syncExecuteCommand(x.id, {
1384
1430
  unitId: this._workbook.getUnitId(),
1385
1431
  subUnitId: this._worksheet.getSheetId(),
1386
1432
  range: {
1387
1433
  startColumn: this._range.startColumn,
1388
1434
  startRow: this._range.startRow,
1389
- endColumn: this._range.endColumn,
1390
- endRow: this._range.endRow
1435
+ endColumn: this._range.startColumn,
1436
+ endRow: this._range.startRow
1391
1437
  },
1392
1438
  value: e
1393
1439
  }), this;
@@ -1398,25 +1444,32 @@ let k = class extends ce {
1398
1444
  * @returns {FRange} The range
1399
1445
  * @example
1400
1446
  * ```
1401
- * univerAPI.getActiveWorkbook()
1402
- * .getActiveSheet()
1403
- * .getActiveRange()
1404
- * .setRichTextValueForCell(new RichTextValue().insertText('Hello'));
1447
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1448
+ * const fWorksheet = fWorkbook.getActiveSheet();
1449
+ * const fRange = fWorksheet.getRange('A1:B2');
1450
+ * console.log(fRange.getValue(true));
1451
+ *
1452
+ * // set the first cell value to 123
1453
+ * const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } })
1454
+ * .setStyle(0, 1, { bl: 1, cl: { rgb: '#c81e1e' } })
1455
+ * .setStyle(6, 7, { bl: 1, cl: { rgb: '#c81e1e' } });
1456
+ * fRange.setRichTextValueForCell(richText);
1457
+ * console.log(fRange.getValue(true).toPlainText()); // Hello World
1405
1458
  * ```
1406
1459
  */
1407
1460
  setRichTextValueForCell(s) {
1408
- const e = s instanceof p ? s.getData() : s, t = {
1461
+ const e = s instanceof E ? s.getData() : s, t = {
1409
1462
  unitId: this._workbook.getUnitId(),
1410
1463
  subUnitId: this._worksheet.getSheetId(),
1411
1464
  range: {
1412
1465
  startColumn: this._range.startColumn,
1413
1466
  startRow: this._range.startRow,
1414
- endColumn: this._range.endColumn,
1415
- endRow: this._range.endRow
1467
+ endColumn: this._range.startColumn,
1468
+ endRow: this._range.startRow
1416
1469
  },
1417
1470
  value: { p: e }
1418
1471
  };
1419
- return this._commandService.syncExecuteCommand(P.id, t), this;
1472
+ return this._commandService.syncExecuteCommand(x.id, t), this;
1420
1473
  }
1421
1474
  /**
1422
1475
  * Set the rich text value for the cells in the range.
@@ -1424,21 +1477,30 @@ let k = class extends ce {
1424
1477
  * @returns {FRange} The range
1425
1478
  * @example
1426
1479
  * ```ts
1427
- * univerAPI
1428
- * .getActiveWorkbook()
1429
- * .getActiveSheet()
1430
- * .getActiveRange()
1431
- * .setRichTextValues([[new RichTextValue().insertText('Hello')]]);
1480
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1481
+ * const fWorksheet = fWorkbook.getActiveSheet();
1482
+ * const fRange = fWorksheet.getRange('A1:B2');
1483
+ * console.log(fRange.getValue(true));
1484
+ *
1485
+ * // set the first cell value to 123
1486
+ * const richText = univerAPI.newRichText({ body: { dataStream: 'Hello World\r\n' } })
1487
+ * .setStyle(0, 1, { bl: 1, cl: { rgb: '#c81e1e' } })
1488
+ * .setStyle(6, 7, { bl: 1, cl: { rgb: '#c81e1e' } });
1489
+ * fRange.setRichTextValues([
1490
+ * [richText, richText],
1491
+ * [null, null]
1492
+ * ]);
1493
+ * console.log(fRange.getValue(true).toPlainText()); // Hello World
1432
1494
  * ```
1433
1495
  */
1434
1496
  setRichTextValues(s) {
1435
- const e = s.map((r) => r.map((o) => o && { p: o instanceof p ? o.getData() : o })), t = ye(e, this._range), n = {
1497
+ const e = s.map((r) => r.map((o) => o && { p: o instanceof E ? o.getData() : o })), t = Ue(e, this._range), n = {
1436
1498
  unitId: this._workbook.getUnitId(),
1437
1499
  subUnitId: this._worksheet.getSheetId(),
1438
1500
  range: this._range,
1439
1501
  value: t
1440
1502
  };
1441
- return this._commandService.syncExecuteCommand(P.id, n), this;
1503
+ return this._commandService.syncExecuteCommand(x.id, n), this;
1442
1504
  }
1443
1505
  /**
1444
1506
  * Set the cell wrap of the given range.
@@ -1447,18 +1509,19 @@ let k = class extends ce {
1447
1509
  * @returns {FRange} this range, for chaining
1448
1510
  * @example
1449
1511
  * ```ts
1450
- * univerAPI.getActiveWorkbook()
1451
- * .getActiveSheet()
1452
- * .getActiveRange()
1453
- * .setWrap(true);
1512
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1513
+ * const fWorksheet = fWorkbook.getActiveSheet();
1514
+ * const fRange = fWorksheet.getRange('A1:B2');
1515
+ * fRange.setWrap(true);
1516
+ * console.log(fRange.getWrap());
1454
1517
  * ```
1455
1518
  */
1456
1519
  setWrap(s) {
1457
- return this._commandService.syncExecuteCommand(Z.id, {
1520
+ return this._commandService.syncExecuteCommand(ee.id, {
1458
1521
  unitId: this._workbook.getUnitId(),
1459
1522
  subUnitId: this._worksheet.getSheetId(),
1460
1523
  range: this._range,
1461
- value: s ? Y.WRAP : Y.UNSPECIFIED
1524
+ value: s ? J.WRAP : J.UNSPECIFIED
1462
1525
  }), this;
1463
1526
  }
1464
1527
  /**
@@ -1467,14 +1530,15 @@ let k = class extends ce {
1467
1530
  * @returns {FRange} this range, for chaining
1468
1531
  * @example
1469
1532
  * ```ts
1470
- * univerAPI.getActiveWorkbook()
1471
- * .getActiveSheet()
1472
- * .getActiveRange()
1473
- * .setWrapStrategy(WrapStrategy.WRAP);
1533
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1534
+ * const fWorksheet = fWorkbook.getActiveSheet();
1535
+ * const fRange = fWorksheet.getRange('A1:B2');
1536
+ * fRange.setWrapStrategy(univerAPI.Enum.WrapStrategy.WRAP);
1537
+ * console.log(fRange.getWrapStrategy());
1474
1538
  * ```
1475
1539
  */
1476
1540
  setWrapStrategy(s) {
1477
- return this._commandService.syncExecuteCommand(Z.id, {
1541
+ return this._commandService.syncExecuteCommand(ee.id, {
1478
1542
  unitId: this._workbook.getUnitId(),
1479
1543
  subUnitId: this._worksheet.getSheetId(),
1480
1544
  range: this._range,
@@ -1487,10 +1551,10 @@ let k = class extends ce {
1487
1551
  * @returns {FRange} this range, for chaining
1488
1552
  * @example
1489
1553
  * ```ts
1490
- * univerAPI.getActiveWorkbook()
1491
- * .getActiveSheet()
1492
- * .getActiveRange()
1493
- * .setVerticalAlignment('top');
1554
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1555
+ * const fWorksheet = fWorkbook.getActiveSheet();
1556
+ * const fRange = fWorksheet.getRange('A1:B2');
1557
+ * fRange.setVerticalAlignment('top');
1494
1558
  * ```
1495
1559
  */
1496
1560
  setVerticalAlignment(s) {
@@ -1498,7 +1562,7 @@ let k = class extends ce {
1498
1562
  unitId: this._workbook.getUnitId(),
1499
1563
  subUnitId: this._worksheet.getSheetId(),
1500
1564
  range: this._range,
1501
- value: Qt(s)
1565
+ value: tn(s)
1502
1566
  }), this;
1503
1567
  }
1504
1568
  /**
@@ -1507,10 +1571,10 @@ let k = class extends ce {
1507
1571
  * @returns {FRange} this range, for chaining
1508
1572
  * @example
1509
1573
  * ```ts
1510
- * univerAPI.getActiveWorkbook()
1511
- * .getActiveSheet()
1512
- * .getActiveRange()
1513
- * .setHorizontalAlignment('left');
1574
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1575
+ * const fWorksheet = fWorkbook.getActiveSheet();
1576
+ * const fRange = fWorksheet.getRange('A1:B2');
1577
+ * fRange.setHorizontalAlignment('left');
1514
1578
  * ```
1515
1579
  */
1516
1580
  setHorizontalAlignment(s) {
@@ -1518,7 +1582,7 @@ let k = class extends ce {
1518
1582
  unitId: this._workbook.getUnitId(),
1519
1583
  subUnitId: this._worksheet.getSheetId(),
1520
1584
  range: this._range,
1521
- value: Yt(s)
1585
+ value: Zt(s)
1522
1586
  }), this;
1523
1587
  }
1524
1588
  /**
@@ -1527,15 +1591,18 @@ let k = class extends ce {
1527
1591
  * @returns {FRange} This range, for chaining
1528
1592
  * @example
1529
1593
  * ```ts
1530
- * univerAPI.getActiveWorkbook()
1531
- * .getActiveSheet()
1532
- * .getActiveRange()
1533
- * .setValues([[1, 2], [3, 4]]);
1594
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1595
+ * const fWorksheet = fWorkbook.getActiveSheet();
1596
+ * const fRange = fWorksheet.getRange('A1:B2');
1597
+ * fRange.setValues([
1598
+ * [1, { v: 2, s: { bg: { rgb: '#ff0000' } } }],
1599
+ * [3, 4]
1600
+ * ]);
1534
1601
  * ```
1535
1602
  */
1536
1603
  setValues(s) {
1537
- const e = ye(s, this._range);
1538
- return this._commandService.syncExecuteCommand(P.id, {
1604
+ const e = Ue(s, this._range);
1605
+ return this._commandService.syncExecuteCommand(x.id, {
1539
1606
  unitId: this._workbook.getUnitId(),
1540
1607
  subUnitId: this._worksheet.getSheetId(),
1541
1608
  range: this._range,
@@ -1548,10 +1615,10 @@ let k = class extends ce {
1548
1615
  * @returns {FRange} This range, for chaining
1549
1616
  * @example
1550
1617
  * ```ts
1551
- * univerAPI.getActiveWorkbook()
1552
- * .getActiveSheet()
1553
- * .getActiveRange()
1554
- * .setFontWeight('bold');
1618
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1619
+ * const fWorksheet = fWorkbook.getActiveSheet();
1620
+ * const fRange = fWorksheet.getRange('A1:B2');
1621
+ * fRange.setFontWeight('bold');
1555
1622
  * ```
1556
1623
  */
1557
1624
  setFontWeight(s) {
@@ -1581,10 +1648,10 @@ let k = class extends ce {
1581
1648
  * @returns {FRange} This range, for chaining
1582
1649
  * @example
1583
1650
  * ```ts
1584
- * univerAPI.getActiveWorkbook()
1585
- * .getActiveSheet()
1586
- * .getActiveRange()
1587
- * .setFontStyle('italic');
1651
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1652
+ * const fWorksheet = fWorkbook.getActiveSheet();
1653
+ * const fRange = fWorksheet.getRange('A1:B2');
1654
+ * fRange.setFontStyle('italic');
1588
1655
  * ```
1589
1656
  */
1590
1657
  setFontStyle(s) {
@@ -1614,10 +1681,10 @@ let k = class extends ce {
1614
1681
  * @returns {FRange} This range, for chaining
1615
1682
  * @example
1616
1683
  * ```ts
1617
- * univerAPI.getActiveWorkbook()
1618
- * .getActiveSheet()
1619
- * .getActiveRange()
1620
- * .setFontLine('underline');
1684
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1685
+ * const fWorksheet = fWorkbook.getActiveSheet();
1686
+ * const fRange = fWorksheet.getRange('A1:B2');
1687
+ * fRange.setFontLine('underline');
1621
1688
  * ```
1622
1689
  */
1623
1690
  setFontLine(s) {
@@ -1645,13 +1712,6 @@ let k = class extends ce {
1645
1712
  * Sets the font underline style of the given ITextDecoration
1646
1713
  * @param {ITextDecoration|null} value The font underline style of the given ITextDecoration; a null value resets the font underline style
1647
1714
  * @returns {void}
1648
- * @example
1649
- * ```ts
1650
- * univerAPI.getActiveWorkbook()
1651
- * .getActiveSheet()
1652
- * .getActiveRange()
1653
- * .setFontLine('underline');
1654
- * ```
1655
1715
  */
1656
1716
  _setFontUnderline(s) {
1657
1717
  const e = {
@@ -1688,10 +1748,10 @@ let k = class extends ce {
1688
1748
  * @returns {FRange} This range, for chaining
1689
1749
  * @example
1690
1750
  * ```ts
1691
- * univerAPI.getActiveWorkbook()
1692
- * .getActiveSheet()
1693
- * .getActiveRange()
1694
- * .setFontFamily('Arial');
1751
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1752
+ * const fWorksheet = fWorkbook.getActiveSheet();
1753
+ * const fRange = fWorksheet.getRange('A1:B2');
1754
+ * fRange.setFontFamily('Arial');
1695
1755
  * ```
1696
1756
  */
1697
1757
  setFontFamily(s) {
@@ -1712,10 +1772,10 @@ let k = class extends ce {
1712
1772
  * @returns {FRange} This range, for chaining
1713
1773
  * @example
1714
1774
  * ```ts
1715
- * univerAPI.getActiveWorkbook()
1716
- * .getActiveSheet()
1717
- * .getActiveRange()
1718
- * .setFontSize(12);
1775
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1776
+ * const fWorksheet = fWorkbook.getActiveSheet();
1777
+ * const fRange = fWorksheet.getRange('A1:B2');
1778
+ * fRange.setFontSize(24);
1719
1779
  * ```
1720
1780
  */
1721
1781
  setFontSize(s) {
@@ -1736,10 +1796,10 @@ let k = class extends ce {
1736
1796
  * @returns {FRange} This range, for chaining
1737
1797
  * @example
1738
1798
  * ```ts
1739
- * univerAPI.getActiveWorkbook()
1740
- * .getActiveSheet()
1741
- * .getActiveRange()
1742
- * .setFontColor('#ff0000');
1799
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1800
+ * const fWorksheet = fWorkbook.getActiveSheet();
1801
+ * const fRange = fWorksheet.getRange('A1:B2');
1802
+ * fRange.setFontColor('#ff0000');
1743
1803
  * ```
1744
1804
  */
1745
1805
  setFontColor(s) {
@@ -1762,17 +1822,16 @@ let k = class extends ce {
1762
1822
  * @returns {FRange} This range, for chaining
1763
1823
  * @example
1764
1824
  * ```ts
1765
- * const workbook = univerAPI.getActiveWorkbook();
1766
- * const worksheet = workbook.getActiveSheet();
1767
- * const range = worksheet.getRange(0, 0, 2, 2);
1768
- * const merge = range.merge();
1769
- * const isMerged = merge.isMerged();
1770
- * console.log('debugger', isMerged);
1825
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1826
+ * const fWorksheet = fWorkbook.getActiveSheet();
1827
+ * const fRange = fWorksheet.getRange('A1:B2');
1828
+ * fRange.merge();
1829
+ * console.log(fRange.isMerged());
1771
1830
  * ```
1772
1831
  */
1773
1832
  merge(s = !0) {
1774
1833
  const e = this._workbook.getUnitId(), t = this._worksheet.getSheetId();
1775
- return z(this._injector, e, t, [this._range], s), this;
1834
+ return G(this._injector, e, t, [this._range], s), this;
1776
1835
  }
1777
1836
  /**
1778
1837
  * Merges cells in a range horizontally.
@@ -1780,17 +1839,21 @@ let k = class extends ce {
1780
1839
  * @returns {FRange} This range, for chaining
1781
1840
  * @example
1782
1841
  * ```ts
1783
- * const workbook = univerAPI.getActiveWorkbook();
1784
- * const worksheet = workbook.getActiveSheet();
1785
- * const range = worksheet.getRange(2, 2, 2, 2);
1786
- * const merge = range.mergeAcross();
1787
- * const allMerge = worksheet.getMergeData();
1788
- * console.log(allMerge.length); // There will be two merged cells.
1842
+ * // Assume the active sheet is a new sheet with no merged cells.
1843
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1844
+ * const fWorksheet = fWorkbook.getActiveSheet();
1845
+ * const fRange = fWorksheet.getRange('A1:B2');
1846
+ * fRange.mergeAcross();
1847
+ * // There will be two merged cells. A1:B1 and A2:B2.
1848
+ * const mergeData = fWorksheet.getMergeData();
1849
+ * mergeData.forEach((item) => {
1850
+ * console.log(item.getA1Notation());
1851
+ * });
1789
1852
  * ```
1790
1853
  */
1791
1854
  mergeAcross(s = !0) {
1792
- const e = _e([this._range], me.ROWS), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
1793
- return z(this._injector, t, n, e, s), this;
1855
+ const e = me([this._range], ue.ROWS), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
1856
+ return G(this._injector, t, n, e, s), this;
1794
1857
  }
1795
1858
  /**
1796
1859
  * Merges cells in a range vertically.
@@ -1798,30 +1861,33 @@ let k = class extends ce {
1798
1861
  * @returns {FRange} This range, for chaining
1799
1862
  * @example
1800
1863
  * ```ts
1801
- * const workbook = univerAPI.getActiveWorkbook();
1802
- * const worksheet = workbook.getActiveSheet();
1803
- * const range = worksheet.getRange(4, 4, 2, 2);
1804
- * const merge = range.mergeVertically();
1805
- * const allMerge = worksheet.getMergeData();
1806
- * console.log(allMerge.length); // There will be two merged cells.
1864
+ * // Assume the active sheet is a new sheet with no merged cells.
1865
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1866
+ * const fWorksheet = fWorkbook.getActiveSheet();
1867
+ * const fRange = fWorksheet.getRange('A1:B2');
1868
+ * fRange.mergeVertically();
1869
+ * // There will be two merged cells. A1:A2 and B1:B2.
1870
+ * const mergeData = fWorksheet.getMergeData();
1871
+ * mergeData.forEach((item) => {
1872
+ * console.log(item.getA1Notation());
1873
+ * });
1807
1874
  * ```
1808
1875
  */
1809
1876
  mergeVertically(s = !0) {
1810
- const e = _e([this._range], me.COLUMNS), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
1811
- return z(this._injector, t, n, e, s), this;
1877
+ const e = me([this._range], ue.COLUMNS), t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
1878
+ return G(this._injector, t, n, e, s), this;
1812
1879
  }
1813
1880
  /**
1814
1881
  * Returns true if cells in the current range overlap a merged cell.
1815
1882
  * @returns {boolean} is overlap with a merged cell
1816
1883
  * @example
1817
1884
  * ```ts
1818
- * const workbook = univerAPI.getActiveWorkbook();
1819
- * const worksheet = workbook.getActiveSheet();
1820
- * const range = worksheet.getRange(0,0,2,2);
1821
- * const merge = range.merge();
1822
- * const anchor = worksheet.getRange(0,0);
1823
- * const isPartOfMerge = anchor.isPartOfMerge();
1824
- * console.log('debugger', isPartOfMerge); // true
1885
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1886
+ * const fWorksheet = fWorkbook.getActiveSheet();
1887
+ * const fRange = fWorksheet.getRange('A1:B2');
1888
+ * fRange.merge();
1889
+ * const anchor = fWorksheet.getRange('A1');
1890
+ * console.log(anchor.isPartOfMerge()); // true
1825
1891
  * ```
1826
1892
  */
1827
1893
  isPartOfMerge() {
@@ -1833,16 +1899,14 @@ let k = class extends ce {
1833
1899
  * @returns {FRange} This range, for chaining
1834
1900
  * @example
1835
1901
  * ```ts
1836
- * const workbook = univerAPI.getActiveWorkbook();
1837
- * const worksheet = workbook.getActiveSheet();
1838
- * const range = worksheet.getRange(0,0,2,2);
1839
- * const merge = range.merge();
1840
- * const anchor = worksheet.getRange(0,0);
1841
- * const isPartOfMergeFirst = anchor.isPartOfMerge();
1842
- * console.log('debugger' isPartOfMergeFirst) // true
1843
- * range.breakApart();
1844
- * const isPartOfMergeSecond = anchor.isPartOfMerge();
1845
- * console.log('debugger' isPartOfMergeSecond) // false
1902
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1903
+ * const fWorksheet = fWorkbook.getActiveSheet();
1904
+ * const fRange = fWorksheet.getRange('A1:B2');
1905
+ * fRange.merge();
1906
+ * const anchor = fWorksheet.getRange('A1');
1907
+ * console.log(anchor.isPartOfMerge()); // true
1908
+ * fRange.breakApart();
1909
+ * console.log(anchor.isPartOfMerge()); // false
1846
1910
  * ```
1847
1911
  */
1848
1912
  breakApart() {
@@ -1882,7 +1946,7 @@ let k = class extends ce {
1882
1946
  * ```
1883
1947
  */
1884
1948
  getA1Notation(s) {
1885
- return s ? Ot(this._worksheet.getName(), this._range) : ue(this._range);
1949
+ return s ? $t(this._worksheet.getName(), this._range) : de(this._range);
1886
1950
  }
1887
1951
  /**
1888
1952
  * Sets the specified range as the active range, with the top left cell in the range as the current cell.
@@ -1896,7 +1960,7 @@ let k = class extends ce {
1896
1960
  * ```
1897
1961
  */
1898
1962
  activate() {
1899
- return this._injector.createInstance(C, this._workbook).setActiveRange(this), this;
1963
+ return this._injector.createInstance(v, this._workbook).setActiveRange(this), this;
1900
1964
  }
1901
1965
  /**
1902
1966
  * Sets the specified cell as the current cell.
@@ -1904,10 +1968,20 @@ let k = class extends ce {
1904
1968
  * If the specified cell is not part of an existing range, then a new range is created with the cell as the active range and the current cell.
1905
1969
  * @returns {FRange} This range, for chaining.
1906
1970
  * @description If the range is not a single cell, an error will be thrown.
1971
+ * @example
1972
+ * ```ts
1973
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1974
+ * const fWorksheet = fWorkbook.getActiveSheet();
1975
+ * const fRange = fWorksheet.getRange('A1:B2');
1976
+ * fRange.activate();
1977
+ * const cell = fWorksheet.getRange('B2');
1978
+ * cell.activateAsCurrentCell(); // the active cell will be B2
1979
+ * console.log(fWorksheet.getActiveRange().getA1Notation()); // B2
1980
+ * ```
1907
1981
  */
1908
1982
  activateAsCurrentCell() {
1909
1983
  const s = this._worksheet.getMergedCell(this._range.startRow, this._range.startColumn);
1910
- if (s && T.equals(s, this._range) || !s && this._range.startRow === this._range.endRow && this._range.startColumn === this._range.endColumn)
1984
+ if (s && D.equals(s, this._range) || !s && this._range.startRow === this._range.endRow && this._range.startColumn === this._range.endColumn)
1911
1985
  return this.activate();
1912
1986
  throw new Error("The range is not a single cell");
1913
1987
  }
@@ -1916,35 +1990,37 @@ let k = class extends ce {
1916
1990
  * @param {boolean} [treatMultipleDelimitersAsOne] Whether to treat multiple continuous delimiters as one. The default value is false.
1917
1991
  * @param {SplitDelimiterEnum} [delimiter] The delimiter to use to split the text. The default delimiter is Tab(1)、Comma(2)、Semicolon(4)、Space(8)、Custom(16).A delimiter like 6 (SplitDelimiterEnum.Comma|SplitDelimiterEnum.Semicolon) means using Comma and Semicolon to split the text.
1918
1992
  * @param {string} [customDelimiter] The custom delimiter to split the text. An error will be thrown if custom delimiter is set but the customDelimiter is not a character.
1919
- * @example Show how to split text to columns with combined delimiter. The bit operations are used to combine the delimiters.
1920
- * // A1:A3 has following values:
1921
- * // A | B | C
1922
- * // 1;;2;3 | |
1923
- * // 1;,2;3 | |
1924
- * // After calling splitTextToColumns(false, SplitDelimiterEnum.Semicolon|SplitDelimiterEnum.Comma), the range will be:
1925
- * // A | B | C | D
1926
- * // 1 | | 2 | 3
1927
- * // 1 | | 2 | 3
1928
- * // After calling splitTextToColumns(true, SplitDelimiterEnum.Semicolon|SplitDelimiterEnum.Comma), the range will be:
1929
- * // A | B | C
1930
- * // 1 | 2 | 3
1931
- * // 1 | 2 | 3
1932
1993
  * @example Show how to split text to columns with custom delimiter
1994
+ * ```ts
1995
+ * const fWorkbook = univerAPI.getActiveWorkbook();
1996
+ * const fWorksheet = fWorkbook.getActiveSheet();
1997
+ *
1933
1998
  * // A1:A3 has following values:
1934
1999
  * // A | B | C
1935
2000
  * // 1#2#3 | |
1936
2001
  * // 4##5#6 | |
1937
- * // After calling splitTextToColumns(false, SplitDelimiterEnum.Custom, '#'), the range will be:
1938
- * // A | B | C | D
2002
+ * const fRange = fWorksheet.getRange('A1:A3');
2003
+ * fRange.setValues([
2004
+ * ['A', 'B', 'C'],
2005
+ * ['1#2#3', null, null],
2006
+ * ['4##5#6', null, null]
2007
+ * ]);
2008
+ *
2009
+ * // After calling splitTextToColumns(false, univerAPI.Enum.SplitDelimiterType.Custom, '#'), the range will be:
2010
+ * // A | | |
1939
2011
  * // 1 | 2 | 3 |
1940
2012
  * // 4 | | 5 | 6
1941
- * // After calling splitTextToColumns(true, SplitDelimiterEnum.Custom, '#'), the range will be:
1942
- * // A | B | C
2013
+ * fRange.splitTextToColumns(false, univerAPI.Enum.SplitDelimiterType.Custom, '#');
2014
+ *
2015
+ * // After calling splitTextToColumns(true, univerAPI.Enum.SplitDelimiterType.Custom, '#'), the range will be:
2016
+ * // A | |
1943
2017
  * // 1 | 2 | 3
1944
2018
  * // 4 | 5 | 6
2019
+ * fRange.splitTextToColumns(true, univerAPI.Enum.SplitDelimiterType.Custom, '#');
2020
+ * ```
1945
2021
  */
1946
2022
  splitTextToColumns(s, e, t) {
1947
- this._commandService.syncExecuteCommand(St.id, {
2023
+ this._commandService.syncExecuteCommand(wt.id, {
1948
2024
  unitId: this._workbook.getUnitId(),
1949
2025
  subUnitId: this._worksheet.getSheetId(),
1950
2026
  range: this._range,
@@ -1969,7 +2045,7 @@ let k = class extends ce {
1969
2045
  const e = this.getUsedThemeStyle();
1970
2046
  e && this.removeThemeStyle(e);
1971
2047
  } else
1972
- this._commandService.syncExecuteCommand(wt.id, {
2048
+ this._commandService.syncExecuteCommand(St.id, {
1973
2049
  unitId: this._workbook.getUnitId(),
1974
2050
  subUnitId: this._worksheet.getSheetId(),
1975
2051
  range: this._range,
@@ -2003,29 +2079,29 @@ let k = class extends ce {
2003
2079
  * const fWorkbook = univerAPI.getActiveWorkbook();
2004
2080
  * const fWorksheet = fWorkbook.getActiveSheet();
2005
2081
  * const fRange = fWorksheet.getRange('A1:E20');
2082
+ * console.log(fRange.getUsedThemeStyle()); // undefined
2006
2083
  * fRange.useThemeStyle('default');
2007
- * const themeStyle = fRange.getUsedThemeStyle();
2008
- * console.log(themeStyle); // 'default'
2084
+ * console.log(fRange.getUsedThemeStyle()); // 'default'
2009
2085
  * ```
2010
2086
  */
2011
2087
  getUsedThemeStyle() {
2012
- return this._injector.get(He).getAppliedRangeThemeStyle({
2088
+ return this._injector.get(Oe).getAppliedRangeThemeStyle({
2013
2089
  unitId: this._workbook.getUnitId(),
2014
2090
  subUnitId: this._worksheet.getSheetId(),
2015
2091
  range: this._range
2016
2092
  });
2017
2093
  }
2018
2094
  };
2019
- k = en([
2020
- K(3, u(b)),
2021
- K(4, m),
2022
- K(5, u(jt))
2095
+ k = sn([
2096
+ Y(3, u(p)),
2097
+ Y(4, m),
2098
+ Y(5, u(Gt))
2023
2099
  ], k);
2024
- var tn = Object.getOwnPropertyDescriptor, nn = (s, e, t, n) => {
2025
- for (var r = n > 1 ? void 0 : n ? tn(e, t) : e, o = s.length - 1, i; o >= 0; o--)
2100
+ var on = Object.getOwnPropertyDescriptor, an = (s, e, t, n) => {
2101
+ for (var r = n > 1 ? void 0 : n ? on(e, t) : e, o = s.length - 1, i; o >= 0; o--)
2026
2102
  (i = s[o]) && (r = i(r) || r);
2027
2103
  return r;
2028
- }, rn = (s, e) => (t, n) => e(t, n, s);
2104
+ }, hn = (s, e) => (t, n) => e(t, n, s);
2029
2105
  let j = class {
2030
2106
  constructor(s, e, t, n) {
2031
2107
  this._workbook = s, this._worksheet = e, this._selections = t, this._injector = n;
@@ -2037,9 +2113,10 @@ let j = class {
2037
2113
  * ```ts
2038
2114
  * const fWorkbook = univerAPI.getActiveWorkbook();
2039
2115
  * const fWorksheet = fWorkbook.getActiveSheet();
2116
+ * const fRange = fWorksheet.getRange('A10:B11');
2117
+ * fRange.activate();
2040
2118
  * const fSelection = fWorksheet.getSelection();
2041
- * const activeRange = fSelection.getActiveRange();
2042
- * console.log(activeRange);
2119
+ * console.log(fSelection.getActiveRange().getA1Notation()); // A10:B11
2043
2120
  * ```
2044
2121
  */
2045
2122
  getActiveRange() {
@@ -2055,7 +2132,9 @@ let j = class {
2055
2132
  * const fWorksheet = fWorkbook.getActiveSheet();
2056
2133
  * const fSelection = fWorksheet.getSelection();
2057
2134
  * const activeRangeList = fSelection.getActiveRangeList();
2058
- * console.log(activeRangeList);
2135
+ * activeRangeList.forEach((range) => {
2136
+ * console.log(range.getA1Notation());
2137
+ * });
2059
2138
  * ```
2060
2139
  */
2061
2140
  getActiveRangeList() {
@@ -2068,9 +2147,13 @@ let j = class {
2068
2147
  * ```ts
2069
2148
  * const fWorkbook = univerAPI.getActiveWorkbook();
2070
2149
  * const fWorksheet = fWorkbook.getActiveSheet();
2150
+ * const fRange = fWorksheet.getRange('A10:B11');
2151
+ * fRange.activate();
2071
2152
  * const fSelection = fWorksheet.getSelection();
2072
2153
  * const currentCell = fSelection.getCurrentCell();
2154
+ * const { actualRow, actualColumn } = currentCell;
2073
2155
  * console.log(currentCell);
2156
+ * console.log(`actualRow: ${actualRow}, actualColumn: ${actualColumn}`); // actualRow: 9, actualColumn: 0
2074
2157
  * ```
2075
2158
  */
2076
2159
  getCurrentCell() {
@@ -2090,7 +2173,7 @@ let j = class {
2090
2173
  * ```
2091
2174
  */
2092
2175
  getActiveSheet() {
2093
- const s = this._injector.createInstance(C, this._workbook);
2176
+ const s = this._injector.createInstance(v, this._workbook);
2094
2177
  return this._injector.createInstance(l, s, this._workbook, this._worksheet);
2095
2178
  }
2096
2179
  /**
@@ -2101,19 +2184,27 @@ let j = class {
2101
2184
  * ```ts
2102
2185
  * const fWorkbook = univerAPI.getActiveWorkbook();
2103
2186
  * const fWorksheet = fWorkbook.getActiveSheet();
2104
- * const fSelection = fWorksheet.getSelection();
2105
- * const cell = fWorksheet.getCell('A1');
2106
- * const newSelection = fSelection.updatePrimaryCell(cell);
2107
- * console.log(newSelection.getActiveRange().getA1Notation()); // A1
2187
+ * const fRange = fWorksheet.getRange('A10:B11');
2188
+ * fRange.activate();
2189
+ * const cell = fWorksheet.getRange('B11');
2190
+ *
2191
+ * let fSelection = fWorksheet.getSelection();
2192
+ * fSelection.updatePrimaryCell(cell);
2193
+ * fSelection = fWorksheet.getSelection();
2194
+ *
2195
+ * const currentCell = fSelection.getCurrentCell();
2196
+ * const { actualRow, actualColumn } = currentCell;
2197
+ * console.log(currentCell);
2198
+ * console.log(`actualRow: ${actualRow}, actualColumn: ${actualColumn}`); // actualRow: 10, actualColumn: 1
2108
2199
  * ```
2109
2200
  */
2110
2201
  updatePrimaryCell(s) {
2111
2202
  const e = this._injector.get(m);
2112
2203
  let t = [], n = !1;
2113
2204
  for (const { range: o, style: i } of this._selections)
2114
- T.contains(o, s.getRange()) ? (t.push({
2205
+ D.contains(o, s.getRange()) ? (t.push({
2115
2206
  range: o,
2116
- primary: ee(s.getRange(), this._worksheet),
2207
+ primary: te(s.getRange(), this._worksheet),
2117
2208
  style: i
2118
2209
  }), n = !0) : t.push({
2119
2210
  range: o,
@@ -2123,7 +2214,7 @@ let j = class {
2123
2214
  n || (t = [
2124
2215
  {
2125
2216
  range: s.getRange(),
2126
- primary: ee(s.getRange(), this._worksheet)
2217
+ primary: te(s.getRange(), this._worksheet)
2127
2218
  }
2128
2219
  ]);
2129
2220
  const r = {
@@ -2134,36 +2225,46 @@ let j = class {
2134
2225
  return e.syncExecuteCommand(Ve.id, r), new j(this._workbook, this._worksheet, t, this._injector);
2135
2226
  }
2136
2227
  /**
2137
- *Get the next primary cell in the specified direction. If the primary cell not exists in selections, return null.
2228
+ * Get the next primary cell in the specified direction. If the primary cell not exists in selections, return null.
2229
+ * The next primary cell in the specified direction is the next cell only within the current selection range.
2230
+ * For example, if the current selection is A1:B2, and the primary cell is B1, the next cell in the right direction is A2 instead of C1.
2138
2231
  * @param {Direction} direction The direction to move the primary cell.The enum value is maybe one of the following: UP(0),RIGHT(1), DOWN(2), LEFT(3).
2139
2232
  * @returns {FRange | null} The next primary cell in the specified direction.
2140
2233
  * @example
2141
2234
  * ```ts
2142
- * // import { Direction } from '@univerjs/core';
2143
2235
  * const fWorkbook = univerAPI.getActiveWorkbook();
2144
2236
  * const fWorksheet = fWorkbook.getActiveSheet();
2145
- * // make sure the active cell is A1 and selection is A1:C3
2146
- * const fSelection = fWorksheet.getSelection();
2147
- * const nextCell = fSelection.getNextDataRange(Direction.RIGHT);
2237
+ * // make sure the active cell is A1 and selection is A1:B2
2238
+ * const fRange = fWorksheet.getRange('A1:B2');
2239
+ * fRange.activate();
2240
+ *
2241
+ * // get the next cell in the right direction, and update the primary cell to the next cell, now the active cell is B1
2242
+ * let fSelection = fWorksheet.getSelection();
2243
+ * const nextCell = fSelection.getNextDataRange(univerAPI.Enum.Direction.RIGHT);
2148
2244
  * console.log(nextCell?.getA1Notation()); // B1
2245
+ * fSelection = fSelection.updatePrimaryCell(nextCell);
2246
+ *
2247
+ * // get the next cell in the right direction, the next cell is A2
2248
+ * const nextCell2 = fSelection.getNextDataRange(univerAPI.Enum.Direction.RIGHT);
2249
+ * console.log(nextCell2?.getA1Notation()); // A2
2149
2250
  * ```
2150
2251
  */
2151
2252
  getNextDataRange(s) {
2152
2253
  if (!this._selections.find((n) => !!n.primary))
2153
2254
  return null;
2154
- const t = ft(this._selections.concat(), s, this._worksheet);
2255
+ const t = vt(this._selections.concat(), s, this._worksheet);
2155
2256
  return t ? this._injector.createInstance(k, this._workbook, this._worksheet, t) : null;
2156
2257
  }
2157
2258
  };
2158
- j = nn([
2159
- rn(3, u(b))
2259
+ j = an([
2260
+ hn(3, u(p))
2160
2261
  ], j);
2161
- var sn = Object.getOwnPropertyDescriptor, on = (s, e, t, n) => {
2162
- for (var r = n > 1 ? void 0 : n ? sn(e, t) : e, o = s.length - 1, i; o >= 0; o--)
2262
+ var dn = Object.getOwnPropertyDescriptor, cn = (s, e, t, n) => {
2263
+ for (var r = n > 1 ? void 0 : n ? dn(e, t) : e, o = s.length - 1, i; o >= 0; o--)
2163
2264
  (i = s[o]) && (r = i(r) || r);
2164
2265
  return r;
2165
2266
  }, B = (s, e) => (t, n) => e(t, n, s);
2166
- let l = class extends ce {
2267
+ let l = class extends he {
2167
2268
  /**
2168
2269
  * Creates a new worksheet facade instance
2169
2270
  * @param {FWorkbook} _fWorkbook - The facade workbook instance
@@ -2182,78 +2283,86 @@ let l = class extends ce {
2182
2283
  * @returns This sheet, for chaining
2183
2284
  * @example
2184
2285
  * ```ts
2185
- * const fWorkbook = univerAPI.getActiveWorkbook();
2186
- * const fWorkSheet = fWorkbook.getActiveSheet();
2187
- * fWorkSheet.setActiveRange(fWorkSheet.getRange('A1'));
2286
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
2287
+ * fWorkSheet.setActiveSelection(fWorkSheet.getRange('A10:B10'));
2188
2288
  * ```
2189
2289
  */
2190
- v(this, "setActiveSelection", this.setActiveRange);
2290
+ I(this, "setActiveSelection", this.setActiveRange);
2191
2291
  this._fWorkbook = e, this._workbook = t, this._worksheet = n, this._injector = r, this._selectionManagerService = o, this._logService = i, this._commandService = a;
2192
2292
  }
2193
2293
  /**
2194
- * Returns the worksheet
2294
+ * Get the worksheet instance.
2195
2295
  * @returns {Worksheet} The worksheet instance.
2196
2296
  * @example
2197
2297
  * ```typescript
2198
- * const sheet = univerAPI.getActiveWorkbook().getActiveSheet().getSheet();
2298
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2299
+ * const sheet = fWorksheet.getSheet();
2300
+ * console.log(sheet);
2199
2301
  * ```
2200
2302
  */
2201
2303
  getSheet() {
2202
2304
  return this._worksheet;
2203
2305
  }
2204
2306
  /**
2205
- * Returns the injector
2206
- * @returns {Injector} The injector
2307
+ * Get the injector instance.
2308
+ * @returns {Injector} The injector instance.
2207
2309
  * @example
2208
2310
  * ```typescript
2209
- * const injector = univerAPI.getActiveWorkbook().getActiveSheet().getInject();
2311
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2312
+ * const injector = fWorksheet.getInject();
2313
+ * console.log(injector);
2210
2314
  * ```
2211
2315
  */
2212
2316
  getInject() {
2213
2317
  return this._injector;
2214
2318
  }
2215
2319
  /**
2216
- * Returns the workbook
2320
+ * Get the workbook instance.
2217
2321
  * @returns {Workbook} The workbook instance.
2218
2322
  * @example
2219
2323
  * ```typescript
2220
- * const workbook = univerAPI.getActiveWorkbook().getWorkbook();
2324
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2325
+ * const workbook = fWorksheet.getWorkbook();
2326
+ * console.log(workbook);
2221
2327
  * ```
2222
2328
  */
2223
2329
  getWorkbook() {
2224
2330
  return this._workbook;
2225
2331
  }
2226
2332
  /**
2227
- * Returns the worksheet id.
2333
+ * Get the worksheet id.
2228
2334
  * @returns {string} The id of the worksheet.
2229
2335
  * @example
2230
2336
  * ```typescript
2231
- * const sheet = univerAPI.getActiveWorkbook().getActiveSheet();
2232
- * const id = sheet.getSheetId();
2337
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2338
+ * const sheetId = fWorksheet.getSheetId();
2339
+ * console.log(sheetId);
2233
2340
  * ```
2234
2341
  */
2235
2342
  getSheetId() {
2236
2343
  return this._worksheet.getSheetId();
2237
2344
  }
2238
2345
  /**
2239
- * Returns the worksheet name.
2346
+ * Get the worksheet name.
2240
2347
  * @returns {string} The name of the worksheet.
2241
2348
  * @example
2242
2349
  * ```typescript
2243
- * const sheet = univerAPI.getActiveWorkbook().getActiveSheet();
2244
- * const name = sheet.getSheetName();
2350
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2351
+ * const sheetName = fWorksheet.getSheetName();
2352
+ * console.log(sheetName);
2245
2353
  * ```
2246
2354
  */
2247
2355
  getSheetName() {
2248
2356
  return this._worksheet.getName();
2249
2357
  }
2250
2358
  /**
2251
- * Represents the selection ranges info of the worksheet.
2359
+ * Get the current selection of the worksheet.
2252
2360
  * @returns {FSelection} return the current selections of the worksheet or null if there is no selection.
2253
2361
  * @example
2254
2362
  * ```typescript
2255
- * const sheet = univerAPI.getActiveWorkbook().getActiveSheet();
2256
- * const selections = sheet.getSelection();
2363
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2364
+ * const selection = fWorksheet.getSelection();
2365
+ * console.log(selection);
2257
2366
  * ```
2258
2367
  */
2259
2368
  getSelection() {
@@ -2263,12 +2372,13 @@ let l = class extends ce {
2263
2372
  // #region rows
2264
2373
  // #region default style
2265
2374
  /**
2266
- * Get the default style of the worksheet
2375
+ * Get the default style of the worksheet.
2267
2376
  * @returns {IStyleData} Default style of the worksheet.
2268
2377
  * @example
2269
2378
  * ```typescript
2270
- * const sheet = workbook.getActiveSheet();
2271
- * const defaultStyle = sheet.getDefaultStyle();
2379
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2380
+ * const defaultStyle = fWorksheet.getDefaultStyle();
2381
+ * console.log(defaultStyle);
2272
2382
  * ```
2273
2383
  */
2274
2384
  getDefaultStyle() {
@@ -2281,11 +2391,13 @@ let l = class extends ce {
2281
2391
  * @returns {(Nullable<IStyleData> | string)} The default style of the worksheet row name or style data
2282
2392
  * @example
2283
2393
  * ```typescript
2284
- * const sheet = univerAPI.getActiveWorkbook().getActiveSheet();
2394
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2285
2395
  * // Get default style for row 0 (1)
2286
- * const rowStyle = sheet.getRowDefaultStyle(0);
2396
+ * const rowStyle = fWorksheet.getRowDefaultStyle(0);
2397
+ * console.log(rowStyle);
2287
2398
  * // Get raw style data for row 0
2288
- * const rawRowStyle = sheet.getRowDefaultStyle(0, true);
2399
+ * const rawRowStyle = fWorksheet.getRowDefaultStyle(0, true);
2400
+ * console.log(rawRowStyle);
2289
2401
  * ```
2290
2402
  */
2291
2403
  getRowDefaultStyle(e, t = !1) {
@@ -2298,11 +2410,13 @@ let l = class extends ce {
2298
2410
  * @returns {(Nullable<IStyleData> | string)} The default style of the worksheet column name or style data
2299
2411
  * @example
2300
2412
  * ```typescript
2301
- * const sheet = univerAPI.getActiveWorkbook().getActiveSheet();
2413
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2302
2414
  * // Get default style for column 0 (A)
2303
- * const colStyle = sheet.getColumnDefaultStyle(0);
2415
+ * const colStyle = fWorksheet.getColumnDefaultStyle(0);
2416
+ * console.log(colStyle);
2304
2417
  * // Get raw style data for column 0
2305
- * const rawColStyle = sheet.getColumnDefaultStyle(0, true);
2418
+ * const rawColStyle = fWorksheet.getColumnDefaultStyle(0, true);
2419
+ * console.log(rawColStyle);
2306
2420
  * ```
2307
2421
  */
2308
2422
  getColumnDefaultStyle(e, t = !1) {
@@ -2314,8 +2428,7 @@ let l = class extends ce {
2314
2428
  * @returns {FWorksheet} This worksheet instance for chaining
2315
2429
  * @example
2316
2430
  * ```typescript
2317
- * const fWorkbook = univerAPI.getActiveWorkbook();
2318
- * const fWorksheet = fWorkbook.getActiveSheet();
2431
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2319
2432
  * fWorksheet.setDefaultStyle('default');
2320
2433
  * // or
2321
2434
  * // fWorksheet.setDefaultStyle({fs: 12, ff: 'Arial'});
@@ -2323,7 +2436,7 @@ let l = class extends ce {
2323
2436
  */
2324
2437
  setDefaultStyle(e) {
2325
2438
  const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId();
2326
- return this._commandService.syncExecuteCommand(vt.id, {
2439
+ return this._commandService.syncExecuteCommand(ft.id, {
2327
2440
  unitId: t,
2328
2441
  subUnitId: n,
2329
2442
  defaultStyle: e
@@ -2338,9 +2451,9 @@ let l = class extends ce {
2338
2451
  * ```ts
2339
2452
  * const fWorkbook = univerAPI.getActiveWorkbook();
2340
2453
  * const fWorksheet = fWorkbook.getActiveSheet();
2341
- * fWorksheet.setRowDefaultStyle(0, 'default');
2454
+ * fWorksheet.setColumnDefaultStyle(0, 'default');
2342
2455
  * // or
2343
- * // fWorksheet.setRowDefaultStyle(0, {fs: 12, ff: 'Arial'});
2456
+ * // fWorksheet.setColumnDefaultStyle(0, {fs: 12, ff: 'Arial'});
2344
2457
  * ```
2345
2458
  */
2346
2459
  setColumnDefaultStyle(e, t) {
@@ -2353,7 +2466,7 @@ let l = class extends ce {
2353
2466
  }
2354
2467
  }
2355
2468
  };
2356
- return this._commandService.syncExecuteCommand(ke.id, o), this;
2469
+ return this._commandService.syncExecuteCommand(le.id, o), this;
2357
2470
  }
2358
2471
  /**
2359
2472
  * Set the default style of the worksheet column
@@ -2364,9 +2477,9 @@ let l = class extends ce {
2364
2477
  * ```ts
2365
2478
  * const fWorkbook = univerAPI.getActiveWorkbook();
2366
2479
  * const fWorksheet = fWorkbook.getActiveSheet();
2367
- * fWorksheet.setColumnDefaultStyle(0, 'default');
2480
+ * fWorksheet.setRowDefaultStyle(0, 'default');
2368
2481
  * // or
2369
- * // fWorksheet.setColumnDefaultStyle(0, {fs: 12, ff: 'Arial'});
2482
+ * // fWorksheet.setRowDefaultStyle(0, {fs: 12, ff: 'Arial'});
2370
2483
  * ```
2371
2484
  */
2372
2485
  setRowDefaultStyle(e, t) {
@@ -2379,14 +2492,14 @@ let l = class extends ce {
2379
2492
  }
2380
2493
  }
2381
2494
  };
2382
- return this._commandService.syncExecuteCommand(Se.id, o), this;
2495
+ return this._commandService.syncExecuteCommand(_e.id, o), this;
2383
2496
  }
2384
2497
  getRange(e, t, n, r) {
2385
2498
  let o, i;
2386
2499
  if (typeof e == "object")
2387
2500
  o = e, i = this._worksheet;
2388
2501
  else if (typeof e == "string") {
2389
- const { range: a, sheetName: h } = Lt(e), d = h ? this._workbook.getSheetBySheetName(h) : this._worksheet;
2502
+ const { range: a, sheetName: h } = qt(e), d = h ? this._workbook.getSheetBySheetName(h) : this._worksheet;
2390
2503
  if (!d)
2391
2504
  throw new Error("Range not found");
2392
2505
  i = d, o = {
@@ -2419,8 +2532,8 @@ let l = class extends ce {
2419
2532
  * @returns {number} The maximum columns count of the sheet
2420
2533
  * @example
2421
2534
  * ```typescript
2422
- * const sheet = workbook.getActiveSheet();
2423
- * const totalColumns = sheet.getMaxColumns();
2535
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2536
+ * const totalColumns = fWorksheet.getMaxColumns();
2424
2537
  * console.log(`Sheet has ${totalColumns} columns`);
2425
2538
  * ```
2426
2539
  */
@@ -2432,8 +2545,8 @@ let l = class extends ce {
2432
2545
  * @returns {number}The maximum rows count of the sheet
2433
2546
  * @example
2434
2547
  * ```typescript
2435
- * const sheet = workbook.getActiveSheet();
2436
- * const totalRows = sheet.getMaxRows();
2548
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2549
+ * const totalRows = fWorksheet.getMaxRows();
2437
2550
  * console.log(`Sheet has ${totalRows} rows`);
2438
2551
  * ```
2439
2552
  */
@@ -2446,11 +2559,11 @@ let l = class extends ce {
2446
2559
  * @returns {FWorksheet} This sheet, for chaining.
2447
2560
  * @example
2448
2561
  * ```typescript
2449
- * const sheet = workbook.getActiveSheet();
2450
- * // Insert 3 rows at row index 2 (before the third row)
2451
- * sheet.insertRowAfter(2);
2452
- * // Insert 1 row at row index 0 (before the first row)
2453
- * sheet.insertRowAfter(0);
2562
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2563
+ * // Insert a row after the third row
2564
+ * fWorksheet.insertRowAfter(2);
2565
+ * // Insert a row after the first row
2566
+ * fWorksheet.insertRowAfter(0);
2454
2567
  * ```
2455
2568
  */
2456
2569
  insertRowAfter(e) {
@@ -2462,11 +2575,11 @@ let l = class extends ce {
2462
2575
  * @returns {FWorksheet} This sheet, for chaining.
2463
2576
  * @example
2464
2577
  * ```typescript
2465
- * const sheet = workbook.getActiveSheet();
2466
- * // Insert 3 rows at row index 2 (before the third row)
2467
- * sheet.insertRowBefore(2);
2468
- * // Insert 1 row at row index 0 (before the first row)
2469
- * sheet.insertRowBefore(0);
2578
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2579
+ * // Insert a row before the third row
2580
+ * fWorksheet.insertRowBefore(2);
2581
+ * // Insert a row before the first row
2582
+ * fWorksheet.insertRowBefore(0);
2470
2583
  * ```
2471
2584
  */
2472
2585
  insertRowBefore(e) {
@@ -2479,11 +2592,11 @@ let l = class extends ce {
2479
2592
  * @returns {FWorksheet} This sheet, for chaining.
2480
2593
  * @example
2481
2594
  * ```typescript
2482
- * const sheet = workbook.getActiveSheet();
2483
- * // Insert 3 rows at row index 2 (before the third row)
2484
- * sheet.insertRows(2, 3);
2485
- * // Insert 1 row at row index 0 (before the first row)
2486
- * sheet.insertRows(0);
2595
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2596
+ * // Insert 3 rows before the third row
2597
+ * fWorksheet.insertRows(2, 3);
2598
+ * // Insert 1 row before the first row
2599
+ * fWorksheet.insertRows(0);
2487
2600
  * ```
2488
2601
  */
2489
2602
  insertRows(e, t = 1) {
@@ -2496,16 +2609,16 @@ let l = class extends ce {
2496
2609
  * @returns {FWorksheet} This sheet, for chaining.
2497
2610
  * @example
2498
2611
  * ```typescript
2499
- * const sheet = workbook.getActiveSheet();
2500
- * // Insert 3 rows at row index 2 (before the third row)
2501
- * sheet.insertRowsAfter(2, 3);
2502
- * // Insert 1 row at row index 0 (before the first row)
2503
- * sheet.insertRowsAfter(0);
2612
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2613
+ * // Insert 3 rows after the third row
2614
+ * fWorksheet.insertRowsAfter(2, 3);
2615
+ * // Insert 1 row after the first row
2616
+ * fWorksheet.insertRowsAfter(0, 1);
2504
2617
  * ```
2505
2618
  */
2506
2619
  insertRowsAfter(e, t) {
2507
- const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = M.DOWN, i = e + 1, a = e + t, h = 0, d = this._worksheet.getColumnCount() - 1, c = A(this._worksheet, i, a, h, d, !0, e);
2508
- return this._commandService.syncExecuteCommand(we.id, {
2620
+ const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = A.DOWN, i = e + 1, a = e + t, h = 0, d = this._worksheet.getColumnCount() - 1, c = W(this._worksheet, i, a, h, d, !0, e);
2621
+ return this._commandService.syncExecuteCommand(ke.id, {
2509
2622
  unitId: n,
2510
2623
  subUnitId: r,
2511
2624
  direction: o,
@@ -2525,16 +2638,16 @@ let l = class extends ce {
2525
2638
  * @returns {FWorksheet} This sheet, for chaining.
2526
2639
  * @example
2527
2640
  * ```typescript
2528
- * const sheet = workbook.getActiveSheet();
2529
- * // Insert 3 rows at row index 2 (before the third row)
2530
- * sheet.insertRowsBefore(2, 3);
2531
- * // Insert 1 row at row index 0 (before the first row)
2532
- * sheet.insertRowsBefore(0);
2641
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2642
+ * // Insert 3 rows before the third row
2643
+ * fWorksheet.insertRowsBefore(2, 3);
2644
+ * // Insert 1 row before the first row
2645
+ * fWorksheet.insertRowsBefore(0, 1);
2533
2646
  * ```
2534
2647
  */
2535
2648
  insertRowsBefore(e, t) {
2536
- const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = M.UP, i = e, a = e + t - 1, h = 0, d = this._worksheet.getColumnCount() - 1, c = A(this._worksheet, i, a, h, d, !0, e - 1);
2537
- return this._commandService.syncExecuteCommand(we.id, {
2649
+ const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = A.UP, i = e, a = e + t - 1, h = 0, d = this._worksheet.getColumnCount() - 1, c = W(this._worksheet, i, a, h, d, !0, e - 1);
2650
+ return this._commandService.syncExecuteCommand(ke.id, {
2538
2651
  unitId: n,
2539
2652
  subUnitId: r,
2540
2653
  direction: o,
@@ -2553,11 +2666,11 @@ let l = class extends ce {
2553
2666
  * @returns {FWorksheet} This sheet, for chaining.
2554
2667
  * @example
2555
2668
  * ```typescript
2556
- * const sheet = workbook.getActiveSheet();
2557
- * // Delete 3 rows at row index 2 (rows 3-5)
2558
- * sheet.deleteRow(2);
2559
- * // Delete 1 row at row index 0 (first row)
2560
- * sheet.deleteRow(0);
2669
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2670
+ * // Delete the third row
2671
+ * fWorksheet.deleteRow(2);
2672
+ * // Delete the first row
2673
+ * fWorksheet.deleteRow(0);
2561
2674
  * ```
2562
2675
  */
2563
2676
  deleteRow(e) {
@@ -2570,11 +2683,11 @@ let l = class extends ce {
2570
2683
  * @returns {FWorksheet} This sheet, for chaining.
2571
2684
  * @example
2572
2685
  * ```typescript
2573
- * const sheet = workbook.getActiveSheet();
2686
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2574
2687
  * // Delete 3 rows at row index 2 (rows 3-5)
2575
- * sheet.deleteRows(2, 3);
2688
+ * fWorksheet.deleteRows(2, 3);
2576
2689
  * // Delete 1 row at row index 0 (first row)
2577
- * sheet.deleteRows(0);
2690
+ * fWorksheet.deleteRows(0, 1);
2578
2691
  * ```
2579
2692
  */
2580
2693
  deleteRows(e, t) {
@@ -2597,15 +2710,17 @@ let l = class extends ce {
2597
2710
  * @returns {FWorksheet} This sheet, for chaining.
2598
2711
  * @example
2599
2712
  * ```typescript
2600
- * const sheet = workbook.getActiveSheet();
2713
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2601
2714
  * // Move 3 rows at row index 2 (rows 3-5) to row index 0
2602
- * sheet.moveRows(rowSpec, 0);
2715
+ * const rowSpec1 = fWorksheet.getRange('3:5');
2716
+ * fWorksheet.moveRows(rowSpec1, 0);
2603
2717
  * // Move 1 row at row index 0 (first row) to row index 2
2604
- * sheet.moveRows(rowSpec, 2);
2718
+ * const rowSpec2 = fWorksheet.getRange('1:1');
2719
+ * fWorksheet.moveRows(rowSpec2, 2);
2605
2720
  * ```
2606
2721
  */
2607
2722
  moveRows(e, t) {
2608
- const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = $(e.getRange(), this._worksheet), i = o, a = {
2723
+ const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = q(e.getRange(), this._worksheet), i = o, a = {
2609
2724
  startRow: t,
2610
2725
  endRow: t,
2611
2726
  startColumn: o.startColumn,
@@ -2625,16 +2740,18 @@ let l = class extends ce {
2625
2740
  * @returns {FWorksheet} This sheet, for chaining.
2626
2741
  * @example
2627
2742
  * ```typescript
2628
- * const sheet = workbook.getActiveSheet();
2743
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2629
2744
  * // Hide 3 rows starting from row index 1 (rows 2-4)
2630
- * sheet.hideRow(1);
2745
+ * const row1 = fWorksheet.getRange('2:4');
2746
+ * fWorksheet.hideRow(row1);
2631
2747
  * // Hide single row at index 0 (first row)
2632
- * sheet.hideRow(0);
2748
+ * const row2 = fWorksheet.getRange('1:1');
2749
+ * fWorksheet.hideRow(row2);
2633
2750
  * ```
2634
2751
  */
2635
2752
  hideRow(e) {
2636
- const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = $(e.getRange(), this._worksheet);
2637
- return this._commandService.syncExecuteCommand(Ce.id, {
2753
+ const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = q(e.getRange(), this._worksheet);
2754
+ return this._commandService.syncExecuteCommand(we.id, {
2638
2755
  unitId: t,
2639
2756
  subUnitId: n,
2640
2757
  ranges: [r]
@@ -2647,11 +2764,11 @@ let l = class extends ce {
2647
2764
  * @returns {FWorksheet} This sheet, for chaining.
2648
2765
  * @example
2649
2766
  * ```typescript
2650
- * const sheet = workbook.getActiveSheet();
2767
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2651
2768
  * // Hide 3 rows starting from row index 1 (rows 2-4)
2652
- * sheet.hideRows(1, 3);
2769
+ * fWorksheet.hideRows(1, 3);
2653
2770
  * // Hide single row at index 0 (first row)
2654
- * sheet.hideRows(0);
2771
+ * fWorksheet.hideRows(0);
2655
2772
  * ```
2656
2773
  */
2657
2774
  hideRows(e, t = 1) {
@@ -2662,7 +2779,7 @@ let l = class extends ce {
2662
2779
  endColumn: this._worksheet.getColumnCount() - 1,
2663
2780
  rangeType: _.ROW
2664
2781
  };
2665
- return this._commandService.syncExecuteCommand(Ce.id, {
2782
+ return this._commandService.syncExecuteCommand(we.id, {
2666
2783
  unitId: n,
2667
2784
  subUnitId: r,
2668
2785
  ranges: [o]
@@ -2674,16 +2791,18 @@ let l = class extends ce {
2674
2791
  * @returns {FWorksheet} This sheet, for chaining.
2675
2792
  * @example
2676
2793
  * ```typescript
2677
- * const sheet = workbook.getActiveSheet();
2794
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2678
2795
  * // Unhide 3 rows starting from row index 1 (rows 2-4)
2679
- * sheet.unhideRow(1);
2796
+ * const row1 = fWorksheet.getRange('2:4');
2797
+ * fWorksheet.unhideRow(row1);
2680
2798
  * // Unhide single row at index 0 (first row)
2681
- * sheet.unhideRow(0);
2799
+ * const row2 = fWorksheet.getRange('1:1');
2800
+ * fWorksheet.unhideRow(row2);
2682
2801
  * ```
2683
2802
  */
2684
2803
  unhideRow(e) {
2685
- const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = $(e.getRange(), this._worksheet);
2686
- return this._commandService.syncExecuteCommand(fe.id, {
2804
+ const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = q(e.getRange(), this._worksheet);
2805
+ return this._commandService.syncExecuteCommand(Se.id, {
2687
2806
  unitId: t,
2688
2807
  subUnitId: n,
2689
2808
  ranges: [r]
@@ -2696,11 +2815,11 @@ let l = class extends ce {
2696
2815
  * @returns {FWorksheet} This worksheet instance for chaining
2697
2816
  * @example
2698
2817
  * ```typescript
2699
- * const sheet = workbook.getActiveSheet();
2818
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2700
2819
  * // Show 3 rows starting from row index 1 (rows 2-4)
2701
- * sheet.showRows(1);
2820
+ * fWorksheet.showRows(1, 3);
2702
2821
  * // Show single row at index 0 (first row)
2703
- * sheet.showRows(0);
2822
+ * fWorksheet.showRows(0);
2704
2823
  * ```
2705
2824
  */
2706
2825
  showRows(e, t = 1) {
@@ -2711,7 +2830,7 @@ let l = class extends ce {
2711
2830
  endColumn: this._worksheet.getColumnCount() - 1,
2712
2831
  rangeType: _.ROW
2713
2832
  };
2714
- return this._commandService.syncExecuteCommand(fe.id, {
2833
+ return this._commandService.syncExecuteCommand(Se.id, {
2715
2834
  unitId: n,
2716
2835
  subUnitId: r,
2717
2836
  ranges: [o]
@@ -2724,11 +2843,11 @@ let l = class extends ce {
2724
2843
  * @returns {FWorksheet} This worksheet instance for chaining
2725
2844
  * @example
2726
2845
  * ```typescript
2727
- * const sheet = workbook.getActiveSheet();
2846
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2728
2847
  * // Set the height of the second row to 30 pixels
2729
- * sheet.setRowHeight(1, 30);
2848
+ * fWorksheet.setRowHeight(1, 30);
2730
2849
  * // Set the height of the first row to 20 pixels
2731
- * sheet.setRowHeight(0, 20);
2850
+ * fWorksheet.setRowHeight(0, 20);
2732
2851
  * ```
2733
2852
  */
2734
2853
  setRowHeight(e, t) {
@@ -2736,14 +2855,13 @@ let l = class extends ce {
2736
2855
  }
2737
2856
  /**
2738
2857
  * Make certain row wrap and auto height.
2739
- * @param rowPosition
2740
- * @param auto
2741
- * @returns {FWorksheet} this
2858
+ * @param {number} rowPosition - The row position to change.
2859
+ * @param {BooleanNumber} auto - Whether to auto fit the row height.
2860
+ * @returns {FWorksheet} This worksheet instance for chaining
2742
2861
  * @example
2743
2862
  * ```ts
2744
- const fWorkbook = univerAPI.getActiveWorkbook();
2745
- const fWorkSheet = fWorkbook.getActiveSheet();
2746
- fWorkSheet.autoFitRow(24);
2863
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
2864
+ * fWorkSheet.autoFitRow(24);
2747
2865
  * ```
2748
2866
  */
2749
2867
  autoFitRow(e, t = g.TRUE) {
@@ -2753,11 +2871,11 @@ let l = class extends ce {
2753
2871
  startColumn: 0,
2754
2872
  endColumn: this._worksheet.getColumnCount() - 1
2755
2873
  }];
2756
- return this._commandService.syncExecuteCommand(Z.id, {
2874
+ return this._commandService.syncExecuteCommand(ee.id, {
2757
2875
  unitId: this._workbook.getUnitId(),
2758
2876
  subUnitId: this._worksheet.getSheetId(),
2759
2877
  range: o[0],
2760
- value: Y.WRAP
2878
+ value: J.WRAP
2761
2879
  }), this._commandService.syncExecuteCommand(
2762
2880
  bt.id,
2763
2881
  {
@@ -2777,28 +2895,28 @@ let l = class extends ce {
2777
2895
  * @returns {FWorksheet} This worksheet instance for chaining
2778
2896
  * @example
2779
2897
  * ```typescript
2780
- * const sheet = workbook.getActiveSheet();
2781
- * sheet.setRowHeights(1, 10, 30);
2898
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2899
+ * fWorksheet.setRowHeights(1, 10, 30);
2782
2900
  * ```
2783
2901
  */
2784
2902
  setRowHeights(e, t, n) {
2785
2903
  var d;
2786
2904
  const r = this._workbook.getUnitId(), o = this._worksheet.getSheetId(), i = this._worksheet.getRowManager(), a = [], h = [];
2787
2905
  for (let c = e; c < e + t; c++) {
2788
- const L = ((d = i.getRow(c)) == null ? void 0 : d.ah) || this._worksheet.getConfig().defaultRowHeight, D = {
2906
+ const z = ((d = i.getRow(c)) == null ? void 0 : d.ah) || this._worksheet.getConfig().defaultRowHeight, M = {
2789
2907
  startRow: c,
2790
2908
  endRow: c,
2791
2909
  startColumn: 0,
2792
2910
  endColumn: this._worksheet.getColumnCount() - 1
2793
2911
  };
2794
- n <= L ? a.push(D) : h.push(D);
2912
+ n <= z ? a.push(M) : h.push(M);
2795
2913
  }
2796
- return h.length > 0 && this._commandService.syncExecuteCommand(ve.id, {
2914
+ return h.length > 0 && this._commandService.syncExecuteCommand(Ce.id, {
2797
2915
  unitId: r,
2798
2916
  subUnitId: o,
2799
2917
  ranges: h,
2800
2918
  value: n
2801
- }), a.length > 0 && this._commandService.syncExecuteCommand(Ie.id, {
2919
+ }), a.length > 0 && this._commandService.syncExecuteCommand(ve.id, {
2802
2920
  unitId: r,
2803
2921
  subUnitId: o,
2804
2922
  ranges: a
@@ -2811,8 +2929,8 @@ let l = class extends ce {
2811
2929
  * @returns {FWorksheet} This worksheet instance for chaining
2812
2930
  * @example
2813
2931
  * ```typescript
2814
- * const sheet = workbook.getActiveSheet();
2815
- * sheet.setRowAutoHeight(1, 10);
2932
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2933
+ * fWorksheet.setRowAutoHeight(1, 10);
2816
2934
  * ```
2817
2935
  */
2818
2936
  setRowAutoHeight(e, t) {
@@ -2824,7 +2942,7 @@ let l = class extends ce {
2824
2942
  endColumn: this._worksheet.getColumnCount() - 1
2825
2943
  }
2826
2944
  ];
2827
- return this._commandService.syncExecuteCommand(Ie.id, {
2945
+ return this._commandService.syncExecuteCommand(ve.id, {
2828
2946
  unitId: n,
2829
2947
  subUnitId: r,
2830
2948
  ranges: o
@@ -2838,8 +2956,8 @@ let l = class extends ce {
2838
2956
  * @returns {FWorksheet} This worksheet instance for chaining
2839
2957
  * @example
2840
2958
  * ```typescript
2841
- * const sheet = workbook.getActiveSheet();
2842
- * sheet.setRowHeightsForced(1, 10, 30);
2959
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
2960
+ * fWorksheet.setRowHeightsForced(1, 10, 30);
2843
2961
  * ```
2844
2962
  */
2845
2963
  setRowHeightsForced(e, t, n) {
@@ -2851,7 +2969,7 @@ let l = class extends ce {
2851
2969
  endColumn: this._worksheet.getColumnCount() - 1
2852
2970
  }
2853
2971
  ];
2854
- return this._commandService.syncExecuteCommand(ve.id, {
2972
+ return this._commandService.syncExecuteCommand(Ce.id, {
2855
2973
  unitId: r,
2856
2974
  subUnitId: o,
2857
2975
  ranges: i,
@@ -2865,9 +2983,8 @@ let l = class extends ce {
2865
2983
  * @returns {FWorksheet} This worksheet instance for chaining
2866
2984
  * @example
2867
2985
  * ```typescript
2868
- * const fWorkbook = univerAPI.getActiveWorkbook();
2869
- * const fWorkSheet = fWorkbook.getActiveSheet();
2870
- * fWorkSheet.setRowCustom({ key: 'value' });
2986
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
2987
+ * fWorkSheet.setRowCustom({ 0: { key: 'value' } });
2871
2988
  * ```
2872
2989
  */
2873
2990
  setRowCustom(e) {
@@ -2881,7 +2998,7 @@ let l = class extends ce {
2881
2998
  subUnitId: n,
2882
2999
  rowData: r
2883
3000
  };
2884
- return this._commandService.syncExecuteCommand(Se.id, o), this;
3001
+ return this._commandService.syncExecuteCommand(_e.id, o), this;
2885
3002
  }
2886
3003
  // #region Column
2887
3004
  /**
@@ -2890,11 +3007,11 @@ let l = class extends ce {
2890
3007
  * @returns {FWorksheet} This worksheet instance for chaining
2891
3008
  * @example
2892
3009
  * ```typescript
2893
- * const sheet = workbook.getActiveSheet();
2894
- * // Insert 3 columns at column index 2 (before column C)
2895
- * sheet.insertColumnAfter(2);
2896
- * // Insert 1 column at column index 0 (before column A)
2897
- * sheet.insertColumnAfter(0);
3010
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3011
+ * // Insert a column after column C
3012
+ * fWorksheet.insertColumnAfter(2);
3013
+ * // Insert a column after column A
3014
+ * fWorksheet.insertColumnAfter(0);
2898
3015
  * ```
2899
3016
  */
2900
3017
  insertColumnAfter(e) {
@@ -2906,11 +3023,11 @@ let l = class extends ce {
2906
3023
  * @returns {FWorksheet} This worksheet instance for chaining
2907
3024
  * @example
2908
3025
  * ```typescript
2909
- * const sheet = workbook.getActiveSheet();
2910
- * // Insert 3 columns at column index 2 (before column C)
2911
- * sheet.insertColumnBefore(2);
2912
- * // Insert 1 column at column index 0 (before column A)
2913
- * sheet.insertColumnBefore(0);
3026
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3027
+ * // Insert a column before column C
3028
+ * fWorksheet.insertColumnBefore(2);
3029
+ * // Insert a column before column A
3030
+ * fWorksheet.insertColumnBefore(0);
2914
3031
  * ```
2915
3032
  */
2916
3033
  insertColumnBefore(e) {
@@ -2923,11 +3040,11 @@ let l = class extends ce {
2923
3040
  * @returns {FWorksheet} This sheet, for chaining
2924
3041
  * @example
2925
3042
  * ```typescript
2926
- * const sheet = workbook.getActiveSheet();
2927
- * // Insert 3 columns at column index 2 (before column C)
2928
- * sheet.insertColumns(2, 3);
2929
- * // Insert 1 column at column index 0 (before column A)
2930
- * sheet.insertColumns(0);
3043
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3044
+ * // Insert 3 columns before column C
3045
+ * fWorksheet.insertColumns(2, 3);
3046
+ * // Insert 1 column before column A
3047
+ * fWorksheet.insertColumns(0);
2931
3048
  * ```
2932
3049
  */
2933
3050
  insertColumns(e, t = 1) {
@@ -2940,16 +3057,16 @@ let l = class extends ce {
2940
3057
  * @returns {FWorksheet} This sheet, for chaining
2941
3058
  * @example
2942
3059
  * ```typescript
2943
- * const sheet = workbook.getActiveSheet();
2944
- * // Insert 3 columns at column index 2 (before column C)
2945
- * sheet.insertColumnsAfter(2, 3);
2946
- * // Insert 1 column at column index 0 (before column A)
2947
- * sheet.insertColumnsAfter(0, 1);
3060
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3061
+ * // Insert 3 columns after column C
3062
+ * fWorksheet.insertColumnsAfter(2, 3);
3063
+ * // Insert 1 column after column A
3064
+ * fWorksheet.insertColumnsAfter(0, 1);
2948
3065
  * ```
2949
3066
  */
2950
3067
  insertColumnsAfter(e, t) {
2951
- const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = M.RIGHT, i = 0, a = this._worksheet.getRowCount() - 1, h = e + 1, d = e + t, c = A(this._worksheet, i, a, h, d, !1, e);
2952
- return this._commandService.syncExecuteCommand(Re.id, {
3068
+ const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = A.RIGHT, i = 0, a = this._worksheet.getRowCount() - 1, h = e + 1, d = e + t, c = W(this._worksheet, i, a, h, d, !1, e);
3069
+ return this._commandService.syncExecuteCommand(fe.id, {
2953
3070
  unitId: n,
2954
3071
  subUnitId: r,
2955
3072
  direction: o,
@@ -2969,16 +3086,16 @@ let l = class extends ce {
2969
3086
  * @returns {FWorksheet} This sheet, for chaining
2970
3087
  * @example
2971
3088
  * ```typescript
2972
- * const sheet = workbook.getActiveSheet();
2973
- * // Insert 3 columns at column index 2 (before column C)
2974
- * sheet.insertColumnsBefore(2, 3);
2975
- * // Insert 1 column at column index 0 (before column A)
2976
- * sheet.insertColumnsBefore(0, 1);
3089
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3090
+ * // Insert 3 columns before column C
3091
+ * fWorksheet.insertColumnsBefore(2, 3);
3092
+ * // Insert 1 column before column A
3093
+ * fWorksheet.insertColumnsBefore(0, 1);
2977
3094
  * ```
2978
3095
  */
2979
3096
  insertColumnsBefore(e, t) {
2980
- const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = M.LEFT, i = 0, a = this._worksheet.getRowCount() - 1, h = e, d = e + t - 1, c = A(this._worksheet, i, a, h, d, !1, e - 1);
2981
- return this._commandService.syncExecuteCommand(Re.id, {
3097
+ const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = A.LEFT, i = 0, a = this._worksheet.getRowCount() - 1, h = e, d = e + t - 1, c = W(this._worksheet, i, a, h, d, !1, e - 1);
3098
+ return this._commandService.syncExecuteCommand(fe.id, {
2982
3099
  unitId: n,
2983
3100
  subUnitId: r,
2984
3101
  direction: o,
@@ -2997,11 +3114,11 @@ let l = class extends ce {
2997
3114
  * @returns {FWorksheet} This sheet, for chaining
2998
3115
  * @example
2999
3116
  * ```typescript
3000
- * const sheet = workbook.getActiveSheet();
3117
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3001
3118
  * // Delete column C
3002
- * sheet.deleteColumn(2);
3119
+ * fWorksheet.deleteColumn(2);
3003
3120
  * // Delete column A
3004
- * sheet.deleteColumn(0);
3121
+ * fWorksheet.deleteColumn(0);
3005
3122
  * ```
3006
3123
  */
3007
3124
  deleteColumn(e) {
@@ -3014,11 +3131,11 @@ let l = class extends ce {
3014
3131
  * @returns {FWorksheet} This sheet, for chaining
3015
3132
  * @example
3016
3133
  * ```typescript
3017
- * const sheet = workbook.getActiveSheet();
3134
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3018
3135
  * // Delete 3 columns at column index 2 (columns C, D, E)
3019
- * sheet.deleteColumns(2, 3);
3136
+ * fWorksheet.deleteColumns(2, 3);
3020
3137
  * // Delete 1 column at column index 0 (column A)
3021
- * sheet.deleteColumns(0, 1);
3138
+ * fWorksheet.deleteColumns(0, 1);
3022
3139
  * ```
3023
3140
  */
3024
3141
  deleteColumns(e, t) {
@@ -3041,15 +3158,17 @@ let l = class extends ce {
3041
3158
  * @returns {FWorksheet} This sheet, for chaining
3042
3159
  * @example
3043
3160
  * ```typescript
3044
- * const sheet = workbook.getActiveSheet();
3161
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3045
3162
  * // Move columns C, D, E to column index 2 (columns B, C, D)
3046
- * sheet.moveColumns({ startColumn: 2, endColumn: 4 }, 1);
3047
- * // Move column A to column index 0 (column A)
3048
- * sheet.moveColumns({ startColumn: 0, endColumn: 0 }, 0);
3163
+ * const columnSpec1 = fWorksheet.getRange('C:E');
3164
+ * fWorksheet.moveColumns(columnSpec1, 1);
3165
+ * // Move column F to column index 0 (column A)
3166
+ * const columnSpec2 = fWorksheet.getRange('F:F');
3167
+ * fWorksheet.moveColumns(columnSpec2, 0);
3049
3168
  * ```
3050
3169
  */
3051
3170
  moveColumns(e, t) {
3052
- const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = q(e.getRange(), this._worksheet), i = o, a = {
3171
+ const n = this._workbook.getUnitId(), r = this._worksheet.getSheetId(), o = K(e.getRange(), this._worksheet), i = o, a = {
3053
3172
  startRow: 0,
3054
3173
  endRow: this._worksheet.getRowCount() - 1,
3055
3174
  startColumn: t,
@@ -3069,16 +3188,18 @@ let l = class extends ce {
3069
3188
  * @returns {FWorksheet} This sheet, for chaining
3070
3189
  * @example
3071
3190
  * ```typescript
3072
- * const sheet = workbook.getActiveSheet();
3191
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3073
3192
  * // Hide columns C, D, E
3074
- * sheet.hideColumn({ startColumn: 2, endColumn: 4 });
3193
+ * const column1 = fWorksheet.getRange('C:E');
3194
+ * fWorksheet.hideColumn(column1);
3075
3195
  * // Hide column A
3076
- * sheet.hideColumn({ startColumn: 0, endColumn: 0 });
3196
+ * const column2 = fWorksheet.getRange('A:A');
3197
+ * fWorksheet.hideColumn(column2);
3077
3198
  * ```
3078
3199
  */
3079
3200
  hideColumn(e) {
3080
- const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = q(e.getRange(), this._worksheet);
3081
- return this._commandService.syncExecuteCommand(be.id, {
3201
+ const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = K(e.getRange(), this._worksheet);
3202
+ return this._commandService.syncExecuteCommand(Ie.id, {
3082
3203
  unitId: t,
3083
3204
  subUnitId: n,
3084
3205
  ranges: [r]
@@ -3091,11 +3212,11 @@ let l = class extends ce {
3091
3212
  * @returns {FWorksheet} This sheet, for chaining
3092
3213
  * @example
3093
3214
  * ```typescript
3094
- * const sheet = workbook.getActiveSheet();
3215
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3095
3216
  * // Hide columns C, D, E
3096
- * sheet.hideColumns(2, 3);
3217
+ * fWorksheet.hideColumns(2, 3);
3097
3218
  * // Hide column A
3098
- * sheet.hideColumns(0, 1);
3219
+ * fWorksheet.hideColumns(0, 1);
3099
3220
  * ```
3100
3221
  */
3101
3222
  hideColumns(e, t = 1) {
@@ -3106,7 +3227,7 @@ let l = class extends ce {
3106
3227
  endColumn: e + t - 1,
3107
3228
  rangeType: _.COLUMN
3108
3229
  };
3109
- return this._commandService.syncExecuteCommand(be.id, {
3230
+ return this._commandService.syncExecuteCommand(Ie.id, {
3110
3231
  unitId: n,
3111
3232
  subUnitId: r,
3112
3233
  ranges: [o]
@@ -3118,16 +3239,18 @@ let l = class extends ce {
3118
3239
  * @returns {FWorksheet} This sheet, for chaining
3119
3240
  * @example
3120
3241
  * ```typescript
3121
- * const sheet = workbook.getActiveSheet();
3242
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3122
3243
  * // Unhide columns C, D, E
3123
- * sheet.unhideColumn({ startColumn: 2, endColumn: 4 });
3244
+ * const column1 = fWorksheet.getRange('C:E');
3245
+ * fWorksheet.unhideColumn(column1);
3124
3246
  * // Unhide column A
3125
- * sheet.unhideColumn({ startColumn: 0, endColumn: 0 });
3247
+ * const column2 = fWorksheet.getRange('A:A');
3248
+ * fWorksheet.unhideColumn(column2);
3126
3249
  * ```
3127
3250
  */
3128
3251
  unhideColumn(e) {
3129
- const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = q(e.getRange(), this._worksheet);
3130
- return this._commandService.syncExecuteCommand(pe.id, {
3252
+ const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = K(e.getRange(), this._worksheet);
3253
+ return this._commandService.syncExecuteCommand(Re.id, {
3131
3254
  unitId: t,
3132
3255
  subUnitId: n,
3133
3256
  ranges: [r]
@@ -3140,11 +3263,11 @@ let l = class extends ce {
3140
3263
  * @returns {FWorksheet} This sheet, for chaining
3141
3264
  * @example
3142
3265
  * ```typescript
3143
- * const sheet = workbook.getActiveSheet();
3266
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3144
3267
  * // Unhide columns C, D, E
3145
- * sheet.unhideColumns(2, 3);
3268
+ * fWorksheet.showColumns(2, 3);
3146
3269
  * // Unhide column A
3147
- * sheet.unhideColumns(0, 1);
3270
+ * fWorksheet.showColumns(0, 1);
3148
3271
  * ```
3149
3272
  */
3150
3273
  showColumns(e, t = 1) {
@@ -3155,7 +3278,7 @@ let l = class extends ce {
3155
3278
  endColumn: e + t - 1,
3156
3279
  rangeType: _.COLUMN
3157
3280
  };
3158
- return this._commandService.syncExecuteCommand(pe.id, {
3281
+ return this._commandService.syncExecuteCommand(Re.id, {
3159
3282
  unitId: n,
3160
3283
  subUnitId: r,
3161
3284
  ranges: [o]
@@ -3168,9 +3291,9 @@ let l = class extends ce {
3168
3291
  * @returns {FWorksheet} This sheet, for chaining
3169
3292
  * @example
3170
3293
  * ```typescript
3171
- * const sheet = workbook.getActiveSheet();
3294
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3172
3295
  * // Set width of column B to 100 pixels
3173
- * sheet.setColumnWidth(1, 100);
3296
+ * fWorksheet.setColumnWidth(1, 100);
3174
3297
  * ```
3175
3298
  */
3176
3299
  setColumnWidth(e, t) {
@@ -3184,9 +3307,9 @@ let l = class extends ce {
3184
3307
  * @returns {FWorksheet} This sheet, for chaining
3185
3308
  * @example
3186
3309
  * ```typescript
3187
- * const sheet = workbook.getActiveSheet();
3310
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3188
3311
  * // Set width of columns B-D (index 1-3) to 100 pixels
3189
- * sheet.setColumnWidths(1, 3, 100);
3312
+ * fWorksheet.setColumnWidths(1, 3, 100);
3190
3313
  * ```
3191
3314
  */
3192
3315
  setColumnWidths(e, t, n) {
@@ -3212,8 +3335,7 @@ let l = class extends ce {
3212
3335
  * @returns {FWorksheet} This worksheet instance for chaining
3213
3336
  * @example
3214
3337
  * ```ts
3215
- * const fWorkbook = univerAPI.getActiveWorkbook();
3216
- * const fWorkSheet = fWorkbook.getActiveSheet();
3338
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3217
3339
  * fWorkSheet.setColumnCustom({ 0: { key: 'value' } });
3218
3340
  * ```
3219
3341
  */
@@ -3228,17 +3350,34 @@ let l = class extends ce {
3228
3350
  subUnitId: n,
3229
3351
  columnData: r
3230
3352
  };
3231
- return this._commandService.syncExecuteCommand(ke.id, o), this;
3353
+ return this._commandService.syncExecuteCommand(le.id, o), this;
3232
3354
  }
3233
3355
  // #region merge cells
3356
+ /**
3357
+ * Get all merged cells in the current worksheet
3358
+ * @returns {FRange[]} All the merged cells in the worksheet
3359
+ * @example
3360
+ * ```ts
3361
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3362
+ * // Get all merged ranges in the sheet
3363
+ * const mergedData = fWorksheet.getMergeData();
3364
+ * // Process each merged range
3365
+ * mergedData.forEach(range => {
3366
+ * console.log(range.getA1Notation());
3367
+ * });
3368
+ * ```
3369
+ */
3370
+ getMergeData() {
3371
+ return this._worksheet.getMergeData().map((e) => this._injector.createInstance(k, this._workbook, this._worksheet, e));
3372
+ }
3234
3373
  /**
3235
3374
  * Get all merged cells in the current sheet
3236
3375
  * @returns {FRange[]} all merged cells
3237
3376
  * @example
3238
3377
  * ```typescript
3239
- * const sheet = workbook.getActiveSheet();
3378
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3240
3379
  * // Get all merged ranges in the sheet
3241
- * const mergedRanges = sheet.getMergedRanges();
3380
+ * const mergedRanges = fWorksheet.getMergedRanges();
3242
3381
  * // Process each merged range
3243
3382
  * mergedRanges.forEach(range => {
3244
3383
  * console.log(range.getA1Notation());
@@ -3255,8 +3394,7 @@ let l = class extends ce {
3255
3394
  * @returns {FRange|undefined} The merged cell data, or undefined if the cell is not merged
3256
3395
  * @example
3257
3396
  * ```ts
3258
- * const fWorkbook = univerAPI.getActiveWorkbook();
3259
- * const fWorkSheet = fWorkbook.getActiveSheet();
3397
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3260
3398
  * const merge = fWorkSheet.getCellMergeData(0, 0);
3261
3399
  * if (merge) {
3262
3400
  * console.log('Merged range:', merge.getA1Notation());
@@ -3274,9 +3412,9 @@ let l = class extends ce {
3274
3412
  * @returns {FRange | null} the active range
3275
3413
  * @example
3276
3414
  * ```typescript
3277
- * const sheet = workbook.getActiveSheet();
3415
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3278
3416
  * // Get the currently active range
3279
- * const activeRange = sheet.getActiveRange();
3417
+ * const activeRange = fWorksheet.getActiveRange();
3280
3418
  * if (activeRange) {
3281
3419
  * console.log('Active range:', activeRange.getA1Notation());
3282
3420
  * }
@@ -3291,9 +3429,8 @@ let l = class extends ce {
3291
3429
  * @returns {FWorksheet} This sheet, for chaining
3292
3430
  * @example
3293
3431
  * ```ts
3294
- * const fWorkbook = univerAPI.getActiveWorkbook();
3295
- * const fWorkSheet = fWorkbook.getActiveSheet();
3296
- * fWorkSheet.setActiveRange(fWorkSheet.getRange('A1'));
3432
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3433
+ * fWorkSheet.setActiveRange(fWorkSheet.getRange('A10:B10'));
3297
3434
  * ```
3298
3435
  */
3299
3436
  setActiveRange(e) {
@@ -3310,9 +3447,9 @@ let l = class extends ce {
3310
3447
  * @returns {FWorksheet} This worksheet instance for chaining
3311
3448
  * @example
3312
3449
  * ```typescript
3313
- * const sheet = workbook.getActiveSheet();
3450
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3314
3451
  * // Freeze first 3 rows and 2 columns
3315
- * sheet.setFreeze({
3452
+ * fWorksheet.setFreeze({
3316
3453
  * startRow: 3,
3317
3454
  * startColumn: 2,
3318
3455
  * xSplit: 2,
@@ -3321,7 +3458,7 @@ let l = class extends ce {
3321
3458
  * ```
3322
3459
  */
3323
3460
  setFreeze(e) {
3324
- return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"), this._commandService.syncExecuteCommand(G.id, {
3461
+ return this._logService.warn("setFreeze is deprecated, use setFrozenRows and setFrozenColumns instead"), this._commandService.syncExecuteCommand($.id, {
3325
3462
  ...e,
3326
3463
  unitId: this._workbook.getUnitId(),
3327
3464
  subUnitId: this.getSheetId()
@@ -3332,9 +3469,9 @@ let l = class extends ce {
3332
3469
  * @returns {FWorksheet} This worksheet instance for chaining
3333
3470
  * @example
3334
3471
  * ```typescript
3335
- * const sheet = workbook.getActiveSheet();
3472
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3336
3473
  * // Cancel freeze
3337
- * sheet.cancelFreeze();
3474
+ * fWorksheet.cancelFreeze();
3338
3475
  * ```
3339
3476
  */
3340
3477
  cancelFreeze() {
@@ -3348,9 +3485,9 @@ let l = class extends ce {
3348
3485
  * @returns {IFreeze} The freeze state of the current sheet
3349
3486
  * @example
3350
3487
  * ```typescript
3351
- * const sheet = workbook.getActiveSheet();
3488
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
3352
3489
  * // Get the freeze state of the current sheet
3353
- * const freeze = sheet.getFreeze();
3490
+ * const freeze = fWorksheet.getFreeze();
3354
3491
  * console.log(freeze);
3355
3492
  * ```
3356
3493
  */
@@ -3368,7 +3505,7 @@ let l = class extends ce {
3368
3505
  });
3369
3506
  } else if (arguments.length === 2) {
3370
3507
  let [n = 0, r = 0] = e;
3371
- n > r && ([n, r] = [r, n]), this._commandService.syncExecuteCommand(G.id, {
3508
+ n > r && ([n, r] = [r, n]), this._commandService.syncExecuteCommand($.id, {
3372
3509
  startColumn: r + 1,
3373
3510
  xSplit: r - n + 1,
3374
3511
  startRow: t.startRow,
@@ -3390,7 +3527,7 @@ let l = class extends ce {
3390
3527
  });
3391
3528
  } else if (arguments.length === 2) {
3392
3529
  let [n = 0, r = 0] = e;
3393
- n > r && ([n, r] = [r, n]), this._commandService.syncExecuteCommand(G.id, {
3530
+ n > r && ([n, r] = [r, n]), this._commandService.syncExecuteCommand($.id, {
3394
3531
  startRow: r + 1,
3395
3532
  ySplit: r - n + 1,
3396
3533
  startColumn: t.startColumn,
@@ -3406,8 +3543,7 @@ let l = class extends ce {
3406
3543
  * @returns {number} The number of frozen columns, returns 0 if no columns are frozen.
3407
3544
  * @example
3408
3545
  * ```typescript
3409
- * const fWorkbook = univerAPI.getActiveWorkbook();
3410
- * const fWorkSheet = fWorkbook.getActiveSheet();
3546
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3411
3547
  * // Get the number of frozen columns
3412
3548
  * const frozenColumns = fWorkSheet.getFrozenColumns();
3413
3549
  * console.log(frozenColumns);
@@ -3422,8 +3558,7 @@ let l = class extends ce {
3422
3558
  * @returns {number} The number of frozen rows. returns 0 if no rows are frozen.
3423
3559
  * @example
3424
3560
  * ```typescript
3425
- * const fWorkbook = univerAPI.getActiveWorkbook();
3426
- * const fWorkSheet = fWorkbook.getActiveSheet();
3561
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3427
3562
  * // Get the number of frozen rows
3428
3563
  * const frozenRows = fWorkSheet.getFrozenRows();
3429
3564
  * console.log(frozenRows);
@@ -3438,8 +3573,7 @@ let l = class extends ce {
3438
3573
  * @returns {IRowRange} The range of the frozen rows.
3439
3574
  * @example
3440
3575
  * ```ts
3441
- * const fWorkbook = univerAPI.getActiveWorkbook();
3442
- * const fWorkSheet = fWorkbook.getActiveSheet();
3576
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3443
3577
  * // Get the range of the frozen rows
3444
3578
  * const frozenRows = fWorkSheet.getFrozenRowRange();
3445
3579
  * console.log(frozenRows);
@@ -3457,8 +3591,7 @@ let l = class extends ce {
3457
3591
  * @returns {IColumnRange} The range of the frozen columns.
3458
3592
  * @example
3459
3593
  * ```ts
3460
- * const fWorkbook = univerAPI.getActiveWorkbook();
3461
- * const fWorkSheet = fWorkbook.getActiveSheet();
3594
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3462
3595
  * // Get the range of the frozen columns
3463
3596
  * const frozenColumns = fWorkSheet.getFrozenColumnRange();
3464
3597
  * console.log(frozenColumns);
@@ -3476,8 +3609,7 @@ let l = class extends ce {
3476
3609
  * @returns {boolean} True if the sheet's gridlines are hidden; otherwise false.
3477
3610
  * @example
3478
3611
  * ```ts
3479
- * const fWorkbook = univerAPI.getActiveWorkbook();
3480
- * const fWorkSheet = fWorkbook.getActiveSheet();
3612
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3481
3613
  * // check if the gridlines are hidden
3482
3614
  * if (fWorkSheet.hasHiddenGridLines()) {
3483
3615
  * console.log('Gridlines are hidden');
@@ -3493,14 +3625,13 @@ let l = class extends ce {
3493
3625
  * @returns {FWorksheet} Returns the current worksheet instance for method chaining
3494
3626
  * @example
3495
3627
  * ``` ts
3496
- * const fWorkbook = univerAPI.getActiveWorkbook();
3497
- * const fWorkSheet = fWorkbook.getActiveSheet();
3628
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3498
3629
  * // hide the gridlines
3499
3630
  * fWorkSheet.setHiddenGridlines(true);
3500
3631
  * ```
3501
3632
  */
3502
3633
  setHiddenGridlines(e) {
3503
- return this._commandService.syncExecuteCommand(te.id, {
3634
+ return this._commandService.syncExecuteCommand(ne.id, {
3504
3635
  unitId: this._workbook.getUnitId(),
3505
3636
  subUnitId: this._worksheet.getSheetId(),
3506
3637
  showGridlines: e ? g.FALSE : g.TRUE
@@ -3512,14 +3643,13 @@ let l = class extends ce {
3512
3643
  * @returns {FWorksheet} Returns the current worksheet instance for method chaining
3513
3644
  * @example
3514
3645
  * ```ts
3515
- * const fWorkbook = univerAPI.getActiveWorkbook();
3516
- * const fWorkSheet = fWorkbook.getActiveSheet();
3646
+ * const fWorkSheet = univerAPI.getActiveWorkbook().getActiveSheet();
3517
3647
  * // set the gridlines color to red
3518
3648
  * fWorkSheet.setGridLinesColor('#ff0000');
3519
3649
  * ```
3520
3650
  */
3521
3651
  setGridLinesColor(e) {
3522
- return this._commandService.syncExecuteCommand(ne.id, {
3652
+ return this._commandService.syncExecuteCommand(re.id, {
3523
3653
  unitId: this._workbook.getUnitId(),
3524
3654
  subUnitId: this._worksheet.getSheetId(),
3525
3655
  color: e
@@ -3552,10 +3682,10 @@ let l = class extends ce {
3552
3682
  * ```
3553
3683
  */
3554
3684
  setTabColor(e) {
3555
- return this._commandService.syncExecuteCommand(re.id, {
3685
+ return this._commandService.syncExecuteCommand(Pt.id, {
3556
3686
  unitId: this._workbook.getUnitId(),
3557
3687
  subUnitId: this._worksheet.getSheetId(),
3558
- color: e
3688
+ value: e
3559
3689
  }), this;
3560
3690
  }
3561
3691
  /**
@@ -3575,25 +3705,25 @@ let l = class extends ce {
3575
3705
  }
3576
3706
  // eslint-disable-next-line
3577
3707
  /**
3578
- * @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, callback)` instead
3708
+ * @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
3579
3709
  */
3580
3710
  onCellDataChange(e) {
3581
3711
  return this._injector.get(m).onCommandExecuted((n) => {
3582
- if (n.id === Ee.id) {
3712
+ if (n.id === be.id) {
3583
3713
  const r = n.params;
3584
- r.unitId === this._workbook.getUnitId() && r.subUnitId === this._worksheet.getSheetId() && r.cellValue && e(new W(r.cellValue));
3714
+ r.unitId === this._workbook.getUnitId() && r.subUnitId === this._worksheet.getSheetId() && r.cellValue && e(new F(r.cellValue));
3585
3715
  }
3586
3716
  });
3587
3717
  }
3588
3718
  // eslint-disable-next-line
3589
3719
  /**
3590
- * @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, callback)` instead
3720
+ * @deprecated use `univerAPI.addEvent(univerAPI.Event.SheetValueChanged, (params) => {})` instead
3591
3721
  */
3592
3722
  onBeforeCellDataChange(e) {
3593
3723
  return this._injector.get(m).beforeCommandExecuted((n) => {
3594
- if (n.id === Ee.id) {
3724
+ if (n.id === be.id) {
3595
3725
  const r = n.params;
3596
- r.unitId === this._workbook.getUnitId() && r.subUnitId === this._worksheet.getSheetId() && r.cellValue && e(new W(r.cellValue));
3726
+ r.unitId === this._workbook.getUnitId() && r.subUnitId === this._worksheet.getSheetId() && r.cellValue && e(new F(r.cellValue));
3597
3727
  }
3598
3728
  });
3599
3729
  }
@@ -3612,7 +3742,7 @@ let l = class extends ce {
3612
3742
  const e = this._injector.get(m);
3613
3743
  if (this._workbook.getSheets().filter((o) => o.isSheetHidden() !== g.TRUE).length <= 1)
3614
3744
  throw new Error("Cannot hide the only visible sheet");
3615
- return e.syncExecuteCommand(se.id, {
3745
+ return e.syncExecuteCommand(xt.id, {
3616
3746
  unitId: this._workbook.getUnitId(),
3617
3747
  subUnitId: this._worksheet.getSheetId()
3618
3748
  }), this;
@@ -3629,7 +3759,7 @@ let l = class extends ce {
3629
3759
  * ```
3630
3760
  */
3631
3761
  showSheet() {
3632
- return this._injector.get(m).syncExecuteCommand(Pt.id, {
3762
+ return this._injector.get(m).syncExecuteCommand(Nt.id, {
3633
3763
  unitId: this._workbook.getUnitId(),
3634
3764
  subUnitId: this._worksheet.getSheetId()
3635
3765
  }), this;
@@ -3637,6 +3767,13 @@ let l = class extends ce {
3637
3767
  /**
3638
3768
  * Returns true if the sheet is currently hidden.
3639
3769
  * @returns {boolean} True if the sheet is hidden; otherwise, false.
3770
+ * @example
3771
+ * ```ts
3772
+ * const fWorkbook = univerAPI.getActiveWorkbook();
3773
+ * const fWorkSheets = fWorkbook.getSheets();
3774
+ * // check if the last sheet is hidden
3775
+ * console.log(fWorkSheets[fWorkSheets.length - 1].isSheetHidden());
3776
+ * ```
3640
3777
  */
3641
3778
  isSheetHidden() {
3642
3779
  return this._worksheet.isSheetHidden() === g.TRUE;
@@ -3650,11 +3787,11 @@ let l = class extends ce {
3650
3787
  * const fWorkbook = univerAPI.getActiveWorkbook();
3651
3788
  * const fWorkSheet = fWorkbook.getActiveSheet();
3652
3789
  * // set the sheet name to 'Sheet1'
3653
- * fWorkSheet.setName('Sheet1');
3790
+ * fWorkSheet.setName('NewSheet1');
3654
3791
  * ```
3655
3792
  */
3656
3793
  setName(e) {
3657
- return this._commandService.syncExecuteCommand(oe.id, {
3794
+ return this._commandService.syncExecuteCommand(se.id, {
3658
3795
  unitId: this._workbook.getUnitId(),
3659
3796
  subUnitId: this._worksheet.getSheetId(),
3660
3797
  name: e
@@ -3663,6 +3800,13 @@ let l = class extends ce {
3663
3800
  /**
3664
3801
  * Activates this sheet. Does not alter the sheet itself, only the parent's notion of the active sheet.
3665
3802
  * @returns {FWorksheet} Current sheet, for chaining.
3803
+ * @example
3804
+ * ```ts
3805
+ * const fWorkbook = univerAPI.getActiveWorkbook();
3806
+ * const fWorkSheets = fWorkbook.getSheets();
3807
+ * // activate the last sheet
3808
+ * fWorkSheets[fWorkSheets.length - 1].activate();
3809
+ * ```
3666
3810
  */
3667
3811
  activate() {
3668
3812
  return this._fWorkbook.setActiveSheet(this), this;
@@ -3676,7 +3820,7 @@ let l = class extends ce {
3676
3820
  * const fWorkSheet = fWorkbook.getActiveSheet();
3677
3821
  * // get the position of the active sheet
3678
3822
  * const position = fWorkSheet.getIndex();
3679
- * console.log(position); // 0
3823
+ * console.log(position);
3680
3824
  * ```
3681
3825
  */
3682
3826
  getIndex() {
@@ -3699,14 +3843,17 @@ let l = class extends ce {
3699
3843
  * ```
3700
3844
  */
3701
3845
  clear(e) {
3702
- e && e.contentsOnly && !e.formatOnly && this.clearContents(), e && e.formatOnly && !e.contentsOnly && this.clearFormats();
3846
+ if (e && e.contentsOnly && !e.formatOnly)
3847
+ return this.clearContents();
3848
+ if (e && e.formatOnly && !e.contentsOnly)
3849
+ return this.clearFormats();
3703
3850
  const t = this._workbook.getUnitId(), n = this._worksheet.getSheetId(), r = this._injector.get(m), o = {
3704
3851
  startRow: 0,
3705
3852
  endRow: this._worksheet.getRowCount() - 1,
3706
3853
  startColumn: 0,
3707
3854
  endColumn: this._worksheet.getColumnCount() - 1
3708
3855
  };
3709
- return r.syncExecuteCommand(xt.id, {
3856
+ return r.syncExecuteCommand(Tt.id, {
3710
3857
  unitId: t,
3711
3858
  subUnitId: n,
3712
3859
  ranges: [o],
@@ -3731,7 +3878,7 @@ let l = class extends ce {
3731
3878
  startColumn: 0,
3732
3879
  endColumn: this._worksheet.getColumnCount() - 1
3733
3880
  };
3734
- return n.syncExecuteCommand(Nt.id, {
3881
+ return n.syncExecuteCommand(Dt.id, {
3735
3882
  unitId: e,
3736
3883
  subUnitId: t,
3737
3884
  ranges: [r]
@@ -3755,7 +3902,7 @@ let l = class extends ce {
3755
3902
  startColumn: 0,
3756
3903
  endColumn: this._worksheet.getColumnCount() - 1
3757
3904
  };
3758
- return n.syncExecuteCommand(Tt.id, {
3905
+ return n.syncExecuteCommand(Mt.id, {
3759
3906
  unitId: e,
3760
3907
  subUnitId: t,
3761
3908
  ranges: [r]
@@ -3769,10 +3916,10 @@ let l = class extends ce {
3769
3916
  * ```ts
3770
3917
  * const fWorkbook = univerAPI.getActiveWorkbook();
3771
3918
  * const fWorkSheet = fWorkbook.getActiveSheet();
3772
- * // the sheet is a empty sheet
3773
- * const cellRange = fWorkSheet.getRange(200, 10, 1, 1);
3919
+ * // Assume the sheet is a empty sheet
3920
+ * const cellRange = fWorkSheet.getRange('J50');
3774
3921
  * cellRange.setValue('Hello World');
3775
- * console.log(fWorkSheet.getDataRange().getA1Notation()); // A1:J200
3922
+ * console.log(fWorkSheet.getDataRange().getA1Notation()); // A1:J50
3776
3923
  * ```
3777
3924
  */
3778
3925
  getDataRange() {
@@ -3780,59 +3927,49 @@ let l = class extends ce {
3780
3927
  return this.getRange(0, 0, e + 1, t + 1);
3781
3928
  }
3782
3929
  /**
3783
- * Returns the position of the last column that has content.
3784
- * @returns {number} the last column of the sheet that contains content.
3785
- * @example
3786
- * ```ts
3787
- * const fWorkbook = univerAPI.getActiveWorkbook();
3788
- * const fWorkSheet = fWorkbook.getActiveSheet();
3789
- * const fRange = fWorkSheet.getRange(100, 20, 1, 1);
3790
- * console.log(fWorkSheet.getLastColumns()); // 20
3791
- * ```
3930
+ * @deprecated use `getLastColumn` instead.
3931
+ * Returns the column index of the last column that contains content.
3932
+ * @returns {number} the column index of the last column that contains content.
3792
3933
  */
3793
3934
  getLastColumns() {
3794
3935
  return this._worksheet.getLastColumnWithContent();
3795
3936
  }
3796
3937
  /**
3797
- * @deprecated use getLastColumn instead.
3798
- * Returns the position of the last column that has content. Same as getLastColumns.
3799
- * @returns {number} the last column of the sheet that contains content.
3938
+ * Returns the column index of the last column that contains content.
3939
+ * @returns {number} the column index of the last column that contains content.
3800
3940
  * @example
3801
3941
  * ```ts
3802
3942
  * const fWorkbook = univerAPI.getActiveWorkbook();
3803
3943
  * const fWorkSheet = fWorkbook.getActiveSheet();
3804
- * const fRange = fWorkSheet.getRange(100, 20, 1, 1);
3805
- * console.log(fWorkSheet.getLastColumn());
3944
+ * // Assume the sheet is a empty sheet
3945
+ * const cellRange = fWorkSheet.getRange('J50');
3946
+ * cellRange.setValue('Hello World');
3947
+ * console.log(fWorkSheet.getLastColumn()); // 9
3806
3948
  * ```
3807
3949
  */
3808
3950
  getLastColumn() {
3809
3951
  return this._worksheet.getLastColumnWithContent();
3810
3952
  }
3811
3953
  /**
3812
- * @deprecated use getLastRow instead.
3813
- * Returns the position of the last row that has content.
3814
- * @returns {number} the last row of the sheet that contains content.
3815
- * @example
3816
- * ```ts
3817
- * const fWorkbook = univerAPI.getActiveWorkbook();
3818
- * const fWorkSheet = fWorkbook.getActiveSheet();
3819
- * const fRange = fWorkSheet.getRange(100,1,1,1);
3820
- * fRange.setValue('Hello World');
3821
- * console.log(fWorkSheet.getLastRows()); // 100
3954
+ * @deprecated use `getLastRow` instead.
3955
+ * Returns the row index of the last row that contains content.
3956
+ * @returns {number} the row index of the last row that contains content.
3822
3957
  */
3823
3958
  getLastRows() {
3824
3959
  return this._worksheet.getLastRowWithContent();
3825
3960
  }
3826
3961
  /**
3827
- * Returns the position of the last row that has content, same as getLastRows().
3828
- * @returns {number} the last row of the sheet that contains content.
3962
+ * Returns the row index of the last row that contains content.
3963
+ * @returns {number} the row index of the last row that contains content.
3829
3964
  * @example
3830
3965
  * ```ts
3831
3966
  * const fWorkbook = univerAPI.getActiveWorkbook();
3832
3967
  * const fWorkSheet = fWorkbook.getActiveSheet();
3833
- * const fRange = fWorkSheet.getRange(100,1,1,1);
3834
- * fRange.setValue('Hello World');
3835
- * console.log(fWorkSheet.getLastRow());
3968
+ * // Assume the sheet is a empty sheet
3969
+ * const cellRange = fWorkSheet.getRange('J50');
3970
+ * cellRange.setValue('Hello World');
3971
+ * console.log(fWorkSheet.getLastRow()); // 49
3972
+ * ```
3836
3973
  */
3837
3974
  getLastRow() {
3838
3975
  return this._worksheet.getLastRowWithContent();
@@ -3844,28 +3981,27 @@ let l = class extends ce {
3844
3981
  * @example
3845
3982
  * ```ts
3846
3983
  * const fWorkbook = univerAPI.getActiveWorkbook();
3984
+ * const sheets = fWorkbook.getSheets();
3847
3985
  * const fWorkSheet = fWorkbook.getActiveSheet();
3848
- * const fWorkSheet2 = fWorkbook.getSheetByName('Sheet1');
3849
- * console.log(fWorkSheet.equals(fWorkSheet2)); // true, if the active sheet is 'Sheet1'
3986
+ * console.log(fWorkSheet.equalTo(sheets[0])); // true, if the active sheet is the first sheet.
3850
3987
  * ```
3851
3988
  */
3852
3989
  equalTo(e) {
3853
3990
  return e instanceof l ? this._worksheet.getSheetId() === e.getSheetId() && this._workbook.getUnitId() === e.getWorkbook().getUnitId() : !1;
3854
3991
  }
3855
- /*
3856
- * Insert a defined name for worksheet.
3992
+ /**
3993
+ * Insert a defined name for worksheet.
3857
3994
  * @param {string} name - The name of the defined name to insert
3858
3995
  * @param {string} formulaOrRefString - The formula(=sum(A2:b10)) or reference(A1) string of the defined name to insert
3859
3996
  * @example
3860
3997
  * ```ts
3861
3998
  * // The code below inserts a defined name
3862
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
3863
- * const sheet1 = activeSpreadsheet.getSheetByName('Sheet1');
3864
- * sheet1.insertDefinedName('MyDefinedName', 'Sheet1!A1');
3999
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
4000
+ * fWorksheet.insertDefinedName('MyDefinedName', 'Sheet1!A1');
3865
4001
  * ```
3866
4002
  */
3867
4003
  insertDefinedName(e, t) {
3868
- const r = this._injector.createInstance(O).setName(e).setRef(t).build();
4004
+ const r = this._injector.createInstance(L).setName(e).setRef(t).build();
3869
4005
  r.localSheetId = this.getSheetId(), this._fWorkbook.insertDefinedNameBuilder(r);
3870
4006
  }
3871
4007
  /**
@@ -3874,9 +4010,9 @@ let l = class extends ce {
3874
4010
  * @example
3875
4011
  * ```ts
3876
4012
  * // The code below gets all the defined names in the worksheet
3877
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
3878
- * const sheet1 = activeSpreadsheet.getSheetByName('Sheet1');
3879
- * const definedNames = sheet1.getDefinedNames();
4013
+ * const fWorksheet = univerAPI.getActiveWorkbook().getActiveSheet();
4014
+ * const definedNames = fWorksheet.getDefinedNames();
4015
+ * console.log(definedNames);
3880
4016
  * ```
3881
4017
  */
3882
4018
  getDefinedNames() {
@@ -3885,7 +4021,7 @@ let l = class extends ce {
3885
4021
  /**
3886
4022
  * Set custom metadata of worksheet
3887
4023
  * @param {CustomData | undefined} custom - custom metadata
3888
- * @returns {FWorksheet}
4024
+ * @returns {FWorksheet} Current worksheet, for chaining.
3889
4025
  * @example
3890
4026
  * ```ts
3891
4027
  * const fWorkbook = univerAPI.getActiveWorkbook();
@@ -3935,6 +4071,7 @@ let l = class extends ce {
3935
4071
  * const fWorkbook = univerAPI.getActiveWorkbook();
3936
4072
  * const fWorkSheet = fWorkbook.getActiveSheet();
3937
4073
  * const custom = fWorkSheet.getRowCustomMetadata(0);
4074
+ * console.log(custom);
3938
4075
  * ```
3939
4076
  */
3940
4077
  getRowCustomMetadata(e) {
@@ -3949,45 +4086,28 @@ let l = class extends ce {
3949
4086
  * const fWorkbook = univerAPI.getActiveWorkbook();
3950
4087
  * const fWorkSheet = fWorkbook.getActiveSheet();
3951
4088
  * const custom = fWorkSheet.getColumnCustomMetadata(0);
4089
+ * console.log(custom);
3952
4090
  * ```
3953
4091
  */
3954
4092
  getColumnCustomMetadata(e) {
3955
4093
  return this._worksheet.getColumnManager().getCustomMetadata(e);
3956
4094
  }
3957
- /**
3958
- * Get all merged cells in the current worksheet
3959
- * @returns {FRange[]} All the merged cells in the worksheet
3960
- * @example
3961
- * ```ts
3962
- * const workbook = univerAPI.getActiveWorkbook();
3963
- * const worksheet = workbook.getActiveSheet();
3964
- * const rangeFirst = worksheet.getRange(0, 0, 2, 2);
3965
- * const mergeFirst = rangeFirst.merge();
3966
- * const rangeSecond = worksheet.getRange(5, 0, 2, 2);
3967
- * const mergeSecond = rangeSecond.merge();
3968
- * const mergeData = worksheet.getMergeData();
3969
- * console.log('debugger', mergeData);
3970
- * ```
3971
- */
3972
- getMergeData() {
3973
- return this._worksheet.getMergeData().map((e) => this._injector.createInstance(k, this._workbook, this._worksheet, e));
3974
- }
3975
4095
  };
3976
- l = on([
3977
- B(3, u(b)),
4096
+ l = cn([
4097
+ B(3, u(p)),
3978
4098
  B(4, u(je)),
3979
- B(5, u(Te)),
4099
+ B(5, u(De)),
3980
4100
  B(6, m)
3981
4101
  ], l);
3982
- var an = Object.getOwnPropertyDescriptor, hn = (s, e, t, n) => {
3983
- for (var r = n > 1 ? void 0 : n ? an(e, t) : e, o = s.length - 1, i; o >= 0; o--)
4102
+ var un = Object.getOwnPropertyDescriptor, gn = (s, e, t, n) => {
4103
+ for (var r = n > 1 ? void 0 : n ? un(e, t) : e, o = s.length - 1, i; o >= 0; o--)
3984
4104
  (i = s[o]) && (r = i(r) || r);
3985
4105
  return r;
3986
- }, w = (s, e) => (t, n) => e(t, n, s);
3987
- let C = class extends ce {
4106
+ }, C = (s, e) => (t, n) => e(t, n, s);
4107
+ let v = class extends he {
3988
4108
  constructor(e, t, n, r, o, i, a, h, d, c) {
3989
4109
  super(t);
3990
- v(this, "id");
4110
+ I(this, "id");
3991
4111
  this._workbook = e, this._injector = t, this._resourceLoaderService = n, this._selectionManagerService = r, this._univerInstanceService = o, this._commandService = i, this._permissionService = a, this._logService = h, this._localeService = d, this._definedNamesService = c, this.id = this._workbook.getUnitId();
3992
4112
  }
3993
4113
  /**
@@ -3996,8 +4116,9 @@ let C = class extends ce {
3996
4116
  * @example
3997
4117
  * ```ts
3998
4118
  * // The code below gets the Workbook instance
3999
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4000
- * const workbook = activeSpreadsheet.getWorkbook();
4119
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4120
+ * const workbook = fWorkbook.getWorkbook();
4121
+ * console.log(workbook);
4001
4122
  * ```
4002
4123
  */
4003
4124
  getWorkbook() {
@@ -4009,8 +4130,9 @@ let C = class extends ce {
4009
4130
  * @example
4010
4131
  * ```ts
4011
4132
  * // The code below gets the id of the workbook
4012
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4013
- * const id = activeSpreadsheet.getId();
4133
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4134
+ * const unitId = fWorkbook.getId();
4135
+ * console.log(unitId);
4014
4136
  * ```
4015
4137
  */
4016
4138
  getId() {
@@ -4022,8 +4144,9 @@ let C = class extends ce {
4022
4144
  * @example
4023
4145
  * ```ts
4024
4146
  * // The code below gets the name of the workbook
4025
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4026
- * const name = activeSpreadsheet.getName();
4147
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4148
+ * const name = fWorkbook.getName();
4149
+ * console.log(name);
4027
4150
  * ```
4028
4151
  */
4029
4152
  getName() {
@@ -4032,12 +4155,11 @@ let C = class extends ce {
4032
4155
  /**
4033
4156
  * Set the name of the workbook.
4034
4157
  * @param {string} name The new name of the workbook.
4035
- * @returns {void}
4036
4158
  * @example
4037
4159
  * ```ts
4038
4160
  * // The code below sets the name of the workbook
4039
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4040
- * activeSpreadsheet.setName('MyWorkbook');
4161
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4162
+ * fWorkbook.setName('MyWorkbook');
4041
4163
  * ```
4042
4164
  */
4043
4165
  setName(e) {
@@ -4049,8 +4171,9 @@ let C = class extends ce {
4049
4171
  * @example
4050
4172
  * ```ts
4051
4173
  * // The code below saves the workbook snapshot data
4052
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4053
- * const snapshot = activeSpreadsheet.save();
4174
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4175
+ * const snapshot = fWorkbook.save();
4176
+ * console.log(snapshot);
4054
4177
  * ```
4055
4178
  */
4056
4179
  save() {
@@ -4076,8 +4199,9 @@ let C = class extends ce {
4076
4199
  * @example
4077
4200
  * ```ts
4078
4201
  * // The code below gets the active sheet of the workbook
4079
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4080
- * const activeSheet = activeSpreadsheet.getActiveSheet();
4202
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4203
+ * const fWorksheet = fWorkbook.getActiveSheet();
4204
+ * console.log(fWorksheet);
4081
4205
  * ```
4082
4206
  */
4083
4207
  getActiveSheet() {
@@ -4090,8 +4214,9 @@ let C = class extends ce {
4090
4214
  * @example
4091
4215
  * ```ts
4092
4216
  * // The code below gets all the worksheets in the workbook
4093
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4094
- * const sheets = activeSpreadsheet.getSheets();
4217
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4218
+ * const sheets = fWorkbook.getSheets();
4219
+ * console.log(sheets);
4095
4220
  * ```
4096
4221
  */
4097
4222
  getSheets() {
@@ -4106,17 +4231,18 @@ let C = class extends ce {
4106
4231
  * @example
4107
4232
  * ```ts
4108
4233
  * // The code below creates a new sheet
4109
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4110
- * const newSheet = activeSpreadsheet.create('MyNewSheet', 10, 10);
4234
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4235
+ * const newSheet = fWorkbook.create('MyNewSheet', 10, 10);
4236
+ * console.log(newSheet);
4111
4237
  * ```
4112
4238
  */
4113
4239
  create(e, t, n) {
4114
- const r = Je({});
4115
- r.rowCount = t, r.columnCount = n, r.name = e, r.id = e.toLowerCase().replace(/ /g, "-"), this._commandService.syncExecuteCommand(x.id, {
4240
+ const r = Qe({});
4241
+ r.rowCount = t, r.columnCount = n, r.name = e, r.id = e.toLowerCase().replace(/ /g, "-"), this._commandService.syncExecuteCommand(N.id, {
4116
4242
  unitId: this.id,
4117
4243
  index: this._workbook.getSheets().length,
4118
4244
  sheet: r
4119
- }), this._commandService.syncExecuteCommand(N.id, {
4245
+ }), this._commandService.syncExecuteCommand(T.id, {
4120
4246
  unitId: this.id,
4121
4247
  subUnitId: this._workbook.getSheets()[this._workbook.getSheets().length - 1].getSheetId()
4122
4248
  });
@@ -4132,8 +4258,9 @@ let C = class extends ce {
4132
4258
  * @example
4133
4259
  * ```ts
4134
4260
  * // The code below gets a worksheet by sheet id
4135
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4136
- * const sheet = activeSpreadsheet.getSheetBySheetId('sheetId');
4261
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4262
+ * const sheet = fWorkbook.getSheetBySheetId('sheetId');
4263
+ * console.log(sheet);
4137
4264
  * ```
4138
4265
  */
4139
4266
  getSheetBySheetId(e) {
@@ -4147,8 +4274,9 @@ let C = class extends ce {
4147
4274
  * @example
4148
4275
  * ```ts
4149
4276
  * // The code below gets a worksheet by sheet name
4150
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4151
- * const sheet = activeSpreadsheet.getSheetByName('Sheet1');
4277
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4278
+ * const sheet = fWorkbook.getSheetByName('Sheet1');
4279
+ * console.log(sheet);
4152
4280
  * ```
4153
4281
  */
4154
4282
  getSheetByName(e) {
@@ -4162,13 +4290,13 @@ let C = class extends ce {
4162
4290
  * @example
4163
4291
  * ```ts
4164
4292
  * // The code below sets the given worksheet to be the active worksheet
4165
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4166
- * const sheet = activeSpreadsheet.getSheetByName('Sheet1');
4167
- * activeSpreadsheet.setActiveSheet(sheet);
4293
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4294
+ * const sheet = fWorkbook.getSheets()[1];
4295
+ * fWorkbook.setActiveSheet(sheet);
4168
4296
  * ```
4169
4297
  */
4170
4298
  setActiveSheet(e) {
4171
- return this._commandService.syncExecuteCommand(N.id, {
4299
+ return this._commandService.syncExecuteCommand(T.id, {
4172
4300
  unitId: this.id,
4173
4301
  subUnitId: typeof e == "string" ? e : e.getSheetId()
4174
4302
  }), typeof e == "string" ? this.getSheetBySheetId(e) : e;
@@ -4181,18 +4309,18 @@ let C = class extends ce {
4181
4309
  * @example
4182
4310
  * ```ts
4183
4311
  * // The code below inserts a new sheet into the workbook
4184
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4185
- * activeSpreadsheet.insertSheet();
4312
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4313
+ * fWorkbook.insertSheet();
4186
4314
  *
4187
4315
  * // The code below inserts a new sheet into the workbook, using a custom name
4188
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4189
- * activeSpreadsheet.insertSheet('MyNewSheet');
4316
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4317
+ * fWorkbook.insertSheet('MyNewSheet');
4190
4318
  * ```
4191
4319
  */
4192
4320
  insertSheet(e) {
4193
- e != null ? this._commandService.syncExecuteCommand(x.id, { sheet: { name: e } }) : this._commandService.syncExecuteCommand(x.id);
4321
+ e != null ? this._commandService.syncExecuteCommand(N.id, { sheet: { name: e } }) : this._commandService.syncExecuteCommand(N.id);
4194
4322
  const t = this.id, n = this._workbook.getSheets()[this._workbook.getSheets().length - 1].getSheetId();
4195
- this._commandService.syncExecuteCommand(N.id, {
4323
+ this._commandService.syncExecuteCommand(T.id, {
4196
4324
  unitId: t,
4197
4325
  subUnitId: n
4198
4326
  });
@@ -4208,14 +4336,14 @@ let C = class extends ce {
4208
4336
  * @example
4209
4337
  * ```ts
4210
4338
  * // The code below deletes the specified worksheet
4211
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4212
- * const sheet = activeSpreadsheet.getSheetByName('Sheet1');
4213
- * activeSpreadsheet.deleteSheet(sheet);
4339
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4340
+ * const sheet = fWorkbook.getSheets()[1];
4341
+ * fWorkbook.deleteSheet(sheet);
4214
4342
  * ```
4215
4343
  */
4216
4344
  deleteSheet(e) {
4217
4345
  const t = this.id, n = typeof e == "string" ? e : e.getSheetId();
4218
- return this._commandService.syncExecuteCommand(ie.id, {
4346
+ return this._commandService.syncExecuteCommand(oe.id, {
4219
4347
  unitId: t,
4220
4348
  subUnitId: n
4221
4349
  });
@@ -4227,12 +4355,12 @@ let C = class extends ce {
4227
4355
  * @example
4228
4356
  * ```ts
4229
4357
  * // The code below undoes the last action
4230
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4231
- * activeSpreadsheet.undo();
4358
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4359
+ * fWorkbook.undo();
4232
4360
  * ```
4233
4361
  */
4234
4362
  undo() {
4235
- return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(Qe.id), this;
4363
+ return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(Xe.id), this;
4236
4364
  }
4237
4365
  /**
4238
4366
  * Redo the last undone action.
@@ -4240,12 +4368,12 @@ let C = class extends ce {
4240
4368
  * @example
4241
4369
  * ```ts
4242
4370
  * // The code below redoes the last undone action
4243
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4244
- * activeSpreadsheet.redo();
4371
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4372
+ * fWorkbook.redo();
4245
4373
  * ```
4246
4374
  */
4247
4375
  redo() {
4248
- return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(Xe.id), this;
4376
+ return this._univerInstanceService.focusUnit(this.id), this._commandService.syncExecuteCommand(Ze.id), this;
4249
4377
  }
4250
4378
  /**
4251
4379
  * Callback for command execution.
@@ -4259,9 +4387,9 @@ let C = class extends ce {
4259
4387
  * @example
4260
4388
  * ```ts
4261
4389
  * // The code below registers a callback that will be triggered before invoking a command targeting the Univer sheet
4262
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4263
- * activeSpreadsheet.onBeforeCommandExecute((command) => {
4264
- * console.log('Command executed:', command);
4390
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4391
+ * fWorkbook.onBeforeCommandExecute((command) => {
4392
+ * console.log('Before command execute:', command);
4265
4393
  * });
4266
4394
  * ```
4267
4395
  */
@@ -4283,8 +4411,8 @@ let C = class extends ce {
4283
4411
  * @example
4284
4412
  * ```ts
4285
4413
  * // The code below registers a callback that will be triggered when a command is invoked targeting the Univer sheet
4286
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4287
- * activeSpreadsheet.onCommandExecuted((command) => {
4414
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4415
+ * fWorkbook.onCommandExecuted((command) => {
4288
4416
  * console.log('Command executed:', command);
4289
4417
  * });
4290
4418
  * ```
@@ -4304,11 +4432,19 @@ let C = class extends ce {
4304
4432
  * Register a callback that will be triggered when the selection changes.
4305
4433
  * @param {onSelectionChangeCallback} callback The callback.
4306
4434
  * @returns {IDisposable} A function to dispose the listening
4435
+ * @example
4436
+ * ```ts
4437
+ * // The code below registers a callback that will be triggered when the selection changes
4438
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4439
+ * fWorkbook.onSelectionChange((selections) => {
4440
+ * console.log('Selection changed:', selections);
4441
+ * });
4442
+ * ```
4307
4443
  */
4308
4444
  onSelectionChange(e) {
4309
- return De(
4445
+ return Me(
4310
4446
  this._selectionManagerService.selectionMoveEnd$.subscribe((t) => {
4311
- this._univerInstanceService.getCurrentUnitForType(R.UNIVER_SHEET).getUnitId() === this.id && (t != null && t.length ? e(t.map((n) => n.range)) : e([]));
4447
+ this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET).getUnitId() === this.id && (t != null && t.length ? e(t.map((n) => n.range)) : e([]));
4312
4448
  })
4313
4449
  );
4314
4450
  }
@@ -4316,15 +4452,27 @@ let C = class extends ce {
4316
4452
  * Used to modify the editing permissions of the workbook. When the value is false, editing is not allowed.
4317
4453
  * @param {boolean} value editable value want to set
4318
4454
  * @returns {FWorkbook} FWorkbook instance
4455
+ * @example
4456
+ * ```ts
4457
+ * // The code below sets the editing permissions of the workbook
4458
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4459
+ * fWorkbook.setEditable(false);
4460
+ * ```
4319
4461
  */
4320
4462
  setEditable(e) {
4321
- const t = new Fe(this._workbook.getUnitId());
4463
+ const t = new He(this._workbook.getUnitId());
4322
4464
  return this._permissionService.getPermissionPoint(t.id) || this._permissionService.addPermissionPoint(t), this._permissionService.updatePermissionPoint(t.id, e), this;
4323
4465
  }
4324
4466
  /**
4325
4467
  * Sets the selection region for active sheet.
4326
4468
  * @param {FRange} range The range to set as the active selection.
4327
4469
  * @returns {FWorkbook} FWorkbook instance
4470
+ * @example
4471
+ * ```ts
4472
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4473
+ * const range = fWorkbook.getActiveSheet().getRange('A10:B10');
4474
+ * fWorkbook.setActiveRange(range);
4475
+ * ```
4328
4476
  */
4329
4477
  setActiveRange(e) {
4330
4478
  const t = this.getActiveSheet(), n = e.getRange().sheetId || t.getSheetId(), r = n ? this._workbook.getSheetBySheetId(n) : this._workbook.getActiveSheet(!0);
@@ -4334,13 +4482,19 @@ let C = class extends ce {
4334
4482
  const o = {
4335
4483
  unitId: this.getId(),
4336
4484
  subUnitId: n,
4337
- selections: [e].map((i) => ({ range: i.getRange(), primary: ee(i.getRange(), r), style: null }))
4485
+ selections: [e].map((i) => ({ range: i.getRange(), primary: te(i.getRange(), r), style: null }))
4338
4486
  };
4339
4487
  return this._commandService.syncExecuteCommand(Ve.id, o), this;
4340
4488
  }
4341
4489
  /**
4342
4490
  * Returns the selected range in the active sheet, or null if there is no active range.
4343
4491
  * @returns {FRange | null} The active range
4492
+ * @example
4493
+ * ```ts
4494
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4495
+ * const activeRange = fWorkbook.getActiveRange();
4496
+ * console.log(activeRange);
4497
+ * ```
4344
4498
  */
4345
4499
  // could sheet have no active range ?
4346
4500
  getActiveRange() {
@@ -4352,9 +4506,8 @@ let C = class extends ce {
4352
4506
  * @returns {boolean} true if the sheet was deleted, false otherwise
4353
4507
  * @example
4354
4508
  * ```ts
4355
- * // The code below deletes the currently active sheet and stores the new active
4356
- * // sheet in a variable
4357
- * const sheet = univerAPI.getActiveWorkbook().deleteActiveSheet();
4509
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4510
+ * fWorkbook.deleteActiveSheet();
4358
4511
  * ```
4359
4512
  */
4360
4513
  deleteActiveSheet() {
@@ -4368,13 +4521,14 @@ let C = class extends ce {
4368
4521
  * @example
4369
4522
  * ```ts
4370
4523
  * // The code below duplicates the given worksheet
4371
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4372
- * const activeSheet = activeSpreadsheet.getActiveSheet();
4373
- * activeSpreadsheet.duplicateSheet(activeSheet);
4524
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4525
+ * const activeSheet = fWorkbook.getActiveSheet();
4526
+ * const duplicatedSheet = fWorkbook.duplicateSheet(activeSheet);
4527
+ * console.log(duplicatedSheet);
4374
4528
  * ```
4375
4529
  */
4376
4530
  duplicateSheet(e) {
4377
- return this._commandService.syncExecuteCommand(Dt.id, {
4531
+ return this._commandService.syncExecuteCommand(At.id, {
4378
4532
  unitId: e.getWorkbook().getUnitId(),
4379
4533
  subUnitId: e.getSheetId()
4380
4534
  }), this._injector.createInstance(l, this, this._workbook, this._workbook.getActiveSheet());
@@ -4384,8 +4538,9 @@ let C = class extends ce {
4384
4538
  * @returns {FWorksheet} The duplicated worksheet
4385
4539
  * @example
4386
4540
  * ```ts
4387
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4388
- * activeSpreadsheet.duplicateActiveSheet();
4541
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4542
+ * const duplicatedSheet = fWorkbook.duplicateActiveSheet();
4543
+ * console.log(duplicatedSheet);
4389
4544
  * ```
4390
4545
  */
4391
4546
  duplicateActiveSheet() {
@@ -4398,8 +4553,8 @@ let C = class extends ce {
4398
4553
  * @example
4399
4554
  * ```ts
4400
4555
  * // The code below gets the number of sheets in the workbook
4401
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4402
- * const numSheets = activeSpreadsheet.getNumSheets();
4556
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4557
+ * console.log(fWorkbook.getNumSheets());
4403
4558
  * ```
4404
4559
  */
4405
4560
  getNumSheets() {
@@ -4411,15 +4566,15 @@ let C = class extends ce {
4411
4566
  * @example
4412
4567
  * ```ts
4413
4568
  * // The code below gets the locale of the workbook
4414
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4415
- * const locale = activeSpreadsheet.getLocale();
4569
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4570
+ * console.log(fWorkbook.getLocale());
4416
4571
  * ```
4417
4572
  */
4418
4573
  getLocale() {
4419
4574
  return this._localeService.getCurrentLocale();
4420
4575
  }
4421
4576
  /**
4422
- * @deprecated use setSpreadsheetLocale instead.
4577
+ * @deprecated use `setSpreadsheetLocale` instead.
4423
4578
  * @param {LocaleType} locale - The locale to set
4424
4579
  */
4425
4580
  setLocale(e) {
@@ -4432,8 +4587,9 @@ let C = class extends ce {
4432
4587
  * @example
4433
4588
  * ```ts
4434
4589
  * // The code below sets the locale of the workbook
4435
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4436
- * activeSpreadsheet.setLocale(LocaleType.EN_US);
4590
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4591
+ * fWorkbook.setSpreadsheetLocale(univerAPI.Enum.LocaleType.EN_US);
4592
+ * console.log(fWorkbook.getLocale());
4437
4593
  * ```
4438
4594
  */
4439
4595
  setSpreadsheetLocale(e) {
@@ -4445,8 +4601,9 @@ let C = class extends ce {
4445
4601
  * @example
4446
4602
  * ```ts
4447
4603
  * // The code below gets the URL of the workbook
4448
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4449
- * const url = activeSpreadsheet.getUrl();
4604
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4605
+ * const url = fWorkbook.getUrl();
4606
+ * console.log(url);
4450
4607
  * ```
4451
4608
  */
4452
4609
  getUrl() {
@@ -4460,14 +4617,14 @@ let C = class extends ce {
4460
4617
  * @example
4461
4618
  * ```ts
4462
4619
  * // The code below moves the sheet to the specified index
4463
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4464
- * const sheet = activeSpreadsheet.getActiveSheet();
4465
- * activeSpreadsheet.moveSheet(sheet, 1);
4620
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4621
+ * const sheet = fWorkbook.getActiveSheet();
4622
+ * fWorkbook.moveSheet(sheet, 1);
4466
4623
  * ```
4467
4624
  */
4468
4625
  moveSheet(e, t) {
4469
4626
  let n = t;
4470
- return n < 0 ? n = 0 : n > this._workbook.getSheets().length - 1 && (n = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(ae.id, {
4627
+ return n < 0 ? n = 0 : n > this._workbook.getSheets().length - 1 && (n = this._workbook.getSheets().length - 1), this._commandService.syncExecuteCommand(Wt.id, {
4471
4628
  unitId: e.getWorkbook().getUnitId(),
4472
4629
  order: n,
4473
4630
  subUnitId: e.getSheetId()
@@ -4480,8 +4637,8 @@ let C = class extends ce {
4480
4637
  * @example
4481
4638
  * ```ts
4482
4639
  * // The code below moves the active sheet to the specified index
4483
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4484
- * activeSpreadsheet.moveActiveSheet(1);
4640
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4641
+ * fWorkbook.moveActiveSheet(1);
4485
4642
  * ```
4486
4643
  */
4487
4644
  moveActiveSheet(e) {
@@ -4491,9 +4648,15 @@ let C = class extends ce {
4491
4648
  /**
4492
4649
  * Get the PermissionInstance.
4493
4650
  * @returns {FPermission} - The PermissionInstance.
4651
+ * @example
4652
+ * ```ts
4653
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4654
+ * const permission = fWorkbook.getPermission();
4655
+ * console.log(permission);
4656
+ * ```
4494
4657
  */
4495
4658
  getPermission() {
4496
- return this._injector.createInstance(H);
4659
+ return this._injector.createInstance(O);
4497
4660
  }
4498
4661
  /**
4499
4662
  * Get the defined name by name.
@@ -4502,13 +4665,14 @@ let C = class extends ce {
4502
4665
  * @example
4503
4666
  * ```ts
4504
4667
  * // The code below gets the defined name by name
4505
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4506
- * const definedName = activeSpreadsheet.getDefinedName('MyDefinedName');
4668
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4669
+ * const definedName = fWorkbook.getDefinedName('MyDefinedName');
4670
+ * console.log(definedName);
4507
4671
  * ```
4508
4672
  */
4509
4673
  getDefinedName(e) {
4510
4674
  const t = this._definedNamesService.getValueByName(this.id, e);
4511
- return t ? this._injector.createInstance(F, { ...t, unitId: this.id }) : null;
4675
+ return t ? this._injector.createInstance(H, { ...t, unitId: this.id }) : null;
4512
4676
  }
4513
4677
  /**
4514
4678
  * Get all the defined names in the workbook.
@@ -4516,13 +4680,14 @@ let C = class extends ce {
4516
4680
  * @example
4517
4681
  * ```ts
4518
4682
  * // The code below gets all the defined names in the workbook
4519
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4520
- * const definedNames = activeSpreadsheet.getDefinedNames();
4683
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4684
+ * const definedNames = fWorkbook.getDefinedNames();
4685
+ * console.log(definedNames);
4521
4686
  * ```
4522
4687
  */
4523
4688
  getDefinedNames() {
4524
4689
  const e = this._definedNamesService.getDefinedNameMap(this.id);
4525
- return e ? Object.values(e).map((t) => this._injector.createInstance(F, { ...t, unitId: this.id })) : [];
4690
+ return e ? Object.values(e).map((t) => this._injector.createInstance(H, { ...t, unitId: this.id })) : [];
4526
4691
  }
4527
4692
  /**
4528
4693
  * Insert a defined name.
@@ -4532,13 +4697,13 @@ let C = class extends ce {
4532
4697
  * @example
4533
4698
  * ```ts
4534
4699
  * // The code below inserts a defined name
4535
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4536
- * activeSpreadsheet.insertDefinedName('MyDefinedName', 'Sheet1!A1');
4700
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4701
+ * fWorkbook.insertDefinedName('MyDefinedName', 'Sheet1!A1');
4537
4702
  * ```
4538
4703
  */
4539
4704
  insertDefinedName(e, t) {
4540
- const r = this._injector.createInstance(O).setName(e).setRef(t).build();
4541
- return r.localSheetId = X, this.insertDefinedNameBuilder(r), this;
4705
+ const r = this._injector.createInstance(L).setName(e).setRef(t).build();
4706
+ return r.localSheetId = Z, this.insertDefinedNameBuilder(r), this;
4542
4707
  }
4543
4708
  /**
4544
4709
  * Delete the defined name with the given name.
@@ -4547,8 +4712,8 @@ let C = class extends ce {
4547
4712
  * @example
4548
4713
  * ```ts
4549
4714
  * // The code below deletes the defined name with the given name
4550
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4551
- * const deleted = activeSpreadsheet.deleteDefinedName('MyDefinedName');
4715
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4716
+ * fWorkbook.deleteDefinedName('MyDefinedName');
4552
4717
  * ```
4553
4718
  */
4554
4719
  deleteDefinedName(e) {
@@ -4562,14 +4727,17 @@ let C = class extends ce {
4562
4727
  * @example
4563
4728
  * ```ts
4564
4729
  * // The code below inserts a defined name by builder param
4565
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4566
- * const builder = univerAPI.newDefinedName();
4567
- * const param = builder.setName('MyDefinedName').setRef('Sheet1!A1').build();
4568
- * activeSpreadsheet.insertDefinedNameBuilder(param);
4730
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4731
+ * const definedNameBuilder = univerAPI.newDefinedName()
4732
+ * .setRef('Sheet1!$A$1')
4733
+ * .setName('MyDefinedName')
4734
+ * .setComment('This is a comment')
4735
+ * .build();
4736
+ * fWorkbook.insertDefinedNameBuilder(definedNameBuilder);
4569
4737
  * ```
4570
4738
  */
4571
4739
  insertDefinedNameBuilder(e) {
4572
- e.unitId = this.getId(), this._commandService.syncExecuteCommand(Q.id, e);
4740
+ e.unitId = this.getId(), this._commandService.syncExecuteCommand(X.id, e);
4573
4741
  }
4574
4742
  /**
4575
4743
  * Update the defined name with the given name.
@@ -4578,14 +4746,16 @@ let C = class extends ce {
4578
4746
  * @example
4579
4747
  * ```ts
4580
4748
  * // The code below updates the defined name with the given name
4581
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4582
- * const builder = activeSpreadsheet.getDefinedName('MyDefinedName').toBuilder();
4583
- * builder.setRef('Sheet1!A2').setName('MyDefinedName1').build();
4584
- * activeSpreadsheet.updateDefinedNameBuilder(param);
4749
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4750
+ * const definedNameBuilder = fWorkbook.getDefinedName('MyDefinedName').toBuilder();
4751
+ * const param = definedNameBuilder.setRef('Sheet1!A2')
4752
+ * .setName('NewDefinedName')
4753
+ * .build();
4754
+ * fWorkbook.updateDefinedNameBuilder(param);
4585
4755
  * ```
4586
4756
  */
4587
4757
  updateDefinedNameBuilder(e) {
4588
- this._commandService.syncExecuteCommand(Q.id, e);
4758
+ this._commandService.syncExecuteCommand(X.id, e);
4589
4759
  }
4590
4760
  /**
4591
4761
  * Gets the registered range themes.
@@ -4593,13 +4763,13 @@ let C = class extends ce {
4593
4763
  * @example
4594
4764
  * ```ts
4595
4765
  * // The code below gets the registered range themes
4596
- * const activeSpreadsheet = univerAPI.getActiveWorkbook();
4597
- * const themes = activeSpreadsheet.getRegisteredRangeThemes();
4766
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4767
+ * const themes = fWorkbook.getRegisteredRangeThemes();
4598
4768
  * console.log(themes);
4599
4769
  * ```
4600
4770
  */
4601
4771
  getRegisteredRangeThemes() {
4602
- return this._injector.get(He).getRegisteredRangeThemes();
4772
+ return this._injector.get(Oe).getRegisteredRangeThemes();
4603
4773
  }
4604
4774
  /**
4605
4775
  * Register a custom range theme style.
@@ -4609,17 +4779,18 @@ let C = class extends ce {
4609
4779
  * ```ts
4610
4780
  * // import {RangeThemeStyle} from '@univerjs/sheets';
4611
4781
  * const fWorkbook = univerAPI.getActiveWorkbook();
4612
- * const rangeThemeStyle = new RangeThemeStyle('MyTheme');
4613
- * rangeThemeStyle.setSecondRowStyle({
4614
- * bg: {
4615
- * rgb: 'rgb(214,231,241)',
4782
+ * const rangeThemeStyle = fWorkbook.createRangeThemeStyle('MyTheme', {
4783
+ * secondRowStyle: {
4784
+ * bg: {
4785
+ * rgb: 'rgb(214,231,241)',
4786
+ * },
4616
4787
  * },
4617
4788
  * });
4618
4789
  * fWorkbook.registerRangeTheme(rangeThemeStyle);
4619
4790
  * ```
4620
4791
  */
4621
4792
  registerRangeTheme(e) {
4622
- this._commandService.syncExecuteCommand(Mt.id, {
4793
+ this._commandService.syncExecuteCommand(Bt.id, {
4623
4794
  unitId: this.getId(),
4624
4795
  rangeThemeStyle: e
4625
4796
  });
@@ -4635,13 +4806,31 @@ let C = class extends ce {
4635
4806
  * ```
4636
4807
  */
4637
4808
  unregisterRangeTheme(e) {
4638
- this._commandService.syncExecuteCommand(At.id, {
4809
+ this._commandService.syncExecuteCommand(Ft.id, {
4639
4810
  unitId: this.getId(),
4640
4811
  themeName: e
4641
4812
  });
4642
4813
  }
4814
+ /**
4815
+ * Create a range theme style.
4816
+ * @param {string} themeName - The name of the theme to register
4817
+ * @param {Omit<IRangeThemeStyleJSON, 'name'>} themeStyleJson - The theme style json to register
4818
+ * @returns {RangeThemeStyle} - The created range theme style
4819
+ * @example
4820
+ * ```ts
4821
+ * const fWorkbook = univerAPI.getActiveWorkbook();
4822
+ * const rangeThemeStyle = fWorkbook.createRangeThemeStyle('MyTheme', {
4823
+ * secondRowStyle: {
4824
+ * bg: {
4825
+ * rgb: 'rgb(214,231,241)',
4826
+ * },
4827
+ * },
4828
+ * });
4829
+ * console.log(rangeThemeStyle);
4830
+ * ```
4831
+ */
4643
4832
  createRangeThemeStyle(e, t) {
4644
- return new Bt(e, t);
4833
+ return new Ht(e, t);
4645
4834
  }
4646
4835
  /**
4647
4836
  * Set custom metadata of workbook
@@ -4663,24 +4852,25 @@ let C = class extends ce {
4663
4852
  * ```ts
4664
4853
  * const fWorkbook = univerAPI.getActiveWorkbook();
4665
4854
  * const custom = fWorkbook.getCustomMetadata();
4855
+ * console.log(custom);
4666
4856
  * ```
4667
4857
  */
4668
4858
  getCustomMetadata() {
4669
4859
  return this._workbook.getCustomMetadata();
4670
4860
  }
4671
4861
  };
4672
- C = hn([
4673
- w(1, u(b)),
4674
- w(2, u(Ye)),
4675
- w(3, u(je)),
4676
- w(4, J),
4677
- w(5, m),
4678
- w(6, he),
4679
- w(7, Te),
4680
- w(8, u(xe)),
4681
- w(9, Oe)
4682
- ], C);
4683
- class dn extends Me {
4862
+ v = gn([
4863
+ C(1, u(p)),
4864
+ C(2, u(Je)),
4865
+ C(3, u(je)),
4866
+ C(4, Q),
4867
+ C(5, m),
4868
+ C(6, ie),
4869
+ C(7, De),
4870
+ C(8, u(Ne)),
4871
+ C(9, Le)
4872
+ ], v);
4873
+ class mn extends Ae {
4684
4874
  getCommandSheetTarget(e) {
4685
4875
  var o;
4686
4876
  const t = e.params;
@@ -4701,11 +4891,11 @@ class dn extends Me {
4701
4891
  return { workbook: n, worksheet: r };
4702
4892
  }
4703
4893
  _initWorkbookEvent(e) {
4704
- const t = e.get(J);
4894
+ const t = e.get(Q);
4705
4895
  this.registerEventHandler(
4706
4896
  this.Event.WorkbookDisposed,
4707
4897
  () => t.unitDisposed$.subscribe((n) => {
4708
- n.type === R.UNIVER_SHEET && this.fireEvent(
4898
+ n.type === b.UNIVER_SHEET && this.fireEvent(
4709
4899
  this.Event.WorkbookDisposed,
4710
4900
  {
4711
4901
  unitId: n.getUnitId(),
@@ -4717,8 +4907,8 @@ class dn extends Me {
4717
4907
  ), this.registerEventHandler(
4718
4908
  this.Event.WorkbookCreated,
4719
4909
  () => t.unitAdded$.subscribe((n) => {
4720
- if (n.type === R.UNIVER_SHEET) {
4721
- const r = n, o = e.createInstance(C, r);
4910
+ if (n.type === b.UNIVER_SHEET) {
4911
+ const r = n, o = e.createInstance(v, r);
4722
4912
  this.fireEvent(
4723
4913
  this.Event.WorkbookCreated,
4724
4914
  {
@@ -4742,7 +4932,7 @@ class dn extends Me {
4742
4932
  this.Event.BeforeSheetCreate,
4743
4933
  () => t.beforeCommandExecuted((n) => {
4744
4934
  var r;
4745
- if (n.id === x.id) {
4935
+ if (n.id === N.id) {
4746
4936
  const o = n.params, { unitId: i, index: a, sheet: h } = o || {}, d = i ? this.getUniverSheet(i) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
4747
4937
  if (!d)
4748
4938
  return;
@@ -4751,103 +4941,141 @@ class dn extends Me {
4751
4941
  index: a,
4752
4942
  sheet: h
4753
4943
  };
4754
- if (this.fireEvent(
4755
- this.Event.BeforeSheetCreate,
4756
- c
4757
- ), c.cancel)
4758
- throw new Ze();
4944
+ if (this.fireEvent(this.Event.BeforeSheetCreate, c), c.cancel)
4945
+ throw new w();
4759
4946
  }
4760
4947
  })
4761
4948
  ), this.registerEventHandler(
4762
4949
  this.Event.BeforeActiveSheetChange,
4763
4950
  () => t.beforeCommandExecuted((n) => {
4764
4951
  var r;
4765
- if (n.id === N.id) {
4952
+ if (n.id === T.id) {
4766
4953
  const { subUnitId: o, unitId: i } = n.params, a = i ? this.getUniverSheet(i) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
4767
4954
  if (!a || !o) return;
4768
4955
  const h = a.getSheetBySheetId(o), d = a.getActiveSheet();
4769
4956
  if (!h || !d) return;
4770
- this._fireBeforeActiveSheetChange(a, h, d);
4957
+ const c = {
4958
+ workbook: a,
4959
+ activeSheet: h,
4960
+ oldActiveSheet: d
4961
+ };
4962
+ if (this.fireEvent(this.Event.BeforeActiveSheetChange, c), c.cancel)
4963
+ throw new w();
4771
4964
  }
4772
4965
  })
4773
4966
  ), this.registerEventHandler(
4774
4967
  this.Event.BeforeSheetDelete,
4775
4968
  () => t.beforeCommandExecuted((n) => {
4776
- if (n.id === ie.id) {
4969
+ if (n.id === oe.id) {
4777
4970
  const r = this.getCommandSheetTarget(n);
4778
4971
  if (!r) return;
4779
- const { workbook: o, worksheet: i } = r;
4780
- this._fireBeforeSheetDelete(o, i);
4972
+ const { workbook: o, worksheet: i } = r, a = {
4973
+ workbook: o,
4974
+ worksheet: i
4975
+ };
4976
+ if (this.fireEvent(this.Event.BeforeSheetDelete, a), a.cancel)
4977
+ throw new w();
4781
4978
  }
4782
4979
  })
4783
4980
  ), this.registerEventHandler(
4784
4981
  this.Event.BeforeSheetMove,
4785
4982
  () => t.beforeCommandExecuted((n) => {
4786
- if (n.id === ae.id) {
4983
+ if (n.id === pe.id) {
4787
4984
  const { fromOrder: r, toOrder: o } = n.params, i = this.getCommandSheetTarget(n);
4788
4985
  if (!i) return;
4789
- this._fireBeforeSheetMove(i.workbook, i.worksheet, o, r);
4986
+ const a = {
4987
+ workbook: i.workbook,
4988
+ worksheet: i.worksheet,
4989
+ newIndex: o,
4990
+ oldIndex: r
4991
+ };
4992
+ if (this.fireEvent(this.Event.BeforeSheetMove, a), a.cancel)
4993
+ throw new w();
4790
4994
  }
4791
4995
  })
4792
4996
  ), this.registerEventHandler(
4793
4997
  this.Event.BeforeSheetNameChange,
4794
4998
  () => t.beforeCommandExecuted((n) => {
4795
- if (n.id === oe.id) {
4999
+ if (n.id === se.id) {
4796
5000
  const { name: r } = n.params, o = this.getCommandSheetTarget(n);
4797
5001
  if (!o) return;
4798
- this._fireBeforeSheetNameChange(o.workbook, o.worksheet, r, o.worksheet.getSheetName());
5002
+ const i = {
5003
+ workbook: o.workbook,
5004
+ worksheet: o.worksheet,
5005
+ newName: r,
5006
+ oldName: o.worksheet.getSheetName()
5007
+ };
5008
+ if (this.fireEvent(this.Event.BeforeSheetNameChange, i), i.cancel)
5009
+ throw new w();
4799
5010
  }
4800
5011
  })
4801
5012
  ), this.registerEventHandler(
4802
5013
  this.Event.BeforeSheetTabColorChange,
4803
5014
  () => t.beforeCommandExecuted((n) => {
4804
- if (n.id === re.id) {
5015
+ if (n.id === Ee.id) {
4805
5016
  const { color: r } = n.params, o = this.getCommandSheetTarget(n);
4806
5017
  if (!o) return;
4807
- this._fireBeforeSheetTabColorChange(o.workbook, o.worksheet, r, o.worksheet.getTabColor());
5018
+ const i = {
5019
+ workbook: o.workbook,
5020
+ worksheet: o.worksheet,
5021
+ newColor: r,
5022
+ oldColor: o.worksheet.getTabColor()
5023
+ };
5024
+ if (this.fireEvent(this.Event.BeforeSheetTabColorChange, i), i.cancel)
5025
+ throw new w();
4808
5026
  }
4809
5027
  })
4810
5028
  ), this.registerEventHandler(
4811
5029
  this.Event.BeforeSheetHideChange,
4812
5030
  () => t.beforeCommandExecuted((n) => {
4813
- if (n.id === se.id) {
5031
+ if (n.id === ye.id) {
4814
5032
  const { hidden: r } = n.params, o = this.getCommandSheetTarget(n);
4815
5033
  if (!o) return;
4816
- this._fireBeforeSheetHideChange(o.workbook, o.worksheet, !!r);
5034
+ const i = {
5035
+ workbook: o.workbook,
5036
+ worksheet: o.worksheet,
5037
+ hidden: !!r
5038
+ };
5039
+ if (this.fireEvent(this.Event.BeforeSheetHideChange, i), i.cancel)
5040
+ throw new w();
4817
5041
  }
4818
5042
  })
4819
5043
  ), this.registerEventHandler(
4820
5044
  this.Event.BeforeGridlineColorChange,
4821
5045
  () => t.beforeCommandExecuted((n) => {
4822
5046
  var r;
4823
- if (n.id === ne.id) {
5047
+ if (n.id === re.id) {
4824
5048
  const o = this.getCommandSheetTarget(n);
4825
5049
  if (!o) return;
4826
- this.fireEvent(this.Event.BeforeGridlineColorChange, {
5050
+ const i = {
4827
5051
  ...o,
4828
5052
  color: (r = n.params) == null ? void 0 : r.color
4829
- });
5053
+ };
5054
+ if (this.fireEvent(this.Event.BeforeGridlineColorChange, i), i.cancel)
5055
+ throw new w();
4830
5056
  }
4831
5057
  })
4832
5058
  ), this.registerEventHandler(
4833
5059
  this.Event.BeforeGridlineEnableChange,
4834
5060
  () => t.beforeCommandExecuted((n) => {
4835
5061
  var r;
4836
- if (n.id === te.id) {
5062
+ if (n.id === ne.id) {
4837
5063
  const o = this.getCommandSheetTarget(n);
4838
5064
  if (!o) return;
4839
- this.fireEvent(this.Event.BeforeGridlineEnableChange, {
5065
+ const i = {
4840
5066
  ...o,
4841
5067
  enabled: !!((r = n.params) != null && r.showGridlines)
4842
- });
5068
+ };
5069
+ if (this.fireEvent(this.Event.BeforeGridlineEnableChange, i), i.cancel)
5070
+ throw new w();
4843
5071
  }
4844
5072
  })
4845
5073
  ), this.registerEventHandler(
4846
5074
  this.Event.SheetValueChanged,
4847
5075
  () => t.onCommandExecuted((n) => {
4848
- if (Wt.indexOf(n.id) > -1) {
5076
+ if (Ot.indexOf(n.id) > -1) {
4849
5077
  if (!this.getActiveSheet()) return;
4850
- const o = Ft(n).map(
5078
+ const o = Vt(n).map(
4851
5079
  (i) => {
4852
5080
  var a, h;
4853
5081
  return (h = (a = this.getWorkbook(i.unitId)) == null ? void 0 : a.getSheetBySheetId(i.subUnitId)) == null ? void 0 : h.getRange(i.range);
@@ -4864,7 +5092,7 @@ class dn extends Me {
4864
5092
  this.Event.SheetCreated,
4865
5093
  () => t.onCommandExecuted((n) => {
4866
5094
  var r;
4867
- if (n.id === x.id) {
5095
+ if (n.id === N.id) {
4868
5096
  const o = n.params, { unitId: i } = o || {}, a = i ? this.getUniverSheet(i) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
4869
5097
  if (!a)
4870
5098
  return;
@@ -4884,7 +5112,7 @@ class dn extends Me {
4884
5112
  ), this.registerEventHandler(
4885
5113
  this.Event.ActiveSheetChanged,
4886
5114
  () => t.onCommandExecuted((n) => {
4887
- if (n.id === N.id) {
5115
+ if (n.id === T.id) {
4888
5116
  const r = this.getActiveSheet();
4889
5117
  if (!r) return;
4890
5118
  const { workbook: o, worksheet: i } = r;
@@ -4895,7 +5123,7 @@ class dn extends Me {
4895
5123
  this.Event.SheetDeleted,
4896
5124
  () => t.onCommandExecuted((n) => {
4897
5125
  var r;
4898
- if (n.id === ie.id) {
5126
+ if (n.id === oe.id) {
4899
5127
  const { subUnitId: o, unitId: i } = n.params, a = i ? this.getUniverSheet(i) : (r = this.getActiveWorkbook) == null ? void 0 : r.call(this);
4900
5128
  if (!a || !o) return;
4901
5129
  this._fireSheetDeleted(a, o);
@@ -4904,7 +5132,7 @@ class dn extends Me {
4904
5132
  ), this.registerEventHandler(
4905
5133
  this.Event.SheetMoved,
4906
5134
  () => t.onCommandExecuted((n) => {
4907
- if (n.id === ae.id) {
5135
+ if (n.id === pe.id) {
4908
5136
  const { toOrder: r } = n.params, o = this.getCommandSheetTarget(n);
4909
5137
  if (!o) return;
4910
5138
  this._fireSheetMoved(o.workbook, o.worksheet, r);
@@ -4913,7 +5141,7 @@ class dn extends Me {
4913
5141
  ), this.registerEventHandler(
4914
5142
  this.Event.SheetNameChanged,
4915
5143
  () => t.onCommandExecuted((n) => {
4916
- if (n.id === oe.id) {
5144
+ if (n.id === se.id) {
4917
5145
  const { name: r } = n.params, o = this.getCommandSheetTarget(n);
4918
5146
  if (!o) return;
4919
5147
  this._fireSheetNameChanged(o.workbook, o.worksheet, r);
@@ -4922,7 +5150,7 @@ class dn extends Me {
4922
5150
  ), this.registerEventHandler(
4923
5151
  this.Event.SheetTabColorChanged,
4924
5152
  () => t.onCommandExecuted((n) => {
4925
- if (n.id === re.id) {
5153
+ if (n.id === Ee.id) {
4926
5154
  const { color: r } = n.params, o = this.getCommandSheetTarget(n);
4927
5155
  if (!o) return;
4928
5156
  this._fireSheetTabColorChanged(o.workbook, o.worksheet, r);
@@ -4931,7 +5159,7 @@ class dn extends Me {
4931
5159
  ), this.registerEventHandler(
4932
5160
  this.Event.SheetHideChanged,
4933
5161
  () => t.onCommandExecuted((n) => {
4934
- if (n.id === se.id) {
5162
+ if (n.id === ye.id) {
4935
5163
  const { hidden: r } = n.params, o = this.getCommandSheetTarget(n);
4936
5164
  if (!o) return;
4937
5165
  this._fireSheetHideChanged(o.workbook, o.worksheet, !!r);
@@ -4940,7 +5168,7 @@ class dn extends Me {
4940
5168
  ), this.registerEventHandler(
4941
5169
  this.Event.GridlineChanged,
4942
5170
  () => t.onCommandExecuted((n) => {
4943
- if (n.id === ne.id || n.id === te.id) {
5171
+ if (n.id === re.id || n.id === ne.id) {
4944
5172
  const r = this.getCommandSheetTarget(n);
4945
5173
  if (!r) return;
4946
5174
  this.fireEvent(this.Event.GridlineChanged, {
@@ -4953,38 +5181,38 @@ class dn extends Me {
4953
5181
  ), this._initWorkbookEvent(e);
4954
5182
  }
4955
5183
  createUniverSheet(e, t) {
4956
- const r = this._injector.get(J).createUnit(R.UNIVER_SHEET, e, t);
4957
- return this._injector.createInstance(C, r);
5184
+ const r = this._injector.get(Q).createUnit(b.UNIVER_SHEET, e, t);
5185
+ return this._injector.createInstance(v, r);
4958
5186
  }
4959
5187
  createWorkbook(e, t) {
4960
5188
  return this.createUniverSheet(e, t);
4961
5189
  }
4962
5190
  getActiveWorkbook() {
4963
- const e = this._univerInstanceService.getCurrentUnitForType(R.UNIVER_SHEET);
4964
- return e ? this._injector.createInstance(C, e) : null;
5191
+ const e = this._univerInstanceService.getCurrentUnitForType(b.UNIVER_SHEET);
5192
+ return e ? this._injector.createInstance(v, e) : null;
4965
5193
  }
4966
5194
  getActiveUniverSheet() {
4967
5195
  return this.getActiveWorkbook();
4968
5196
  }
4969
5197
  getUniverSheet(e) {
4970
- const t = this._univerInstanceService.getUnit(e, R.UNIVER_SHEET);
4971
- return t ? this._injector.createInstance(C, t) : null;
5198
+ const t = this._univerInstanceService.getUnit(e, b.UNIVER_SHEET);
5199
+ return t ? this._injector.createInstance(v, t) : null;
4972
5200
  }
4973
5201
  getWorkbook(e) {
4974
5202
  return this.getUniverSheet(e);
4975
5203
  }
4976
5204
  getPermission() {
4977
- return this._injector.createInstance(H);
5205
+ return this._injector.createInstance(O);
4978
5206
  }
4979
5207
  onUniverSheetCreated(e) {
4980
- const t = this._univerInstanceService.getTypeOfUnitAdded$(R.UNIVER_SHEET).subscribe((n) => {
4981
- const r = this._injector.createInstance(C, n);
5208
+ const t = this._univerInstanceService.getTypeOfUnitAdded$(b.UNIVER_SHEET).subscribe((n) => {
5209
+ const r = this._injector.createInstance(v, n);
4982
5210
  e(r);
4983
5211
  });
4984
- return De(t);
5212
+ return Me(t);
4985
5213
  }
4986
5214
  newDefinedName() {
4987
- return this._injector.createInstance(O);
5215
+ return this._injector.createInstance(L);
4988
5216
  }
4989
5217
  getActiveSheet() {
4990
5218
  const e = this.getActiveWorkbook();
@@ -4993,39 +5221,18 @@ class dn extends Me {
4993
5221
  const t = e.getActiveSheet();
4994
5222
  return t ? { workbook: e, worksheet: t } : null;
4995
5223
  }
4996
- _fireBeforeActiveSheetChange(e, t, n) {
4997
- this.fireEvent(this.Event.BeforeActiveSheetChange, {
4998
- workbook: e,
4999
- activeSheet: t,
5000
- oldActiveSheet: n
5001
- });
5002
- }
5003
5224
  _fireActiveSheetChanged(e, t) {
5004
5225
  this.fireEvent(this.Event.ActiveSheetChanged, {
5005
5226
  workbook: e,
5006
5227
  activeSheet: t
5007
5228
  });
5008
5229
  }
5009
- _fireBeforeSheetDelete(e, t) {
5010
- this.fireEvent(this.Event.BeforeSheetDelete, {
5011
- workbook: e,
5012
- worksheet: t
5013
- });
5014
- }
5015
5230
  _fireSheetDeleted(e, t) {
5016
5231
  this.fireEvent(this.Event.SheetDeleted, {
5017
5232
  workbook: e,
5018
5233
  sheetId: t
5019
5234
  });
5020
5235
  }
5021
- _fireBeforeSheetMove(e, t, n, r) {
5022
- this.fireEvent(this.Event.BeforeSheetMove, {
5023
- workbook: e,
5024
- worksheet: t,
5025
- newIndex: n,
5026
- oldIndex: r
5027
- });
5028
- }
5029
5236
  _fireSheetMoved(e, t, n) {
5030
5237
  this.fireEvent(this.Event.SheetMoved, {
5031
5238
  workbook: e,
@@ -5033,14 +5240,6 @@ class dn extends Me {
5033
5240
  newIndex: n
5034
5241
  });
5035
5242
  }
5036
- _fireBeforeSheetNameChange(e, t, n, r) {
5037
- this.fireEvent(this.Event.BeforeSheetNameChange, {
5038
- workbook: e,
5039
- worksheet: t,
5040
- newName: n,
5041
- oldName: r
5042
- });
5043
- }
5044
5243
  _fireSheetNameChanged(e, t, n) {
5045
5244
  this.fireEvent(this.Event.SheetNameChanged, {
5046
5245
  workbook: e,
@@ -5048,14 +5247,6 @@ class dn extends Me {
5048
5247
  newName: n
5049
5248
  });
5050
5249
  }
5051
- _fireBeforeSheetTabColorChange(e, t, n, r) {
5052
- this.fireEvent(this.Event.BeforeSheetTabColorChange, {
5053
- workbook: e,
5054
- worksheet: t,
5055
- newColor: n,
5056
- oldColor: r
5057
- });
5058
- }
5059
5250
  _fireSheetTabColorChanged(e, t, n) {
5060
5251
  this.fireEvent(this.Event.SheetTabColorChanged, {
5061
5252
  workbook: e,
@@ -5063,13 +5254,6 @@ class dn extends Me {
5063
5254
  newColor: n
5064
5255
  });
5065
5256
  }
5066
- _fireBeforeSheetHideChange(e, t, n) {
5067
- this.fireEvent(this.Event.BeforeSheetHideChange, {
5068
- workbook: e,
5069
- worksheet: t,
5070
- hidden: n
5071
- });
5072
- }
5073
5257
  _fireSheetHideChanged(e, t, n) {
5074
5258
  this.fireEvent(this.Event.SheetHideChanged, {
5075
5259
  workbook: e,
@@ -5078,17 +5262,20 @@ class dn extends Me {
5078
5262
  });
5079
5263
  }
5080
5264
  }
5081
- Me.extend(dn);
5082
- class cn {
5265
+ Ae.extend(mn);
5266
+ class ln {
5083
5267
  get SheetValueChangeType() {
5084
- return Ht;
5268
+ return jt;
5085
5269
  }
5086
5270
  get SheetSkeletonChangeType() {
5087
- return Vt;
5271
+ return Lt;
5272
+ }
5273
+ get SplitDelimiterType() {
5274
+ return zt;
5088
5275
  }
5089
5276
  }
5090
- et.extend(cn);
5091
- class un {
5277
+ et.extend(ln);
5278
+ class _n {
5092
5279
  get SheetCreated() {
5093
5280
  return "SheetCreated";
5094
5281
  }
@@ -5150,27 +5337,27 @@ class un {
5150
5337
  return "SheetValueChanged";
5151
5338
  }
5152
5339
  }
5153
- tt.extend(un);
5154
- var gn = Object.getOwnPropertyDescriptor, mn = (s, e, t, n) => {
5155
- for (var r = n > 1 ? void 0 : n ? gn(e, t) : e, o = s.length - 1, i; o >= 0; o--)
5340
+ tt.extend(_n);
5341
+ var kn = Object.getOwnPropertyDescriptor, wn = (s, e, t, n) => {
5342
+ for (var r = n > 1 ? void 0 : n ? kn(e, t) : e, o = s.length - 1, i; o >= 0; o--)
5156
5343
  (i = s[o]) && (r = i(r) || r);
5157
5344
  return r;
5158
- }, ln = (s, e) => (t, n) => e(t, n, s);
5159
- let Ue = class extends de {
5345
+ }, Sn = (s, e) => (t, n) => e(t, n, s);
5346
+ let Pe = class extends ae {
5160
5347
  constructor(s) {
5161
5348
  super(), this._injector = s;
5162
5349
  }
5163
5350
  };
5164
- Ue = mn([
5165
- ln(0, u(b))
5166
- ], Ue);
5351
+ Pe = wn([
5352
+ Sn(0, u(p))
5353
+ ], Pe);
5167
5354
  export {
5168
- H as FPermission,
5355
+ O as FPermission,
5169
5356
  k as FRange,
5170
5357
  j as FSelection,
5171
- un as FSheetEventName,
5172
- Ue as FSheetHooks,
5173
- cn as FSheetsEnum,
5174
- C as FWorkbook,
5358
+ _n as FSheetEventName,
5359
+ Pe as FSheetHooks,
5360
+ ln as FSheetsEnum,
5361
+ v as FWorkbook,
5175
5362
  l as FWorksheet
5176
5363
  };